/* ============================================================
   SMART ABSENSI QR — Design System
   Dark Neon Glassmorphism. Satu sumber kebenaran untuk warna,
   spasi, radius, shadow, transisi, dan komponen.
   ============================================================ */

:root {
  /* --- Warna dasar --- */
  --bg-0: #05060d;
  --bg-1: #0a0f1f;
  --bg-2: #101733;

  --neon-cyan: #00f3ff;
  --neon-magenta: #ff00ff;
  --neon-lime: #39ff14;
  --neon-amber: #ffb800;
  --neon-red: #ff2d55;

  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-bg-2: rgba(255, 255, 255, 0.08);
  --glass-brd: rgba(255, 255, 255, 0.1);
  --glass-brd-2: rgba(255, 255, 255, 0.16);

  --txt: #e8ecff;
  --txt-dim: #8f9bc4;
  --txt-mute: #64708f;

  /* --- Skala spasi (konsisten di seluruh halaman) --- */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;

  /* --- Radius --- */
  --r-sm: 10px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-pill: 999px;
  --radius: var(--r-lg);

  /* --- Shadow --- */
  --sh-sm: 0 2px 10px rgba(0, 0, 0, 0.28);
  --sh-md: 0 8px 26px rgba(0, 0, 0, 0.38);
  --sh-lg: 0 18px 48px rgba(0, 0, 0, 0.55);
  --glow-cyan: 0 0 22px rgba(0, 243, 255, 0.35);

  /* --- Transisi --- */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 0.15s var(--ease);
  --t: 0.24s var(--ease);
  --t-slow: 0.35s var(--ease);
  --tr: color var(--t), background-color var(--t), border-color var(--t),
    box-shadow var(--t), transform var(--t), opacity var(--t);

  /* --- Layout --- */
  --sidebar-w: 260px;
  --header-h: 60px;
  --bottomnav-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-0);
  color: var(--txt);
  font-family: "Outfit", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  /* mencegah konten terpotong di ponsel dengan notch */
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

body.no-scroll {
  overflow: hidden;
}

img,
svg,
video,
canvas {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
h4 {
  line-height: 1.25;
  margin: 0;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--neon-cyan);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Latar dekoratif */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(60rem 40rem at 12% -10%, rgba(0, 243, 255, 0.16), transparent 60%),
    radial-gradient(55rem 38rem at 100% 0%, rgba(255, 0, 255, 0.14), transparent 60%),
    radial-gradient(50rem 40rem at 50% 120%, rgba(57, 255, 20, 0.1), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.3;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 20%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse at 50% 20%, #000 20%, transparent 75%);
}

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

@media (min-width: 1024px) {
  .app-shell {
    margin-left: var(--sidebar-w);
  }
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: var(--header-h);
  padding: var(--sp-3) var(--sp-4);
  background: rgba(8, 12, 26, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--glass-brd);
}

@media (min-width: 640px) {
  .app-header {
    padding: var(--sp-3) var(--sp-6);
  }
}

.app-main {
  padding: var(--sp-4);
  /* ruang untuk bottom nav agar konten tidak tertutup */
  padding-bottom: calc(var(--bottomnav-h) + var(--sp-6) + var(--safe-b));
}

@media (min-width: 640px) {
  .app-main {
    padding: var(--sp-6);
    padding-bottom: calc(var(--bottomnav-h) + var(--sp-6) + var(--safe-b));
  }
}

@media (min-width: 1024px) {
  .app-main {
    padding-bottom: var(--sp-6);
  }
}

.page {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

/* kompatibilitas kelas lama */
.main-pad {
  padding-bottom: calc(var(--bottomnav-h) + var(--sp-6) + var(--safe-b));
}

@media (min-width: 1024px) {
  .main-pad {
    padding-bottom: var(--sp-6);
  }
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--bg-2);
  border-radius: 0 0 var(--r-md) 0;
}

.skip-link:focus {
  left: 0;
}

/* ------------------------------------------------------------
   Primitif kaca
   ------------------------------------------------------------ */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-brd);
  border-radius: var(--radius);
  box-shadow: var(--sh-sm);
  transition: var(--tr);
}

