/* ===== Palet dasar (warna warisan templat dasar, dijadikan token bernama dengan nilai yang sama): satu sumber untuk CSS lama.
   Tema baru memakai token --t-* di tbz-tema.css; sambil CSS lama dimigrasikan, mengubah warna cukup di sini. ===== */
:root {
    --v-teks: #3b3f5c;              /* teks tubuh, tombol dasar */
    --v-garis: #e0e6ed;             /* garis, latar tombol dasar, permukaan abu muda */
    --v-garis-gelap: #bfc9d4;       /* teks redup di latar gelap, garis isian */
    --v-latar-gelap: #0e1726;       /* latar tema gelap, teks tegas */
    --v-teks-redup: #888ea8;        /* teks sekunder, ikon */
    --v-bahaya: #e7515a;            /* merah: bahaya, galat */
    --v-info: #2196f3;              /* biru: info */
    --v-teks-2: #515365;            /* teks sekunder tabel dan form */
    --v-sukses: #00ab55;            /* hijau: sukses */
    --v-permukaan-gelap: #1b2e4b;   /* permukaan tema gelap */
    --v-kartu-gelap: #191e3a;       /* kartu tema gelap */
    --v-peringatan: #e2a03f;        /* kuning: peringatan */
    --v-latar-gelap-2: #060818;     /* latar paling gelap */
    --v-abu: #d3d3d3;               /* abu netral */
    --v-teal: #009688;              /* teal */
    --v-biru-redup: #506690;        /* biru redup */
    --v-oranye: #e95f2b;            /* oranye */
}

/* =====================================================================
   CBT Thariq Bin Ziyad — identitas visual
   Palet resmi LPIT TBZ: hijau #008000 (primer), biru #003399 (sekunder),
   oranye #FF6600 (aksen SAJA — jangan jadi latar teks putih).
   Dimuat paling akhir di <head> lewat app/Views/Layout/_tbz_head.php
   ===================================================================== */

:root {
    --tbz-green-900: #004D00;
    --tbz-green-700: #006400;
    --tbz-green-500: #008000;
    --tbz-green-100: #E6F2E6;
    --tbz-green-050: #F3F9F3;
    --tbz-blue-900: #002266;
    --tbz-blue-500: #003399;
    --tbz-blue-100: #E6EBF5;
    --tbz-orange-700: #B34700;
    --tbz-orange-500: #FF6600;
    --tbz-orange-100: #FFF0E6;
    --tbz-neutral-900: #1A1A1A;
    --tbz-neutral-500: #6B7280;
    --tbz-neutral-100: #F5F5F5;

    --bs-primary: #008000;
    --bs-primary-rgb: 0, 128, 0;
    --bs-link-color: #006400;
    --bs-link-color-rgb: 0, 100, 0;
    --bs-link-hover-color: #004D00;
}

/* ---------- Komponen umum (panel admin & peserta) ---------- */
a {
    color: var(--tbz-green-700);
}

.form-control:hover {
    border-color: #99cc99;
    box-shadow: 0 3px 8px rgba(0, 128, 0, .12);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--tbz-green-500) !important;
    box-shadow: 0 0 0 .2rem rgba(0, 128, 0, .18) !important;
}

.form-control:focus~label,
.form-group>label:has(+ .form-control:focus) {
    color: var(--tbz-green-700);
}

body.dark .form-control:hover {
    border-color: #4d994d;
}

body.dark .form-control:focus~label,
body.dark .form-group>label:has(+ .form-control:focus) {
    color: #66b366;
}

/* Tombol: tbz-tombol.css (D4.3e) */

.form-check-input:checked {
    background-color: var(--tbz-green-500);
    border-color: var(--tbz-green-500);
}

.page-item.active .page-link {
    background-color: var(--tbz-green-500);
    border-color: var(--tbz-green-500);
}

/* SweetAlert2 tombol konfirmasi */
.swal2-styled.swal2-confirm {
    background-color: var(--tbz-green-500) !important;
}

