/* ═══════════════════════════════════════════════════════
   ROADLINE — Cleverwise-Inspired Design System
   Deep purple-black · 20px cards · Libre Franklin + Mulish
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Libre+Franklin:wght@400;500;600;700;800&family=Mulish:wght@400;500;600;700&display=swap');

:root {
    /* ── Surfaces — Deep Purple Stack ── */
    --bg-root: #12071d;
    --bg-surface: #21182c;
    --bg-elevated: #2f233c;
    --bg-subtle: #37333b;

    /* Backward-compat aliases */
    --bg-main: var(--bg-root);
    --bg-card: var(--bg-surface);
    --bg-card-hover: var(--bg-elevated);
    --bg-input: #1a1026;
    --bg-sidebar: #260e5e;
    --bg-sidebar-hover: rgba(255,255,255,0.06);
    --bg-sidebar-active: rgba(175,255,182,1);
    --bg-topbar: var(--bg-surface);
    --bg-overlay: rgba(18,7,29,0.75);

    /* ── Borders ── */
    --border: rgba(255,255,255,0.06);
    --border-light: rgba(255,255,255,0.04);
    --border-hover: rgba(255,255,255,0.10);
    --border-strong: rgba(255,255,255,0.14);
    --border-focus: var(--accent);

    /* ── Text ── */
    --text-primary: #ffffff;
    --text-secondary: #e0e3e9;
    --text-muted: #959ca6;
    --text-faint: #635b6c;
    --text-white: #ffffff;

    /* ── Accent — Purple Primary ── */
    --accent: #9466f2;
    --accent-hover: #a57dff;
    --accent-subtle: rgba(148,102,242,0.12);
    --primary: #9466f2;
    --primary-light: #a57dff;
    --primary-dark: #7b4fd9;
    --primary-glow: rgba(148,102,242,0.15);
    --primary-glow-strong: rgba(148,102,242,0.25);

    /* ── Highlight — Mint Green Active ── */
    --highlight: #afffb6;
    --highlight-text: #12071d;

    /* Backward-compat aliases */
    --forest: var(--accent);
    --forest-light: var(--primary-light);
    --forest-dark: var(--primary-dark);
    --forest-glow: var(--primary-glow);
    --forest-glow-strong: var(--primary-glow-strong);
    --burnt: var(--accent);
    --burnt-light: var(--primary-light);
    --burnt-dark: var(--primary-dark);
    --burnt-glow: var(--primary-glow);
    --burnt-orange: var(--accent);
    --burnt-orange-light: var(--primary-light);
    --burnt-orange-dark: var(--primary-dark);
    --blue: #1f74ec;

    /* ── Semantic colors ── */
    --green: #23eb30;
    --green-bg: rgba(35,235,48,0.10);
    --red: #f87171;
    --red-bg: rgba(248,113,113,0.10);
    --orange: #f9aa3c;
    --orange-bg: rgba(249,170,60,0.10);
    --purple: #9466f2;
    --purple-bg: rgba(148,102,242,0.10);
    --cyan: #22d3ee;
    --blue-bg: rgba(31,116,236,0.10);

    /* ── Layout ── */
    --sidebar-w: 280px;
    --topbar-h: 54px;
    --radius: 20px;
    --radius-sm: 12px;
    --radius-lg: 24px;

    /* ── Shadows ── */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.25);
    --shadow-card: 0 2px 8px rgba(0,0,0,0.2);
    --shadow-elevated: 0 8px 24px rgba(0,0,0,0.35);
    --shadow-modal: 0 32px 64px rgba(0,0,0,0.5);

    /* ── Transitions ── */
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --dur: 150ms;
    --dur-fast: 100ms;

    /* Gray scale aliases */
    --gray-950: var(--bg-root);
    --gray-900: var(--bg-surface);
    --gray-800: var(--bg-elevated);
    --gray-700: var(--bg-subtle);
    --gray-600: var(--text-faint);
    --gray-500: var(--text-muted);
    --gray-400: var(--text-secondary);
    --gray-300: var(--text-primary);
    --gray-100: #f4f5f7;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
    font-family: 'Mulish', system-ui, -apple-system, sans-serif;
    background: var(--bg-root);
    color: var(--text-secondary);
    min-height: 100vh;
    line-height: 1.5;
    font-size: 13.5px;
    letter-spacing: -0.006em;
    overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
::selection { background: var(--primary-glow-strong); color: white; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.12); }