.glass-hover:hover {
  border-color: rgba(0, 243, 255, 0.4);
  box-shadow: var(--sh-md), var(--glow-cyan);
  transform: translateY(-2px);
}

.glass-strong {
  background: rgba(10, 15, 31, 0.78);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--glass-brd);
  border-radius: var(--radius);
}

.card-pad {
  padding: var(--sp-4);
}

@media (min-width: 640px) {
  .card-pad {
    padding: var(--sp-5);
  }
}

/* ------------------------------------------------------------
   Teks
   ------------------------------------------------------------ */
.neon-cyan { color: var(--neon-cyan); text-shadow: 0 0 10px rgba(0, 243, 255, 0.55); }
.neon-magenta { color: var(--neon-magenta); text-shadow: 0 0 10px rgba(255, 0, 255, 0.55); }
.neon-lime { color: var(--neon-lime); text-shadow: 0 0 10px rgba(57, 255, 20, 0.5); }
.neon-red { color: var(--neon-red); text-shadow: 0 0 10px rgba(255, 45, 85, 0.5); }
.neon-amber { color: var(--neon-amber); text-shadow: 0 0 10px rgba(255, 184, 0, 0.5); }

.text-dim { color: var(--txt-dim); }

.section-title {
  font-size: 0.95rem;
  font-weight: 700;
}

.eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--txt-dim);
}

/* ------------------------------------------------------------
   Tombol
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 42px;
  padding: 0.6rem 1.1rem;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid var(--glass-brd);
  background: var(--glass-bg);
  color: var(--txt);
  transition: var(--tr);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.btn:hover { background: var(--glass-bg-2); border-color: var(--glass-brd-2); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.985); }

.btn svg { width: 18px; height: 18px; flex: none; }

.btn-sm { min-height: 34px; padding: 0.32rem 0.7rem; font-size: 0.78rem; border-radius: var(--r-sm); }
.btn-icon { min-height: 40px; width: 40px; padding: 0; }
.btn-block { width: 100%; }

.btn-neon { border-color: rgba(0, 243, 255, 0.5); color: var(--neon-cyan); }
.btn-neon:hover { box-shadow: var(--glow-cyan); background: rgba(0, 243, 255, 0.1); border-color: rgba(0, 243, 255, 0.7); }

.btn-magenta { border-color: rgba(255, 0, 255, 0.5); color: var(--neon-magenta); }
.btn-magenta:hover { box-shadow: 0 0 22px rgba(255, 0, 255, 0.35); background: rgba(255, 0, 255, 0.1); }

.btn-lime { border-color: rgba(57, 255, 20, 0.45); color: var(--neon-lime); }
.btn-lime:hover { box-shadow: 0 0 22px rgba(57, 255, 20, 0.3); background: rgba(57, 255, 20, 0.1); }

.btn-danger { border-color: rgba(255, 45, 85, 0.45); color: var(--neon-red); }
.btn-danger:hover { box-shadow: 0 0 22px rgba(255, 45, 85, 0.3); background: rgba(255, 45, 85, 0.1); }

.btn:disabled,
.btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-group { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

/* Toggle mode scan (radio dalam label) */
.btn > input[type="radio"],
.btn > input[type="checkbox"] { accent-color: currentColor; margin: 0; }

/* ------------------------------------------------------------
   Form
   ------------------------------------------------------------ */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-3);
}

@media (min-width: 640px) {
  .form-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.field { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }

.label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--txt-dim);
  margin-bottom: 0.35rem;
}

.field .label { margin-bottom: 0; }

.input,
select.input,
textarea.input {
  width: 100%;
  max-width: 100%;
  min-height: 42px;
  padding: 0.6rem 0.85rem;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-brd);
  color: var(--txt);
  font-size: 0.9rem;
  outline: none;
  transition: var(--tr);
  appearance: none;
  -webkit-appearance: none;
}

textarea.input { min-height: 84px; resize: vertical; }

