/* ===== LIZETTE DESIGN SYSTEM ===== */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg-base: #0b1120;
    --bg-card: #0f172a;
    --bg-surface: #1e293b;
    --border: rgba(148,163,184,0.08);
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #6366f1;
    --accent-light: #818cf8;
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
    --sidebar-width: 240px;
}

body {
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.2s ease;
}

.sidebar-header {
    padding: 20px 16px;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-logo-text {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease;
    position: relative;
}

.nav-link:hover {
    background: rgba(148,163,184,0.06);
    color: var(--text-primary);
}

.nav-link.active {
    background: rgba(99,102,241,0.12);
    color: var(--accent-light);
}

.nav-link .nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-badge {
    position: absolute;
    top: 6px;
    left: 30px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: var(--danger);
    color: white;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
    70% { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
    100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}

@keyframes pulse-ring-green {
    0% { box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
    70% { box-shadow: 0 0 0 8px rgba(34,197,94,0); }
    100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-avatar {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(99,102,241,0.2);
    color: var(--accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
}

.sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.sidebar-user-role {
    font-size: 11px;
    color: var(--text-muted);
}

.btn-logout {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 0;
    margin-top: 8px;
    font-family: inherit;
}

.btn-logout:hover {
    color: var(--danger);
}

/* ===== MOBILE SIDEBAR ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 99;
}

.mobile-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
}

.menu-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 0 32px 32px;
    min-height: 100vh;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 28px 0 24px;
}

.page-title {
    font-size: 26px;
    font-weight: 700;
    color: #f1f5f9;
    letter-spacing: -0.02em;
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--success);
    font-weight: 500;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse-ring-green 2s infinite;
}

.section-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===== STATS ===== */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1;
    color: var(--text-primary);
}

.stat-value.alert { color: var(--danger); }
.stat-value.success { color: var(--success); }
.stat-value.info { color: var(--accent); }
.stat-value.confirmed { color: var(--danger); }
.stat-value.dismissed { color: var(--success); }

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.15s, transform 0.1s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn:hover { opacity: 0.85; }
.btn:active { transform: scale(0.98); }

.btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
}

.btn-secondary {
    background: transparent;
    border: 1px solid rgba(148,163,184,0.2);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    border-color: rgba(148,163,184,0.4);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-confirmed {
    background: rgba(239,68,68,0.15);
    color: #f87171;
}

.badge-dismissed {
    background: rgba(148,163,184,0.1);
    color: var(--text-secondary);
}

.badge-pending {
    background: rgba(245,158,11,0.15);
    color: #fbbf24;
}

/* ===== FILTERS ===== */
.filters {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 13px;
}

.filter-group select,
.filter-group input {
    padding: 8px 12px;
    border: 1px solid rgba(148,163,184,0.15);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    outline: none;
}

.filter-group select:focus,
.filter-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.filter-group input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.7);
}

/* ===== TABLES ===== */
.table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal.active { display: flex; }

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    max-width: 500px;
    width: 90%;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.modal img {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 16px;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 30px;
    color: white;
    cursor: pointer;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.modal-actions .btn {
    flex: 1;
}

/* ===== EMPTY / LOADING STATES ===== */
.no-alerts, .empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    grid-column: 1 / -1;
}

.no-alerts-icon, .empty-state-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.refresh-info {
    text-align: center;
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 13px;
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 14px;
    border: 1px solid rgba(148,163,184,0.15);
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    transition: all 0.15s;
}

.pagination button:hover {
    border-color: rgba(148,163,184,0.3);
    color: var(--text-primary);
}

.pagination button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination button.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,0.5);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .mobile-bar {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        padding: 0 16px 24px;
    }

    .stats-bar {
        grid-template-columns: 1fr 1fr;
    }

    .top-bar {
        padding: 16px 0;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
    }
}