/* ============================================================
   SCMS — Global Styles
   ============================================================ */

:root {
    --primary: #4f46e5;
    --primary-h: #4338ca;
    --primary-l: #eef2ff;
    --accent: #10b981;
    --accent-h: #059669;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    --bg: #f7f8fc;
    --surface: #ffffff;
    --surface-2: #f9fafb;
    --border: #e5e7eb;
    --border-2: #eef0f4;

    --text: #0f172a;
    --text-2: #475569;
    --text-3: #94a3b8;

    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow: 0 4px 12px rgba(15, 23, 42, .08);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, .12);

    --sidebar-w: 260px;
    --sidebar-w-collapsed: 78px;
    --topbar-h: 68px;

    --ease: cubic-bezier(.4, 0, .2, 1);
    --dur: 220ms;
}

/* Dark theme */
[data-theme="dark"] {
    --primary: #818cf8;
    --primary-h: #6366f1;
    --primary-l: #1e1b4b;
    --accent: #34d399;
    --accent-h: #10b981;
    --bg: #0b1020;
    --surface: #131a2e;
    --surface-2: #1a2138;
    --border: #26304a;
    --border-2: #1f2740;
    --text: #e5e7eb;
    --text-2: #a0aec0;
    --text-3: #64748b;
    --shadow: 0 4px 12px rgba(0, 0, 0, .4);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

button { font: inherit; cursor: pointer; }

/* ---------- Animations ---------- */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-24px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.06); }
}
@keyframes shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-10px); }
}
@keyframes spin { to { transform: rotate(360deg); } }

.animate-fade-up { animation: fadeUp .6s var(--ease) both; }
.animate-fade-in { animation: fadeIn .6s var(--ease) both; }
.delay-1 { animation-delay: .1s; }
.delay-2 { animation-delay: .2s; }
.delay-3 { animation-delay: .3s; }
.delay-4 { animation-delay: .4s; }
.delay-5 { animation-delay: .5s; }

/* ============================================================
   LANDING PAGE
   ============================================================ */

.landing { overflow-x: hidden; }

.landing-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 40px;
    background: rgba(255, 255, 255, .7);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid transparent;
    transition: all var(--dur) var(--ease);
}
.landing-nav.scrolled {
    background: rgba(255, 255, 255, .92);
    border-bottom-color: var(--border);
    box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .landing-nav { background: rgba(19, 26, 46, .7); }
[data-theme="dark"] .landing-nav.scrolled { background: rgba(19, 26, 46, .92); }

.landing-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text);
}
.landing-brand:hover { text-decoration: none; }

.brand-mark {
    width: 36px; height: 36px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    border-radius: 10px;
    font-weight: 800;
    font-size: 1rem;
    box-shadow: 0 6px 16px rgba(79, 70, 229, .35);
}

.landing-links { display: flex; gap: 28px; align-items: center; }
.landing-links a {
    color: var(--text-2);
    font-weight: 500;
    font-size: .95rem;
    text-decoration: none;
    transition: color var(--dur);
}
.landing-links a:hover { color: var(--primary); }

.landing-cta { display: flex; gap: 10px; align-items: center; }

/* Hero */
.hero {
    position: relative;
    padding: 160px 40px 100px;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 60px;
    align-items: center;
    max-width: 1280px;
    margin: 0 auto;
}
.hero::before {
    content: '';
    position: absolute;
    top: -200px; right: -200px;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(79,70,229,.18), transparent 70%);
    border-radius: 50%;
    z-index: -1;
    animation: float 8s ease-in-out infinite;
}
.hero::after {
    content: '';
    position: absolute;
    bottom: -200px; left: -200px;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(16,185,129,.15), transparent 70%);
    border-radius: 50%;
    z-index: -1;
    animation: float 10s ease-in-out infinite reverse;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--primary-l);
    color: var(--primary);
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 600;
    margin-bottom: 24px;
}
.hero-badge .dot {
    width: 8px; height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.hero h1 {
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
}
.hero h1 .grad {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero p.lead {
    font-size: 1.15rem;
    color: var(--text-2);
    margin-bottom: 36px;
    max-width: 540px;
}
.hero-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 48px;
}
.hero-stats { display: flex; gap: 40px; flex-wrap: wrap; }
.hero-stat-num {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text);
    display: block;
}
.hero-stat-label { font-size: .85rem; color: var(--text-3); }