select.input {
  background-image: linear-gradient(45deg, transparent 50%, var(--txt-dim) 50%),
    linear-gradient(135deg, var(--txt-dim) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2.1rem;
}

.input[type="file"] { padding: 0.45rem 0.6rem; }
.input[type="date"],
.input[type="time"] { min-width: 0; }

.input::placeholder { color: var(--txt-mute); }

.input:hover { border-color: var(--glass-brd-2); }

.input:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 3px rgba(0, 243, 255, 0.14);
  background: rgba(0, 243, 255, 0.05);
}

select.input option { background: #0a0f1f; color: var(--txt); }

.check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
  min-height: 42px;
}

.check input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--neon-cyan); }

/* Baris filter: konsisten di semua halaman */
.filter-bar {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-3);
}

@media (min-width: 640px) {
  .filter-bar { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; }
  .filter-bar .span-2 { grid-column: span 2; }
}

/* ------------------------------------------------------------
   Tabel
   ------------------------------------------------------------ */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
}

.tbl {
  width: 100%;
  min-width: 620px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85rem;
}

.tbl thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  padding: 0.7rem 0.85rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--txt-dim);
  background: rgba(10, 15, 31, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--glass-brd);
  white-space: nowrap;
}

.tbl tbody td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.tbl tbody tr { transition: background-color var(--t-fast); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: rgba(0, 243, 255, 0.05); }

.tbl .actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.table-empty { text-align: center; color: var(--txt-dim); padding: 2rem 1rem !important; }

/* ------------------------------------------------------------
   Badge
   ------------------------------------------------------------ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--r-pill);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid currentColor;
  line-height: 1.5;
}

.badge-hadir { color: var(--neon-lime); background: rgba(57, 255, 20, 0.08); }
.badge-telat { color: var(--neon-amber); background: rgba(255, 184, 0, 0.08); }
.badge-izin { color: var(--neon-cyan); background: rgba(0, 243, 255, 0.08); }
.badge-sakit { color: var(--neon-magenta); background: rgba(255, 0, 255, 0.08); }
.badge-alfa { color: var(--neon-red); background: rgba(255, 45, 85, 0.08); }
.badge-default { color: var(--txt-dim); background: rgba(255, 255, 255, 0.05); }

/* ------------------------------------------------------------
   Sidebar
   ------------------------------------------------------------ */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  max-width: 84vw;
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: rgba(8, 12, 26, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--glass-brd);
  transform: translateX(-100%);
  transition: transform var(--t-slow);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: var(--safe-b);
}

.sidebar.open { transform: translateX(0); }

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(2, 4, 10, 0.6);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t), visibility var(--t);
}

.sidebar-backdrop.show { opacity: 1; visibility: visible; }

@media (min-width: 1024px) {
  .sidebar { transform: translateX(0); background: rgba(8, 12, 26, 0.72); }
  .sidebar-backdrop { display: none; }
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-5) var(--sp-4) var(--sp-4);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 var(--sp-3) var(--sp-4);
}

.sidebar-foot { margin-top: auto; padding: var(--sp-3) var(--sp-4) var(--sp-6); }

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.8rem;
  border-radius: var(--r-md);
  color: var(--txt-dim);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: var(--tr);
}

.nav-item svg { width: 19px; height: 19px; flex: none; }
.nav-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item:hover { color: var(--txt); background: rgba(255, 255, 255, 0.06); }

.nav-item.active {
  color: var(--neon-cyan);
  background: rgba(0, 243, 255, 0.1);
  border-color: rgba(0, 243, 255, 0.35);
  box-shadow: inset 0 0 18px rgba(0, 243, 255, 0.15);
}

/* ------------------------------------------------------------
   Bottom navigation (mobile & tablet)
   ------------------------------------------------------------ */
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: calc(12px + var(--safe-b));
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: stretch;
  gap: 4px;
  padding: 6px;
  width: calc(100% - 24px);
  max-width: 480px;
  background: rgba(10, 15, 31, 0.86);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-brd);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-lg);
}

@media (min-width: 1024px) {
  .bottom-nav { display: none; }
}

