/* ============================================================
   PSB Al-Kamil — Dashboard Panitia Pendaftaran Santri Baru
   Tema: Teal/hijau kebiruan + Maroon/burgundy + Putih (brosur)
   ============================================================ */
:root {
  --teal: #0F766E;
  --teal-d: #115E59;
  --teal-l: #14B8A6;
  --teal-bg: #ECFDF5;
  --maroon: #7F1D1D;
  --maroon-l: #991B1B;
  --ink: #1F2937;
  --muted: #6B7280;
  --line: #E5E7EB;
  --card: #FFFFFF;
  --grad-teal: linear-gradient(135deg, #0F766E, #14B8A6);
  --grad-maroon: linear-gradient(135deg, #7F1D1D, #991B1B);
  --radius: 14px;
  --shadow: 0 10px 30px -14px rgba(15, 118, 110, 0.28);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: #F3F6F5;
  line-height: 1.55;
  min-height: 100vh;
}
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ================= Layout ================= */
.app { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 244px; flex-shrink: 0;
  background: linear-gradient(180deg, #0B3B36 0%, #115E59 55%, #134E4A 100%);
  color: #fff;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.side-brand {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 22px 16px 18px; color: #fff; text-align: center;
}
.side-brand:hover { text-decoration: none; }
.side-brand img { width: 62px; height: 62px; border-radius: 16px; box-shadow: 0 8px 24px -8px rgba(0,0,0,.5); }
.sb-t1 { font-weight: 800; font-size: 13.5px; letter-spacing: 1.2px; margin-top: 4px; }
.sb-t2 { font-size: 10.5px; color: rgba(255,255,255,.75); font-weight: 600; }
.side-nav { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; flex: 1; overflow-y: auto; }
.side-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 10px;
  color: rgba(255,255,255,.82); font-size: 13.5px; font-weight: 600;
  transition: all .15s; white-space: nowrap;
}
.side-link .si { width: 22px; text-align: center; }
.side-badge {
  margin-left: auto; background: var(--grad-maroon); color: #fff; font-size: 10.5px; font-weight: 800;
  border-radius: 999px; padding: 1px 8px; min-width: 20px; text-align: center;
}
.side-link:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.side-link.active {
  background: var(--grad-maroon); color: #fff;
  box-shadow: 0 8px 20px -8px rgba(127,29,29,.8);
}
.side-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.12); }

/* ---------- Main ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 26px; background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.tb-title h1 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -0.3px; }
.tb-title p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.tb-user { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.tb-user .avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--grad-teal); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800;
}
.tb-name { font-size: 13px; font-weight: 700; line-height: 1.2; }
.tb-name small { display: block; color: var(--muted); font-weight: 500; font-size: 11px; }
.content { padding: 24px 26px 60px; flex: 1; max-width: 1240px; width: 100%; margin: 0 auto; }
.app-foot { text-align: center; color: var(--muted); font-size: 11.5px; padding: 14px; border-top: 1px solid var(--line); background: #fff; }

/* ---------- Judul halaman khusus (mis. Tes Kemampuan Akademik) ---------- */
.page-title {
  background: linear-gradient(135deg, #FFFFFF 0%, #F0FDFA 100%);
  border: 1px solid var(--line); border-left: 6px solid var(--maroon);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 22px; margin-bottom: 20px;
}
.page-title h2 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: .5px; color: var(--maroon); }
.page-title p { margin: 4px 0 0; font-size: 12.5px; font-weight: 700; letter-spacing: .6px; color: var(--teal-d); }

