/*
   Bademler Network — Premium Light Monitoring Dashboard
   Design: Clean White + Slate | Enterprise SaaS | Linear/Stripe Inspired
   Font: Inter (UI) + JetBrains Mono (data)
*/
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ═══════════════════════════════════════════════════════
   DESIGN TOKENS
═══════════════════════════════════════════════════════ */
:root {
    /* Backgrounds */
    --bg-base:        #f1f5f9;
    --bg-app:         #f8fafc;
    --bg-surface:     #ffffff;
    --bg-elevated:    #f1f5f9;
    --bg-hover:       #e9f0fb;
    --bg-card:        #ffffff;

    /* Borders */
    --border-subtle:  rgba(0,0,0,0.04);
    --border-color:   #e2e8f0;
    --border-hover:   #c7d2e0;
    --border-glow:    rgba(99,102,241,0.25);

    /* Text */
    --text-primary:   #0f172a;
    --text-secondary: #475569;
    --text-muted:     #94a3b8;
    --text-900:       #020617;

    /* Brand Accent — Indigo */
    --brand-primary:       #4f46e5;
    --brand-primary-light: #6366f1;
    --brand-primary-glow:  rgba(79,70,229,0.15);
    --brand-light:         #eef2ff;

    /* Semantic */
    --brand-success:       #059669;
    --brand-success-light: #ecfdf5;
    --brand-success-glow:  rgba(5,150,105,0.15);

    --brand-danger:        #dc2626;
    --brand-danger-light:  #fef2f2;
    --brand-danger-glow:   rgba(220,38,38,0.15);

    --brand-warning:       #d97706;
    --brand-warning-light: #fffbeb;

    --brand-info:          #0891b2;
    --brand-info-light:    #ecfeff;

    --brand-purple:        #7c3aed;
    --brand-purple-light:  #f5f3ff;

    /* Shadows */
    --shadow-sm:  0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:  0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.05);
    --shadow-lg:  0 10px 40px rgba(0,0,0,0.1), 0 4px 16px rgba(0,0,0,0.06);
    --shadow-glow: 0 0 20px rgba(79,70,229,0.12), 0 4px 16px rgba(0,0,0,0.06);

    /* Radius */
    --radius-xs:  4px;
    --radius-sm:  8px;
    --radius-md:  12px;
    --radius-lg:  16px;
    --radius-xl:  20px;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Transitions */
    --transition-fast:   all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ═══════════════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════════════ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 14px; background: var(--bg-base); scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    background: var(--bg-app);
    color: var(--text-secondary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.2;
}

code {
    font-family: var(--font-mono);
    font-size: 0.82em;
    background: var(--brand-light);
    color: var(--brand-primary);
    padding: 0.15em 0.45em;
    border-radius: var(--radius-xs);
    border: 1px solid rgba(79,70,229,0.12);
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

::selection { background: rgba(79,70,229,0.15); color: var(--text-primary); }

/* ═══════════════════════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════════════════════ */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-online {
    0%, 100% { box-shadow: 0 0 0 0 rgba(5,150,105,0.4); }
    50%       { box-shadow: 0 0 0 6px rgba(5,150,105,0); }
}

@keyframes pulse-danger {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.35); }
    50%       { box-shadow: 0 0 0 5px rgba(220,38,38,0); }
}

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

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-6px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ═══════════════════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════════════════ */
.app-container { display: flex; min-height: 100vh; }

/* ═══════════════════════════════════════════════════════
   SIDEBAR — Premium Light
═══════════════════════════════════════════════════════ */
.sidebar {
    width: 252px;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    box-shadow: 2px 0 12px rgba(0,0,0,0.04);
    padding: 1.25rem 0.75rem;
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Logo */
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.25rem 0.5rem 1.5rem;
}

.sidebar-logo-icon {
    width: 38px; height: 38px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 60%, #06b6d4 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(79,70,229,0.3), 0 0 0 1px rgba(79,70,229,0.1);
}

