/* ============================================================
   XI PPLG Vidyatechna — Design System
   Dark Modern · Teal & Amber academic palette
   ============================================================ */

:root {
    --primary: #0D9488;
    --primary-600: #0F766E;
    --secondary: #14B8A6;
    --accent: #F59E0B;
    --danger: #EF4444;
    --warning: #F59E0B;
    --success: #10B981;
    --info: #3B82F6;

    --gradient: linear-gradient(135deg, var(--primary-600), var(--primary));
    --gradient-accent: linear-gradient(135deg, var(--primary), var(--accent));

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;

    --shadow-sm: 0 1px 3px rgba(2, 6, 23, .18);
    --shadow: 0 10px 30px -8px rgba(2, 6, 23, .35);
    --shadow-lg: 0 24px 60px -12px rgba(2, 6, 23, .5);

    --font-head: 'Space Grotesk', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;

    --sidebar-w: 262px;
    --sidebar-w-collapsed: 78px;
    --topbar-h: 68px;
}

[data-theme="dark"] {
    --bg: #0F172A;
    --bg-soft: #111827;
    --bg-elevated: #1a2333;
    --card: rgba(255, 255, 255, .035);
    --card-solid: #111827;
    --border: rgba(148, 163, 184, .14);
    --border-strong: rgba(148, 163, 184, .24);
    --text: #E2E8F0;
    --text-muted: #94A3B8;
    --text-faint: #64748B;
    --input-bg: rgba(15, 23, 42, .6);
    --hover: rgba(255, 255, 255, .05);
    --glass: rgba(15, 23, 42, .55);
    --sidebar-bg: rgba(15, 23, 42, .8);
    --table-stripe: rgba(255, 255, 255, .02);
    --tooltip-bg: rgba(15, 23, 42, .95);
}

[data-theme="light"] {
    --bg: #F4F6FB;
    --bg-soft: #FFFFFF;
    --bg-elevated: #FFFFFF;
    --card: rgba(255, 255, 255, .75);
    --card-solid: #FFFFFF;
    --border: rgba(15, 23, 42, .10);
    --border-strong: rgba(15, 23, 42, .18);
    --text: #0F172A;
    --text-muted: #475569;
    --text-faint: #94A3B8;
    --input-bg: #FFFFFF;
    --hover: rgba(15, 23, 42, .04);
    --glass: rgba(255, 255, 255, .7);
    --sidebar-bg: rgba(255, 255, 255, .85);
    --table-stripe: rgba(15, 23, 42, .02);
    --tooltip-bg: rgba(255, 255, 255, .98);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, .08);
    --shadow: 0 10px 30px -10px rgba(15, 23, 42, .12);
    --shadow-lg: 0 24px 60px -16px rgba(15, 23, 42, .18);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    transition: background .35s ease, color .35s ease;
}

a { color: var(--primary); text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--primary-600); }
img { max-width: 100%; }
h1, h2, h3, h4, h5 { font-family: var(--font-head); margin: 0; line-height: 1.25; }
code { font-family: var(--font-mono); }
kbd { font-family: var(--font-mono); font-size: 11px; background: var(--hover); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; padding: 2px 7px; }

.mono { font-family: var(--font-mono); }
.muted { color: var(--text-muted); }
.grad-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 13.5px;
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn svg { width: 16px; height: 16px; }

.btn-primary {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 8px 20px -8px rgba(13, 148, 136, .6);
}
.btn-primary:hover { box-shadow: 0 12px 28px -8px rgba(13, 148, 136, .75); color: #fff; transform: translateY(-1px); }

.btn-ghost {
    background: var(--hover);
    color: var(--text);
    border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--border-strong); background: var(--hover); }