/* ================= Kartu & statistik ================= */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px 22px; margin-bottom: 20px;
}
.card h3 { margin: 0 0 4px; font-size: 15.5px; font-weight: 800; }
.card .sub { color: var(--muted); font-size: 12.5px; margin: 0 0 14px; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.card-head h3 { margin: 0; }
.card-head .btn { margin-left: auto; }
.card-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.card-grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px;
  display: flex; align-items: center; gap: 14px;
}
.sc-ico {
  width: 44px; height: 44px; border-radius: 13px; color: #fff; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.sc-ico.teal { background: var(--grad-teal); }
.sc-ico.green { background: linear-gradient(135deg,#16a34a,#22c55e); }
.sc-ico.amber { background: linear-gradient(135deg,#d97706,#f59e0b); }
.sc-ico.red { background: linear-gradient(135deg,#dc2626,#ef4444); }
.sc-ico.maroon { background: var(--grad-maroon); }
.sc-ico.gray { background: linear-gradient(135deg,#64748b,#94a3b8); }
.sc-val { font-size: 22px; font-weight: 800; letter-spacing: -0.4px; line-height: 1.1; }
.sc-lbl { font-size: 11px; color: var(--muted); font-weight: 600; }

.big-num { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }
.mini-stats { display: flex; flex-direction: column; gap: 8px; }
.mini-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #F9FAFB; border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 13px; font-size: 13px;
}
.mini-row.total { background: #FDF2F2; border-color: #FECACA; font-weight: 700; }
.mini-row b { font-weight: 800; font-variant-numeric: tabular-nums; }
.t-green { color: #16a34a; }
.t-red { color: #dc2626; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }

.quick-actions { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }

/* ================= Form ================= */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12.5px; font-weight: 700; }
.field label small { color: var(--muted); font-weight: 500; }
.field .req { color: #dc2626; }
.field input, .field select, .field textarea {
  font-family: inherit; font-size: 14px; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: 10px;
  padding: 10px 13px; outline: none; width: 100%; transition: border .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--teal); box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}
.field textarea { resize: vertical; min-height: 70px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 4px 18px; }
.form-grid .full { grid-column: 1 / -1; }

.check-grid { display: flex; flex-wrap: wrap; gap: 14px; }
.check-item {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 14px;
  font-size: 13.5px; font-weight: 600; background: #fff; cursor: pointer;
}
.check-item:has(input:checked) { border-color: var(--teal); background: var(--teal-bg); }
.check-item input { accent-color: var(--teal); width: 16px; height: 16px; }

/* ================= Tombol ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer;
  border-radius: 10px; padding: 10px 18px; border: 1.5px solid transparent;
  transition: all .15s; text-decoration: none; white-space: nowrap; line-height: 1.2;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--grad-maroon); color: #fff; box-shadow: 0 10px 22px -10px rgba(127,29,29,.8); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-teal { background: var(--grad-teal); color: #fff; box-shadow: 0 10px 22px -10px rgba(15,118,110,.8); }
.btn-ghost { background: #fff; color: var(--teal); border-color: var(--line); }
.btn-ghost:hover { background: var(--teal-bg); }
.btn-danger { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn-success { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.btn-success:hover { background: #d1fae5; }
/* Tombol WhatsApp (hijau WA #25D366, teks putih) */
.btn-wa { background: #25D366; color: #fff !important; border-color: #1da851; box-shadow: 0 10px 22px -10px rgba(37, 211, 102, .85); }
.btn-wa:hover { background: #1ebe5b; color: #fff; text-decoration: none; }
.btn-wa svg { width: 17px; height: 17px; fill: currentColor; flex-shrink: 0; }
.btn-wa.disabled, .btn-wa:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.wa-note { font-size: 12px; font-weight: 600; }
.wa-note.ok { color: #047857; }
.wa-note.warn { color: #b45309; }
.wa-note.err { color: #b91c1c; }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 9px; }
.btn-lg { padding: 13px 26px; font-size: 14.5px; }
.btn-block { width: 100%; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.toolbar .spacer { flex: 1; }
.filterbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filterbar input[type="text"], .filterbar select { padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 10px; font-family: inherit; font-size: 13.5px; outline: none; }
.filterbar input[type="text"] { width: 280px; }
.filterbar input:focus, .filterbar select:focus { border-color: var(--teal); }

.savebar {
  position: sticky; bottom: 12px; z-index: 40;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: rgba(255,255,255,.92); backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 18px;
  box-shadow: 0 14px 36px -16px rgba(15,118,110,.5);
}
.savebar-note { font-size: 12px; color: var(--muted); font-weight: 600; flex: 1 1 220px; }

/* ================= Tabel ================= */
.tablewrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--line); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 700px; background: #fff; }
table.data th {
  text-align: left; padding: 11px 13px; font-size: 11px; text-transform: uppercase;
  letter-spacing: .5px; color: var(--muted); font-weight: 700;
  background: #F8FAF9; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td { padding: 11px 13px; border-bottom: 1px solid #F1F3F2; vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: #F8FAF9; }
table.data .num { width: 40px; color: var(--muted); font-weight: 600; }
table.data .actions { display: flex; gap: 5px; flex-wrap: wrap; }
table.data .actions .btn { padding: 5px 9px; font-size: 11.5px; border-radius: 8px; }
.right { text-align: right; }
.mono { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ================= Badge ================= */
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.badge-green { background: #d1fae5; color: #065f46; }
.badge-amber { background: #fef3c7; color: #92400e; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-teal { background: #ccfbf1; color: #0f766e; }
.badge-gray { background: #f1f5f9; color: #475569; }
.badge-maroon { background: #fae8e8; color: #7f1d1d; }

/* ================= Alert ================= */
.alert { border-radius: 12px; padding: 12px 16px; font-size: 13.5px; font-weight: 600; margin-bottom: 16px; }
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ================= Progress ================= */
.progress { height: 8px; border-radius: 999px; background: #E5E7EB; overflow: hidden; }
.progress > div { height: 100%; border-radius: 999px; background: var(--grad-teal); transition: width .4s; }
.progress-head { display: flex; align-items: center; gap: 12px; }
.progress-pct { font-size: 18px; font-weight: 800; color: var(--teal); margin-left: auto; }

/* ================= Registrasi ================= */
.reg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.reg-item {
  display: flex; align-items: center; gap: 10px;
  border: 1.5px solid var(--line); border-radius: 12px; padding: 13px 15px;
  background: #fff; font-weight: 700; font-size: 14px; cursor: pointer; transition: all .15s;
}
.reg-item:hover { border-color: var(--teal); }
.reg-item input { accent-color: var(--teal); width: 17px; height: 17px; }
.reg-item.done { background: var(--teal-bg); border-color: var(--teal-l); color: var(--teal-d); }

/* ================= Kamar / Kelas ================= */
.kamar-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.kamar-card { margin-bottom: 0; }
.kamar-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.kamar-head h3 { margin: 0; }
.kamar-list { list-style: none; margin: 0 0 10px; padding: 0; }
.kamar-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 11px; background: #F9FAFB; border-radius: 9px; margin-bottom: 6px; font-size: 13px;
}
.assign-form { display: flex; gap: 8px; }
.assign-form select { flex: 1; min-width: 0; border: 1.5px solid var(--line); border-radius: 9px; padding: 8px 10px; font-family: inherit; font-size: 13px; }

/* ================= Modal ================= */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 23, 42, .5); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff; border-radius: 16px; max-width: 760px; width: 100%;
  max-height: 92vh; overflow-y: auto; box-shadow: 0 30px 70px -20px rgba(0,0,0,.4);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 2; }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-x { font-size: 18px; font-weight: 800; color: var(--muted); }
.modal-body { padding: 18px 22px; }
.modal-foot { display: flex; gap: 10px; flex-wrap: wrap; padding: 14px 22px; border-top: 1px solid var(--line); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.detail-grid h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .4px; color: var(--teal); }
.dlist { margin: 0; }
.dlist dt { font-size: 11px; color: var(--muted); font-weight: 600; margin-top: 8px; }
.dlist dd { margin: 1px 0 0; font-size: 13.5px; font-weight: 600; }

/* ================= Login ================= */
.auth-body { background: radial-gradient(900px 500px at 10% -5%, rgba(20,184,166,.25), transparent 55%), radial-gradient(800px 500px at 100% 10%, rgba(127,29,29,.15), transparent 55%), linear-gradient(160deg, #ECFDF5 0%, #F0FDFA 50%, #FFF7F7 100%); background-attachment: fixed; }
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 400px; background: #fff; border-radius: 20px; box-shadow: 0 30px 70px -25px rgba(15,118,110,.4); padding: 30px 32px; }
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-brand img { width: 78px; height: 78px; border-radius: 20px; box-shadow: 0 12px 30px -10px rgba(127,29,29,.5); }
.auth-brand h1 { margin: 14px 0 2px; font-size: 18px; letter-spacing: 1px; color: var(--maroon); }
.auth-brand p { margin: 0; font-size: 12px; font-weight: 700; color: var(--teal-d); letter-spacing: .4px; }
.auth-tag { display: inline-block; margin-top: 6px; font-size: 11px; color: var(--muted); background: #F3F6F5; padding: 3px 12px; border-radius: 999px; font-weight: 600; }
.auth-foot { text-align: center; font-size: 11px; color: var(--muted); margin: 18px 0 0; }

/* ================= Komponen biaya (pengaturan) ================= */
.komponen-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.komponen-item { background: #F9FAFB; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 13px; }
.komponen-item label { display: block; font-size: 11.5px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.money-input { display: flex; align-items: center; gap: 8px; }
.money-input > span { font-weight: 800; color: var(--teal); font-size: 13px; }
.money-input input { flex: 1; min-width: 0; font-family: inherit; font-size: 14.5px; font-weight: 700; border: 1.5px solid var(--line); border-radius: 9px; padding: 8px 11px; outline: none; }
.money-input input:focus { border-color: var(--teal); }
.money-display {
  font-size: 15px; font-weight: 800; color: var(--teal-d);
  background: var(--teal-bg); border: 1.5px solid #ccfbf1; border-radius: 10px;
  padding: 10px 13px; font-variant-numeric: tabular-nums;
}

/* ================= Responsive ================= */
/* Default (layar lebar): sembunyikan hamburger */
.menu-toggle {
  display: none; align-items: center; justify-content: center;
  background: var(--grad-teal); color: #fff; border: none; cursor: pointer;
  width: 38px; height: 38px; border-radius: 10px; font-size: 18px; line-height: 1; flex-shrink: 0;
}

@media (max-width: 900px) {
  .app { flex-direction: row; }
  .menu-toggle { display: inline-flex; }   /* muncul di HP */
  /* Sidebar off-canvas: tampil dari samping kiri saat .sidebar-open */
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; z-index: 90;
    width: 250px; transform: translateX(-100%); transition: transform .25s ease;
    box-shadow: 0 0 40px rgba(0,0,0,.3);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  /* Overlay gelap saat sidebar terbuka */
  .side-overlay {
    position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.45);
    opacity: 0; pointer-events: none; transition: opacity .2s;
  }
  body.sidebar-open .side-overlay { opacity: 1; pointer-events: auto; }
  /* Sidebrand & nav tetap vertikal */
  .side-brand { flex-direction: column; align-items: center; padding: 22px 16px 18px; text-align: center; }
  .side-brand img { width: 62px; height: 62px; }
  .sb-t2 { display: block; }
  .side-nav { flex-direction: column; overflow-y: auto; display: flex; padding: 8px 12px; }
  .side-link { white-space: normal; }
  .side-foot { display: block; }
  .content { padding: 18px 14px 50px; }
  .detail-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   MODUL PRESENSI PANITIA — gaya konsisten dengan aplikasi PSB
   ============================================================ */
.subtabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 18px; }
.subtab {
  padding: 8px 14px; border-radius: 10px; font-size: 12.5px; font-weight: 700;
  background: #fff; color: var(--teal); border: 1.5px solid var(--line); white-space: nowrap;
}
.subtab:hover { background: var(--teal-bg); text-decoration: none; }
.subtab.active { background: var(--grad-maroon); color: #fff; border-color: transparent; box-shadow: 0 8px 20px -8px rgba(127,29,29,.7); }

.kantor-status {
  margin-top: 10px; padding: 14px 18px; border-radius: 12px;
  font-size: 15.5px; font-weight: 800; letter-spacing: .2px;
}
.kantor-status.ok { background: #ecfdf5; color: #065f46; border: 2px solid #a7f3d0; }
.kantor-status.bad { background: #fef2f2; color: #991b1b; border: 2px solid #fecaca; }

.presensi-sukses { border: 2px solid #a7f3d0; background: #f0fdf4; }
.presensi-sukses h3 { color: #065f46; }

/* Wizard presensi */
.prs-steps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.prs-step-dot {
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: #f1f5f9; color: #64748b; border: 1.5px solid var(--line);
}
.prs-step-dot.active { background: var(--grad-teal); color: #fff; border-color: transparent; }
.prs-step-dot.done { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.prs-step { display: none; }
.prs-step.active { display: block; }
.prs-step h4 { margin: 0 0 4px; font-size: 15px; }
.prs-cam {
  position: relative; background: #0f172a; border-radius: 14px; overflow: hidden;
  aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center;
}
.prs-cam video, .prs-cam img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Penting: rule di atas membuat atribut [hidden] tidak lagi menyembunyikan elemen
   (UA stylesheet [hidden]{display:none} kalah oleh display:block di atas) sehingga
   pratinjau selfie kosong sempat tampil sebagai gambar rusak. Paksa tetap disembunyikan. */
.prs-cam [hidden] { display: none !important; }
.prs-cam-selfie { aspect-ratio: 3 / 4; max-height: 340px; }
.prs-info { font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 10px 0 0; }
.prs-info.ok { color: #047857; }
.prs-info.err { color: #b91c1c; }
.prs-map, .presensi-map { border-radius: 12px; overflow: hidden; border: 1.5px solid var(--line); }
.presensi-map iframe { width: 100%; height: 240px; border: 0; display: block; }
.selfie-img { max-width: 190px; border-radius: 10px; border: 1.5px solid var(--line); display: block; margin-top: 6px; }
.qr-box { background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 14px; display: inline-block; }
.qr-box img, .qr-box canvas { display: block; }
.stat-card .sc-ico.gray { background: linear-gradient(135deg,#64748b,#94a3b8); }
#live-badge { animation: livePulse 2s ease-in-out infinite; }
@keyframes livePulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

@media (max-width: 900px) {
  .prs-cam-selfie { aspect-ratio: 4 / 5; max-height: 300px; }
  .subtabs { gap: 6px; }
  .subtab { padding: 7px 11px; font-size: 11.5px; }
  .kantor-status { font-size: 14px; padding: 12px 14px; }
  .presensi-map iframe { height: 180px; }
}
@media print {
  .subtabs, .modal-overlay { display: none !important; }
}

/* ============================================================
   MODUL TES KEMAMPUAN AKADEMIK (TKA) v2 — sisi peserta & admin
   ============================================================ */
/* ---------- Sisi peserta (mobile-first) ---------- */
.tes-body { background: linear-gradient(160deg,#F0FDF4 0%,#F4FBF5 45%,#EEF9F1 100%); }
.tes-wrap { max-width: 680px; margin: 0 auto; padding: 18px 14px 50px; }
.tes-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.tes-head img { width: 52px; height: 52px; border-radius: 14px; box-shadow: var(--shadow); flex-shrink: 0; }
.tes-head h1 { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: .2px; color: var(--maroon); }
.tes-head p { margin: 2px 0 0; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.tes-kartu { border-radius: 16px; }
.tes-ident { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tes-nama { font-size: 17px; font-weight: 800; letter-spacing: -.2px; }
.tes-status { flex-shrink: 0; }
.tes-item-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.tes-item-head b { font-size: 15.5px; }
.tes-no {
  display: inline-flex; width: 24px; height: 24px; border-radius: 8px; background: var(--grad-teal); color: #fff;
  align-items: center; justify-content: center; font-size: 12.5px; font-weight: 800; margin-right: 4px;
}
.tes-tanda { font-size: 11.5px; font-weight: 800; color: var(--muted); background: #f1f5f9; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.tes-tanda.ok { background: #d1fae5; color: #065f46; }
.tes-aksi { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0 6px; }
.tes-aksi .btn { min-height: 46px; padding: 12px 18px; font-size: 14px; }
.tes-aksi label.btn { cursor: pointer; }
.tes-daftar { margin-top: 10px; }
.tes-sudah { font-size: 12px; font-weight: 700; color: #047857; margin-bottom: 6px; }
.tes-media {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: rgba(255,255,255,.75); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px;
}
.tes-media-info { flex: 1 1 150px; min-width: 0; display: flex; flex-direction: column; }
.tes-media-info b { font-size: 13px; }
.tes-media-info span { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.tes-thumb { width: 108px; height: 78px; object-fit: cover; border-radius: 10px; border: 1.5px solid var(--line); cursor: zoom-in; }
.tes-vid { width: 100%; max-width: 100%; border-radius: 12px; background: #0f172a; max-height: 260px; }
.tes-aud { width: 100%; max-width: 300px; }
.tes-up, .tes-ok, .tes-err { font-size: 12.5px; font-weight: 700; margin-bottom: 6px; }
.tes-ok { color: #047857; } .tes-err { color: #b91c1c; }
.tes-pilih { width: 100%; }
/* Bagian ke-6 (isian reflektif) — textarea nyaman di HP, counter karakter di kanan */
.tes-motivasi {
  width: 100%; min-height: 170px; resize: vertical; font-family: inherit; font-size: 14px; line-height: 1.6;
  padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; color: var(--ink); background: #fff;
}
.tes-motivasi:focus { outline: none; border-color: var(--teal-l); box-shadow: 0 0 0 3px rgba(20,184,166,.16); }
.tes-motivasi-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.tes-counter {
  font-size: 12px; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.tes-counter.cukup { color: #047857; }
/* Pesan sesi peserta berakhir (tombol login kembali) — muncul hanya bila server menolak sesi */
/* Panel "pengiriman video belum selesai" (lanjutkan tanpa rekam ulang) */
.tes-pulihkan {
  background: #fffbeb; border: 1.5px solid #fcd34d; border-radius: 12px; padding: 12px 14px; margin-top: 10px;
}
.tes-pulihkan b { display: block; color: #92400e; font-size: 13.5px; margin-bottom: 4px; }
.tes-sesi-habis {
  position: fixed; left: 50%; top: 16px; transform: translateX(-50%); z-index: 9999;
  background: #fff; border: 1.5px solid #fca5a5; border-radius: 14px; padding: 14px 18px;
  box-shadow: 0 18px 40px -18px rgba(127,29,29,.5); max-width: 92vw; width: 420px;
  display: flex; flex-direction: column; gap: 6px; text-align: center;
}
.tes-sesi-habis b { color: #991b1b; font-size: 14px; letter-spacing: .3px; }
.tes-sesi-habis span { color: var(--muted); font-size: 12.5px; }
.tes-counter.lebih { color: #b91c1c; }
.tes-rec-dot { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; color: #b91c1c; }
.tes-rec-dot span { width: 12px; height: 12px; border-radius: 50%; background: #dc2626; animation: tesRec 1s infinite; }
@keyframes tesRec { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
.tes-cek { margin: 10px 0 14px; }
.tes-cek-row { font-size: 13px; font-weight: 700; padding: 7px 12px; border-radius: 10px; background: #f8fafc; margin-bottom: 5px; }
.tes-cek-row.ok { background: #ecfdf5; color: #065f46; }
.tes-cek-row.no { background: #fef2f2; color: #991b1b; }
.tes-kunci { border-color: #a7f3d0; background: #f0fdf4; }
.tes-foot { text-align: center; font-size: 11.5px; color: var(--muted); margin-top: 20px; }
.tes-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: #065f46; color: #fff; font-size: 13.5px; font-weight: 700;
  padding: 12px 20px; border-radius: 12px; box-shadow: 0 16px 40px -14px rgba(0,0,0,.5);
  opacity: 0; transition: all .25s; z-index: 9999; max-width: 90vw; text-align: center;
}
.tes-toast.show { opacity: 1; transform: translate(-50%, 0); }
.tes-toast.err { background: #991b1b; }

/* ---------- Bukti via WhatsApp (halaman peserta) ----------
   Berkas video TIDAK diunggah ke server; panel ini hanya untuk pratinjau lokal, tombol
   kirim ke WhatsApp panitia, dan status verifikasi. Tombol dibuat besar (nyaman di HP). */
.tes-wa { margin-top: 12px; }
.tes-wa-panduan {
  padding: 10px 12px; border-left: 3px solid #25D366; background: #f0fdf4;
  border-radius: 0 9px 9px 0; font-size: 12.5px; line-height: 1.6; color: var(--ink);
}
.tes-wa-saran { margin: 8px 0 0; font-size: 12px; font-weight: 700; color: #92400e; }
.tes-wa-kecil { margin: 10px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.55; }
/* Tautan jalur alternatif (buka WhatsApp + lampirkan dari Galeri) — tetap terlihat sebagai
   tombol teks agar dapat ditekan nyaman di HP. */
.tes-wa-kecil a { color: var(--teal-d); font-weight: 700; text-decoration: underline; }
.tes-wa-kecil a:hover { color: var(--maroon); }
.tes-wa-video { background: #0f172a; border-radius: 12px; overflow: hidden; }
.tes-wa-video video { width: 100%; max-height: 300px; display: block; }
.tes-wa-meta {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px;
  background: rgba(255,255,255,.75); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 9px 12px; margin-top: 10px;
}
.tes-wa-meta b { font-size: 12.5px; word-break: break-all; }
.tes-wa-meta span { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.tes-wa-ingat {
  margin-top: 10px; padding: 10px 12px; border-radius: 11px; font-size: 12.5px; line-height: 1.55;
  background: #fffbeb; border: 1.5px solid #fcd34d; color: #92400e; font-weight: 700;
}
.tes-wa-status {
  padding: 12px 14px; border-radius: 12px; font-weight: 800; font-size: 14px; letter-spacing: .2px;
  text-align: center; background: #f1f5f9; color: #334155;
}
.tes-wa-status.siap { background: #fffbeb; color: #92400e; border: 1.5px solid #fcd34d; }
.tes-wa-status.tunggu { background: #fffbeb; color: #92400e; border: 1.5px solid #fcd34d; }
.tes-wa-status.ok { background: #ecfdf5; color: #065f46; border: 1.5px solid #a7f3d0; }
.tes-wa-status.ulang { background: #fef2f2; color: #991b1b; border: 1.5px solid #fecaca; }
.tes-wa-teks { margin: 10px 0 0; font-size: 13px; line-height: 1.6; }
.tes-wa-judul { margin: 16px 0 0; font-size: 13px; font-weight: 800; letter-spacing: .4px; color: var(--maroon); }
.tes-wa-langkah { margin: 10px 0 0; padding-left: 20px; font-size: 13px; line-height: 1.7; }
.tes-wa-langkah li { margin-bottom: 3px; }
@media (max-width: 900px) {
  .tes-wa .tes-aksi .btn { flex: 1 1 100%; justify-content: center; min-height: 50px; font-size: 14.5px; }
  .tes-wa-judul { font-size: 12.5px; }
}
/* ---------- Praktik Shalat: alur sesederhana mungkin (peserta) ----------
   Satu tombol besar per langkah, bahasa Indonesia tanpa istilah teknis. */
.ps-batas {
  margin: 10px 0 0; padding: 9px 12px; border-radius: 11px; background: #f0fdf4;
  border-left: 3px solid #25D366; font-size: 12.5px; font-weight: 600; color: #065f46;
}
.ps-batas-sep { color: #94a3b8; margin: 0 6px; }
.ps-box { margin-top: 14px; }
.ps-langkah { font-size: 11px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.ps-aksi { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.ps-aksi .btn { min-height: 52px; padding: 14px 20px; font-size: 15px; font-weight: 800; }
.ps-btn-besar { width: 100%; justify-content: center; min-height: 56px; font-size: 15.5px; }
.ps-video { border-radius: 12px; overflow: hidden; background: #0f172a; }
.ps-video video { width: 100%; max-height: 320px; display: block; }
.ps-video-kecil { max-width: 300px; margin-top: 12px; }
.ps-teks { margin: 12px 0 0; font-size: 14px; line-height: 1.6; }
.ps-kecil { margin: 10px 0 0; font-size: 12px; line-height: 1.55; color: var(--muted); }
.ps-kirim-judul { margin: 4px 0 10px; font-size: 16px; font-weight: 800; text-align: center; }
.ps-progress { height: 14px; border-radius: 999px; overflow: hidden; }
.ps-persen { margin: 8px 0 0; text-align: center; font-size: 17px; font-weight: 800; color: var(--teal-d); font-variant-numeric: tabular-nums; }
.ps-hasil {
  padding: 15px 16px; border-radius: 13px; font-weight: 800; font-size: 15.5px; letter-spacing: .2px;
  text-align: center; background: #f1f5f9; color: #334155; line-height: 1.4;
}
.ps-hasil.ok { background: #ecfdf5; color: #065f46; border: 1.5px solid #a7f3d0; }
.ps-hasil.tunggu { background: #fffbeb; color: #92400e; border: 1.5px solid #fcd34d; }
.ps-hasil.gagal { background: #fef2f2; color: #991b1b; border: 1.5px solid #fecaca; }
.ps-catatan {
  background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px;
  font-size: 13px; line-height: 1.55; margin-bottom: 12px;
}
.ps-catatan-kuning { background: #fffbeb; border-color: #fcd34d; color: #92400e; }
.ps-nomor { margin: 10px 0 0; font-size: 14px; }
.ps-tanya { margin-top: 16px; font-size: 14px; font-weight: 800; }
@media (max-width: 900px) {
  .ps-aksi .btn { flex: 1 1 100%; justify-content: center; }
  .ps-aksi .btn-ghost { flex: 1 1 100%; }
}

/* Kartu bukti WhatsApp di panel panitia */
.tka-wa-box { background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.tka-wa-box .mini-row { font-size: 12.5px; }
.tka-wa-aksi { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.tka-wa-aksi form { display: inline-flex; margin: 0; }
.tka-wa-aksi .btn { min-height: 40px; }
@media (max-width: 700px) { .tka-wa-aksi .btn, .tka-wa-aksi form .btn { flex: 1 1 auto; justify-content: center; } }

/* ---------- Sisi admin: header identitas modul ---------- */
.tka-kop {
  background: #fff; border-left: 6px solid var(--maroon); border-radius: 12px;
  padding: 16px 20px; margin-bottom: 20px; box-shadow: var(--shadow);
}
.tka-kop h2 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.2px; color: var(--maroon); }
.tka-kop p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.tka-note {
  background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px;
  font-size: 12.5px; color: var(--ink); margin-bottom: 18px;
}
.stat-grid.tka-stats { grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); }
.stat-card.tka-mini { padding: 13px 14px; }
.stat-card.tka-mini .sc-val { font-size: 19px; }
/* kartu peserta pada layar HP (tabel jadi list) */
.tka-cards { display: none; }
.tka-card {
  background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 12px;
  box-shadow: 0 8px 20px -14px rgba(15,118,110,.4);
}
.tka-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.tka-card-nama { font-size: 15px; font-weight: 800; line-height: 1.25; }
.tka-card-line { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.tka-card-aksi { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.tka-card-aksi .btn { flex: 1 1 auto; min-height: 40px; }
.tka-prog { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.tka-prog .progress { flex: 1; }
/* media di panel penilaian */
.tka-media-blok { background: #f8fafc; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.tka-media-blok h5 { margin: 0 0 8px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--teal-d); }
.tka-motivasi-teks {
  background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px;
  font-size: 13.5px; line-height: 1.65; color: var(--ink); white-space: pre-wrap;
  max-height: 320px; overflow-y: auto; word-break: break-word;
}
.tka-motivasi h5 { margin-bottom: 4px; }
.tka-media-item { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 8px 0; border-top: 1px dashed var(--line); }
.tka-media-item:first-of-type { border-top: none; }
/* Aksi per jawaban (Buka / Hapus) — rapi berdampingan di sisi kanan */
.tka-media-aksi { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.tka-media-aksi form { display: inline-flex; margin: 0; }
/* Tombol "Hapus Semua Jawaban" di kepala kartu bukti */
.tka-hapus-semua { display: inline-flex; margin: 0; }
.tka-hapus-semua .btn { margin-left: 0; }
@media (max-width: 700px) {
  .tka-media-aksi { margin-left: 0; width: 100%; }
  .tka-media-aksi .btn, .tka-media-aksi form .btn { flex: 1 1 auto; justify-content: center; }
}
.tka-nilai-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.tka-nilai-row { background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 13px; }
.tka-nilai-row label { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 6px; }
.tka-nilai-row .row { display: flex; gap: 8px; align-items: center; }
.tka-nilai-row select, .tka-nilai-row input { flex: 1; min-width: 0; font-family: inherit; font-size: 14px; padding: 9px 11px; border: 1.5px solid var(--line); border-radius: 10px; }
.tka-bobot { font-size: 11px; font-weight: 700; color: var(--muted); }
.tka-nilai-akhir {
  background: linear-gradient(135deg, rgba(22,163,74,.1), rgba(5,150,105,.08));
  border: 1.5px solid #a7f3d0; border-radius: 14px; padding: 16px 18px; text-align: center;
}
.tka-nilai-akhir .val { font-size: 34px; font-weight: 800; letter-spacing: -1px; color: #065f46; line-height: 1.1; }
.tka-aspek-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.tka-slider { width: 100%; }

/* ---------- Petunjuk / perintah tugas TKA (peserta & panitia) ---------- */
.tes-perintah {
  padding: 9px 12px; border-left: 3px solid var(--teal-l); background: var(--teal-bg);
  border-radius: 0 9px 9px 0; line-height: 1.55;
}
.tka-media-blok .tes-perintah { background: #fff; }
.pjk-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pjk-no {
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px;
  border-radius: 8px; background: var(--grad-teal); color: #fff; font-weight: 800; font-size: 12.5px; margin-right: 6px;
}
.pjk-card textarea {
  width: 100%; font-family: inherit; font-size: 13.5px; line-height: 1.55; color: var(--ink);
  padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; resize: vertical; min-height: 98px;
}
.pjk-card textarea:focus { outline: none; border-color: var(--teal-l); box-shadow: 0 0 0 3px rgba(20, 184, 166, .16); }
.pjk-prev-lbl { display: block; margin-top: 13px; font-size: 10.5px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.pjk-prev {
  margin-top: 6px; padding: 11px 13px; border: 1.5px dashed #cbd5e1; border-radius: 11px;
  background: #f8fafc; color: #334155; font-size: 13px; line-height: 1.55; white-space: pre-line; min-height: 44px;
}
@media (max-width: 700px) {
  .pjk-card textarea { min-height: 86px; }
}

@media (max-width: 900px) {
  .tka-tabel { display: none; }
  .tka-cards { display: block; }
  .tka-kop { padding: 13px 15px; }
  .tka-kop h2 { font-size: 15.5px; }
  .tes-aksi .btn { flex: 1 1 100%; justify-content: center; }
  .tes-thumb { width: 100%; height: 190px; }
  .tes-motivasi { min-height: 210px; font-size: 15px; }
  .tes-motivasi-meta { flex-direction: column; align-items: flex-start; gap: 4px; }
}