.hero-visual { position: relative; }
.hero-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 24px;
    animation: float 6s ease-in-out infinite;
}
.hero-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.hero-card-title { font-weight: 700; font-size: .95rem; }
.hero-card-sub   { font-size: .78rem; color: var(--text-3); }

.hero-chart {
    height: 140px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-bottom: 20px;
}
.hero-chart .bar {
    flex: 1;
    background: linear-gradient(180deg, var(--primary), var(--primary-h));
    border-radius: 6px 6px 0 0;
    animation: fadeUp .8s var(--ease) both;
    min-height: 12%;
}
.hero-chart .bar:nth-child(odd) { background: linear-gradient(180deg, var(--accent), var(--accent-h)); }

.hero-mini-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.hero-mini {
    padding: 12px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-2);
}
.hero-mini-label { font-size: .72rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.hero-mini-value { font-size: 1.05rem; font-weight: 700; margin-top: 2px; }

/* Sections */
.section { padding: 100px 40px; max-width: 1280px; margin: 0 auto; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 64px; }
.section-eyebrow {
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--primary);
    margin-bottom: 12px;
}
.section-head h2 {
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 14px;
}
.section-head p { color: var(--text-2); font-size: 1.05rem; }

/* Feature grid */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}
.feature {
    padding: 32px 28px;
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-lg);
    transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur);
}
.feature:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}
.feature-icon {
    width: 52px; height: 52px;
    display: grid; place-items: center;
    border-radius: 14px;
    background: var(--primary-l);
    color: var(--primary);
    font-size: 1.4rem;
    margin-bottom: 20px;
    transition: transform var(--dur) var(--ease);
}
.feature:hover .feature-icon { transform: scale(1.1) rotate(-4deg); }
.feature h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.feature p  { font-size: .93rem; color: var(--text-2); }

/* Steps */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    counter-reset: step;
}
.step {
    position: relative;
    padding: 32px 24px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-2);
}
.step::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    top: -18px; left: 24px;
    width: 40px; height: 40px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    border-radius: 12px;
    font-weight: 800;
    box-shadow: 0 6px 16px rgba(79, 70, 229, .35);
}
.step h3 { margin-top: 12px; font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; }
.step p { font-size: .9rem; color: var(--text-2); }

/* CTA band */
.cta-band {
    max-width: 1280px;
    margin: 40px auto;
    padding: 72px 40px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--radius-lg);
    text-align: center;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.cta-band::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(255,255,255,.15), transparent 40%),
                radial-gradient(circle at 80% 80%, rgba(255,255,255,.1), transparent 40%);
}
.cta-band > * { position: relative; }
.cta-band h2 {
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    font-weight: 800;
    margin-bottom: 14px;
    letter-spacing: -0.02em;
}
.cta-band p { opacity: .92; margin-bottom: 32px; font-size: 1.05rem; }
.cta-band .btn-white {
    background: #fff;
    color: var(--primary);
    padding: 14px 28px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    display: inline-block;
    transition: transform var(--dur) var(--ease), box-shadow var(--dur);
}
.cta-band .btn-white:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0,0,0,.2);
    text-decoration: none;
}
.cta-band .btn-ghost {
    background: rgba(255,255,255,.15);
    color: #fff;
    padding: 14px 28px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,.4);
    display: inline-block;
    margin-left: 12px;
    transition: background var(--dur);
}
.cta-band .btn-ghost:hover { background: rgba(255,255,255,.25); text-decoration: none; }

/* Footer */
.landing-footer {
    padding: 48px 40px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-3);
    font-size: .9rem;
}