.sidebar-logo-text { display: flex; flex-direction: column; }

.sidebar-logo-text strong {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.sidebar-logo-text small {
    font-size: 0.6rem;
    color: var(--brand-primary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
    margin-top: 1px;
}

/* Section Label */
.sidebar-section-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    padding: 0 0.75rem;
    margin: 1.25rem 0 0.35rem;
    font-weight: 700;
}

/* Menu */
.sidebar-menu { list-style: none; display: flex; flex-direction: column; gap: 2px; }

.sidebar-item a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition-fast);
    position: relative;
}

.sidebar-item a i {
    font-size: 1rem;
    width: 18px;
    text-align: center;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.sidebar-item a:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
}

.sidebar-item a:hover i { color: var(--text-secondary); }

.sidebar-item.active a {
    color: var(--brand-primary);
    background: var(--brand-light);
    font-weight: 600;
}

.sidebar-item.active a i { color: var(--brand-primary); }

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

/* ═══════════════════════════════════════════════════════
   MAIN CONTENT
═══════════════════════════════════════════════════════ */
.main-content {
    flex: 1;
    margin-left: 252px;
    padding: 2rem 2rem 3rem;
    min-height: 100vh;
    animation: fadeUp 0.35s ease both;
}

/* ═══════════════════════════════════════════════════════
   PAGE HEADER
═══════════════════════════════════════════════════════ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.page-title h1 {
    font-size: 1.65rem;
    font-weight: 800;
    margin-bottom: 0.2rem;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.page-title p { color: var(--text-secondary); font-size: 0.875rem; }

/* ═══════════════════════════════════════════════════════
   CARDS
═══════════════════════════════════════════════════════ */
.card, .glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.card:hover, .glass-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.card-heading {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-heading i { font-size: 1rem; }

/* ═══════════════════════════════════════════════════════
   STAT CARDS
═══════════════════════════════════════════════════════ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card-gradient {
    border-radius: var(--radius-lg);
    padding: 1.35rem 1.5rem;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-sm);
}

/* Color accent bar on left */
.stat-card-gradient::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    border-radius: 4px 0 0 4px;
}

.stat-card-gradient .stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 0.4rem;
}

.stat-card-gradient .stat-value {
    font-size: 2.1rem;
    font-weight: 800;
    font-family: var(--font-mono);
    letter-spacing: -1px;
    line-height: 1;
}

.stat-card-gradient .stat-icon-bg {
    position: absolute;
    bottom: 0.75rem; right: 1rem;
    font-size: 2.8rem;
    opacity: 0.06;
    transition: var(--transition-smooth);
}

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

.stat-card-gradient:hover .stat-icon-bg {
    opacity: 0.11;
    transform: scale(1.1) rotate(-5deg);
}

/* Variants */
.grad-blue::before    { background: var(--brand-primary); }
.grad-blue .stat-value { color: var(--brand-primary); }

.grad-emerald::before  { background: var(--brand-success); }
.grad-emerald .stat-value { color: var(--brand-success); }

.grad-rose::before     { background: var(--brand-danger); }
.grad-rose .stat-value { color: var(--brand-danger); }

.grad-amber::before    { background: var(--brand-warning); }
.grad-amber .stat-value { color: var(--brand-warning); }

.grad-violet::before   { background: var(--brand-purple); }
.grad-violet .stat-value { color: var(--brand-purple); }

/* ═══════════════════════════════════════════════════════
   CHART GRIDS
═══════════════════════════════════════════════════════ */
.charts-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.charts-3col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.charts-full { margin-bottom: 1rem; }

/* ═══════════════════════════════════════════════════════
   TABLES
═══════════════════════════════════════════════════════ */
.table-container { width: 100%; overflow-x: auto; }

.custom-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }

.custom-table thead th {
    padding: 0.7rem 1rem;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-muted);
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.custom-table tbody td {
    padding: 0.9rem 1rem;
    color: var(--text-secondary);
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    transition: var(--transition-fast);
}

.custom-table tbody tr { background: #ffffff; transition: var(--transition-fast); }

.custom-table tbody tr:hover td {
    background: #f8fafc;
    color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════
   FORMS
═══════════════════════════════════════════════════════ */
.form-group { margin-bottom: 1.25rem; }

.form-group label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.form-control {
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    transition: var(--transition-fast);
    -webkit-appearance: none;
    appearance: none;
}

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

.form-control:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-primary-glow);
}

select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    background-size: 16px;
    padding-right: 2.25rem;
    cursor: pointer;
}

.search-wrapper { position: relative; width: 280px; }
.search-wrapper i {
    position: absolute;
    left: 12px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.95rem;
    pointer-events: none;
}
.search-wrapper .form-control { padding-left: 2.25rem; }

/* ═══════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.58rem 1.1rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition-fast);
    white-space: nowrap;
    user-select: none;
}

.btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

.btn-primary {
    background: var(--brand-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(79,70,229,0.2);
}
.btn-primary:hover {
    background: #4338ca;
    box-shadow: 0 4px 16px rgba(79,70,229,0.3);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #ffffff;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background: #f8fafc;
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--brand-danger);
    color: #fff;
    box-shadow: 0 2px 8px rgba(220,38,38,0.2);
}
.btn-danger:hover {
    background: #b91c1c;
    box-shadow: 0 4px 14px rgba(220,38,38,0.3);
    transform: translateY(-1px);
}

.btn-sm { padding: 0.32rem 0.7rem; font-size: 0.75rem; border-radius: var(--radius-xs); }

/* ═══════════════════════════════════════════════════════
   BADGES
═══════════════════════════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.badge-blue    { background: var(--brand-light);           color: var(--brand-primary);       border-color: rgba(79,70,229,0.15); }
.badge-violet, .badge-purple { background: var(--brand-purple-light); color: var(--brand-purple); border-color: rgba(124,58,237,0.15); }
.badge-indigo  { background: #eef2ff;                      color: #6366f1;                    border-color: rgba(99,102,241,0.15); }
.badge-success, .badge-emerald { background: var(--brand-success-light); color: var(--brand-success); border-color: rgba(5,150,105,0.15); }
.badge-danger, .badge-rose { background: var(--brand-danger-light); color: var(--brand-danger); border-color: rgba(220,38,38,0.15); }
.badge-cyan    { background: var(--brand-info-light);       color: var(--brand-info);          border-color: rgba(8,145,178,0.15); }
.badge-amber   { background: var(--brand-warning-light);    color: var(--brand-warning);       border-color: rgba(217,119,6,0.15); }
.badge-secondary { background: #f1f5f9;                    color: var(--text-secondary);       border-color: #e2e8f0; }

.vendor-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-xs);
    background: #f1f5f9;
    color: var(--text-secondary);
    border: 1px solid #e2e8f0;
    margin-left: 0.3rem;
}

/* ═══════════════════════════════════════════════════════
   STATUS INDICATORS
═══════════════════════════════════════════════════════ */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    font-weight: 600;
}

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

.status-dot.online {
    background: var(--brand-success);
    animation: pulse-online 2.2s ease infinite;
}

.status-dot.idle {
    background: var(--brand-warning);
    animation: pulse-idle 2.8s ease infinite;
}

.status-dot.offline {
    background: var(--brand-danger);
    animation: pulse-danger 2.5s ease infinite;
}

@keyframes pulse-idle {
    0%, 100% { box-shadow: 0 0 0 0 rgba(217,119,6,0.45); }
    50%       { box-shadow: 0 0 0 5px rgba(217,119,6,0); }
}

/* Idle badge */
.badge-idle { background: var(--brand-warning-light); color: var(--brand-warning); border-color: rgba(217,119,6,0.2); }

