:root {
    --sm-sidebar-bg: #0b1220;
    --sm-sidebar-width: 260px;
    --sm-accent: #2563eb;
    --sm-sidebar-text: #dbeafe;
    --sm-sidebar-muted: #94a3b8;
    --sm-sidebar-hover-bg: #1e293b;
    --sm-sidebar-active-bg: #1d4ed8;
}

body {
    background: #f4f6f9;
    -webkit-font-smoothing: auto;
    -moz-osx-font-smoothing: auto;
}

.sm-shell { min-height: 100vh; }

.sm-sidebar {
    width: var(--sm-sidebar-width);
    background: var(--sm-sidebar-bg);
    color: var(--sm-sidebar-text);
    flex-shrink: 0;
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: auto;
    -moz-osx-font-smoothing: auto;
    text-rendering: optimizeSpeed;
}

.sm-sidebar .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--sm-accent);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
}

.sm-sidebar .sm-brand-title {
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.sm-sidebar .sm-brand-tagline {
    color: #cbd5e1;
    font-size: 0.8125rem;
    line-height: 1.3;
}

.sm-sidebar .nav-link {
    color: var(--sm-sidebar-text);
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0.7rem 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none;
    transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.sm-sidebar .nav-link i {
    width: 1.125rem;
    font-size: 1.05rem;
    line-height: 1;
    text-align: center;
    flex-shrink: 0;
}

.sm-sidebar .nav-link:hover {
    color: #fff;
    background: var(--sm-sidebar-hover-bg);
    border-color: #334155;
}

.sm-sidebar .nav-link.active {
    color: #fff;
    background: var(--sm-sidebar-active-bg);
    border-color: #3b82f6;
}

.sm-main { flex: 1; min-width: 0; }
.sm-topbar { background: #fff; border-bottom: 1px solid #dee2e6; }
.sm-content { padding: 1.5rem; }

.stat-card { border: 0; box-shadow: 0 .125rem .25rem rgba(0,0,0,.075); height: 100%; }
.stat-card .stat-label { color: #6c757d; font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; }
.stat-card .stat-value { font-size: 1.75rem; font-weight: 700; }
.stat-online { border-left: 4px solid #198754; }
.stat-offline { border-left: 4px solid #dc3545; }
.stat-warning { border-left: 4px solid #fd7e14; }
.stat-info { border-left: 4px solid #0d6efd; }

.device-tree-parent { background: #f8fafc; }
.device-tree-parent td { border-top-width: 2px; }
.device-tree-child td { background: #fff; }
.device-tree-child td:nth-child(2) { border-left: 3px solid #dbeafe; }
.device-tree-empty td { background: #fcfcfc; }
.device-tree-toggle-btn { line-height: 1; vertical-align: middle; text-decoration: none; }
.device-tree-toggle-btn:hover { color: #0d6efd !important; }
.device-tree-chevron { transition: transform 0.15s ease; display: inline-block; }
.device-tree-toggle-btn[aria-expanded="true"] .device-tree-chevron { transform: rotate(90deg); }
.device-tree-camera-panel > td { background: #fff; border-top: 0 !important; }
.device-tree-camera-panel[hidden] { display: none; }
.device-tree-camera-panel:not([hidden]) { display: table-row; }
.device-tree-nested { background: #fff; }
.device-tree-nested td:first-child { border-left: 3px solid #dbeafe; }

.auth-wrap {
    min-height: 100vh;
    background: linear-gradient(135deg, #0b1220 0%, #1e3a8a 100%);
}

@media (max-width: 991.98px) {
    .sm-sidebar { width: 100%; }
}