.bn-item {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  min-height: 54px;
  border-radius: var(--r-lg);
  color: var(--txt-dim);
  text-decoration: none;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  transition: var(--tr);
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.bn-item svg {
  width: 22px;
  height: 22px;
  flex: none;
  transition: transform var(--t);
}

.bn-item span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bn-item:active { transform: scale(0.94); }

.bn-item.active {
  color: var(--neon-cyan);
  background: rgba(0, 243, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(0, 243, 255, 0.35);
}

.bn-item.active svg { transform: translateY(-1px); }

.bn-item.active::after {
  content: "";
  position: absolute;
  bottom: 4px;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--neon-cyan);
  box-shadow: 0 0 8px var(--neon-cyan);
}

/* ------------------------------------------------------------
   Toast
   ------------------------------------------------------------ */
#toast-wrap {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: 12px;
  left: 12px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  pointer-events: none;
}

@media (min-width: 640px) {
  #toast-wrap { left: auto; top: 16px; right: 16px; max-width: 360px; }
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  width: 100%;
  max-width: 360px;
  padding: 0.75rem 0.95rem;
  border-radius: var(--r-md);
  background: rgba(10, 15, 31, 0.92);
  backdrop-filter: blur(18px);
  border: 1px solid var(--glass-brd);
  box-shadow: var(--sh-md);
  font-size: 0.85rem;
  line-height: 1.4;
  animation: slideIn var(--t-slow) both;
}

.toast.out { animation: slideOut var(--t) both; }
.toast.success { border-color: rgba(57, 255, 20, 0.5); }
.toast.error { border-color: rgba(255, 45, 85, 0.5); }
.toast.info { border-color: rgba(0, 243, 255, 0.5); }
.toast.warning { border-color: rgba(255, 184, 0, 0.5); }

@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
@keyframes slideOut { to { opacity: 0; transform: translateX(20px); } }

/* ------------------------------------------------------------
   Modal
   ------------------------------------------------------------ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(2, 4, 10, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  animation: fadeIn var(--t-fast) both;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow: auto;
  padding: var(--sp-5);
  background: rgba(12, 18, 38, 0.95);
  backdrop-filter: blur(24px);
  border: 1px solid var(--glass-brd);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-lg);
  animation: popIn var(--t) both;
}

.modal-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 0.4rem; }
.modal-actions { display: flex; gap: 0.6rem; justify-content: flex-end; flex-wrap: wrap; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(0.96) translateY(8px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------
   Loading
   ------------------------------------------------------------ */
.spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--neon-cyan);
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.12) 37%, rgba(255, 255, 255, 0.05) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ------------------------------------------------------------
   Scanner
   ------------------------------------------------------------ */
.scan-frame {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid rgba(0, 243, 255, 0.45);
  box-shadow: inset 0 0 30px rgba(0, 243, 255, 0.1);
}

#reader { border-radius: var(--r-lg); overflow: hidden; min-height: 220px; }
#reader video { width: 100% !important; height: auto !important; border-radius: var(--r-lg); display: block; }
#reader img[alt="Info icon"] { display: none; }

.scan-frame::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  top: 0;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
  box-shadow: 0 0 14px var(--neon-cyan);
  animation: scanline 2.4s linear infinite;
  pointer-events: none;
}

@keyframes scanline { 0% { top: 0; } 50% { top: calc(100% - 2px); } 100% { top: 0; } }

.scan-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 4, 10, 0.6);
  backdrop-filter: blur(4px);
  border-radius: var(--r-xl);
}

.pulse-ok { animation: pulseOk 1s ease 2; }
.pulse-fail { animation: pulseFail 1s ease 2; }

@keyframes pulseOk {
  0%, 100% { box-shadow: 0 0 0 rgba(57, 255, 20, 0); }
  50% { box-shadow: 0 0 40px rgba(57, 255, 20, 0.75); }
}

@keyframes pulseFail {
  0%, 100% { box-shadow: 0 0 0 rgba(255, 45, 85, 0); }
  50% { box-shadow: 0 0 40px rgba(255, 45, 85, 0.75); }
}

.blink-neon { animation: blinkNeon 0.55s ease-in-out 4; }

@keyframes blinkNeon {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* ------------------------------------------------------------
   Statistik & lain-lain
   ------------------------------------------------------------ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
}

