:root {
    --bg-dark: #070b14;
    --bg-surface: #0c1220;
    --bg-card: rgba(13, 20, 36, 0.85);
    --bg-card-hover: rgba(18, 28, 50, 0.95);
    --border-card: rgba(255, 255, 255, 0.07);
    --border-subtle: rgba(255, 255, 255, 0.04);
    --border-accent: rgba(56, 189, 248, 0.3);
    --primary: #38bdf8;
    --primary-hover: #0ea5e9;
    --primary-glow: rgba(56, 189, 248, 0.25);
    --accent: #818cf8;
    --accent-purple: #c084fc;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-subtle: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-main);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.admin-wrapper {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* ============================================================================
   SIDEBAR NAVIGATION & CATEGORIES
   ============================================================================ */
.sidebar {
    width: 290px;
    background: linear-gradient(180deg, #090e1a 0%, #060911 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    flex-direction: column;
    padding: 20px 14px;
    flex-shrink: 0;
    box-shadow: 4px 0 28px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 8px 18px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    margin-bottom: 14px;
}

.brand-icon {
    font-size: 22px;
    font-weight: 800;
    color: #38bdf8;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.28) 0%, rgba(56, 189, 248, 0.06) 100%);
    border: 1px solid rgba(56, 189, 248, 0.45);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.2);
    flex-shrink: 0;
}

.brand-text h2 {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(90deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.badge-lan {
    font-size: 0.68rem;
    font-family: var(--font-mono);
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(56, 189, 248, 0.35);
    font-weight: 700;
    letter-spacing: 0.04em;
}

.pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
    display: inline-block;
    animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.85); }
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 4px;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
}

.nav-category {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    padding: 16px 10px 6px 10px;
    display: flex;
    align-items: center;
    opacity: 0.85;
}

.nav-category:first-of-type {
    padding-top: 2px;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid transparent;
    color: #cbd5e1;
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    transform: translateX(2px);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.16) 0%, rgba(99, 102, 241, 0.08) 100%);
    color: #38bdf8;
    font-weight: 600;
    border: 1px solid rgba(56, 189, 248, 0.3);
    box-shadow: inset 0 0 16px rgba(56, 189, 248, 0.08);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 6px;
    bottom: 6px;
    width: 3.5px;
    border-radius: 4px;
    background: linear-gradient(180deg, #38bdf8, #818cf8);
    box-shadow: 0 0 10px #38bdf8;
}

.nav-icon {
    font-size: 1.05rem;
    width: 32px;
    height: 32px;
    min-width: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 7px;
    transition: all 0.15s ease-in-out;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.nav-item:hover .nav-icon {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.3);
    color: #38bdf8;
    transform: scale(1.05);
}

