/* ==========================================================================
   KIDS — Sistem Informasi Sekolah
   Desain: modern, ringan, tanpa framework. Tema terang & gelap.
   ========================================================================== */

:root {
    --bg: #e4effa;
    --surface: #ffffff;
    --surface-2: #f0f7fd;
    --surface-3: #d9e8f7;
    --border: #c8def2;
    --text: #08243c;
    --text-soft: #365a7a;
    --muted: #6484a3;

    --primary: #0284c7;
    --primary-strong: #075985;
    --primary-soft: #d2e9fb;
    --on-primary: #ffffff;

    --accent: #f59e0b;
    --success: #0b8f5a;
    --success-soft: #d8f7e7;
    --danger: #e11d48;
    --danger-soft: #ffe2e8;
    --warning: #b45309;
    --warning-soft: #fef0d2;
    --info: #4f46e5;
    --info-soft: #e8e6ff;

    --radius: 16px;
    --radius-sm: 11px;
    --shadow-sm: 0 1px 2px rgba(3, 105, 161, .07);
    --shadow: 0 2px 4px rgba(3, 105, 161, .05), 0 22px 44px -26px rgba(2, 132, 199, .55);
    --ring: rgba(2, 132, 199, .30);
    --glow: rgba(2, 132, 199, .16);
    --glow-2: rgba(14, 165, 233, .10);

    --sidebar-w: 264px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

[data-theme="dark"] {
    --bg: #03101c;
    --surface: #081d30;
    --surface-2: #061726;
    --surface-3: #0f2b43;
    --border: #183c58;
    --text: #e7f4ff;
    --text-soft: #a9c6e0;
    --muted: #7d9cb9;

    --primary: #38bdf8;
    --primary-strong: #7dd3fc;
    --primary-soft: rgba(56, 189, 248, .16);
    --on-primary: #04222f;

    --accent: #fbbf24;
    --success: #34d399;
    --success-soft: rgba(52, 211, 153, .16);
    --danger: #fb7185;
    --danger-soft: rgba(251, 113, 133, .16);
    --warning: #fbbf24;
    --warning-soft: rgba(251, 191, 36, .16);
    --info: #a5b4fc;
    --info-soft: rgba(165, 180, 252, .16);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 2px 4px rgba(0, 0, 0, .32), 0 22px 44px -24px rgba(0, 0, 0, .9);
    --glow: rgba(56, 189, 248, .10);
    --glow-2: rgba(125, 211, 252, .08);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--text);
    background-color: var(--bg);
    background-image:
        radial-gradient(1100px 520px at 6% -10%, var(--glow), transparent 70%),
        radial-gradient(900px 480px at 100% 0%, var(--glow-2), transparent 65%);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4, p { margin: 0; }
a { color: var(--primary-strong); text-decoration: none; }
a:hover { text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.skip-link {
    position: absolute;
    left: -999px;
    top: 8px;
    z-index: 200;
    background: var(--surface);
    padding: 10px 16px;
    border-radius: 10px;
}
.skip-link:focus { left: 12px; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.inline { display: inline; }

.icon { width: 18px; height: 18px; flex: none; }

/* --------------------------------------------------------------------------
   Kerangka aplikasi
   -------------------------------------------------------------------------- */

.app { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px 14px 14px;
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
    border-right: 1px solid var(--border);
    z-index: 40;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 4px 8px 14px;
    color: inherit;
}
.brand-mark { width: 38px; height: 38px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { font-size: 15px; letter-spacing: .02em; }
.brand-text small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav { display: flex; flex-direction: column; gap: 1px; overflow-y: auto; padding-right: 2px; }
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }

.nav-section {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .09em;
    font-weight: 700;
    color: var(--muted);
    margin: 16px 10px 5px;
}
.nav-section:first-child { margin-top: 2px; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-soft);
    transition: background .15s, color .15s;
}
.nav-link .icon { width: 17px; height: 17px; opacity: .85; }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.is-active {
    background: linear-gradient(90deg, var(--primary-soft), transparent 92%);
    color: var(--primary-strong);
    font-weight: 650;
    box-shadow: inset 3px 0 0 var(--primary);
}
.nav-link.is-active .icon { opacity: 1; }

.sidebar-foot { margin-top: auto; padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.sidebar-meta { font-size: 11px; color: var(--muted); padding: 0 10px; }

.ghost-btn {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text-soft);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}
.ghost-btn:hover { background: var(--surface-3); color: var(--text); }
.theme-icon { display: none; }
[data-theme="dark"] .theme-icon-dark { display: inline-flex; }
:root:not([data-theme="dark"]) .theme-icon-light { display: inline-flex; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 66px;
    padding: 10px clamp(16px, 3vw, 30px);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 10px 30px -24px rgba(2, 132, 199, .7);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
    .topbar { background: var(--surface); }
}

.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title p { font-size: 12.5px; color: var(--muted); margin-top: 1px; }

.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-actions-slot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.content {
    flex: 1;
    width: 100%;
    max-width: 1340px;
    margin: 0 auto;
    padding: 22px clamp(16px, 3vw, 30px) 36px;
}

.foot {
    display: flex;
    gap: 8px;
    justify-content: center;
    padding: 18px;
    font-size: 12px;
    color: var(--muted);
    border-top: 1px solid var(--border);
}
.foot-dot { opacity: .5; }

/* Avatar & menu pengguna */
.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #0ea5e9, #075985);
    color: #ffffff;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .02em;
    flex: none;
    box-shadow: 0 6px 14px -8px rgba(14, 165, 233, .9);
}

.usermenu { position: relative; }
.usermenu > summary {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 4px 6px 4px 4px;
    border-radius: 999px;
    cursor: pointer;
    list-style: none;
}
.usermenu > summary::-webkit-details-marker { display: none; }
.usermenu > summary:hover { background: var(--surface-2); }
.usermenu-name { display: flex; flex-direction: column; line-height: 1.15; max-width: 160px; }
.usermenu-name strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usermenu-name small { font-size: 11px; color: var(--muted); }
.usermenu-caret { transform: rotate(90deg); width: 14px; height: 14px; color: var(--muted); }

.usermenu-pop {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 232px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 6px;
    z-index: 50;
}
.usermenu-pop a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 10px;
    border-radius: 9px;
    font-size: 13px;
    color: var(--text-soft);
}
.usermenu-pop a:hover { background: var(--surface-2); color: var(--text); }
.usermenu-pop a.is-danger { color: var(--danger); }
.usermenu-pop a.is-danger:hover { background: var(--danger-soft); }
.usermenu-head { padding: 10px 10px 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.usermenu-head strong { display: block; font-size: 13.5px; }
.usermenu-head small { font-size: 11.5px; color: var(--muted); }

.scrim { position: fixed; inset: 0; background: rgba(8, 15, 28, .5); z-index: 35; }

/* Notifikasi */
.notifmenu { position: relative; }
.notifmenu > summary { list-style: none; cursor: pointer; position: relative; }
.notifmenu > summary::-webkit-details-marker { display: none; }
.notif-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    display: grid;
    place-items: center;
    border: 2px solid var(--surface);
}
.notif-badge[hidden] { display: none; }
.notif-pop {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: min(370px, calc(100vw - 24px));
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    z-index: 50;
    overflow: hidden;
}
.notif-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}
.notif-head strong { font-size: 13.5px; }
.notif-mark {
    border: 0;
    background: none;
    color: var(--primary-strong);
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 7px;
}
.notif-mark:hover { background: var(--surface-2); }
.notif-perm { padding: 12px 14px; background: var(--primary-soft); border-bottom: 1px solid var(--border); }
.notif-perm[hidden] { display: none; }
.notif-perm p { font-size: 12px; color: var(--text-soft); line-height: 1.5; margin-bottom: 8px; }
.notif-list { max-height: min(380px, 60vh); overflow: auto; }
.notif-empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 12.5px; }
.notif-item { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--border); color: inherit; }
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--surface-2); }
.notif-dot { width: 7px; height: 7px; border-radius: 50%; background: transparent; flex: none; margin-top: 7px; }
.notif-item.is-unread .notif-dot { background: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.notif-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notif-text strong { font-size: 12.5px; font-weight: 700; line-height: 1.35; }
.notif-text span {
    font-size: 11.5px;
    color: var(--text-soft);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.notif-text small { font-size: 10.5px; color: var(--muted); }
.notif-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-strong);
}
.notif-page-list { display: flex; flex-direction: column; }
.notif-item-lg { padding: 15px 20px; gap: 12px; }
.notif-item-lg .notif-text strong { font-size: 13.5px; }
.notif-item-lg .notif-text span { font-size: 12.5px; -webkit-line-clamp: 3; }

