/* =========================================================
   Lembar Guru app design system (teacher, student, admin panels).
   Same language as the public site: graphite, red pen, marker.
   ========================================================= */

@font-face {
    font-family: "Jakarta";
    src: url("../fonts/jakarta-var.woff2") format("woff2");
    font-weight: 200 800;
    font-display: swap;
}

:root {
    /* Lembar Guru: graphite (pencil 2B), red pen, marker yellow. */
    --brand: #23252b;
    --brand-dark: #000000;
    --brand-soft: #fff4c2;
    --brand-soft-text: #5c4800;
    --pen: #d42a3c;
    --marker: #ffe14a;
    --ljk: #f2a9b3;

    --success: #12805a;
    --success-soft: #e6f4ee;
    --warning: #9a6200;
    --warning-soft: #fff3d6;
    --danger: #c0182b;
    --danger-soft: #fdedef;

    --sidebar-bg: #23252b;
    --sidebar-text: #c9ced8;
    --sidebar-muted: #8a909c;
    --sidebar-active-bg: rgba(255, 255, 255, 0.08);

    --body-bg: #f1f4f7;
    --card-bg: #ffffff;
    --border: #e3e7ec;
    --text: #23252b;
    --text-muted: #5e6472;

    --radius: 12px;
    --shadow-sm: 0 1px 2px rgba(35, 37, 43, 0.05);
    --shadow: 0 10px 30px -18px rgba(35, 37, 43, 0.35);

    /* Bootstrap's own blues, replaced. */
    --bs-primary: #23252b;
    --bs-primary-rgb: 35, 37, 43;
    --bs-link-color: #23252b;
    --bs-link-color-rgb: 35, 37, 43;
    --bs-link-hover-color: #d42a3c;
    --bs-link-hover-color-rgb: 212, 42, 60;
    --bs-focus-ring-color: rgba(255, 225, 74, 0.7);
    --bs-body-font-family: "Jakarta", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: "Jakarta", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    background: var(--body-bg);
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.6;
}

a {
    text-decoration: none;
}

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

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 264px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    overflow-y: auto;
}

.app-sidebar .brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 1.4rem 1.4rem 1.2rem;
    color: #fff;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.app-sidebar .brand-logo { height: 28px; width: auto; display: block; }

.app-sidebar .brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #23252b;
    color: #fff;
    font-size: 1.1rem;
    flex: 0 0 auto;
}

.app-sidebar .nav {
    padding: 1rem 0.8rem;
    flex: 1;
}

.app-sidebar .nav-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sidebar-muted);
    padding: 0.4rem 0.75rem;
    margin-top: 0.4rem;
}

.app-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--sidebar-text);
    padding: 0.65rem 0.8rem;
    border-radius: 10px;
    margin-bottom: 0.15rem;
    transition: background 0.15s ease, color 0.15s ease;
}

.app-sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.app-sidebar .nav-link.active {
    background: var(--sidebar-active-bg);
    color: #fff;
    font-weight: 600;
}

.app-sidebar .nav-link i {
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
}

.app-sidebar .sidebar-footer {
    padding: 1rem 1.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.8rem;
    color: var(--sidebar-muted);
}

.app-main {
    margin-left: 264px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    padding: 0.85rem 1.6rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.app-topbar .page-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.app-content {
    padding: 1.6rem;
    flex: 1;
}

/* ---------- Cards ---------- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

/* ---------- Buttons ---------- */
.btn {
    border-radius: 10px;
    font-weight: 500;
}

.btn-primary {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-dark);
    --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-bg: var(--brand-dark);
    --bs-btn-active-border-color: var(--brand-dark);
    box-shadow: 0 4px 12px rgba(35, 37, 43, 0);
}

.btn-outline-primary {
    --bs-btn-color: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand);
    --bs-btn-hover-border-color: var(--brand);
    --bs-btn-active-bg: var(--brand);
    --bs-btn-active-border-color: var(--brand);
}

/* ---------- Stat cards ---------- */
.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    height: 100%;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex: 0 0 auto;
}

.stat-card .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.bg-brand-soft {
    background: var(--brand-soft);
    color: var(--brand-soft-text);
}

.bg-success-soft {
    background: var(--success-soft);
    color: var(--success);
}

.bg-warning-soft {
    background: var(--warning-soft);
    color: var(--warning);
}

.bg-danger-soft {
    background: var(--danger-soft);
    color: var(--danger);
}

/* ---------- Tables ---------- */
.table {
    --bs-table-bg: transparent;
    margin-bottom: 0;
}

.table thead th {
    background: #f8fafc;
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table tbody td {
    vertical-align: middle;
    border-color: var(--border);
}

/* ---------- Badges ---------- */
.badge {
    font-weight: 500;
    border-radius: 999px;
    padding: 0.4em 0.7em;
}

.badge-soft-primary {
    background: var(--brand-soft);
    color: var(--brand-soft-text);
}

.badge-soft-success {
    background: var(--success-soft);
    color: var(--success);
}

.badge-soft-warning {
    background: var(--warning-soft);
    color: var(--warning);
}

.badge-soft-secondary {
    background: #eef0f4;
    color: #5b6472;
}

.badge-soft-danger {
    background: var(--danger-soft);
    color: var(--danger);
}

/* ---------- Forms ---------- */
.form-control,
.form-select {
    border-radius: 10px;
    border-color: var(--border);
    padding: 0.55rem 0.8rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(255, 225, 74, 0.7);
}

.form-label {
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.4rem;
}

/* ---------- Login ---------- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 45%, #e0e7ff 100%);
}

.login-card {
    width: 100%;
    max-width: 430px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 2.2rem;
}

.login-card .login-brand {
    text-align: center;
    margin-bottom: 1.6rem;
}

.login-card .login-logo { display: block; color: #23252b; margin: 0 0 .9rem; line-height: 1; }
.login-card .login-logo svg { height: 40px; width: auto; }

.login-card .login-brand-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #23252b;
    color: #fff;
    font-size: 1.6rem;
    margin-bottom: 0.9rem;
}

/* ---------- Login: kartu info akun (tahap deploy) ---------- */
.login-demo {
    background: var(--brand-soft);
    border: 1px dashed #c7d2fe;
    border-radius: var(--radius);
    padding: 0.85rem 0.9rem;
    margin-bottom: 1.4rem;
}

.login-demo__head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--brand-soft-text);
    margin-bottom: 0.7rem;
}

.login-demo__tag {
    margin-left: auto;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: none;
    color: #fff;
    background: var(--brand);
    border-radius: 999px;
    padding: 0.15rem 0.5rem;
}

.login-demo__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.login-demo__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    background: #fff;
    border: 1px solid #e0e7ff;
    border-radius: 10px;
    padding: 0.42rem 0.6rem;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.login-demo__item:hover,
.login-demo__item.is-active {
    border-color: var(--brand);
    box-shadow: 0 2px 10px rgba(35, 37, 43, 0.12);
    transform: translateY(-1px);
}

.login-demo__role {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text);
}

.login-demo__role i {
    color: var(--brand);
    font-size: 0.85rem;
}

.login-demo__user {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--brand-dark);
    background: var(--brand-soft);
    border-radius: 6px;
    padding: 0.12rem 0.45rem;
}

.login-demo__foot {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.7rem;
    padding-top: 0.65rem;
    border-top: 1px dashed #c7d2fe;
    font-size: 0.74rem;
    color: var(--text-muted);
}

.login-demo__foot i {
    color: var(--brand);
}

.login-demo__foot code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 700;
    font-size: 0.76rem;
    color: var(--brand-dark);
    background: #fff;
    border: 1px solid #e0e7ff;
    border-radius: 6px;
    padding: 0.1rem 0.42rem;
}

@media (max-width: 400px) {
    .login-demo__item {
        padding: 0.4rem 0.5rem;
    }

    .login-demo__role {
        font-size: 0.72rem;
    }

    .login-demo__user {
        font-size: 0.7rem;
    }
}

/* ---------- Exam question navigation ---------- */
.question-nav {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
    gap: 0.5rem;
}