/* Garis aksen oranye kecil — penanda identitas TBZ */
.tbz-accent {
    display: inline-block;
    width: 44px;
    height: 4px;
    border-radius: 4px;
    background: var(--tbz-orange-500);
}

/* Footer kredit */
.tbz-credit {
    font-size: .78rem;
    color: var(--tbz-neutral-500);
}

.tbz-credit a {
    color: inherit;
    text-decoration: none;
}

/* ---------- Sidebar panel ---------- */
#sidebar .theme-brand .navbar-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

/* Nama aplikasi + nama unit: dua baris rapi, tidak terpotong oleh tombol « */
#sidebar .theme-brand .nav-logo {
    min-width: 0;
    flex: 1 1 auto;
    align-items: center;
}

#sidebar .theme-brand div.theme-text {
    min-width: 0;
    flex: 1 1 auto;
}

#sidebar .theme-brand div.theme-text a.tbz-brand {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    padding: 0 0 0 10px !important;
    min-width: 0;
    white-space: normal;
    line-height: 1.15;
}

#sidebar .theme-brand .tbz-brand__nama {
    color: var(--tbz-green-900);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .1px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

#sidebar .theme-brand .tbz-brand__unit {
    color: var(--tbz-neutral-500);
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.dark #sidebar .theme-brand .tbz-brand__nama {
    color: #e6f2e6;
}

body.dark #sidebar .theme-brand .tbz-brand__unit {
    color: #9aa7a0;
}

/* Judul di header atas panel */
.tbz-header-judul {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--tbz-green-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60vw;
}

.tbz-header-judul small {
    font-weight: 600;
    color: var(--tbz-neutral-500);
    margin-left: .35rem;
}

body.dark .tbz-header-judul {
    color: #e6f2e6;
}

/* Pratinjau logo unit di Pengaturan, meniru tampilan di halaman login */
.tbz-preview-logo {
    display: inline-flex;
    padding: 14px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--tbz-green-700), var(--tbz-green-500));
}

.tbz-preview-logo img {
    width: 88px;
    height: 88px;
    object-fit: contain;
    background: #fff;
    border-radius: 14px;
    padding: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
}

/* =====================================================================
   HALAMAN LOGIN (peserta & panel)
   ===================================================================== */
.tbz-auth-body {
    margin: 0;
    background: #fff;
}

.tbz-auth {
    font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
    min-height: 100vh;
    margin: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    background: #fff;
    color: var(--tbz-neutral-900);
}

.tbz-auth__brand {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 56px;
    color: #fff;
    background:
        radial-gradient(1200px 600px at -10% 110%, rgba(16, 185, 129, .22), transparent 60%),
        linear-gradient(160deg, #0F172A 0%, #064E3B 100%);
}

/* Pola geometris islami halus (8 titik) — dekoratif */
.tbz-auth__brand::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .07;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23fff' stroke-width='1.2'%3E%3Cpath d='M40 8l9.4 22.6L72 40l-22.6 9.4L40 72l-9.4-22.6L8 40l22.6-9.4z'/%3E%3Crect x='22' y='22' width='36' height='36' transform='rotate(45 40 40)'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 80px 80px;
    pointer-events: none;
}

.tbz-auth__brand>* {
    position: relative;
}

.tbz-auth__org {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Logo resmi selalu di atas kartu putih (aturan brand: jangan di latar jenuh) */
.tbz-logo-chip {
    background: #fff;
    border-radius: 18px;
    padding: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
    display: inline-flex;
}

.tbz-logo-chip img {
    width: 92px;
    height: 92px;
    object-fit: contain;
}

.tbz-auth__org small {
    display: block;
    opacity: .85;
    font-size: .82rem;
    letter-spacing: .4px;
    text-transform: uppercase;
}

.tbz-auth__org strong {
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.2;
}

.tbz-auth__hero h1 {
    font-size: clamp(1.9rem, 3vw, 2.6rem);
    font-weight: 800;
    line-height: 1.15;
    margin: 18px 0 12px;
}

.tbz-auth__hero p {
    font-size: 1.02rem;
    max-width: 440px;
    opacity: .92;
    margin: 0;
}

.tbz-auth__points {
    list-style: none;
    padding: 0;
    margin: 26px 0 0;
    display: grid;
    gap: 10px;
}

.tbz-auth__points li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: .95rem;
}