/* Toast notifikasi */
.toast-wrap {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 80;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(340px, calc(100vw - 32px));
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    display: block;
    padding: 12px 14px;
    border-radius: 13px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    color: var(--text);
    animation: toast-in .22s ease;
}
.toast strong { display: block; font-size: 12.5px; }
.toast span { display: block; font-size: 11.5px; color: var(--text-soft); margin-top: 2px; line-height: 1.4; }
.toast.is-out { opacity: 0; transform: translateY(6px); transition: .3s; }
@keyframes toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   Tombol
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 15px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s, transform .1s;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn .icon { width: 16px; height: 16px; }

.btn-primary {
    background: linear-gradient(135deg, #0284c7, #075985);
    color: #ffffff;
    box-shadow: 0 10px 22px -12px rgba(2, 132, 199, .85);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #0369a1, #0c4a6e);
    color: #ffffff;
}
[data-theme="dark"] .btn-primary {
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    color: #04222f;
}
[data-theme="dark"] .btn-primary:hover {
    background: linear-gradient(135deg, #7dd3fc, #38bdf8);
    color: #04222f;
}

.btn-soft { background: var(--primary-soft); color: var(--primary-strong); }
.btn-soft:hover { background: var(--surface-3); }

.btn-ghost { background: transparent; color: var(--text-soft); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.94); }

.btn-sm { padding: 7px 11px; font-size: 12.5px; border-radius: 9px; }
.btn-block { width: 100%; }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
    transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 8px; }
.icon-btn.sm .icon { width: 15px; height: 15px; }
.icon-btn.is-danger { color: var(--danger); }
.icon-btn.is-danger:hover { background: var(--danger-soft); }

