/* ============================================================
 * KOPASUS IT HUB - css/components.css
 * Komponen antarmuka: kartu, tombol, form, tabel, modal, drawer,
 * toast, panel notifikasi, kamera, halaman masuk, dan blok khusus
 * beranda (hero, statistik, pintasan, agenda).
 * ============================================================ */

/* ---------------- KARTU ---------------- */

.card {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow-soft);
}
.card:hover { box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.card-head h3 { margin: 0; }

.card-hero {
  background: linear-gradient(160deg, var(--accent-soft) 0%, var(--bg-elev) 58%);
  border-color: color-mix(in srgb, var(--accent) 20%, var(--line));
}
.card-accent { border-color: var(--accent); }

.hero-emoji {
  width: 42px; height: 42px; flex: none; display: grid; place-items: center; font-size: 19px;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 13px;
  box-shadow: var(--shadow-soft);
}

/* Judul halaman + tombol aksi */
.page-head { display: flex; align-items: center; gap: 13px; margin: 2px 0 18px; }
.page-emoji {
  width: 46px; height: 46px; flex: none; display: grid; place-items: center; font-size: 21px;
  background: var(--accent-soft); border-radius: 50%; color: var(--accent);
}
.page-head h1 { margin: 0; }
.page-sub { margin: 2px 0 0; font-size: 13px; color: var(--text-dim); }

/* ---------------- TOMBOL ---------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 10px 17px; border-radius: 12px; cursor: pointer;
  font: 650 14px var(--font-sans); border: 1px solid var(--line-strong);
  background: var(--bg-elev); color: var(--text);
}
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0) scale(.99); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink); border-color: transparent;
  box-shadow: 0 10px 22px -14px var(--accent);
}
.btn-outline { background: var(--bg-elev); border-color: var(--line-strong); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger {
  background: var(--danger-soft); color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 26%, transparent);
}
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 6px 13px; font-size: 13px; border-radius: 10px; }
.btn-lg { min-height: 52px; font-size: 15.5px; border-radius: 14px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 12px; }

.ghost-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 12px; min-height: var(--tap); border: 1px solid var(--line);
  background: var(--bg-elev-2); color: var(--text-dim);
  border-radius: 12px; font: 650 13.5px var(--font-sans); cursor: pointer;
  transition: border-color .16s var(--ease), color .16s var(--ease), background-color .16s var(--ease);
}
.ghost-btn:hover { color: var(--text); border-color: var(--line-strong); }
.ghost-btn.danger { color: #fff; background: var(--danger); border-color: transparent; font-weight: 700; }
.ghost-btn.danger:hover { color: #fff; background: color-mix(in srgb, var(--danger) 88%, #000); border-color: transparent; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px;
  background: var(--bg-elev-2); border: 1px solid var(--line);
  font-size: 12px; font-weight: 650; color: var(--text-dim);
}
.chev { color: var(--text-faint); font-size: 20px; line-height: 1; }

/* ---------------- FORM ---------------- */

.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 12.5px; font-weight: 650; color: var(--text-dim); margin-bottom: 6px; }
.input, .textarea, select.input {
  width: 100%; background: var(--bg-elev); color: var(--text); border: 1px solid var(--line-strong);
  border-radius: 12px; padding: 12px 14px; font: 400 14.5px var(--font-sans); min-height: var(--tap);
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.textarea { min-height: 108px; resize: vertical; }
.input:focus, .textarea:focus, select.input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.field-error { color: var(--danger); font-size: 12px; margin-top: 5px; }

.choice-group { display: grid; gap: 9px; }
.choice {
  display: flex; align-items: center; gap: 11px; padding: 13px 15px; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: 12px; background: var(--bg-elev);
  font-size: 14px; transition: border-color .16s var(--ease), background-color .16s var(--ease);
}
.choice:hover { border-color: var(--accent); }
.choice input { accent-color: var(--accent); width: 18px; height: 18px; }
.choice.selected { border-color: var(--accent); background: var(--accent-soft); }
.checklist { display: grid; gap: 8px; }

/* ---------------- LABEL STATUS ---------------- */

.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.pill-ok     { background: var(--ok-soft);     color: var(--ok); }
.pill-warn   { background: var(--warn-soft);   color: var(--warn); }
.pill-danger { background: var(--danger-soft); color: var(--danger); }
.pill-info   { background: var(--info-soft);   color: var(--info); }
.pill-muted  { background: var(--bg-elev-2);   color: var(--text-dim); }

/* ---------------- DAFTAR ---------------- */

.row-item {
  display: flex; align-items: center; gap: 12px; padding: 13px 15px; margin-bottom: 9px;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
}
.row-item.clickable { cursor: pointer; }
.row-item.clickable:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow); }

