/* Rapor Adab — dashboard modern (terang), responsif untuk ponsel, tablet, dan desktop.
   Sidebar mengikuti struktur menu RDM dengan gaya dashboard modern.
   Semua warna lewat token di :root. Mode gelap mengikuti pengaturan sistem. */

:root {
    color-scheme: light;
    --bg: #f3f5fb;
    --surface: #ffffff;
    --surface-2: #f7f8fc;
    --surface-3: #eaf0ff;
    --text: #111827;
    --text-soft: #374151;
    --muted: #5b6474;            /* ≥ 4.5:1 di atas putih dan bg */
    --line: #e6e9f2;
    --line-strong: #8a93a6;      /* batas input, ≥ 3:1 */
    --brand: #2563eb;            /* putih di atasnya ≥ 4.5:1 */
    --brand-hover: #1d4ed8;
    --brand-soft: #e8efff;
    --brand-ink: #1e40af;
    --accent: #7c3aed;
    --accent-soft: #f1e9ff;
    --accent-ink: #5b21b6;
    --ok: #15803d;
    --ok-soft: #e7f8ee;
    --ok-ink: #14532d;
    --danger: #dc2626;
    --danger-soft: #fdecec;
    --danger-ink: #991b1b;
    --warn-soft: #fff6e0;
    --warn-ink: #7a4b00;
    --info-soft: #e8f4ff;
    --info-ink: #0b4a8a;
    --focus: #2563eb;
    --radius-lg: 20px;
    --radius: 16px;
    --radius-sm: 12px;
    --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.05);
    --shadow: 0 1px 2px rgba(17, 24, 39, 0.04), 0 8px 24px -12px rgba(17, 24, 39, 0.12);
    --shadow-lg: 0 24px 48px -20px rgba(37, 99, 235, 0.28);
    --sidebar-w: 264px;
    --topbar-h: 68px;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --bg: #0c1220;
        --surface: #141c2e;
        --surface-2: #19233a;
        --surface-3: #1c2a4a;
        --text: #f3f4f6;
        --text-soft: #d1d5db;
        --muted: #aab3c5;
        --line: #26324b;
        --line-strong: #7a849a;
        --brand: #3b82f6;
        --brand-hover: #2563eb;
        --brand-soft: #1b2b52;
        --brand-ink: #bfdbfe;
        --accent: #a78bfa;
        --accent-soft: #2a1f4a;
        --accent-ink: #ddd6fe;
        --ok: #4ade80;
        --ok-soft: #13301f;
        --ok-ink: #bbf7d0;
        --danger: #f87171;
        --danger-soft: #3a1619;
        --danger-ink: #fecaca;
        --warn-soft: #3a2e10;
        --warn-ink: #fde68a;
        --info-soft: #132a44;
        --info-ink: #bae6fd;
        --focus: #60a5fa;
        --shadow: none;
        --shadow-lg: none;
    }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

h1 { font-size: clamp(1.4rem, 1.2rem + 1vw, 1.9rem); line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 0.5rem; }
h2 { font-size: 1.125rem; margin: 0 0 0.75rem; letter-spacing: -0.01em; }
h3 { font-size: 1rem; margin: 1.25rem 0 0.5rem; }

a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-hover); }

:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--focus) 50%, transparent);
    outline-offset: 2px;
}

code, .code {
    font-family: inherit;
    font-size: 0.95em;
    padding: 0.1rem 0.4rem;
    border-radius: 6px;
    background: var(--surface-2);
    border: 1px solid var(--line);
}

/* ---------- Tata letak aplikasi ---------- */

.app-shell { min-height: 100vh; }

/* Sidebar: putih, penuh tinggi, rapat ke tepi kiri (gaya dashboard modern) */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1.25rem 0.85rem 1rem;
    background: var(--surface);
    border-right: 1px solid var(--line);
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index: 40;
    transition: transform 220ms ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.2rem 0.6rem 1rem;
    color: var(--text);
    text-decoration: none;
    font-weight: 750;
}
.sidebar-brand:hover { color: var(--text); }

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    box-shadow: 0 8px 18px -8px rgba(37, 99, 235, 0.7);
    flex: none;
}
.brand-name { font-size: 1rem; letter-spacing: -0.01em; }

.sidebar-nav { display: flex; flex-direction: column; gap: 0.2rem; flex: 1 0 auto; }

/* Label bagian: huruf kapital kecil, seperti judul bagian di RDM */
.nav-section { display: flex; flex-direction: column; gap: 0.1rem; margin-top: 0.9rem; }
.nav-label {
    margin: 0 0 0.25rem;
    padding: 0 0.6rem;
    font-size: 0.68rem;
    font-weight: 750;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

/* Menu utama (BERANDA, IDENTITAS LEMBAGA): huruf kapital */
.nav-top {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-height: 42px;
    padding: 0.45rem 0.7rem;
    border-radius: 12px;
    color: var(--text-soft);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.8rem;
    font-weight: 700;
    transition: background-color 150ms ease, color 150ms ease;
}
.nav-top:hover { background: var(--surface-2); color: var(--text); }
.nav-top.is-active {
    background: var(--surface-3);
    color: var(--brand-ink);
    box-shadow: inset -3px 0 0 var(--brand);
}

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

/* Sub menu yang bisa dibuka-tutup */
.nav-sub-group > summary {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-height: 40px;
    padding: 0.4rem 0.7rem;
    border-radius: 12px;
    color: var(--text-soft);
    font-size: 0.92rem;
    font-weight: 600;
    list-style: none;
    cursor: pointer;
    user-select: none;
}
.nav-sub-group > summary::-webkit-details-marker { display: none; }
.nav-sub-group > summary:hover { background: var(--surface-2); color: var(--text); }
.nav-sub-group[open] > summary { color: var(--text); }
.nav-sub-group > summary span:not(.chev) { flex: 1 1 auto; }

.chev {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 0.25rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 160ms ease;
    opacity: 0.7;
    flex: none;
}
details[open] > summary > .chev { transform: rotate(225deg) translate(-2px, -2px); }

/* Item di dalam sub menu, diindentasi dan diberi garis panduan */
.nav-sub-group > .nav-link,
.nav-section > .nav-link {
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 0.4rem 0.7rem 0.4rem 2.5rem;
    border-radius: 10px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 150ms ease, color 150ms ease;
}
.nav-section > .nav-link { padding-left: 0.7rem; }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.is-active {
    background: var(--surface-3);
    color: var(--brand-ink);
    font-weight: 700;
    box-shadow: inset -3px 0 0 var(--brand);
}

.nav-section-account { margin-top: 1rem; }

.sidebar-user {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.6rem 0.75rem;
    padding: 0.8rem;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.sidebar-user .user-meta { max-width: none; }
.sidebar-user .user-meta strong { max-width: none; font-size: 0.92rem; }
.sidebar-user .user-meta .muted { font-size: 0.8rem; }
.sidebar-user .logout-form { grid-column: 1 / -1; margin: 0; }
.sidebar-user .logout-form button { width: 100%; min-height: 40px; }

.sidebar-scrim { display: none; }

/* Topbar */
.app-main {
    margin-left: calc(var(--sidebar-w));
    min-width: 0;
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: var(--topbar-h);
    padding: 0.75rem 1.75rem;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(160%) blur(10px);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.topbar-title {
    margin: 0;
    font-weight: 700;
    color: var(--text);
    font-size: 1rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.topbar-spacer { flex: 1; }

.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    padding: 0;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    flex: none;
}
.menu-toggle:hover { background: var(--surface-2); color: var(--text); }
.menu-toggle-bars { position: relative; width: 18px; height: 2px; background: currentColor; border-radius: 2px; }
.menu-toggle-bars::before,
.menu-toggle-bars::after {
    content: "";
    position: absolute;
    left: 0;
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform 180ms ease;
}
.menu-toggle-bars::before { top: -6px; }
.menu-toggle-bars::after { top: 6px; }
body.nav-open .menu-toggle-bars { background: transparent; }
body.nav-open .menu-toggle-bars::before { top: 0; transform: rotate(45deg); }
body.nav-open .menu-toggle-bars::after { top: 0; transform: rotate(-45deg); }

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
    padding: 0.3rem 0.7rem 0.3rem 0.3rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
}
.user-meta { min-width: 0; line-height: 1.25; }
.user-meta strong { display: block; font-size: 0.88rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 16ch; }
.user-meta .muted { display: block; font-size: 0.75rem; text-transform: capitalize; }

.avatar {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    color: #fff;
    font-weight: 750;
    font-size: 0.9rem;
    flex: none;
}

.logout-form { margin: 0; }

.container {
    max-width: none;
    margin: 0;
    padding: 0.5rem clamp(1rem, 2vw, 2rem) 3rem;
}

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

.guest .auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
}

.auth-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 3rem;
    color: #eef2ff;
    background:
        radial-gradient(60% 50% at 80% 10%, rgba(167, 139, 250, 0.45), transparent 70%),
        radial-gradient(70% 60% at 0% 100%, rgba(59, 130, 246, 0.55), transparent 70%),
        linear-gradient(160deg, #1e3a8a 0%, #3b2a8a 100%);
}
.auth-brand .brand-mark { width: 48px; height: 48px; font-size: 1.2rem; background: #fff; color: #1e3a8a; box-shadow: none; }
.auth-brand h2 { font-size: 2.2rem; margin: 0.75rem 0 0; color: #fff; letter-spacing: -0.03em; }
.auth-brand p { margin: 0; max-width: 36ch; color: #dbe4ff; font-size: 1.02rem; }

.auth-panel {
    display: grid;
    place-items: center;
    padding: 2rem 1.25rem;
    background: var(--bg);
}
.auth-content { width: 100%; max-width: 410px; }

.auth-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}
.auth-card h1 { margin-top: 0.15rem; }
.auth-card .muted { margin: 0 0 1.25rem; }

.eyebrow {
    margin: 0;
    font-size: 0.74rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand);
}

/* ---------- Kartu, grid, dan judul halaman ---------- */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem 1.4rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow);
    min-width: 0;
}

