/* ═══════════════════════════════════════════════════════════════════════════
   Sentinel — Security Dashboard
   Theme: Warm Cream — soft, easy on the eyes, night-friendly
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ── Reset ─────────────────────────────────────────────────────────────────── */

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

:root {
    /* Surface — warm cream palette */
    --bg-root: #F8F7F4;
    --bg-surface: #FFFFFF;
    --bg-surface-hover: #FDFCFA;
    --bg-elevated: rgba(255,254,252,0.92);
    --bg-muted: #F5F3EF;
    --bg-inset: #F0EDE8;

    /* Borders — warm gray */
    --border: #E8E5DF;
    --border-light: #EFECEA;
    --border-focus: #5B6ABF;

    /* Primary — muted indigo */
    --primary: #5B6ABF;
    --primary-hover: #4E5CA8;
    --primary-light: #EEEDF8;
    --primary-subtle: rgba(91,106,191,0.07);
    --primary-glow: rgba(91,106,191,0.18);

    /* Semantic — muted, warm tones */
    --success: #5A9E6F;
    --success-light: #EFF7F1;
    --success-border: #B5D6BE;
    --success-glow: rgba(90,158,111,0.2);

    --warning: #C4933F;
    --warning-light: #FBF6ED;
    --warning-border: #E8D5A8;

    --danger: #C45B5B;
    --danger-light: #FAF0F0;
    --danger-border: #E4BABA;
    --danger-glow: rgba(196,91,91,0.2);

    --info: #5B8EC4;
    --info-light: #EFF4FA;
    --info-border: #B8D0E8;

    /* Text — warm, never pure black */
    --text-primary: #2D2A26;
    --text-secondary: #6B6560;
    --text-tertiary: #8A8478;
    --text-inverse: #FFFEFA;

    /* Elevation — warm, subtle shadows */
    --shadow-xs: 0 1px 2px rgba(45,42,38,0.04);
    --shadow-sm: 0 1px 3px rgba(45,42,38,0.06), 0 4px 12px rgba(45,42,38,0.03);
    --shadow-md: 0 2px 6px rgba(45,42,38,0.06), 0 8px 24px rgba(45,42,38,0.04);
    --shadow-lg: 0 4px 12px rgba(45,42,38,0.07), 0 16px 40px rgba(45,42,38,0.05);
    --shadow-xl: 0 8px 24px rgba(45,42,38,0.10), 0 24px 48px rgba(45,42,38,0.06);
    --shadow-glow-primary: 0 0 20px rgba(91,106,191,0.12);
    --shadow-glow-success: 0 0 12px rgba(90,158,111,0.15);

    /* Radius — softer */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;
    --radius-full: 9999px;

    /* Fonts */
    --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 150ms;
    --duration: 200ms;
    --duration-slow: 350ms;
}

html {
    font-size: 15px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-root);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.hidden { display: none !important; }

/* ── Animations ────────────────────────────────────────────────────────────── */

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 0 0 rgba(90,158,111,0.4); }
    50% { box-shadow: 0 0 0 6px rgba(90,158,111,0); }
}

@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 0 0 rgba(196,91,91,0.4); }
    50% { box-shadow: 0 0 0 6px rgba(196,91,91,0); }
}

@keyframes pulse-amber {
    0%, 100% { box-shadow: 0 0 0 0 rgba(196,147,63,0.35); }
    50% { box-shadow: 0 0 0 5px rgba(196,147,63,0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-16px); max-height: 0; }
    to { opacity: 1; transform: translateY(0); max-height: 200px; }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes flashGreen {
    0% { background-color: rgba(90,158,111,0.15); }
    100% { background-color: transparent; }
}

@keyframes flashAmber {
    0% { background-color: rgba(196,147,63,0.12); }
    100% { background-color: transparent; }
}

@keyframes countPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

@keyframes toastIn {
    from { transform: translateX(110%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(110%); opacity: 0; }
}

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 15px rgba(91,106,191,0.2), 0 0 30px rgba(91,106,191,0.1); }
    50% { box-shadow: 0 0 20px rgba(91,106,191,0.35), 0 0 40px rgba(91,106,191,0.15); }
}

@keyframes tabSlide {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

.flash-green { animation: flashGreen 1s var(--ease-out); }
.flash-amber { animation: flashAmber 1s var(--ease-out); }
.animate-in { animation: fadeInUp 0.4s var(--ease-out) both; }
.slide-down-in { animation: slideDown 0.35s var(--ease-out) both; }

/* ═══════════════════════════════════════════════════════════════════════════
   LOGIN
   ═══════════════════════════════════════════════════════════════════════════ */

#login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #f8f9fc 0%, #eef2ff 50%, #f0f1fe 100%);
    position: relative;
    overflow: hidden;
}

#login-screen::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(91,106,191,0.06) 0%, transparent 70%);
    top: -200px;
    right: -100px;
}

#login-screen::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99,102,241,0.05) 0%, transparent 70%);
    bottom: -150px;
    left: -100px;
}

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-root), var(--bg-muted));
}

.login-container {
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 3rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255,255,255,0.8) inset;
    border: 1px solid rgba(228,231,239,0.6);
    width: 100%;
    max-width: 400px;
    margin: 1rem;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s var(--ease-out);
}

.login-logo {
    text-align: center;
    margin-bottom: 2.5rem;
}

.shield-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.25rem;
    background: linear-gradient(135deg, #5B6ABF, #7580CC);
    border-radius: 18px;
    position: relative;
    box-shadow: 0 8px 24px rgba(91,106,191,0.25);
    transform: rotate(-3deg);
}

.shield-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 26px;
    height: 30px;
    background: white;
    clip-path: polygon(50% 0%, 100% 15%, 100% 60%, 50% 100%, 0% 60%, 0% 15%);
}

.shield-icon-sm {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #5B6ABF, #7580CC);
    border-radius: 8px;
    position: relative;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(91,106,191,0.2);
}

.shield-icon-sm::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 13px;
    height: 15px;
    background: white;
    clip-path: polygon(50% 0%, 100% 15%, 100% 60%, 50% 100%, 0% 60%, 0% 15%);
}

.login-logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.login-logo p {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    margin-top: 0.35rem;
    font-weight: 400;
}

.input-group {
    margin-bottom: 1.25rem;
}

.input-group input,
.input-lg {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: var(--font-sans);
    transition: all var(--duration) var(--ease-out);
    background: var(--bg-surface);
    color: var(--text-primary);
}

.input-group input:focus,
.input-lg:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-subtle);
}

.input-group input::placeholder,
.input-lg::placeholder {
    color: var(--text-tertiary);
}

.error-msg {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 0.75rem;
    text-align: center;
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 1.1rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 550;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all var(--duration) var(--ease-out);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: linear-gradient(135deg, #5B6ABF, #7580CC);
    color: white;
    box-shadow: 0 2px 8px rgba(91,106,191,0.25);
}
.btn-primary:hover {
    box-shadow: 0 4px 16px rgba(91,106,191,0.35);
    transform: translateY(-1px);
}
.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover {
    background: var(--bg-muted);
    color: var(--text-primary);
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-full { width: 100%; padding: 0.8rem; font-size: 0.95rem; }

.btn-success {
    background: linear-gradient(135deg, #5A9E6F, #6DAF80);
    color: white;
    box-shadow: 0 2px 8px rgba(90,158,111,0.25);
}
.btn-success:hover { box-shadow: 0 4px 14px rgba(90,158,111,0.35); }

.btn-danger {
    background: linear-gradient(135deg, #C45B5B, #D07070);
    color: white;
}

.btn-outline {
    background: var(--bg-surface);
    border: 1.5px solid var(--border);
    color: var(--text-secondary);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.btn-ai {
    background: linear-gradient(135deg, #5B6ABF, #7B6EB5, #7580CC);
    background-size: 200% 200%;
    color: white;
    box-shadow: 0 4px 15px rgba(91,106,191,0.3);
    animation: glowPulse 3s ease-in-out infinite;
    font-weight: 600;
    letter-spacing: 0.01em;
}
.btn-ai:hover {
    box-shadow: 0 6px 25px rgba(91,106,191,0.45);
    transform: translateY(-2px);
}

.btn .spinner-inline {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.5s linear infinite;
    flex-shrink: 0;
}

.btn-outline .spinner-inline {
    border-color: rgba(91,106,191,0.2);
    border-top-color: var(--primary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SIDEBAR NAVIGATION
   ═══════════════════════════════════════════════════════════════════════════ */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 220px;
    height: 100vh;
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: transform 0.3s var(--ease-out), width 0.25s var(--ease-out);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0 1rem;
    height: 60px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
    text-decoration: none;
    color: inherit;
}

.sidebar-logo {
    font-size: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: linear-gradient(135deg, #5B6ABF, #7580CC);
    color: white;
    box-shadow: 0 4px 12px rgba(91,106,191,0.25);
    flex-shrink: 0;
}

.sidebar-title {
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.2px;
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.625rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    height: 44px;
    padding: 0 0 0 calc(1rem - 3px);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
    border-left: 3px solid transparent;
    margin: 1px 0;
}

.nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-root);
}

.nav-item.active {
    color: var(--primary);
    font-weight: 600;
    background: var(--bg-muted);
    border-left-color: var(--primary);
}

.nav-icon {
    width: 22px;
    text-align: center;
    font-size: 18px;
    flex-shrink: 0;
    opacity: 0.85;
}

.nav-item.active .nav-icon { opacity: 1; }

.sidebar-footer {
    padding: 0.9rem 1rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    flex: 1;
}

.sidebar-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5B6ABF, #7580CC);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(91,106,191,0.2);
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.sidebar-username {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

.sidebar-role {
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.12rem 0.5rem;
    border-radius: var(--radius-full);
    align-self: flex-start;
    line-height: 1.4;
}

.sidebar-role.admin { background: var(--primary); color: white; }
.sidebar-role.viewer { background: var(--text-tertiary); color: white; }

.sidebar-actions {
    display: flex;
    gap: 0.25rem;
}

.btn-icon {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-light);
    background: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-tertiary);
    font-size: 1rem;
    transition: all var(--duration-fast);
}

.btn-icon:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-subtle); }

.sidebar-toggle {
    display: none;
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 250;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

/* ═══════════════════════════════════════════════════════════════════════════
   MAIN CONTENT AREA
   ═══════════════════════════════════════════════════════════════════════════ */

.main-content {
    margin-left: 220px;
    min-height: 100vh;
    padding: 2rem 2.5rem 2.5rem;
    max-width: 1580px;
    animation: pageEnter 0.25s var(--ease-out) both;
}

@keyframes pageEnter {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.page-header h1 {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.settings-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    margin: 1.5rem 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-light);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.checkbox-label input { accent-color: var(--primary); }

.disabled-viewer {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    font-family: var(--font-mono);
    background: linear-gradient(135deg, #C45B5B, #D07070);
    color: white;
    margin-left: 0.4rem;
    box-shadow: 0 2px 6px rgba(196,91,91,0.3);
}

.badge:empty { display: none; }

/* ═══════════════════════════════════════════════════════════════════════════
   SERVER CARDS
   ═══════════════════════════════════════════════════════════════════════════ */

.server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 1.5rem;
}

.server-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: none;
    overflow: hidden;
    transition: transform var(--duration) var(--ease-out), box-shadow var(--duration) var(--ease-out);
    animation: fadeInUp 0.5s var(--ease-out) both;
}

.server-card:nth-child(2) { animation-delay: 0.08s; }
.server-card:nth-child(3) { animation-delay: 0.16s; }

.server-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.35rem;
    background: linear-gradient(135deg, rgba(248,247,244,0.5), rgba(245,243,239,0.3));
    border-bottom: 1px solid var(--border-light);
}

.card-server-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.card-server-name {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.card-server-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-server-ip {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    font-weight: 500;
}

.card-server-os {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    padding: 0.1rem 0.45rem;
    background: var(--bg-muted);
    border-radius: var(--radius-sm);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-tertiary);
    flex-shrink: 0;
    transition: all var(--duration) var(--ease-out);
}

.status-dot.online {
    background: var(--success);
    animation: pulse-green 2s ease-in-out infinite;
}

.status-dot.warning {
    background: var(--warning);
    animation: pulse-amber 2s ease-in-out infinite;
}

.status-dot.error {
    background: var(--danger);
    animation: pulse-red 1.5s ease-in-out infinite;
}

.status-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
}

.status-label.online { color: var(--success); }
.status-label.warning { color: var(--warning); }
.status-label.error { color: var(--danger); }

.card-body {
    padding: 1.1rem 1.35rem;
}

/* Metrics grid */
.card-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.metric {
    padding: 0.75rem 0.85rem;
    background: var(--bg-muted);
    border-radius: var(--radius);
    transition: background var(--duration) var(--ease-out);
    position: relative;
    overflow: hidden;
}

.metric-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.metric-label .metric-icon {
    width: 12px;
    height: 12px;
    opacity: 0.5;
}

.metric-value {
    font-size: 1.2rem;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text-primary);
    line-height: 1.2;
    transition: color var(--duration) var(--ease-out);
}

.metric-value.success { color: var(--success); }
.metric-value.warning { color: var(--warning); }
.metric-value.danger { color: var(--danger); }

.metric-sub {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    margin-top: 0.15rem;
}

/* Progress bar for disk/memory */
.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--border-light);
    border-radius: 2px;
    margin-top: 0.45rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.8s var(--ease-out);
    background: linear-gradient(90deg, var(--success), #5A9E6F);
}