.nav-item.active .nav-icon {
    background: rgba(56, 189, 248, 0.2);
    border-color: rgba(56, 189, 248, 0.45);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

.nav-label {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

.sidebar-footer {
    padding-top: 14px;
    margin-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.admin-user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 8px;
    transition: background 0.15s ease;
    flex-grow: 1;
}

.admin-user-card:hover {
    background: rgba(255, 255, 255, 0.05);
}

.admin-avatar {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: linear-gradient(135deg, #38bdf8 0%, #6366f1 100%);
    color: #fff;
    font-weight: 800;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
    flex-shrink: 0;
}

.admin-meta {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.admin-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.admin-role-badge {
    font-size: 0.65rem;
    color: #10b981;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.btn-sidebar-logout {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
    border-radius: 8px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.btn-sidebar-logout:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
    color: #ffffff;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.35);
    transform: scale(1.04);
}

/* ============================================================================
   MAIN CONTENT & HEADER
   ============================================================================ */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    background: var(--bg-dark);
}

.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 32px;
    border-bottom: 1px solid var(--border-card);
    background: rgba(11, 17, 32, 0.85);
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 5;
}

.header-title h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

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

.security-tag {
    font-size: 0.72rem;
    background: rgba(56, 189, 248, 0.1);
    color: #93c5fd;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid rgba(56, 189, 248, 0.25);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.content-body {
    padding: 24px 32px 40px 32px;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.hidden {
    display: none !important;
}

.view-panel.hidden {
    display: none !important;
}

/* ============================================================================
   METRICS GRID & STAT CARDS
   ============================================================================ */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stat-card {
    background: linear-gradient(180deg, rgba(16, 25, 46, 0.85) 0%, rgba(10, 16, 30, 0.95) 100%) !important;
    border: 1px solid var(--border-card) !important;
    border-radius: 10px !important;
    padding: 16px 18px !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.stat-card:hover {
    border-color: rgba(255, 255, 255, 0.14) !important;
    transform: translateY(-1px);
}

div[style*="background: rgba(0,0,0,0.25)"],
div[style*="background: rgba(0, 0, 0, 0.25)"],
div[style*="background: rgba(0,0,0,0.3)"],
div[style*="background: rgba(0, 0, 0, 0.3)"] {
    background: rgba(8, 12, 22, 0.55) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 10px !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.5), transparent);
}

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

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-main);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.stat-sub {
    font-size: 0.74rem;
    color: var(--text-subtle);
}

.text-success { color: var(--success) !important; }
.text-accent { color: #a78bfa !important; }
.text-danger { color: var(--danger) !important; }
.text-primary { color: #38bdf8 !important; }

/* Status Badges & Pills */
.pill-tag,
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-family: var(--font-mono);
}

.pill-green { background: rgba(16, 185, 129, 0.12); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.pill-blue { background: rgba(56, 189, 248, 0.12); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.pill-orange { background: rgba(245, 158, 11, 0.12); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.pill-red { background: rgba(239, 68, 68, 0.12); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.pill-purple { background: rgba(168, 85, 247, 0.12); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.pill-gray { background: rgba(156, 163, 175, 0.12); color: #9ca3af; border: 1px solid rgba(156, 163, 175, 0.25); }
.pill-yellow { background: rgba(245, 158, 11, 0.12); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }

/* ============================================================================
   PANEL CARDS, TOOLBARS & TABLES
   ============================================================================ */
.panel-card {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.85) 0%, rgba(10, 16, 30, 0.95) 100%);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    padding: 20px 22px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
}

.panel-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.panel-header.justify-between {
    justify-content: space-between;
}

.panel-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #f8fafc;
}

.panel-header p {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.dashboard-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

@media (max-width: 900px) {
    .dashboard-split {
        grid-template-columns: 1fr;
    }
}

.badge-live {
    font-size: 0.68rem;
    font-family: var(--font-mono);
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid rgba(16, 185, 129, 0.3);
    font-weight: 700;
}

/* Data Tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border-card);
    border-radius: 10px;
    background: rgba(8, 12, 22, 0.4);
}

.table-responsive .data-table {
    min-width: 780px;
}

.modal-card .table-responsive .data-table {
    min-width: 100%;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
    text-align: left;
}

.data-table th {
    padding: 11px 14px;
    color: var(--text-muted);
    background: rgba(15, 23, 42, 0.8);
    font-weight: 600;
    border-bottom: 1px solid var(--border-card);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.data-table td {
    padding: 11px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    vertical-align: middle;
}

.data-table tr:hover td {
    background: rgba(56, 189, 248, 0.035);
}

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

/* ============================================================================
   BUTTONS & FORM CONTROLS
   ============================================================================ */
.btn {
    padding: 7px 14px;
    border-radius: 7px;
    font-size: 0.84rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1.3;
    user-select: none;
}

.btn-primary {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    border-color: rgba(56, 189, 248, 0.35);
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
    border-color: rgba(56, 189, 248, 0.6);
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.45);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.76rem;
    border-radius: 6px;
}

.btn-full {
    width: 100%;
    padding: 10px;
}

.form-input {
    width: 100%;
    padding: 8px 12px;
    background: rgba(8, 12, 22, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 7px;
    color: var(--text-main);
    font-size: 0.83rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.form-input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.form-group {
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

/* ============================================================================
   MODALS & DIALOGS
   ============================================================================ */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(3, 7, 18, 0.82);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.modal-overlay.hidden { display: none; }

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

.modal-header.justify-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.modal-card {
    background: #0d1424;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 24px 28px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.modal-card.modal-lg {
    max-width: 880px;
    width: 95vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
}

.modal-brand {
    text-align: center;
    margin-bottom: 22px;
}

.modal-brand .brand-icon {
    display: inline-flex;
    margin-bottom: 10px;
}

.modal-brand p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.login-error {
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    color: #f87171;
    font-size: 0.8rem;
    text-align: center;
}

.auth-status {
    margin: 12px 0;
    padding: 8px 12px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 6px;
    color: #6ee7b7;
    font-size: 0.8rem;
    text-align: center;
}

.auth-link {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 4px;
    border: 0;
    background: transparent;
    color: #38bdf8;
    font: inherit;
    font-size: 0.82rem;
    cursor: pointer;
    text-align: center;
}

.auth-link:hover { text-decoration: underline; }

.messages-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
    flex-grow: 1;
    max-height: 280px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.msg-bubble {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    max-width: 80%;
}

.msg-user { background: rgba(59, 130, 246, 0.15); border: 1px solid rgba(59, 130, 246, 0.3); align-self: flex-start; }
.msg-agent { background: rgba(139, 92, 246, 0.15); border: 1px solid rgba(139, 92, 246, 0.3); align-self: flex-end; }

/* ==========================================================================
   REAL-TIME AUTOMOTIVE SPEEDOMETER CLUSTER DASHBOARD (2-ROW LAYOUT)
   ========================================================================== */
.speedometers-dashboard {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 24px;
    width: 100%;
}

/* Speedometer SVG Styling */
.speedo-auto-svg {
    background: radial-gradient(circle, #0e1422 0%, #060912 80%, #000000 100%);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.75), inset 0 0 18px rgba(0, 0, 0, 0.9);
    overflow: visible;
}

/* ROW 1: Main Hero Speedometer Card */
.speedo-hero-card {
    background: linear-gradient(180deg, #0e1628 0%, #080d19 100%);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
}

.speedo-hero-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.speedo-hero-body-vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 100%;
}

.speedo-gauge-wrapper-large {
    width: 280px;
    min-width: 280px;
    max-width: 280px;
    height: 280px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
}

.speedo-svg-large {
    width: 280px !important;
    height: 280px !important;
    max-width: 280px;
    display: block;
    margin: 0 auto;
}

.speedo-hero-stats-below {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    background: rgba(8, 12, 22, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 16px 22px;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .speedo-hero-stats-below {
        grid-template-columns: 1fr;
    }
}

.speedo-hero-stats-below .speedo-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
}

.speedo-stat-item .stat-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    color: var(--text-muted);
}

.speedo-stat-item .stat-val {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

.speedo-stat-item .stat-desc {
    font-size: 0.74rem;
    color: #64748b;
}

/* ROW 2: 4 Sub-Speedometers Grid in 1 row */
.sub-speedometers-row-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    width: 100%;
    box-sizing: border-box;
}

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

@media (max-width: 580px) {
    .sub-speedometers-row-4 {
        grid-template-columns: 1fr;
    }
}

.speedo-sub-card {
    background: linear-gradient(180deg, rgba(14, 20, 34, 0.9) 0%, rgba(8, 12, 22, 0.95) 100%);
    border: 1px solid var(--border-card);
    border-radius: 14px;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.speedo-sub-card:hover {
    transform: translateY(-2px);
    border-color: rgba(56, 189, 248, 0.35);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.speedo-gauge-wrapper-small {
    width: 160px;
    min-width: 160px;
    max-width: 160px;
    height: 160px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
}

.speedo-svg-small {
    width: 160px !important;
    height: 160px !important;
    max-width: 160px;
    display: block;
}

.speedo-sub-footer {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 8px;
    margin-top: 8px;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--font-mono);
}

/* Filter Tab Buttons */
.btn-tab {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-tab.active {
    background: rgba(56, 189, 248, 0.15);
    border-color: #38bdf8;
    color: #38bdf8;
    font-weight: 600;
}

.switch-toggle input:checked + .slider-toggle {
    background-color: #38bdf8 !important;
}

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

.slider-toggle:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .2s;
    border-radius: 50%;
}

/* Accessibility & Visible Focus */
:focus-visible {
    outline: 2px solid #38bdf8;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* P2P Screen Transport */
.p2p-ring-card {
    transition: border-color 0.2s ease, transform 0.15s ease;
}
.p2p-ring-card:hover {
    border-color: rgba(56, 189, 248, 0.4);
}

/* ==========================================================================
   NCC Unified Accessible Toast & System Dialog System
   ========================================================================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: 420px;
    width: calc(100vw - 40px);
}

.toast {
    pointer-events: auto;
    background: rgba(13, 20, 36, 0.96);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-card);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--text-main);
    font-size: 0.85rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: toastSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateY(-12px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.toast.toast-fadeOut {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
}

.toast-icon {
    font-size: 1.1rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast-content {
    flex: 1;
}

.toast-message {
    font-size: 0.82rem;
    color: #e2e8f0;
    line-height: 1.4;
    word-break: break-word;
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 4px;
    font-size: 1.1rem;
    line-height: 1;
    flex-shrink: 0;
}
.toast-close:hover { color: #fff; }

.toast-success { border-color: rgba(52, 211, 153, 0.4); background: rgba(6, 78, 59, 0.92); }
.toast-success .toast-icon { color: #34d399; }
.toast-error { border-color: rgba(248, 113, 113, 0.4); background: rgba(127, 29, 29, 0.92); }
.toast-error .toast-icon { color: #f87171; }
.toast-warning { border-color: rgba(251, 191, 36, 0.4); background: rgba(120, 53, 15, 0.92); }
.toast-warning .toast-icon { color: #fbbf24; }
.toast-info { border-color: rgba(56, 189, 248, 0.4); background: rgba(15, 23, 42, 0.95); }
.toast-info .toast-icon { color: #38bdf8; }

/* Accessible Dialog Modal */
.dialog-modal-card {
    max-width: 480px;
    width: 95vw;
    background: #0d1424;
    border: 1px solid var(--border-card);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}