/* Idle device block style */
.device-block-icon.idle-icon {
    background: var(--brand-warning-light);
    color: var(--brand-warning);
    border-color: rgba(217,119,6,0.2);
}


/* ═══════════════════════════════════════════════════════
   FILTER TABS
═══════════════════════════════════════════════════════ */
.filter-tabs {
    display: inline-flex;
    gap: 2px;
    background: #f1f5f9;
    padding: 3px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.filter-tab-btn {
    background: transparent;
    border: none;
    padding: 0.38rem 0.85rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-family: var(--font-sans);
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

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

.filter-tab-btn.active {
    background: #ffffff;
    color: var(--brand-primary);
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.filterable-block { transition: all 0.3s ease; opacity: 1; max-height: 4000px; }
.filterable-block.hidden-block {
    opacity: 0; max-height: 0 !important;
    padding: 0 !important; margin: 0 !important;
    overflow: hidden; pointer-events: none;
}

/* ═══════════════════════════════════════════════════════
   VIEW TOGGLE
═══════════════════════════════════════════════════════ */
.view-toggle-container {
    display: flex;
    background: #f1f5f9;
    padding: 3px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    gap: 2px;
}

.view-toggle-btn {
    background: transparent;
    border: none;
    width: 32px; height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 1rem;
}

.view-toggle-btn.active {
    background: #ffffff;
    color: var(--brand-primary);
    box-shadow: var(--shadow-sm);
}

/* ═══════════════════════════════════════════════════════
   DEVICE CARDS
═══════════════════════════════════════════════════════ */
.device-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 1.1rem;
    margin-top: 1rem;
}

.device-block {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.35rem;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 230px;
    box-shadow: var(--shadow-sm);
}

.device-block:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--border-hover);
}

.device-block-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.75rem; }

.device-block-icon {
    width: 38px; height: 38px;
    border-radius: var(--radius-sm);
    background: #f1f5f9;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    border: 1px solid var(--border-color);
}

.device-block-icon.offline-icon {
    background: var(--brand-danger-light);
    color: var(--brand-danger);
    border-color: rgba(220,38,38,0.15);
}

.device-block-title { font-size: 0.97rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.15rem; }

.device-block-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.device-block-body div {
    display: flex;
    justify-content: space-between;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid #f1f5f9;
}

.device-block-body div:last-child { border-bottom: none; }

.device-block-footer {
    margin-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
    padding-top: 0.6rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.device-card-chart-container {
    width: 100%;
    height: 44px;
    margin: 0.5rem 0;
    background: #f8fafc;
    border-radius: var(--radius-xs);
    overflow: hidden;
    border: 1px solid #f1f5f9;
}

.cyber-device-canvas { width: 100%; height: 100%; display: block; }

/* ═══════════════════════════════════════════════════════
   DETAIL GRID
═══════════════════════════════════════════════════════ */
.detail-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 1.25rem; }
.info-list { list-style: none; }
.info-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.875rem;
}
.info-list li:last-child { border-bottom: none; }
.info-label { color: var(--text-muted); font-weight: 500; font-size: 0.82rem; }
.info-val { font-weight: 600; color: var(--text-primary); text-align: right; }

/* ═══════════════════════════════════════════════════════
   ALERTS
═══════════════════════════════════════════════════════ */
.alert {
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    animation: fadeUp 0.3s ease;
}

.alert-success { background: var(--brand-success-light); color: var(--brand-success); border-color: rgba(5,150,105,0.2); }
.alert-danger  { background: var(--brand-danger-light);  color: var(--brand-danger);  border-color: rgba(220,38,38,0.2); }
.alert i { font-size: 1.2rem; }

/* ═══════════════════════════════════════════════════════
   TOPOLOGY
═══════════════════════════════════════════════════════ */
#topology-network {
    width: 100%;
    height: 580px;
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