.progress-fill.warning {
    background: linear-gradient(90deg, var(--warning), #FBBF24);
}

.progress-fill.danger {
    background: linear-gradient(90deg, var(--danger), #F87171);
}

/* WireGuard peers indicator */
.wg-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wg-dots {
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
    max-width: 80px;
}

.wg-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--success);
    opacity: 0.6;
}

.wg-count {
    font-size: 1.2rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

/* Services */
.card-services {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.85rem;
}

.service-tag {
    padding: 0.2rem 0.6rem;
    background: var(--primary-subtle);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: all var(--duration-fast);
}

.service-tag:hover {
    background: var(--primary-light);
}

/* Alert summary badges */
.card-alerts-summary {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.85rem;
}

.alert-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.22rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

.alert-count-badge.critical {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}
.alert-count-badge.high {
    background: var(--warning-light);
    color: #C4933F;
    border: 1px solid #FECDD3;
}
.alert-count-badge.medium {
    background: var(--warning-light);
    color: #C4933F;
    border: 1px solid var(--warning-border);
}
.alert-count-badge.low {
    background: var(--info-light);
    color: var(--info);
    border: 1px solid var(--info-border);
}

/* Scan timestamps */
.card-scan-times {
    padding: 0.65rem 1.35rem;
    display: flex;
    gap: 1.1rem;
    flex-wrap: wrap;
    border-top: 1px solid var(--border-light);
    background: rgba(248,249,252,0.4);
}

.scan-time {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.scan-time-type {
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.05em;
}

.scan-time-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--success);
}

/* Card footer / actions */
.card-footer {
    display: flex;
    gap: 0.5rem;
    padding: 0.85rem 1.35rem;
    border-top: 1px solid var(--border-light);
    background: rgba(248,249,252,0.3);
}

.card-footer .btn {
    flex: 1;
    min-width: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════════════════════════════════════ */

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.section-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.toggle-label input[type="checkbox"] {
    appearance: none;
    width: 36px;
    height: 20px;
    background: var(--border);
    border-radius: var(--radius-full);
    position: relative;
    cursor: pointer;
    transition: background var(--duration) var(--ease-out);
}

.toggle-label input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    box-shadow: var(--shadow-xs);
    transition: transform var(--duration) var(--ease-out);
}

.toggle-label input[type="checkbox"]:checked {
    background: var(--primary);
}

.toggle-label input[type="checkbox"]:checked::after {
    transform: translateX(16px);
}

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.alert-item {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem 1.25rem;
    background: var(--bg-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border-light);
    border-left: 3px solid var(--text-tertiary);
    transition: all var(--duration) var(--ease-out);
    animation: fadeInUp 0.35s var(--ease-out) both;
}

.alert-item:hover {
    box-shadow: var(--shadow-sm);
}

.alert-item.critical { border-left-color: var(--danger); background: rgba(196,91,91,0.04); }
.alert-item.high { border-left-color: var(--warning); background: rgba(196,147,63,0.04); }
.alert-item.medium { border-left-color: var(--info); background: rgba(91,142,196,0.04); }
.alert-item.low { border-left-color: var(--text-tertiary); background: rgba(138,132,120,0.03); }

.alert-item.acknowledged {
    opacity: 0.5;
    border-left-color: var(--border) !important;
    background: var(--bg-surface) !important;
}

/* Expandable alert row */
.alert-item { cursor: pointer; position: relative; }

.alert-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--text-tertiary);
    transition: transform var(--duration) var(--ease-out);
    font-size: 0.7rem;
    align-self: center;
}

.alert-item.expanded .alert-chevron {
    transform: rotate(90deg);
    color: var(--primary);
}

/* Detail panel */
.alert-detail-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s var(--ease-out), opacity 0.3s;
    opacity: 0;
    background: linear-gradient(135deg, #F8F7F4 0%, #F5F3EF 100%);
    border-radius: 0 0 var(--radius) var(--radius);
    margin: -0.25rem 0 0.5rem 0;
    border: 1px solid var(--border-light);
    border-top: none;
}

.alert-detail-panel.open {
    max-height: 2000px;
    opacity: 1;
    padding: 1.25rem;
}

.detail-section {
    margin-bottom: 1.25rem;
}

.detail-section:last-child { margin-bottom: 0; }

.detail-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary);
    margin-bottom: 0.6rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid rgba(91,106,191,0.1);
}

/* IP table in detail panel */
.detail-ip-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    margin-top: 0.35rem;
}

.detail-ip-table th {
    text-align: left;
    padding: 0.45rem 0.6rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-tertiary);
    background: rgba(255,255,255,0.6);
    border-bottom: 1px solid var(--border-light);
}

.detail-ip-table td {
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid rgba(228,231,239,0.5);
    vertical-align: middle;
}

.detail-ip-table tr:last-child td { border-bottom: none; }

.detail-ip-table .ip-mono {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    position: relative;
}

.detail-ip-table .ip-mono:hover {
    color: var(--primary);
}

.detail-ip-table .ip-mono::after {
    content: 'Click to copy';
    position: absolute;
    top: -1.8rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
}

.detail-ip-table .ip-mono:hover::after { opacity: 1; }

.detail-ip-table .ip-mono.copied::after {
    content: 'Copied!';
    opacity: 1;
    background: var(--success);
}

.correlation-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 700;
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

/* Username table */
.detail-user-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.detail-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    background: rgba(255,255,255,0.7);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
}

.detail-user-chip .chip-count {
    font-size: 0.68rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

/* Mini bar chart (CSS-only) */
.mini-bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 40px;
    padding: 0.15rem 0;
}

.mini-bar {
    flex: 1;
    min-width: 6px;
    background: linear-gradient(to top, var(--primary), #8B96D0);
    border-radius: 2px 2px 0 0;
    transition: height 0.3s var(--ease-out);
    position: relative;
}

.mini-bar:hover { opacity: 0.8; }

.mini-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.6rem;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    margin-top: 0.2rem;
}

/* Copy command button */
.copy-cmd-wrap {
    display: flex;
    align-items: stretch;
    gap: 0;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    margin-top: 0.35rem;
    background: #2A2825;
}

.copy-cmd-code {
    flex: 1;
    padding: 0.55rem 0.85rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: #E8E5DF;
    overflow-x: auto;
    white-space: nowrap;
    line-height: 1.4;
}

.copy-cmd-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.85rem;
    background: #3D3A36;
    border: none;
    color: #8A8478;
    cursor: pointer;
    font-size: 0.78rem;
    font-family: var(--font-sans);
    font-weight: 600;
    transition: all var(--duration-fast);
    white-space: nowrap;
    gap: 0.3rem;
}