/* --------------------------------------------------------------------------
   Kartu, grid, statistik
   -------------------------------------------------------------------------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.card + .card { margin-top: 16px; }

.card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 17px 20px;
    border-bottom: 1px solid var(--border);
}
.card-head h2 { font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; }
.card-head p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.card-body { padding: 20px; }
.card-foot {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
}
.card-note { padding: 12px 20px; border-top: 1px dashed var(--border); font-size: 12.5px; color: var(--muted); }
.card-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    font-size: 12.5px;
    color: var(--text-soft);
}
.card-notice .icon { width: 16px; height: 16px; flex: none; margin-top: 1px; color: var(--primary-strong); }
.card-notice strong { display: block; color: var(--text); font-size: 13px; margin-bottom: 1px; }

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(172px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.stat {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}
.stat::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--primary);
}
.stat.is-warning::after { background: var(--warning); }
.stat.is-danger::after { background: var(--danger); }
.stat.is-info::after { background: var(--info); }
.stat.is-success::after { background: var(--success); }
.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    color: var(--primary-strong);
    flex: none;
}
.stat-icon .icon { width: 20px; height: 20px; }
.stat-value { font-size: 23px; font-weight: 760; letter-spacing: -.02em; line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat.is-warning .stat-icon { background: var(--warning-soft); color: var(--warning); }
.stat.is-danger .stat-icon { background: var(--danger-soft); color: var(--danger); }
.stat.is-info .stat-icon { background: var(--info-soft); color: var(--info); }
.stat.is-success .stat-icon { background: var(--success-soft); color: var(--success); }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.grid-2.even { grid-template-columns: 1fr 1fr; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.split { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; justify-content: space-between; }

/* --------------------------------------------------------------------------
   Badge, flash, notice
   -------------------------------------------------------------------------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 650;
    white-space: nowrap;
    line-height: 1.5;
}
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-muted { background: var(--surface-3); color: var(--text-soft); }
.badge-primary { background: var(--primary-soft); color: var(--primary-strong); }

.flash {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 13.5px;
    transition: opacity .3s, transform .3s;
}
.flash .icon { flex: none; }
.flash-success { background: var(--success-soft); border-color: transparent; color: var(--success); }
.flash-error { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.flash-info { background: var(--info-soft); border-color: transparent; color: var(--info); }
.flash-x { margin-left: auto; background: none; border: 0; color: inherit; opacity: .65; cursor: pointer; display: grid; place-items: center; }
.flash-x:hover { opacity: 1; }

.notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 13px;
}
.notice strong { display: block; font-size: 13.5px; }
.notice p { color: var(--text-soft); font-size: 12.5px; margin-top: 2px; }
.notice .btn { margin-left: auto; }
.notice-warn { background: var(--warning-soft); border-color: transparent; color: var(--warning); }
.notice-warn p { color: inherit; opacity: .85; }
.notice-info { background: var(--info-soft); border-color: transparent; color: var(--info); }

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    margin: 0 20px 16px;
}
.alert .icon { flex: none; margin-top: 1px; }
.alert-danger { background: var(--danger-soft); color: var(--danger); }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-info { background: var(--info-soft); color: var(--info); }

/* --------------------------------------------------------------------------
   Tabel
   -------------------------------------------------------------------------- */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 540px; }
.table th {
    text-align: left;
    padding: 10px 16px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    font-weight: 700;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table td { padding: 11px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.th-actions, .td-actions { text-align: right; width: 1%; white-space: nowrap; }
.row-actions { display: flex; gap: 3px; justify-content: flex-end; align-items: center; }
.table .cell-main { font-weight: 600; }
.table .cell-sub { font-size: 11.5px; color: var(--muted); }
.table-narrow { min-width: 0; }
.table-center td, .table-center th { text-align: center; }

.file-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 7px;
    background: var(--primary-soft);
    color: var(--primary-strong);
    font-size: 11.5px;
    font-weight: 600;
}

/* Matriks absensi */
.matrix { border-collapse: separate; border-spacing: 0; font-size: 12px; min-width: 720px; width: 100%; }
.matrix th, .matrix td { padding: 6px 7px; text-align: center; border-bottom: 1px solid var(--border); }
.matrix th { background: var(--surface-2); font-weight: 650; color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; }
.matrix .sticky-col { position: sticky; left: 0; background: var(--surface); text-align: left; z-index: 2; min-width: 168px; }
.matrix th.sticky-col { background: var(--surface-2); z-index: 3; }
.matrix tr:hover td { background: var(--surface-2); }
.matrix tr:hover td.sticky-col { background: var(--surface-2); }
.sym { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; font-weight: 700; font-size: 10.5px; }
.sym-H { background: var(--success-soft); color: var(--success); }
.sym-S { background: var(--warning-soft); color: var(--warning); }
.sym-I { background: var(--info-soft); color: var(--info); }
.sym-A { background: var(--danger-soft); color: var(--danger); }
.sym-L { background: var(--surface-3); color: var(--muted); }
.sym-T { background: transparent; color: var(--muted); border: 1px dashed var(--border); }

/* --------------------------------------------------------------------------
   Form
   -------------------------------------------------------------------------- */

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.span-2 { grid-column: span 2; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 12.5px; font-weight: 650; color: var(--text-soft); }
.req { color: var(--danger); }

.input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.55; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.file-input { padding: 8px; font-size: 12.5px; }
.field-help { font-size: 11.5px; color: var(--muted); }
.field-error { font-size: 11.5px; color: var(--danger); font-weight: 600; }
.has-error .input { border-color: var(--danger); }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span { width: 38px; height: 22px; border-radius: 999px; background: var(--surface-3); position: relative; transition: background .15s; flex: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch em { font-style: normal; color: var(--text-soft); }

.check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-soft); }
.file-current {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 9px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-soft);
    flex-wrap: wrap;
}
.file-current a { font-weight: 600; }
.filterbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.search-input {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 11px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
    color: var(--muted);
    min-width: 220px;
    flex: 1;
    max-width: 360px;
}
.search-input input { border: 0; background: none; padding: 9px 0; width: 100%; font-size: 13.5px; color: var(--text); outline: none; }
.search-input .icon { width: 16px; height: 16px; }
.filterbar .input { width: auto; min-width: 130px; font-size: 13px; padding: 8px 10px; }
.filterbar select.input { padding-right: 30px; }

