/* ============================================================
   SentinelIQ – Enterprise Dark Theme v4.0
   Estética sobria estilo SOC: sin neón, tonos muted, foco en datos
   ============================================================ */

:root {
    /* Backgrounds — slate profesional menos saturado */
    --bg-base:        #0c1220;
    --bg-surface:     #141d33;
    --bg-card:        #1a2340;
    --bg-card-hover:  #222d4d;
    --bg-input:       #141d33;
    --border:         rgba(148,163,184,0.10);
    --border-bright:  rgba(148,163,184,0.18);

    /* Acentos — muted enterprise (tipo Splunk/Cortex/QRadar) */
    --cyan:    #5b9bd5;        /* azul cielo apagado, no neón */
    --cyan-dim: rgba(91,155,213,0.13);
    --purple:  #7986cb;        /* índigo sobrio */
    --purple-dim: rgba(121,134,203,0.13);
    --blue:    #4a7bc8;        /* azul corporativo */

    /* Severidad — mantiene legibilidad, tonos serios (versión SÓLIDA) */
    --green:   #16a34a;
    --green-dim: rgba(22,163,74,0.14);
    --yellow:  #d97706;
    --yellow-dim: rgba(217,119,6,0.13);
    --red:     #dc2626;
    --red-dim: rgba(220,38,38,0.14);

    /* Tonos "light" — para texto, iconos y badges sobre fondos oscuros.
       Los sólidos de arriba son para botones rellenos; estos son la versión
       legible sobre dark theme. Cambia 1 línea aquí y se actualiza todo. */
    --green-light:  #4ade80;
    --green-light2: #86efac;
    --yellow-light: #fbbf24;
    --orange-light: #fb923c;
    --red-light:    #f87171;
    --red-light2:   #fca5a5;
    --cyan-light:   #67e8f9;
    --blue-light:   #60a5fa;
    --purple-light: #c084fc;

    --text-primary:   #e8edf3;
    --text-secondary: #a3b1c7;
    --text-muted:     #6b7a8f;

    --sidebar-w: 240px;
    --topbar-h:  60px;
    --radius:    10px;
    --radius-lg: 16px;
    --shadow:    0 4px 24px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.6);

    --transition: 0.2s ease;
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
}

/* ============================================================
   LOGIN
   ============================================================ */
.auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-base);
    position: relative;
    overflow: hidden;
    padding: 24px;
}

.auth__bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.auth__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(91,155,213,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(91,155,213,0.04) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 20%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 20%, transparent 100%);
}

.auth__glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.35;
}

.auth__glow--1 {
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(91,155,213,0.2), transparent 70%);
    top: -200px; left: 50%; transform: translateX(-50%);
}

.auth__glow--2 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(121,134,203,0.2), transparent 70%);
    bottom: -100px; right: -100px;
}

.auth__container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

.auth__logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth__logo-mark {
    width: 48px; height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: white;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.auth__logo-text {
    font-size: 26px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.auth__card {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-lg);
    padding: 36px;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(91,155,213,0.05);
}

.auth__title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.auth__sub {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 28px;
}

.form-group { margin-bottom: 18px; }

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-bright);
    border-radius: 8px;
    padding: 11px 14px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    transition: var(--transition);
    font-family: inherit;
}

.form-control:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(91,155,213,0.12);
}

.form-control::placeholder { color: var(--text-muted); }

.form-control option { background: var(--bg-card); }

select.form-control { cursor: pointer; }

/* ── Fix global de visibilidad de opciones en selects ──
   El menú desplegable nativo del SO renderiza los <option> con su propio
   estilo. Algunas combinaciones SO+navegador (Chrome/Firefox en Linux,
   Safari macOS modo claro) pintan el fondo blanco, y el color heredado
   gris/blanco del tema oscuro queda invisible. Forzamos negro sobre blanco. */
option,
select option,
select optgroup,
.form-control option {
    background-color: #ffffff !important;
    color: #000000 !important;
    font-weight: 500 !important;
    text-shadow: none !important;
}
option:checked,
select option:checked,
option:hover,
select option:hover,
option:focus {
    background-color: #dbeafe !important;
    color: #000000 !important;
    font-weight: 600 !important;
}
optgroup {
    color: #4b5563 !important;
    font-weight: 700 !important;
    font-style: italic;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--cyan);
    color: #fff;
    border: 1px solid rgba(91,155,213,0.4);
}