.copy-cmd-btn:hover { background: #504D48; color: white; }
.copy-cmd-btn.copied { background: var(--success); color: white; }

/* Suggested rules */
.detail-rules-pre {
    background: #2A2825;
    color: #E8E5DF;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    margin-top: 0.35rem;
    border: 1px solid #3D3A36;
    position: relative;
}

/* Suspicious vs normal badge */
.port-badge {
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 700;
}

.port-badge.normal { background: var(--success-light); color: var(--success); }
.port-badge.suspicious { background: var(--danger-light); color: var(--danger); }

/* File diff detail */
.detail-file-info {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.3rem 1rem;
    font-size: 0.82rem;
}

.detail-file-info dt {
    font-weight: 600;
    color: var(--text-secondary);
}

.detail-file-info dd {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    word-break: break-all;
}

/* Security highlight for packages */
.security-pkg {
    color: var(--danger);
    font-weight: 600;
}

.alert-severity-pill {
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-full);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    flex-shrink: 0;
    font-family: var(--font-mono);
}

.alert-severity-pill.critical { background: var(--danger); color: var(--text-inverse); }
.alert-severity-pill.high { background: var(--warning); color: var(--text-inverse); }
.alert-severity-pill.medium { background: var(--info); color: var(--text-inverse); }
.alert-severity-pill.low { background: var(--text-tertiary); color: var(--text-inverse); }

.alert-content { flex: 1; min-width: 0; }

.alert-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.15rem;
    color: var(--text-primary);
}

.alert-message {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.alert-meta {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    margin-top: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-meta-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-tertiary);
}

.alert-actions { flex-shrink: 0; align-self: center; }

/* ═══════════════════════════════════════════════════════════════════════════
   SSL CHECKER
   ═══════════════════════════════════════════════════════════════════════════ */

.ssl-checker {
    max-width: 640px;
}

.ssl-checker h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.ssl-checker .section-desc {
    color: var(--text-tertiary);
    font-size: 0.88rem;
    margin-bottom: 1.25rem;
}

.ssl-form {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

.ssl-form .input-lg {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.ssl-result {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    overflow: hidden;
    animation: fadeInUp 0.3s var(--ease-out);
}

.ssl-result-header {
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(248,247,244,0.8), rgba(245,243,239,0.4));
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ssl-status-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.ssl-status-icon.ok { background: var(--success-light); }
.ssl-status-icon.warn { background: var(--warning-light); }
.ssl-status-icon.bad { background: var(--danger-light); }

.ssl-status-text h3 {
    font-size: 0.95rem;
    font-weight: 700;
}

.ssl-status-text p {
    font-size: 0.78rem;
    color: var(--text-tertiary);
}

.ssl-fields {
    padding: 0.25rem 0;
}

.ssl-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.88rem;
    transition: background var(--duration-fast);
}

.ssl-field:last-child { border-bottom: none; }
.ssl-field:hover { background: rgba(248,249,252,0.5); }

.ssl-field-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.ssl-field-value {
    font-weight: 600;
    text-align: right;
    word-break: break-all;
    font-family: var(--font-mono);
    font-size: 0.82rem;
}

.ssl-field-value.ok { color: var(--success); }
.ssl-field-value.warn { color: var(--warning); }
.ssl-field-value.bad { color: var(--danger); }

/* ═══════════════════════════════════════════════════════════════════════════
   SCAN HISTORY — TIMELINE
   ═══════════════════════════════════════════════════════════════════════════ */

.select-sm {
    padding: 0.45rem 0.85rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-family: var(--font-sans);
    font-weight: 500;
    background: var(--bg-surface);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--duration) var(--ease-out);
}

.select-sm:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-subtle);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
}

/* Timeline connector line */
.history-list::before {
    content: '';
    position: absolute;
    left: 22px;
    top: 12px;
    bottom: 12px;
    width: 2px;
    background: var(--border-light);
    border-radius: 1px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem 0.75rem 0;
    margin-left: 10px;
    cursor: pointer;
    transition: all var(--duration) var(--ease-out);
    position: relative;
    border-radius: var(--radius);
    animation: fadeInUp 0.3s var(--ease-out) both;
}

.history-item:hover {
    background: var(--bg-muted);
}

.history-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--bg-surface);
    flex-shrink: 0;
    margin-left: 8px;
    position: relative;
    z-index: 2;
    transition: all var(--duration) var(--ease-out);
}

.history-item:hover .history-dot {
    border-color: var(--primary);
    background: var(--primary-light);
}

.history-dot.quick { border-color: var(--success); }
.history-dot.standard { border-color: var(--primary); }
.history-dot.deep { border-color: var(--info); }
.history-dot.digest { border-color: #8B5CF6; background: #8B5CF6; }
.history-dot.audit { border-color: #C4933F; background: #C4933F; }

.history-type {
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    min-width: 72px;
    text-align: center;
    font-family: var(--font-mono);
}

.history-type.quick { background: var(--success-light); color: var(--success); }
.history-type.standard { background: var(--primary-light); color: var(--primary); }
.history-type.deep { background: var(--info-light); color: var(--info); }
.history-type.digest { background: rgba(139,92,246,0.1); color: #8B5CF6; }
.history-type.audit { background: rgba(196,147,63,0.1); color: #C4933F; }
.history-digest { border-left: 2px solid #8B5CF6; }

.history-server {
    font-weight: 600;
    font-size: 0.88rem;
    min-width: 80px;
}

.history-time {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    margin-left: auto;
    font-family: var(--font-mono);
    font-weight: 500;
}

.history-trigger {
    font-size: 0.68rem;
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.history-trigger.daemon { background: var(--bg-muted); color: var(--text-tertiary); }
.history-trigger.manual { background: var(--primary-light); color: var(--primary); }

/* ═══════════════════════════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════════════════════════ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(45,42,38,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: fadeIn 0.2s var(--ease-out);
}

.modal {
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-light);
    width: 100%;
    max-width: 660px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: fadeInUp 0.3s var(--ease-out);
}

.modal-wide { max-width: 940px; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(135deg, rgba(248,247,244,0.8), rgba(245,243,239,0.3));
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-header h3 {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close {
    font-size: 1.3rem;
    line-height: 1;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.7;
}

.modal-body h1, .modal-body h2, .modal-body h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.modal-body h1 { font-size: 1.1rem; }
.modal-body h2 { font-size: 1rem; }
.modal-body h3 { font-size: 0.95rem; }
.modal-body h1:first-child, .modal-body h2:first-child, .modal-body h3:first-child { margin-top: 0; }

.modal-body ul, .modal-body ol {
    padding-left: 1.25rem;
    margin-bottom: 0.75rem;
}
.modal-body li { margin-bottom: 0.3rem; }

.modal-body code {
    background: var(--bg-muted);
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.82em;
    color: var(--primary);
    border: 1px solid var(--border-light);
}

.modal-body pre {
    background: #2A2825;
    color: #E8E5DF;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 0.75rem 0;
    font-size: 0.82rem;
    line-height: 1.55;
    border: 1px solid #3D3A36;
}

.modal-body pre code {
    background: none;
    padding: 0;
    color: inherit;
    border: none;
}

.modal-body p { margin-bottom: 0.6rem; }

.modal-body strong {
    font-weight: 700;
    color: var(--text-primary);
}

/* Scan detail sections */
.scan-detail-section { margin-bottom: 1.5rem; }

.scan-detail-section h4 {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary);
    margin-bottom: 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.scan-detail-section pre {
    background: var(--bg-muted);
    color: var(--text-primary);
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    font-size: 0.78rem;
    font-family: var(--font-mono);
    overflow-x: auto;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.55;
    border: 1px solid var(--border-light);
}

/* ═══════════════════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 2000;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 1.15rem;
    background: var(--bg-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    font-size: 0.85rem;
    font-weight: 500;
    pointer-events: auto;
    animation: toastIn 0.35s var(--ease-out);
    max-width: 360px;
}

.toast.removing { animation: toastOut 0.3s var(--ease-out) forwards; }

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
}

.toast.success .toast-icon { background: var(--success-light); color: var(--success); }
.toast.info .toast-icon { background: var(--primary-light); color: var(--primary); }
.toast.warning .toast-icon { background: var(--warning-light); color: var(--warning); }
.toast.error .toast-icon { background: var(--danger-light); color: var(--danger); }

.toast-msg { flex: 1; color: var(--text-primary); }

.toast-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.1rem 0.3rem;
    border-radius: var(--radius-sm);
    transition: background var(--duration-fast);
}
.toast-close:hover { background: var(--bg-muted); }

/* ═══════════════════════════════════════════════════════════════════════════
   LOADING / EMPTY / SPINNER
   ═══════════════════════════════════════════════════════════════════════════ */

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2.5px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.spinner-lg { width: 36px; height: 36px; border-width: 3px; }

.loading-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    gap: 1rem;
    color: var(--text-tertiary);
    font-size: 0.9rem;
    font-weight: 500;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.empty-state p {
    font-size: 0.85rem;
}

/* Shimmer loading skeleton */
.shimmer {
    background: linear-gradient(90deg, var(--bg-muted) 25%, var(--border-light) 50%, var(--bg-muted) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

/* ═══════════════════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════════════════ */

.app-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.25rem 1.75rem;
    color: var(--text-tertiary);
    font-size: 0.78rem;
    font-weight: 500;
    border-top: 1px solid var(--border-light);
    background: rgba(248,249,252,0.5);
    margin-top: 2rem;
}

.footer-sep {
    color: var(--text-tertiary);
    opacity: 0.4;
}

.footer-mono {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-tertiary);
}

.footer-refresh {
    font-family: var(--font-mono);
    font-size: 0.72rem;
}

.footer-daemon {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-tertiary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SECURITY SCORES ROW
   ═══════════════════════════════════════════════════════════════════════════ */

.scores-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.score-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all var(--duration) var(--ease-out);
    animation: fadeInUp 0.4s var(--ease-out) both;
}

.score-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.score-gauge {
    width: 64px;
    height: 64px;
    position: relative;
    flex-shrink: 0;
}

.score-gauge svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-gauge-bg {
    fill: none;
    stroke: var(--bg-inset);
    stroke-width: 5;
}

.score-gauge-fill {
    fill: none;
    stroke-width: 5;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s var(--ease-out), stroke 0.3s;
}

.score-gauge-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
}

.score-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.score-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.score-label.good { color: var(--success); }
.score-label.fair { color: var(--warning); }
.score-label.poor { color: var(--danger); }

.score-updated {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-top: 0.15rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   THREAT INTELLIGENCE
   ═══════════════════════════════════════════════════════════════════════════ */

.threat-countries {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.65rem;
    margin-bottom: 1.5rem;
}

.threat-country {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
    background: var(--bg-surface);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-xs);
    transition: all var(--duration) var(--ease-out);
    animation: fadeInUp 0.3s var(--ease-out) both;
}

.threat-country:hover { box-shadow: var(--shadow-sm); }

.threat-country-flag {
    font-size: 1.4rem;
    line-height: 1;
}

.threat-country-info {
    flex: 1;
    min-width: 0;
}

.threat-country-name {
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.threat-country-count {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
}

.threat-table-wrap {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.threat-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.threat-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    background: var(--bg-muted);
    border-bottom: 1px solid var(--border-light);
}

.threat-table td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.threat-table tr:last-child td { border-bottom: none; }

.threat-table tr:hover td { background: rgba(248,249,252,0.5); }

.threat-table .ip-cell {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.82rem;
}

.threat-table .count-cell {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--danger);
}

.threat-table .geo-cell {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.threat-table .type-pills {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.type-pill {
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
}

.type-pill.ssh { background: var(--danger-light); color: var(--danger); }
.type-pill.web { background: var(--warning-light); color: #C4933F; }

.threat-table .time-cell {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
}

/* ═══════════════════════════════════════════════════════════════════════════
   ALERT STATS BAR — Clickable severity pills
   ═══════════════════════════════════════════════════════════════════════════ */

.alert-stats-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.alert-stat-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    background: var(--bg-surface);
    border-radius: var(--radius-full);
    border: 1.5px solid var(--border-light);
    box-shadow: var(--shadow-xs);
    cursor: pointer;
    transition: all var(--duration) var(--ease-out);
    font-family: var(--font-sans);
    white-space: nowrap;
}

.alert-stat-pill:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }

.alert-stat-pill.active {
    border-color: var(--primary);
    background: rgba(91,106,191,0.06);
    box-shadow: 0 0 0 2px rgba(91,106,191,0.15);
}

.alert-stat-pill.critical.active { border-color: var(--danger); background: rgba(196,91,91,0.06); box-shadow: 0 0 0 2px rgba(196,91,91,0.15); }
.alert-stat-pill.high.active { border-color: #C4933F; background: rgba(196,147,63,0.06); box-shadow: 0 0 0 2px rgba(196,147,63,0.15); }
.alert-stat-pill.medium.active { border-color: var(--warning); background: rgba(196,147,63,0.06); box-shadow: 0 0 0 2px rgba(196,147,63,0.15); }
.alert-stat-pill.low.active { border-color: var(--info); background: rgba(91,142,196,0.06); box-shadow: 0 0 0 2px rgba(91,142,196,0.15); }

.stat-pill-count {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.alert-stat-pill.critical .stat-pill-count { color: var(--danger); }
.alert-stat-pill.high .stat-pill-count { color: var(--warning); }
.alert-stat-pill.medium .stat-pill-count { color: var(--info); }
.alert-stat-pill.low .stat-pill-count { color: var(--text-tertiary); }

.stat-pill-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-tertiary);
}

.stat-pill-trend {
    font-size: 0.65rem;
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-tertiary);
}

.stat-pill-trend.up { color: var(--danger); }
.stat-pill-trend.down { color: var(--success); }

/* ── Active filter chips ───────────────────────────────────────────────────── */

.alert-active-filters {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    min-height: 0;
}

.alert-active-filters:empty { margin-bottom: 0; }

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.55rem;
    border-radius: var(--radius-full);
    background: var(--bg-muted);
    border: 1px solid var(--border-light);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    animation: fadeInUp 0.2s var(--ease-out) both;
}

.filter-chip.critical { background: rgba(196,91,91,0.08); border-color: rgba(196,91,91,0.2); color: var(--danger); }
.filter-chip.high { background: rgba(196,147,63,0.08); border-color: rgba(196,147,63,0.2); color: #C4933F; }
.filter-chip.medium { background: rgba(196,147,63,0.08); border-color: rgba(196,147,63,0.2); color: #C4933F; }
.filter-chip.low { background: rgba(91,142,196,0.08); border-color: rgba(91,142,196,0.2); color: var(--info); }

.filter-chip-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border: none;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 0.65rem;
    border-radius: 50%;
    transition: background var(--duration-fast);
    padding: 0;
    line-height: 1;
}

.filter-chip-x:hover { background: rgba(0,0,0,0.1); }

/* ── Server group sections ─────────────────────────────────────────────────── */

.server-alert-group {
    margin-bottom: 1.25rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-xs);
    background: var(--bg-surface);
    animation: fadeInUp 0.3s var(--ease-out) both;
}

.server-group-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.15rem;
    background: linear-gradient(135deg, rgba(var(--server-color-rgb, 79,70,229), 0.04), rgba(var(--server-color-rgb, 79,70,229), 0.02));
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background var(--duration-fast);
    user-select: none;
    position: relative;
}

.server-group-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--server-color, var(--primary));
}

.server-group-header:hover { background: rgba(91,106,191,0.04); }

.server-group-chevron {
    font-size: 0.6rem;
    color: var(--text-tertiary);
    transition: transform var(--duration) var(--ease-out);
    flex-shrink: 0;
}

.server-group-chevron.open { transform: rotate(90deg); }

.server-group-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.server-group-name {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-primary);
}