.tbz-auth__points li::before {
    content: "";
    flex: 0 0 8px;
    height: 8px;
    margin-top: 7px;
    border-radius: 2px;
    transform: rotate(45deg);
    background: var(--tbz-orange-500);
}

.tbz-auth__ayah {
    border-left: 3px solid var(--tbz-orange-500);
    padding: 4px 0 4px 14px;
    font-size: .92rem;
    opacity: .95;
}

.tbz-auth__ayah .ar {
    font-family: 'Amiri', 'Traditional Arabic', 'Scheherazade New', serif;
    font-size: 1.45rem;
    line-height: 1.6;
    direction: rtl;
    display: block;
}

.tbz-auth__panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: #F8FAFC;
}

.tbz-auth__card {
    width: 100%;
    max-width: 420px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    padding: 36px 32px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.04), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
}

.tbz-auth__app {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 26px;
}

.tbz-auth__app img {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.tbz-auth__app b {
    display: block;
    font-size: 1.05rem;
    color: var(--tbz-green-900);
    font-weight: 800;
}

.tbz-auth__app span {
    font-size: .85rem;
    color: var(--tbz-neutral-500);
}

.tbz-auth__card h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--tbz-green-900);
    margin: 0 0 6px;
}

.tbz-auth__card .lead-text {
    color: var(--tbz-neutral-500);
    margin: 10px 0 26px;
    font-size: .95rem;
}

.tbz-field {
    margin-bottom: 18px;
}

.tbz-field label {
    display: block;
    font-weight: 700;
    font-size: .88rem;
    margin-bottom: 6px;
    color: #374151;
}

.tbz-input {
    position: relative;
}

.tbz-input input {
    width: 100%;
    height: 50px;
    border-radius: 12px;
    border: 1.5px solid #d6dbe1;
    background: #fff;
    padding: 0 48px 0 16px;
    font-size: 1rem;
    color: var(--tbz-neutral-900);
    transition: border-color .2s, box-shadow .2s;
}

.tbz-input input:focus {
    outline: none;
    border-color: var(--tbz-green-500);
    box-shadow: 0 0 0 4px rgba(0, 128, 0, .14);
}

.tbz-input input.is-invalid {
    border-color: #dc3545;
}

.tbz-input .toggle-password {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: var(--tbz-neutral-500);
    cursor: pointer;
    display: grid;
    place-items: center;
}
@media (pointer: coarse) {
    .tbz-input .toggle-password { width: 44px; height: 44px; right: 4px; }
}

.tbz-input .toggle-password:hover,
.tbz-input .toggle-password:focus-visible {
    background: var(--tbz-green-100);
    color: var(--tbz-green-700);
    outline: none;
}

.tbz-field .invalid-feedback {
    font-size: .82rem;
}