.segmented {
    display: inline-flex;
    padding: 4px;
    gap: 4px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    flex-wrap: wrap;
}
.segmented a, .segmented button {
    padding: 7px 13px;
    border-radius: 9px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-soft);
    border: 0;
    background: none;
    cursor: pointer;
}
.segmented a.is-active, .segmented button.is-active {
    background: var(--surface);
    color: var(--primary-strong);
    box-shadow: var(--shadow-sm);
}

/* --------------------------------------------------------------------------
   Empty state, pager, misc
   -------------------------------------------------------------------------- */

.empty { padding: 46px 24px; text-align: center; color: var(--muted); }
.empty .icon { width: 34px; height: 34px; margin: 0 auto 10px; opacity: .6; }
.empty h3 { font-size: 14px; color: var(--text); margin-bottom: 4px; }
.empty p { font-size: 12.5px; }

.pager { display: flex; gap: 5px; align-items: center; justify-content: center; padding: 14px; flex-wrap: wrap; }
.pager-btn {
    min-width: 34px;
    padding: 6px 11px;
    border-radius: 9px;
    border: 1px solid var(--border);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-soft);
    text-align: center;
}
.pager-btn:hover { background: var(--surface-2); }
.pager-btn.is-active { background: linear-gradient(135deg, #0284c7, #075985); border-color: transparent; color: #fff; }
.pager-btn.is-disabled { opacity: .45; pointer-events: none; }

.kv { display: grid; grid-template-columns: 132px 1fr; gap: 8px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); font-size: 12.5px; }
.kv dd { margin: 0; font-weight: 500; }
@media (max-width: 560px) { .kv { grid-template-columns: 1fr; gap: 2px; } .kv dd { margin-bottom: 8px; } }

.bars { display: flex; align-items: flex-end; gap: 7px; height: 128px; padding-top: 8px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar {
    width: 100%;
    max-width: 34px;
    border-radius: 7px 7px 3px 3px;
    background: linear-gradient(180deg, #7dd3fc, #075985);
    min-height: 4px;
    transition: height .35s ease;
}
.bar-label { font-size: 10.5px; color: var(--muted); }

.progress { height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #38bdf8, #075985); }

.hero-card {
    position: relative;
    padding: 22px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #082f49 0%, #075985 46%, #0369a1 78%, #0ea5e9 100%);
    color: #f0f9ff;
    overflow: hidden;
    box-shadow: 0 24px 48px -28px rgba(2, 132, 199, .85);
}
.hero-card::after {
    content: "";
    position: absolute;
    width: 220px; height: 220px;
    right: -70px; top: -80px;
    background: radial-gradient(circle, rgba(255,255,255,.22), transparent 65%);
    border-radius: 50%;
}
.hero-card h2 { font-size: 20px; font-weight: 750; letter-spacing: -.02em; }
.hero-card p { color: rgba(240, 249, 255, .86); font-size: 13.5px; margin-top: 4px; }
.hero-card .btn { background: rgba(255,255,255,.16); color: #fff; backdrop-filter: blur(4px); }
.hero-card .btn:hover { background: rgba(255,255,255,.26); }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: var(--surface-2); }
.list-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-soft); flex: none; }
.list-main { min-width: 0; flex: 1; }
.list-main strong { display: block; font-size: 13.5px; font-weight: 600; }
.list-main small { font-size: 11.5px; color: var(--muted); display: block; }
.list-meta { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

/* Chat */
.chat-shell { display: flex; flex-direction: column; height: min(72vh, 640px); }
.chat-box { flex: 1; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.bubble { max-width: 78%; padding: 10px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.bubble small { display: block; font-size: 10.5px; opacity: .7; margin-top: 4px; }
.bubble-me { align-self: flex-end; background: var(--primary); color: var(--on-primary); border-bottom-right-radius: 5px; }
[data-theme="dark"] .bubble-me { color: #042220; }
.bubble-them { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.chat-form { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border); background: var(--surface); }
.chat-form .input { min-height: 44px; max-height: 110px; }
.chat-empty { margin: auto; color: var(--muted); font-size: 12.5px; text-align: center; }

/* Timeline */
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item { position: relative; padding: 0 0 18px 24px; border-left: 2px solid var(--border); margin-left: 6px; }
.tl-item:last-child { padding-bottom: 0; border-left-color: transparent; }
.tl-dot { position: absolute; left: -7px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); border: 2px solid var(--surface); }
.tl-item h4 { font-size: 13.5px; font-weight: 650; }
.tl-item p { font-size: 12.5px; color: var(--text-soft); margin-top: 2px; }
.tl-item time { font-size: 11px; color: var(--muted); }

/* Jadwal */
.schedule { display: grid; gap: 10px; }
.sched-row { display: grid; grid-template-columns: 92px 1fr; gap: 12px; align-items: stretch; }
.sched-day { font-size: 12px; font-weight: 700; color: var(--muted); padding-top: 10px; text-transform: uppercase; letter-spacing: .05em; }
.sched-items { display: flex; flex-direction: column; gap: 6px; }
.sched-item { display: flex; align-items: center; gap: 12px; padding: 10px 13px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); }
.sched-time { font-size: 11.5px; font-weight: 700; color: var(--primary-strong); white-space: nowrap; }
.sched-body { min-width: 0; flex: 1; }
.sched-body strong { display: block; font-size: 13.5px; }
.sched-body small { font-size: 11.5px; color: var(--muted); }
.sched-empty { font-size: 12.5px; color: var(--muted); padding: 8px 0; }

/* --------------------------------------------------------------------------
   Navigasi bawah (mobile)
   -------------------------------------------------------------------------- */

.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 45;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    padding: 7px 6px calc(7px + env(safe-area-inset-bottom));
}
.bottom-link {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 5px 2px;
    border-radius: 10px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
}
.bottom-link .icon { width: 20px; height: 20px; }
.bottom-link.is-active { color: var(--primary-strong); background: var(--primary-soft); }

/* --------------------------------------------------------------------------
   Halaman publik (beranda & login)
   -------------------------------------------------------------------------- */

.site { min-height: 100vh; display: flex; flex-direction: column; background: transparent; }
.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.site-head-inner {
    max-width: 1160px;
    margin: 0 auto;
    padding: 12px clamp(16px, 3vw, 28px);
    display: flex;
    align-items: center;
    gap: 18px;
}
.site-nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.site-nav a { padding: 8px 12px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--text-soft); }
.site-nav a:hover { background: var(--surface); color: var(--text); }

.site-main { flex: 1; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 28px); }

.hero { padding: clamp(26px, 5vw, 58px) 0 clamp(30px, 5vw, 54px); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(24px, 4vw, 54px); align-items: center; }
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-strong);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .02em;
}
.hero h1 {
    font-size: clamp(30px, 4.4vw, 46px);
    line-height: 1.08;
    letter-spacing: -.035em;
    font-weight: 800;
    margin: 16px 0 14px;
}
.hero h1 em {
    font-style: normal;
    background: linear-gradient(90deg, #075985, #0284c7 52%, #0ea5e9);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
[data-theme="dark"] .hero h1 em {
    background: linear-gradient(90deg, #38bdf8, #7dd3fc 55%, #bae6fd);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero-lead { font-size: clamp(14.5px, 1.4vw, 16.5px); color: var(--text-soft); max-width: 46ch; line-height: 1.65; }
.hero-cta { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 26px; margin-top: 30px; flex-wrap: wrap; }
.hero-stat strong { display: block; font-size: 22px; font-weight: 780; letter-spacing: -.02em; color: var(--primary-strong); }
.hero-stat span { font-size: 12px; color: var(--muted); }

.hero-visual { position: relative; }
.visual-card {
    position: relative;
    border-radius: 22px;
    padding: 22px;
    background: linear-gradient(150deg, #082f49, #075985 42%, #0369a1 78%, #38bdf8);
    color: #f0f9ff;
    box-shadow: 0 30px 60px -32px rgba(2, 132, 199, .85);
    overflow: hidden;
}
.visual-card::before {
    content: "";
    position: absolute;
    inset: -40% 40% 40% -30%;
    background: radial-gradient(circle, rgba(255,255,255,.25), transparent 62%);
}
.visual-card h3 { font-size: 15px; font-weight: 700; }
.visual-card p { font-size: 12.5px; opacity: .82; margin-top: 2px; }
.visual-top { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; position: relative; }
.visual-avatar { width: 36px; height: 36px; border-radius: 11px; background: rgba(255,255,255,.2); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.visual-list { display: flex; flex-direction: column; gap: 8px; position: relative; }
.visual-row { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 12px; background: rgba(255,255,255,.13); font-size: 12.5px; }
.visual-row strong { font-weight: 650; }
.visual-row .dot { width: 8px; height: 8px; border-radius: 50%; background: #fcd34d; margin-left: auto; box-shadow: 0 0 0 4px rgba(252, 211, 77, .22); }
.visual-badge { position: absolute; right: -14px; bottom: -16px; background: var(--surface); color: var(--text); border-radius: 14px; padding: 12px 15px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 650; border: 1px solid var(--border); }
.visual-badge .icon { color: var(--primary-strong); }

.section { padding: clamp(24px, 4vw, 44px) 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(20px, 2.4vw, 26px); letter-spacing: -.025em; font-weight: 780; }
.section-head p { color: var(--muted); font-size: 13.5px; margin-top: 4px; max-width: 56ch; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.feature {
    padding: 20px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: transform .18s, box-shadow .18s;
}
.feature:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.feature-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-strong); margin-bottom: 13px; }
.feature h3 { font-size: 14.5px; font-weight: 700; margin-bottom: 5px; }
.feature p { font-size: 12.5px; color: var(--text-soft); line-height: 1.6; }

.news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.news-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.news-cover { aspect-ratio: 16 / 9; background: var(--surface-3); overflow: hidden; }
.news-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.news-card:hover .news-cover img { transform: scale(1.03); }
.news-body { padding: 15px 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.news-body time { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.news-body h3 { font-size: 14.5px; font-weight: 700; line-height: 1.35; }
.news-body p { font-size: 12.5px; color: var(--text-soft); }

.news-detail { overflow: hidden; }
.news-hero { margin: 0; background: var(--surface-3); }
.news-hero img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 auto;
}
.news-detail-body { padding: clamp(20px, 4vw, 34px); }
.news-detail-title {
    font-size: clamp(22px, 3vw, 30px);
    letter-spacing: -.02em;
    margin: 8px 0 14px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}
.news-detail-text {
    color: var(--text-soft);
    font-size: 14.5px;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

.site-footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: 30px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 24px; padding: 34px 0; }
.foot-grid h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 10px; }
.foot-grid a, .foot-grid p { font-size: 13px; color: var(--text-soft); display: block; margin-bottom: 6px; }
.foot-bottom { border-top: 1px solid var(--border); padding: 14px 0; font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Login */
.auth-body { margin: 0; min-height: 100vh; }
.auth { display: grid; grid-template-columns: 1.05fr .95fr; min-height: 100vh; }
.auth-aside {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(26px, 4vw, 48px);
    background: linear-gradient(155deg, #021526, #072d47 35%, #075985 68%, #0284c7);
    color: #eff8ff;
    overflow: hidden;
}
.auth-aside::before,
.auth-aside::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.16), transparent 68%);
}
.auth-aside::before { width: 420px; height: 420px; right: -140px; top: -160px; }
.auth-aside::after { width: 320px; height: 320px; left: -120px; bottom: -120px; }
.auth-copy { position: relative; max-width: 460px; margin: auto 0; }
.auth-copy h1 { font-size: clamp(26px, 3.2vw, 38px); line-height: 1.13; letter-spacing: -.03em; font-weight: 800; }
.auth-copy p { color: rgba(239, 248, 255, .84); margin-top: 12px; font-size: 14px; line-height: 1.65; }
.auth-points { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-direction: column; gap: 10px; }
.auth-points li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: rgba(239,248,255,.94); }
.auth-points .icon { width: 17px; height: 17px; color: #bae6fd; }
.auth-aside .brand { padding: 0; position: relative; }
.auth-aside .brand-text strong, .auth-aside .brand-text small { color: #fff; }
.auth-aside .brand-text small { color: rgba(239,248,255,.74); }
.auth-foot { position: relative; font-size: 12px; color: rgba(239,248,255,.66); }

.auth-main { display: flex; align-items: center; justify-content: center; padding: clamp(22px, 4vw, 44px); }
.auth-card { width: 100%; max-width: 400px; }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; color: inherit; }
.auth-brand img { width: 36px; height: 36px; object-fit: contain; }
.auth-brand strong { display: block; font-size: 14px; }
.auth-brand span span { font-size: 11.5px; color: var(--muted); }
.auth-brand > span { display: flex; flex-direction: column; line-height: 1.25; }
.auth-card h2 { font-size: 24px; letter-spacing: -.025em; font-weight: 780; }
.auth-card > p { color: var(--muted); font-size: 13.5px; margin-top: 4px; margin-bottom: 22px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-top: 18px; font-size: 12.5px; flex-wrap: wrap; }
.auth-hint { margin-top: 22px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; color: var(--muted); line-height: 1.6; }
.login-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-strong); font-size: 11.5px; font-weight: 700; margin-bottom: 14px; }

.field-inline { position: relative; }
.field-inline .toggle-pass { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }

/* Utilitas responsif */
.only-mobile { display: none !important; }

@media (max-width: 1180px) {
    .site-nav .nav-text { display: none; }
}

@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        height: 100%;
        transform: translateX(-102%);
        transition: transform .22s ease;
        box-shadow: 0 20px 50px rgba(8, 15, 28, .3);
    }
    .app.sidebar-open .sidebar { transform: none; }
    .only-mobile { display: inline-grid !important; }
    .only-desktop { display: none !important; }
    .bottom-nav { display: flex; }
    .content { padding-bottom: 92px; }
    .foot { margin-bottom: 64px; }
    .grid-2, .grid-2.even { grid-template-columns: 1fr; }
    .hero-grid { grid-template-columns: 1fr; }
    .hero-visual { max-width: 520px; }
    .hero-visual { order: 0; }
    .toast-wrap { bottom: 78px; }
    .auth { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .auth-main { min-height: 100vh; padding-top: 40px; padding-bottom: 40px; }
    .auth-card { max-width: 420px; }
}

@media (max-width: 720px) {
    .site-nav a:not(.btn) { display: none; }
    .site-nav { margin-left: auto; }
    .site-head-inner { padding-top: 10px; padding-bottom: 10px; }
    .hero-stats { gap: 18px; }
    .visual-badge { right: 8px; bottom: -12px; }
    .form-grid { grid-template-columns: 1fr; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .bottom-link span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .span-2 { grid-column: auto; }
    .card-head { flex-direction: column; align-items: flex-start; gap: 10px; }
    .card-head > div:first-child { width: 100%; }
    .card-head > .btn { align-self: flex-start; }
    .card-actions { justify-content: flex-start; }
    .topbar { min-height: 60px; }
    .topbar-title h1 { font-size: 15.5px; }
    .topbar-actions-slot .btn span.label { display: none; }
    .stat { padding: 13px; gap: 10px; }
    .stat-value { font-size: 20px; }
    .stat-icon { width: 36px; height: 36px; border-radius: 10px; }
    .foot-grid { grid-template-columns: 1fr; gap: 18px; }
    .sched-row { grid-template-columns: 1fr; gap: 6px; }
    .sched-day { padding-top: 4px; }
    .card-body { padding: 16px; }
    .filterbar { padding: 12px 16px; }
    .search-input { max-width: none; }
    .notif-pop {
        position: fixed;
        left: 12px;
        right: 12px;
        top: 68px;
        width: auto;
        max-height: calc(100vh - 88px);
    }
    .notif-list { max-height: calc(100vh - 270px); }
    .notif-item-lg { padding: 14px 16px; }
    .news-detail {
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        margin-left: calc(-1 * clamp(16px, 3vw, 28px));
        margin-right: calc(-1 * clamp(16px, 3vw, 28px));
    }
    .news-detail-body { padding: 20px 16px 26px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Cetak */
@media print {
    .sidebar, .topbar, .bottom-nav, .foot, .scrim, .filterbar, .row-actions, .th-actions, .td-actions { display: none !important; }
    body { background: #fff; color: #000; }
    .content { padding: 0; max-width: none; }
    .card { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; }
    .table th { background: #f2f2f2 !important; }
    .print-only { display: block !important; }
    .print-head { display: flex !important; align-items: center; gap: 14px; margin-bottom: 14px; }
}
.print-only, .print-head { display: none; }

/* ==========================================================================
   Absensi wajah
   ========================================================================== */

[data-face-app] [hidden],
.face-panel[hidden],
.face-result[hidden] {
    display: none !important;
}

.face-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
    gap: 16px;
    align-items: start;
}

.face-camera-card .card-body { padding-top: 14px; }

.face-stage {
    position: relative;
    aspect-ratio: 4 / 3;
    min-height: 250px;
    max-height: 460px;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid rgba(148, 197, 235, .22);
    background:
        radial-gradient(circle at 50% 34%, rgba(56, 189, 248, .18), transparent 56%),
        #04121f;
    isolation: isolate;
}

.face-stage video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
    opacity: 0;
    transition: opacity .2s ease;
}

.face-stage[data-live="1"] video { opacity: 1; }

.face-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 24px;
    text-align: center;
    color: #b9d7ef;
}

.face-placeholder .icon {
    width: 42px;
    height: 42px;
    opacity: .82;
    margin-bottom: 2px;
}

.face-placeholder strong {
    color: #eaf6ff;
    font-size: 14.5px;
    font-weight: 700;
}

.face-placeholder span {
    max-width: 280px;
    color: #9fbdd6;
    font-size: 12.5px;
    line-height: 1.5;
}

.face-guide {
    position: absolute;
    left: 50%;
    top: 47%;
    width: min(46%, 228px);
    aspect-ratio: 3 / 4;
    transform: translate(-50%, -50%);
    border: 2px dashed rgba(186, 230, 253, .48);
    border-radius: 48% 48% 44% 44% / 56% 56% 40% 40%;
    box-shadow: 0 0 0 9999px rgba(2, 10, 18, .18);
    pointer-events: none;
    transition: border-color .2s ease, box-shadow .2s ease, opacity .2s ease;
}

.face-guide span {
    position: absolute;
    inset: 8%;
    border: 1px solid rgba(56, 189, 248, .18);
    border-radius: inherit;
}

.face-stage[data-live="0"] .face-guide { opacity: .42; }

.face-stage[data-detected="1"] .face-guide {
    border-color: rgba(52, 211, 153, .92);
    box-shadow: 0 0 0 9999px rgba(2, 10, 18, .11), 0 0 30px rgba(52, 211, 153, .28);
}

.face-scanline {
    position: absolute;
    left: 8%;
    right: 8%;
    top: 20%;
    height: 2px;
    opacity: 0;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(56, 189, 248, .92), transparent);
}

.face-stage[data-live="1"] .face-scanline {
    opacity: .8;
    animation: face-scan 3s linear infinite;
}

@keyframes face-scan {
    0% { top: 18%; }
    50% { top: 78%; }
    100% { top: 18%; }
}

.face-stage-foot {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: #b8d7ef;
    font-size: 11.5px;
    pointer-events: none;
}

.face-stage-foot span {
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(2, 10, 18, .56);
    backdrop-filter: blur(4px);
}

.face-status {
    margin-top: 13px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-2);
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.5;
    transition: background .15s ease, color .15s ease;
}

.face-status[data-tone="success"] {
    border-color: transparent;
    background: var(--success-soft);
    color: var(--success);
}

.face-status[data-tone="warning"] {
    border-color: transparent;
    background: var(--warning-soft);
    color: var(--warning);
}

.face-status[data-tone="error"] {
    border-color: transparent;
    background: var(--danger-soft);
    color: var(--danger);
}

.face-status[data-tone="loading"] {
    border-color: transparent;
    background: var(--primary-soft);
    color: var(--primary-strong);
}

.face-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.face-time-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.face-time-grid > div {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-2);
}

.face-time-grid span {
    display: block;
    margin-bottom: 1px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.face-time-grid strong {
    font-size: 19px;
    font-weight: 760;
    letter-spacing: -.02em;
}

.face-panel { margin-top: 4px; }

.face-modes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.face-mode {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 78px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease, transform .15s ease;
}

.face-mode:hover:not(:disabled) {
    border-color: var(--primary);
    box-shadow: 0 8px 22px -16px var(--primary);
    transform: translateY(-1px);
}

.face-mode.is-active {
    border-color: var(--primary);
    background: linear-gradient(135deg, var(--primary-soft), var(--surface));
    box-shadow: 0 0 0 3px var(--ring);
}

.face-mode.is-done {
    border-color: transparent;
    background: var(--success-soft);
}

.face-mode:disabled {
    opacity: .62;
    cursor: not-allowed;
}

.face-mode-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: var(--primary-soft);
    color: var(--primary-strong);
}

.face-mode-icon .icon { width: 19px; height: 19px; }

.face-mode-text { min-width: 0; flex: 1; }

.face-mode-text strong {
    display: block;
    font-size: 13.5px;
    font-weight: 700;
}

.face-mode-text small {
    display: block;
    margin-top: 1px;
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.35;
}

.face-mode-check {
    display: inline-flex;
    flex: none;
    color: var(--success);
}

.face-mode-check .icon { width: 19px; height: 19px; }

.face-enroll-copy {
    margin-bottom: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-2);
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--text-soft);
}