.server-group-count {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    background: var(--bg-muted);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
}

.server-group-sev-badge {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.12rem 0.4rem;
    border-radius: var(--radius-full);
}

.server-group-sev-badge.critical { background: rgba(196,91,91,0.1); color: var(--danger); }
.server-group-sev-badge.high { background: rgba(196,147,63,0.1); color: #C4933F; }

.server-group-body {
    display: flex;
    flex-direction: column;
}

.server-group-body .alert-item {
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    box-shadow: none;
    border-bottom: 1px solid var(--border-light);
}

.server-group-body .alert-item:last-of-type { border-bottom: none; }

.server-group-body .alert-detail-panel {
    border-radius: 0;
    margin: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    border-bottom: 1px solid var(--border-light);
}

/* Severity left border inside groups */
.server-group-body .alert-item.critical { border-left: 4px solid var(--danger) !important; }
.server-group-body .alert-item.high { border-left: 4px solid #C4933F !important; }
.server-group-body .alert-item.medium { border-left: 4px solid var(--warning) !important; }
.server-group-body .alert-item.low { border-left: 4px solid var(--info) !important; }

/* Critical alerts get slightly larger text */
.server-group-body .alert-item.critical .alert-title { font-size: 0.95rem; }
.server-group-body .alert-item.critical .alert-message { font-size: 0.85rem; }

/* Detail panel severity border matching */
.alert-detail-panel.critical-border { border-left: 4px solid var(--danger); }
.alert-detail-panel.high-border { border-left: 4px solid #C4933F; }
.alert-detail-panel.medium-border { border-left: 4px solid var(--warning); }
.alert-detail-panel.low-border { border-left: 4px solid var(--info); }

/* Show more button */
.show-more-btn {
    display: block;
    width: 100%;
    padding: 0.7rem;
    background: transparent;
    border: none;
    border-top: 1px solid var(--border-light);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--duration-fast);
    font-family: var(--font-sans);
}

.show-more-btn:hover { background: rgba(91,106,191,0.04); }

/* ── Empty state with shield icon ──────────────────────────────────────────── */

.alerts-empty-state {
    text-align: center;
    padding: 3rem 2rem;
}

.empty-shield-icon {
    color: var(--success);
    margin-bottom: 1rem;
    animation: pulse-gentle 2s ease-in-out infinite;
}

@keyframes pulse-gentle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

/* ── Ack badge ─────────────────────────────────────────────────────────────── */

.ack-badge {
    font-size: 0.68rem;
    color: var(--text-tertiary);
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    background: var(--bg-muted);
    border-radius: var(--radius-full);
}

/* ── Occurrence timeline ───────────────────────────────────────────────────── */

.occ-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.82rem;
}

.occ-timeline-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.occ-label {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    font-weight: 600;
    width: 90px;
    flex-shrink: 0;
}

.occ-value {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.occ-count {
    font-weight: 700;
    color: var(--primary);
    font-size: 0.9rem;
}

/* ── Detail summary grid ───────────────────────────────────────────────────── */

.detail-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.detail-summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.4rem 0.6rem;
    background: rgba(255,255,255,0.5);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.detail-summary-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-tertiary);
}

.detail-summary-value {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ── Zebra striping for detail tables ──────────────────────────────────────── */

.detail-ip-table.zebra tbody tr:nth-child(even) {
    background: rgba(0,0,0,0.02);
}

.detail-ip-table.zebra tbody tr:hover {
    background: rgba(91,106,191,0.04);
}

/* ── Inline copy button (small, icon-only) ─────────────────────────────────── */

.copy-inline-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-light);
    background: rgba(255,255,255,0.6);
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--duration-fast);
    padding: 0;
}

.copy-inline-btn:hover { color: var(--primary); border-color: var(--primary); background: rgba(91,106,191,0.06); }
.copy-inline-btn.copied { color: var(--success); border-color: var(--success); }

.section-header-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

/* Alert resolution note */
.alert-note {
    margin-top: 0.35rem;
    padding: 0.35rem 0.6rem;
    background: var(--bg-muted);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
}

.alert-occurrences {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--primary);
    font-weight: 700;
    background: rgba(91,106,191,0.08);
    padding: 0.1rem 0.35rem;
    border-radius: var(--radius-full);
    margin-left: 0.25rem;
}

.alert-category-pill {
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-full);
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--bg-muted);
    color: var(--text-tertiary);
    margin-left: 0.35rem;
}

/* Ack note input */
.ack-note-input {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-family: var(--font-sans);
    margin-top: 0.35rem;
    transition: border-color var(--duration-fast);
}

.ack-note-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SETTINGS — WHITELIST EDITOR
   ═══════════════════════════════════════════════════════════════════════════ */

.settings-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.settings-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}

.settings-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(135deg, rgba(248,247,244,0.8), rgba(245,243,239,0.3));
}

.settings-card-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
}

.settings-card-header p {
    font-size: 0.78rem;
    color: var(--text-tertiary);
}