/* ═══════════════════════════════════════════════════════
   FLOORPLAN / BLUEPRINT
═══════════════════════════════════════════════════════ */
.floorplan-workspace {
    background-color: #f8fafc;
    background-image:
        linear-gradient(rgba(0,0,0,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.025) 1px, transparent 1px);
    background-size: 20px 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.floorplan-sidebar { background: #ffffff; border: 1px solid var(--border-color); }

.device-drag-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.device-drag-card:hover { border-color: var(--brand-primary); box-shadow: var(--shadow-sm); }

.device-info strong { color: var(--text-primary); }
.device-info small  { color: var(--text-secondary); }

/* Map Markers */
.map-marker { background: #ffffff !important; border: 2px solid var(--brand-primary) !important; color: var(--brand-primary) !important; box-shadow: var(--shadow-sm) !important; }
.map-marker:hover { box-shadow: var(--shadow-md) !important; }
.map-marker.active-marker { box-shadow: 0 0 0 3px rgba(79,70,229,0.2), var(--shadow-md) !important; }
.marker-nvr { border-color: var(--brand-warning) !important; color: var(--brand-warning) !important; }
.marker-camera { border-color: var(--brand-danger) !important; color: var(--brand-danger) !important; }
.fov-path { fill: rgba(220,38,38,0.05) !important; stroke: rgba(220,38,38,0.2) !important; }

.nvr-highlight-btn { border: 1px solid var(--border-color); background: #ffffff; color: var(--text-secondary); transition: var(--transition-fast); }
.nvr-highlight-btn:hover { background: #f8fafc; color: var(--text-primary); }
.nvr-highlight-btn.active { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); box-shadow: 0 2px 8px rgba(79,70,229,0.2); }

.marker-edit-panel { background: #ffffff !important; border: 1px solid var(--border-color) !important; color: var(--text-primary) !important; box-shadow: var(--shadow-lg) !important; }
.panel-row label { color: var(--text-muted); }
.panel-row span  { color: var(--text-primary); }

/* ═══════════════════════════════════════════════════════
   ANALYTICS / AUDIT CONSOLE
═══════════════════════════════════════════════════════ */
.analyst-glow-container {
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    background: #ffffff;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    position: relative;
}

.analyst-glow-container::before {
    content: 'SYSTEM AUDIT CONSOLE';
    position: absolute;
    top: -9px; left: 15px;
    background: var(--bg-app);
    padding: 0 8px;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--brand-primary);
    letter-spacing: 1px;
    font-weight: 700;
}

.cyber-critical-alert {
    border-left: 3px solid var(--brand-danger);
    background: var(--brand-danger-light);
    padding: 0.75rem 1rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(220,38,38,0.12);
    border-left: 3px solid var(--brand-danger);
}

.cyber-warning-alert {
    border-left: 3px solid var(--brand-warning);
    background: var(--brand-warning-light);
    padding: 0.75rem 1rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(217,119,6,0.12);
    border-left: 3px solid var(--brand-warning);
}

.analysis-terminal-log {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: var(--radius-md);
    padding: 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #94a3b8;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.4);
    line-height: 1.6;
}

.analysis-terminal-log p { margin-bottom: 0.4rem; }
.analysis-terminal-log .log-timestamp { color: #ec4899; margin-right: 0.5rem; }
.analysis-terminal-log .log-tag { color: #38bdf8; margin-right: 0.5rem; }

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
    .charts-3col { grid-template-columns: 1fr 1fr; }
}

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

@media (max-width: 800px) {
    .sidebar { width: 60px; padding: 1.25rem 0.4rem; }
    .sidebar-logo-text, .sidebar-section-label, .sidebar-item a span { display: none; }
    .sidebar-item a { justify-content: center; padding: 0.65rem; }
    .sidebar-item.active a::before { display: none; }
    .main-content { margin-left: 60px; padding: 1.25rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .page-header { flex-direction: column; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .main-content { padding: 1rem; }
}