.narrow { max-width: 540px; margin: 1rem auto; }
.narrow-wide { max-width: 800px; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.grid > * { min-width: 0; }

.stat {
    position: relative;
    margin: 0;
    overflow: hidden;
}
.stat::after {
    content: "";
    position: absolute;
    right: -30px;
    top: -30px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--accent-c, var(--brand)) 10%, transparent);
    pointer-events: none;
}
.stat .stat-icon {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--accent-c, var(--brand)) 14%, transparent);
    color: var(--accent-c, var(--brand));
    margin-bottom: 0.9rem;
}
.stat .stat-icon svg { width: 20px; height: 20px; }
.stat > span:not(.stat-icon) { display: block; font-size: 0.86rem; font-weight: 600; color: var(--muted); }
.stat strong {
    display: block;
    margin-top: 0.2rem;
    font-size: clamp(1.7rem, 1.4rem + 1vw, 2.2rem);
    line-height: 1.1;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.page-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem 1rem;
    margin: 0.5rem 0 1.25rem;
}
.page-head h1 { margin: 0; }

.hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    padding: clamp(1.25rem, 1rem + 1.5vw, 2rem);
    margin-bottom: 1.25rem;
    color: #f8faff;
    background:
        radial-gradient(60% 90% at 100% 0%, rgba(167, 139, 250, 0.55), transparent 70%),
        linear-gradient(120deg, #1d4ed8 0%, #4338ca 60%, #6d28d9 100%);
    box-shadow: var(--shadow-lg);
}
.hero h1 { color: #fff; margin: 0.25rem 0 0.4rem; font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.2rem); }
.hero p { margin: 0; color: #dbe4ff; max-width: 60ch; }
.hero .eyebrow { color: #c7d2fe; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 0.84rem;
    font-weight: 600;
}

.section-title { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1.5rem 0 0.75rem; }
.section-title h2 { margin: 0; }

.kelas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 0.9rem;
    margin-bottom: 1.25rem;
}
.kelas-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.1rem;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text);
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.kelas-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); color: var(--text); }
.kelas-card strong { font-size: 1.05rem; }
.kelas-card .arrow { margin-top: auto; font-size: 0.88rem; font-weight: 650; color: var(--brand); }

.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.75rem;
}
.quick {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 56px;
    padding: 0.75rem 0.9rem;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--line);
    text-decoration: none;
    color: var(--text);
    font-weight: 650;
    box-shadow: var(--shadow-sm);
    transition: border-color 160ms ease, transform 160ms ease;
}
.quick:hover { border-color: var(--brand); color: var(--text); transform: translateY(-1px); }
.quick .stat-icon {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: var(--c, var(--brand));
    color: #fff;
    flex: none;
}
.quick .stat-icon svg { width: 18px; height: 18px; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1.25rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

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

form { margin: 0; }
.stack > * + * { margin-top: 0.25rem; }

label {
    display: block;
    margin-bottom: 1rem;
    font-size: 0.88rem;
    font-weight: 650;
    color: var(--text-soft);
}
label.check {
    display: flex;
    gap: 0.55rem;
    align-items: center;
    font-weight: 500;
}
label.check input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); margin: 0; }

