/* PAI Teacher Hub — sistem tampilan. Tidak bergantung pada CDN: aplikasi tetap rapi tanpa internet. */
:root {
    --ink: #12302a;
    --ink-2: #1a3f37;
    --ink-3: #25524a;
    --paper: #f2f5f3;
    --surface: #ffffff;
    --surface-2: #f7f9f8;
    --line: #dde5e1;
    --line-strong: #c5d1cb;
    --text: #15231e;
    --muted: #5a6a64;
    --primary: #1d6b57;
    --primary-strong: #145244;
    --primary-soft: #e2efe9;
    --brass: #d39a2b;
    --brass-soft: #fbf1dc;
    --fase-a: #2b78ad;
    --fase-a-soft: #e3eff7;
    --fase-b: #378a59;
    --fase-b-soft: #e3f2e8;
    --fase-c: #bd6722;
    --fase-c-soft: #fbece0;
    --danger: #b23b2b;
    --danger-soft: #fbe8e5;
    --ok: #237a4b;
    --ok-soft: #e1f3e8;
    --warn: #8a5a00;
    --warn-soft: #fdf3d9;
    --r-lg: 16px;
    --r-md: 10px;
    --r-sm: 7px;
    --shadow: 0 1px 2px rgba(18, 48, 42, .06), 0 4px 14px rgba(18, 48, 42, .05);
    --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --arab: "Amiri", "Noto Naskh Arabic", "Traditional Arabic", serif;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --paper: #0f1a17; --surface: #16231f; --surface-2: #1b2a25; --line: #26372f; --line-strong: #33483f;
        --text: #e5ece9; --muted: #9db0a8; --primary: #4fb394; --primary-strong: #6cc7aa; --primary-soft: #183a30;
        --brass-soft: #3a2f17; --fase-a: #6aaee0; --fase-a-soft: #17303f; --fase-b: #6cc08e; --fase-b-soft: #183323;
        --fase-c: #e79a5c; --fase-c-soft: #3a2616; --danger: #ef8a7c; --danger-soft: #3d1e1a; --ok: #6cc08e; --ok-soft: #183323;
        --warn: #e9c46a; --warn-soft: #3a3016; --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --paper: #0f1a17; --surface: #16231f; --surface-2: #1b2a25; --line: #26372f; --line-strong: #33483f;
    --text: #e5ece9; --muted: #9db0a8; --primary: #4fb394; --primary-strong: #6cc7aa; --primary-soft: #183a30;
    --brass-soft: #3a2f17; --fase-a: #6aaee0; --fase-a-soft: #17303f; --fase-b: #6cc08e; --fase-b-soft: #183323;
    --fase-c: #e79a5c; --fase-c-soft: #3a2616; --danger: #ef8a7c; --danger-soft: #3d1e1a; --ok: #6cc08e; --ok-soft: #183323;
    --warn: #e9c46a; --warn-soft: #3a3016; --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; background: var(--paper); color: var(--text); font-family: var(--font);
    font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
p { margin: 0; }
:focus-visible { outline: 2.5px solid var(--brass); outline-offset: 2px; border-radius: 4px; }
.ic { width: 18px; height: 18px; flex: none; }
.ic-lg { width: 22px; height: 22px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.arab { font-family: var(--arab); direction: rtl; }
.print-only { display: none; }

/* ---------- Kerangka ---------- */
.shell { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(to right, var(--ink) 268px, transparent 268px); }
.sidebar {
    background: var(--ink); color: #d6e3de; position: sticky; top: 0; height: 100vh; overflow-y: auto;
    display: flex; flex-direction: column; scrollbar-width: thin; scrollbar-color: var(--ink-3) transparent;
}
.brand {
    display: flex; gap: 12px; align-items: center; padding: 22px 20px 20px; color: #fff; position: relative;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.07' stroke-width='1'%3E%3Crect x='14' y='14' width='20' height='20'/%3E%3Crect x='14' y='14' width='20' height='20' transform='rotate(45 24 24)'/%3E%3Cpath d='M0 24h10M38 24h10M24 0v10M24 38v10'/%3E%3C/g%3E%3C/svg%3E");
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.brand:hover { text-decoration: none; }
.brand-mark { width: 40px; height: 40px; flex: none; }
.brand-name { font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.brand-sub { font-size: 12px; color: #9fb8af; margin-top: 1px; }
.nav { padding: 14px 12px 24px; display: grid; gap: 16px; }
.nav-group-title { font-size: 12px; font-weight: 600; color: #7f9b91; padding: 0 10px 6px; }
.nav a {
    display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; color: #cddbd5;
    font-size: 14px; font-weight: 500; position: relative;
}
.nav a:hover { background: var(--ink-2); color: #fff; text-decoration: none; }
.nav a[aria-current="page"] { background: var(--ink-3); color: #fff; font-weight: 600; }
.nav a[aria-current="page"]::before {
    content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brass);
}
.nav a .ic { color: #8fb0a5; }
.nav a[aria-current="page"] .ic { color: var(--brass); }
.sidebar-foot { margin-top: auto; padding: 14px 20px 20px; font-size: 12px; color: #86a197; border-top: 1px solid rgba(255, 255, 255, .07); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
    display: flex; align-items: center; gap: 14px; padding: 14px 32px; background: color-mix(in srgb, var(--paper) 88%, transparent);
    backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line);
}
.topbar-title { font-size: 15px; font-weight: 700; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-meta { font-size: 13px; color: var(--muted); text-align: right; line-height: 1.35; }
.topbar-meta strong { color: var(--text); font-weight: 600; display: block; }
.topbar .menu-btn { display: none; }
.content { padding: 28px 32px 56px; width: 100%; max-width: 1240px; }
.scrim { display: none; }

/* ---------- Kepala halaman ---------- */
.page-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; }
.page-head h1 { font-size: 26px; font-weight: 800; }
.page-head p { color: var(--muted); margin-top: 6px; max-width: 68ch; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- Tombol ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-size: 14px; font-weight: 600;
    padding: 9px 15px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
    cursor: pointer; line-height: 1.2; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); }
:root[data-theme="dark"] .btn-primary, :root[data-theme="dark"] .btn-primary:hover { color: #0f1a17; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: #0f1a17; } }
.btn-quiet { border-color: transparent; background: transparent; color: var(--muted); }
.btn-quiet:hover { background: var(--primary-soft); color: var(--text); }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: var(--surface); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: var(--r-sm); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--danger); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* ---------- Panel ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.panel-pad { padding: 22px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.panel-head h2, .panel-head h3 { font-size: 16px; font-weight: 700; }
.panel-body { padding: 18px 22px; }
.stack { display: grid; gap: 20px; }
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }

/* ---------- Formulir ---------- */
.field { display: grid; gap: 6px; }
.field > label, .label { font-size: 13.5px; font-weight: 600; }
.req { color: var(--danger); }
.hint { font-size: 12.5px; color: var(--muted); }
.input, .select, .textarea {
    width: 100%; font: inherit; font-size: 14.5px; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong);
    border-radius: var(--r-md); padding: 9px 12px; line-height: 1.4;
}
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.is-invalid { border-color: var(--danger) !important; }
.err { font-size: 12.5px; color: var(--danger); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-section { padding: 22px; border-top: 1px solid var(--line); }
.form-section:first-of-type { border-top: 0; }
.form-section-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; display: flex; gap: 10px; align-items: center; }
.form-section-title .step {
    width: 24px; height: 24px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-strong);
    display: inline-grid; place-items: center; font-size: 12.5px; font-weight: 700;
}
.form-foot { display: flex; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check-pill { position: relative; }
.check-pill input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.check-pill span {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-strong);
    font-size: 13px; background: var(--surface); cursor: pointer;
}
.check-pill input:checked + span { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-strong); font-weight: 600; }
.check-pill input:focus-visible + span { outline: 2.5px solid var(--brass); outline-offset: 2px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 22px; border-bottom: 1px solid var(--line); align-items: center; }
.filters .select, .filters .input { width: auto; min-width: 180px; font-size: 14px; padding: 8px 11px; }
.search { position: relative; flex: 1; min-width: 200px; max-width: 340px; }
.search .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .input { padding-left: 36px; width: 100%; }

/* ---------- Tabel ---------- */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
    text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 10px 14px; background: var(--surface-2);
    border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tbody tr:hover td { background: color-mix(in srgb, var(--primary-soft) 45%, transparent); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: center; font-variant-numeric: tabular-nums; width: 1%; white-space: nowrap; }
.tbl .name { font-weight: 600; }
.tbl .row-actions { white-space: nowrap; text-align: right; width: 1%; }
.row-actions a, .row-actions button { font-size: 13px; font-weight: 600; margin-left: 12px; }
.row-actions form { display: inline; }
.tbl-detail th { width: 240px; background: var(--surface-2); color: var(--text); font-size: 13.5px; white-space: normal; vertical-align: top; }
.tbl-detail td { white-space: pre-line; }
.empty { padding: 44px 22px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--text); font-size: 16px; margin-bottom: 6px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 14px; font-size: 13.5px; border-top: 1px solid var(--line); }

/* ---------- Lencana & fase ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.fase { --c: var(--primary); --s: var(--primary-soft); display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12.5px; padding: 2px 10px 2px 8px; border-radius: 999px; background: var(--s); color: var(--c); white-space: nowrap; }
.fase::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.fase-A { --c: var(--fase-a); --s: var(--fase-a-soft); }
.fase-B { --c: var(--fase-b); --s: var(--fase-b-soft); }
.fase-C { --c: var(--fase-c); --s: var(--fase-c-soft); }

/* ---------- Pemberitahuan ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r-md); font-size: 14px; margin-bottom: 18px; border: 1px solid transparent; }
.alert-ok { background: var(--ok-soft); color: var(--ok); }
.alert-err { background: var(--danger-soft); color: var(--danger); }
.alert-info { background: var(--brass-soft); color: var(--text); border-color: color-mix(in srgb, var(--brass) 30%, transparent); }

/* ---------- Beranda ---------- */
.welcome {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end; padding: 30px 32px;
    background: var(--ink); color: #e6efeb; border-radius: 20px; position: relative; overflow: hidden; margin-bottom: 24px;
}
.welcome::after {
    content: ""; position: absolute; right: -70px; top: -110px; width: 280px; height: 280px; opacity: .6; pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='%23d39a2b' stroke-opacity='.35' stroke-width='.6'%3E%3Crect x='20' y='20' width='60' height='60'/%3E%3Crect x='20' y='20' width='60' height='60' transform='rotate(45 50 50)'/%3E%3Crect x='32' y='32' width='36' height='36'/%3E%3Crect x='32' y='32' width='36' height='36' transform='rotate(45 50 50)'/%3E%3Ccircle cx='50' cy='50' r='9'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}
.welcome .salam { font-family: var(--arab); font-size: 26px; color: var(--brass); line-height: 1.4; }
.welcome h1 { font-size: 30px; font-weight: 800; color: #fff; margin-top: 4px; }
.welcome p { color: #a9c1b8; margin-top: 6px; font-size: 14.5px; }
.dates { text-align: right; position: relative; z-index: 1; }
.dates .masehi { font-size: 15px; font-weight: 600; color: #fff; }
.dates .hijri { font-size: 22px; font-weight: 800; color: var(--brass); letter-spacing: -.01em; }
.dates .note { font-size: 11.5px; color: #86a197; }
.quick { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; position: relative; z-index: 1; }
.quick a {
    display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px; background: rgba(255, 255, 255, .08);
    color: #fff; font-size: 14px; font-weight: 600; border: 1px solid rgba(255, 255, 255, .1);
}
.quick a:hover { background: rgba(255, 255, 255, .15); text-decoration: none; }
.quick a .ic { color: var(--brass); }

.class-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.class-tile {
    --c: var(--primary); display: grid; gap: 10px; padding: 16px 18px 16px 20px; background: var(--surface); border: 1px solid var(--line);
    border-radius: 14px; position: relative; color: var(--text); overflow: hidden; align-content: start;
}
.class-tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c); }
.class-tile:hover { border-color: var(--c); text-decoration: none; }
.class-tile.fase-A { --c: var(--fase-a); } .class-tile.fase-B { --c: var(--fase-b); } .class-tile.fase-C { --c: var(--fase-c); }
.class-tile .top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.class-tile .nm { font-weight: 800; font-size: 17px; }
.class-tile .fs { font-size: 12.5px; font-weight: 700; color: var(--c); }
.class-tile .meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.status-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.status-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.status-dot.on { color: var(--ok); } .status-dot.on::before { background: var(--ok); }
.status-dot.off { color: var(--muted); }

.todo { list-style: none; margin: 0; padding: 0; }
.todo li { display: flex; gap: 12px; align-items: flex-start; padding: 13px 22px; border-bottom: 1px solid var(--line); }
.todo li:last-child { border-bottom: 0; }
.todo .ic { color: var(--brass); margin-top: 2px; }
.todo .t { flex: 1; font-size: 14px; }
.todo a { font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.counts a { padding: 16px 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--text); }
.counts a:nth-child(4n) { border-right: 0; }
.counts a:nth-last-child(-n+4) { border-bottom: 0; }
.counts a:hover { background: var(--surface-2); text-decoration: none; }
.counts .v { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.counts .l { font-size: 13px; color: var(--muted); }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { padding: 12px 22px; border-bottom: 1px solid var(--line); font-size: 14px; }
.feed li:last-child { border-bottom: 0; }
.feed .d { font-size: 12.5px; color: var(--muted); }

/* ---------- Referensi CP ---------- */
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.tabs a { padding: 8px 16px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); display: inline-flex; gap: 8px; align-items: center; }
.tabs a:hover { text-decoration: none; color: var(--text); background: var(--surface-2); }
.tabs a[aria-current="page"] { background: var(--s, var(--primary-soft)); color: var(--c, var(--primary-strong)); }
.tabs a.fase-A { --c: var(--fase-a); --s: var(--fase-a-soft); } .tabs a.fase-B { --c: var(--fase-b); --s: var(--fase-b-soft); } .tabs a.fase-C { --c: var(--fase-c); --s: var(--fase-c-soft); }
.fase-banner { --c: var(--primary); --s: var(--primary-soft); display: flex; gap: 18px; align-items: center; padding: 18px 22px; border-radius: var(--r-lg); background: var(--s); margin: 18px 0 20px; }
.fase-banner.fase-A { --c: var(--fase-a); --s: var(--fase-a-soft); } .fase-banner.fase-B { --c: var(--fase-b); --s: var(--fase-b-soft); } .fase-banner.fase-C { --c: var(--fase-c); --s: var(--fase-c-soft); }
.fase-banner .big { font-size: 46px; font-weight: 800; color: var(--c); line-height: 1; letter-spacing: -.03em; }
.fase-banner .t { font-weight: 700; font-size: 17px; }
.fase-banner .s { color: var(--muted); font-size: 14px; }
.cp-list { display: grid; gap: 12px; }
.cp-item { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 16px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.cp-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-strong); }
.cp-item h3 { font-size: 16px; font-weight: 700; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cp-item .kode { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.cp-item .teks { font-size: 15.5px; margin-top: 6px; max-width: 75ch; line-height: 1.6; }
.cp-item .ringkas { font-size: 13px; color: var(--muted); margin-top: 8px; max-width: 75ch; }
.cp-item .foot { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 12px; font-size: 13px; }
.ref-list { list-style: none; margin: 0; padding: 0; }
.ref-list li { padding: 10px 22px; border-bottom: 1px solid var(--line); font-size: 14px; display: flex; gap: 10px; }
.ref-list li:last-child { border-bottom: 0; }
.ref-list .n { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 16px; }
.ref-list em { font-style: normal; font-weight: 700; display: block; }
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.cell-yes { color: var(--ok); font-weight: 700; }
.cell-no { color: var(--danger); font-weight: 600; }
.diff-old { color: var(--muted); text-decoration: line-through; font-size: 13px; display: block; margin-top: 4px; }

/* ---------- Presensi & nilai ---------- */
.att { display: inline-flex; gap: 4px; }
.att label { position: relative; }
.att input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.att span {
    display: inline-grid; place-items: center; width: 38px; height: 34px; border-radius: 8px; border: 1px solid var(--line-strong);
    font-weight: 700; font-size: 13.5px; color: var(--muted); background: var(--surface); cursor: pointer;
}
.att input:focus-visible + span { outline: 2.5px solid var(--brass); outline-offset: 1px; }
.att input[value="H"]:checked + span { background: var(--ok); border-color: var(--ok); color: #fff; }
.att input[value="I"]:checked + span { background: var(--fase-a); border-color: var(--fase-a); color: #fff; }
.att input[value="S"]:checked + span { background: var(--brass); border-color: var(--brass); color: #fff; }
.att input[value="A"]:checked + span { background: var(--danger); border-color: var(--danger); color: #fff; }
.score { width: 92px; text-align: center; font-variant-numeric: tabular-nums; }
.score.low { border-color: var(--danger); color: var(--danger); }
.tally { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); }
.tally b { color: var(--text); font-variant-numeric: tabular-nums; }
.sticky-foot { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 14px 22px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.stat { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat .l { font-size: 12.5px; color: var(--muted); }
.stat .v { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- Masuk ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--ink); }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border-radius: 18px; padding: 30px; display: grid; gap: 16px; }
.login-card .brand-name { color: var(--text); font-size: 20px; }

/* ---------- Layar kecil ---------- */
@media (max-width: 1080px) {
    .class-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
    .shell { grid-template-columns: minmax(0, 1fr); }
    .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 50; transform: translateX(-100%); transition: transform .22s ease; }
    body.nav-open .sidebar { transform: none; }
    body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(10, 20, 17, .45); z-index: 40; }
    .topbar .menu-btn { display: inline-flex; }
    .shell { background: none; }
    .topbar { padding: 10px 16px; }
    .topbar-meta { display: none; }
    .content { padding: 20px 16px 48px; }
    .page-head h1 { font-size: 22px; }
    .form-grid, .form-grid.cols-3, .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
    .welcome { grid-template-columns: minmax(0, 1fr); padding: 24px 20px; }
    .welcome h1 { font-size: 24px; }
    .dates { text-align: left; }
    .counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .counts a:nth-child(2n) { border-right: 0; }
    .counts a:nth-child(4n) { border-right: 0; }
    .counts a:nth-last-child(-n+4) { border-bottom: 1px solid var(--line); }
    .counts a:nth-last-child(-n+2) { border-bottom: 0; }
    .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .panel-head, .panel-body, .filters, .form-section, .form-foot, .todo li, .feed li, .ref-list li { padding-left: 16px; padding-right: 16px; }
    .tbl-detail th { width: 38%; }
}
@media (max-width: 560px) {
    .class-grid { grid-template-columns: minmax(0, 1fr); }
    .cp-item { grid-template-columns: minmax(0, 1fr); }
    .cp-icon { display: none; }
    .filters .select, .search { min-width: 0; max-width: none; width: 100%; flex: 1 1 100%; }
    .att { gap: 3px; }
    .att span { width: 31px; height: 32px; }
    .tbl td, .tbl th { padding: 9px 8px; }
    .tbl td.name { font-size: 13.5px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* Tombol Ekspor dengan pilihan format */
.menu-ekspor { position: relative; display: inline-block; }
.menu-ekspor > summary { list-style: none; cursor: pointer; }
.menu-ekspor > summary::-webkit-details-marker { display: none; }
.menu-ekspor > summary::after { content: ""; width: 6px; height: 6px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg); margin: -3px 0 0 4px; }
.menu-ekspor .menu-isi { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 270px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: 6px; }
.menu-ekspor .menu-isi a { display: flex; flex-direction: column; padding: 9px 12px; border-radius: 8px; color: var(--text); }
.menu-ekspor .menu-isi a:hover { background: var(--surface-2); text-decoration: none; }
.menu-ekspor .menu-isi a span { font-size: 12.5px; color: var(--muted); }