/* Landing responsive */
@media (max-width: 900px) {
    .hero { grid-template-columns: 1fr; padding: 130px 24px 60px; }
    .hero-visual { display: none; }
    .landing-links { display: none; }
    .landing-nav { padding: 14px 20px; }
    .section { padding: 70px 24px; }
    .cta-band { margin: 40px 20px; padding: 56px 24px; }
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font: inherit;
    font-weight: 600;
    font-size: .92rem;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--dur) var(--ease);
    white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-h); box-shadow: 0 8px 20px rgba(79,70,229,.3); }

.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-h); box-shadow: 0 8px 20px rgba(16,185,129,.3); }

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-success { background: var(--accent); color: #fff; }

.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-block { width: 100%; }

/* ============================================================
   ALERTS
   ============================================================ */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: .9rem;
    border: 1px solid transparent;
    animation: fadeUp .4s var(--ease) both;
}
.alert ul { margin: 0; padding-left: 18px; }
.alert-success { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.alert-error   { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.alert-info    { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.alert-warning { background: #fef3c7; color: #92400e; border-color: #fde68a; }

[data-theme="dark"] .alert-success { background: rgba(22,163,74,.15); color: #86efac; border-color: rgba(22,163,74,.3); }
[data-theme="dark"] .alert-error   { background: rgba(220,38,38,.15); color: #fca5a5; border-color: rgba(220,38,38,.3); }

/* ============================================================
   APP LAYOUT (sidebar + topbar)
   ============================================================ */

.app { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: transform var(--dur) var(--ease), width var(--dur) var(--ease);
}
.sidebar-head {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
    flex-shrink: 0;
}
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
}
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.nav-group-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-3);
    padding: 16px 12px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-size: .9rem;
    font-weight: 500;
    margin-bottom: 2px;
    transition: all var(--dur) var(--ease);
    position: relative;
    text-decoration: none;
}
.nav-item:hover {
    background: var(--surface-2);
    color: var(--text);
    text-decoration: none;
}
.nav-item.active {
    background: var(--primary-l);
    color: var(--primary);
    font-weight: 600;
}
.nav-item.active::before {
    content: '';
    position: absolute;
    left: -12px; top: 50%;
    transform: translateY(-50%);
    width: 4px; height: 22px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
}
.nav-item .icon { width: 20px; height: 20px; flex-shrink: 0; stroke-width: 2; }
.nav-item .badge-count {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    min-width: 20px;
    text-align: center;
}

.sidebar-foot {
    padding: 14px;
    border-top: 1px solid var(--border);
    font-size: .78rem;
    color: var(--text-3);
    text-align: center;
}

/* Main area */
.main {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-width: 0;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--dur) var(--ease);
}

/* Topbar */
.topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-h);
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 20px;
    z-index: 150;
}
[data-theme="dark"] .topbar { background: rgba(19,26,46,.85); }

.topbar-brand {
    display: none;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.05rem;
}

.topbar-search { flex: 1; max-width: 480px; position: relative; }
.topbar-search input {
    width: 100%;
    padding: 9px 14px 9px 40px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-size: .9rem;
    transition: all var(--dur) var(--ease);
}
.topbar-search input:focus {
    outline: none;
    background: var(--surface);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79,70,229,.1);
}
.topbar-search .search-icon {
    position: absolute;
    left: 12px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-3);
    pointer-events: none;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.icon-btn {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text-2);
    cursor: pointer;
    position: relative;
    transition: all var(--dur) var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.icon-btn .dot-indicator {
    position: absolute;
    top: 8px; right: 8px;
    width: 8px; height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--surface);
    animation: pulse 2s infinite;
}

/* Dropdowns */
.dropdown { position: relative; }

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 280px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--dur) var(--ease);
    z-index: 300;
    max-height: 420px;
    overflow-y: auto;
}
.dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-head {
    padding: 12px 14px 8px;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-3);
    border-bottom: 1px solid var(--border-2);
    margin-bottom: 6px;
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-size: .9rem;
    cursor: pointer;
    transition: all var(--dur) var(--ease);
    text-decoration: none;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}
.dropdown-item:hover {
    background: var(--surface-2);
    color: var(--text);
    text-decoration: none;
}
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: rgba(239,68,68,.08); }

.dropdown-item .icon { width: 18px; height: 18px; flex-shrink: 0; }