/* ---------------- STATISTIK ---------------- */

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; }
.stat {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 15px 16px;
}
.stat:hover { box-shadow: var(--shadow); }
.stat .stat-ic {
  width: 42px; height: 42px; flex: none; display: grid; place-items: center;
  border-radius: 12px; background: var(--accent-soft); font-size: 18px;
}
.stat .num { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin: 2px 0; }
.stat .lbl { font-size: 12px; color: var(--text-faint); font-weight: 650; }
/* Bila .num/.lbl menjadi anak langsung (layar lama), paksa bertumpuk. */
.stat > .num, .stat > .lbl { flex-basis: 100%; }

.progress {
  height: 9px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; margin-top: 10px;
}
.progress > i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .55s var(--ease);
}

/* ---------------- BERANDA ---------------- */

.hero-user {
  position: relative; overflow: hidden; border: 0; color: #fff; padding: 24px 26px;
  border-radius: var(--radius-lg);
  background: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 62%, color-mix(in srgb, var(--accent-2) 70%, #fff) 100%);
  box-shadow: 0 18px 40px -26px var(--accent);
}
.hero-user::after {
  content: ""; position: absolute; right: -60px; top: -80px; width: 320px; height: 320px;
  border-radius: 50%; background: rgba(255, 255, 255, .1);
}
.hero-user .card-head { margin: 0; position: relative; z-index: 1; }
.hero-user .avatar { background: rgba(255, 255, 255, .22); border: 1px solid rgba(255, 255, 255, .35); }
.hero-user h2 { color: #fff; margin: 2px 0 6px; font-size: 24px; letter-spacing: -.02em; }
.hero-user .sub, .hero-user .dim, .hero-user .faint { color: rgba(255, 255, 255, .82); }
.hero-user .mono { letter-spacing: .02em; }
.hero-user {
  display: flex; align-items: center; gap: 22px;
}
.hero-user-main { position: relative; z-index: 1; flex: 1 1 auto; min-width: 0; }
.hero-quote {
  position: relative; z-index: 1; flex: 0 0 300px; max-width: 340px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: var(--radius);
  padding: 16px 18px 18px; display: flex; gap: 8px; align-items: flex-start;
  backdrop-filter: blur(4px);
}
.hero-quote-mark {
  font-size: 34px; line-height: .8; font-weight: 800; color: rgba(255, 255, 255, .55);
  flex: 0 0 auto;
}
.hero-quote-text {
  margin: 4px 0 0; color: #fff; font-size: 14px; line-height: 1.5; font-weight: 500;
}
@media (max-width: 900px) {
  .hero-user { flex-direction: column; align-items: stretch; gap: 16px; }
  .hero-quote { flex-basis: auto; max-width: none; }
}

.home-grid { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }

.tile-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; }
.tile {
  display: flex; align-items: center; gap: 13px; text-align: left; cursor: pointer;
  padding: 15px; border-radius: var(--radius); color: var(--text); font: inherit;
  background: var(--bg-elev); border: 1px solid var(--line); box-shadow: var(--shadow-soft);
}
.tile:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow); }
.tile:active { transform: translateY(0) scale(.99); }
.tile-ic {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center; font-size: 19px;
  border-radius: 13px; background: var(--accent-soft);
}
.tile-label { font-size: 14px; font-weight: 700; line-height: 1.25; }
.tile-desc { font-size: 12px; color: var(--text-dim); line-height: 1.35; margin-top: 2px; }

.agenda-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.agenda-item:last-child { border-bottom: 0; padding-bottom: 0; }
.agenda-date {
  width: 46px; height: 46px; flex: none; border-radius: 12px; display: grid; place-items: center;
  background: var(--bg-elev-2); line-height: 1.05; text-align: center;
}
.agenda-date b { font-size: 15px; font-weight: 800; }
.agenda-date span { font-size: 10.5px; color: var(--text-faint); font-weight: 650; }
.feed-item { display: flex; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.feed-item:last-child { border-bottom: 0; padding-bottom: 0; }
.feed-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 7px; flex: none; background: var(--accent); }

/* ---------------- SYARAT / CHECKLIST STATUS ---------------- */