.btn-danger { background: linear-gradient(135deg, #EF4444, #DC2626); color: #fff; box-shadow: 0 8px 20px -8px rgba(239, 68, 68, .5); }
.btn-danger:hover { color: #fff; }

.btn-sm { padding: 7px 13px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { padding: 14px 28px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }

.ripple-ink {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .4);
    transform: scale(0);
    animation: ripple .6s ease-out;
    pointer-events: none;
}
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--hover);
    color: var(--text-muted);
    cursor: pointer;
    transition: all .18s ease;
    position: relative;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.danger:hover { color: var(--danger); border-color: rgba(239, 68, 68, .4); }

/* ---------- Inputs ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-muted); margin-bottom: 7px; }
.input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 12px;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.input-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13, 148, 136, .15); }
.input-wrap svg { width: 16px; height: 16px; color: var(--text-faint); flex-shrink: 0; }
.input-wrap input {
    flex: 1;
    background: transparent;
    border: 0;
    outline: 0;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 14px;
    padding: 11px 0;
}
.input-wrap input::placeholder { color: var(--text-faint); }
.input-toggle { background: none; border: 0; color: var(--text-faint); cursor: pointer; padding: 4px; }
.input-toggle svg { width: 17px; height: 17px; }

input[type="text"], input[type="password"], input[type="email"], input[type="number"], input[type="date"], input[type="month"], input[type="time"], textarea, select.input, .select {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 13px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 13.5px;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13, 148, 136, .12); }
textarea { resize: vertical; min-height: 84px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.input-sm { padding: 7px 10px; font-size: 13px; border-radius: 8px; }
.input-sm input { padding: 7px 0; font-size: 13px; }
.input-sm svg { width: 15px; height: 15px; }

.checkbox { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-muted); cursor: pointer; }
.checkbox input { display: none; }
.checkmark {
    width: 18px; height: 18px; border-radius: 6px;
    border: 2px solid var(--border-strong);
    display: inline-flex; align-items: center; justify-content: center;
    transition: all .18s ease; flex-shrink: 0;
}
.checkbox input:checked + .checkmark { background: var(--gradient); border-color: transparent; }
.checkbox input:checked + .checkmark::after { content: ''; width: 8px; height: 4px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }

.form-title { margin-bottom: 16px; font-size: 15px; }
.link { font-size: 13px; font-weight: 600; }

/* ---------- Alerts ---------- */
.alert {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 14px; border-radius: 10px; font-size: 13.5px;
    margin-bottom: 16px; border: 1px solid transparent;
}
.alert svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 1px; }
.alert-error { background: rgba(239, 68, 68, .12); color: #FCA5A5; border-color: rgba(239, 68, 68, .3); }
.alert-info { background: rgba(59, 130, 246, .12); color: #93C5FD; border-color: rgba(59, 130, 246, .3); }
[data-theme="light"] .alert-error { color: #B91C1C; }
[data-theme="light"] .alert-info { color: #1D4ED8; }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11.5px; font-weight: 600;
    padding: 3.5px 10px; border-radius: 999px;
    border: 1px solid transparent;
}
.badge svg { width: 12px; height: 12px; }
.badge-green { background: rgba(16, 185, 129, .13); color: #34D399; border-color: rgba(16, 185, 129, .3); }
.badge-amber { background: rgba(245, 158, 11, .13); color: #FBBF24; border-color: rgba(245, 158, 11, .3); }
.badge-red { background: rgba(239, 68, 68, .13); color: #F87171; border-color: rgba(239, 68, 68, .3); }
.badge-blue { background: rgba(59, 130, 246, .13); color: #60A5FA; border-color: rgba(59, 130, 246, .3); }
.badge-indigo { background: rgba(13, 148, 136, .15); color: #2DD4BF; border-color: rgba(13, 148, 136, .35); }
.badge-purple { background: rgba(20, 184, 166, .15); color: #5EEAD4; border-color: rgba(20, 184, 166, .35); }
.badge-cyan { background: rgba(245, 158, 11, .13); color: #FBBF24; border-color: rgba(245, 158, 11, .3); }
.badge-slate { background: rgba(100, 116, 139, .15); color: #94A3B8; border-color: rgba(100, 116, 139, .3); }
[data-theme="light"] .badge-green { color: #047857; }
[data-theme="light"] .badge-amber { color: #B45309; }
[data-theme="light"] .badge-red { color: #B91C1C; }
[data-theme="light"] .badge-blue { color: #1D4ED8; }
[data-theme="light"] .badge-indigo { color: #0F766E; }
[data-theme="light"] .badge-purple { color: #0D9488; }
[data-theme="light"] .badge-cyan { color: #B45309; }
[data-theme="light"] .badge-slate { color: #475569; }

/* ---------- Cards ---------- */
.card {
    background: var(--card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-sm);
}
.glass {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.glass-sm { border-radius: var(--radius); }

.card-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 14px; margin-bottom: 18px;
}
.card-head h3 { font-size: 15.5px; }
.card-head p { font-size: 12.5px; color: var(--text-muted); margin: 3px 0 0; }
.card-head.between { align-items: center; }

/* ---------- Stat cards ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}
.stat-grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.stat-grid-5 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.stat-card {
    position: relative;
    padding: 20px;
    overflow: hidden;
}
.stat-card::after {
    content: '';
    position: absolute;
    right: -34px; top: -34px;
    width: 110px; height: 110px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(20, 184, 166, .16), transparent 70%);
    pointer-events: none;
}
.stat-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.stat-icon {
    width: 42px; height: 42px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 12px;
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 8px 18px -6px rgba(13, 148, 136, .55);
}
.stat-icon svg { width: 19px; height: 19px; }
.stat-trend { font-size: 11.5px; font-weight: 600; color: var(--text-faint); display: inline-flex; align-items: center; gap: 4px; }
.stat-trend svg { width: 13px; height: 13px; }
.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }
.stat-value { font-size: 27px; font-weight: 700; letter-spacing: -.5px; display: block; }
.stat-label { font-size: 12.5px; color: var(--text-muted); }

/* ---------- Layout shell ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    position: fixed;
    inset: 0 auto 0 0;
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 50;
    transition: transform .3s cubic-bezier(.16, 1, .3, 1), width .3s cubic-bezier(.16, 1, .3, 1);
}
.sidebar-brand {
    display: flex; align-items: center; gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}
.brand-mark {
    width: 40px; height: 40px;
    border-radius: 12px;
    background: var(--gradient);
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 8px 18px -6px rgba(13, 148, 136, .55);
}
.brand-mark svg { width: 21px; height: 21px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 16px; letter-spacing: -.2px; }
.brand-sub { font-size: 11.5px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .8px; }
.sidebar-close { display: none; margin-left: auto; background: none; border: 0; color: var(--text-muted); font-size: 24px; cursor: pointer; line-height: 1; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
.nav-group { margin-bottom: 18px; }
.nav-group-label {
    font-size: 10.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1.2px;
    color: var(--text-faint);
    padding: 0 12px; margin-bottom: 7px;
}
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 9.5px 12px;
    border-radius: 10px;
    color: var(--text-muted);
    font-weight: 500; font-size: 13.5px;
    margin-bottom: 2px;
    position: relative;
    transition: all .18s ease;
}
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.active {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 8px 18px -6px rgba(13, 148, 136, .5);
}
.nav-icon { width: 19px; height: 19px; flex-shrink: 0; }
.nav-icon svg { width: 19px; height: 19px; }
.nav-label { white-space: nowrap; transition: opacity .2s ease; }

.sidebar-footer { border-top: 1px solid var(--border); padding: 14px 16px; }
.sidebar-user { display: flex; align-items: center; gap: 11px; }
.sidebar-user-meta { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.sidebar-user-meta strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-meta span { font-size: 11.5px; color: var(--text-muted); }

body.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .sidebar-user-meta,
body.sidebar-collapsed .nav-group-label { opacity: 0; pointer-events: none; }
body.sidebar-collapsed .nav-group-label { height: 0; overflow: hidden; }
body.sidebar-collapsed .sidebar-brand { justify-content: center; padding: 18px 10px; }
body.sidebar-collapsed .nav-item { justify-content: center; padding: 11px; }
body.sidebar-collapsed .sidebar-user { justify-content: center; }
body.sidebar-collapsed .nav-item:hover .nav-label {
    opacity: 1; position: absolute; left: 100%; top: 0;
    background: var(--tooltip-bg);
    border: 1px solid var(--border);
    padding: 6px 12px; border-radius: 8px;
    white-space: nowrap; z-index: 60;
    font-size: 12.5px; color: var(--text);
    box-shadow: var(--shadow);
}

.sidebar-backdrop {
    position: fixed; inset: 0;
    background: rgba(2, 6, 23, .6);
    backdrop-filter: blur(2px);
    z-index: 45;
    opacity: 0; pointer-events: none;
    transition: opacity .25s ease;
}
.sidebar-backdrop.show { opacity: 1; pointer-events: auto; }

.main {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-width: 0;
    display: flex; flex-direction: column;
    transition: margin-left .3s cubic-bezier(.16, 1, .3, 1);
}
body.sidebar-collapsed .main { margin-left: var(--sidebar-w-collapsed); }

/* ---------- Topbar ---------- */
.topbar {
    position: sticky; top: 0; z-index: 40;
    height: var(--topbar-h);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 26px;
    background: var(--glass);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
}
.topbar-left { display: flex; align-items: center; gap: 16px; min-width: 0; }
.page-title h1 { font-size: 17px; font-weight: 700; letter-spacing: -.3px; }
.page-title span { font-size: 11.5px; color: var(--text-muted); }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.profile-btn {
    display: flex; align-items: center; gap: 10px;
    background: var(--hover);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 5px 12px 5px 6px;
    cursor: pointer;
    transition: all .18s ease;
}
.profile-btn:hover { border-color: var(--border-strong); }
.profile-name { font-size: 13px; font-weight: 600; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-btn > svg { width: 15px; height: 15px; color: var(--text-muted); }

/* Avatar */
.avatar {
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff;
    font-weight: 700;
    flex-shrink: 0;
    font-family: var(--font-head);
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-xs { width: 26px; height: 26px; font-size: 10px; }
.avatar-sm { width: 36px; height: 36px; font-size: 12px; }
.avatar-md { width: 40px; height: 40px; font-size: 13px; }
.avatar-lg { width: 54px; height: 54px; font-size: 17px; }
.avatar-xl { width: 76px; height: 76px; font-size: 24px; border-radius: 20px; }

/* ---------- Dropdowns ---------- */
.notif-wrap, .profile-wrap { position: relative; }
.dropdown {
    position: absolute;
    right: 0; top: calc(100% + 10px);
    min-width: 300px;
    background: var(--card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(-8px) scale(.98);
    pointer-events: none;
    transition: all .2s cubic-bezier(.16, 1, .3, 1);
    z-index: 60;
    overflow: hidden;
}
.dropdown.show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.dropdown-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.dropdown-head strong { font-size: 14px; }
.dropdown-head a { font-size: 12.5px; font-weight: 600; }

.notif-badge {
    position: absolute; top: -5px; right: -5px;
    min-width: 18px; height: 18px;
    border-radius: 999px;
    background: linear-gradient(135deg, #EF4444, #F97316);
    color: #fff;
    font-size: 10px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    padding: 0 5px;
    border: 2px solid var(--bg);
}
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item {
    display: flex; gap: 11px; align-items: flex-start;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    transition: background .15s ease;
    color: var(--text);
}
.notif-item:hover { background: var(--hover); }
.notif-item.unread { background: rgba(13, 148, 136, .06); }
.notif-item strong { font-size: 13px; display: block; }
.notif-item p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-muted); }
.notif-item time { font-size: 11px; color: var(--text-faint); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.dot-success, .dot-green { background: var(--success); }
.dot-error, .dot-red { background: var(--danger); }
.dot-info, .dot-blue { background: var(--info); }
.dot-warning, .dot-amber { background: var(--warning); }
.dot-purple { background: var(--secondary); }
.dot-indigo { background: var(--primary); }
.dot-slate { background: var(--text-faint); }

.profile-dropdown { min-width: 230px; }
.dropdown-user { padding: 18px; text-align: center; border-bottom: 1px solid var(--border); }
.dropdown-user strong { display: block; margin-top: 8px; font-size: 14px; }
.dropdown-user span:not(.avatar) { font-size: 12px; color: var(--text-muted); }
.profile-dropdown a {
    display: flex; align-items: center; gap: 11px;
    padding: 11px 18px;
    font-size: 13.5px;
    color: var(--text);
    transition: background .15s ease;
}
.profile-dropdown a:hover { background: var(--hover); }
.profile-dropdown a svg { width: 16px; height: 16px; color: var(--text-muted); }
.profile-dropdown a.danger { color: var(--danger); }
.profile-dropdown a.danger svg { color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ---------- Content ---------- */
.content {
    padding: 26px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--text-faint);
    padding: 13px 15px;
    background: var(--hover);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table td { padding: 12px 15px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s ease; }
.table tbody tr:hover { background: var(--table-stripe); }
.table tbody tr.row-highlight { background: rgba(13, 148, 136, .07); animation: rowFlash 1s ease; }
@keyframes rowFlash { 0% { background: rgba(13, 148, 136, .18); } 100% { background: rgba(13, 148, 136, .07); } }

.cell-user { display: flex; align-items: center; gap: 11px; }
.cell-user strong { display: block; font-size: 13.5px; }
.cell-user .muted { font-size: 12px; }
.cell-user > div:last-child { line-height: 1.3; }
.mini-ok { display: block; font-size: 11px; color: var(--success); font-weight: 600; }
.mini-gender { display: inline-flex; width: 18px; height: 18px; align-items: center; justify-content: center; border-radius: 6px; font-size: 11px; margin-right: 4px; }
.mini-gender.m { background: rgba(59, 130, 246, .15); color: #60A5FA; }
.mini-gender.f { background: rgba(236, 72, 153, .15); color: #F472B6; }

.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.row-actions .icon-btn { width: 34px; height: 34px; border-radius: 9px; }

.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- Attendance ---------- */
.att-table .att-td { text-align: center; width: 64px; }
.radio-pill { display: inline-flex; cursor: pointer; }
.radio-pill input { display: none; }
.radio-mark {
    width: 26px; height: 26px;
    border-radius: 9px;
    border: 2px solid var(--border-strong);
    display: inline-flex; align-items: center; justify-content: center;
    transition: all .18s ease;
}
.radio-pill input:checked + .radio-mark { border-color: var(--primary); }
.radio-pill input:checked + .radio-mark::after { content: ''; width: 12px; height: 12px; border-radius: 4px; background: var(--gradient); }
.att-pill {
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
    padding: 4px 9px; border-radius: 999px;
}
.att-present { background: rgba(16,185,129,.14); color: #34D399; }
.att-late { background: rgba(245,158,11,.14); color: #FBBF24; }
.att-sick { background: rgba(239,68,68,.14); color: #F87171; }
.att-permission { background: rgba(59,130,246,.14); color: #60A5FA; }
.att-absent { background: rgba(100,116,139,.18); color: #94A3B8; }
.loader-inline { width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Monthly summary */
.month-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.month-day-card { padding: 12px; text-align: center; border: 1px solid var(--border); border-radius: 12px; background: var(--hover); }
.month-day-card strong { font-size: 18px; display: block; }
.month-day-card > span { font-size: 11px; color: var(--text-muted); text-transform: uppercase; }
.month-day-stats { display: flex; gap: 4px; justify-content: center; margin-top: 8px; }
.mds { width: 18px; height: 18px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #fff; }
.md-present { background: #10B981; }
.md-late { background: #F59E0B; }
.md-sick { background: #EF4444; }
.md-permission { background: #3B82F6; }
.md-absent { background: #64748B; }

/* ---------- Charts ---------- */
.chart-box { position: relative; height: 300px; }
.chart-box.chart-sm { height: 210px; }
.legend { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--text-muted); }
.lg { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 3px; }
.lg-indigo { background: #0D9488; }
.lg-cyan { background: #F59E0B; }
.lg-emerald { background: #10B981; }
.lg-red { background: #EF4444; }
.status-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 16px; }
.sl-item { font-size: 12.5px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 6px; }
.sl-item strong { color: var(--text); font-family: var(--font-mono); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-indigo { background: #0D9488; }
.dot-amber { background: #F59E0B; }
.dot-red { background: #EF4444; }
.dot-blue { background: #3B82F6; }
.dot-slate { background: #64748B; }

/* Events / activities list */
.event-list { display: flex; flex-direction: column; }
.event-item { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.event-item:last-child { border-bottom: 0; }
.event-date {
    width: 48px; height: 52px;
    border-radius: 12px;
    background: var(--gradient);
    color: #fff;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    flex-shrink: 0;
    line-height: 1.1;
}
.event-date strong { font-family: var(--font-mono); font-size: 17px; }
.event-date span { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; opacity: .85; }
.event-date.event-time { background: linear-gradient(135deg, #14B8A6, #F59E0B); font-size: 11px; }
.event-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.event-body strong { font-size: 13.5px; }
.event-body small { color: var(--text-muted); font-size: 12px; }

.activity-list { display: flex; flex-direction: column; }
.activity-item { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: 0; }
.activity-body { flex: 1; min-width: 0; }
.activity-body p { margin: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-body time { font-size: 11.5px; color: var(--text-faint); }

/* ---------- Modals ---------- */
.modal-layer { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-layer.show { display: flex; }
.modal-layer::before {
    content: '';
    position: absolute; inset: 0;
    background: rgba(2, 6, 23, .62);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: fadeIn .2s ease;
}
.modal { display: none; }
.modal-layer .modal { display: block; }
.modal-card {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 88vh;
    overflow-y: auto;
    background: var(--card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--card-solid); z-index: 2; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.modal-head h3 { font-size: 16px; }
.modal-close { background: var(--hover); border: 0; width: 34px; height: 34px; border-radius: 9px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-muted); transition: all .18s ease; }
.modal-close:hover { color: var(--danger); background: rgba(239, 68, 68, .12); }
.modal-close svg { width: 17px; height: 17px; }
.modal-body { padding: 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--card-solid); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }

.detail-hero { display: flex; align-items: center; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.detail-hero h4 { font-size: 17px; }
.detail-hero .muted { font-size: 12.5px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.detail-row { background: var(--hover); border-radius: 10px; padding: 12px 14px; border: 1px solid var(--border); }
.detail-row span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--text-faint); font-weight: 600; margin-bottom: 3px; }
.detail-row strong { font-size: 13.5px; font-weight: 600; }

/* ---------- Toasts ---------- */
.toast-stack { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: min(360px, calc(100vw - 32px)); }
.toast {
    display: flex; align-items: flex-start; gap: 12px;
    background: var(--card-solid);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 13px 14px;
    box-shadow: var(--shadow-lg);
    animation: toastIn .35s cubic-bezier(.16, 1, .3, 1);
    transition: opacity .25s ease, transform .25s ease;
}
.toast.out { opacity: 0; transform: translateX(30px); }
.toast-icon { width: 20px; height: 20px; flex-shrink: 0; }
.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--danger); }
.toast-info .toast-icon { color: var(--info); }
.toast-warning .toast-icon { color: var(--warning); }
.toast strong { display: block; font-size: 13px; text-transform: capitalize; }
.toast p { margin: 1px 0 0; font-size: 12.5px; color: var(--text-muted); }
.toast-close { margin-left: auto; background: none; border: 0; color: var(--text-faint); font-size: 17px; cursor: pointer; line-height: 1; padding: 0 2px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }

/* ---------- App loader ---------- */
.app-loader {
    position: fixed; inset: 0; z-index: 999;
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    transition: opacity .45s ease, visibility .45s ease;
}
.app-loader.done { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-inner { position: relative; width: 84px; height: 84px; display: flex; align-items: center; justify-content: center; }
.loader-ring {
    position: absolute; inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--primary);
    border-right-color: var(--secondary);
    animation: spin 1.1s linear infinite;
}
.loader-mark {
    width: 52px; height: 52px;
    border-radius: 16px;
    background: var(--gradient);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 14px 34px -10px rgba(13, 148, 136, .7);
}
.loader-mark svg { width: 27px; height: 27px; }

/* ---------- Search palette ---------- */
.search-palette {
    position: fixed; inset: 0; z-index: 150;
    display: none; align-items: flex-start; justify-content: center;
    padding: 14vh 20px 20px;
}
.search-palette.show { display: flex; }
.search-palette::before { content: ''; position: absolute; inset: 0; background: rgba(2, 6, 23, .6); backdrop-filter: blur(4px); animation: fadeIn .2s ease; }
.palette-box {
    position: relative;
    width: 100%; max-width: 620px;
    background: var(--card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: modalIn .25s cubic-bezier(.16, 1, .3, 1);
}
.palette-input { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.palette-input svg { width: 18px; height: 18px; color: var(--text-faint); }
.palette-input input { flex: 1; background: none; border: 0; outline: 0; color: var(--text); font-size: 15px; font-family: var(--font-body); }
.palette-results { max-height: 52vh; overflow-y: auto; }
.palette-group { padding: 10px 18px 5px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-faint); display: flex; align-items: center; gap: 6px; }
.palette-group svg { width: 13px; height: 13px; }
.palette-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 18px; color: var(--text); transition: background .12s ease; }
.palette-item:hover { background: var(--hover); color: var(--text); }
.palette-item small { color: var(--text-muted); font-size: 12px; }
.empty-inline { text-align: center; color: var(--text-faint); padding: 22px; font-size: 13px; }

/* ---------- Grid utils ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: 24px; }

/* Skeleton */
.skeleton-line { height: 13px; border-radius: 6px; background: linear-gradient(90deg, var(--border) 25%, var(--hover) 50%, var(--border) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; margin-bottom: 10px; }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w80 { width: 80%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Landing page ---------- */
body.landing { background: #0F172A; color: #E2E8F0; overflow-x: hidden; }
.landing-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: #0F172A; overflow: hidden; }
.aurora { position: absolute; border-radius: 50%; filter: blur(110px); opacity: .3; }
.aurora-a { width: 560px; height: 560px; background: rgba(13, 148, 136, .5); top: -180px; left: -120px; animation: floaty 18s ease-in-out infinite; }
.aurora-b { width: 520px; height: 520px; background: rgba(245, 158, 11, .22); top: 20%; right: -160px; animation: floaty 24s ease-in-out infinite reverse; }
.aurora-c { width: 460px; height: 460px; background: rgba(20, 184, 166, .2); bottom: -160px; left: 30%; animation: floaty 30s ease-in-out infinite; }
@keyframes floaty { 0%, 100% { transform: translate(0, 0) scale(1); } 33% { transform: translate(40px, -40px) scale(1.08); } 66% { transform: translate(-30px, 30px) scale(.94); } }
.float-shape { position: absolute; border: 1.5px solid rgba(148, 163, 184, .28); animation: floaty 12s ease-in-out infinite; }
.shape-1 { width: 90px; height: 90px; border-radius: 24px; transform: rotate(20deg); top: 22%; left: 8%; }
.shape-2 { width: 60px; height: 60px; border-radius: 50%; right: 12%; top: 16%; border-color: rgba(20, 184, 166, .4); }
.shape-3 { width: 70px; height: 70px; border-radius: 18px; bottom: 18%; right: 26%; border-color: rgba(245, 158, 11, .35); transform: rotate(-15deg); }
.grid-overlay { position: absolute; inset: 0; background-image: linear-gradient(rgba(148,163,184,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(148,163,184,.06) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 40%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 40%, transparent 75%); }
#particles, #authParticles { position: absolute; inset: 0; }

/* Landing nav */
.lp-nav { position: fixed; top: 0; left: 0; right: 0; z-index: 60; transition: all .3s ease; }
.lp-nav.scrolled { background: rgba(15, 23, 42, .72); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid rgba(148, 163, 184, .12); }
.lp-nav-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 16px 28px; gap: 20px; }
.lp-brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.lp-brand strong { font-family: var(--font-head); font-size: 17px; display: block; line-height: 1.1; }
.lp-brand small { font-size: 11px; color: #94A3B8; text-transform: uppercase; letter-spacing: .8px; }
.lp-menu { display: flex; gap: 4px; }
.lp-link { color: #94A3B8; font-size: 13.5px; font-weight: 500; padding: 8px 13px; border-radius: 9px; transition: all .18s ease; }
.lp-link:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.lp-actions { display: flex; align-items: center; gap: 10px; }
.lp-burger { display: none; }

/* Hero */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 130px 24px 60px; }
.hero-inner { max-width: 860px; position: relative; z-index: 2; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 9px;
    background: rgba(148, 163, 184, .1);
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 999px;
    padding: 7px 16px;
    font-size: 12.5px;
    color: #CBD5E1;
    margin-bottom: 26px;
}
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); animation: pulse 2s infinite; position: relative; }
.pulse-dot::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; background: rgba(16, 185, 129, .4); animation: pulse 2s infinite; }
@keyframes pulse { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.8); opacity: 0; } }
.hero-title { font-size: clamp(44px, 8vw, 86px); font-weight: 800; letter-spacing: -2.5px; line-height: 1.02; margin-bottom: 22px; }
.hero-sub { font-size: clamp(15px, 2vw, 18.5px); color: #94A3B8; max-width: 620px; margin: 0 auto 34px; line-height: 1.7; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 56px; }
.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; max-width: 760px; margin: 0 auto; }
.hs-item { background: rgba(255, 255, 255, .045); border: 1px solid rgba(148, 163, 184, .16); border-radius: 16px; padding: 18px 12px; backdrop-filter: blur(10px); transition: all .25s ease; }
.hs-item:hover { transform: translateY(-4px); border-color: rgba(20, 184, 166, .4); box-shadow: 0 16px 34px -14px rgba(13, 148, 136, .4); }
.hs-item strong { display: block; font-size: 26px; color: #fff; }
.hs-item span { font-size: 12px; color: #94A3B8; }
.hero-scroll { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); color: #94A3B8; animation: bob 2s ease-in-out infinite; }
.hero-scroll svg { width: 26px; height: 26px; }
@keyframes bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 9px); } }

/* Sections */
.lp-section { position: relative; z-index: 1; padding: 100px 24px; }
.lp-section.alt { background: rgba(255, 255, 255, .022); border-top: 1px solid rgba(148, 163, 184, .1); border-bottom: 1px solid rgba(148, 163, 184, .1); }
.lp-container { max-width: 1180px; margin: 0 auto; }
.section-head { text-align: center; margin-bottom: 54px; }
.section-eyebrow {
    display: inline-block;
    font-size: 11.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 2px;
    color: var(--accent);
    background: rgba(245, 158, 11, .1);
    border: 1px solid rgba(245, 158, 11, .25);
    padding: 6px 14px; border-radius: 999px;
    margin-bottom: 18px;
}
.section-title { font-size: clamp(28px, 4.5vw, 42px); font-weight: 800; letter-spacing: -1px; }

.about-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.about-card { padding: 32px; transition: all .3s ease; }
.about-card:hover { transform: translateY(-6px); border-color: rgba(13, 148, 136, .4); box-shadow: 0 24px 48px -18px rgba(13, 148, 136, .35); }
.about-icon {
    width: 54px; height: 54px; border-radius: 16px;
    background: var(--gradient); color: #fff;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 20px;
    box-shadow: 0 12px 24px -8px rgba(13, 148, 136, .6);
}
.about-icon svg { width: 24px; height: 24px; }
.about-card h3 { font-size: 18px; margin-bottom: 10px; }
.about-card p { color: #94A3B8; font-size: 14px; line-height: 1.7; margin: 0; }

.vm-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; max-width: 960px; margin: 0 auto; }
.vm-card { padding: 36px; position: relative; overflow: hidden; }
.vm-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--gradient); }
.vm-card.accent::before { background: var(--gradient-accent); }
.vm-badge {
    display: inline-block;
    font-family: var(--font-head); font-weight: 700; font-size: 12px;
    text-transform: uppercase; letter-spacing: 2px;
    color: var(--primary);
    background: rgba(13, 148, 136, .14);
    padding: 6px 15px; border-radius: 999px;
    margin-bottom: 18px;
}
.vm-badge.accent { color: var(--accent); background: rgba(245, 158, 11, .12); }
.vm-card h3 { font-size: 20px; line-height: 1.6; font-weight: 600; }
.vm-card ul { margin: 0; padding: 0; list-style: none; }
.vm-card li { color: #CBD5E1; padding: 9px 0 9px 26px; position: relative; font-size: 14.5px; }
.vm-card li::before { content: ''; position: absolute; left: 0; top: 17px; width: 12px; height: 12px; border-radius: 4px; background: var(--gradient-accent); }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.stat-card.lp {
    padding: 28px; text-align: center; transition: all .3s ease;
}
.stat-card.lp:hover { transform: translateY(-5px); border-color: rgba(20, 184, 166, .4); }
.stat-icon.lp { margin: 0 auto 14px; }
.stat-card.lp strong { font-size: 34px; display: block; color: #fff; }
.stat-card.lp span { color: #94A3B8; font-size: 13px; }

.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.gallery-item { position: relative; border-radius: 18px; overflow: hidden; aspect-ratio: 4/3; display: block; border: 1px solid rgba(148, 163, 184, .15); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.16, 1, .3, 1); }
.gallery-item:hover img { transform: scale(1.07); }
.gallery-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(2, 6, 23, .85), transparent 60%);
    display: flex; flex-direction: column; justify-content: flex-end;
    padding: 18px; gap: 6px;
    opacity: 0; transition: opacity .3s ease;
}
.gallery-item:hover .gallery-overlay { opacity: 1; }
.gallery-overlay svg { width: 20px; height: 20px; color: #fff; }
.gallery-overlay strong { color: #fff; font-size: 14px; }
.gallery-ph { height: 100%; display: flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, .5); }
.gallery-ph svg { width: 44px; height: 44px; }

.lightbox { position: fixed; inset: 0; z-index: 300; background: rgba(2, 6, 23, .92); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 30px; animation: fadeIn .25s ease; }
.lightbox img { max-width: 90vw; max-height: 80vh; border-radius: 14px; }
.lightbox p { color: #CBD5E1; }
.lightbox-close { position: absolute; top: 22px; right: 26px; background: none; border: 0; color: #fff; font-size: 38px; cursor: pointer; line-height: 1; }

.ann-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.ann-card { padding: 26px; transition: all .3s ease; }
.ann-card:hover { transform: translateY(-5px); border-color: rgba(245, 158, 11, .35); }
.ann-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.ann-meta time { margin-left: auto; font-size: 12px; color: #94A3B8; }
.ann-card h3 { font-size: 17px; margin-bottom: 10px; }
.ann-card p { color: #94A3B8; font-size: 13.5px; line-height: 1.7; margin: 0 0 14px; }
.ann-author { font-size: 12px; color: #64748B; }

.teacher-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.teacher-card { padding: 28px 20px; text-align: center; transition: all .3s ease; }
.teacher-card:hover { transform: translateY(-5px); border-color: rgba(13, 148, 136, .4); }
.teacher-avatar {
    width: 68px; height: 68px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 20px;
    margin-bottom: 14px;
    font-family: var(--font-head);
    box-shadow: 0 12px 24px -8px rgba(2, 6, 23, .5);
}
.teacher-card h3 { font-size: 15px; }
.teacher-subject { display: inline-block; margin-top: 6px; font-size: 12px; color: var(--accent); background: rgba(245, 158, 11, .1); padding: 4px 12px; border-radius: 999px; }

.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; max-width: 960px; margin: 0 auto; }
.contact-card { padding: 28px; text-align: center; transition: all .3s ease; }
.contact-card:hover { transform: translateY(-5px); }
.contact-icon {
    width: 48px; height: 48px; border-radius: 14px;
    background: rgba(20, 184, 166, .14);
    color: #5EEAD4;
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 14px;
}
.contact-icon svg { width: 22px; height: 22px; }
.contact-card strong { display: block; font-size: 14px; margin-bottom: 4px; }
.contact-card p { margin: 0; color: #94A3B8; font-size: 13px; }

/* Landing footer */
.lp-footer { position: relative; z-index: 1; background: rgba(2, 6, 23, .6); border-top: 1px solid rgba(148, 163, 184, .12); padding: 60px 24px 26px; }
.lp-footer-top { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: 1.4fr 2fr; gap: 48px; padding-bottom: 40px; border-bottom: 1px solid rgba(148, 163, 184, .1); }
.lp-footer-top > div:first-child p { color: #94A3B8; font-size: 13.5px; max-width: 380px; margin: 18px 0 0; line-height: 1.7; }
.lp-footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.lp-footer-cols h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px; color: #64748B; margin-bottom: 16px; }
.lp-footer-cols a { display: block; color: #94A3B8; font-size: 13.5px; padding: 5px 0; transition: color .18s ease; }
.lp-footer-cols a:hover { color: #fff; }
.lp-footer-bottom { max-width: 1180px; margin: 24px auto 0; display: flex; justify-content: space-between; font-size: 12.5px; color: #64748B; }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s cubic-bezier(.16, 1, .3, 1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Auth page ---------- */
body.auth-body { background: #0F172A; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 30px 20px; overflow-x: hidden; }
.auth-bg { position: fixed; inset: 0; overflow: hidden; }
.auth-wrap { position: relative; z-index: 2; width: 100%; max-width: 440px; }
.auth-card { padding: 40px 38px; }
.auth-brand { display: inline-flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.auth-brand strong { color: #fff; font-family: var(--font-head); font-size: 17px; display: block; line-height: 1.15; }
.auth-brand small { color: #94A3B8; font-size: 11px; }
.auth-head h1 { color: #fff; font-size: 25px; font-weight: 700; letter-spacing: -.5px; margin-bottom: 6px; }
.auth-head p { color: #94A3B8; font-size: 13.5px; margin: 0 0 26px; }
.auth-form .field label { color: #CBD5E1; }
.auth-form .input-wrap { background: rgba(15, 23, 42, .6); }
.auth-form .input-wrap input { color: #fff; }
.auth-row { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 20px; }
.auth-demo {
    margin-top: 24px;
    background: rgba(13, 148, 136, .08);
    border: 1px dashed rgba(13, 148, 136, .35);
    border-radius: 14px;
    padding: 16px;
}
.demo-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: #FCD34D; margin-bottom: 10px; }
.demo-head svg { width: 15px; height: 15px; }
.demo-creds { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 12.5px; color: #94A3B8; align-items: center; margin-bottom: 12px; }
.demo-creds code { background: rgba(15, 23, 42, .7); border: 1px solid rgba(148, 163, 184, .2); padding: 4px 10px; border-radius: 8px; color: #E2E8F0; font-size: 12.5px; }
.auth-foot { text-align: center; margin-top: 22px; font-size: 13px; color: #94A3B8; }
.auth-foot a { display: inline-flex; align-items: center; gap: 6px; }
.auth-foot a svg { width: 15px; height: 15px; }

/* ---------- Misc ---------- */
.fade-in { animation: fadeIn .5s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state svg { width: 52px; height: 52px; opacity: .4; margin-bottom: 14px; }

/* Calendar */
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-day-head { text-align: center; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--text-faint); padding: 8px 0; }
.cal-day { min-height: 96px; border: 1px solid var(--border); border-radius: 12px; padding: 8px; background: var(--hover); position: relative; transition: all .2s ease; }
.cal-day:hover { border-color: var(--border-strong); }
.cal-day.other { opacity: .35; }
.cal-day.today { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(13, 148, 136, .25); }
.cal-num { font-size: 12.5px; font-weight: 700; font-family: var(--font-mono); margin-bottom: 6px; }
.cal-ev { display: block; font-size: 10.5px; padding: 3px 7px; border-radius: 6px; margin-bottom: 3px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; transition: opacity .15s ease; }
.cal-ev:hover { opacity: .85; }
.cal-ev.event { background: #0D9488; }
.cal-ev.assignment { background: #3B82F6; }
.cal-ev.exam { background: #EF4444; }
.cal-ev.meeting { background: #14B8A6; }
.cal-ev.cleaning { background: #10B981; }
.cal-more { font-size: 10.5px; color: var(--text-faint); padding-left: 7px; }
.cal-nav { display: flex; align-items: center; gap: 10px; }

/* Schedule board */
.schedule-board { overflow-x: auto; }
.schedule-grid { display: grid; grid-template-columns: repeat(6, minmax(180px, 1fr)); gap: 10px; min-width: 1000px; }
.schedule-col { border: 1px solid var(--border); border-radius: 14px; background: var(--hover); overflow: hidden; }
.schedule-day-head { font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); padding: 10px 12px; text-align: center; }
.schedule-col:nth-child(6n+2) .schedule-day-head { background: linear-gradient(135deg, #14B8A6, #F59E0B); }
.schedule-col:nth-child(6n+3) .schedule-day-head { background: linear-gradient(135deg, #14B8A6, #3B82F6); }
.schedule-col:nth-child(6n+4) .schedule-day-head { background: linear-gradient(135deg, #10B981, #F59E0B); }
.schedule-col:nth-child(6n+5) .schedule-day-head { background: linear-gradient(135deg, #F59E0B, #EF4444); }
.schedule-col:nth-child(6n+6) .schedule-day-head { background: linear-gradient(135deg, #EC4899, #14B8A6); }
.schedule-empty { padding: 18px 10px; text-align: center; color: var(--text-faint); font-size: 12px; }
.schedule-card { position: relative; margin: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--bg); box-shadow: 0 2px 8px rgba(0, 0, 0, .08); }
.schedule-time { font-size: 11px; color: var(--primary); font-weight: 600; margin-bottom: 4px; }
.schedule-subject { font-size: 13.5px; font-weight: 700; line-height: 1.3; margin-bottom: 5px; }
.schedule-teacher, .schedule-room { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.schedule-teacher svg, .schedule-room svg { width: 13px; height: 13px; flex-shrink: 0; }
.schedule-actions { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .2s ease; }
.schedule-card:hover .schedule-actions { opacity: 1; }
.schedule-actions .icon-btn { width: 24px; height: 24px; }
.schedule-actions .icon-btn svg { width: 13px; height: 13px; }


/* Permissions grid */
.perm-cat { margin-bottom: 20px; }
.perm-cat-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-faint); margin-bottom: 10px; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.perm-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; background: var(--hover); border: 1px solid var(--border); padding: 8px 11px; border-radius: 9px; cursor: pointer; transition: all .15s ease; }
.perm-item:hover { border-color: var(--border-strong); }
.perm-item input { accent-color: var(--primary); }

/* Profile */
.profile-grid { display: grid; grid-template-columns: 300px 1fr; gap: 24px; }
.profile-side { text-align: center; }
.profile-side .avatar { margin: 0 auto 16px; }
.profile-side h3 { font-size: 17px; margin-bottom: 3px; }
.profile-side .role-badge { display: inline-block; background: rgba(20, 184, 166, .14); color: #5EEAD4; font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 999px; margin-top: 6px; }
.profile-meta { margin-top: 20px; text-align: left; border-top: 1px solid var(--border); padding-top: 16px; }
.profile-meta .detail-row { margin-bottom: 8px; }
.profile-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.tab-btn { background: none; border: 0; padding: 10px 16px; font-size: 13.5px; font-weight: 600; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all .18s ease; }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Backup / restore */
.backup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.file-list { display: flex; flex-direction: column; }
.file-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.file-item .mono { font-size: 12px; color: var(--text-muted); }

/* Toast-stack-init hidden */
.toast-stack-init { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
    .about-grid { grid-template-columns: repeat(3, 1fr); }
    .teacher-grid { grid-template-columns: repeat(3, 1fr); }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); box-shadow: none; }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .sidebar-close { display: block; }
    body.sidebar-collapsed .sidebar { width: var(--sidebar-w); }
    .main { margin-left: 0 !important; }
    body.sidebar-collapsed .main { margin-left: 0; }
    body.sidebar-collapsed .brand-text, body.sidebar-collapsed .nav-label, body.sidebar-collapsed .sidebar-user-meta, body.sidebar-collapsed .nav-group-label { opacity: 1; pointer-events: auto; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .profile-grid { grid-template-columns: 1fr; }
    .backup-grid { grid-template-columns: 1fr; }
    .vm-grid { grid-template-columns: 1fr; }
    .about-grid { grid-template-columns: repeat(2, 1fr); }
    .ann-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-stats { grid-template-columns: repeat(2, 1fr); }
    .contact-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .content { padding: 18px; }
    .topbar { padding: 0 16px; }
    .profile-name { display: none; }
    .page-title span { display: none; }
    .lp-menu { display: none; position: absolute; top: 100%; left: 0; right: 0; background: rgba(15, 23, 42, .96); backdrop-filter: blur(16px); flex-direction: column; padding: 14px; border-bottom: 1px solid rgba(148, 163, 184, .15); }
    .lp-menu.open { display: flex; }
    .lp-burger { display: inline-flex; }
    .about-grid, .teacher-grid, .gallery-grid, .ann-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
    .lp-footer-top { grid-template-columns: 1fr; }
    .lp-footer-cols { grid-template-columns: repeat(2, 1fr); }
    .stat-grid-5 { grid-template-columns: repeat(2, 1fr); }
    .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
    .stat-grid, .stat-grid-4 { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat-value { font-size: 22px; }
    .hero-stats { grid-template-columns: 1fr 1fr; }
    .auth-card { padding: 30px 22px; }
    .contact-grid { grid-template-columns: 1fr; }
}