.wl-entries {
    padding: 0.75rem 1.25rem;
    max-height: 300px;
    overflow-y: auto;
}

.wl-entry {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.82rem;
}

.wl-entry:last-child { border-bottom: none; }

.wl-entry-ip {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-primary);
    min-width: 140px;
}

.wl-entry-label {
    flex: 1;
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.wl-entry-server {
    font-size: 0.65rem;
    background: var(--bg-muted);
    padding: 0.1rem 0.35rem;
    border-radius: var(--radius-full);
    color: var(--text-tertiary);
    font-weight: 600;
}

.wl-entry-date {
    font-size: 0.68rem;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
}

.wl-entry-remove {
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    transition: all var(--duration-fast);
    flex-shrink: 0;
}

.wl-entry-remove:hover {
    background: rgba(196,91,91,0.1);
    color: var(--danger);
}

.wl-empty {
    padding: 0.75rem 0;
    color: var(--text-tertiary);
    font-size: 0.82rem;
    font-style: italic;
}

.wl-add-form {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border-light);
    background: var(--bg-muted);
    flex-wrap: wrap;
}

.wl-add-form .input-sm {
    flex: 1;
    min-width: 120px;
}

.input-sm {
    padding: 0.4rem 0.7rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.82rem;
    font-family: var(--font-sans);
    background: var(--bg-surface);
    color: var(--text-primary);
    transition: border-color var(--duration-fast);
}

.input-sm:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-subtle);
}

/* ═══════════════════════════════════════════════════════════════════════════
   FIREWALL TAB
   ═══════════════════════════════════════════════════════════════════════════ */

.fw-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-xs);
}

.fw-table th {
    text-align: left;
    padding: 0.65rem 0.85rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-tertiary);
    background: var(--bg-muted);
    border-bottom: 1px solid var(--border-light);
}

.fw-table td {
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.fw-table tr:last-child td { border-bottom: none; }

.fw-table tbody tr:hover { background: rgba(91,106,191,0.02); }

.fw-type-badge {
    display: inline-block;
    padding: 0.12rem 0.4rem;
    border-radius: var(--radius-full);
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-right: 0.35rem;
}

.fw-type-ip { background: rgba(196,91,91,0.1); color: var(--danger); }
.fw-type-cidr { background: rgba(196,147,63,0.1); color: #C4933F; }
.fw-type-country { background: rgba(123,110,181,0.1); color: #7B6EB5; }

.fw-auto-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.35rem;
    border-radius: var(--radius-sm);
    font-size: 0.58rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: linear-gradient(135deg, rgba(91,106,191,0.12), rgba(91,106,191,0.06));
    color: var(--primary);
    border: 1px solid rgba(91,106,191,0.2);
    vertical-align: middle;
}

.fw-server-chip {
    display: inline-block;
    padding: 0.1rem 0.35rem;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 600;
    background: var(--bg-muted);
    color: var(--text-secondary);
    margin: 0 0.15rem;
}

.fw-status {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
}

.fw-status.active { background: rgba(196,91,91,0.1); color: var(--danger); }
.fw-status.removed { background: var(--bg-muted); color: var(--text-tertiary); }

.fw-geo {
    display: inline-block;
    font-size: 0.72rem;
    color: var(--text-secondary);
    white-space: nowrap;
}
.fw-muted {
    color: var(--text-tertiary);
    font-size: 0.78rem;
}

.btn-danger-outline {
    border-color: rgba(196,91,91,0.3) !important;
    color: var(--danger) !important;
}
.btn-danger-outline:hover {
    background: rgba(196,91,91,0.06) !important;
    border-color: var(--danger) !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BAN MODAL
   ═══════════════════════════════════════════════════════════════════════════ */

.ban-modal-header {
    background: linear-gradient(135deg, rgba(196,91,91,0.06), rgba(196,91,91,0.02)) !important;
}

.ban-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ban-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-tertiary);
    margin-bottom: 0.35rem;
}

.ban-warning {
    padding: 0.65rem 0.85rem;
    background: rgba(196,147,63,0.08);
    border: 1px solid rgba(196,147,63,0.2);
    border-radius: var(--radius);
    color: #C4933F;
    font-size: 0.8rem;
    font-weight: 600;
}

.ban-server-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.ban-server-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    cursor: pointer;
}

.ban-server-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.ban-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-light);
}

.btn-danger {
    background: linear-gradient(135deg, #B54E4E, #C45B5B);
    color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(196,91,91,0.25);
}

.btn-danger:hover { box-shadow: 0 4px 12px rgba(196,91,91,0.35); transform: translateY(-1px); }

.ban-results-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.ban-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0.65rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
}

.ban-result-row.success { background: rgba(90,158,111,0.06); }
.ban-result-row.fail { background: rgba(196,91,91,0.06); }

.ban-result-output {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-tertiary);
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ban-result-error {
    padding: 0.65rem;
    background: rgba(196,91,91,0.06);
    border: 1px solid rgba(196,91,91,0.15);
    border-radius: var(--radius);
    color: var(--danger);
    font-size: 0.82rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MICRO BUTTONS (inline actions in tables)
   ═══════════════════════════════════════════════════════════════════════════ */

.btn-micro {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.45rem;
    border: 1px solid var(--border-light);
    background: rgba(255,255,255,0.7);
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 0.65rem;
    font-weight: 700;
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    transition: all var(--duration-fast);
    white-space: nowrap;
}

.btn-micro:hover { color: var(--primary); border-color: var(--primary); background: rgba(91,106,191,0.06); }

.btn-micro-danger { color: var(--danger); border-color: rgba(196,91,91,0.2); }
.btn-micro-danger:hover { color: var(--danger); border-color: var(--danger); background: rgba(196,91,91,0.06); }

.action-cell {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

/* Known Safe badge (green) */
.port-badge.safe {
    background: rgba(90,158,111,0.1);
    color: var(--success);
}

/* Banned IP badge */
.banned-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--success);
    color: var(--text-inverse);
    white-space: nowrap;
}

.banned-badge-sm {
    font-size: 0.58rem;
    font-weight: 600;
    color: var(--success);
    margin-left: 0.3rem;
}

.ban-already-info {
    padding: 0.65rem 0.85rem;
    background: rgba(90,158,111,0.06);
    border: 1px solid rgba(90,158,111,0.15);
    border-radius: var(--radius);
    font-size: 0.82rem;
    color: var(--success);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ban-already-yes { color: var(--success); }
.ban-already-no { color: var(--text-tertiary); }

/* Whitelisted row dimming */
.row-whitelisted {
    opacity: 0.6;
}

.row-whitelisted:hover { opacity: 0.85; }

.row-banned { opacity: 0.55; }
.row-banned:hover { opacity: 0.75; }

/* ═══════════════════════════════════════════════════════════════════════════
   ACTIVE SESSIONS
   ═══════════════════════════════════════════════════════════════════════════ */

.sessions-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.session-server-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    animation: fadeInUp 0.35s var(--ease-out) both;
}

.session-server-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    background: linear-gradient(135deg, rgba(248,247,244,0.5), rgba(245,243,239,0.3));
    border-bottom: 1px solid var(--border-light);
}

.session-server-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
}

.session-count-badge {
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--font-mono);
    background: var(--primary-light);
    color: var(--primary);
}

.session-server-body {
    padding: 0;
}

.session-server-body pre {
    padding: 0.85rem 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
    background: transparent;
    color: var(--text-primary);
}

.session-empty {
    padding: 1.5rem 1.25rem;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RECENT CHANGES
   ═══════════════════════════════════════════════════════════════════════════ */

.recent-changes-section {
    margin-top: 1.5rem;
}

.recent-changes-section h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.85rem;
    letter-spacing: -0.2px;
}

.changes-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding-left: 1.5rem;
}

.changes-list::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: var(--border-light);
    border-radius: 1px;
}

.change-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 0;
    position: relative;
}

.change-item::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 0.65rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--bg-root);
    z-index: 1;
}

.change-file {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-all;
}

.change-meta {
    font-size: 0.72rem;
    color: var(--text-tertiary);
}

.change-server {
    font-weight: 600;
    color: var(--text-secondary);
}

/* Badge variant */
.badge-amber {
    background: linear-gradient(135deg, var(--warning), #FBBF24) !important;
    box-shadow: 0 2px 6px rgba(196,147,63,0.3) !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SETTINGS — TOGGLES, SLIDERS, AUTO-BAN
   ═══════════════════════════════════════════════════════════════════════════ */

.settings-card-wide {
    grid-column: 1 / -1;
}

.settings-toggle-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 0;
}

.settings-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.settings-toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-inset);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--duration) var(--ease-out);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 2px;
    bottom: 2px;
    background: white;
    border-radius: 50%;
    box-shadow: var(--shadow-xs);
    transition: transform var(--duration) var(--ease-out);
}

.settings-toggle input:checked + .toggle-slider {
    background: var(--primary);
    border-color: var(--primary);
}

.settings-toggle input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.settings-toggle-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.settings-toggle-info strong {
    font-size: 0.85rem;
    color: var(--text-primary);
}

.settings-toggle-desc {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.settings-slider-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0 0.5rem 3.5rem;
}

.settings-slider-row label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.settings-slider-row input[type="range"] {
    flex: 1;
    max-width: 250px;
    accent-color: var(--primary);
}

.settings-slider-val {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--danger);
    min-width: 35px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   HARDENING ADVISOR
   ═══════════════════════════════════════════════════════════════════════════ */

.harden-server {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.harden-server-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-muted);
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
}

.harden-server-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.harden-score {
    display: flex;
    align-items: baseline;
    gap: 0.2rem;
    margin-left: auto;
}

.harden-score-num {
    font-size: 1.5rem;
    font-weight: 800;
    font-family: var(--font-mono);
}

.harden-score-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 600;
}

.harden-summary {
    display: flex;
    gap: 0.4rem;
}

.harden-badge {
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
}

.harden-badge.pass { background: var(--success-light); color: var(--success); }
.harden-badge.fail { background: var(--danger-light); color: var(--danger); }
.harden-badge.warn { background: var(--warning-light); color: var(--warning); }

.harden-checks {
    display: flex;
    flex-direction: column;
}

.harden-check {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--duration-fast);
}

.harden-check:last-child { border-bottom: none; }
.harden-check:hover { background: rgba(248,249,252,0.5); }