.check-list { display: grid; gap: 7px; margin: 4px 0 12px; }
.check { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--text-dim); }
.check .tick {
  width: 20px; height: 20px; flex: none; border-radius: 7px; display: grid; place-items: center;
  border: 1.5px solid var(--line-strong); background: var(--bg-elev-2);
  font-size: 12px; font-weight: 700; color: transparent;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.check.done { color: var(--text); }
.check.done .tick { background: var(--ok); border-color: var(--ok); color: #fff; }

/* ---------------- TAB ---------------- */

.tabs {
  display: flex; gap: 5px; margin-bottom: 16px; background: var(--bg-elev-2);
  padding: 5px; border-radius: 14px; border: 1px solid var(--line);
}
.tabs button {
  flex: 1; min-height: 40px; padding: 8px 12px; border: 0; background: transparent;
  color: var(--text-dim); font: 650 13.5px var(--font-sans); border-radius: 10px; cursor: pointer;
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] {
  background: var(--bg-elev); color: var(--accent); box-shadow: var(--shadow-soft);
}

/* ---------------- TABEL ---------------- */

.table-wrap {
  overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-elev); box-shadow: var(--shadow-soft);
}
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 620px; }
table.data th, table.data td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
table.data th {
  background: var(--bg-elev-2); color: var(--text-faint); font-weight: 700; position: sticky; top: 0;
  font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase;
}
table.data tbody tr { transition: background-color .14s var(--ease); }
table.data tbody tr:hover { background: var(--bg-elev-2); }
table.data tbody tr:last-child td { border-bottom: 0; }

/* ---------------- MODAL ---------------- */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 1000; background: rgba(23, 27, 47, .38);
  backdrop-filter: blur(3px); display: grid; place-items: center; padding: 18px;
  animation: fade .18s ease;
}
.modal {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius-lg);
  width: min(560px, 100%); max-height: 88vh; display: flex; flex-direction: column;
  box-shadow: 0 30px 70px -30px rgba(21, 27, 58, .5);
  animation: cardIn .24s var(--ease) both;
}
.modal-head {
  display: flex; align-items: center; gap: 12px; padding: 17px 20px; border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; flex: 1; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { padding: 15px 20px; border-top: 1px solid var(--line); display: flex; gap: 9px; justify-content: flex-end; }

/* ---------------- DRAWER ---------------- */

.drawer-backdrop {
  position: fixed; inset: 0; z-index: 1000; background: rgba(23, 27, 47, .38);
  backdrop-filter: blur(3px); animation: fade .18s ease;
}
.drawer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1001; max-height: 84vh; overflow-y: auto;
  background: var(--bg-elev); border-radius: 22px 22px 0 0; border-top: 1px solid var(--line);
  padding: 10px 12px calc(20px + env(safe-area-inset-bottom));
  animation: drawerUp .24s var(--ease) both;
  box-shadow: 0 -20px 50px -30px rgba(21, 27, 58, .5);
}
@keyframes drawerUp { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.grabber { width: 42px; height: 4px; border-radius: 4px; background: var(--line-strong); margin: 6px auto 12px; }
.drawer .nav-desktop { max-height: none; overflow: visible; padding: 0 4px 8px; }

/* ---------------- TOAST ---------------- */

.toast-root {
  position: fixed; left: 0; right: 0; bottom: calc(var(--bottomnav-h) + 14px); z-index: 1200;
  display: grid; gap: 8px; justify-items: center; pointer-events: none; padding: 0 14px;
}
.toast {
  pointer-events: auto; max-width: 460px; width: fit-content; background: var(--bg-elev);
  border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: 12px; padding: 12px 16px; font-size: 13.5px; box-shadow: var(--shadow);
  animation: cardIn .22s var(--ease) both;
}
.toast.ok    { border-left-color: var(--ok); }
.toast.error { border-left-color: var(--danger); }
.toast.info  { border-left-color: var(--info); }

/* ---------------- PANEL NOTIFIKASI ---------------- */

.notif-panel {
  position: fixed; top: calc(var(--topbar-h) + 8px); right: 14px; z-index: 900;
  width: min(390px, calc(100vw - 28px)); max-height: 72vh; overflow-y: auto;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 24px 60px -30px rgba(21, 27, 58, .5); padding: 8px;
  animation: cardIn .2s var(--ease) both;
}
.np-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px 12px; }
.np-head h3 { margin: 0; flex: 1; }
.notif-item {
  padding: 11px 12px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid transparent; transition: background-color .14s var(--ease);
}
.notif-item:hover { background: var(--bg-elev-2); }
.notif-item.unread { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 18%, transparent); }
.np-title { font-weight: 700; font-size: 13.5px; }
.np-body { font-size: 12.5px; color: var(--text-dim); }
.np-time { font-size: 11px; color: var(--text-faint); margin-top: 3px; }