@media (min-width: 640px) { .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .stat-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

.stat-card { padding: var(--sp-4); }
.stat-card .stat-value { font-size: 1.6rem; font-weight: 800; line-height: 1.1; margin-top: 0.2rem; }

.avatar { object-fit: cover; border-radius: 50%; border: 1px solid var(--glass-brd); }

.scroll-thin { scrollbar-width: thin; scrollbar-color: rgba(0, 243, 255, 0.35) transparent; }
.scroll-thin::-webkit-scrollbar { width: 6px; height: 6px; }
.scroll-thin::-webkit-scrollbar-thumb { background: rgba(0, 243, 255, 0.35); border-radius: 6px; }
.scroll-thin::-webkit-scrollbar-track { background: transparent; }

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.list-row:last-child { border-bottom: none; }

.chart-box { position: relative; width: 100%; height: 260px; }
.chart-box canvas { width: 100% !important; height: 100% !important; }

.qr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--sp-3);
}

.qr-tile { text-align: center; padding: var(--sp-4); }
.qr-tile .qr-box { background: #fff; padding: 8px; border-radius: var(--r-md); display: inline-block; line-height: 0; }
.qr-tile .qr-box img,
.qr-tile .qr-box canvas { margin: 0 auto; }

/* ------------------------------------------------------------
   Aksesibilitas & cetak
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  body::before,
  body::after,
  .sidebar,
  .bottom-nav,
  .app-header,
  #toast-wrap,
  .no-print { display: none !important; }

  .app-shell { margin-left: 0 !important; }
  .app-main { padding: 0 !important; }
  body { background: #fff; color: #000; }
  .glass, .glass-strong { background: #fff; border-color: #ccc; box-shadow: none; }
}

/* Standalone centered pages (error pages, minimal screens) */
.page-center {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 2.5rem);
}

/* ============================================================
   V2 — REDESIGN PREMIUM (Futuristic Neon Glassmorphism)
   Ditambahkan tanpa mengubah kelas lama agar semua halaman
   otomatis ikut memakai identitas visual baru.
   ============================================================ */

:root {
  --neon-blue: #2f7bff;
  --neon-violet: #8b5cff;
  --glow-blue: 0 0 24px rgba(47, 123, 255, 0.35);
  --glow-violet: 0 0 24px rgba(139, 92, 255, 0.32);
}

/* ---------- Kartu kaca yang lebih premium ---------- */
.glass {
  border-radius: var(--r-xl);
  box-shadow: var(--sh-md), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.glass-hover { transition: var(--tr); }
.glass-hover:hover { box-shadow: var(--sh-lg), 0 0 0 1px rgba(0, 243, 255, 0.18); transform: translateY(-2px); }

/* ---------- Hero sambutan ---------- */
.hero-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: var(--sp-4);
  padding: var(--sp-5);
  border-radius: var(--r-xl);
  border: 1px solid var(--glass-brd);
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(139, 92, 255, 0.26), transparent 60%),
    radial-gradient(90% 120% at 0% 100%, rgba(0, 243, 255, 0.16), transparent 62%),
    rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(20px);
  box-shadow: var(--sh-md), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  animation: fadeUp 0.5s var(--ease) both;
}

@media (min-width: 640px) {
  .hero-card { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: var(--sp-6); }
}

.hero-card h2 { font-size: clamp(1.35rem, 4.5vw, 1.9rem); font-weight: 800; letter-spacing: -0.02em; }
.hero-card p { color: var(--txt-dim); font-size: 0.9rem; margin-top: 0.4rem; max-width: 46ch; }

.hero-art {
  width: 108px;
  height: 108px;
  display: grid;
  place-items: center;
  border-radius: var(--r-xl);
  background: rgba(139, 92, 255, 0.12);
  border: 1px solid rgba(139, 92, 255, 0.4);
  box-shadow: var(--glow-violet);
  justify-self: start;
}
.hero-art svg { width: 60%; height: 60%; color: #c9b8ff; filter: drop-shadow(0 0 10px rgba(139, 92, 255, 0.7)); }
@media (min-width: 640px) { .hero-art { justify-self: end; } }

.hero-chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-4); }
.chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0.7rem; border-radius: var(--r-pill);
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em;
  border: 1px solid var(--glass-brd-2); background: rgba(255, 255, 255, 0.05); color: var(--txt-dim);
}