.face-enroll-copy p { margin-bottom: 3px; color: var(--text); }
.face-enroll-copy ol { margin: 0; padding-left: 18px; }
.face-enroll-copy li + li { margin-top: 2px; }

.face-dots {
    display: flex;
    gap: 7px;
    margin: 14px 0 7px;
}

.face-dot {
    width: 34px;
    height: 7px;
    border-radius: 999px;
    background: var(--surface-3);
    transition: background .18s ease, width .18s ease;
}

.face-dot.is-filled {
    width: 44px;
    background: linear-gradient(90deg, var(--primary), var(--primary-strong));
}

.face-progress-note {
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 12px;
}

.face-result {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 14px;
    padding: 12px;
    border-radius: 14px;
    background: var(--success-soft);
    color: var(--success);
}

.face-result[data-tone="info"] {
    background: var(--info-soft);
    color: var(--info);
}

.face-result[data-tone="error"] {
    background: var(--danger-soft);
    color: var(--danger);
}

.face-result-icon {
    display: inline-flex;
    flex: none;
    margin-top: 1px;
}

.face-result-icon .icon { width: 21px; height: 21px; }

.face-result-copy { min-width: 0; flex: 1; }

.face-result-copy strong {
    display: block;
    color: inherit;
    font-size: 13px;
    font-weight: 700;
}