/* ═══════════════════════════════════════════
   SIDEBAR — Deep Purple
   ═══════════════════════════════════════════ */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-sidebar);
    display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0;
    height: 100vh; z-index: 40;
    overflow: hidden;
}
.sidebar::-webkit-scrollbar { width: 0; }
.sidebar-brand {
    height: var(--topbar-h);
    padding: 0 1.25rem;
    display: flex; align-items: center; gap: 0.625rem;
    flex-shrink: 0;
}
.sidebar-brand .logo {
    width: 32px; height: 32px; border-radius: 10px;
    background: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; color: white; font-size: 0.875rem;
    flex-shrink: 0;
    box-shadow: 0 0 20px var(--primary-glow);
}
.sidebar-brand span {
    font-family: 'Libre Franklin', sans-serif;
    font-size: 0.875rem; font-weight: 800; color: var(--text-primary);
    letter-spacing: -0.04em;
}
.sidebar nav {
    flex: 1; padding: 0.5rem 0.75rem;
    overflow-y: auto; overflow-x: hidden;
}
.sidebar nav::-webkit-scrollbar { width: 0; }
.sidebar svg {
    width: 16px; height: 16px; flex-shrink: 0;
    opacity: 0.4; stroke-width: 1.8;
    transition: opacity var(--dur) ease;
}
.sidebar-section {
    padding: 1.25rem 0.75rem 0.375rem;
    font-family: 'Libre Franklin', sans-serif;
    font-size: 0.6875rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.10em;
    color: rgba(255,255,255,0.25);
}
.nav-link {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius-lg);
    color: rgba(255,255,255,0.5);
    font-size: 0.8125rem; font-weight: 500;
    transition: all var(--dur) ease;
    cursor: pointer; position: relative;
    margin-bottom: 2px;
    border: 1px solid transparent;
}
.nav-link:hover {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.8);
}
.nav-link:hover svg { opacity: 0.65; }
.nav-link.active {
    background: var(--highlight);
    color: var(--highlight-text);
    font-weight: 700;
    border-color: transparent;
}
.nav-link.active svg { opacity: 1; color: var(--highlight-text); }
.nav-link.active::before { display: none; }
.sidebar-user {
    padding: 0.875rem 1rem;
    display: flex; align-items: center; gap: 0.5rem;
    flex-shrink: 0;
}
.sidebar-user .avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(255,255,255,0.08);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 700; color: rgba(255,255,255,0.5);
    flex-shrink: 0;
}
.sidebar-user .info { flex: 1; min-width: 0; }
.sidebar-user .info .name {
    font-size: 0.75rem; font-weight: 700; color: var(--text-primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar-user .info .role { font-size: 0.6875rem; color: rgba(255,255,255,0.3); }
.sidebar-user-link {
    display: flex; align-items: center; gap: 0.5rem;
    text-decoration: none; color: inherit;
    flex: 1; min-width: 0;
    padding: 0.35rem 0.5rem; border-radius: var(--radius-sm);
    transition: background var(--dur) ease;
}
.sidebar-user-link:hover { background: var(--bg-sidebar-hover); }
.sidebar-user .logout {
    color: rgba(255,255,255,0.3);
    transition: all var(--dur) ease;
    padding: 4px; border-radius: 8px;
}
.sidebar-user .logout:hover { color: var(--red); background: var(--red-bg); }
.sidebar-user .logout svg { width: 15px; height: 15px; opacity: 1; }

/* ═══════════════════════════════════════════
   TOPBAR — Rounded card style (like Cleverwise header bar)
   ═══════════════════════════════════════════ */
.topbar {
    position: sticky; top: 0; z-index: 30;
    height: var(--topbar-h);
    background: var(--bg-surface);
    border-radius: 14px;
    margin: 16px 2rem 0;
    padding: 0 1.5rem;
    display: flex; align-items: center; justify-content: space-between;
}
.topbar-left { display: flex; align-items: center; gap: 0.75rem; }
.topbar-breadcrumb {
    display: flex; align-items: center; gap: 0.375rem;
    font-size: 0.8125rem; color: var(--text-faint);
}
.topbar-breadcrumb a { color: var(--text-faint); transition: color var(--dur) ease; }
.topbar-breadcrumb a:hover { color: var(--text-secondary); }
.topbar-breadcrumb .sep { font-size: 0.625rem; color: var(--text-faint); }
.topbar-breadcrumb .current { color: var(--text-secondary); font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 0.75rem; }
.topbar-search {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.3rem 0.625rem;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-faint); font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--dur) ease;
}
.topbar-search:hover { border-color: var(--border-hover); color: var(--text-muted); }
.topbar-search svg { width: 13px; height: 13px; }
.topbar-search kbd {
    font-family: inherit; font-size: 0.625rem;
    padding: 1px 4px; border-radius: 4px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-faint);
}
.topbar h1 {
    font-family: 'Libre Franklin', sans-serif;
    font-size: 0.875rem; font-weight: 700; color: var(--text-primary);
}