/* ---------------- KAMERA ---------------- */

.cam-modal { width: min(520px, 100%); }
.cam-stage {
  position: relative; background: #0b0f1a; border-radius: 14px; overflow: hidden; aspect-ratio: 4 / 3;
}
/* `contain` — seluruh bidang kamera tampil apa adanya, tidak dipotong,
   sehingga posisi anggota saat presensi terlihat jelas oleh pembina. */
.cam-stage video, .cam-stage canvas, .cam-stage img {
  width: 100%; height: 100%; object-fit: contain; display: block;
}
.cam-frame {
  position: absolute; inset: 8% 26%; border: 2px dashed rgba(255, 255, 255, .45); border-radius: 46%;
  pointer-events: none;
}
.cam-hint { font-size: 12.5px; color: var(--text-dim); margin: 10px 0; text-align: center; }
.cam-count {
  position: absolute; inset: 0; display: grid; place-items: center;
  font: 800 76px var(--font-sans); color: rgba(255, 255, 255, .92); text-shadow: 0 4px 24px rgba(0, 0, 0, .5);
}
.cam-size { font-size: 11.5px; color: var(--text-faint); text-align: center; }
.cam-error { color: var(--danger); font-size: 13px; text-align: center; padding: 14px; }

/* ---------------- STATUS KOSONG & MEMUAT ---------------- */