.face-result-copy p {
    margin-top: 2px;
    color: inherit;
    font-size: 12px;
    line-height: 1.5;
    opacity: .9;
}

.face-result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
    margin-left: auto;
}

.face-data-body > p {
    color: var(--text-soft);
    font-size: 12.5px;
    line-height: 1.6;
}

.face-data-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 10px 0 2px;
}

.face-privacy {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.55;
}

.face-privacy .icon {
    flex: none;
    width: 16px;
    height: 16px;
    margin-top: 2px;
    color: var(--primary-strong);
}

.face-history-time {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
}

@media (max-width: 1024px) {
    .face-layout { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .face-modes { grid-template-columns: 1fr; }
    .face-stage { min-height: 235px; }
    .face-result { flex-wrap: wrap; }
    .face-result-actions { width: 100%; margin-left: 0; justify-content: flex-start; }
    .face-mode { min-height: 70px; }
    .face-time-grid strong { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
    .face-scanline { animation: none !important; }
    .face-mode, .face-guide, .face-status, .face-dot { transition: none !important; }
}

/* ------------------------------------------------------------------
 |  Koreksi soal
 * ------------------------------------------------------------------ */

.koreksi-filter {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
    align-items: end;
    gap: 12px;
}

.koreksi-filter .field { gap: 4px; }
.koreksi-filter .field > label { font-size: 11.5px; }
.koreksi-filter .btn { width: 100%; min-height: 38px; }
.koreksi-filter .input { width: 100%; min-width: 0; }

.koreksi-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 20px;
    padding: 12px 14px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-2);
    color: var(--text-soft);
    font-size: 12.5px;
}