.question-nav .q-btn {
    aspect-ratio: 1;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    font-weight: 600;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.question-nav .q-btn:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.question-nav .q-btn.answered {
    background: var(--brand-soft);
    border-color: var(--brand);
    color: var(--brand);
}

.question-nav .q-btn.flagged {
    background: var(--warning-soft);
    border-color: var(--warning);
    color: var(--warning);
}

.question-nav .q-btn.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

/* ---------- Exam option ---------- */
.exam-option {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 1rem 1.1rem;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    background: #fff;
}

.exam-option:hover {
    border-color: var(--brand);
    background: var(--brand-soft);
}

.exam-option.selected {
    border-color: var(--brand);
    background: var(--brand-soft);
}

.exam-option .option-letter {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #f1f5f9;
    color: var(--text-muted);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.exam-option.selected .option-letter {
    background: var(--brand);
    color: #fff;
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    /* Sidebar mobile dirender sebagai offcanvas Bootstrap.
       .app-sidebar memaksa z-index 1040, sama dengan .offcanvas-backdrop,
       sehingga tirai menutupi sidebar dan tap menu tidak tembus.
       Naikkan di atas backdrop + offcanvas supaya menu bisa diklik. */
    .app-sidebar.offcanvas {
        z-index: 1055;
    }

    .app-sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

    .app-sidebar.show {
        transform: translateX(0);
    }

    .app-main {
        margin-left: 0;
    }
}

@media (max-width: 575.98px) {
    .app-topbar {
        padding: 0.7rem 1rem;
    }

    .app-content {
        padding: 1rem;
    }
}

/* Allow flex children to shrink so long names truncate instead of overflowing. */
.min-w-0 { min-width: 0; }

/* ── Question editor ── */
.editor-shell .ql-toolbar.ql-snow { border-radius: var(--radius) var(--radius) 0 0; border-color: var(--border); background: #fff; position: sticky; top: 0; z-index: 2; }
.editor-shell .ql-container.ql-snow { border-radius: 0 0 var(--radius) var(--radius); border-color: var(--border); font-size: 1rem; font-family: inherit; }
.editor-shell .ql-editor { min-height: 140px; line-height: 1.6; }
.editor-shell .ql-editor img { max-width: 100%; height: auto; border-radius: 8px; }
.option-row { display: grid; grid-template-columns: auto 1fr auto; gap: .5rem; align-items: start; padding: .5rem; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.option-row:has(.option-correct:checked) { border-color: var(--success); background: var(--success-soft); }
.option-key { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding-top: .35rem; cursor: pointer; min-width: 2rem; }
.option-key .form-check-input { width: 1.35rem; height: 1.35rem; margin: 0; }
.option-letter { font-weight: 700; font-size: .8rem; color: var(--text-muted); }
.option-body { display: grid; gap: .4rem; min-width: 0; }
.option-image { position: relative; max-width: 220px; }
.option-image img { width: 100%; border-radius: 8px; border: 1px solid var(--border); display: block; }
.option-image-remove { position: absolute; top: 4px; right: 4px; padding: .1rem .35rem; }
.option-actions { display: flex; flex-direction: column; gap: .35rem; }
@media (min-width: 576px) { .option-actions { flex-direction: row; } }
.question-excerpt img, .q-card__text img, .opt__image img { max-width: 100%; height: auto; border-radius: 10px; }

/* ── Exam wizard steps ── */
.exam-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; }
.exam-step { display: flex; align-items: center; gap: .45rem; padding: .5rem .6rem; border-radius: 12px; background: #fff; border: 1px solid var(--border); color: var(--text-muted); text-decoration: none; font-size: .85rem; min-width: 0; }
.exam-step__num { flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; background: var(--body-bg); font-weight: 700; font-size: .8rem; }
.exam-step__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exam-step.current { border-color: var(--brand); color: var(--brand); font-weight: 600; }
.exam-step.current .exam-step__num { background: var(--brand); color: #fff; }
.exam-step.done .exam-step__num { background: var(--success-soft); color: var(--success); }
a.exam-step:hover { border-color: var(--brand); color: var(--brand); }
@media (max-width: 575.98px) { .exam-steps { display: flex; } .exam-step { flex: 0 0 auto; justify-content: center; } .exam-step__label { display: none; } .exam-step.current { flex: 1 1 auto; } .exam-step.current .exam-step__label { display: inline; } }

/* Plans (9.5) */
.plan-card {
    border-radius: 1rem;
}

.plan-card--featured {
    border: 2px solid var(--brand);
    box-shadow: 8px 8px 0 #ffe14a;
}

.plan-periods .nav-link {
    border-radius: 999px;
}

.paywall-card {
    background: #fff9dc;
    border-radius: 1rem;
}

/* Onboarding checklist (3.4) */
.onboarding-card {
    border: 1px solid var(--brand-soft);
    background: linear-gradient(180deg, var(--brand-soft), #fff 70%);
}

.onboarding-step {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem .75rem;
    border-radius: .75rem;
    background: #fff;
    border: 1px solid #eef0f4;
    color: inherit;
    text-decoration: none;
}

.onboarding-step:hover {
    border-color: var(--brand);
}

.onboarding-step__dot {
    flex: 0 0 2rem;
    height: 2rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    background: var(--brand-soft);
    color: var(--brand);
}

.onboarding-step.is-done {
    opacity: .7;
}

.onboarding-step.is-done .onboarding-step__dot {
    background: #16a34a;
    color: #fff;
}

/* Admin acting as a teacher (10.2) */
.impersonation-bar {
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem 1rem;
    background: #7c2d12;
    color: #fff;
    font-size: .85rem;
}

/* ---------- Submit loading (app.js initSubmitLoading) ---------- */
button.is-loading { cursor: progress; display: inline-flex; align-items: center; justify-content: center; }
button.is-loading:disabled { opacity: .85; }


/* =========================================================
   Lembar Guru theme layer: components and Bootstrap overrides
   ========================================================= */
:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; box-shadow: 0 0 0 6px var(--marker) !important; }

a { color: var(--text); }
a:hover { color: var(--pen); }
.app-content a:not([class]), .app-content .card-body p a, .app-content .form-text a, .app-content .alert a:not(.btn) {
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(212, 42, 60, 0.45);
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-weight: 800; letter-spacing: -0.015em; color: var(--text); }

/* Sidebar */
.app-sidebar .brand { padding: 1.35rem 1.4rem 1.15rem; }
.app-sidebar .nav-label { text-transform: none; letter-spacing: 0; font-size: 0.78rem; font-weight: 600; color: var(--sidebar-muted); padding: 0.9rem 0.8rem 0.3rem; margin-top: 0; }
.app-sidebar .nav-link { position: relative; font-weight: 500; border-radius: 8px; padding: 0.62rem 0.8rem; }
.app-sidebar .nav-link.active { background: var(--sidebar-active-bg); color: #fff; font-weight: 700; }
.app-sidebar .nav-link.active::before { content: ""; position: absolute; left: -0.8rem; top: 0.5rem; bottom: 0.5rem; width: 4px; border-radius: 0 4px 4px 0; background: var(--marker); }
.app-sidebar .nav-link.active i { color: var(--marker); }
.app-sidebar .sidebar-footer { color: var(--sidebar-muted); }

/* Top bar */
.app-topbar { background: rgba(255, 255, 255, 0.92); }
.app-topbar .page-title { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.015em; }
.app-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--text); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.9rem; flex: none; }

/* Cards */
.card { border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-header { font-weight: 800; letter-spacing: -0.005em; padding: 0.95rem 1.2rem; }
.card-footer { background: #fbfcfd; border-top-color: var(--border); }

/* Buttons */
.btn { border-radius: 8px; font-weight: 700; padding: 0.5rem 0.95rem; transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, color 0.15s ease; }
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.85rem; }
.btn-lg { padding: 0.7rem 1.25rem; }
.btn-primary {
    --bs-btn-bg: #23252b; --bs-btn-border-color: #23252b; --bs-btn-color: #fff;
    --bs-btn-hover-bg: #000; --bs-btn-hover-border-color: #000; --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #000; --bs-btn-active-border-color: #000;
    --bs-btn-disabled-bg: #6b707b; --bs-btn-disabled-border-color: #6b707b;
    box-shadow: none;
}
.btn-primary:hover { box-shadow: 0 3px 0 var(--marker); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(1px); box-shadow: none; }
.btn-outline-primary {
    --bs-btn-color: #23252b; --bs-btn-border-color: #23252b;
    --bs-btn-hover-bg: #23252b; --bs-btn-hover-border-color: #23252b; --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #000; --bs-btn-active-border-color: #000;
    border-width: 2px;
}
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: #d5dbe2; --bs-btn-color: #23252b; --bs-btn-hover-bg: #f1f4f7; --bs-btn-hover-border-color: #b9c1cc; --bs-btn-active-bg: #e8ecf1; }
.btn-dark { --bs-btn-bg: #23252b; --bs-btn-border-color: #23252b; }
.btn-success { --bs-btn-bg: #12805a; --bs-btn-border-color: #12805a; --bs-btn-hover-bg: #0d6a4a; --bs-btn-hover-border-color: #0d6a4a; }
.btn-outline-danger { --bs-btn-color: #c0182b; --bs-btn-border-color: #c0182b; --bs-btn-hover-bg: #c0182b; --bs-btn-hover-border-color: #c0182b; }
.btn-link { --bs-btn-color: #23252b; --bs-btn-hover-color: #d42a3c; text-decoration: underline; text-decoration-color: rgba(212, 42, 60, 0.45); text-underline-offset: 3px; }

/* Forms */
.form-control, .form-select { border: 1.5px solid #cdd3dc; border-radius: 8px; min-height: 44px; }
.form-control-sm, .form-select-sm { min-height: 34px; }
.form-control:hover, .form-select:hover { border-color: #aab2be; }
.form-control:focus, .form-select:focus { border-color: #23252b; box-shadow: 0 0 0 4px rgba(255, 225, 74, 0.7); }
.form-label { font-weight: 700; font-size: 0.9rem; }
.form-text { color: var(--text-muted); }
.form-check-input { border: 2px solid #8a909c; }
.form-check-input:checked { background-color: #23252b; border-color: #23252b; }
.form-check-input:focus { border-color: #23252b; box-shadow: 0 0 0 4px rgba(255, 225, 74, 0.7); }
.form-switch .form-check-input:focus { --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%2323252b'/%3e%3c/svg%3e"); }
.input-group-text { border: 1.5px solid #cdd3dc; background: #f6f8fa; }

/* Tables */
.table thead th { background: #f6f8fa; color: var(--text-muted); font-size: 0.78rem; font-weight: 700; text-transform: none; letter-spacing: 0; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #f8f9fb; }

/* Badges */
.badge { font-weight: 700; border-radius: 6px; padding: 0.35em 0.6em; }
.badge-soft-primary { background: #eceef2; color: #23252b; }
.badge-soft-warning { background: var(--warning-soft); color: var(--warning); }
.bg-primary { background-color: #23252b !important; }
.text-primary { color: #23252b !important; }
.border-primary { border-color: #23252b !important; }

/* Alerts */
.alert { border: 0; border-radius: 10px; box-shadow: inset 4px 0 0 currentColor; }
.alert-success { background: #e6f4ee; color: #0b5a3f; }
.alert-danger { background: #fdedef; color: #8f1525; }
.alert-warning { background: #fff3d6; color: #6b4500; }
.alert-info, .alert-primary { background: #fff9dc; color: #4d3d00; box-shadow: inset 4px 0 0 var(--marker); }
.alert-light, .alert-secondary { background: #f1f4f7; color: #23252b; box-shadow: inset 4px 0 0 #b9c1cc; }

/* Bootstrap components that default to blue */
.nav-pills { --bs-nav-pills-link-active-bg: #23252b; --bs-nav-link-color: #23252b; --bs-nav-link-hover-color: #d42a3c; }
.nav-tabs { --bs-nav-tabs-link-active-color: #23252b; --bs-nav-link-color: #5e6472; --bs-nav-link-hover-color: #23252b; }
.nav-tabs .nav-link.active { font-weight: 700; box-shadow: inset 0 -3px 0 var(--marker); }
.progress { --bs-progress-bar-bg: #23252b; --bs-progress-bg: #e8ecf1; border-radius: 999px; }
.list-group { --bs-list-group-active-bg: #23252b; --bs-list-group-active-border-color: #23252b; }
.dropdown-menu { --bs-dropdown-link-active-bg: #23252b; --bs-dropdown-link-active-color: #fff; border-radius: 10px; border-color: var(--border); box-shadow: var(--shadow); }
.pagination { --bs-pagination-color: #23252b; --bs-pagination-hover-color: #23252b; --bs-pagination-focus-color: #23252b; --bs-pagination-active-bg: #23252b; --bs-pagination-active-border-color: #23252b; --bs-pagination-focus-box-shadow: 0 0 0 4px rgba(255, 225, 74, 0.7); }
.accordion { --bs-accordion-active-bg: #f6f8fa; --bs-accordion-active-color: #23252b; --bs-accordion-btn-focus-box-shadow: 0 0 0 4px rgba(255, 225, 74, 0.7); }
.offcanvas.app-sidebar { --bs-offcanvas-width: 284px; }

/* Wizard steps & exam nav in the new colours */
.exam-step.current { border-color: #23252b; color: #23252b; box-shadow: inset 0 -3px 0 var(--marker); }
.exam-step.current .exam-step__num { background: #23252b; color: #fff; }
a.exam-step:hover { border-color: #23252b; color: #23252b; }

/* Plans, paywall, onboarding */
.plan-card--featured { border: 2px solid #23252b; box-shadow: 8px 8px 0 var(--marker); }
.paywall-card { background: #fff9dc; border: 1px dashed #c9a227; }
.onboarding-card { border: 1px solid var(--border); background: #fff; }
.onboarding-step:hover { border-color: #23252b; }
.onboarding-step__dot { background: #f1f4f7; color: #23252b; border: 2px solid #23252b; }
.onboarding-step.is-done .onboarding-step__dot { background: #12805a; border-color: #12805a; color: #fff; }

/* Empty state helper */
.empty-state { text-align: center; padding: 2.5rem 1.25rem; color: var(--text-muted); }
.empty-state i { font-size: 2rem; color: #b9c1cc; display: block; margin-bottom: 0.5rem; }
.empty-state strong { display: block; color: var(--text); font-size: 1.05rem; margin-bottom: 0.25rem; }

/* Stat cards */
.stat-card .stat-icon { border-radius: 10px; }
.stat-card .stat-value { font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
    .btn { transition: none; }
    .btn-primary:hover { transform: none; }
}

/* Flash messages: icon + text, errors stay until closed */
.app-flash { display: flex; align-items: flex-start; gap: 0.6rem; }
.app-flash > i { font-size: 1.1rem; line-height: 1.4; flex: none; }
.app-flash > span { flex: 1; padding-right: 1.5rem; }

/* Teacher home */
.dash-hello { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 1.5rem; margin-bottom: 1.25rem; }
.dash-hello__title { font-size: clamp(1.4rem, 3.5vw, 1.9rem); font-weight: 800; letter-spacing: -0.025em; margin: 0 0 0.2rem; }
.dash-hello__sub { color: var(--text-muted); margin: 0; }
.dash-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
@media (max-width: 575.98px) {
    .dash-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
    .dash-actions .btn-primary { grid-column: 1 / -1; min-height: 48px; }
}
.dash-live { border: 2px solid var(--text); }
.dash-live__dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 0 rgba(18, 128, 90, 0.5); animation: dash-live 1.8s ease-out infinite; }
@keyframes dash-live { 70% { box-shadow: 0 0 0 7px rgba(18, 128, 90, 0); } 100% { box-shadow: 0 0 0 0 rgba(18, 128, 90, 0); } }
.dash-exam { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.85rem 1.2rem; }
.dash-exam__name { font-weight: 700; color: var(--text); }
.dash-exam__link { text-decoration: none; }
.dash-exam__link:hover { color: var(--pen); }
.dash-exam__meta { font-size: 0.84rem; color: var(--text-muted); display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin-top: 0.15rem; }
.dash-exam__actions { flex: none; }
.stat-card--link { color: var(--text); text-decoration: none; transition: border-color 0.15s ease, transform 0.15s ease; }
.stat-card--link:hover { color: var(--text); border-color: #b9c1cc; transform: translateY(-1px); }
.stat-card { flex-direction: row; }
.stat-card .stat-icon { background: #f1f4f7; color: var(--text); }
.stat-card--link:hover .stat-icon { background: var(--marker); }
@media (prefers-reduced-motion: reduce) { .dash-live__dot { animation: none; } .stat-card--link:hover { transform: none; } }

/* Filter bars: fields sit side by side instead of each taking a full row */
form.d-flex > .form-control, form.d-flex > .form-select { width: auto; flex: 1 1 200px; }
form.d-flex > .btn { flex: none; }
.app-content code { color: var(--text); background: #f1f4f7; border-radius: 4px; padding: 0.1em 0.35em; font-size: 0.85em; }

/* =========================================================
   Lembar Guru shell v2: notebook margin rail, big page heads,
   phone tab bar. Mirrors the public site.
   ========================================================= */
@font-face {
    font-family: "Pen";
    src: url("../fonts/kalam-700.woff2") format("woff2");
    font-weight: 700;
    font-display: swap;
}

body.app { background: var(--body-bg); }

.rail {
    position: fixed;
    inset: 0 auto 0 0;
    width: 248px;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: 1.4rem 0.9rem 1rem;
    background: #fff;
    border-right: 1px solid var(--border);
    overflow-y: auto;
}
/* A red margin line, like the left edge of a notebook page. */
.rail::after { content: ""; position: absolute; top: 0; bottom: 0; right: 10px; width: 1.5px; background: rgba(212, 42, 60, 0.18); pointer-events: none; }
.rail__logo { display: inline-flex; color: var(--text); padding: 0 0.55rem; }
.rail__logo-svg { height: 30px; width: auto; }
.rail__workspace {
    display: flex; align-items: center; gap: 0.5rem; width: 100%;
    font-size: 0.82rem; font-weight: 600; color: var(--text-muted);
    background: var(--body-bg); border: 0; border-radius: 8px; padding: 0.5rem 0.65rem; text-align: left;
}
.rail__workspace--switch:hover { color: var(--text); background: #e8ecf1; }
.rail__nav { display: flex; flex-direction: column; gap: 2px; margin-top: 0.3rem; }
.rail__link {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.62rem 0.65rem; border-radius: 8px;
    color: var(--text-muted); font-weight: 600; font-size: 0.95rem; text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.rail__link i { font-size: 1.1rem; width: 1.3rem; text-align: center; }
.rail__link:hover { background: var(--body-bg); color: var(--text); }
.rail__link.is-active { color: var(--text); font-weight: 800; }
/* The active page is "highlighted with a marker". */
.rail__link.is-active span { background: linear-gradient(transparent 55%, var(--marker) 55%, var(--marker) 92%, transparent 92%); padding: 0 0.15rem; margin: 0 -0.15rem; }
.rail__user { margin-top: auto; display: flex; align-items: center; gap: 0.6rem; padding: 0.9rem 0.4rem 0; border-top: 1px solid var(--border); }
.rail__user-text { display: flex; flex-direction: column; flex: 1; line-height: 1.25; }
.rail__user-name { font-weight: 700; font-size: 0.88rem; color: var(--text); }
.rail__user-role { font-size: 0.75rem; color: var(--text-muted); }
.rail__logout { width: 38px; height: 38px; border: 0; border-radius: 8px; background: none; color: var(--text-muted); font-size: 1.1rem; }
.rail__logout:hover { background: var(--danger-soft); color: var(--danger); }
.rail--sheet { width: 290px !important; padding-top: 1.1rem; }
.rail--sheet.offcanvas { z-index: 1055; }
.rail__close { position: absolute; top: 0.85rem; right: 1.2rem; width: 40px; height: 40px; border: 0; border-radius: 8px; background: var(--body-bg); color: var(--text); z-index: 2; }

.app-main { margin-left: 248px; }
@media (max-width: 991.98px) { .app-main { margin-left: 0; padding-bottom: calc(72px + env(safe-area-inset-bottom)); } }

.app-topbar { padding: 0.7rem 1rem; background: rgba(255, 255, 255, 0.92); }
.app-topbar__logo { color: var(--text); display: inline-flex; }
.app-topbar__logo svg { height: 26px; width: auto; }

.app-content { padding: clamp(1.1rem, 3vw, 2.25rem); width: 100%; max-width: 1240px; }

/* Page head: the big headline of every screen */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0.9rem 1.5rem; margin-bottom: 1.5rem; }
.page-head__title { font-size: clamp(1.55rem, 3.2vw, 2.25rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; margin: 0; text-wrap: balance; }
.page-head__sub { color: var(--text-muted); margin: 0.4rem 0 0; max-width: 60ch; }
.page-head__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
@media (max-width: 575.98px) {
    .page-head__actions { width: 100%; }
    .page-head__actions > .btn-primary { flex: 1 1 100%; min-height: 48px; }
}

/* Phone tab bar */
.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1035;
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    padding: 0.35rem 0.4rem calc(0.35rem + env(safe-area-inset-bottom));
}
.tabbar__item {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.15rem;
    min-height: 54px; justify-content: center; border: 0; background: none; border-radius: 10px;
    color: var(--text-muted); font-size: 0.7rem; font-weight: 700; text-decoration: none;
}
.tabbar__item i { font-size: 1.25rem; }
.tabbar__item.is-active { color: var(--text); }
.tabbar__item.is-active::before { content: ""; position: absolute; top: -0.35rem; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--text); }
.tabbar__item.is-active i { background: var(--marker); border-radius: 999px; padding: 0.05rem 0.85rem; }
.tabbar-fab { position: fixed; right: 1rem; bottom: 1rem; z-index: 1035; width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--text); color: #fff; font-size: 1.4rem; box-shadow: 0 10px 24px -8px rgba(35, 37, 43, 0.6); }

/* Sheets: cards with an answer-sheet rule under the title */
.card { border-radius: 10px; }
.card-header { border-bottom: 2px solid #f6ccd2; background: #fff; border-radius: 10px 10px 0 0 !important; font-size: 1rem; }
.list-group-item { border-color: var(--border); }

/* Tally strip: one sheet, numbers separated by dashed answer-sheet rules */
.tally { display: grid; grid-template-columns: repeat(4, 1fr); overflow: hidden; }
.tally--3 { grid-template-columns: repeat(3, 1fr); }
.tally__cell { display: flex; flex-direction: column; gap: 0.15rem; padding: 1.15rem 1.3rem; color: var(--text); text-decoration: none; border-left: 1.5px dashed #f2b8bf; transition: background-color 0.15s ease; }
.tally__cell:first-child { border-left: 0; }
.tally__cell:hover { background: #fffbe6; color: var(--text); }
.tally__value { font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.tally__label { font-size: 0.85rem; color: var(--text-muted); }
@media (max-width: 767.98px) {
    .tally { grid-template-columns: 1fr 1fr; }
    .tally__cell:nth-child(odd) { border-left: 0; }
    .tally__cell:nth-child(n + 3) { border-top: 1.5px dashed #f2b8bf; }
    .tally--3 { grid-template-columns: repeat(3, 1fr); }
    .tally--3 .tally__cell { border-top: 0; padding: 0.95rem 0.8rem; }
    .tally--3 .tally__cell:nth-child(n + 2) { border-left: 1.5px dashed #f2b8bf; }
}

/* Live exams: the card gets the scan-sheet timing marks */
.dash-live { position: relative; border: 2px solid var(--text); padding-right: 14px; }
.dash-live::after { content: ""; position: absolute; top: 0.9rem; bottom: 0.9rem; right: 6px; width: 5px; background: repeating-linear-gradient(to bottom, var(--text) 0 6px, transparent 6px 20px); }
.dash-live .card-header { border-bottom-color: #f6ccd2; }
.tips-card { background: #fffbe6; border-color: #f1df8a; }
.tips-card .card-body { font-size: 0.92rem; }

.dash-hello { margin-bottom: 1.5rem; }

/* List tools: status pills + search */
.list-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; }
.pill-tabs { display: flex; gap: 0.35rem; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.pill-tabs::-webkit-scrollbar { display: none; }
.pill-tabs__item { flex: none; padding: 0.45rem 0.95rem; border-radius: 999px; border: 1.5px solid #d5dbe2; background: #fff; color: var(--text-muted); font-weight: 700; font-size: 0.88rem; text-decoration: none; }
.pill-tabs__item:hover { color: var(--text); border-color: #aab2be; }
.pill-tabs__item.is-active { background: var(--text); border-color: var(--text); color: #fff; }
.search-box { position: relative; flex: 1 1 260px; max-width: 360px; }
.search-box i { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.search-box input { width: 100%; min-height: 44px; padding: 0.5rem 0.9rem 0.5rem 2.4rem; border: 1.5px solid #cdd3dc; border-radius: 999px; background: #fff; font: inherit; color: var(--text); }
.search-box input:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 4px rgba(255, 225, 74, 0.7); }
@media (max-width: 575.98px) { .search-box { max-width: none; } }

/* Tickets: one exam per strip, perforated on the left like an exam slip */
.ticket-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }
.ticket {
    position: relative; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    background: #fff; border: 1px solid var(--border); border-radius: 10px;
    padding: 1rem 1.15rem 1rem 1.6rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ticket::before { content: ""; position: absolute; left: 0.6rem; top: 0.8rem; bottom: 0.8rem; border-left: 2px dashed #f2b8bf; }
.ticket:hover { border-color: #b9c1cc; box-shadow: 0 10px 24px -20px rgba(35, 37, 43, 0.6); }
.ticket__top { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.3rem; }
.ticket__code { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.06em; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.ticket__name { display: block; font-size: 1.08rem; font-weight: 800; letter-spacing: -0.01em; color: var(--text); text-decoration: none; line-height: 1.3; }
.ticket__name:hover { color: var(--pen); }
.ticket__meta { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin-top: 0.35rem; font-size: 0.84rem; color: var(--text-muted); }
.ticket__meta i { margin-right: 0.15rem; }
.ticket__actions { display: flex; align-items: center; gap: 0.4rem; flex: none; }
.ticket__actions .btn-sm { min-height: 38px; }
.ticket__more { width: 38px; padding: 0; }
@media (max-width: 575.98px) {
    .ticket { flex-direction: column; align-items: stretch; }
    .ticket__actions .btn-primary { flex: 1; }
}

/* Status stamps */
.stamp { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.76rem; font-weight: 800; padding: 0.18rem 0.55rem; border-radius: 6px; line-height: 1.3; }
.stamp::before { content: ""; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: currentColor; }
.stamp--live { background: #e6f4ee; color: #0b6a48; }
.stamp--soon { background: #eceef2; color: var(--text); }
.stamp--draft { background: #fff; color: #8a5a00; box-shadow: inset 0 0 0 1.5px #e5c46a; }
.stamp--draft::before { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.stamp--done { background: #f1f4f7; color: var(--text-muted); }
.stamp--bad { background: var(--danger-soft); color: #8f1525; }
/* Disqualified exams: kept apart from finished ones on the student side */
.dq-heading { margin-top: 1.8rem; }
.dq-intro { font-size: .88rem; color: var(--text-muted); margin: -.35rem 0 .7rem; }
.dq-ticket { box-shadow: inset 4px 0 0 var(--pen), var(--shadow-sm, 0 1px 2px rgba(0,0,0,.05)); }

/* Empty state: a blank answer-sheet row */
.empty-sheet { text-align: center; padding: 2.75rem 1.25rem; align-items: center; }
.empty-sheet__bubbles { display: flex; justify-content: center; gap: 0.5rem; margin-bottom: 1rem; }
.empty-sheet__bubbles span { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--ljk); }
.empty-sheet__bubbles span:nth-child(2) { background: radial-gradient(circle at 35% 35%, #555a64 0 18%, #23252b 60%); border-color: #23252b; }
.empty-sheet strong { display: block; font-size: 1.15rem; font-weight: 800; margin-bottom: 0.3rem; }
.empty-sheet p { color: var(--text-muted); max-width: 42ch; margin: 0 auto 1.1rem; }

.list-heading { display: flex; align-items: center; gap: 0.5rem; font-size: 1.05rem; font-weight: 800; margin: 0 0 0.7rem; }
.list-heading__count { font-size: 0.78rem; font-weight: 800; background: #e8ecf1; color: var(--text-muted); border-radius: 999px; padding: 0.1rem 0.5rem; }
.ticket--live { border: 2px solid var(--text); }
.ticket__progress { height: 6px; background: #e8ecf1; border-radius: 999px; overflow: hidden; margin-top: 0.6rem; max-width: 360px; }
.ticket__progress span { display: block; height: 100%; background: var(--text); border-radius: 999px; }
/* The grade, written and circled in red pen */
.grade { position: relative; flex: none; width: 5.2rem; height: 3.3rem; display: flex; align-items: center; justify-content: center; color: var(--pen); transform: rotate(-6deg); }
.grade span { font-family: "Pen", cursive; font-size: 1.9rem; line-height: 1; }
.grade svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: var(--pen); stroke-width: 3; stroke-linecap: round; }
@media (max-width: 575.98px) { .ticket--graded { flex-direction: row; align-items: center; } }

/* Filter bar: search + compact selects in one row */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.filter-bar .search-box { flex: 1 1 260px; max-width: 420px; }
.filter-select { min-height: 44px; padding: 0.45rem 2.2rem 0.45rem 0.95rem; border: 1.5px solid #cdd3dc; border-radius: 999px; background: #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2323252b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") no-repeat right 0.85rem center / 12px; appearance: none; font: inherit; font-size: 0.9rem; font-weight: 600; color: var(--text); max-width: 100%; }
.filter-select:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 4px rgba(255, 225, 74, 0.7); }
.filter-reset { font-size: 0.88rem; font-weight: 700; color: var(--pen); text-decoration: none; padding: 0.4rem 0.5rem; }
.tag-row { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tag-chip { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); background: #fff; border: 1px dashed #c9cfd8; border-radius: 6px; padding: 0.15rem 0.5rem; text-decoration: none; }
.tag-chip span { opacity: 0.6; margin-left: 0.15rem; }
.tag-chip:hover { color: var(--text); border-color: var(--text); }
.tag-chip.is-active { background: var(--marker); border: 1px solid var(--text); color: var(--text); }
@media (max-width: 575.98px) { .filter-select { flex: 1 1 calc(50% - 0.5rem); } .filter-bar .search-box { flex-basis: 100%; } }

/* List header row (select all + count) */
.qlist-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 0.25rem 0.6rem; font-size: 0.88rem; color: var(--text-muted); }
.qlist-head__all { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; color: var(--text); cursor: pointer; }

/* Question cards: a slip of an exam paper */
.qlist { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; counter-reset: q calc(var(--start, 1) - 1); }
.qcard { position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: 0.85rem; align-items: start; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.1rem; transition: border-color 0.15s ease; }
.qcard:hover { border-color: #b9c1cc; }
.qcard:has(.qcard__check:checked) { border-color: var(--text); background: #fffdf2; }
.qcard__check { margin-top: 0.3rem; width: 1.2rem; height: 1.2rem; }
.qcard__text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--text); font-weight: 600; line-height: 1.5; text-decoration: none; }
.qcard__text:hover { color: var(--pen); }
.qcard__bubbles { display: flex; gap: 0.3rem; margin: 0.55rem 0 0.5rem; }
.qcard__bubbles span { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--ljk); color: var(--pen); font-size: 0.6rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.qcard__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.4rem; }
.qcard__score { font-size: 0.78rem; color: var(--text-muted); margin-left: 0.2rem; }
.qcard__actions { display: flex; gap: 0.3rem; }
@media (max-width: 575.98px) {
    .qcard { grid-template-columns: auto 1fr; }
    .qcard__actions { grid-column: 2; }
}
.qtag { font-size: 0.75rem; font-weight: 700; color: var(--text); background: #f1f4f7; border-radius: 5px; padding: 0.12rem 0.45rem; line-height: 1.4; }
.qtag--type { background: #23252b; color: #fff; }
.qtag--tag { background: transparent; color: var(--text-muted); padding-left: 0; padding-right: 0.1rem; }

/* Bulk bar: appears once questions are ticked */
.bulk-bar.is-enhanced:not(.is-open) { display: none; }
.bulk-bar { margin-top: 1rem; background: #fff; border: 2px solid var(--text); border-radius: 12px; padding: 0.65rem 0.75rem 0.65rem 1rem; }
.bulk-bar.is-enhanced { position: sticky; bottom: 1rem; z-index: 5; box-shadow: 0 18px 40px -24px rgba(35, 37, 43, 0.6); max-height: 70vh; overflow-y: auto; }
.bulk-bar__row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.bulk-bar__title { font-weight: 600; }
.bulk-bar__buttons { display: flex; gap: 0.35rem; }
.bulk-bar__hint { font-size: 0.82rem; color: var(--text-muted); margin: 0.6rem 0 0.5rem; }
@media (max-width: 991.98px) { .bulk-bar.is-enhanced { bottom: calc(80px + env(safe-area-inset-bottom)); } }

/* Class cards: a name label on a notebook cover */
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.9rem; }
.class-card { position: relative; display: flex; flex-direction: column; gap: 0.9rem; background: #fff; border: 1px solid var(--border); border-left: 10px solid var(--text); border-radius: 10px; padding: 1.1rem 1.1rem 1rem; }
.class-card.is-archived { border-left-color: #b9c1cc; opacity: 0.85; }
.class-card__label { border: 1.5px solid var(--ljk); border-radius: 6px; padding: 0.55rem 0.8rem; background: repeating-linear-gradient(to bottom, transparent 0 calc(1.45rem - 1px), rgba(242, 169, 179, 0.35) calc(1.45rem - 1px) 1.45rem); }
.class-card__name { display: block; font-size: 1.6rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
.class-card__year { display: block; font-size: 0.82rem; color: var(--text-muted); }
.class-card__stats { display: flex; align-items: center; gap: 1rem; font-size: 0.9rem; color: var(--text-muted); }
.class-card__stats b { color: var(--text); font-size: 1.05rem; }
.class-card__actions { display: flex; gap: 0.4rem; margin-top: auto; }
.class-card__actions .btn-primary { flex: 1; }

/* People list */
.people { list-style: none; padding: 0; margin: 0; background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.person { display: flex; align-items: center; gap: 0.8rem; padding: 0.8rem 1rem; border-bottom: 1px solid var(--border); }
.person:last-child { border-bottom: 0; }
.person:has(input:checked) { background: #fffdf2; }
.person .form-check-input { width: 1.2rem; height: 1.2rem; flex: none; }
.person__avatar { background: #f1f4f7; color: var(--text); }
.person__body { flex: 1; }
.person__name { font-weight: 700; }
.person__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem 0.85rem; font-size: 0.82rem; color: var(--text-muted); }
.person__actions { display: flex; gap: 0.3rem; flex: none; }

.select-bar { position: sticky; bottom: 1rem; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; padding: 0.7rem 0.8rem 0.7rem 1.1rem; background: var(--text); color: #fff; border-radius: 12px; box-shadow: 0 18px 40px -20px rgba(35, 37, 43, 0.7); }
.select-bar .btn-primary { background: var(--marker); border-color: var(--marker); color: var(--text); }
@media (max-width: 991.98px) { .select-bar { bottom: calc(80px + env(safe-area-inset-bottom)); } }

/* =========================================================
   Messages: soft, readable, never neon.
   ========================================================= */
.alert { background: #fff; color: var(--text); border: 1px solid var(--border); border-radius: 12px; box-shadow: none; padding: 0.85rem 1rem; }
.alert-success { background: #f3f9f6; border-color: #d3eadf; }
.alert-danger { background: #fdf5f6; border-color: #f3d6da; }
.alert-warning { background: #fdf9ee; border-color: #f0e2b6; }
.alert-info, .alert-primary { background: #fdfbf1; border-color: #efe5bd; box-shadow: none; }
.alert-light, .alert-secondary { background: #f6f8fa; border-color: var(--border); box-shadow: none; }
.alert .btn-close { opacity: 0.45; }

.app-flash { display: flex; align-items: flex-start; gap: 0.75rem; }
.app-flash > i { flex: none; width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; line-height: 1; }
.alert-success.app-flash > i { background: #dff0e7; color: #1d7a55; }
.alert-danger.app-flash > i { background: #f8e1e4; color: #b4283a; }
.app-flash > span, .app-flash > div { flex: 1; padding-top: 0.2rem; padding-right: 1.5rem; }
.app-flash--list ul { margin: 0.3rem 0 0; padding-left: 1.1rem; color: #5a3036; }
.app-flash.fade:not(.show) { opacity: 0; }

/* Notice: account steps and plan reminders */
.notice { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; background: #fff; border: 1px solid #efe5bd; border-radius: 12px; padding: 0.9rem 1rem; margin-bottom: 1.25rem; box-shadow: inset 4px 0 0 var(--marker); }
.notice__icon { flex: none; width: 40px; height: 40px; border-radius: 50%; background: #fff6cc; color: #6b5300; display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; }
.notice__text { flex: 1 1 260px; display: flex; flex-direction: column; gap: 0.1rem; font-size: 0.92rem; }
.notice__text span { color: var(--text-muted); }
@media (max-width: 575.98px) { .notice .btn { width: 100%; min-height: 44px; } }

/* Dialog (CatApp.ask / CatApp.dialog) */
.sdialog { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 1.25rem; background: rgba(35, 37, 43, 0.45); backdrop-filter: blur(3px); animation: sd-fade 0.15s ease; }
.sdialog.is-leaving { animation: sd-fade 0.15s ease reverse forwards; }
.sdialog__box { width: 100%; max-width: 400px; background: #fff; border-radius: 16px; padding: 1.5rem 1.4rem 1.2rem; text-align: center; box-shadow: 0 30px 60px -30px rgba(35, 37, 43, 0.55); animation: sd-rise 0.22s cubic-bezier(0.2, 0.8, 0.2, 1); }
.sdialog__icon { width: 52px; height: 52px; margin: 0 auto 0.85rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; background: #f1f4f7; color: var(--text); }
.sdialog__box--danger .sdialog__icon { background: #fbe9eb; color: #b4283a; }
.sdialog__title { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 0.4rem; text-wrap: balance; }
.sdialog__body { color: var(--text-muted); font-size: 0.93rem; margin: 0 0 0.3rem; }
.sdialog__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-top: 1.2rem; }
.sdialog__actions .btn { min-height: 48px; }
.sdialog__actions .btn:only-child { grid-column: 1 / -1; }
.sdialog__ok { background: var(--text); border: 2px solid var(--text); color: #fff; }
.sdialog__ok:hover { background: #000; color: #fff; }
.sdialog__box--danger .sdialog__ok { background: #b4283a; border-color: #b4283a; }
.sdialog__box--danger .sdialog__ok:hover { background: #962033; border-color: #962033; }
@keyframes sd-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sd-rise { from { transform: translateY(12px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 575.98px) {
    .sdialog { align-items: flex-end; padding: 0; }
    .sdialog__box { max-width: none; border-radius: 18px 18px 0 0; padding-bottom: calc(1.2rem + env(safe-area-inset-bottom)); }
}

/* Toasts (CatApp.notify) */
.stoast-host { position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); z-index: 2100; display: grid; gap: 0.5rem; width: min(420px, calc(100% - 2rem)); }
@media (max-width: 991.98px) { .stoast-host { bottom: calc(84px + env(safe-area-inset-bottom)); } }
.stoast { display: flex; align-items: flex-start; gap: 0.6rem; background: var(--text); color: #fff; border-radius: 12px; padding: 0.75rem 0.95rem; font-size: 0.92rem; box-shadow: 0 18px 40px -20px rgba(35, 37, 43, 0.7); animation: sd-rise 0.2s ease; }
.stoast i { font-size: 1.05rem; line-height: 1.35; }
.stoast--success i { color: #7fd6ae; }
.stoast--error i { color: #ff9aa5; }
.stoast--info i { color: var(--marker); }
.stoast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity 0.3s ease, transform 0.3s ease; }
@media (prefers-reduced-motion: reduce) { .sdialog, .sdialog__box, .stoast { animation: none; } }

/* =========================================================
   Shell v3: top navigation and airy white pages, like the
   public site; pastel action tiles for the main jobs.
   ========================================================= */
body.app { background: #fff; }
.app-main, .app-main { margin-left: 0 !important; }
@media (min-width: 992px) { .app-main { padding-bottom: 0; } }

.topnav { position: sticky; top: 0; z-index: 1030; background: rgba(255, 255, 255, 0.92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.topnav__in { max-width: 1168px; margin: 0 auto; padding: 0 24px; height: 68px; display: flex; align-items: center; gap: 1.75rem; }
.topnav__logo { color: var(--text); display: inline-flex; flex: none; }
.topnav__logo svg { height: 30px; width: auto; }
.topnav__links { display: flex; align-items: center; gap: 0.15rem; margin: 0 auto; }
.topnav__link { position: relative; padding: 0.5rem 0.75rem; border-radius: 8px; font-weight: 600; font-size: 0.95rem; color: var(--text-muted); text-decoration: none; white-space: nowrap; }
.topnav__link:hover { color: var(--text); }
.topnav__link::after { content: ""; position: absolute; left: 0.75rem; right: 0.75rem; bottom: 0.15rem; height: 3px; border-radius: 3px; background: var(--pen); transform: scaleX(0) rotate(-1.5deg); transform-origin: left; transition: transform 0.25s ease; }
.topnav__link.is-active { color: var(--text); font-weight: 700; }
.topnav__link.is-active::after { transform: scaleX(1) rotate(-1.5deg); }
.topnav__me { display: flex; align-items: center; gap: 0.6rem; border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 0.25rem 0.75rem 0.25rem 0.25rem; color: var(--text); }
.topnav__me:hover { border-color: #b9c1cc; }
.topnav__me-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; text-align: left; }
.topnav__me-name { font-weight: 700; font-size: 0.88rem; }
.topnav__me-ws { font-size: 0.74rem; color: var(--text-muted); }
.topnav__menu { min-width: 260px; padding: 0.4rem; }
.topnav__menu-head { padding: 0.6rem 0.75rem 0.5rem; }
.topnav__menu .dropdown-item { border-radius: 8px; padding: 0.55rem 0.75rem; }
@media (max-width: 1199.98px) { .topnav__me-text { display: none; } .topnav__in { gap: 1rem; } .topnav__link { padding: 0.5rem 0.55rem; } }

.app-content { max-width: 1168px; margin: 0 auto; padding: clamp(1.25rem, 3.5vw, 2.75rem) 24px 4rem; }
@media (max-width: 575.98px) { .app-content { padding-left: 16px; padding-right: 16px; } }
.page-head { margin-bottom: 1.75rem; }
.page-head__title { font-size: clamp(1.8rem, 3.6vw, 2.6rem); letter-spacing: -0.035em; }
.page-head__sub { font-size: 1.02rem; }

/* Full-width tinted band, like the alternating sections on the landing page */
.band { margin: 2.25rem calc(50% - 50vw); padding: 2.25rem calc(50vw - 50%); background: var(--body-bg); }
.band > :last-child { margin-bottom: 0; }
.section-title { font-size: clamp(1.3rem, 2.4vw, 1.7rem); font-weight: 800; letter-spacing: -0.025em; margin: 0 0 1rem; }

/* Cards on white paper: a hairline, no shadow */
.card { box-shadow: none; }

/* Pastel action tiles */
.action-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.85rem; }
.action-tile { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 1.25rem; min-height: 132px; padding: 1.1rem 1.15rem; border-radius: 16px; color: var(--text); text-decoration: none; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.action-tile i { font-size: 1.55rem; }
.action-tile b { display: block; font-size: 1.05rem; font-weight: 800; }
.action-tile span { font-size: 0.85rem; color: rgba(35, 37, 43, 0.72); }
.action-tile::after { content: ""; position: absolute; right: -20px; bottom: -20px; width: 86px; height: 86px; border-radius: 50%; border: 11px solid rgba(255, 255, 255, 0.5); }
.action-tile:hover { color: var(--text); transform: translateY(-2px); box-shadow: 0 14px 28px -20px rgba(35, 37, 43, 0.5); }
.action-tile--yellow { background: #ffe98a; }
.action-tile--pink { background: #fde4e8; }
.action-tile--mint { background: #dff3e8; }
.action-tile--peach { background: #ffe7d6; }
@media (max-width: 767.98px) { .action-tiles { grid-template-columns: 1fr 1fr; } .action-tile { min-height: 116px; } }

/* Home hero: greeting + a live answer sheet */
.home-hero { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 2.5rem; align-items: center; margin-bottom: 2rem; }
.home-hero__title { font-size: clamp(2rem, 4.4vw, 3.1rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; margin: 0 0 0.9rem; text-wrap: balance; }
.home-hero__lead { font-size: 1.1rem; color: var(--text-muted); margin: 0 0 1.4rem; max-width: 34rem; }
.home-hero__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.home-hero__actions .btn { min-height: 48px; }
@media (max-width: 991.98px) { .home-hero { grid-template-columns: 1fr; gap: 1.75rem; } }
@media (max-width: 575.98px) { .home-hero__actions .btn { flex: 1 1 100%; } }

.live-sheet { position: relative; background: #fff; border: 1px solid #ecd0d4; border-radius: 8px; padding: 1.1rem 1.25rem 1.2rem; transform: rotate(-1.2deg); box-shadow: 0 28px 50px -28px rgba(35, 37, 43, 0.45); text-decoration: none; color: var(--text); display: block; }
.live-sheet:hover { color: var(--text); transform: rotate(-0.6deg); }
.live-sheet__head { display: flex; justify-content: space-between; gap: 1rem; color: var(--pen); font-weight: 700; font-size: 0.88rem; border-bottom: 2px solid var(--ljk); padding-bottom: 0.5rem; }
.live-sheet__name { font-weight: 800; font-size: 1.15rem; margin: 0.8rem 0 0.15rem; }
.live-sheet__meta { font-size: 0.86rem; color: var(--text-muted); }
.live-sheet__bubbles { display: flex; flex-wrap: wrap; gap: 6px; margin: 0.85rem 0 0.2rem; }
.live-sheet__bubbles span { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--ljk); }
.live-sheet__bubbles span.is-done { background: radial-gradient(circle at 35% 35%, #555a64 0 18%, #23252b 60%); border-color: #23252b; }
.live-sheet__bubbles span.is-work { border-color: #23252b; }
.live-sheet__grade { position: absolute; right: 1rem; bottom: 0.75rem; font-family: "Pen", cursive; color: var(--pen); font-size: 1.25rem; transform: rotate(-6deg); }
.live-sheet--empty { transform: rotate(1deg); }
.live-sheet--empty .live-sheet__head { color: var(--text-muted); border-bottom-color: #e3e7ec; }

.tally--open { border: 0; border-top: 2px solid var(--text); border-radius: 0; background: transparent; }
.tally--open .tally__cell { border-left: 0; padding: 1.1rem 0.25rem 0.25rem; }
.tally--open .tally__cell:hover { background: transparent; }
.tally--open .tally__value { font-size: clamp(2rem, 3.6vw, 2.6rem); }
@media (max-width: 767.98px) { .tally--open .tally__cell:nth-child(n + 3) { border-top: 0; } }
.action-tiles--2 { grid-template-columns: repeat(2, 1fr); }

/* Footer: the bottom edge of an answer sheet, as on the public site */
.app-main { display: flex; flex-direction: column; min-height: 100vh; }
.app-content { flex: 1 0 auto; }
.app-foot { background: var(--body-bg); color: var(--text-muted); font-size: 0.9rem; margin-top: 2rem; }
.app-foot__marks { height: 10px; background: repeating-linear-gradient(90deg, var(--text) 0 14px, transparent 14px 34px); opacity: 0.9; }
.app-foot__in { max-width: 1168px; margin: 0 auto; padding: 2rem 24px 1.75rem; display: grid; grid-template-columns: auto 1fr; gap: 1.25rem 2rem; align-items: center; }
.app-foot__logo { color: var(--text); display: inline-flex; }
.app-foot__logo svg { height: 26px; width: auto; }
.app-foot__links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.35rem 1.25rem; }
.app-foot__links a { color: var(--text-muted); text-decoration: none; font-weight: 600; }
.app-foot__links a:hover { color: var(--text); text-decoration: underline; text-decoration-color: var(--pen); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.app-foot__base { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem; border-top: 1px solid #d5dbe2; padding-top: 1.1rem; font-size: 0.85rem; }
.app-foot__sign { font-family: "Pen", cursive; color: var(--pen); font-size: 1.05rem; transform: rotate(-2deg); }
@media (max-width: 767.98px) {
    .app-foot__in { grid-template-columns: 1fr; padding-left: 16px; padding-right: 16px; }
    .app-foot__links { justify-content: flex-start; }
}

/* ===== Admin console (shared by admin pages) ===== */
/* Sheet: one topic per sheet, pink header rule like an answer sheet */
.sheet { background: #fff; border: 1px solid var(--border); border-radius: 10px; }
.sheet + .sheet { margin-top: 1rem; }
.sheet__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; padding: 1rem 1.2rem 0.8rem; border-bottom: 2px solid #f6ccd2; }
.sheet__title { font-size: 1.05rem; font-weight: 800; margin: 0; }
.sheet__hint { margin: 0.15rem 0 0; font-size: 0.86rem; color: var(--text-muted); }
.sheet__body { padding: 1.1rem 1.2rem 1.2rem; }
.sheet__body--flush { padding: 0; }
.sheet__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; padding: 0.9rem 1.2rem; border-top: 1px solid var(--border); }
.sheet__foot .btn-primary { min-height: 44px; }
@media (max-width: 575.98px) { .sheet__foot .btn-primary { flex: 1 1 100%; } }

/* Switch row: what it does on the left, the switch on the right */
.toggle-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 0.85rem 0; border-top: 1px solid var(--border); }
.toggle-row:first-child { border-top: 0; padding-top: 0.2rem; }
.toggle-row__label { display: block; font-weight: 700; font-size: 0.95rem; cursor: pointer; margin: 0; }
.toggle-row__help { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.15rem; line-height: 1.45; }
.toggle-row.is-locked .toggle-row__label { color: var(--text-muted); cursor: not-allowed; }
.toggle-row .form-switch { padding-left: 0; margin: 0; min-height: 0; flex: none; }
.toggle-row .form-switch .form-check-input { width: 2.9rem; height: 1.6rem; margin: 0.1rem 0 0; float: none; cursor: pointer; }

/* Key/value facts */
.kv { margin: 0; display: grid; gap: 0; }
.kv__row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px dashed var(--border); font-size: 0.9rem; }
.kv__row:last-child { border-bottom: 0; }
.kv__row dt { font-weight: 500; color: var(--text-muted); }
.kv__row dd { margin: 0; font-weight: 700; text-align: right; min-width: 0; overflow-wrap: anywhere; }

/* "Perlu tindakan": a few big counters that link to a queue */
.todo { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin-bottom: 1.5rem; }
.todo__item { display: flex; align-items: center; gap: 0.9rem; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.1rem; color: var(--text); text-decoration: none; min-height: 84px; }
.todo__item:hover { border-color: #b9c1cc; color: var(--text); }
.todo__item.is-hot { border: 2px solid var(--text); box-shadow: 6px 6px 0 var(--marker); }
.todo__count { flex: none; width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--ljk); display: grid; place-items: center; font-weight: 800; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.todo__item.is-hot .todo__count { border-color: var(--pen); color: var(--pen); }
.todo__text { display: flex; flex-direction: column; min-width: 0; }
.todo__text b { font-size: 0.98rem; }
.todo__text span { font-size: 0.84rem; color: var(--text-muted); }
@media (max-width: 767.98px) { .todo { grid-template-columns: 1fr; } .todo__item { min-height: 0; } }

/* A secret stored in the database: never shown, only its state */
.secret-state { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.82rem; color: #0b6a48; font-weight: 700; }
.secret-state.is-empty { color: var(--text-muted); font-weight: 600; }

/* Counter badge on menu items (queues) */
.nav-count { display: inline-grid; place-items: center; min-width: 1.25rem; height: 1.25rem; padding: 0 0.3rem; border-radius: 999px; background: var(--pen); color: #fff; font-size: 0.72rem; font-weight: 800; line-height: 1; margin-left: 0.35rem; font-style: normal; }

/* Proof of transfer thumbnail */
.proof-thumb { display: block; width: 72px; height: 72px; border-radius: 8px; border: 1px solid var(--border); object-fit: cover; background: #f1f4f7; flex: none; }
.proof-thumb--lg { width: 100%; height: auto; max-height: 70vh; object-fit: contain; }
.tabbar__item { position: relative; }
.tabbar__item i.tabbar__count { position: absolute; top: 0.3rem; left: 50%; margin-left: 0.35rem; font-size: 0.68rem; }
.rail__link .nav-count { margin-left: auto; }

/* ===== Dropdown (public/js/pick.js): select as a sheet of LJK bubbles ===== */
.pick { position: relative; display: block; width: 100%; min-width: 0; }
.pick__native { position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; opacity: 0; pointer-events: none; }
.pick__button { position: relative; display: flex; align-items: center; gap: 0.6rem; width: 100%; min-height: 44px; padding: 0.45rem 0.85rem; background: #fff; border: 1.5px solid #cdd3dc; border-radius: 8px; font: inherit; font-size: 0.95rem; color: var(--text); text-align: left; cursor: pointer; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.pick__button:hover { border-color: #aab2be; }
.pick__button:focus-visible, .pick.is-open .pick__button { outline: none; border-color: var(--text); box-shadow: 0 0 0 4px rgba(255, 225, 74, 0.7); }
.pick__button:disabled { background: #f1f4f7; color: var(--text-muted); cursor: not-allowed; }
.pick__value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick__value.is-placeholder { color: var(--text-muted); }
.pick__chev { flex: none; font-size: 0.8rem; transition: transform 0.15s ease; }
.pick.is-open .pick__chev { transform: rotate(180deg); }
.pick--sm .pick__button { min-height: 36px; padding: 0.3rem 0.7rem; font-size: 0.88rem; }
.pick--pill { display: inline-block; width: auto; max-width: 100%; }
.pick--pill .pick__button { border-radius: 999px; padding: 0.45rem 0.95rem; font-weight: 600; font-size: 0.9rem; }
.pick.is-invalid .pick__button { border-color: var(--danger); }
.filter-bar .pick--pill { flex: 0 1 auto; }
@media (max-width: 575.98px) { .filter-bar .pick--pill { flex: 1 1 calc(50% - 0.5rem); } .filter-bar .pick--pill .pick__button { width: 100%; } }
.input-group > .pick { flex: 1 1 auto; width: 1%; }
form.d-flex > .pick { width: auto; flex: 1 1 200px; }

.pick__menu { position: fixed; z-index: 1060; width: max-content; max-width: min(420px, calc(100vw - 32px)); background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 18px 40px -18px rgba(35, 37, 43, 0.45); overflow: hidden; animation: pick-in 0.12s ease-out; }
.pick__list { list-style: none; margin: 0; padding: 0.35rem; max-height: 300px; overflow-y: auto; outline: none; overscroll-behavior: contain; }
.pick__option { display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0.7rem; border-radius: 8px; cursor: pointer; font-size: 0.93rem; line-height: 1.35; }
.pick__option.is-active { background: #fffbe6; }
.pick__option[aria-selected="true"] { font-weight: 700; }
.pick__option[aria-disabled="true"] { color: var(--text-muted); cursor: not-allowed; }
.pick__option.is-placeholder { color: var(--text-muted); }
.pick__bubble { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--ljk); background: #fff; }
.pick__option[aria-selected="true"] .pick__bubble { border-color: #23252b; background: radial-gradient(circle at 35% 35%, #555a64 0 18%, #23252b 60%); }
.pick__text { min-width: 0; overflow-wrap: anywhere; }
.pick__search { display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.8rem; border-bottom: 2px solid #f6ccd2; color: var(--text-muted); }
.pick__search input { flex: 1; min-width: 0; border: 0; outline: none; font: inherit; font-size: 0.92rem; color: var(--text); background: transparent; }
.pick__empty { padding: 0.9rem 1rem; font-size: 0.88rem; color: var(--text-muted); }

/* Phone: a bottom sheet */
.pick__backdrop { position: fixed; inset: 0; z-index: 1065; background: rgba(35, 37, 43, 0.4); animation: pick-fade 0.15s ease-out; }
.pick__menu--sheet { position: fixed; z-index: 1070; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-width: none; border-radius: 16px 16px 0 0; border: 0; padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -12px 32px -16px rgba(35, 37, 43, 0.5); animation: pick-up 0.18s ease-out; }
.pick__menu--sheet .pick__list { max-height: 60vh; padding: 0.4rem 0.6rem 0.8rem; }
.pick__menu--sheet .pick__option { min-height: 48px; font-size: 1rem; }
.pick__menu--sheet .pick__bubble { width: 22px; height: 22px; }
.pick__head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.9rem 1rem 0.7rem; border-bottom: 2px solid #f6ccd2; }
.pick__head::before { content: ""; position: absolute; top: 6px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: #d5dbe2; }
.pick__title { font-weight: 800; font-size: 1.02rem; }
.pick__close { width: 40px; height: 40px; border: 0; border-radius: 50%; background: #f1f4f7; color: var(--text); display: grid; place-items: center; flex: none; }
body.pick-lock { overflow: hidden; }
@keyframes pick-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes pick-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes pick-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pick__menu, .pick__backdrop { animation: none; } .pick__chev { transition: none; } }
.pick__list:focus, .pick__list:focus-visible { outline: none !important; box-shadow: none !important; }

/* Dashboard link to the teacher guide: visible, but quieter than the action tiles */
.guide-strip { display: flex; align-items: center; gap: 1rem; background: #fff; border: 1.5px dashed #f2b8bf; border-radius: 12px; padding: 0.95rem 1.15rem; color: var(--text); text-decoration: none; transition: border-color 0.15s ease, background-color 0.15s ease; }
.guide-strip:hover { border-color: var(--pen); background: #fffdf6; color: var(--text); }
.guide-strip__icon { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--pen); color: var(--pen); display: grid; place-items: center; font-size: 1.2rem; }
.guide-strip__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.guide-strip__text b { font-size: 1.02rem; }
.guide-strip__text span { font-size: 0.9rem; color: var(--text-muted); line-height: 1.45; }
.guide-strip__go { flex: none; font-weight: 800; font-size: 0.92rem; white-space: nowrap; background: linear-gradient(transparent 55%, var(--marker) 55% 92%, transparent 92%); }
@media (max-width: 575.98px) {
    .guide-strip { flex-wrap: wrap; align-items: flex-start; gap: 0.6rem 0.85rem; }
    .guide-strip__text { flex: 1 1 calc(100% - 44px - 0.85rem); }
    .guide-strip__go { margin-left: calc(44px + 0.85rem); }
}

/* ===== Date and time picker (public/js/datepick.js) ===== */
.dpick { position: relative; display: block; width: 100%; min-width: 0; }
.dpick__button { display: flex; align-items: center; gap: 0.6rem; width: 100%; min-height: 44px; padding: 0.45rem 0.85rem; background: #fff; border: 1.5px solid #cdd3dc; border-radius: 8px; font: inherit; font-size: 0.95rem; color: var(--text); text-align: left; cursor: pointer; }
.dpick__button:hover { border-color: #aab2be; }
.dpick.is-open .dpick__button, .dpick__button:focus-visible { outline: none; border-color: var(--text); box-shadow: 0 0 0 4px rgba(255, 225, 74, 0.7); }
.dpick__button:disabled { background: #f1f4f7; color: var(--text-muted); cursor: not-allowed; }
.dpick__icon { color: var(--pen); flex: none; }
.dpick__value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dpick__value.is-placeholder { color: var(--text-muted); }
.dpick.is-invalid .dpick__button { border-color: var(--danger); }
.dpick--pill { display: inline-block; width: auto; }
.dpick--pill .dpick__button { border-radius: 999px; font-size: 0.9rem; font-weight: 600; }
.filter-bar .dpick--pill { flex: 0 1 auto; }

.dpick__menu { position: fixed; z-index: 1060; width: 316px; max-width: calc(100vw - 32px); background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 18px 40px -18px rgba(35, 37, 43, 0.45); padding: 0 0.8rem 0.8rem; animation: pick-in 0.12s ease-out; }
.dpick__menu--sheet { left: 0; right: 0; bottom: 0; top: auto; width: auto; max-width: none; border-radius: 16px 16px 0 0; border: 0; padding: 0 1rem calc(1rem + env(safe-area-inset-bottom)); max-height: 90vh; overflow-y: auto; animation: pick-up 0.18s ease-out; z-index: 1070; }
.dpick__head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.75rem 0 0.55rem; margin-bottom: 0.55rem; border-bottom: 2px solid #f6ccd2; }
.dpick__title { font-weight: 800; font-size: 0.98rem; }
.dpick__x { width: 34px; height: 34px; border: 0; border-radius: 50%; background: #f1f4f7; color: var(--text); display: grid; place-items: center; }
.dpick__quick { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.5rem; }
.dpick__chip { border: 1.5px solid #d5dbe2; background: #fff; border-radius: 999px; padding: 0.22rem 0.75rem; font: inherit; font-size: 0.82rem; font-weight: 700; color: var(--text); }
.dpick__chip:hover { border-color: var(--text); background: #fffbe6; }
.dpick__nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.3rem; }
.dpick__month { font-weight: 800; }
.dpick__step { width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--text); display: grid; place-items: center; }
.dpick__step:hover { background: #f1f4f7; }
.dpick__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dpick__dow { text-align: center; font-size: 0.72rem; font-weight: 700; color: var(--text-muted); padding: 0.25rem 0; }
.dpick__day { aspect-ratio: 1; max-width: 100%; border: 0; background: transparent; border-radius: 50%; font: inherit; font-size: 0.9rem; font-variant-numeric: tabular-nums; color: var(--text); display: grid; place-items: center; cursor: pointer; }
.dpick__day:hover:not(:disabled) { background: #fffbe6; }
.dpick__day.is-out { color: #aab2be; }
.dpick__day.is-today { box-shadow: inset 0 0 0 2px var(--ljk); font-weight: 800; }
.dpick__day.is-picked { background: radial-gradient(circle at 35% 35%, #555a64 0 18%, #23252b 60%); color: #fff; font-weight: 800; box-shadow: none; }
.dpick__day:disabled { color: #cdd3dc; cursor: not-allowed; text-decoration: line-through; }
.dpick__day:focus-visible { outline: 3px solid var(--text); outline-offset: 1px; }
.dpick__menu--sheet .dpick__day { font-size: 1rem; }
.dpick__menu { max-height: calc(100vh - 24px); overflow-y: auto; }
.dpick__time { display: flex; align-items: center; gap: 0.5rem; border-top: 1px dashed var(--border); margin-top: 0.55rem; padding-top: 0.6rem; }
.dpick__time-label { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); margin-right: auto; }
.dpick__tstep { display: inline-flex; align-items: center; border: 1.5px solid #cdd3dc; border-radius: 8px; overflow: hidden; }
.dpick__tstep button { width: 34px; height: 36px; border: 0; background: #f6f7f9; color: var(--text); display: grid; place-items: center; }
.dpick__tstep button:hover { background: #fffbe6; }
.dpick__tstep b { min-width: 2.2rem; text-align: center; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.dpick__colon { font-weight: 800; }
.dpick__foot { display: flex; align-items: center; justify-content: flex-end; gap: 0.6rem; margin-top: 0.7rem; }
.dpick__clear { border: 0; background: none; font: inherit; font-size: 0.88rem; font-weight: 700; color: var(--pen); margin-right: auto; padding: 0.4rem 0; }
.dpick__ok { min-height: 42px; }
.dpick__menu--sheet .dpick__ok { flex: 1; min-height: 48px; }

/* ===== Whole-number stepper (bobot) ===== */
.nstep { display: inline-flex; align-items: stretch; border: 1.5px solid #cdd3dc; border-radius: 8px; background: #fff; overflow: hidden; min-height: 44px; max-width: 100%; }
.nstep:focus-within { border-color: var(--text); box-shadow: 0 0 0 4px rgba(255, 225, 74, 0.7); }
.nstep .nstep__input { width: 3.2rem; min-width: 0; border: 0 !important; border-radius: 0; box-shadow: none !important; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; padding: 0 0.2rem; min-height: 0; background: transparent; }
.nstep__btn { flex: none; width: 40px; border: 0; background: #f6f7f9; color: var(--text); display: grid; place-items: center; font-size: 0.95rem; }
.nstep__btn:hover:not(:disabled) { background: #fffbe6; }
.nstep__btn:disabled { color: #b9c1cc; cursor: not-allowed; }
.nstep--sm { min-height: 36px; }
.nstep--sm .nstep__btn { width: 32px; font-size: 0.85rem; }
.nstep--sm .nstep__input { width: 2.6rem; font-size: 0.9rem; }

/* ===== Form checks in Lembar Guru style (app.js initValidation) ===== */
.field-error { display: flex; align-items: flex-start; gap: 0.35rem; margin-top: 0.35rem; font-size: 0.84rem; font-weight: 600; color: var(--danger); }
.field-error::before { content: "\F33A"; font-family: "bootstrap-icons"; font-weight: 400; }
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--danger); background-image: none; padding-right: 0.85rem; }
.form-control.is-invalid:focus { box-shadow: 0 0 0 4px rgba(192, 24, 43, 0.15); }
.pick:has(.is-invalid) .pick__button, .nstep:has(.is-invalid) { border-color: var(--danger); }

/* ===== Bank soal: package shelf, add menu, package dialog ===== */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0.6rem; margin-bottom: 1rem; }
.shelf__item { display: flex; align-items: center; gap: 0.7rem; min-width: 0; padding: 0.75rem 0.85rem; background: #fff; border: 1.5px solid var(--border); border-radius: 10px; color: var(--text); text-decoration: none; text-align: left; font: inherit; cursor: pointer; transition: border-color 0.15s ease; }
.shelf__item:hover { border-color: #aab2be; color: var(--text); }
.shelf__item.is-active { border: 2px solid var(--text); box-shadow: 4px 4px 0 var(--marker); }
.shelf__icon { flex: none; width: 38px; height: 38px; border-radius: 9px; background: #f1f4f7; display: grid; place-items: center; font-size: 1.1rem; }
.shelf__item.is-active .shelf__icon { background: var(--marker); }
.shelf__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.shelf__text b { font-size: 0.92rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.shelf__text small { font-size: 0.78rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shelf__item--new { border-style: dashed; border-color: #e7b4bb; }
.shelf__item--new .shelf__icon { background: #fde4e8; color: var(--pen); }
.shelf__item--loose .shelf__icon { color: var(--text-muted); }
@media (max-width: 575.98px) {
    .shelf { display: flex; overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 0 16px 4px; }
    .shelf::-webkit-scrollbar { display: none; }
    .shelf__item { flex: 0 0 72%; }
}
.shelf-open { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.8rem 1rem; margin-bottom: 1rem; border-radius: 10px; background: #fffbea; box-shadow: inset 3px 0 0 var(--marker); }
.shelf-open__name { font-weight: 800; }
.shelf-open__meta { font-size: 0.86rem; color: var(--text-muted); }
.shelf-open__actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.add-menu { min-width: 300px; padding: 0.4rem; border-radius: 12px; }
.add-menu__head { font-size: 0.78rem; font-weight: 700; color: var(--text-muted); padding: 0.35rem 0.7rem 0.45rem; }
.add-menu .dropdown-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.55rem 0.7rem; border-radius: 8px; white-space: normal; }
.add-menu .dropdown-item > i { width: 34px; height: 34px; border-radius: 8px; background: #f1f4f7; display: grid; place-items: center; flex: none; font-size: 1rem; }
.add-menu .dropdown-item span { display: flex; flex-direction: column; line-height: 1.3; }
.add-menu .dropdown-item small { color: var(--text-muted); font-size: 0.78rem; }
.add-menu .dropdown-item:hover, .add-menu .dropdown-item:focus { background: #fffbe6; color: var(--text); }

.lg-modal { border: 0; border-radius: 16px; }
.lg-modal .modal-header { border-bottom: 2px solid #f6ccd2; align-items: flex-start; }
.pm-h { font-size: 1rem; font-weight: 800; margin: 0 0 0.6rem; }
.pm-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 10px; }
.pm-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--border); }
.pm-row:last-child { border-bottom: 0; }
.pm-row__form { display: flex; flex: 1; gap: 0.4rem; min-width: 0; flex-wrap: wrap; }
.pm-row__form .form-control { flex: 1 1 110px; min-width: 0; }
.pm-row__form .pm-row__name { flex: 2 1 200px; font-weight: 700; }
.pm-row__form .pm-row__grade { flex: 0 1 80px; }
.pm-row__count { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; }
.pm-scale { border-top: 1px dashed var(--border); padding-top: 1rem; }

/* ===== Question form: keys as answer-sheet bubbles, clearer footer ===== */
.option-key { position: relative; padding-top: 0.1rem; min-width: 44px; }
.option-key .form-check-input.option-correct { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.option-key .option-letter { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--ljk); background: #fff; display: grid; place-items: center; font-size: 0.95rem; font-weight: 800; color: var(--text-muted); transition: background-color 0.12s ease; }
.option-key:hover .option-letter { border-color: var(--text); color: var(--text); }
.option-key .option-correct:checked + .option-letter { background: radial-gradient(circle at 35% 35%, #555a64 0 18%, #23252b 60%); border-color: #23252b; color: #fff; }
.option-key .option-correct:focus-visible + .option-letter { outline: 3px solid var(--text); outline-offset: 2px; box-shadow: 0 0 0 6px var(--marker); }
.option-row { align-items: center; }
.option-row:has(.option-correct:checked) { border-color: #12805a; background: #f4fbf7; }
.qf-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; }
@media (max-width: 575.98px) {
    .qf-foot { flex-direction: column-reverse; }
    .qf-foot .btn { width: 100%; min-height: 46px; }
}