.empty { text-align: center; padding: 42px 18px; color: var(--text-dim); }
.empty .em { font-size: 42px; display: block; margin-bottom: 12px; }
.empty h3 { margin: 0 0 6px; }
.loading-block { display: flex; align-items: center; gap: 11px; padding: 26px; color: var(--text-dim); font-size: 13.5px; }
.loader {
  width: 19px; height: 19px; border-radius: 50%; border: 2.5px solid var(--line-strong);
  border-top-color: var(--accent); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- ALERT ---------------- */

.alert { padding: 13px 16px; border-radius: 12px; border: 1px solid var(--line-strong); font-size: 13.5px; margin-bottom: 12px; }
.alert-info   { background: var(--info-soft);   border-color: color-mix(in srgb, var(--info) 26%, transparent);   color: #1d4ed8; }
.alert-warn   { background: var(--warn-soft);   border-color: color-mix(in srgb, var(--warn) 30%, transparent);   color: #92400e; }
.alert-danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: #9f1239; }

/* ---------------- HALAMAN MASUK ---------------- */

.auth-overlay {
  position: fixed; inset: 0; z-index: 800; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(900px 480px at 50% -10%, var(--accent-soft) 0%, var(--bg) 62%);
  overflow-y: auto;
}
.auth-card {
  width: min(430px, 100%); background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 30px 26px; box-shadow: 0 30px 70px -40px rgba(21, 27, 58, .55);
  animation: cardIn .3s var(--ease) both;
}
.auth-mark {
  width: 66px; height: 66px; margin: 0 auto 16px; border-radius: 20px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  font: 800 22px var(--font-mono); color: #fff; box-shadow: 0 14px 30px -16px var(--accent);
}
.auth-title { text-align: center; margin: 0 0 4px; font-size: 20px; font-weight: 800; }
.auth-sub { text-align: center; color: var(--text-dim); font-size: 13px; margin-bottom: 22px; }
.auth-foot { text-align: center; font-size: 11.5px; color: var(--text-faint); margin-top: 18px; }

/* ---------------- UTILITAS ---------------- */

.stack-lg > * + * { margin-top: 14px; }
.offline-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1300; text-align: center;
  background: var(--warn); color: #fff; font-size: 12.5px; font-weight: 650; padding: 7px;
}

/* ===== Grid Jadwal Piket Mingguan ===== */
.picket-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(190px, 1fr));
  gap: 16px;
  margin-top: 10px;
}
.picket-col {
  background: var(--bg-elev, #fff);
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
}
.picket-col-head {
  text-align: center;
  padding: 16px 10px 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent, #6366f1), var(--accent-2, #8b5cf6));
}
.picket-day {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.picket-count {
  font-size: .78rem;
  opacity: .9;
  margin-top: 2px;
}
.picket-labels {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 14px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--text-faint, #94a3b8);
  background: var(--bg-soft, #f8fafc);
  border-bottom: 1px solid var(--line, #e5e7eb);
}
.picket-lbl-kelas { text-align: right; }
.picket-item {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line, #f1f5f9);
}
.picket-item:last-child { border-bottom: 0; }
.picket-no {
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-faint, #94a3b8);
  text-align: center;
}
.picket-name {
  font-weight: 600;
  font-size: .95rem;
  word-break: break-word;
  line-height: 1.25;
}
.picket-kelas {
  font-size: .82rem;
  font-weight: 600;
  color: var(--accent, #6366f1);
  background: var(--accent-soft, #eef2ff);
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.picket-x {
  border: 0;
  background: transparent;
  color: var(--danger, #dc2626);
  cursor: pointer;
  font-size: .82rem;
  padding: 2px 6px;
  border-radius: 6px;
}
.picket-x:hover { background: rgba(220,38,38,.1); }
.picket-empty {
  text-align: center;
  color: var(--text-faint, #9ca3af);
  padding: 22px 0;
  font-size: .9rem;
}
@media (max-width: 720px) {
  .picket-grid {
    grid-auto-flow: column;
    grid-template-columns: none;
    grid-auto-columns: 80%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 10px;
  }
  .picket-col { scroll-snap-align: start; }
}

/* ===== Kartu Statistik Beranda (Status Hari Ini) ===== */
.statb {
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 6px;
  transition: box-shadow .16s var(--ease), transform .16s var(--ease);
}
.statb:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.statb-head { display: flex; align-items: center; gap: 10px; }
.statb-head .stat-ic {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center;
  border-radius: 12px; background: var(--accent-soft); font-size: 18px;
}
.statb-head .lbl { font-size: 13px; color: var(--text-dim); font-weight: 650; }
.statb-num { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; }
.statb .sub { font-size: 12.5px; }
.trend {
  font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap;
}
.trend-up   { color: var(--ok);   background: var(--ok-soft); }
.trend-down { color: var(--danger); background: var(--danger-soft); }

/* ===== Layout Beranda: Agenda/Pengumuman + Pintasan ===== */
.home-top-grid {
  display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 16px; align-items: start;
}
.home-shortcuts-grid {
  display: grid; grid-template-columns: 1fr; gap: 16px 20px; margin-top: 18px; align-items: start;
}
.home-shortcut-block { min-width: 0; }
.tile-grid.tile-grid-1 { grid-template-columns: 1fr; }

@media (min-width: 860px) {
  .home-top-grid { grid-template-columns: 1fr 1fr; }
  .home-shortcuts-grid { grid-template-columns: 1fr 1fr; }
}

/* ===== Presensi Acara (QR) ===== */
.qr-box {
  display: inline-block; background: #fff; padding: 12px; border-radius: 14px;
  border: 1px solid var(--line); margin: 6px 0;
}
.qr-box svg { display: block; width: 240px; height: 240px; }
.qr-title { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.qr-nrp { font-family: var(--font-mono, monospace); font-weight: 700; font-size: 18px; letter-spacing: 1px; margin: 6px 0; }
.scan-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; background: var(--bg-elev);
}

/* ===== Layar Scan: kamera sebagai elemen utama ===== */
.scan-panel {
  max-width: 480px; margin: 14px auto 0; background: var(--bg-elev);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
}
.scan-video-frame {
  position: relative; width: 100%; aspect-ratio: 4 / 3;
  background: #0b0f1a; border-radius: 14px; overflow: hidden;
}
.scan-video-frame video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
/* Bingkai sudut penanda area bidikan (gaya pemindai). */
.scan-corner {
  position: absolute; width: 34px; height: 34px; pointer-events: none;
  border-color: #fff; border-style: solid; opacity: .92;
}
.scan-corner-tl { top: 10%; left: 8%;  border-width: 4px 0 0 4px; border-top-left-radius: 8px; }
.scan-corner-tr { top: 10%; right: 8%; border-width: 4px 4px 0 0; border-top-right-radius: 8px; }
.scan-corner-bl { bottom: 10%; left: 8%;  border-width: 0 0 4px 4px; border-bottom-left-radius: 8px; }
.scan-corner-br { bottom: 10%; right: 8%; border-width: 0 4px 4px 0; border-bottom-right-radius: 8px; }
.scan-hint {
  position: absolute; left: 0; right: 0; bottom: 6%; text-align: center;
  color: #fff; font-size: 12.5px; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,.6);
  pointer-events: none;
}
.scan-panel .field { margin-top: 12px; }
/* Pembatas "atau" antara kamera dan input manual. */
.scan-divider {
  display: flex; align-items: center; gap: 12px; max-width: 480px; margin: 18px auto;
  color: var(--text-faint); font-size: 13px; font-weight: 600;
}
.scan-divider-line { flex: 1; height: 1px; background: var(--line); }