.tbz-btn {
    width: 100%;
    height: 48px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(180deg, #059669 0%, #047857 100%);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: .2px;
    transition: background .2s, transform .1s, box-shadow .2s;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.28);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tbz-btn:hover {
    background: linear-gradient(180deg, #047857 0%, #065F46 100%);
    box-shadow: 0 6px 18px rgba(5, 150, 105, 0.38);
}

.tbz-btn:active {
    transform: translateY(1px);
}

.tbz-btn:disabled {
    opacity: .7;
    cursor: wait;
}

.tbz-btn .spinner-border {
    width: 1rem;
    height: 1rem;
    border-width: .15em;
}

/* ---- Login dengan Google (panel): tombol putih bergaris + logo G, bukan tombol hijau utama ---- */
.tbz-btn--google {
    background: #fff;
    color: var(--tbz-neutral-900);
    border: 1.5px solid #d6dbe1;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
    height: 54px;
    border-radius: 16px;
    gap: 12px;
    font-weight: 700;
    letter-spacing: 0;
    text-decoration: none;
    cursor: pointer;
}

.tbz-btn--google:hover {
    background: #fff;
    color: var(--tbz-neutral-900);
    border-color: var(--tbz-green-500);
    box-shadow: 0 6px 18px rgba(16, 24, 40, .08);
}

.tbz-btn--google:focus-visible {
    outline: none;
    border-color: var(--tbz-green-500);
    box-shadow: 0 0 0 4px rgba(0, 128, 0, .14);
}

.tbz-btn--google .tbz-google-g {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
}

.tbz-btn--google.is-loading {
    pointer-events: none;
    opacity: .75;
}

.tbz-btn--google .spinner-border {
    display: none;
    color: var(--tbz-green-500);
}

.tbz-btn--google.is-loading .spinner-border {
    display: inline-block;
}

.tbz-btn--google.is-loading .tbz-google-g {
    display: none;
}

.tbz-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 20px;
    color: var(--tbz-neutral-500);
    font-size: .88rem;
}

.tbz-divider::before,
.tbz-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e3e7ec;
}

.tbz-alert--galat {
    border: 1px solid #f1b0b7;
    background: #fdecee;
    color: #842029;
    border-radius: 12px;
    padding: 11px 14px;
    margin: 0 0 16px;
    font-size: .92rem;
    line-height: 1.45;
}

.tbz-auth__note {
    margin-top: 22px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--tbz-orange-100);
    color: #5a2a00;
    font-size: .85rem;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.tbz-auth__note svg {
    flex: 0 0 18px;
    color: var(--tbz-orange-700);
    margin-top: 1px;
}

.tbz-auth__foot {
    margin-top: 28px;
    text-align: center;
}

/* Mobile / tablet — satu kolom, panel brand jadi header ringkas */
@media (max-width: 991.98px) {
    .tbz-auth {
        grid-template-columns: 1fr;
    }

    .tbz-auth__brand {
        padding: 22px 20px 26px;
        gap: 0;
    }

    .tbz-auth__hero,
    .tbz-auth__ayah {
        display: none;
    }

    .tbz-logo-chip {
        padding: 6px;
        border-radius: 14px;
    }

    .tbz-logo-chip img {
        width: 56px;
        height: 56px;
    }

    .tbz-auth__panel {
        justify-content: flex-start;
        padding: 28px 18px 36px;
    }

    .tbz-auth__app {
        display: none;
    }
}

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

/* =====================================================================
   PAPAN TULIS TANGAN (jawaban esai dengan Apple Pencil)
   ===================================================================== */
.tbz-papan {
    border: 1px solid #d1d5db;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    /* Seluruh papan (termasuk toolbar) kebal seleksi teks & menu tekan-lama iOS */
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.tbz-papan__alat,
.tbz-papan__kaki {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--tbz-green-050);
}

.tbz-papan__alat {
    border-bottom: 1px solid #e5e7eb;
}

.tbz-papan__kaki {
    border-top: 1px solid #e5e7eb;
    justify-content: space-between;
}

.tbz-papan__sela {
    flex: 1 1 auto;
}

/* Target sentuh minimal 44px (pedoman Apple) */
.tbz-papan button {
    min-height: 44px;
    touch-action: manipulation;   /* tanpa jeda ketuk ganda / zoom */
    padding: 0 14px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
    color: var(--tbz-neutral-900);
    font-size: .95rem;
}

.tbz-papan button.aktif {
    border-color: var(--tbz-green-500);
    background: var(--tbz-green-100);
    color: var(--tbz-green-900);
    font-weight: 700;
}