/* Notification items */
.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    transition: background var(--dur);
    cursor: pointer;
}
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: var(--primary-l); }
.notif-icon {
    width: 34px; height: 34px;
    border-radius: 10px;
    display: grid; place-items: center;
    background: var(--primary-l);
    color: var(--primary);
    flex-shrink: 0;
    font-size: .9rem;
}
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: .88rem; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.notif-text  { font-size: .8rem; color: var(--text-2); }
.notif-time  { font-size: .72rem; color: var(--text-3); margin-top: 3px; }

/* Quick actions grid */
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 10px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text-2);
    font-size: .78rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--dur) var(--ease);
    border: 1px solid transparent;
    text-align: center;
}
.quick-action:hover {
    background: var(--primary-l);
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
    text-decoration: none;
}
.quick-action .icon { width: 22px; height: 22px; }

/* User avatar */
.avatar {
    width: 38px; height: 38px;
    border-radius: 10px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-weight: 700;
    font-size: .9rem;
    cursor: pointer;
    transition: transform var(--dur) var(--ease);
    user-select: none;
}
.avatar:hover { transform: scale(1.05); }

.user-info-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-2);
    margin-bottom: 6px;
}
.user-info-head .avatar { width: 44px; height: 44px; font-size: 1rem; }
.user-info-head .name { font-weight: 700; font-size: .92rem; }
.user-info-head .role { font-size: .78rem; color: var(--text-3); text-transform: capitalize; }

/* Page content */
.page { padding: 28px; flex: 1; animation: fadeIn .4s var(--ease); }
.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.page-head h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.01em; }
.page-head p { color: var(--text-2); font-size: .92rem; margin-top: 2px; }
.page-head-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-sm);
}
.card-title { font-size: .95rem; font-weight: 700; margin-bottom: 4px; }
.card-sub { font-size: .82rem; color: var(--text-3); }

/* Stat cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}
.stat {
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    transition: all var(--dur) var(--ease);
    position: relative;
    overflow: hidden;
}
.stat:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}
.stat::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--primary);
    opacity: 0;
    transition: opacity var(--dur);
}
.stat:hover::before { opacity: 1; }
.stat-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}
.stat-label { font-size: .8rem; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: grid; place-items: center;
    background: var(--primary-l);
    color: var(--primary);
}
.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}
.stat-trend { font-size: .8rem; display: flex; align-items: center; gap: 4px; }
.stat-trend.up { color: var(--accent); }
.stat-trend.down { color: var(--danger); }

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
    overflow-x: auto;
}
.tab {
    padding: 10px 16px;
    font-size: .88rem;
    font-weight: 600;
    color: var(--text-2);
    border-bottom: 2px solid transparent;
    text-decoration: none;
    transition: all var(--dur);
    white-space: nowrap;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Tables */