.harden-check.harden-fail { background: rgba(196,91,91,0.02); }
.harden-check.harden-pass { opacity: 0.7; }

.harden-icon {
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.harden-info {
    flex: 1;
    min-width: 0;
}

.harden-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.harden-detail {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.15rem;
}

.harden-cmd {
    display: block;
    margin-top: 0.35rem;
    padding: 0.35rem 0.5rem;
    background: var(--bg-muted);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 500px;
}

.harden-category {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-tertiary);
    padding: 0.15rem 0.4rem;
    background: var(--bg-muted);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    flex-shrink: 0;
}

.harden-note {
    padding: 0.65rem 1.25rem;
    background: var(--warning-light);
    color: var(--warning);
    font-size: 0.78rem;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BULK SELECTION & ACTION BAR
   ═══════════════════════════════════════════════════════════════════════════ */

.bulk-helpers {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.bulk-helpers.hidden { display: none; }

.bulk-country-select .select-sm {
    min-width: 180px;
}

.bulk-selection-count {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary);
    opacity: 0;
    transition: opacity var(--duration) var(--ease-out);
}

.bulk-selection-count.visible {
    opacity: 1;
}

/* Checkbox column in table */
.threat-table .check-cell {
    width: 36px;
    text-align: center;
    padding-left: 0.75rem;
    padding-right: 0;
}

.threat-table .check-cell input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Selected row highlight */
.threat-table tr.row-selected td {
    background: rgba(91,106,191,0.06);
}

/* Selected country card highlight */
.threat-country.card-selected {
    border-color: var(--primary);
    background: rgba(91,106,191,0.04);
    box-shadow: 0 0 0 1px var(--primary), var(--shadow-xs);
}

.threat-country .bulk-country-check {
    width: 15px;
    height: 15px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

/* Sticky bulk action bar */
.bulk-action-bar {
    position: sticky;
    bottom: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    margin-top: 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    animation: fadeInUp 0.2s var(--ease-out);
}

.bulk-action-bar.hidden { display: none; }

.bulk-action-info {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

.bulk-action-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Bulk ban modal extras */
.bulk-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    max-height: 120px;
    overflow-y: auto;
    padding: 0.5rem;
    background: var(--bg-muted);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

.bulk-preview-item {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
    font-family: var(--font-mono);
}

.bulk-preview-item.ip {
    background: rgba(196,91,91,0.08);
    color: var(--danger);
    border: 1px solid rgba(196,91,91,0.15);
}

.bulk-preview-item.country {
    background: rgba(139,92,246,0.08);
    color: #8B5CF6;
    border: 1px solid rgba(139,92,246,0.15);
}

.bulk-preview-more {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    font-weight: 600;
    padding: 0.15rem 0.5rem;
}

.bulk-progress-bar {
    position: relative;
    height: 28px;
    background: var(--bg-muted);
    border-radius: var(--radius);
    overflow: hidden;
    margin-top: 0.5rem;
}

.bulk-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(135deg, rgba(91,106,191,0.15), rgba(91,106,191,0.25));
    transition: width 0.3s var(--ease-out);
    border-radius: var(--radius);
}

.bulk-progress-text {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.bulk-summary {
    padding: 0.65rem 0.85rem;
    background: rgba(90,158,111,0.08);
    border: 1px solid rgba(90,158,111,0.2);
    border-radius: var(--radius);
    color: var(--success);
    font-size: 0.85rem;
    font-weight: 700;
    margin-top: 0.5rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   DARK MODE
   ═══════════════════════════════════════════════════════════════════════════ */

[data-theme="dark"] {
    --bg-root: #1A1918;
    --bg-surface: #252422;
    --bg-surface-hover: #2C2A27;
    --bg-elevated: rgba(37,36,34,0.95);
    --bg-muted: #1F1E1C;
    --bg-inset: #171615;
    --border: #3A3835;
    --border-light: #333130;
    --border-focus: #7B8AD4;
    --primary: #7B8AD4;
    --primary-hover: #8E9ADE;
    --primary-light: #2A2D3E;
    --primary-subtle: rgba(123,138,212,0.1);
    --primary-glow: rgba(123,138,212,0.2);
    --success: #6DB580;
    --success-light: #1E2E23;
    --success-border: #3A5A44;
    --success-glow: rgba(109,181,128,0.2);
    --warning: #D4A84E;
    --warning-light: #2E2618;
    --warning-border: #5A4A2A;
    --danger: #D47070;
    --danger-light: #2E1E1E;
    --danger-border: #5A3333;
    --danger-glow: rgba(212,112,112,0.2);
    --info: #70A0D4;
    --info-light: #1E2630;
    --info-border: #33506A;
    --text-primary: #E8E5DF;
    --text-secondary: #A09A90;
    --text-tertiary: #7A746A;
    --text-inverse: #1A1918;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3), 0 4px 12px rgba(0,0,0,0.15);
    --shadow-md: 0 2px 6px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.2);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.35), 0 16px 40px rgba(0,0,0,0.25);
    --shadow-xl: 0 8px 24px rgba(0,0,0,0.4), 0 24px 48px rgba(0,0,0,0.3);
}

[data-theme="dark"] .threat-table tr:hover td { background: rgba(255,255,255,0.03); }
[data-theme="dark"] .harden-check:hover { background: rgba(255,255,255,0.03); }
[data-theme="dark"] .btn-micro { background: rgba(30,30,28,0.7); }
[data-theme="dark"] .modal-overlay { background: rgba(0,0,0,0.6); }

html, body { transition: background-color 0.3s ease, color 0.3s ease; }
.server-card, .modal, .settings-card, .threat-country, .threat-table-wrap,
.harden-server, .topbar, .tab-nav, .app-footer, .toast { transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease; }

.btn-theme-toggle {
    font-size: 1.1rem;
    line-height: 1;
    padding: 0.3rem 0.5rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LIVE ATTACK MAP
   ═══════════════════════════════════════════════════════════════════════════ */

.attack-map-wrap { margin-bottom: 1rem; }

.attack-map {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.attack-map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--border-light);
}

.attack-map-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-tertiary);
}

.attack-map-count {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
}

.attack-map-svg {
    width: 100%;
    height: auto;
    max-height: 220px;
    display: block;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOG ANALYZER
   ═══════════════════════════════════════════════════════════════════════════ */

.log-output {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    max-height: 500px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 0.72rem;
}

.log-lines { padding: 0.5rem; }

.log-line {
    padding: 0.2rem 0.5rem;
    border-bottom: 1px solid var(--border-light);
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.4;
    color: var(--text-secondary);
}

.log-line:last-child { border-bottom: none; }
.log-line:hover { background: var(--bg-muted); }

.log-line.log-suspicious {
    background: rgba(196,91,91,0.04);
    color: var(--danger);
    font-weight: 600;
}

.log-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.log-line-count {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
}

.settings-toggle-sm {
    width: 32px;
    height: 18px;
}

.settings-toggle-sm .toggle-slider::before {
    width: 13px;
    height: 13px;
    left: 2px;
    bottom: 2px;
}

.settings-toggle-sm input:checked + .toggle-slider::before {
    transform: translateX(14px);
}

/* ═══════════════════════════════════════════════════════════════════════════
   NOTIFICATION & API KEY SETTINGS
   ═══════════════════════════════════════════════════════════════════════════ */

.notify-fields {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.notify-sev-toggles {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.notify-sev-label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.78rem;
    cursor: pointer;
    text-transform: capitalize;
}

.notify-sev-label input { accent-color: var(--primary); }

.api-key-new {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--success-light);
    border: 1px solid var(--success-border);
    border-radius: var(--radius);
}

.api-key-display { font-size: 0.82rem; }
.api-key-display strong { display: block; margin-bottom: 0.35rem; font-size: 0.75rem; color: var(--text-tertiary); }

.api-key-value {
    display: block;
    padding: 0.5rem;
    background: var(--bg-muted);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    word-break: break-all;
    user-select: all;
    cursor: text;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    html { font-size: 14px; }

    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-xl); }
    .sidebar-toggle { display: block; }
    .main-content { margin-left: 0; padding: 1.25rem; padding-top: 3.5rem; }
    .app-footer { margin-left: 0; }

    .server-grid { grid-template-columns: 1fr; }

    .card-metrics { grid-template-columns: 1fr 1fr; }

    .card-footer { flex-wrap: wrap; }
    .card-footer .btn { flex: 0 0 calc(50% - 0.25rem); }

    .ssl-form { flex-direction: column; }

    .ssl-field {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
    }
    .ssl-field-value { text-align: left; }

    .modal { max-height: 95vh; border-radius: var(--radius-lg); }
    .modal-wide { max-width: 100%; }

    .scores-row { grid-template-columns: 1fr; }
    .threat-countries { grid-template-columns: repeat(2, 1fr); }
    .threat-table { font-size: 0.78rem; }
    .threat-table th, .threat-table td { padding: 0.5rem 0.65rem; }
    .alert-stats-bar { gap: 0.35rem; }
    .alert-stat-pill { padding: 0.45rem 0.7rem; gap: 0.35rem; }
    .stat-pill-count { font-size: 0.95rem; }
    .stat-pill-label { font-size: 0.62rem; }
    .section-header-actions { width: 100%; }
    .section-header { flex-direction: column; align-items: flex-start; }

    .history-list::before { left: 17px; }
    .history-item { gap: 0.65rem; flex-wrap: wrap; }

    .toast-container { left: 1rem; right: 1rem; bottom: 1rem; }
    .toast { max-width: none; }

    .alert-item { flex-direction: column; gap: 0.5rem; }
    .alert-actions { align-self: flex-start; }

    /* Mobile: severity pills become compact colored dots */
    .server-group-body .alert-severity-pill {
        width: 10px;
        height: 10px;
        min-width: 10px;
        padding: 0;
        border-radius: 50%;
        font-size: 0;
        overflow: hidden;
    }
    .server-group-body .alert-severity-pill.critical { background: var(--danger); }
    .server-group-body .alert-severity-pill.high { background: #C4933F; }
    .server-group-body .alert-severity-pill.medium { background: var(--warning); }
    .server-group-body .alert-severity-pill.low { background: var(--info); }

    .server-group-header { flex-wrap: wrap; }
    .server-group-sev-badge { font-size: 0.58rem; }

    .detail-summary-grid { grid-template-columns: 1fr; }

    .alert-detail-panel.open { padding: 0.85rem; }
    .detail-ip-table { font-size: 0.75rem; }
    .detail-ip-table th, .detail-ip-table td { padding: 0.35rem 0.45rem; }

    .wl-add-form { flex-direction: column; }
    .wl-entry { flex-wrap: wrap; gap: 0.35rem; }
    .wl-entry-ip { min-width: auto; }

    .fw-table { font-size: 0.75rem; }
    .fw-table th, .fw-table td { padding: 0.45rem 0.55rem; }
    .ban-result-output { max-width: 150px; }

    .bulk-action-bar { flex-direction: column; gap: 0.5rem; text-align: center; }
    .bulk-helpers { gap: 0.35rem; }
    .bulk-helpers .btn { font-size: 0.7rem; padding: 0.3rem 0.5rem; }

    .harden-check { flex-wrap: wrap; gap: 0.5rem; }
    .harden-cmd { max-width: 100%; font-size: 0.6rem; }
    .harden-server-header { flex-direction: column; align-items: flex-start; }
    .harden-score { margin-left: 0; }
    .settings-slider-row { padding-left: 0; flex-wrap: wrap; }
    .settings-toggle-row { flex-wrap: wrap; }

    .attack-map-svg { max-height: 150px; }
    .log-output { max-height: 350px; font-size: 0.65rem; }
    .notify-fields .input-sm { font-size: 0.78rem; }

    .app-footer { flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
}

@media (max-width: 480px) {
    .card-scan-times { flex-direction: column; gap: 0.3rem; }
    .topbar-left h1 { font-size: 1rem; }
    .card-footer .btn { flex: 0 0 100%; }
    .card-metrics { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   USER MANAGEMENT TAB
   ═══════════════════════════════════════════════════════════════════════════ */

.users-table .action-cell {
    flex-wrap: wrap;
    gap: 0.3rem;
}

.user-role-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.user-role-badge.admin { background: rgba(91,106,191,0.12); color: var(--primary); border: 1px solid rgba(91,106,191,0.2); }
.user-role-badge.viewer { background: var(--bg-muted); color: var(--text-tertiary); border: 1px solid var(--border-light); }

.user-status {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
}
.user-status.active { background: rgba(90,158,111,0.1); color: var(--success); }
.user-status.disabled { background: rgba(196,91,91,0.1); color: var(--danger); }

.user-sess-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 700;
    background: rgba(91,106,191,0.08);
    color: var(--primary);
    margin-right: 0.25rem;
}

.user-protected {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: linear-gradient(135deg, rgba(196,147,63,0.12), rgba(196,147,63,0.04));
    color: #C4933F;
    border: 1px solid rgba(196,147,63,0.25);
}

.user-prot-chip { font-size: 0.8rem; margin-left: 0.3rem; }

#user-overlay .ban-result-error {
    padding: 0.5rem 0.65rem;
    background: var(--danger-light);
    border: 1px solid var(--danger-border);
    border-radius: var(--radius-sm);
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 0.5rem;
}
#user-overlay .ban-result-error.hidden { display: none; }

/* ═══════════════════════════════════════════════════════════════════════════
   ACCESS DENIED + PERMISSIONS UI
   ═══════════════════════════════════════════════════════════════════════════ */

.access-denied {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    max-width: 500px;
    margin: 3rem auto;
}
.access-denied-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}
.access-denied h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}
.access-denied p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.readonly-badge {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--bg-muted);
    color: var(--text-tertiary);
    border: 1px solid var(--border-light);
}

