:root {
    --bg-app: #09090b;
    --bg-panel: #18181b;
    --bg-hover: #27272a;
    --border: #3f3f46;
    --border-light: rgba(255, 255, 255, 0.08);
    --text-main: #e4e4e7;
    --text-muted: #a1a1aa;
    /* BRAND ORANGE */
    --accent: #f97316; 
    --accent-hover: #ea580c;
    --danger: #ef4444;
    --nav-width: 260px;
}

/* --- BASE RESETS & VIEW TRANSITIONS --- */
html { 
    scrollbar-gutter: stable; 
    height: 100%; 
    color-scheme: dark;
}

body { 
    background-color: var(--bg-app); 
    color: var(--text-main); 
    font-family: 'Inter', system-ui, -apple-system, sans-serif; 
    margin: 0; 
    min-height: 100vh; 
    display: flex; 
    flex-direction: column; 
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { text-decoration: none; color: inherit; transition: color 0.2s, transform 0.2s; }

/* --- SCROLLBARS --- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #3f3f46; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #52525b; }

/* --- SMOOTH PAGE TRANSITIONS --- */
@view-transition {
    navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.25s;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- BACKGROUND VIGNETTE --- */
body::after {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 0;
    background: radial-gradient(circle at 50% 50%, transparent 0%, rgba(5, 5, 6, 0.6) 100%);
    pointer-events: none;
}

main, nav, footer, .admin-layout {
    position: relative;
    z-index: 1;
}

/* --- NAV & SIDEBAR (Glassmorphism) --- */
nav {
    background: rgba(24, 24, 27, 0.85) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light) !important;
}

.admin-sidebar {
    background: rgba(24, 24, 27, 0.85);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    box-sizing: border-box;
}

/* --- LAYOUTS --- */
.admin-layout { 
    display: grid; 
    grid-template-columns: var(--nav-width) 1fr; 
    min-height: 100vh;
}
.admin-content { padding: 30px; box-sizing: border-box; }

/* --- COMPONENTS --- */
.admin-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 24px;
    box-sizing: border-box;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: border-color 0.2s, transform 0.2s;
}
/* Only hover effect if it's likely interactive (context specific usually) or just subtle highlight */
.admin-card:hover { border-color: rgba(255,255,255,0.15); }

/* --- TYPOGRAPHY UTILS --- */
.text-accent { color: var(--accent) !important; }
.text-danger { color: var(--danger) !important; }
.text-muted { color: var(--text-muted) !important; }