.table-wrap {
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    animation: fadeUp .4s var(--ease);
}
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
    padding: 13px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-2);
    font-size: .88rem;
}
.table th {
    background: var(--surface-2);
    font-weight: 700;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-3);
}
.table tr { transition: background var(--dur); }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: none; }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 600;
    text-transform: capitalize;
}
.badge-pending   { background: #fef3c7; color: #92400e; }
.badge-approved  { background: #dcfce7; color: #166534; }
.badge-rejected  { background: #fee2e2; color: #991b1b; }
.badge-suspended { background: #e5e7eb; color: #374151; }
.badge-active    { background: #dcfce7; color: #166534; }
.badge-inactive  { background: #f3f4f6; color: #6b7280; }
.badge-info      { background: #dbeafe; color: #1e40af; }

/* Utility */
.muted  { color: var(--text-3); }
.center { text-align: center; }
.inline { display: inline; }
.flex   { display: flex; }
.gap-2  { gap: 8px; }
.gap-4  { gap: 16px; }
.mt-4   { margin-top: 16px; }
.mb-4   { margin-bottom: 16px; }
.w-full { width: 100%; }

/* App Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; }
    .topbar-brand { display: flex; }
    .topbar-search { max-width: none; }
    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(15,23,42,.5);
        z-index: 190;
        opacity: 0;
        transition: opacity var(--dur);
    }
    .sidebar-backdrop.show { display: block; opacity: 1; }
}
@media (min-width: 1025px) {
    .sidebar-backdrop { display: none !important; }
    .menu-toggle { display: none; }
}
@media (max-width: 640px) {
    .topbar { padding: 0 12px; gap: 8px; }
    .topbar-search { display: none; }
    .page { padding: 18px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat-value { font-size: 1.4rem; }
    .quick-actions { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 420px) {
    .stats-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   AUTH PAGES
   ============================================================ */

.auth-page {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 32px 20px;
    background: var(--bg);
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
}
.auth-page::before {
    content: '';
    position: absolute;
    top: -200px; right: -200px;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(79,70,229,.15), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.auth-page::after {
    content: '';
    position: absolute;
    bottom: -200px; left: -200px;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(16,185,129,.12), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.auth-card {
    position: relative;
    z-index: 1;
    background: var(--surface);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 440px;
    margin: auto 0; /* centers when content fits; top-aligns & scrolls when tall */
    animation: fadeUp .5s var(--ease) both;
    border: 1px solid var(--border-2);
}
.auth-card h1 {
    margin: 0 0 6px;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.2;
}
.auth-card .subtitle {
    color: var(--text-2);
    margin-bottom: 28px;
    font-size: .92rem;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
    font-weight: 700;
    font-size: 1rem;
}
.auth-brand:hover { text-decoration: none; color: var(--text); }

.auth-card label {
    display: block;
    margin-bottom: 16px;
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-2);
}
.auth-card input {
    width: 100%;
    padding: 12px 14px;
    margin-top: 6px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: 1rem; /* >=16px prevents iOS zoom */
    background: var(--surface);
    color: var(--text);
    transition: border-color var(--dur), box-shadow var(--dur);
    -webkit-appearance: none;
    appearance: none;
}
.auth-card input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79,70,229,.12);
}

.auth-foot {
    text-align: center;
    margin-top: 20px;
    font-size: .9rem;
    color: var(--text-2);
}
.auth-foot a { color: var(--primary); font-weight: 600; }

/* Two short inputs side-by-side on wide screens */
.auth-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
}

/* ---------- Auth responsive breakpoints ---------- */

/* Tablet */
@media (max-width: 768px) {
    .auth-card { padding: 32px; border-radius: 16px; }
    .auth-card h1 { font-size: 1.45rem; }
    .auth-card .subtitle { margin-bottom: 22px; font-size: .88rem; }
    .auth-brand { margin-bottom: 22px; }
}

/* Phone */
@media (max-width: 520px) {
    .auth-page { padding: 20px 14px; }
    .auth-card {
        padding: 24px 20px;
        border-radius: 14px;
        max-width: 100%;
    }
    .auth-card h1 { font-size: 1.3rem; }
    .auth-card .subtitle { margin-bottom: 20px; font-size: .85rem; }

    .auth-brand { margin-bottom: 20px; font-size: .95rem; }
    .auth-brand .brand-mark { width: 32px; height: 32px; font-size: .9rem; }

    .auth-card label { margin-bottom: 14px; font-size: .82rem; }
    .auth-card input { padding: 11px 12px; font-size: 1rem; }

    .auth-card .btn-lg { padding: 12px 20px; font-size: .95rem; }
    .auth-foot { margin-top: 16px; font-size: .85rem; }

    .auth-grid { grid-template-columns: 1fr; }
}

/* Very small phones */
@media (max-width: 380px) {
    .auth-page { padding: 16px 10px; }
    .auth-card { padding: 20px 16px; border-radius: 12px; }
    .auth-card h1 { font-size: 1.2rem; }
    .auth-brand { margin-bottom: 16px; }
}

/* Landscape phones */
@media (max-height: 500px) and (orientation: landscape) {
    .auth-page { padding-top: 20px; padding-bottom: 20px; }
    .auth-card { padding: 20px 24px; }
    .auth-brand { margin-bottom: 16px; }
    .auth-card .subtitle { margin-bottom: 16px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .auth-card { animation: none; }
}