/* Permissions grid in user modal */
.perms-section { margin-top: 0.5rem; }
.perms-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.9rem;
}
.perms-preset-btn {
    padding: 0.35rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    background: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--duration-fast);
}
.perms-preset-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(91,106,191,0.05);
}
.perms-preset-btn.active {
    background: linear-gradient(135deg, rgba(91,106,191,0.12), rgba(91,106,191,0.04));
    border-color: var(--primary);
    color: var(--primary);
}

.perms-category {
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    background: var(--bg-surface);
    overflow: hidden;
}
.perms-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0.85rem;
    background: var(--bg-muted);
    border-bottom: 1px solid var(--border-light);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
}
.perms-toggle-all {
    font-size: 0.68rem;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    background: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
}
.perms-toggle-all:hover { border-color: var(--primary); color: var(--primary); }
.perms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.25rem;
    padding: 0.65rem 0.85rem;
}
.perms-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    padding: 0.35rem 0.4rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    user-select: none;
    transition: background var(--duration-fast);
}
.perms-item:hover { background: var(--bg-muted); }
.perms-item input[type="checkbox"] { display: none; }
.perms-item .perms-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: var(--bg-surface);
    font-size: 0.75rem;
    color: var(--text-tertiary);
    flex-shrink: 0;
}
.perms-item input:checked + .perms-check {
    background: var(--success);
    border-color: var(--success);
    color: white;
}
.perms-item input:checked + .perms-check::before { content: '\2713'; font-weight: 800; }
.perms-item input:not(:checked) + .perms-check::before { content: '\1F512 '; font-size: 0.7rem; opacity: 0.4; }
.perms-item input:disabled ~ .perms-label { opacity: 0.55; cursor: not-allowed; }
.perms-item input:disabled + .perms-check { opacity: 0.55; }
.perms-label { flex: 1; }