/* ---------- Stat card versi referensi ---------- */
.stat-grid { gap: var(--sp-3); }
@media (min-width: 640px) { .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .stat-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

.stat-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: var(--sp-4);
  border-radius: var(--r-lg);
  animation: fadeUp 0.45s var(--ease) both;
}
.stat-card .stat-ico {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; margin-bottom: var(--sp-3);
  border: 1px solid currentColor; background: rgba(255, 255, 255, 0.04);
}
.stat-card .stat-ico svg { width: 20px; height: 20px; }
.stat-card .stat-value { font-size: clamp(1.3rem, 5vw, 1.7rem); font-weight: 800; letter-spacing: -0.02em; }
.stat-card .stat-label { color: var(--txt-dim); font-size: 0.76rem; font-weight: 500; }
.stat-card .stat-sub { font-size: 0.78rem; font-weight: 700; margin-top: 0.15rem; }

.stat-c-blue   { border-color: rgba(47, 123, 255, 0.42); box-shadow: var(--sh-sm), inset 0 0 26px rgba(47, 123, 255, 0.1); }
.stat-c-lime   { border-color: rgba(57, 255, 20, 0.34); box-shadow: var(--sh-sm), inset 0 0 26px rgba(57, 255, 20, 0.08); }
.stat-c-amber  { border-color: rgba(255, 184, 0, 0.36); box-shadow: var(--sh-sm), inset 0 0 26px rgba(255, 184, 0, 0.09); }
.stat-c-violet { border-color: rgba(139, 92, 255, 0.42); box-shadow: var(--sh-sm), inset 0 0 26px rgba(139, 92, 255, 0.11); }
.stat-c-red    { border-color: rgba(255, 45, 85, 0.38); box-shadow: var(--sh-sm), inset 0 0 26px rgba(255, 45, 85, 0.09); }

.ico-blue   { color: var(--neon-blue); }
.ico-lime   { color: var(--neon-lime); }
.ico-amber  { color: var(--neon-amber); }
.ico-violet { color: var(--neon-violet); }
.ico-red    { color: var(--neon-red); }
.neon-blue  { color: var(--neon-blue); text-shadow: 0 0 10px rgba(47, 123, 255, 0.55); }
.neon-violet{ color: var(--neon-violet); text-shadow: 0 0 10px rgba(139, 92, 255, 0.55); }