/* Main layout */
body > main, body > .main-content {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    background: var(--bg-root);
}

/* ═══════════════════════════════════════════
   CARDS — 20px radius, clean elevation
   ═══════════════════════════════════════════ */
.card {
    background: var(--bg-surface);
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: background var(--dur) ease;
}
.card-hover:hover {
    background: var(--bg-elevated);
}
.card-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 1rem;
}
.card-content {}
.stat-card {
    text-align: center; padding: 1.25rem 1rem;
    position: relative;
}
.stat-card::after { display: none; }
.stat-value {
    font-family: 'Libre Franklin', sans-serif;
    font-size: 2rem; font-weight: 800; line-height: 1.1;
    color: var(--text-primary); letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
}
.stat-value.green { color: var(--green); }
.stat-value.orange { color: var(--orange); }
.stat-label {
    font-size: 0.6875rem; color: var(--text-muted);
    margin-top: 0.375rem; text-transform: uppercase;
    letter-spacing: 0.06em; font-weight: 600;
}

/* ═══════════════════════════════════════════
   BUTTONS — Rounded, Cleverwise-style
   ═══════════════════════════════════════════ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.8125rem; font-weight: 700;
    font-family: inherit; cursor: pointer; border: none;
    transition: all var(--dur) ease;
    white-space: nowrap; position: relative;
    line-height: 1.4;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary {
    background: var(--highlight);
    color: var(--highlight-text);
    box-shadow: 0 4px 16px rgba(175,255,182,0.15);
}
.btn-primary:hover {
    box-shadow: 0 4px 24px rgba(175,255,182,0.25);
    filter: brightness(1.05);
}
.btn-accent {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 16px var(--primary-glow);
}
.btn-accent:hover { background: var(--accent-hover); box-shadow: 0 4px 24px var(--primary-glow); }
.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-secondary);
}
.btn-secondary:hover {
    background: var(--bg-subtle);
    color: var(--text-primary);
}
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-ghost:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}
.btn-sm { padding: 0.3rem 0.75rem; font-size: 0.75rem; border-radius: var(--radius-sm); }
.btn-danger {
    background: transparent;
    color: var(--red);
    border: 1px solid rgba(248,113,113,0.15);
}
.btn-danger:hover { background: var(--red-bg); }

/* ═══════════════════════════════════════════
   INPUTS
   ═══════════════════════════════════════════ */
.input, .form-input, select.input, textarea.input {
    width: 100%; padding: 0.5rem 0.875rem;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 0.8125rem; font-family: inherit;
    outline: none;
    transition: border-color var(--dur) ease, box-shadow var(--dur) ease;
    line-height: 1.5;
}
.input:hover, .form-input:hover { border-color: var(--border-hover); }
.input:focus, .form-input:focus, select.input:focus, textarea.input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}
.input::placeholder, .form-input::placeholder { color: var(--text-faint); }
label, .form-label {
    display: block; font-size: 0.75rem; font-weight: 700;
    color: var(--text-muted); margin-bottom: 0.3125rem;
}
select.input, select.form-input {
    cursor: pointer; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23635b6c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 0.625rem center;
    padding-right: 1.75rem;
}
textarea.input, textarea.form-input { resize: vertical; min-height: 60px; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

/* ═══════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════ */
.table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.table th {
    text-align: left; padding: 0.625rem 0.875rem;
    font-family: 'Libre Franklin', sans-serif;
    font-size: 0.6875rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--text-faint); border-bottom: 1px solid var(--border);
    background: transparent;
}
.table td {
    padding: 0.625rem 0.875rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}
.table tr { transition: background var(--dur) ease; }
.table tr:hover td { background: rgba(148,102,242,0.04); }
.table tr:last-child td { border-bottom: none; }

