/* ==========================================================================
   Gaya tambahan panel form: rekap (tipe soal baru) dan Kelola Akses.
   Melengkapi css/form.css (jangan menimpa kelas dasarnya).
   ========================================================================== */

/* ---------- Ringkasan: kartu angka / unggah dan sub-batang grid ---------- */
.rk-mini-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.rk-mini { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 10px 12px; min-width: 0; }
.rk-mini-v { font-size: 22px; font-weight: 800; color: #003366; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rk-mini-l { margin-top: 2px; font-size: 12px; font-weight: 600; color: #64748b; }
.rk-sub-grup { margin-top: 14px; padding-top: 10px; border-top: 1px dashed #e2e8f0; }
.rk-sub-grup:first-of-type { border-top: 0; }
.rk-sub-judul { font-size: 13px; font-weight: 700; color: #0f172a; }

/* ---------- Tabel isian: sel tipe baru ---------- */
.rk-c-grid { min-width: 220px; max-width: 340px; }
.rk-c-sembunyi { opacity: .72; }
.rk-tabel th.rk-c-sembunyi { font-style: italic; }
.rk-bintang { color: #f59e0b; letter-spacing: 1px; white-space: nowrap; font-size: 15px; }
.rk-grid-isi { display: flex; flex-direction: column; gap: 3px; }
.rk-grid-baris { font-size: 13px; color: #334155; line-height: 1.35; }
.rk-grid-baris b { font-weight: 700; color: #0f172a; margin-right: 4px; }
.rk-grid-baris b::after { content: ":"; }
.rk-berkas-list { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.rk-berkas, .rk-tautan { display: inline-block; max-width: 100%; padding: 0; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; color: #0055a4; text-align: left; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; overflow-wrap: anywhere; }
.rk-berkas:hover, .rk-tautan:hover { color: #003366; }
.rk-berkas:disabled { opacity: .55; cursor: progress; }

/* ---------- Kelola Akses ---------- */
.ka-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid #e2e8f0; }
.ka-tabel { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.ka-tabel th { text-align: left; padding: 11px 14px; background: #f8fafc; border-bottom: 1px solid #e2e8f0; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #64748b; white-space: nowrap; }
.ka-tabel td { padding: 12px 14px; border-bottom: 1px solid #f1f5f9; color: #1e293b; vertical-align: middle; }
.ka-tabel tbody tr:last-child td { border-bottom: 0; }
.ka-tabel tbody tr:hover td { background: #f8fbff; }
.ka-nama { font-weight: 700; color: #0f172a; }
.ka-user { font-size: 12.5px; color: #64748b; }
.ka-saya { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 9999px; background: #fff7ed; color: #c2410c; font-size: 11px; font-weight: 700; vertical-align: middle; }
.ka-chip { display: inline-block; padding: 3px 11px; border-radius: 9999px; background: #e0ecf8; color: #003366; font-size: 12px; font-weight: 700; white-space: nowrap; }
.ka-catatan { color: #475569; max-width: 260px; overflow-wrap: anywhere; }
.ka-diubah { font-size: 12.5px; color: #64748b; white-space: nowrap; }
.ka-tabel .ka-aksi { text-align: right; white-space: nowrap; }
.ka-tabel th.ka-aksi { text-align: right; }

/* sakelar aktif */
.ka-switch { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; font-size: 13px; font-weight: 700; color: #475569; }
.ka-switch-trek { position: relative; width: 42px; height: 24px; border-radius: 9999px; background: #cbd5e1; transition: background .15s; flex: none; }
.ka-switch-trek::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 9999px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.ka-switch[aria-checked="true"] .ka-switch-trek { background: #16a34a; }
.ka-switch[aria-checked="true"] .ka-switch-trek::after { transform: translateX(18px); }
.ka-switch:focus-visible { outline: none; }
.ka-switch:focus-visible .ka-switch-trek { box-shadow: 0 0 0 3px #fff, 0 0 0 5px #0055a4; }
.ka-switch:disabled { opacity: .6; cursor: progress; }

/* modal */
.ka-modal { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(15,23,42,.55); }
.ka-modal.hidden { display: none; }
.ka-dialog { width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; background: #fff; border-radius: 16px; box-shadow: 0 25px 50px -12px rgba(0,0,0,.35); padding: 20px; }
.ka-dialog h2 { font-size: 19px; font-weight: 800; color: #0f172a; }
.ka-field { margin-top: 16px; }
.ka-ac { position: relative; }
.ka-ac-daftar { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5; max-height: 240px; overflow: auto; background: #fff; border: 1px solid #cbd5e1; border-radius: 10px; box-shadow: 0 12px 28px -10px rgba(15,23,42,.35); }
.ka-ac-daftar.hidden { display: none; }
.ka-ac-item { display: block; width: 100%; min-height: 44px; padding: 8px 12px; border: 0; border-bottom: 1px solid #f1f5f9; background: #fff; text-align: left; font: inherit; cursor: pointer; }
.ka-ac-item:last-child { border-bottom: 0; }
.ka-ac-item:hover, .ka-ac-item.is-aktif { background: #eff6ff; }
.ka-ac-item b { display: block; font-size: 14px; color: #0f172a; }
.ka-ac-item span { font-size: 12.5px; color: #64748b; }
.ka-ac-info { padding: 10px 12px; font-size: 13px; color: #64748b; }
.ka-pilih { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1.5px solid #003366; border-radius: 8px; background: #eff6ff; }
.ka-pilih.hidden { display: none; }
.ka-pilih b { display: block; font-size: 14px; color: #0f172a; overflow-wrap: anywhere; }
.ka-pilih span { font-size: 12.5px; color: #64748b; }
.ka-peran { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1.5px solid #e2e8f0; border-radius: 8px; cursor: pointer; margin-top: 6px; }
.ka-peran:has(input:checked) { border-color: #003366; background: #eff6ff; }
.ka-peran input { margin-top: 3px; accent-color: #003366; width: 18px; height: 18px; flex: none; }
.ka-peran b { display: block; font-size: 14px; color: #0f172a; }
.ka-peran span { font-size: 12.5px; color: #64748b; line-height: 1.45; }
.ka-aktif-baris { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ka-dialog-aksi { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 22px; }
.ka-galat { margin-top: 14px; }

/* tabel akses menjadi kartu di layar sempit */
@media (max-width: 719px) {
  .ka-tabel, .ka-tabel tbody, .ka-tabel tr, .ka-tabel td { display: block; width: 100%; }
  .ka-tabel thead { display: none; }
  .ka-tabel tr { padding: 14px 16px; border-bottom: 1px solid #e2e8f0; }
  .ka-tabel tbody tr:last-child { border-bottom: 0; }
  .ka-tabel td { padding: 3px 0; border: 0; }
  .ka-tabel tbody tr:hover td { background: transparent; }
  .ka-tabel .ka-aksi { text-align: left; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
  .ka-catatan { max-width: none; }
  .ka-dialog-aksi .fm-btn { flex: 1 1 100%; }
  .rk-mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Kartu dua kolom di rekap tidak boleh melebarkan halaman di HP */
.rk-dua > .fm-card { min-width: 0; }
@media (max-width: 899px) { .rk-dua { grid-template-columns: minmax(0, 1fr); } }