.btn-primary:hover {
    background: #6da9d9;
    transform: translateY(-1px);
}

.btn-purple {
    background: var(--purple);
    color: white;
    border: 1px solid rgba(121,134,203,0.4);
}

.btn-purple:hover { background: #8a96d4; transform: translateY(-1px); }

.btn-success {
    background: linear-gradient(135deg, var(--green), #059669);
    color: white;
}

.btn-success:hover { transform: translateY(-1px); }

.btn-danger {
    background: linear-gradient(135deg, #ffffff, #d1d5db);
    color: #000000;
}

.btn-danger:hover { transform: translateY(-1px); }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-bright);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--cyan);
    color: var(--cyan);
    background: var(--cyan-dim);
}

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 14px; }

.btn-full { width: 100%; justify-content: center; }

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar contraído (escritorio): solo iconos visibles ───── */
.app-layout.nav-collapsed .sidebar {
    width: 64px;
    transition: width 0.25s ease;
}
.app-layout.nav-collapsed .sidebar .sidebar-brand {
    justify-content: center;
    padding: 16px 8px;
    font-size: 0;            /* oculta texto, deja iconos */
}
.app-layout.nav-collapsed .sidebar .sidebar-brand .logo-icon { font-size: 22px; }
.app-layout.nav-collapsed .sidebar .nav-section { display: none; }
.app-layout.nav-collapsed .sidebar .nav-item {
    justify-content: center;
    padding: 12px 0;
    margin: 2px 8px;
    border-radius: 8px;
    position: relative;
}
/* Oculta texto del nav en modo collapsed (texto vive en .nav-text) */
.app-layout.nav-collapsed .sidebar .nav-item .nav-text { display: none; }
/* Backup: ocultar cualquier elemento adicional que no sea icon/badge/nav-text */
.app-layout.nav-collapsed .sidebar .nav-item > *:not(.icon):not(.badge):not(.nav-text) {
    display: none;
}
/* Ocultar text-nodes legacy: usamos font-size:0 sobre el nav-item y restauramos en hijos */
.app-layout.nav-collapsed .sidebar .nav-item { font-size: 0; }
.app-layout.nav-collapsed .sidebar .nav-item .icon  { font-size: 17px; margin: 0; }
.app-layout.nav-collapsed .sidebar .nav-item .badge { font-size: 9.5px; }
.app-layout.nav-collapsed .sidebar .nav-item .badge {
    position: absolute;
    top: 4px; right: 6px;
    transform: scale(0.85);
}
.app-layout.nav-collapsed .main-content { margin-left: 64px; }

/* Tooltip al hover en modo contraído */
.app-layout.nav-collapsed .sidebar .nav-item::after {
    content: attr(data-tip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translate(8px, -50%);
    background: rgba(15,22,40,0.96);
    color: #f1f5f9;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    border: 1px solid rgba(255,255,255,0.08);
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s;
    z-index: 200;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.app-layout.nav-collapsed .sidebar .nav-item:hover::after { opacity: 1; }

/* ── Modo TV: oculta sidebar + topbar para vista de pared ───── */
.app-layout.tv-mode .sidebar { display: none; }
.app-layout.tv-mode .main-content { margin-left: 0; }
.app-layout.tv-mode .topbar { display: none; }
.app-layout.tv-mode .page-content { padding: 14px; }
.app-layout.tv-mode body { overflow: hidden; }

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

.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 4px; }

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 18px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 17px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.3px;
}