.tbz-papan__bidang {
    position: relative;
    width: 100%;
    /* garis bantu kertas; ukuran baris diatur JS mengikuti skala papan */
    background-color: #fff;
    background-image: linear-gradient(to bottom, transparent calc(100% - 1px), #dfe7ee calc(100% - 1px));
    background-size: 100% 48px;
    touch-action: none;
    overscroll-behavior: contain;
}

.tbz-papan__titik {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: -1px;
}

.tbz-papan button.tbz-papan__bahaya {
    color: #b45309;
}

.tbz-papan canvas {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    /* Ukuran tampil harus = bidang; jangan biarkan kanvas tampil sebesar resolusi pikselnya (iPad 2x) */
    width: 100%;
    height: 100%;
    touch-action: none;           /* menulis tidak ikut menggulir halaman */
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;  /* cegah menu tekan-lama iOS */
    cursor: crosshair;
}

.tbz-papan canvas.mode-hapus {
    cursor: cell;
}

.tbz-papan__info {
    color: var(--tbz-neutral-500);
}

/* Tombol buka papan di soal esai */
.tbz-esai-tulis {
    min-height: 44px;
}

/* Tampilan coretan siswa di panel koreksi guru */
.tbz-coretan-guru {
    max-width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
}

.tbz-papan__dasar {
    pointer-events: none;
}

/* ---------- Penanda "Bagian dari TBZ DMS" (Layout/_tbz_dms.php) ---------- */
.tbz-dms {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .78rem;
    color: #566170; /* kontras ≥ 4,5:1 di atas putih dan abu muda */
    white-space: nowrap;
}

.tbz-dms__logo {
    height: 30px;
    width: auto;
}

/* Logo tidak punya versi putih: di latar gelap taruh di kartu putih kecil (aturan identitas TBZ) */
body.dark .tbz-dms { color: #a1a9b6; }
body.dark .tbz-dms__logo {
    background: #fff;
    border-radius: 6px;
    padding: 2px 6px;
    box-sizing: content-box;
}

.footer-wrapper .tbz-dms {
    margin: 0;
}

/* Dashboard per peran (C5): teks panjang boleh menyusut di dalam flex */
.tbz-dasbor .min-w-0 { min-width: 0; }

/* ---------- Pemberitahuan pengawas (assets/js/tbz-notifikasi.js) ---------- */
.tbz-notif {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: min(360px, calc(100vw - 32px));
}

.tbz-notif__item {
    position: relative;
    padding: 10px 36px 10px 14px;
    border-radius: 12px;
    border-left: 5px solid #dc3545;
    background: #fff;
    color: #1a1a1a;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
    font-size: .9rem;
    animation: tbz-notif-masuk .2s ease-out;
}

.tbz-notif__judul {
    font-weight: 700;
    color: #b42318;
    margin-bottom: 4px;
}

.tbz-notif__item ul {
    margin: 0;
    padding-left: 18px;
}

.tbz-notif__tutup {
    position: absolute;
    top: 4px;
    right: 6px;
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    font-size: 1.3rem;
    line-height: 1;
    color: #6b7280;
}

@keyframes tbz-notif-masuk {
    from { transform: translateY(8px); opacity: 0; }
    to { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .tbz-notif__item { animation: none; }
}

body.dark .tbz-notif__item { background: #1e293b; color: #e6e6e6; }

/* =====================================================================
   Header siswa TBZ (Layout/main_peserta.php) — menggantikan header template vendor.
   Putih + garis hijau resmi, logo unit, nama aplikasi & sekolah, akun berupa inisial (tanpa foto).
   ===================================================================== */
body.tbz-siswa #content {
    margin-top: 0;               /* template memberi 119px untuk header melayang yang kini tidak ada */
}

body.tbz-siswa .layout-top-spacing {
    margin-top: 16px;
}

.tbz-kepala {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: #fff;
    border-bottom: 3px solid var(--tbz-green-500);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .04);
}

.tbz-kepala__isi {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: 1320px;           /* selebar container-xxl konten */
    margin: 0 auto;
    padding: 10px 32px;
}

.tbz-kepala__merek {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    text-decoration: none;
}

.tbz-kepala__logo {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.tbz-kepala__teks {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.2;
}

.tbz-kepala__aplikasi {
    color: var(--tbz-green-900);
    font-size: 1.1rem;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tbz-kepala__sekolah {
    color: var(--tbz-neutral-500);
    font-size: .8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tbz-kepala__aksi {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.tbz-kepala__tombol,
.tbz-kepala__akun {
    min-height: 44px;            /* target sentuh iPad (Apple HIG) */
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--tbz-neutral-900);
}

.tbz-kepala__tombol {
    width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tbz-kepala__tombol:hover,
.tbz-kepala__akun:hover,
.tbz-kepala__akun[aria-expanded="true"] {
    background: var(--tbz-green-050);
    border-color: var(--tbz-green-100);
}

.tbz-kepala__tombol:focus-visible,
.tbz-kepala__akun:focus-visible {
    outline: 3px solid rgba(0, 128, 0, .35);
    outline-offset: 2px;
}

.tbz-kepala__tombol svg { width: 20px; height: 20px; }
.tbz-ikon-ke-terang { display: none; }
body.dark .tbz-ikon-ke-gelap { display: none; }
body.dark .tbz-ikon-ke-terang { display: inline-block; }

.tbz-kepala__akun {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    max-width: 280px;
}

.tbz-avatar {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--tbz-green-500);
    color: #fff;
    font-size: .85rem;
    font-weight: 800;
    letter-spacing: .02em;
}

.tbz-avatar--besar {
    width: 44px;
    height: 44px;
    font-size: 1rem;
}

.tbz-kepala__nama {
    min-width: 0;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tbz-kepala__panah { width: 16px; height: 16px; flex: 0 0 auto; color: var(--tbz-neutral-500); }

/* Pembungkus menu akun sengaja BUKAN .dropdown: CSS template memaksa ".dropdown .dropdown-menu" tampil (display:block
   !important, hanya visibility:hidden) dan mematikan posisi Popper (transform/top !important) → menu tertutup tetap
   menempati ruang di luar layar dan halaman bisa digeser ke samping di layar sempit. */
.tbz-kepala__dropdown {
    position: relative;
}

.tbz-kepala__menu {
    min-width: 240px;
    padding: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
}

.tbz-kepala__profil {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
}

.tbz-kepala__profil strong { display: block; color: var(--tbz-neutral-900); line-height: 1.25; }
.tbz-kepala__profil small { color: var(--tbz-neutral-500); }

.tbz-kepala__keluar {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    border-radius: 8px;
    color: #b42318;
    font-weight: 600;
}

.tbz-kepala__keluar svg { width: 18px; height: 18px; }
.tbz-kepala__keluar:hover,
.tbz-kepala__keluar:focus { background: #fde2e2; color: #b42318; }

/* Selama mengerjakan soal header disembunyikan (mode fokus, lihat tbz-ujian.css) */
body.tbz-ujian .tbz-kepala { display: none; }

@media (max-width: 1199px) {
    .tbz-kepala__isi { padding: 10px 16px; }
}

/* iPad potret / layar sempit: nama siswa cukup di menu, nama sekolah tetap tampil */
@media (max-width: 575px) {
    .tbz-kepala__nama,
    .tbz-kepala__panah { display: none; }
    .tbz-kepala__akun { padding: 4px; }
    .tbz-kepala__aplikasi { font-size: 1rem; }
}

/* Kartu di halaman siswa bertema gelap: CSS gelap template hanya mengganti latar kartu (var(--v-kartu-gelap)), warna teks tetap
   --bs-body-color (gelap) → angka tanpa kelas warna (Nilai akhir, Poin di halaman Hasil) hampir tak terlihat */
body.dark.tbz-siswa .card { color: var(--v-garis); }

body.dark .tbz-kepala { background: var(--v-latar-gelap); border-bottom-color: var(--tbz-green-700); box-shadow: none; }
body.dark .tbz-kepala__aplikasi { color: #e6f2e6; }
body.dark .tbz-kepala__sekolah,
body.dark .tbz-kepala__panah { color: #9aa6b8; }
body.dark .tbz-kepala__tombol,
body.dark .tbz-kepala__akun { color: var(--v-garis); }
body.dark .tbz-kepala__tombol:hover,
body.dark .tbz-kepala__akun:hover,
body.dark .tbz-kepala__akun[aria-expanded="true"] { background: #1b2230; border-color: #2e3a4d; }
body.dark .tbz-kepala__menu { background: #1b2230; border-color: #2e3a4d; }
body.dark .tbz-kepala__profil strong { color: #e6e9ef; }
body.dark .tbz-kepala__keluar { color: #ff8a80; }
body.dark .tbz-kepala__keluar:hover,
body.dark .tbz-kepala__keluar:focus { background: #3a1c1c; color: #ffb4ab; }

/* ---------- Foto pada avatar (tbz_avatar): menutupi inisial; hilang sendiri bila gagal dimuat ---------- */
.tbz-avatar { position: relative; overflow: hidden; }
.tbz-avatar__foto {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;   /* foto siswa 3×4: wajah di bagian atas */
    border-radius: 50%;
    background: #fff;
}

/* Item menu biasa di dropdown akun siswa (Beranda, Analisis Belajar) */
.tbz-kepala__menu-item {
    display: flex; align-items: center; gap: 8px; min-height: 42px; border-radius: 8px;
    color: var(--tbz-neutral-900); font-weight: 600;
}
.tbz-kepala__menu-item svg { width: 18px; height: 18px; }
.tbz-kepala__menu-item:hover, .tbz-kepala__menu-item:focus { background: var(--tbz-green-050); color: var(--tbz-green-900); }
body.dark .tbz-kepala__menu-item { color: var(--v-garis); }
body.dark .tbz-kepala__menu-item:hover, body.dark .tbz-kepala__menu-item:focus { background: #1b2230; color: #e6f2e6; }

/* =====================================================================
   Penyempurnaan UI/UX (27 Okt 2026): login proporsional di semua layar + header siswa modern
   ===================================================================== */

/* ---------- Login (peserta & panel): pas satu layar laptop/iPad, tidak terpotong ---------- */
.tbz-auth {
    min-height: 100vh;
    min-height: 100dvh;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.tbz-auth__brand {
    padding: clamp(24px, 5vh, 48px) clamp(28px, 4.5vw, 56px);
    gap: clamp(12px, 3vh, 28px);
}

.tbz-logo-chip { padding: clamp(6px, 1vh, 10px); border-radius: 16px; }
.tbz-logo-chip img { width: clamp(60px, 11vh, 92px); height: clamp(60px, 11vh, 92px); }

.tbz-auth__hero h1 {
    font-size: clamp(1.5rem, 2.2vw + 1.2vh, 2.5rem);
    margin: clamp(10px, 2vh, 18px) 0 clamp(8px, 1.4vh, 12px);
}

.tbz-auth__hero p { font-size: clamp(.92rem, .35vw + .75rem, 1.02rem); }
.tbz-auth__points { margin-top: clamp(14px, 2.6vh, 26px); gap: clamp(6px, 1.2vh, 10px); }
.tbz-auth__ayah .ar { font-size: clamp(1.2rem, 2.4vh, 1.45rem); }

.tbz-auth__panel {
    padding: clamp(20px, 4vh, 40px) clamp(16px, 3vw, 24px);
    justify-content: flex-start;
    overflow-y: auto;
}

/* margin:auto memusatkan kartu bila muat, dan tetap bisa digulir dari atas bila tidak muat (tanpa terpotong) */
.tbz-auth__card {
    margin: auto 0;
    max-width: 420px;
    padding: clamp(22px, 4vh, 36px) clamp(20px, 2.6vw, 32px);
}

.tbz-auth__app { margin-bottom: clamp(14px, 2.6vh, 26px); }
.tbz-auth__card h2 { font-size: clamp(1.35rem, 1.2vw + 1rem, 1.6rem); }
.tbz-auth__card .lead-text { margin: clamp(6px, 1.2vh, 10px) 0 clamp(14px, 2.6vh, 26px); }
.tbz-field { margin-bottom: clamp(12px, 2vh, 18px); }
.tbz-input input, .tbz-btn { height: clamp(44px, 6.4vh, 50px); }
.tbz-auth__note { margin-top: clamp(14px, 2.4vh, 22px); }
.tbz-auth__foot { margin-top: clamp(14px, 2.6vh, 28px); }

/* Layar pendek (laptop kecil, iPad lanskap dengan bilah Safari): ringkas konten dekoratif */
@media (max-height: 760px) and (min-width: 992px) {
    .tbz-auth__app { display: none; }              /* ikon+nama aplikasi sudah ada di panel kiri */
    .tbz-auth__points li:nth-child(3) { display: none; }
}

@media (max-height: 640px) and (min-width: 992px) {
    .tbz-auth__points { display: none; }
    .tbz-auth__note { display: none; }
}

@media (max-height: 540px) and (min-width: 992px) {
    .tbz-auth__ayah { display: none; }
}

/* iPad potret & ponsel: satu kolom, kartu tidak menempel tepi dan tidak kekecilan */
@media (max-width: 991.98px) {
    .tbz-auth { min-height: 100dvh; }
    .tbz-auth__panel { padding: 24px 18px 32px; background: #F8FAFC; }
    .tbz-auth__card { margin: 0 auto; max-width: 480px; }
    .tbz-auth__brand { padding: 18px 20px; }
}

@media (max-width: 575.98px) {
    .tbz-auth__card { padding: 22px 18px; border-radius: 14px; box-shadow: none; }
}

/* ---------- Header siswa: ringan & bersih (tanpa garis hijau tebal) ---------- */
.tbz-kepala {
    border-bottom: 1px solid #E2E8F0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

body.dark .tbz-kepala { border-bottom-color: #1f2a3d; }
.tbz-kepala__aplikasi { color: #0F172A; }
.tbz-kepala__sekolah { color: #64748B; }
body.dark .tbz-kepala__aplikasi { color: #e6e9ef; }

/* Kanvas siswa: Slate 50 */
body.tbz-siswa:not(.dark) { background-color: #F8FAFC; }

/* iPad potret / ponsel: HARUS satu kolom (menimpa grid dua kolom di atas yang dideklarasikan lebih akhir) */
@media (max-width: 991.98px) {
    .tbz-auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .tbz-auth__panel { overflow: visible; }
}

/* Aksesibilitas (axe, WCAG AA): teks redup bawaan template (var(--v-teks-redup), kontras 3,2:1) diganti slate 500 (4,8:1 di atas putih) */
body.tbz-siswa:not(.dark) .text-muted { color: #64748b !important; }
body.tbz-siswa:not(.dark) #datetime-text { color: #64748b; }
body.tbz-siswa:not(.dark) .f-section-1 p,
body.tbz-siswa:not(.dark) .dynamic-year { color: #5b6b80; }
/* Lencana hijau: putih di atas #10b981 hanya 2,5:1; hijau resmi TBZ 5,1:1 */
body.tbz-siswa .badge.bg-success { background-color: #008000 !important; }
/* Teks peringatan kuning (var(--v-peringatan)) di atas putih hanya 2,2:1; amber tua 7:1. Tombol hijau template (var(--v-sukses)) 3,0:1 → hijau resmi TBZ */
body.tbz-siswa:not(.dark) .text-warning { color: #92400e !important; }