/* ---------- Kartu aksi scan ---------- */
.scan-cta { display: grid; place-items: center; gap: var(--sp-3); text-align: center; padding: var(--sp-5); }
.scan-cta .scan-ring {
  width: 108px; height: 108px; border-radius: 26px;
  display: grid; place-items: center;
  border: 1.5px solid rgba(47, 123, 255, 0.6);
  background: radial-gradient(circle at 50% 50%, rgba(47, 123, 255, 0.22), transparent 70%);
  box-shadow: var(--glow-blue), inset 0 0 24px rgba(47, 123, 255, 0.22);
  animation: floaty 3.4s ease-in-out infinite;
}
.scan-cta .scan-ring svg { width: 52px; height: 52px; color: #8ec2ff; }

/* ---------- Baris daftar dengan avatar ---------- */
.row-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--sp-3);
  padding: 0.6rem 0.7rem;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  transition: var(--tr);
}
.row-item + .row-item { margin-top: 0.35rem; }
.row-item:hover { background: rgba(255, 255, 255, 0.045); border-color: var(--glass-brd); }
.row-item .row-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 1px solid var(--glass-brd-2); flex: none; }
.row-item .row-title { font-size: 0.86rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-item .row-sub { font-size: 0.72rem; color: var(--txt-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Header kartu ---------- */
.card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.card-head .section-title { margin: 0; }

.link-more {
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-size: 0.78rem; font-weight: 600; color: var(--neon-cyan);
  text-decoration: none; transition: var(--tr);
}
.link-more:hover { text-shadow: 0 0 12px rgba(0, 243, 255, 0.6); }

/* ---------- Donut ringkasan ---------- */
.donut-wrap { display: grid; gap: var(--sp-4); align-items: center; }
@media (min-width: 420px) { .donut-wrap { grid-template-columns: 160px minmax(0, 1fr); } }
.donut-box { position: relative; width: 100%; max-width: 170px; aspect-ratio: 1; margin-inline: auto; }
.donut-center {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none;
}
.donut-center b { display: block; font-size: 1.45rem; font-weight: 800; line-height: 1; }
.donut-center span { font-size: 0.7rem; color: var(--txt-dim); }
.legend { display: grid; gap: 0.45rem; }
.legend-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 0.6rem; font-size: 0.82rem; }
.legend-row i { width: 10px; height: 10px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.legend-row b { font-variant-numeric: tabular-nums; }

/* ---------- Bottom nav dengan tombol scan mengapung ---------- */
.bottom-nav { border-radius: 22px 22px 0 0; }
.bn-item.bn-scan {
  position: relative;
}
.bn-item.bn-scan .bn-fab {
  width: 54px; height: 54px; margin-top: -26px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, rgba(47, 123, 255, 0.9), rgba(20, 40, 110, 0.95));
  border: 1.5px solid rgba(120, 180, 255, 0.85);
  box-shadow: 0 0 26px rgba(47, 123, 255, 0.65), inset 0 0 16px rgba(255, 255, 255, 0.16);
  transition: var(--tr);
}
.bn-item.bn-scan .bn-fab svg { width: 26px; height: 26px; color: #eaf3ff; }
.bn-item.bn-scan:active .bn-fab { transform: scale(0.93); }
.bn-item.bn-scan.active .bn-fab { box-shadow: 0 0 34px rgba(47, 123, 255, 0.85); }
.bn-item.bn-scan::after { display: none; }

/* ---------- Skeleton & animasi ---------- */
.skel-line { height: 12px; border-radius: 6px; margin-bottom: 0.5rem; }
.skel-card { height: 96px; border-radius: var(--r-lg); }

@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.anim-fade { animation: fadeUp 0.45s var(--ease) both; }
.anim-d1 { animation-delay: 0.05s; }
.anim-d2 { animation-delay: 0.1s; }
.anim-d3 { animation-delay: 0.15s; }
.anim-d4 { animation-delay: 0.2s; }

/* Ripple tombol */
.btn { position: relative; overflow: hidden; }
.btn .ripple {
  position: absolute; border-radius: 50%; transform: scale(0);
  background: rgba(255, 255, 255, 0.28); pointer-events: none;
  animation: rippleGo 0.6s var(--ease) forwards;
}
@keyframes rippleGo { to { transform: scale(2.6); opacity: 0; } }

.btn-primary {
  border-color: rgba(47, 123, 255, 0.55);
  color: #eaf3ff;
  background: linear-gradient(135deg, rgba(47, 123, 255, 0.35), rgba(139, 92, 255, 0.3));
}
.btn-primary:hover { box-shadow: var(--glow-blue); background: linear-gradient(135deg, rgba(47, 123, 255, 0.5), rgba(139, 92, 255, 0.42)); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- Profil ---------- */
.profile-head { display: grid; gap: var(--sp-4); align-items: center; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 560px) { .profile-head { grid-template-columns: 96px minmax(0, 1fr); } }
.profile-photo {
  width: 96px; height: 96px; border-radius: 28px; object-fit: cover;
  border: 1.5px solid rgba(0, 243, 255, 0.4); box-shadow: var(--glow-cyan); background: rgba(255, 255, 255, 0.05);
}
.info-list { display: grid; gap: 0.55rem; }
.info-list > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp-3); font-size: 0.84rem; padding-bottom: 0.5rem; border-bottom: 1px dashed var(--glass-brd); }
.info-list > div:last-child { border-bottom: none; padding-bottom: 0; }
.info-list span { color: var(--txt-dim); }
.info-list b { text-align: right; overflow-wrap: anywhere; }

/* ---------- QR tile aksi ---------- */
.qr-tile .qr-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: center; margin-top: var(--sp-3); }