input[type="text"], input[type="password"], input[type="number"], input[type="date"],
input[type="email"], input[type="search"], input[type="file"], select, textarea {
    display: block;
    width: 100%;
    margin-top: 0.4rem;
    min-height: 44px;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    font: inherit;
    font-weight: 450;
    background: var(--surface);
    color: var(--text);
    transition: border-color 150ms ease, box-shadow 150ms ease;
}
select { appearance: auto; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--focus);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 18%, transparent);
}
input[readonly] { opacity: 0.75; }
input[type="file"] { padding: 0.5rem; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset[disabled] input, fieldset[disabled] select { opacity: 0.7; }

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

button, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 42px;
    padding: 0.55rem 1.1rem;
    border: 1px solid transparent;
    border-radius: 12px;
    background: var(--brand);
    color: #fff;
    font: inherit;
    font-weight: 650;
    font-size: 0.92rem;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 6px 16px -8px rgba(37, 99, 235, 0.7);
    transition: background-color 150ms ease, transform 100ms ease, box-shadow 150ms ease;
}
button:hover, .button:hover { background: var(--brand-hover); color: #fff; }
button:active, .button:active { transform: translateY(1px); }
button:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
button.block { display: flex; width: 100%; margin-top: 0.5rem; min-height: 46px; font-size: 0.98rem; }
button.small { min-height: 34px; padding: 0.3rem 0.75rem; font-size: 0.85rem; border-radius: 10px; }

button.ghost, .ghost {
    background: var(--surface);
    color: var(--text-soft);
    border: 1px solid var(--line);
    box-shadow: none;
}
button.ghost:hover, .ghost:hover { background: var(--surface-2); color: var(--text); }

button.danger, .danger { background: var(--danger); color: #fff; box-shadow: none; }
button.danger:hover, .danger:hover { background: #b91c1c; color: #fff; }

button.link, .link {
    min-height: 0;
    padding: 0;
    background: none;
    color: var(--brand);
    font-weight: 600;
    text-decoration: none;
    box-shadow: none;
    border-radius: 6px;
}
button.link:hover, .link:hover { background: none; color: var(--brand-hover); text-decoration: underline; }
button.link.danger, .link.danger { color: var(--danger); background: none; }
button.link.danger:hover, .link.danger:hover { color: #991b1b; background: none; text-decoration: underline; }

.inline { display: inline; }
.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: flex-end;
    margin-bottom: 1.1rem;
    padding: 0.9rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.inline-form label { margin-bottom: 0; min-width: 170px; flex: 1 1 170px; }
.inline-form button { flex: none; }
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    align-items: center;
    margin-top: 0.85rem;
}
.actions-cell { white-space: nowrap; display: flex; gap: 0.6rem; align-items: center; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
.span-2 { grid-column: span 2; }

.logo-box {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: flex-start;
    border-top: 1px solid var(--line);
    padding-top: 1rem;
    margin-top: 0.5rem;
}
.logo-box input[type="file"] { width: auto; }
.logo-preview { max-height: 90px; max-width: 220px; display: block; margin-top: 0.5rem; border-radius: 10px; }

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

.table-wrap {
    overflow-x: auto;
    padding: 0;
    -webkit-overflow-scrolling: touch;
}
.table-wrap.card { padding: 0; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.92rem; }
th, td {
    padding: 0.8rem 0.95rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}
thead th {
    position: sticky;
    top: 0;
    background: var(--surface-2);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}
tbody tr { transition: background-color 120ms ease; }
tbody tr:hover td { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.nilai-table td input[type="text"],
.nilai-table td input[type="number"],
.nilai-input {
    width: 6.5rem;
    min-height: 40px;
    margin: 0;
    padding: 0.4rem 0.5rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.num { font-variant-numeric: tabular-nums; }

.deskripsi-cell { max-width: 46ch; white-space: normal; color: var(--text-soft); }
.catatan-row { margin-bottom: 0.75rem; }
.ttd { margin-top: 2rem; }
.list { padding-left: 1.2rem; margin: 0.5rem 0; }
.list li { margin: 0.3rem 0; }
.json {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.82rem;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text-soft);
}

/* ---------- Badge, alert, status ---------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    background: var(--info-soft);
    color: var(--info-ink);
    font-size: 0.78rem;
    font-weight: 650;
    white-space: nowrap;
}
.badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.8;
}
.badge-aktif { background: var(--ok-soft); color: var(--ok-ink); }
.badge-bahaya { background: var(--danger-soft); color: var(--danger-ink); }
.badge-arsip { background: var(--surface-2); color: var(--text-soft); border: 1px solid var(--line); }

.alert {
    padding: 0.85rem 1.05rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    margin-bottom: 1.1rem;
    font-size: 0.92rem;
}
.alert-sukses { background: var(--ok-soft); color: var(--ok-ink); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.alert-gagal, .alert-error { background: var(--danger-soft); color: var(--danger-ink); border-color: color-mix(in srgb, var(--danger) 28%, transparent); }
.alert-info { background: var(--info-soft); color: var(--info-ink); border-color: color-mix(in srgb, var(--info-ink) 18%, transparent); }

.error { color: var(--danger-ink); font-size: 0.85rem; display: block; margin-top: 0.25rem; }
.muted { color: var(--muted); }

/* ---------- Layar sentuh: area tekan lebih besar ---------- */
@media (pointer: coarse) {
    button, .button, .nav-link, .nav-top, .nav-sub-group > summary,
    input[type="text"], input[type="password"], input[type="number"], input[type="date"], select, textarea {
        min-height: 46px;
    }
}

/* ---------- Tablet dan ponsel: sidebar menjadi drawer ---------- */
@media (max-width: 960px) {
    .menu-toggle { display: inline-flex; }
    .sidebar {
        width: min(86vw, 310px);
        transform: translateX(-105%);
        padding-top: calc(1.1rem + env(safe-area-inset-top));
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
        box-shadow: var(--shadow-lg);
    }
    body.nav-open .sidebar { transform: translateX(0); }
    .sidebar-scrim {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.42);
        opacity: 0;
        pointer-events: none;
        transition: opacity 200ms ease;
        z-index: 35;
    }
    body.nav-open .sidebar-scrim { opacity: 1; pointer-events: auto; }
    body.nav-open { overflow: hidden; }
    .app-main { margin-left: 0; }
    .topbar { padding: 0.6rem 1rem; }
    .container { padding: 0.5rem 1rem 2.5rem; }
    .topbar .user-meta { display: none; }
    .user-chip { padding: 0.25rem; }
    .auth-brand { display: none; }
    .guest .auth-shell { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .two-col { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .card { padding: 1rem; border-radius: var(--radius-sm); }
    .hero { border-radius: var(--radius); }
    .inline-form label { min-width: 0; flex-basis: 100%; }
    .inline-form button { width: 100%; }
    .grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
    .stat strong { font-size: 1.6rem; }
    .topbar-title { display: none; }
    .topbar-spacer { display: none; }
    .auth-panel { padding: 1.5rem 1rem 2rem; }
    .auth-card { padding: 1.5rem; border-radius: var(--radius); }
    .auth-card h1 { font-size: 1.5rem; }
}

@media (max-width: 420px) {
    .grid { grid-template-columns: 1fr; }
    .quick-grid { grid-template-columns: 1fr 1fr; }
    .kelas-grid { grid-template-columns: 1fr; }
    .actions-cell { flex-wrap: wrap; white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- Cetak ---------- */

@media print {
    .sidebar, .topbar, .sidebar-scrim { display: none !important; }
    .app-main { margin-left: 0; }
    .card { box-shadow: none; }
    body { background: #fff; }
}

/* ---------- Daftar periksa (persiapan sekolah) ---------- */
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.check-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--line);
    font-weight: 550;
}
.check-list .badge { min-width: 5.5rem; justify-content: center; }
.check-list .badge:not(.badge-aktif) { background: var(--warn-soft); color: var(--warn-ink); }

/* ---------- Log audit ---------- */
.nowrap { white-space: nowrap; }
.audit-table td { vertical-align: top; }
.audit-kv { margin: 0; display: grid; gap: 0.25rem; min-width: 14rem; }
.audit-kv > div { display: flex; flex-wrap: wrap; gap: 0.35rem; font-size: 0.86rem; }
.audit-kv dt { color: var(--muted); font-weight: 600; }
.audit-kv dt::after { content: ":"; }
.audit-kv dd { margin: 0; word-break: break-word; }

/* ---------- Seragam font: semua kontrol memakai font yang sama ---------- */
html, body, input, select, textarea, button, table, th, td, label, code, .code {
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
input, select, textarea, button { font-size: inherit; letter-spacing: normal; }

/* ---------- Toolbar di atas tabel, aksi baris, dan kotak tambah ---------- */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    margin-bottom: 1rem;
}
.toolbar .muted { margin: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; }
.section-head h2 { margin: 0; }
.add-box { margin-bottom: 1rem; }
.add-box > summary { list-style: none; display: inline-flex; cursor: pointer; }
.add-box > summary::-webkit-details-marker { display: none; }
.add-box[open] > summary { margin-bottom: 0.75rem; }
.add-box > .inline-form { margin-bottom: 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; align-items: center; }
.row-actions form { margin: 0; }
button.link.danger { color: var(--danger); }
td > input[type="text"] { min-width: 180px; }

.periode-tetap { display: block; margin-top: 0.4rem; padding: 0.6rem 0.85rem; border-radius: var(--radius-sm); background: var(--brand-soft); color: var(--brand-ink); font-weight: 650; }

.tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0; }
a.button.secondary, .tabs a.button.secondary { background: var(--brand-soft); color: var(--brand-ink); border: 1px solid var(--brand); box-shadow: none; }
textarea { width: 100%; font: inherit; padding: 0.6rem 0.75rem; border: 1px solid var(--line, #d6dbe6); border-radius: var(--radius-sm); }
[hidden] { display: none !important; }

/* ---------- Logo lembaga di sidebar ---------- */
.brand-logo { width: 40px; height: 40px; border-radius: 12px; object-fit: contain; background: #fff; padding: 3px; box-shadow: 0 2px 8px rgba(30, 58, 138, 0.2); }

/* ---------- Halaman masuk berwarna ---------- */
.guest .auth-brand {
    background:
        radial-gradient(55% 45% at 85% 8%, rgba(251, 191, 36, 0.55), transparent 70%),
        radial-gradient(60% 55% at 8% 95%, rgba(236, 72, 153, 0.55), transparent 70%),
        radial-gradient(50% 50% at 95% 90%, rgba(16, 185, 129, 0.45), transparent 70%),
        linear-gradient(150deg, #1d4ed8 0%, #6d28d9 55%, #be185d 100%);
    justify-content: space-between;
}
.auth-brand .orb { position: absolute; border-radius: 50%; filter: blur(2px); opacity: 0.35; pointer-events: none; }
.auth-brand .orb-1 { width: 260px; height: 260px; background: #fde047; top: -80px; right: -60px; }
.auth-brand .orb-2 { width: 180px; height: 180px; background: #34d399; bottom: 90px; left: -70px; }
.auth-brand .orb-3 { width: 120px; height: 120px; background: #f472b6; top: 42%; right: 12%; }
.auth-brand-body { position: relative; display: flex; flex-direction: column; gap: 0.7rem; margin-top: auto; padding-top: 2rem; }
.auth-logo { width: 92px; height: 92px; border-radius: 26px; background: #fff; display: grid; place-items: center; box-shadow: 0 14px 36px rgba(15, 23, 42, 0.3); overflow: hidden; }
.auth-logo img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.auth-logo-huruf { font-size: 2.6rem; font-weight: 800; color: #6d28d9; }
.auth-kicker { margin: 0.4rem 0 0; font-size: 0.78rem; font-weight: 750; letter-spacing: 0.14em; text-transform: uppercase; color: #fde68a; }
.guest .auth-brand h2 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.5rem); line-height: 1.15; }
.auth-lead { max-width: 44ch; color: #f1f5ff; }
.auth-fitur { list-style: none; margin: 0.6rem 0 0; padding: 0; display: grid; gap: 0.55rem; }
.auth-fitur li { display: flex; align-items: center; gap: 0.65rem; padding: 0.55rem 0.8rem; border-radius: 12px; background: rgba(255, 255, 255, 0.14); backdrop-filter: blur(4px); font-weight: 600; font-size: 0.95rem; }
.auth-fitur .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.auth-fitur .d1 { background: #fde047; } .auth-fitur .d2 { background: #34d399; } .auth-fitur .d3 { background: #f9a8d4; }
.auth-foot { position: relative; margin: 1.5rem 0 0; font-size: 0.8rem; color: #e0e7ff; }
.guest .auth-panel { background: linear-gradient(160deg, #eff6ff 0%, #faf5ff 55%, #fff7ed 100%); }
.guest .auth-card { border: 0; border-top: 6px solid transparent; border-image: linear-gradient(90deg, #2563eb, #7c3aed, #ec4899, #f59e0b) 1; box-shadow: 0 24px 60px rgba(76, 29, 149, 0.18); }
.guest .auth-card button.block { background: linear-gradient(90deg, #2563eb, #7c3aed); border: 0; font-size: 1rem; padding: 0.8rem; }
.guest .auth-card button.block:hover { filter: brightness(1.08); }
.input-ikon { position: relative; display: block; margin-top: 0.35rem; }
.input-ikon svg { position: absolute; left: 0.8rem; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; fill: none; stroke: #7c3aed; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.input-ikon input { padding-left: 2.5rem; margin-top: 0; width: 100%; }
.auth-bantuan { margin: 1rem 0 0; text-align: center; font-size: 0.85rem; color: var(--muted, #6b7280); }
@media (max-width: 860px) {
    .guest .auth-shell { grid-template-columns: 1fr; }
    .guest .auth-brand { padding: 1.75rem 1.5rem; min-height: 0; }
    .auth-brand-body { margin-top: 0; padding-top: 0; }
    .auth-fitur, .auth-foot { display: none; }
    .auth-logo { width: 68px; height: 68px; border-radius: 20px; }
}

/* ---------- Pop up hasil aksi dan konfirmasi ---------- */
.pop-latar { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 1.5rem; background: rgba(15, 23, 42, 0.55); animation: pop-latar 0.18s ease-out; }
.pop-kartu { position: relative; width: min(100%, 360px); background: #fff; color: #1f2937; border-radius: 16px; padding: 3.2rem 1.5rem 1.5rem; text-align: center; box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35); animation: pop-naik 0.22s ease-out; }
.pop-ikon { position: absolute; top: -36px; left: 50%; transform: translateX(-50%); width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; color: #fff; box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25); }
.pop-ikon svg { width: 36px; height: 36px; fill: none; stroke: #fff; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.pop-sukses .pop-ikon { background: #84cc16; } .pop-gagal .pop-ikon { background: #ef4444; } .pop-info .pop-ikon { background: #3b82f6; } .pop-tanya .pop-ikon { background: #f59e0b; }
.pop-kartu h3 { margin: 0.2rem 0 0.5rem; font-size: 1.35rem; font-weight: 500; color: #374151; }
.pop-kartu p { margin: 0 0 1.4rem; font-size: 0.92rem; line-height: 1.5; color: #6b7280; white-space: pre-line; }
.pop-aksi { display: flex; gap: 0.6rem; justify-content: center; }
.pop-aksi button { flex: 1; border: 0; border-radius: 8px; padding: 0.7rem 1rem; font-weight: 700; font-size: 0.9rem; letter-spacing: 0.04em; cursor: pointer; color: #fff; }
.pop-sukses .pop-ok { background: #84cc16; } .pop-gagal .pop-ok { background: #ef4444; } .pop-info .pop-ok { background: #3b82f6; } .pop-tanya .pop-ok { background: #f59e0b; }
.pop-aksi .pop-batal { background: #e5e7eb; color: #374151; }
.pop-aksi button:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.5); outline-offset: 2px; }
@keyframes pop-latar { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-naik { from { opacity: 0; transform: translateY(14px) scale(0.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pop-latar, .pop-kartu { animation: none; } }

/* Grid isian nilai: sepuluh kolom H/K berdampingan, jadi lebih sempit dari .nilai-table bawaan. */
.grid-nilai { border: 0; padding: 0; margin: 0; min-width: 0; }
.nilai-table.nilai-ringkas td input[type="text"] { width: 4rem; min-width: 0; min-height: 36px; padding: 0.3rem 0.35rem; }
.nilai-table td input[type="text"].is-error { border-color: var(--danger); background: var(--danger-soft); }
.nowrap { white-space: nowrap; }
.nilai-table td select { min-width: 0; width: auto; max-width: 11rem; padding: 0.3rem 0.4rem; min-height: 36px; }
.nilai-table td.is-error, .nilai-table tr.is-error td { background: var(--danger-soft); }
.deskripsi-cell { min-width: 16rem; white-space: normal; }

/* =====================================================================
   Tema "glass pastel": latar gradasi lavender, persik, dan mint; kartu kaca
   transparan; sidebar tanpa kotak dengan item aktif berupa pil biru.
   Ditaruh paling akhir agar menimpa token dan aturan di atas (termasuk mode gelap,
   karena tema ini sengaja satu tampilan terang).
   ===================================================================== */
:root, :root:not([data-theme="light"]) {
    color-scheme: light;
    --bg: #ece8f7;
    --surface: rgba(255, 255, 255, 0.62);
    --surface-2: rgba(255, 255, 255, 0.5);
    --surface-3: rgba(37, 99, 235, 0.1);
    --text: #14161f;
    --text-soft: #3f4557;
    --muted: #5d6478;
    --line: rgba(255, 255, 255, 0.85);
    --line-strong: #8a93a6;
    --brand: #2b7be4;
    --brand-hover: #1f66c7;
    --brand-soft: rgba(43, 123, 228, 0.12);
    --brand-ink: #1d4f9c;
    --ok: #1f9d55;
    --ok-soft: #d9f4e4;
    --ok-ink: #14633a;
    --danger: #e0475b;
    --danger-soft: #fde1e5;
    --danger-ink: #a12636;
    --warn-soft: #fff0d6;
    --info-soft: #e0efff;
    --radius-lg: 24px;
    --radius: 20px;
    --radius-sm: 12px;
    --shadow: 0 8px 30px -14px rgba(90, 80, 150, 0.35);
    --shadow-lg: 0 24px 60px -20px rgba(90, 80, 150, 0.45);
    --sidebar-w: 268px;
}

body.app, body.guest {
    background:
        radial-gradient(900px 600px at 8% 0%, #c9c2f5 0%, transparent 60%),
        radial-gradient(900px 640px at 100% 10%, #f6dccd 0%, transparent 62%),
        radial-gradient(900px 700px at 90% 100%, #c8ecdc 0%, transparent 60%),
        radial-gradient(700px 500px at 0% 100%, #f1c9ee 0%, transparent 60%),
        #ece8f7;
    background-attachment: fixed;
}

.card, .table-wrap.card, .pop-kartu {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: var(--radius);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
    box-shadow: var(--shadow);
}

/* Sidebar */
.sidebar {
    background: rgba(255, 255, 255, 0.28);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-right: 1px solid rgba(255, 255, 255, 0.7);
}
.brand-mark {
    background: linear-gradient(135deg, #2b7be4, #7b5cf0);
    box-shadow: 0 6px 16px -6px rgba(43, 123, 228, 0.7);
}
.brand-name { font-size: 1.15rem; font-weight: 800; }
.nav-top, .nav-sub-group > summary, .nav-link {
    border-radius: 10px;
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.93rem;
    font-weight: 500;
    color: var(--text-soft);
}
.nav-top:hover, .nav-sub-group > summary:hover, .nav-link:hover { background: rgba(255, 255, 255, 0.65); color: var(--text); }
.nav-top.is-active, .nav-link.is-active {
    background: var(--brand);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 8px 18px -8px rgba(43, 123, 228, 0.8);
}
.nav-label { font-size: 0.72rem; letter-spacing: 0.08em; color: var(--muted); }

/* Topbar */
.topbar {
    background: transparent;
    border-bottom: 0;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    padding-top: 1.1rem;
}
.topbar-title { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.topbar-title small { display: block; font-size: 0.85rem; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.user-chip {
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 999px;
}

/* Tombol, isian */
button, .button { border-radius: 10px; background: var(--brand); box-shadow: 0 8px 18px -10px rgba(43, 123, 228, 0.9); }
button.ghost, .ghost { background: rgba(255, 255, 255, 0.6); border-color: rgba(255, 255, 255, 0.9); }
input[type="text"], input[type="password"], input[type="email"], input[type="search"], input[type="number"], input[type="date"], select, textarea {
    background: rgba(255, 255, 255, 0.75);
    border-radius: 12px;
}

/* Tabel: kepala polos di atas kaca, baris dipisah garis tipis */
thead th { background: rgba(255, 255, 255, 0.55); color: var(--text-soft); text-transform: none; letter-spacing: 0; font-size: 0.85rem; }
th, td { border-bottom: 1px solid rgba(120, 110, 170, 0.14); }
tbody tr:hover td { background: rgba(255, 255, 255, 0.45); }
.table-wrap { border-radius: var(--radius); }

/* Lencana berbentuk pil pastel seperti status "Complete" dan "Pending" */
.badge { border-radius: 8px; background: var(--info-soft); color: var(--info-ink); font-weight: 600; }
.badge::before { display: none; }
.badge-aktif { background: var(--ok-soft); color: var(--ok-ink); }
.badge-bahaya { background: var(--danger-soft); color: var(--danger-ink); }

/* Halaman masuk */
.auth-brand { background: linear-gradient(145deg, #2b7be4 0%, #7b5cf0 100%); margin: 1.25rem; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.auth-panel { background: transparent; }
.auth-card { background: var(--surface); border: 1px solid rgba(255, 255, 255, 0.9); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }

@media (max-width: 960px) {
    .sidebar { background: rgba(244, 241, 252, 0.96); }
}
@media print {
    body.app, body.guest { background: #fff; }
}

/* ---------- Dasbor pimpinan (tema glass pastel) ---------- */
.dash-grid { display: grid; gap: 1.1rem; margin-bottom: 1.1rem; }
.dash-grid > * { margin-bottom: 0; min-width: 0; }
.dash-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dash-mid { grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); }
.dash-bottom { grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.9rem; flex-wrap: wrap; }
.card-top h2 { margin: 0; font-size: 1.1rem; }
.mini-link { font-size: 0.88rem; font-weight: 600; text-decoration: none; }
.stat-head { font-size: 0.98rem; color: var(--text-soft); margin-bottom: 0.4rem; }
.stat-body { display: flex; align-items: flex-end; justify-content: space-between; gap: 0.75rem; }
.stat-card strong { display: block; font-size: clamp(1.9rem, 1.5rem + 1.2vw, 2.6rem); line-height: 1.1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.delta { display: flex; align-items: center; gap: 0.3rem; margin: 0.5rem 0 0; font-size: 0.88rem; font-weight: 600; flex-wrap: wrap; }
.delta span { color: var(--muted); font-weight: 400; }
.delta.naik { color: var(--ok); }
.delta.turun { color: var(--danger); }
.spark { width: 46%; max-width: 170px; height: 64px; flex: none; }
.ring { width: 70px; height: 70px; flex: none; }
.chart { width: 100%; height: auto; display: block; }
.chart .ax, .donut .ax { font-size: 11px; fill: var(--muted); }
.legend { display: flex; gap: 1rem; font-size: 0.85rem; color: var(--text-soft); flex-wrap: wrap; }
.legend i, .donut-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 0.4rem; }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.bar-row { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.9rem; margin-bottom: 0.35rem; }
.bar-row a { color: var(--text); text-decoration: none; font-weight: 500; }
.bar-row span { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar { height: 6px; border-radius: 999px; background: rgba(43, 123, 228, 0.14); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.donut-wrap { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.donut { width: 160px; height: 160px; flex: none; }
.donut-n { font-size: 28px; font-weight: 700; fill: var(--text); }
.donut-legend { list-style: none; margin: 0; padding: 0; flex: 1 1 140px; display: grid; gap: 0.7rem; }
.donut-legend li { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; font-size: 0.92rem; }
.donut-legend li span { flex: 1; }
.donut-legend li.sum { border-top: 1px solid rgba(120, 110, 170, 0.18); padding-top: 0.6rem; color: var(--text-soft); }
.plain-table thead th { background: rgba(255, 255, 255, 0.55); border-radius: 0; }
.plain-table td, .plain-table th { padding: 0.7rem 0.8rem; }
.avatar.sm { width: 28px; height: 28px; font-size: 0.8rem; margin-right: 0.4rem; vertical-align: middle; }
.pil { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 8px; font-size: 0.82rem; font-weight: 600; white-space: nowrap; }
.pil-hijau { background: var(--ok-soft); color: var(--ok-ink); }
.pil-merah { background: var(--danger-soft); color: var(--danger-ink); }
.pil-abu { background: rgba(120, 110, 170, 0.14); color: var(--text-soft); }
.small-note { font-size: 0.82rem; margin: 0.6rem 0 0; }
.card-sum { cursor: pointer; list-style: none; }
.card-sum h2 { margin: 0; display: inline-flex; gap: 0.6rem; align-items: center; }
@media (max-width: 1100px) { .dash-mid, .dash-bottom { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .dash-stats { grid-template-columns: 1fr; } }
.topbar { background: rgba(236, 232, 247, 0.55); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }

/* Kotak centang kelas (Mengajar berdasarkan guru) dan tab */
.kotak-centang { display: flex; flex-wrap: wrap; gap: 0.5rem 1.2rem; margin: 0.4rem 0 1rem; }
.kotak-centang .check { display: inline-flex; align-items: center; gap: 0.4rem; background: rgba(255,255,255,.55); padding: 0.35rem 0.8rem; border-radius: 10px; }
.tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1rem; }

/* Status nilai: komponen berwarna (merah draft, kuning terkirim, hijau terkunci) */
.chips-status { display: flex; flex-wrap: wrap; gap: 0.3rem; max-width: 520px; }
.chip-status { display: inline-block; padding: 0.12rem 0.55rem; border-radius: 8px; font-size: 0.78rem; font-weight: 600; white-space: nowrap; }
.chip-status.st-draft { background: var(--danger-soft); color: var(--danger-ink); }
.chip-status.st-terkirim { background: #fff0c9; color: #7a4b00; }
.chip-status.st-terkunci { background: var(--ok-soft); color: var(--ok-ink); }
.legend-status { font-size: 0.88rem; color: var(--muted); }

/* Label kuning periode aktif (pindah semester cepat ala RDM) */
.semester-cepat { margin: 0.2rem 0 0.6rem; }
.semester-cepat > summary { list-style: none; cursor: pointer; display: block; text-align: center; padding: 0.4rem 0.7rem; border-radius: 10px; background: #f9d44a; color: #4a3500; font-weight: 700; font-size: 0.85rem; box-shadow: 0 6px 14px -8px rgba(180, 140, 0, 0.8); }
.semester-cepat > summary::-webkit-details-marker { display: none; }
.semester-cepat form { display: grid; gap: 0.35rem; margin-top: 0.5rem; }
.semester-cepat form button { width: 100%; }
.semester-cepat form button.is-aktif { background: var(--brand); color: #fff; }
.semester-cepat p { font-size: 0.82rem; margin: 0.4rem 0 0; text-align: center; }
.hitung-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.1rem; margin-bottom: 1.1rem; }
.hitung { display: flex; align-items: center; gap: 0.9rem; }
.hitung .ikon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.hitung strong { display: block; font-size: 1.7rem; line-height: 1.1; letter-spacing: -0.02em; }
.hitung span { font-size: 0.86rem; color: var(--muted); }
@media (max-width: 1100px) { .hitung-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.nilai-alat { margin-bottom: 1rem; }
.nilai-alat .tabs { margin-bottom: 0.7rem; }
th .isi-semua { font-size: 0.7rem; font-weight: 500; padding: 0; min-height: 0; }

/* ---------- Komponen halaman gaya RDM ---------- */
.rdm-judul { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.rdm-judul h1 { margin: 0; font-size: 1.5rem; }
.rdm-judul small { display: block; color: var(--muted); font-size: 0.8rem; }
.rdm-aksi { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.btn-rdm { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 36px; padding: 0.3rem 0.9rem; border: 0; border-radius: 6px; font-weight: 600; font-size: 0.88rem; color: #fff; text-decoration: none; cursor: pointer; background: #3f3fd9; box-shadow: none; }
.btn-rdm:hover { filter: brightness(0.92); color: #fff; }
.btn-hijau { background: #2ea84f; }
.btn-biru { background: #2b7be4; }
.btn-ungu { background: #3f3fd9; }
.btn-merah { background: #e0475b; }
.btn-kuning { background: #f0a812; color: #3b2a00; }
.btn-kecil { min-height: 28px; padding: 0.15rem 0.6rem; font-size: 0.8rem; }
.btn-garis { background: #fff; color: #3f3fd9; border: 1px solid #3f3fd9; }
.btn-garis:hover { color: #3f3fd9; background: #eef; }
.rdm-banner { padding: 0.75rem 1rem; border-radius: 6px; font-size: 0.88rem; margin-bottom: 1rem; color: #fff; }
.rdm-banner.biru { background: #3f3fd9; }
.rdm-banner.oranye { background: #f0a812; color: #3b2a00; }
.rdm-banner.kuning { background: #fff1d6; color: #6b4400; border: 1px solid #f3d38c; }
.rdm-banner strong { display: block; margin-bottom: 0.2rem; }
.rdm-kartu { padding: 0; overflow: hidden; }
.rdm-kartu > .rdm-kepala { padding: 0.8rem 1.1rem; border-bottom: 1px solid rgba(120, 110, 170, 0.18); font-weight: 700; display: flex; gap: 0.5rem; align-items: center; }
.rdm-kartu > .rdm-isi { padding: 1rem 1.1rem; }
.rdm-kartu > .rdm-kaki { padding: 0.7rem 1.1rem; border-top: 1px solid rgba(120, 110, 170, 0.18); display: flex; justify-content: flex-end; gap: 0.5rem; }
.rdm-form label { display: block; margin-bottom: 0.9rem; font-size: 0.88rem; color: var(--text-soft); }
.rdm-form input, .rdm-form select { width: 100%; max-width: none; margin-top: 0.25rem; }
.rdm-profil { display: grid; grid-template-columns: minmax(250px, 340px) minmax(0, 1fr); gap: 1.1rem; align-items: start; }
.rdm-profil .kolom { display: grid; gap: 1.1rem; min-width: 0; }
.logo-profil { text-align: center; padding: 1.4rem 1rem; }
.logo-profil img { width: 120px; height: 120px; object-fit: contain; }
.logo-profil .huruf { width: 120px; height: 120px; margin: 0 auto; border-radius: 50%; background: var(--brand-soft); display: grid; place-items: center; font-size: 3rem; font-weight: 800; color: var(--brand); }
.logo-profil h2 { margin: 0.8rem 0 0.1rem; font-size: 1.1rem; text-transform: uppercase; }
.logo-profil .peran { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.8rem; }
.logo-profil .tombol { display: inline-flex; border: 1px solid #3f3fd9; border-radius: 6px; overflow: hidden; }
.logo-profil .tombol > * { border-radius: 0; }
.tabel-info { width: 100%; border-collapse: collapse; }
.tabel-info th, .tabel-info td { padding: 0.65rem 0.5rem; border-bottom: 1px solid rgba(120, 110, 170, 0.18); text-align: left; background: transparent; font-size: 0.88rem; text-transform: none; letter-spacing: 0; vertical-align: top; position: static; }
.tabel-info th { width: 28%; font-weight: 700; color: var(--text); }
.tabel-info tr:last-child th, .tabel-info tr:last-child td { border-bottom: 0; }
dialog.modal { border: 0; border-radius: 12px; padding: 0; width: min(520px, 94vw); box-shadow: 0 30px 80px -20px rgba(40, 30, 90, 0.5); background: #fff; color: var(--text); }
dialog.modal::backdrop { background: rgba(30, 25, 60, 0.45); }
dialog.modal .m-kepala { display: flex; justify-content: space-between; align-items: center; padding: 0.9rem 1.2rem; border-bottom: 1px solid #eee; font-weight: 700; font-size: 1.05rem; }
dialog.modal .m-kepala button { background: none; color: #666; box-shadow: none; font-size: 1.4rem; min-height: 0; padding: 0 0.3rem; }
dialog.modal .m-isi { padding: 1rem 1.2rem; max-height: 70vh; overflow: auto; }
dialog.modal .m-kaki { display: flex; justify-content: flex-end; gap: 0.5rem; padding: 0.8rem 1.2rem; border-top: 1px solid #eee; }
.m-baris { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 0.6rem; align-items: center; margin-bottom: 0.7rem; font-size: 0.9rem; }
.m-baris input, .m-baris select { width: 100%; max-width: none; }
.m-baris small { grid-column: 2; color: var(--muted); font-size: 0.78rem; margin-top: -0.4rem; }
.dt-atas { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.dt-bar { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; font-size: 0.85rem; }
.dt-tombol { display: inline-flex; }
.dt-btn { background: #f3f3f6; color: #333; border: 1px solid #c9c9d3; border-radius: 0; min-height: 28px; padding: 0.15rem 0.7rem; font-size: 0.78rem; font-weight: 500; box-shadow: none; }
.dt-btn:first-child { border-radius: 4px 0 0 4px; }
.dt-btn:last-child { border-radius: 0 4px 4px 0; }
.dt-btn:hover { background: #e6e6ee; color: #111; }
.dt-per select, .dt-cari input { min-width: 0; width: auto; padding: 0.2rem 0.4rem; min-height: 28px; border-radius: 4px; }
.dt-cari input { width: 170px; }
.dt-bawah { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin: 0.6rem 0 1rem; font-size: 0.82rem; color: var(--muted); }
.dt-nav { display: inline-flex; gap: 0.15rem; }
.dt-hal { background: transparent; color: #444; border: 1px solid transparent; border-radius: 4px; min-height: 28px; padding: 0.1rem 0.6rem; font-size: 0.8rem; box-shadow: none; }
.dt-hal:hover:not(:disabled) { background: #e6e6ee; color: #111; }
.dt-hal.aktif { background: #3f3fd9; color: #fff; }
.dt-hal:disabled { opacity: 0.4; cursor: default; }
.aksi-ikon { display: inline-flex; gap: 0.3rem; align-items: center; }
.aksi-ikon form { margin: 0; }
@media (max-width: 900px) { .rdm-profil { grid-template-columns: 1fr; } .m-baris { grid-template-columns: 1fr; } .m-baris small { grid-column: 1; } }
.dt-per, .dt-cari { display: inline-flex; align-items: center; gap: 0.35rem; white-space: nowrap; margin: 0; font-weight: 500; }
.dt-per select { width: 4.2rem; }

/* ---------- Penyesuaian tema untuk halaman dan modal gaya RDM ---------- */
.rdm-kartu .rdm-isi { padding: 1.1rem 1.3rem; }
.rdm-kartu .rdm-kaki { padding: 0.8rem 1.3rem; border-top: 1px solid rgba(120, 110, 170, 0.18); display: flex; justify-content: flex-end; gap: 0.5rem; }
.rdm-kartu .rdm-kepala { padding: 0.9rem 1.3rem; border-bottom: 1px solid rgba(120, 110, 170, 0.18); }
.rdm-kartu .rdm-banner { margin: 0 0 1rem; }
.rdm-kartu fieldset { min-width: 0; }
.rdm-form label { font-weight: 600; }
.rdm-form small { display: block; margin-top: 0.3rem; font-weight: 400; }
.rdm-form input, .rdm-form select { background: rgba(255, 255, 255, 0.85); }
.btn-rdm { border-radius: 10px; box-shadow: 0 8px 18px -10px rgba(43, 123, 228, 0.7); }
.btn-ungu { background: var(--brand); }
.btn-hijau { background: #22a35a; box-shadow: 0 8px 18px -10px rgba(34, 163, 90, 0.7); }
.btn-merah { background: #e0475b; box-shadow: 0 8px 18px -10px rgba(224, 71, 91, 0.7); }
.btn-garis { box-shadow: none; color: var(--brand); border-color: var(--brand); background: rgba(255, 255, 255, 0.7); }
.btn-garis:hover { background: #fff; color: var(--brand-hover); }
.logo-profil .tombol { border-color: var(--brand); border-radius: 10px; }
.rdm-banner { border-radius: 14px; }
.rdm-banner.biru { background: linear-gradient(120deg, #2b7be4, #6b5cf0); }
.rdm-banner.oranye { background: linear-gradient(120deg, #f6b73c, #f0a812); }
.rdm-banner.kuning { background: rgba(255, 241, 214, 0.85); }
.rdm-form input, .rdm-form select, .m-baris input, .m-baris select { border-radius: 12px; }
.inline-form select { min-width: 0; width: auto; }

/* Modal bertema kaca pastel */
dialog.modal {
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 22px;
    background:
        radial-gradient(420px 260px at 0% 0%, rgba(201, 194, 245, 0.55), transparent 70%),
        radial-gradient(420px 260px at 100% 100%, rgba(200, 236, 220, 0.5), transparent 70%),
        rgba(250, 248, 255, 0.92);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    box-shadow: 0 40px 90px -30px rgba(70, 60, 140, 0.55);
    width: min(540px, 94vw);
}
dialog.modal::backdrop { background: rgba(60, 50, 120, 0.28); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
dialog.modal .m-kepala { border-bottom: 1px solid rgba(120, 110, 170, 0.18); padding: 1.1rem 1.5rem; font-size: 1.15rem; letter-spacing: -0.01em; }
dialog.modal .m-kepala button { border-radius: 50%; width: 32px; height: 32px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.7); color: var(--text-soft); }
dialog.modal .m-kepala button:hover { background: #fff; color: var(--text); }
dialog.modal .m-isi { padding: 1.3rem 1.5rem; }
dialog.modal .m-kaki { border-top: 1px solid rgba(120, 110, 170, 0.18); padding: 1rem 1.5rem; }
.m-baris { grid-template-columns: 150px minmax(0, 1fr); margin-bottom: 0.9rem; }
.m-baris label { font-weight: 600; color: var(--text-soft); }
.m-baris input, .m-baris select { background: rgba(255, 255, 255, 0.9); }

/* Upload Guru (dropzone) */
dialog.modal.modal-lebar { width: min(820px, 95vw); }
.m-kepala-aksi { display: inline-flex; align-items: center; gap: 0.6rem; }
.dropzone { display: grid; justify-items: center; gap: 0.5rem; padding: 1.6rem 1rem; border: 2px dashed rgba(43, 123, 228, 0.45); border-radius: 16px; background: rgba(255, 255, 255, 0.6); color: var(--brand); text-align: center; cursor: pointer; margin-bottom: 1rem; transition: background 150ms, border-color 150ms; }
.dropzone:hover, .dropzone.aktif { background: rgba(43, 123, 228, 0.1); border-color: var(--brand); }
.dropzone small { color: var(--muted); font-weight: 400; }
.hasil-unggah td, .hasil-unggah th { padding: 0.55rem 0.6rem; font-size: 0.85rem; }
.dz-bar { width: 90px; height: 8px; border-radius: 99px; background: rgba(43, 123, 228, 0.15); overflow: hidden; }
.dz-bar i { display: block; height: 100%; width: 0; background: var(--brand); transition: width 120ms; }
.dz-ok { color: var(--ok-ink); font-weight: 600; }
.dz-gagal { color: var(--danger-ink); font-weight: 600; }
.dz-rinci { font-size: 0.78rem; color: var(--muted); background: rgba(255, 241, 214, 0.6); }
.baris-nonaktif td { opacity: 0.6; }
.pilih-guru { min-width: 0; width: 100%; max-width: 280px; padding: 0.3rem 0.5rem; min-height: 34px; border-radius: 10px; }
.baris-belum td { opacity: 0.8; }
.nav-logout { margin: 0.3rem 0 0; }
.nav-logout .nav-link { width: 100%; display: flex; align-items: center; gap: 0.7rem; background: transparent; color: var(--text-soft); box-shadow: none; justify-content: flex-start; min-height: 40px; padding: 0.45rem 0.7rem; font-weight: 500; }
.nav-logout .nav-link:hover { background: rgba(255, 255, 255, 0.65); color: var(--danger-ink); }

/* Beranda ala RDM: empat kotak berwarna dan kartu info */
.rdm-kotak-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.1rem; margin-bottom: 1.1rem; }
.rdm-kotak { display: flex; justify-content: space-between; align-items: flex-start; padding: 1.1rem 1.2rem; border-radius: 18px; color: #fff; text-decoration: none; box-shadow: 0 14px 28px -16px rgba(40, 30, 90, 0.6); }
.rdm-kotak:hover { color: #fff; transform: translateY(-2px); }
.rdm-kotak strong { display: block; font-size: 1.9rem; line-height: 1.1; }
.rdm-kotak span { font-size: 0.72rem; letter-spacing: 0.06em; font-weight: 700; opacity: 0.9; }
.rdm-kotak svg { opacity: 0.85; }
.rdm-kotak.biru { background: linear-gradient(135deg, #3b8ff0, #2b6fd6); }
.rdm-kotak.hijau { background: linear-gradient(135deg, #34c06a, #22a35a); }
.rdm-kotak.merah { background: linear-gradient(135deg, #f0606f, #d9435a); }
.rdm-kotak.oranye { background: linear-gradient(135deg, #f8c04b, #f0a812); color: #3b2a00; }
.rdm-kotak.oranye:hover { color: #3b2a00; }
.rdm-info-kartu { background: linear-gradient(120deg, rgba(248, 192, 75, 0.92), rgba(240, 168, 18, 0.9)); color: #3b2a00; border-color: rgba(255, 255, 255, 0.6); }
.rdm-info-kartu .rdm-kepala { border-bottom-color: rgba(59, 42, 0, 0.18); }
.rdm-info-kartu p { margin: 0 0 0.6rem; }
@media (max-width: 1000px) { .rdm-kotak-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.m-dua-kolom { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.4rem; }
.m-baris textarea { width: 100%; border-radius: 12px; background: rgba(255,255,255,.9); }
dialog.modal#m-siswa { width: min(980px, 96vw); }
@media (max-width: 900px) { .m-dua-kolom { grid-template-columns: 1fr; } }
.panel-dua { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; align-items: start; }
.saring-dua { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.6rem; margin-bottom: 0.8rem; }
.saring-dua label { font-size: 0.85rem; font-weight: 600; color: var(--text-soft); }
.saring-dua select { width: 100%; min-width: 0; margin-top: 0.2rem; }
.pilih-siswa tr[data-pilih] { cursor: pointer; }
.pilih-siswa tr.terpilih td { background: #2ea84f !important; color: #fff; }
.rdm-perhatian { margin-top: 0.8rem; padding: 0.8rem 1rem; border-radius: 12px; background: #fde1e5; color: #a12636; text-align: right; font-size: 0.85rem; }
.rdm-perhatian strong { display: block; font-size: 1rem; }
@media (max-width: 1000px) { .panel-dua { grid-template-columns: 1fr; } }

/* KKM tingkat: tabel predikat kecil */
.predikat-mini { width: auto; border-collapse: collapse; background: rgba(255,255,255,.6); border-radius: 8px; }
.predikat-mini th, .predikat-mini td { padding: 0.1rem 0.45rem; border: 0; font-size: 0.82rem; background: transparent; position: static; text-transform: none; letter-spacing: 0; }

/* Status nilai: batang progres */
.progres-baris { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 0.8rem; align-items: center; margin-bottom: 0.7rem; font-size: 0.88rem; }
.progres { position: relative; height: 18px; border-radius: 99px; background: rgba(43, 123, 228, 0.12); overflow: hidden; }
.progres i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #3f3fd9, #2b7be4); border-radius: inherit; }
.progres b { position: relative; display: block; text-align: center; font-size: 0.72rem; line-height: 18px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.35); }

/* ===== Toolbar tabel: Copy / Print / Excel ===== */
.dt-atas { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.dt-tombol { display: inline-flex; padding: 3px; gap: 3px; border-radius: 12px; background: #f1f0f7; border: 1px solid #e4e2ef; }
.dt-btn { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 32px; padding: 0.25rem 0.8rem; border: 0; border-radius: 9px !important;
    background: transparent; color: var(--text-soft); font-size: 0.8rem; font-weight: 600; box-shadow: none; }
.dt-btn svg { width: 15px; height: 15px; flex: none; }
.dt-btn:hover { background: #fff; color: var(--brand); box-shadow: 0 2px 6px -2px rgba(30, 25, 60, 0.18); }
.dt-btn.dt-excel:hover { color: #15803d; }
.dt-btn.dt-print:hover { color: #6d28d9; }
.dt-per select, .dt-cari input { min-height: 34px; border-radius: 10px; border: 1px solid #dcd9ea; background: #fff; padding: 0.25rem 0.6rem; }
.dt-cari input { width: 200px; }
.dt-cari input:focus, .dt-per select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); }

/* ===== Form modal ala RDM: label di kiri, isian di kanan, satu kolom ===== */
dialog.modal { width: min(620px, 94vw); border-radius: 14px; padding: 0; overflow: hidden; background: #fff; border: 1px solid #e5e7eb; box-shadow: 0 30px 70px -25px rgba(30, 25, 60, 0.45); -webkit-backdrop-filter: none; backdrop-filter: none; }
dialog.modal .m-kepala { padding: 1rem 1.4rem; border-bottom: 1px solid #e9e9ef; background: #fff; font-size: 1.1rem; font-weight: 600; color: var(--text); }
dialog.modal .m-kepala button { width: 30px; height: 30px; border-radius: 8px; background: transparent; color: #8a8f9c; font-size: 1.3rem; line-height: 1; }
dialog.modal .m-kepala button:hover { background: #f2f2f6; color: var(--text); }
dialog.modal .m-isi { display: block; padding: 1.2rem 1.4rem 0.6rem; max-height: min(70vh, 640px); overflow: auto; }
dialog.modal .m-isi > * + * { margin-top: 0; }
dialog.modal .m-isi > .rdm-banner, dialog.modal .m-isi > .dropzone, dialog.modal .m-isi > .table-wrap { margin-bottom: 1rem; }
dialog.modal .m-isi form { margin: 0; }

.m-baris { display: grid; grid-template-columns: 34% minmax(0, 1fr); column-gap: 1rem; row-gap: 0.25rem; align-items: center; margin: 0 0 0.85rem; font-size: 0.88rem; }
.m-baris > label { grid-column: 1; margin: 0; padding: 0; font-weight: 500; color: var(--text-soft); text-align: left; }
.m-baris > :not(label):not(small) { grid-column: 2; }
.m-baris > small { grid-column: 2; margin: 0; font-size: 0.74rem; line-height: 1.35; color: var(--muted); }
.m-baris input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .m-baris select, .m-baris textarea {
    width: 100%; max-width: none; min-height: 38px; padding: 0.4rem 0.7rem; border: 1px solid #d9dbe3; border-radius: 6px; background: #fff; font-size: 0.88rem; color: var(--text); box-shadow: none; }
.m-baris textarea { min-height: 70px; resize: vertical; }
.m-baris input:focus, .m-baris select:focus, .m-baris textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.m-baris input[readonly] { background: #f3f4f6; color: var(--muted); }
.m-baris input::placeholder, .m-baris textarea::placeholder { color: #a3a8b4; }
.m-baris > span { display: flex; align-items: center; gap: 0.5rem; min-height: 38px; }
.m-baris input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); }
.m-baris .inline-form { display: flex; gap: 0.5rem; align-items: center; margin: 0; }

dialog.modal .m-isi.m-dua-kolom { display: grid; grid-template-columns: 1fr 1fr; column-gap: 2rem; }
dialog.modal .m-isi.m-dua-kolom .m-baris { grid-template-columns: 38% minmax(0, 1fr); }

dialog.modal .m-kaki { display: flex; justify-content: flex-end; gap: 0.5rem; padding: 0.85rem 1.4rem; border-top: 1px solid #e9e9ef; background: #fff; }
dialog.modal .m-isi .m-kaki { padding: 0.6rem 0 0.6rem; border: 0; }
dialog.modal .m-kaki .btn-rdm { min-width: 0; min-height: 36px; padding: 0.35rem 1rem; border-radius: 6px; font-weight: 600; box-shadow: none; }
dialog.modal .m-kaki .btn-merah { background: #ef5a5a; color: #fff; border: 0; }
dialog.modal .m-kaki .btn-garis { background: #eef0f4; color: var(--text-soft); border: 1px solid #d9dbe3; }

dialog.modal.modal-lebar { width: min(860px, 95vw); }
dialog.modal#m-siswa { width: min(1000px, 96vw); }
@media (max-width: 760px) {
    .m-baris, dialog.modal .m-isi.m-dua-kolom .m-baris { grid-template-columns: 1fr; }
    .m-baris > label, .m-baris > :not(label):not(small), .m-baris > small { grid-column: 1; }
    dialog.modal .m-isi.m-dua-kolom { grid-template-columns: 1fr; }
}

/* ===== Filter ala RDM (Tingkat, Kelas): dua kolom rapat, pilihan selebar kolom ===== */
.rdm-saring { display: grid; grid-template-columns: repeat(2, minmax(0, 320px)); gap: 0.6rem 1.5rem; align-items: end; margin: 0 0 1rem; padding: 0.9rem 1.1rem; }
.rdm-saring label { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; margin: 0; font-size: 0.85rem; font-weight: 600; color: var(--text-soft); }
.rdm-saring select { width: 100%; min-width: 0; min-height: 38px; }
@media (max-width: 640px) { .rdm-saring { grid-template-columns: 1fr; } }

/* ===== Tabel ringkas (Mengajar): baris rapat, pilihan guru selebar kolom ===== */
table.rdm-ringkas td, table.rdm-ringkas th { padding: 0.5rem 0.75rem; vertical-align: middle; }
table.rdm-ringkas td:first-child, table.rdm-ringkas th:first-child { width: 3rem; }
table.rdm-ringkas .pilih-guru { width: 100%; max-width: 300px; min-height: 34px; padding: 0.25rem 0.6rem; border-radius: 8px; font-size: 0.86rem; }
table.rdm-ringkas tr.baris-belum td { opacity: 1; color: var(--muted); }
table.rdm-ringkas form { margin: 0; }

/* ===== Penilaian: filter tiga kolom, tab, dan mode lihat ===== */
.rdm-saring.rdm-saring-tiga { grid-template-columns: repeat(3, minmax(0, 260px)); }
@media (max-width: 760px) { .rdm-saring.rdm-saring-tiga { grid-template-columns: 1fr; } }
.rdm-tabs { margin-top: 0.4rem; }
.rdm-tabs > .tab-bar { display: flex; flex-wrap: wrap; gap: 0.3rem; padding: 4px; margin-bottom: 0.9rem; border-radius: 12px; background: #f1f0f7; border: 1px solid #e4e2ef; width: fit-content; max-width: 100%; }
.rdm-tabs > .tab-bar button { background: transparent; color: var(--text-soft); border: 0; box-shadow: none; min-height: 36px; padding: 0.35rem 1rem; border-radius: 9px; font-weight: 600; font-size: 0.88rem; }
.rdm-tabs > .tab-bar button:hover { background: rgba(255, 255, 255, 0.7); color: var(--brand); }
.rdm-tabs > .tab-bar button.aktif { background: #fff; color: var(--brand); box-shadow: 0 2px 8px -3px rgba(30, 25, 60, 0.25); }
.rdm-tabs [data-tab-panel] > .muted:first-child { margin-top: 0; }
.tabel-isian td, .tabel-isian th { padding: 0.45rem 0.6rem; vertical-align: middle; }
.tabel-isian select, .tabel-isian input[type="text"] { min-height: 34px; padding: 0.25rem 0.5rem; border-radius: 8px; font-size: 0.86rem; width: 100%; min-width: 5.5rem; }
.tabel-isian textarea { width: 100%; min-width: 18rem; min-height: 56px; padding: 0.35rem 0.55rem; border-radius: 8px; font-size: 0.86rem; resize: vertical; }
.tabel-isian td.nama { white-space: nowrap; font-weight: 500; }
.tabel-isian td.is-error select, .tabel-isian td.is-error input, .tabel-isian td.is-error textarea { border-color: var(--danger); }
.tabel-isian .na { color: var(--muted); font-size: 0.8rem; }
.mode-lihat { margin: 0.4rem 0 0.9rem; }
/* Mode lihat: kontrol yang terkunci tampil seperti teks biasa, tidak seperti isian yang bisa diubah. */
fieldset:disabled select, fieldset:disabled input:not([type="checkbox"]):not([type="radio"]), fieldset:disabled textarea {
    -webkit-appearance: none; appearance: none; border: 0 !important; background: transparent !important; box-shadow: none !important;
    padding-left: 0; padding-right: 0; color: var(--text) !important; opacity: 1; cursor: default; resize: none; min-height: 0; }
fieldset:disabled input::placeholder, fieldset:disabled textarea::placeholder { color: transparent; }

/* ===== Penilaian: bar tab sebagai legend (tetap aktif di mode lihat), toolbar nilai, poin presensi ===== */
legend.tab-bar { float: none; display: flex; }
.tab-bar.tab-lepas { display: flex; flex-wrap: wrap; gap: 0.3rem; padding: 4px; border-radius: 12px; background: #f1f0f7; border: 1px solid #e4e2ef; width: fit-content; }
.tab-bar.tab-lepas button { background: transparent; color: var(--text-soft); border: 0; box-shadow: none; min-height: 36px; padding: 0.35rem 1rem; border-radius: 9px; font-weight: 600; font-size: 0.88rem; }
.tab-bar.tab-lepas button:hover { background: rgba(255, 255, 255, 0.7); color: var(--brand); }
.tab-bar.tab-lepas button.aktif { background: #fff; color: var(--brand); box-shadow: 0 2px 8px -3px rgba(30, 25, 60, 0.25); }
.nilai-alat { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.8rem; margin: 0.6rem 0 0.6rem; }
.nilai-alat .rdm-aksi { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.nilai-alat .inline-form { display: flex; gap: 0.4rem; align-items: center; margin: 0; }
.nilai-alat input[type="file"] { font-size: 0.82rem; max-width: 15rem; }
fieldset.poin-presensi { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.8rem 1.2rem; align-items: flex-end; }
fieldset.poin-presensi label { display: flex; flex-direction: column; gap: 0.3rem; margin: 0; font-size: 0.85rem; font-weight: 600; color: var(--text-soft); }
fieldset.poin-presensi input { width: 6rem !important; min-height: 36px; }
.rdm-banner.mode-lihat { background: #eef3ff; color: #1e3a8a; border: 1px solid #c9d8ff; box-shadow: none; font-size: 0.88rem; padding: 0.6rem 0.9rem; }
.row-actions .btn-rdm { text-decoration: none; }

/* ===== Label kuning semester (RDM): klik untuk membuka modal Ubah Semester ===== */
.semester-cepat .semester-label { display: block; width: 100%; text-align: center; padding: 0.4rem 0.7rem; border: 0; border-radius: 10px; min-height: 0;
    background: #f9d44a; color: #4a3500; font-weight: 700; font-size: 0.85rem; box-shadow: 0 6px 14px -8px rgba(180, 140, 0, 0.8); }
.semester-cepat button.semester-label { cursor: pointer; }
.semester-cepat button.semester-label:hover { background: #f5c928; color: #3b2a00; }

/* ===== Modul guru (docs/sprint_guru.md) ===== */
.nav-kosong { font-size: 0.8rem; color: var(--muted); padding: 0.2rem 0.7rem; margin: 0; }
.nav-link-status { display: flex !important; align-items: center; justify-content: space-between; gap: 0.5rem; }
.nav-status { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.nav-status.st-draft { background: #ef4444; }
.nav-status.st-terkirim, .nav-status.st-terkunci { background: #22c55e; }
.guru-bar { margin: 0.2rem 0 1rem; }
.guru-bar a { display: inline-flex; align-items: center; gap: 0.35rem; text-decoration: none; color: var(--text-soft); min-height: 38px; padding: 0.4rem 1rem; border-radius: 9px; font-weight: 600; font-size: 0.9rem; }
.guru-bar a:hover { background: rgba(255, 255, 255, 0.7); color: var(--brand); }
.guru-bar a.aktif { background: #fff; color: var(--brand); box-shadow: 0 2px 8px -3px rgba(30, 25, 60, 0.25); }
.guru-dua { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 1rem; align-items: start; }
.guru-ikon-kelas { width: 96px; height: 96px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; font-size: 2.6rem; background: linear-gradient(135deg, #bfe3ff, #8cc8ff); }
.guru-rincian { display: grid; grid-template-columns: max-content 1fr; gap: 0.55rem 1.2rem; margin: 0; font-size: 0.9rem; }
.guru-rincian dt { color: var(--muted); font-weight: 600; }
.guru-rincian dd { margin: 0; text-align: right; color: var(--brand-ink); }
.guru-rincian-lebar dd { text-align: left; color: var(--text); }
.guru-rincian-lebar dt, .guru-rincian-lebar dd { padding-bottom: 0.5rem; border-bottom: 1px solid #eeecf6; }
.guru-kepala { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.guru-kepala .rdm-aksi { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
.btn-oranye { background: #f59e0b; color: #fff; }
.btn-oranye:hover { background: #d97706; color: #fff; }
.rdm-banner.ungu-muda { background: #ece9ff; color: #4338ca; border: 1px solid #d6d1ff; font-size: 0.85rem; padding: 0.6rem 0.8rem; }
.tabel-predikat { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.tabel-predikat th { background: #e9e8f1; text-align: left; padding: 0.45rem 0.6rem; }
.tabel-predikat td { padding: 0.45rem 0.6rem; border-bottom: 1px solid #eeecf6; }
tr.baris-aktif td { background: #f3f8ff; }
th.kolom-ph { white-space: nowrap; }
.kolom-aksi { display: inline-flex; gap: 0.15rem; margin-left: 0.3rem; vertical-align: middle; }
.kolom-aksi form { margin: 0; display: inline; }
.ikon-kecil { min-height: 0; min-width: 0; width: 22px; height: 22px; padding: 0; border-radius: 6px; font-size: 0.75rem; line-height: 1; background: #eef1ff; color: var(--brand); border: 0; box-shadow: none; cursor: pointer; }
.ikon-kecil.merah { background: #fde8ea; color: #c0263a; }
.dropzone-form input[type="file"] { margin: 0.3rem auto; }
.guru-dash { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 1rem; align-items: start; }
.guru-dash-kiri, .guru-dash-kanan { display: grid; gap: 1rem; }
.guru-foto { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 4px solid #e7f0ff; display: inline-block; }
.guru-foto-huruf { display: inline-grid; place-items: center; font-size: 3rem; font-weight: 700; color: #fff; background: linear-gradient(135deg, #7c6cf0, var(--brand)); }
.tabel-kelas-anda th, .tabel-kelas-anda td { padding: 0.5rem 0.7rem; }
@media (max-width: 900px) { .guru-dua, .guru-dash { grid-template-columns: 1fr; } }

/* Bobot guru (RDM) */
fieldset.bobot-kotak { border: 1px solid #e4e2ef; border-radius: 10px; padding: 0.7rem 1rem 0.9rem; margin: 0.4rem 0 0; }
fieldset.bobot-kotak > legend { font-weight: 700; font-size: 0.88rem; padding: 0 0.4rem; color: var(--text-soft); }
.bobot-isi { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0.8rem; }
.bobot-isi label { display: flex; flex-direction: column; gap: 0.3rem; margin: 0; font-size: 0.85rem; font-weight: 600; color: var(--text-soft); }
.bobot-isi input { max-width: 7rem; min-height: 36px; }
.bobot-isi small { font-weight: 400; color: var(--muted); }

/* ===== Wali kelas (RDM) ===== */
input.input-kunci, .modal .m-baris input.input-kunci, .modal input[readonly].input-kunci { background: #e4e4ea !important; color: #555; cursor: not-allowed; }
.menu-lain { position: relative; display: inline-block; }
.menu-lain > summary { list-style: none; cursor: pointer; }
.menu-lain > summary::-webkit-details-marker { display: none; }
.menu-lain-isi { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 9rem; background: #fff; border: 1px solid #e4e2ef; border-radius: 10px; box-shadow: 0 10px 24px -12px rgba(30, 30, 60, .35); padding: .3rem; }
.menu-lain-isi a { display: block; padding: .4rem .6rem; border-radius: 6px; color: inherit; text-decoration: none; font-size: .85rem; white-space: nowrap; }
.menu-lain-isi a:hover { background: #f1f0f7; }
@media print { .tanpa-cetak { display: none !important; } }
.aksi-ikon .btn-rdm { white-space: nowrap; }

/* ===== Tombol tabel Copy / Print / Excel: lebih besar dan berwarna ===== */
.dt-tombol { gap: 6px; padding: 0; background: transparent; border: 0; }
.dt-btn { min-height: 40px; padding: 0.45rem 1.1rem; font-size: 0.92rem; color: #fff !important; border-radius: 10px !important; box-shadow: 0 6px 14px -8px rgba(20, 20, 50, .55); }
.dt-btn svg { width: 18px; height: 18px; }
.dt-btn.dt-copy { background: #2b7be4; }
.dt-btn.dt-print { background: #7c3aed; }
.dt-btn.dt-excel { background: #16a34a; }
.dt-btn:hover { filter: brightness(1.08); transform: translateY(-1px); color: #fff !important; }
.dt-btn.dt-copy:hover { background: #2b7be4; }
.dt-btn.dt-print:hover { background: #7c3aed; }
.dt-btn.dt-excel:hover { background: #16a34a; }
@media print { .dt-tombol { display: none; } }