.rating-ow { color: #60a5fa !important; }
.rating-sc { color: #34d399 !important; }
.rating-ov { color: #facc15 !important; }

/* --- NAVIGATION LINKS --- */
.nav-section { margin-bottom: 24px; }
.nav-label {
    text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.08em;
    color: var(--text-muted); margin-bottom: 8px; font-weight: 700; padding-left: 12px;
}
.nav-link {
    display: block; padding: 10px 12px; border-radius: 8px; margin-bottom: 2px;
    color: var(--text-main); border-left: 3px solid transparent;
    transition: 0.2s; font-weight: 500; font-size: 0.9rem;
}
.nav-link:hover { background: var(--bg-hover); color: white; }
.nav-link.active { 
    background: rgba(249, 115, 22, 0.1); 
    color: var(--accent); 
    border-left-color: var(--accent);
}

/* --- BUTTONS --- */
.btn-modern {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 8px 16px; border-radius: 8px; font-weight: 600; font-size: 0.9rem;
    background: var(--bg-hover); border: 1px solid var(--border); color: var(--text-main);
    cursor: pointer; transition: 0.2s; text-decoration: none;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.btn-modern:hover { 
    background: #3f3f46; color: #fff; border-color: #52525b; 
    transform: translateY(-1px);
}
.btn-modern:active { transform: translateY(0); }

.btn-primary { 
    background: var(--accent); border-color: var(--accent); color: #000; 
}
.btn-primary:hover { 
    background: var(--accent-hover); border-color: var(--accent-hover); color: #fff;
}

/* --- FORMS --- */
input, select, textarea {
    background: #0f1115;
    border: 1px solid var(--border);
    color: white;
    padding: 10px 12px;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.25);
}
input[type="checkbox"] { width: auto; accent-color: var(--accent); }

/* --- TABLES --- */
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.data-table th { 
    text-align: left; color: var(--text-muted); font-size: 0.8rem; 
    text-transform: uppercase; padding: 14px; 
    border-bottom: 1px solid var(--border); 
    background: var(--bg-panel); /* Sticky headers need bg */
    position: sticky; top: 0; z-index: 10;
    letter-spacing: 0.05em;
    font-weight: 600;
}
.data-table td { padding: 14px; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
.clickable-row { transition: background 0.1s; }
.clickable-row:hover { background: var(--bg-hover); cursor: pointer; }

/* Fix borders on rounded tables */
.data-table tr:last-child td { border-bottom: none; }

/* --- BADGES --- */
.badge { padding: 4px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; }
.badge-ow { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-sc { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-ov { background: rgba(234, 179, 8, 0.15); color: #facc15; border: 1px solid rgba(234, 179, 8, 0.3); }

/* Driver License Squares */
.lic-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border-radius: 6px; font-weight: 800; color: white;
    font-size: 0.85rem; border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.lic-A { background: linear-gradient(135deg, #2563eb, #1d4ed8); } 
.lic-B { background: linear-gradient(135deg, #059669, #047857); } 
.lic-C { background: linear-gradient(135deg, #eab308, #ca8a04); }
.lic-D { background: linear-gradient(135deg, #f97316, #ea580c); } 
.lic-R { background: linear-gradient(135deg, #52525b, #3f3f46); }

/* --- STATS GRID --- */
.stat-box { 
    background: var(--bg-hover); 
    border-radius: 8px; 
    border: 1px solid var(--border-light); 
    margin-bottom: 16px; 
    overflow: hidden; 
}
.stat-series { 
    display: block; font-size: 0.75rem; font-weight: 800; 
    text-transform: uppercase; padding: 10px 14px; 
    background: rgba(0,0,0,0.3); 
    border-bottom: 1px solid var(--border-light); 
    letter-spacing: 0.05em;
}
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; padding: 12px; }
.stat-val { font-size: 1.25rem; font-weight: 800; color: #fff; line-height: 1.2; }
.stat-label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; font-weight: 600; }
.stat-rating { 
    font-family: 'JetBrains Mono', monospace; font-size: 1rem; font-weight: 700; 
    margin-top: 5px; display: block; text-align: center; padding-bottom: 12px; 
}

/* --- ANIMATIONS --- */
.reveal-row {
    opacity: 0; transform: translateY(10px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}
.reveal-row.is-visible { opacity: 1; transform: translateY(0); }

/* --- REPORT MODAL --- */
.report-modal { 
    display: none; position: fixed; z-index: 9999; left: 0; top: 0; width: 100%; height: 100%; 
    background-color: rgba(9, 9, 11, 0.96); backdrop-filter: blur(8px); 
    align-items: center; justify-content: center; cursor: zoom-out; 
    opacity: 0; transition: opacity 0.2s ease; 
}
.report-modal.active { display: flex; opacity: 1; }
.report-content { 
    max-width: 95%; max-height: 95%; border-radius: 8px; 
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8); border: 1px solid rgba(255,255,255,0.1); 
    opacity: 0; transform: scale(0.95); transition: transform 0.2s, opacity 0.2s; 
}
.report-modal.active .report-content { opacity: 1; transform: scale(1); }

/* --- CANVAS --- */
#beamgp-bg {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1; pointer-events: none; background-color: var(--bg-app); 
    opacity: 0; transition: opacity 0.5s ease-in;
}
#beamgp-bg.loaded { opacity: 1; }