.koreksi-summary strong { color: var(--text); }

.koreksi-foot { flex-wrap: wrap; align-items: center; }
.koreksi-foot .field-help { flex: 1 1 240px; }

.koreksi-score {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 22px;
    padding: 16px 18px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary-soft), var(--surface));
}

.score-main { min-width: 120px; }
.score-main span {
    display: block;
    font-size: 34px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.04em;
    color: var(--primary-strong);
}
.score-main small { display: block; margin-top: 5px; color: var(--muted); font-size: 11.5px; }

.score-meta { display: flex; flex-wrap: wrap; gap: 18px; }
.score-meta strong { display: block; font-size: 16px; color: var(--text); }
.score-meta small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }

.koreksi-sections { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.koreksi-section .split { margin-bottom: 5px; font-size: 12.5px; }
.koreksi-section .split strong { font-size: 12.5px; }
.koreksi-section .split span { color: var(--muted); font-size: 11.5px; }

.q-section { margin-top: 18px; }
.q-section:first-child { margin-top: 0; }
.q-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}
.q-section-head strong { font-size: 13px; }

.q-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 7px;
}

.q-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 9px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
    color: var(--text-soft);
    cursor: pointer;
    font-size: 12px;
    user-select: none;
    transition: border-color .15s, background .15s, color .15s;
}
.q-item:hover { border-color: var(--primary); }
.q-item input { width: 15px; height: 15px; flex: none; accent-color: var(--primary); }
.q-no { min-width: 18px; font-weight: 700; color: var(--text); }
.q-meta { overflow: hidden; color: var(--muted); font-size: 10.5px; white-space: nowrap; text-overflow: ellipsis; }
.q-item.is-wrong { border-color: var(--danger); background: var(--danger-soft); }
.q-item.is-wrong .q-no, .q-item.is-wrong .q-meta { color: var(--danger); }

.koreksi-result .kv { margin-top: 4px; }

@media (max-width: 720px) {
    .koreksi-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .q-grid { grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); }
    .score-main span { font-size: 28px; }
}

@media (max-width: 480px) {
    .koreksi-filter { grid-template-columns: 1fr; }
}