.user-perm-chip {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 600;
    padding: 0.08rem 0.3rem;
    background: var(--bg-muted);
    color: var(--text-tertiary);
    border-radius: var(--radius-sm);
    margin-right: 0.15rem;
    margin-top: 0.1rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   DESIGN POLISH — global refinements across all pages
   ═══════════════════════════════════════════════════════════════════════════ */

/* Tighter, consistent page title (section headers inside cards/panels) */
.settings-section-title {
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
}

/* ── Tables — zebra, sticky header, refined hover ────────────────────────── */
.fw-table {
    border: none;
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius);
    font-size: 0.85rem;
    overflow: hidden;
}
.fw-table thead {
    position: sticky;
    top: 0;
    z-index: 3;
}
.fw-table th {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    padding: 0.75rem 1rem;
    background: var(--bg-muted);
    border-bottom: 1px solid var(--border-light);
}
.fw-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.85rem;
    color: var(--text-primary);
}
.fw-table tbody tr:nth-child(odd) { background: #FCFBF9; }
.fw-table tbody tr:nth-child(even) { background: var(--bg-surface); }
.fw-table tbody tr:hover { background: #FAFAF7; }
.fw-table tbody tr:last-child td { border-bottom: none; }
.fw-table td strong,
.fw-table td code {
    font-family: var(--font-mono);
    font-size: 0.81rem;
    font-weight: 600;
}

/* ── Severity pills — normalized to spec colors ──────────────────────────── */
.alert-severity-pill {
    padding: 0.25rem 0.7rem;
    border-radius: var(--radius-full);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1.3;
}
.alert-severity-pill.critical { background: #C45B5B; color: #fff; }
.alert-severity-pill.high     { background: #C4933F; color: #fff; }
.alert-severity-pill.medium   { background: #5B8EC4; color: #fff; }
.alert-severity-pill.low      { background: #8A8478; color: #fff; }

/* Banned & status pills used in threats/firewall */
.banned-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-full);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    background: var(--success);
    color: #fff;
    text-transform: uppercase;
}
.fw-status.active {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(90,158,111,0.08);
    color: var(--success);
    border: 1px solid rgba(90,158,111,0.18);
    padding: 0.18rem 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.65rem;
    font-weight: 600;
}
.fw-status.active::before {
    content: '';
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 6px rgba(90,158,111,0.4);
}
.fw-status.removed {
    display: inline-block;
    padding: 0.18rem 0.55rem;
    background: var(--bg-muted);
    color: var(--text-tertiary);
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Buttons — spec hierarchy ────────────────────────────────────────────── */
.btn {
    padding: 0.55rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 550;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease,
                box-shadow 0.15s ease, transform 0.15s ease;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 1px 2px rgba(91,106,191,0.2);
}
.btn-primary:hover { background: #4A5AAE; box-shadow: 0 4px 12px rgba(91,106,191,0.25); }
.btn-danger { background: #C45B5B; color: #fff; }
.btn-danger:hover { background: #B34A4A; }
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
.btn-outline:hover {
    background: var(--bg-muted);
    border-color: var(--border);
    color: var(--text-primary);
}
.btn-sm { padding: 0.375rem 0.875rem; font-size: 0.8125rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    background: var(--bg-surface);
    color: var(--text-tertiary);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-icon:hover { background: var(--bg-muted); color: var(--primary); border-color: var(--border); }

/* ── Form inputs — consistent focus ring ─────────────────────────────────── */
.input-sm, .input-lg, .select-sm {
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input-sm:focus, .input-lg:focus, .select-sm:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(91,106,191,0.12);
}
.input-sm::placeholder, .input-lg::placeholder { color: #B5AFA4; }

/* Checkbox / toggle accent */
input[type="checkbox"] { accent-color: var(--primary); }

/* ── Toasts — slide in + progress bar ────────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-width: 380px;
}
.toast {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 1.2rem 0.95rem 0.95rem;
    background: var(--bg-surface);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(45,42,38,0.12), 0 2px 6px rgba(45,42,38,0.05);
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--primary);
    animation: toastIn 0.25s var(--ease-out) both;
    overflow: hidden;
    font-size: 0.875rem;
    color: var(--text-primary);
}
.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast.info    { border-left-color: var(--info); }
.toast.removing { animation: toastOut 0.25s var(--ease-out) forwards; }
.toast::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 2px;
    background: currentColor;
    opacity: 0.25;
    transform-origin: left;
    animation: toastProgress 4s linear forwards;
}
.toast.success::after { background: var(--success); }
.toast.error::after   { background: var(--danger); }
.toast.warning::after { background: var(--warning); }
.toast.info::after    { background: var(--info); }
@keyframes toastProgress {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}
.toast-icon {
    font-size: 1rem;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.toast-msg { flex: 1; line-height: 1.4; }
.toast-close {
    background: none; border: none; cursor: pointer;
    color: var(--text-tertiary); font-size: 1rem;
    padding: 0 0.25rem;
}
.toast-close:hover { color: var(--text-primary); }

/* ── Modal refinements ───────────────────────────────────────────────────── */
.modal-overlay {
    background: rgba(45,42,38,0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.modal {
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(45,42,38,0.15), 0 4px 12px rgba(45,42,38,0.06);
    border: none;
    animation: modalIn 0.22s var(--ease-out) both;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(4px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header { padding: 1.25rem 1.5rem; }
.modal-header h3 { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.2px; }
.modal-close {
    width: 32px; height: 32px;
    border-radius: 50%;
    color: var(--text-tertiary);
    border: none;
    background: transparent;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.modal-close:hover { background: var(--bg-muted); color: var(--text-primary); }

/* ── Footer (app) ────────────────────────────────────────────────────────── */
.app-footer {
    height: 40px;
    border-top: 1px solid var(--border-light);
    background: transparent;
    padding: 0 2.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: #A09A90;
    margin-left: 220px;
}
.app-footer .footer-mono { font-family: var(--font-mono); font-size: 0.72rem; }
.app-footer .footer-sep { opacity: 0.4; }

/* ── Number flash highlight when values change ───────────────────────────── */
@keyframes numberFlash {
    0% { background-color: rgba(91,106,191,0.18); box-shadow: 0 0 0 4px rgba(91,106,191,0.1); }
    100% { background-color: transparent; box-shadow: none; }
}
.number-flash {
    animation: numberFlash 0.9s var(--ease-out);
    border-radius: 4px;
}

/* Force monospace on numeric cells and IP values */
.fw-table td[data-ip],
.fw-server-chip,
.cr-cnt, .val, .metric-value, .metric-count {
    font-family: var(--font-mono);
}

/* ── Hardening page: card-per-item with severity left bar ────────────────── */
.hardening-item, .harden-item {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 0.9rem 1.1rem;
    background: var(--bg-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    border-left: 4px solid var(--border);
    margin-bottom: 0.6rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.hardening-item:hover, .harden-item:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}
.hardening-item.pass, .harden-item.pass,
.hardening-item[data-status="pass"] { border-left-color: var(--success); }
.hardening-item.fail, .harden-item.fail,
.hardening-item[data-status="fail"] { border-left-color: var(--danger); }
.hardening-item.warn, .harden-item.warn,
.hardening-item[data-status="warn"] { border-left-color: var(--warning); }
.hardening-status-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #fff;
    flex-shrink: 0;
    margin-top: 0.1rem;
}
.hardening-item.pass .hardening-status-icon,
.hardening-item[data-status="pass"] .hardening-status-icon { background: var(--success); }
.hardening-item.fail .hardening-status-icon,
.hardening-item[data-status="fail"] .hardening-status-icon { background: var(--danger); }
.hardening-item.warn .hardening-status-icon,
.hardening-item[data-status="warn"] .hardening-status-icon { background: var(--warning); }

/* ── Logs terminal polish ────────────────────────────────────────────────── */
.log-output {
    background: #1F1D1A;
    color: #E8E5DF;
    border-radius: var(--radius);
    border: 1px solid var(--bg-inset);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.55;
    padding: 1rem 1.1rem;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
    max-height: 65vh;
    overflow: auto;
}
.log-line {
    display: flex;
    gap: 0.75rem;
    padding: 0.12rem 0.35rem;
    border-bottom: none;
    border-radius: 3px;
    color: #D6D2C9;
}
.log-line::before {
    content: attr(data-ln);
    color: #6B6560;
    min-width: 3em;
    text-align: right;
    opacity: 0.6;
}
.log-line:hover { background: rgba(255,255,255,0.035); }
.log-line .log-line-text { flex: 1; white-space: pre-wrap; word-break: break-word; }
.log-line.log-suspicious {
    background: rgba(196,91,91,0.14);
    color: #F6C9C9;
    border-left: 3px solid var(--danger);
}
.log-line mark {
    background: rgba(196,147,63,0.45);
    color: #FFF4D9;
    padding: 0 2px;
    border-radius: 2px;
}

/* ── Sticky bulk-action bar on threats page ──────────────────────────────── */
.bulk-action-bar {
    position: sticky;
    bottom: 1rem;
    margin-top: 1rem;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 -4px 20px rgba(45,42,38,0.08), var(--shadow-md);
    padding: 0.85rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    animation: slideUpIn 0.25s var(--ease-out) both;
    z-index: 15;
}
@keyframes slideUpIn {
    from { transform: translateY(12px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.bulk-action-bar.hidden { display: none !important; }
.bulk-action-info { font-weight: 600; color: var(--text-primary); font-size: 0.9rem; }
.bulk-action-buttons { display: flex; gap: 0.5rem; }

/* ── Sessions cards ──────────────────────────────────────────────────────── */
.session-server-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
    overflow: hidden;
}
.session-server-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1.2rem;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-muted);
}
.session-server-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.1px;
}
.session-count-badge {
    background: rgba(90,158,111,0.1);
    color: var(--success);
    border: 1px solid rgba(90,158,111,0.2);
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.session-count-badge::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 6px rgba(90,158,111,0.4);
}
.session-server-body {
    padding: 0.85rem 1.2rem;
}
.session-server-body pre {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-secondary);
    background: var(--bg-muted);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.85rem;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
}
.session-empty { color: var(--text-tertiary); font-size: 0.85rem; font-style: italic; }

/* ── History items (list-style lightweight rows) ─────────────────────────── */
.history-list { display: flex; flex-direction: column; gap: 0.3rem; }
.history-item {
    display: grid;
    grid-template-columns: 14px 80px 1fr 120px 120px;
    gap: 0.9rem;
    align-items: center;
    padding: 0.7rem 1rem;
    background: var(--bg-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
    font-size: 0.82rem;
}
.history-item:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.history-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--border);
}
.history-type {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: var(--radius-full);
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: center;
    width: fit-content;
}
.history-time { font-family: var(--font-mono); font-size: 0.74rem; color: var(--text-tertiary); }
.history-trigger { font-size: 0.72rem; color: var(--text-tertiary); }
@media (max-width: 900px) {
    .history-item { grid-template-columns: 14px 1fr 90px; }
    .history-trigger, .history-time { display: none; }
}

/* ── Code blocks inside modals / expanded alerts ─────────────────────────── */
.modal-body pre, .alert-expanded pre {
    background: #2D2A26;
    color: #E8E5DF;
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    line-height: 1.55;
    overflow-x: auto;
    margin: 0.5rem 0;
}
.modal-body code {
    font-family: var(--font-mono);
    background: var(--bg-muted);
    padding: 0.08rem 0.35rem;
    border-radius: 3px;
    font-size: 0.82rem;
}

/* ── Role / ADMIN / VIEWER pill consistency on users table ──────────────── */
.user-role-badge.admin  { background: var(--primary); color: #fff; border: none; }
.user-role-badge.viewer { background: var(--text-tertiary); color: #fff; border: none; }
.user-role-badge {
    padding: 0.18rem 0.65rem;
    font-size: 0.65rem;
    letter-spacing: 0.05em;
}

/* ── Threats country grid ────────────────────────────────────────────────── */
.threat-countries {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
@media (max-width: 900px) {
    .threat-countries { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
    .threat-countries { grid-template-columns: 1fr; }
}

/* ── Empty state refinement ──────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    color: var(--text-secondary);
}
.empty-state-icon { font-size: 2.5rem; opacity: 0.5; margin-bottom: 0.75rem; }
.empty-state h3 { font-size: 1rem; font-weight: 600; color: var(--text-primary); margin-bottom: 0.3rem; }

/* ── Responsive sidebar (collapsed to icons on mid screens) ──────────────── */
@media (min-width: 768px) and (max-width: 1080px) {
    .sidebar { width: 64px; }
    .sidebar:not(.open) .sidebar-title,
    .sidebar:not(.open) .sidebar-user-info,
    .sidebar:not(.open) .nav-label,
    .sidebar:not(.open) .sidebar-actions { display: none; }
    .sidebar:not(.open) .sidebar-brand { justify-content: center; padding: 0; }
    .sidebar:not(.open) .sidebar-user { justify-content: center; }
    .sidebar:not(.open) .nav-item { justify-content: center; padding-left: 0; gap: 0; }
    .sidebar:not(.open) .nav-icon { width: auto; }
    .main-content, .app-footer { margin-left: 64px; }
}

/* Users page: ensure action cell wraps nicely + matches polish */
.users-table .action-cell { gap: 0.35rem; }
.user-status.active {
    background: rgba(90,158,111,0.08);
    color: var(--success);
    border: 1px solid rgba(90,158,111,0.2);
}
.user-status.disabled {
    background: rgba(196,91,91,0.08);
    color: var(--danger);
    border: 1px solid rgba(196,91,91,0.2);
}

/* Access-denied nicer */
.access-denied {
    box-shadow: var(--shadow-sm);
    border: none;
}

/* Permissions grid — presets pill style */
.perms-preset-btn {
    border-radius: var(--radius-full);
    padding: 0.3rem 0.85rem;
    font-size: 0.72rem;
    font-weight: 600;
}

/* ── Settings page read-only badge + disabled state ──────────────────────── */
.readonly-badge {
    background: var(--warning-light);
    color: var(--warning);
    border: 1px solid var(--warning-border);
}
body:has(.readonly-badge) .settings-card input:disabled,
body:has(.readonly-badge) .settings-card select:disabled,
body:has(.readonly-badge) .settings-card button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Gaps inside ban actions */
.ban-actions { gap: 0.75rem; }

/* Make sidebar brand hover gently */
.sidebar-brand:hover .sidebar-title { color: var(--primary); }

/* Make settings toggle sliders a touch smoother */
.settings-toggle { transition: all 0.2s var(--ease-out); }

/* Page-level content animate-in, but skip when rendered inside access-denied */
.main-content > .page-header,
.main-content > div:not(.access-denied) {
    animation: fadeInUp 0.35s var(--ease-out) both;
}
.main-content > div:nth-child(2) { animation-delay: 0.05s; }
.main-content > div:nth-child(3) { animation-delay: 0.1s; }

/* Tight, consistent scrollbars */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); border: 2px solid transparent; background-clip: content-box; }