/* ═══════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════ */
.badge {
    display: inline-flex; align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.6875rem; font-weight: 700;
    letter-spacing: 0.01em; white-space: nowrap; gap: 0.25rem;
}
.badge-green, .badge-success { background: var(--green-bg); color: var(--green); }
.badge-orange, .badge-warning { background: var(--orange-bg); color: var(--orange); }
.badge-gray { background: var(--bg-elevated); color: var(--text-muted); }
.badge-red, .badge-danger { background: var(--red-bg); color: var(--red); }
.badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-purple { background: var(--purple-bg); color: var(--purple); }

/* ═══════════════════════════════════════════
   GRIDS
   ═══════════════════════════════════════════ */
.grid-cols-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grid-cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-cols-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.grid-cols-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; }
.grid-cols-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1rem; }

/* ═══════════════════════════════════════════
   COMPONENT CLASSES
   ═══════════════════════════════════════════ */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.75rem; }
.page-title {
    font-family: 'Libre Franklin', sans-serif;
    font-size: 1.5rem; font-weight: 800; color: var(--text-primary);
    letter-spacing: -0.04em;
}
.page-subtitle { font-size: 0.8125rem; color: var(--text-muted); margin-top: 0.25rem; }
.section-title {
    font-family: 'Libre Franklin', sans-serif;
    font-size: 0.875rem; font-weight: 700; color: var(--text-primary);
    letter-spacing: -0.01em;
}
.card-action {
    font-size: 0.6875rem; font-weight: 700;
    color: var(--accent); cursor: pointer;
    padding: 4px 12px; border-radius: 9999px;
    transition: background var(--dur) ease;
}
.card-action:hover { background: var(--accent-subtle); }
.form-stack { display: flex; flex-direction: column; gap: 0.75rem; }
.form-row { display: grid; gap: 0.75rem; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.75rem; }
.form-row-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 0.75rem; }
.form-row-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.75rem; }
.list-stack { display: flex; flex-direction: column; gap: 0; }
.list-row {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    transition: background var(--dur) ease;
}
.list-row:hover { background: rgba(148,102,242,0.04); }
.list-row:last-child { border-bottom: none; }
.list-row-clickable { cursor: pointer; }
.list-row-clickable:hover { background: var(--accent-subtle); }
.list-row-text { flex: 1; font-size: 0.8125rem; color: var(--text-secondary); }
.list-row-name { font-weight: 700; font-size: 0.8125rem; color: var(--text-primary); }
.list-row-meta { font-size: 0.6875rem; color: var(--text-muted); margin-top: 1px; }
.list-row-date {
    min-width: 70px; font-weight: 700; font-size: 0.8125rem;
    color: var(--accent); font-variant-numeric: tabular-nums;
}
.dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.dot-red { background: var(--red); }
.dot-orange { background: var(--orange); }
.dot-green { background: var(--green); }
.dot-muted { background: var(--text-faint); }
.empty-state {
    font-size: 0.8125rem; color: var(--text-muted);
    text-align: center; padding: 3rem 1rem;
}
.link-accent { color: var(--accent); transition: color var(--dur) ease; }
.link-accent:hover { color: var(--primary-light); }
.avatar-sm {
    width: 32px; height: 32px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.75rem; color: white; flex-shrink: 0;
}
.quick-link {
    text-align: center; padding: 1.75rem 1.25rem; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
    transition: background var(--dur) ease;
}
.quick-link:hover { background: rgba(148,102,242,0.04); }
.quick-link-icon {
    font-size: 1.5rem; margin-bottom: 0.25rem;
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 14px; background: var(--bg-elevated);
    transition: background var(--dur) ease, transform var(--dur) ease;
}
.quick-link:hover .quick-link-icon { background: var(--accent-subtle); transform: translateY(-2px); }
.quick-link-title { font-weight: 700; font-size: 0.8125rem; color: var(--text-primary); }
.quick-link-desc { font-size: 0.75rem; color: var(--text-muted); }
.checkbox-label {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.8125rem; color: var(--text-secondary); cursor: pointer;
}
.checkbox-label:hover { color: var(--text-primary); }
.icon-square {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.icon-square.blue { background: var(--blue-bg); color: var(--blue); }
.icon-square.green { background: var(--green-bg); color: var(--green); }
.icon-square.orange { background: var(--orange-bg); color: var(--orange); }
.icon-square.red { background: var(--red-bg); color: var(--red); }
.icon-square.purple { background: var(--purple-bg); color: var(--purple); }
.video-container { background: #0d0515; border-radius: var(--radius-sm); overflow: hidden; }

/* ═══════════════════════════════════════════
   SPACING UTILITIES
   ═══════════════════════════════════════════ */
.flex { display: flex; } .flex-1 { flex: 1; } .flex-col { flex-direction: column; }
.items-center { align-items: center; } .justify-center { justify-content: center; }
.justify-between { justify-content: space-between; } .min-h-screen { min-height: 100vh; }
.relative { position: relative; } .fixed { position: fixed; } .sticky { position: sticky; top: 0; }
.z-10 { z-index: 10; } .z-50 { z-index: 50; } .overflow-y-auto { overflow-y: auto; }
.min-w-0 { min-width: 0; } .hidden { display: none; }
.gap-2 { gap: 0.5rem; } .gap-3 { gap: 0.75rem; } .gap-4 { gap: 1rem; } .gap-6 { gap: 1.5rem; }
.p-4 { padding: 1rem; } .p-6 { padding: 1.5rem; } .p-8 { padding: 2rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.pl-8 { padding-left: 2rem; }
.mt-1 { margin-top: 0.25rem; } .mt-2 { margin-top: 0.5rem; } .mt-4 { margin-top: 1rem; } .mt-6 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1rem; } .mb-6 { margin-bottom: 1.5rem; }
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.w-full { width: 100%; } .w-5 { width: 1.25rem; } .h-5 { height: 1.25rem; }
.w-8 { width: 2rem; } .h-8 { height: 2rem; }
.w-64 { width: 16rem; } .ml-64 { margin-left: var(--sidebar-w); }
.h-full { height: 100%; }
.text-xs { font-size: 0.75rem; } .text-sm { font-size: 0.8125rem; }
.text-lg { font-size: 1.0625rem; } .text-xl { font-size: 1.25rem; }
.font-bold { font-weight: 600; } .font-medium { font-weight: 500; } .font-semibold { font-weight: 600; }
.text-gray-300 { color: var(--text-primary); } .text-gray-400 { color: var(--text-secondary); }
.text-gray-500 { color: var(--text-muted); } .text-gray-600 { color: var(--text-faint); }
.text-white { color: var(--text-white); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uppercase { text-transform: uppercase; } .tracking-wider { letter-spacing: 0.05em; }
.bg-forest { background: var(--accent); } .bg-burnt-orange { background: var(--accent); }
.bg-gray-800 { background: var(--bg-elevated); }
.bg-gray-900 { background: var(--bg-surface); }
.bg-gray-950 { background: var(--bg-root); }
.text-forest { color: var(--accent); } .text-burnt-orange { color: var(--accent); }
.border-b { border-bottom: 1px solid var(--border); }
.border-r { border-right: 1px solid var(--border); }
.border-t { border-top: 1px solid var(--border); }
.border-gray-800 { border-color: var(--border); }
.rounded-full { border-radius: 9999px; }
.rounded-lg { border-radius: var(--radius-sm); }
.rounded-xl { border-radius: var(--radius); }
.inline-flex { display: inline-flex; } .block { display: block; }

/* ═══════════════════════════════════════════
   PROGRESS / TIMELINE / MODALS / TOAST
   ═══════════════════════════════════════════ */
.progress { height: 6px; background: var(--bg-elevated); border-radius: 9999px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 9999px; transition: width 0.5s var(--ease); }
.progress-fill.green { background: var(--green); }
.progress-fill.orange { background: var(--orange); }
.progress-fill.blue { background: var(--accent); }

.timeline { position: relative; padding-left: 2rem; }
.timeline::before { content: ''; position: absolute; left: 0.5rem; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 1.5rem; }
.timeline-dot {
    position: absolute; left: -1.625rem; top: 0.25rem;
    width: 0.75rem; height: 0.75rem; border-radius: 50%;
    background: var(--bg-surface); border: 2px solid var(--bg-subtle);
}
.timeline-dot.active { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 10px var(--primary-glow); }
.timeline-dot.done { background: var(--green); border-color: var(--green); box-shadow: 0 0 10px rgba(35,235,48,0.25); }

.modal-backdrop {
    display: none; position: fixed; inset: 0; z-index: 50;
    background: rgba(18,7,29,0.75);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.modal-backdrop.open { display: block; }
.modal-content {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 100%; max-height: 85vh; overflow-y: auto;
    animation: modalIn 250ms var(--ease);
}
[style*="position:fixed"][style*="inset:0"],
[style*="position: fixed"][style*="inset: 0"] {
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}
[style*="position:fixed"][style*="inset:0"] > .card,
[style*="position: fixed"][style*="inset: 0"] > .card {
    box-shadow: var(--shadow-modal);
    animation: modalIn 250ms var(--ease);
}
@keyframes modalIn {
    from { opacity: 0; transform: translate(-50%, -48%) scale(0.96); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.toast {
    position: fixed; bottom: 1.5rem; right: 1.5rem;
    padding: 0.75rem 1.25rem; border-radius: var(--radius-sm);
    font-size: 0.8125rem; font-weight: 700;
    z-index: 9999; animation: toastIn 300ms var(--ease);
}
.toast-success { background: var(--green-bg); color: var(--green); }
.toast-error { background: var(--red-bg); color: var(--red); }
.toast-info { background: var(--bg-surface); color: var(--text-primary); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ═══════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════ */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: slideUp 350ms var(--ease); }
main .p-8 > * { animation: slideUp 400ms var(--ease) forwards; opacity: 0; }
main .p-8 > *:nth-child(1) { animation-delay: 0ms; }
main .p-8 > *:nth-child(2) { animation-delay: 50ms; }
main .p-8 > *:nth-child(3) { animation-delay: 100ms; }
main .p-8 > *:nth-child(4) { animation-delay: 150ms; }
main .p-8 > *:nth-child(5) { animation-delay: 200ms; }
main .p-8 > *:nth-child(6) { animation-delay: 250ms; }
main .p-8 > *:nth-child(7) { animation-delay: 300ms; }
main .p-8 > *:nth-child(8) { animation-delay: 350ms; }

/* ═══════════════════════════════════════════
   LOGIN
   ═══════════════════════════════════════════ */
.login-page {
    min-height: 100vh; display: flex;
    align-items: center; justify-content: center;
    background: var(--bg-root);
    position: relative; overflow: hidden;
}
.login-page::before {
    content: ''; position: absolute;
    width: 600px; height: 600px; border-radius: 50%;
    background: radial-gradient(circle, rgba(148,102,242,0.08) 0%, transparent 65%);
    top: -200px; right: -200px; pointer-events: none;
    animation: loginGlow 8s ease-in-out infinite alternate;
}
.login-page::after {
    content: ''; position: absolute;
    width: 500px; height: 500px; border-radius: 50%;
    background: radial-gradient(circle, rgba(148,102,242,0.05) 0%, transparent 65%);
    bottom: -150px; left: -150px; pointer-events: none;
    animation: loginGlow 10s ease-in-out infinite alternate-reverse;
}
@keyframes loginGlow {
    from { transform: scale(1) translate(0, 0); opacity: 0.5; }
    to { transform: scale(1.1) translate(15px, -8px); opacity: 0.8; }
}
.login-card {
    width: 100%; max-width: 400px;
    background: var(--bg-surface);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    position: relative; z-index: 1;
    box-shadow: var(--shadow-elevated);
}

/* Tab groups */
.tab-group {
    display: flex; gap: 0;
    background: var(--bg-root);
    border-radius: var(--radius-sm);
    padding: 3px;
}
.tab-item {
    padding: 0.375rem 0.875rem; border-radius: 9px;
    font-size: 0.75rem; font-weight: 600;
    color: var(--text-muted); cursor: pointer;
    transition: all var(--dur) ease;
    border: none; background: none; font-family: inherit;
}
.tab-item:hover { color: var(--text-secondary); }
.tab-item.active {
    background: var(--bg-elevated); color: var(--text-primary);
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
.content-detail-grid { grid-template-columns: 280px 1fr; }

@media (max-width: 768px) {
    .content-detail-grid { grid-template-columns: 1fr; }
    .sidebar { transform: translateX(-100%); transition: transform 280ms var(--ease); z-index: 50; }
    .sidebar.open { transform: translateX(0); }
    body > main, body > .main-content { margin-left: 0 !important; }
    .ml-64 { margin-left: 0; }
    .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-cols-5 { grid-template-columns: repeat(2, 1fr); }
    .grid-cols-6 { grid-template-columns: repeat(2, 1fr); }
    .grid-cols-3 { grid-template-columns: 1fr; }
    .grid-cols-2 { grid-template-columns: 1fr; }
    .topbar { margin: 8px 1rem 0; padding: 0 1rem; }
    .topbar-search { display: none; }
    .p-8 { padding: 1rem !important; }
}