.logo-icon {
    width: 34px; height: 34px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 16px; flex-shrink: 0;
    -webkit-text-fill-color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.sidebar-nav {
    padding: 10px 10px 20px;
    flex: 1;
}

.nav-section {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 16px 10px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    margin-bottom: 2px;
    position: relative;
}

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

.nav-item.active {
    background: var(--cyan-dim);
    color: var(--cyan);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 20%; bottom: 20%;
    width: 3px;
    background: var(--cyan);
    border-radius: 0 3px 3px 0;
}

.nav-item .icon {
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    font-size: 14px;
}

.nav-item .badge {
    margin-left: auto;
    background: #ffffff;
    color: #000000;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 20px;
    font-weight: 700;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
    height: var(--topbar-h);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.topbar h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ============================================================
   PAGE CONTENT
   ============================================================ */
.page-content {
    flex: 1;
    padding: 24px;
    overflow-x: hidden;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.card:hover { border-color: var(--border-bright); }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--border-bright);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-icon.cyan  { background: var(--cyan-dim); color: var(--cyan); }
.stat-icon.green { background: var(--green-dim); color: var(--green); }
.stat-icon.red   { background: var(--red-dim); color: var(--red); }
.stat-icon.yellow{ background: var(--yellow-dim); color: var(--yellow); }
.stat-icon.purple{ background: var(--purple-dim); color: #a78bfa; }

.stat-value {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    color: var(--text-primary);
}

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

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    background: var(--bg-surface);
    padding: 10px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 13px;
    vertical-align: middle;
}

tbody tr:hover td { background: rgba(255,255,255,0.02); }
tbody tr:last-child td { border-bottom: none; }

/* ============================================================
   BADGES / STATUS
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-success  { background: var(--green-dim); color: var(--green); }
.badge-danger   { background: var(--red-dim); color: var(--red); }
.badge-warning  { background: var(--yellow-dim); color: var(--yellow); }
.badge-info     { background: var(--cyan-dim); color: var(--cyan); }
.badge-purple   { background: var(--purple-dim); color: #a78bfa; }
.badge-muted    { background: rgba(255,255,255,0.06); color: var(--text-muted); }

.dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.dot-green  { background: var(--green); box-shadow: 0 0 6px var(--green); animation: pulse-green 2s infinite; }
.dot-red    { background: var(--red); box-shadow: 0 0 6px var(--red); }
.dot-yellow { background: var(--yellow); }
.dot-grey   { background: var(--text-muted); }

@keyframes pulse-green {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
}

/* ============================================================
   TOASTS
   ============================================================ */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    z-index: 9999;
    animation: slideIn 0.3s ease;
    max-width: 320px;
    box-shadow: var(--shadow-lg);
}

.toast-success { background: #064e3b; border: 1px solid var(--green); color: var(--green); }
.toast-error   { background: #000000; border: 1px solid #ffffff; color: #ffffff; }
.toast-info    { background: #0c1a2e; border: 1px solid var(--cyan); color: var(--cyan); }

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

/* ============================================================
   CODE BLOCKS
   ============================================================ */
.code-block {
    background: #060b14;
    border: 1px solid var(--border-bright);
    border-radius: 8px;
    padding: 14px 16px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 12px;
    color: #7dd3fc;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.7;
    position: relative;
}

.copy-btn {
    position: absolute;
    top: 8px; right: 8px;
    background: var(--border-bright);
    border: none;
    border-radius: 6px;
    padding: 4px 8px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 11px;
    transition: var(--transition);
}

.copy-btn:hover { background: var(--cyan-dim); color: var(--cyan); }

/* ============================================================
   PROGRESS BARS
   ============================================================ */
.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.progress-fill.cyan   { background: linear-gradient(90deg, var(--cyan), #0099cc); }
.progress-fill.green  { background: linear-gradient(90deg, var(--green), #059669); }
.progress-fill.red    { background: linear-gradient(90deg, #ffffff, #d1d5db); }
.progress-fill.yellow { background: linear-gradient(90deg, var(--yellow), #d97706); }

/* ============================================================
   GRID UTILITIES
   ============================================================ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    :root { --sidebar-w: 0px; }
    .sidebar {
        transform: translateX(-240px);
        width: 240px !important;     /* anula nav-collapsed en mobile */
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content { margin-left: 0 !important; }
    #menuBtn { display: flex !important; }
    /* En mobile no hay modo "solo iconos": el sidebar es siempre overlay drawer.
       Ocultamos el botón de colapsar y restauramos el texto si quedó nav-collapsed. */
    #navCollapseBtn { display: none !important; }
    .app-layout.nav-collapsed .sidebar { width: 240px !important; }
    .app-layout.nav-collapsed .sidebar .nav-item { font-size: inherit !important; justify-content: flex-start !important; padding: 12px 16px !important; margin: 0 !important; border-radius: 0 !important; }
    .app-layout.nav-collapsed .sidebar .nav-item .nav-text { display: inline !important; }
    .app-layout.nav-collapsed .sidebar .nav-section { display: block !important; }
    .app-layout.nav-collapsed .sidebar .sidebar-brand { font-size: 17px !important; padding: 20px 18px 16px !important; justify-content: flex-start !important; }
    /* Backdrop para cerrar el drawer haciendo click fuera */
    .sidebar.open ~ .main-content::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.55);
        z-index: 99;
        backdrop-filter: blur(2px);
    }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   METRIC GAUGES
   ============================================================ */
.gauge-ring {
    transform: rotate(-90deg);
}

.gauge-text {
    font-size: 18px;
    font-weight: 700;
    fill: var(--text-primary);
    text-anchor: middle;
    dominant-baseline: middle;
}

.gauge-sub {
    font-size: 9px;
    fill: var(--text-secondary);
    text-anchor: middle;
    dominant-baseline: middle;
}

/* ============================================================
   AGENT TASK PILL
   ============================================================ */
.task-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
}

.task-pill:hover { transform: scale(1.05); }

/* ============================================================
   NETWORK MAP
   ============================================================ */
#networkMap {
    width: 100%;
    height: 600px;
    background: #060b14;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.map-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.legend-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ============================================================
   DEVICE CARDS (network map side panel)
   ============================================================ */
.device-detail-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-lg);
    padding: 20px;
    min-height: 200px;
}

.device-detail-panel .device-ip {
    font-size: 20px;
    font-weight: 700;
    color: var(--cyan);
    margin-bottom: 4px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.detail-row:last-child { border-bottom: none; }

.detail-label { color: var(--text-muted); }
.detail-value { color: var(--text-primary); font-weight: 500; text-align: right; }

/* ============================================================
   SNMP SCAN PROGRESS
   ============================================================ */
.scan-progress-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
}

.scan-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cyan), var(--purple));
    border-radius: 2px;
    animation: scanMove 2s linear infinite;
    width: 30%;
}

@keyframes scanMove {
    0%   { margin-left: -30%; }
    100% { margin-left: 100%; }
}

/* ============================================================
   ALERTS / INFO BOXES
   ============================================================ */
.alert-box {
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 13px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
}

.alert-info    { background: rgba(91,155,213,0.08); border: 1px solid rgba(91,155,213,0.2); color: #7dd3fc; }
.alert-success { background: var(--green-dim); border: 1px solid rgba(16,185,129,0.2); color: #6ee7b7; }
.alert-warning { background: var(--yellow-dim); border: 1px solid rgba(245,158,11,0.2); color: #fcd34d; }
.alert-danger  { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.25); color: #ffffff; }

/* ============================================================
   TABS
   ============================================================ */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
    overflow-x: auto;
}

.tab {
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: var(--transition);
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: inherit;
}

.tab:hover { color: var(--text-primary); }

.tab.active {
    color: var(--cyan);
    border-bottom-color: var(--cyan);
}

/* ============================================================
   SEARCH INPUT
   ============================================================ */
.search-box {
    position: relative;
}

.search-box input {
    padding-left: 36px;
}

.search-box .fa-magnifying-glass {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 13px;
    pointer-events: none;
}

/* ============================================================
   WAZUH-STYLE AGENT STATUS CARD
   ============================================================ */
.agent-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    transition: var(--transition);
    cursor: default;
}

.agent-card:hover {
    border-color: var(--cyan);
    box-shadow: 0 0 20px rgba(91,155,213,0.08);
    transform: translateY(-1px);
}

.agent-card.online  { border-left: 3px solid var(--green); }
.agent-card.offline { border-left: 3px solid var(--red); }
.agent-card.pending { border-left: 3px solid var(--yellow); }

.agent-hostname {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.agent-ip {
    font-size: 12px;
    color: var(--cyan);
    font-family: monospace;
}

/* ============================================================
   METRIC MINI CARDS
   ============================================================ */
.metric-mini {
    background: var(--bg-surface);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.metric-mini-value {
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
}

.metric-mini-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline {
    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px; top: 0; bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
}

.timeline-dot {
    position: absolute;
    left: -20px;
    top: 4px;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--cyan);
    border: 2px solid var(--bg-card);
}

/* ============================================================
   SCROLLBAR GLOBAL
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================================
   UTILITIES
   ============================================================ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-auto { margin-top: auto; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-cyan { color: var(--cyan); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-yellow { color: var(--yellow); }
.font-bold { font-weight: 700; }
.font-mono { font-family: 'JetBrains Mono', 'Courier New', monospace; }
.w-full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
