/* ============================================================
   style.css — Absensi Digital TK
   01 Variabel & Reset
   02 Helper
   03 Layout / App Shell
   04 Header & Navigasi
   05 Kartu & Panel
   06 Tombol & Badge
   07 Form
   08 Scan Kamera
   09 Daftar & Tabel
   10 Notifikasi
   11 Kartu Siswa (QR)
   12 Modal
   13 Animasi
   14 Responsive
   ============================================================ */

/* ---------- 01 Variabel & Reset ---------- */
:root {
  --brand: #6d28d9;
  --brand-2: #8b5cf6;
  --brand-3: #a78bfa;
  --brand-soft: #f3eeff;

  --green: #10b981;
  --green-soft: #d1fae5;
  --amber: #f59e0b;
  --amber-soft: #fef3c7;
  --red: #ef4444;
  --red-soft: #fee2e2;
  --blue: #0ea5e9;
  --blue-soft: #e0f2fe;
  --pink: #ec4899;
  --pink-soft: #fce7f3;

  --ink: #1f1b2e;
  --ink-2: #4b4560;
  --ink-3: #8b85a0;
  --line: #e8e4f3;
  --bg: #faf8ff;
  --card: #ffffff;

  --radius-s: 10px;
  --radius: 16px;
  --radius-l: 24px;
  --shadow-s: 0 1px 2px rgba(31, 27, 46, .06), 0 2px 8px rgba(31, 27, 46, .04);
  --shadow: 0 4px 12px rgba(31, 27, 46, .07), 0 12px 28px rgba(31, 27, 46, .06);
  --shadow-l: 0 10px 30px rgba(109, 40, 217, .14);

  --nav-h: 62px;
  --maxw: 1080px;
  --font: "Poppins", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(167, 139, 250, .16), transparent 42%),
    radial-gradient(circle at 88% 0%, rgba(251, 191, 36, .14), transparent 40%);
  background-attachment: fixed;
  padding-bottom: 80px;
}

h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.22rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 1em; color: var(--ink-2); }
a { color: var(--brand); text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
ul { margin: 0; padding: 0; list-style: none; }

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

/* ---------- 02 Helper ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1 1 auto; min-width: 0; }
.center { text-align: center; }
.muted { color: var(--ink-3); }
.small { font-size: .8rem; }
.tiny { font-size: .72rem; }
.bold { font-weight: 700; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.hide { display: none !important; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px; margin: 26px 0 12px; flex-wrap: wrap;
}
.section-head h2 { margin: 0; }
.section-head .sub { font-size: .82rem; color: var(--ink-3); margin: 2px 0 0; }

/* ---------- 03 Layout ---------- */
.app { max-width: var(--maxw); margin-inline: auto; padding: 16px; }

.hero-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-l);
  padding: 22px 20px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 55%, #b98bff 100%);
  box-shadow: var(--shadow-l);
}
.hero-card::after {
  content: "";
  position: absolute; inset: auto -40px -60px auto;
  width: 220px; height: 220px; border-radius: 50%;
  background: rgba(255, 255, 255, .12);
}
.hero-card::before {
  content: "";
  position: absolute; top: -50px; right: -20px;
  width: 140px; height: 140px; border-radius: 50%;
  background: rgba(255, 255, 255, .1);
}
.hero-card > * { position: relative; z-index: 1; }
.hero-card h1 { font-size: 1.35rem; margin-bottom: 6px; }
.hero-card p { color: rgba(255, 255, 255, .88); margin: 0; font-size: .88rem; }

.grid { display: grid; gap: 12px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--auto { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

/* Statistik */
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat {
  background: var(--card); border-radius: var(--radius); padding: 13px 14px;
  border: 1px solid var(--line); box-shadow: var(--shadow-s);
  display: flex; align-items: center; gap: 11px;
}
.stat__ic {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 11px;
  display: grid; place-items: center; font-size: 1.05rem;
  background: var(--brand-soft); color: var(--brand);
}
.stat__val { font-size: 1.3rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat__lbl { font-size: .7rem; color: var(--ink-3); font-weight: 500; }
.stat--green .stat__ic { background: var(--green-soft); color: #047857; }
.stat--amber .stat__ic { background: var(--amber-soft); color: #b45309; }
.stat--red .stat__ic { background: var(--red-soft); color: #b91c1c; }
.stat--blue .stat__ic { background: var(--blue-soft); color: #0369a1; }

/* ---------- 04 Header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar__in {
  max-width: var(--maxw); margin-inline: auto;
  height: var(--nav-h); padding-inline: 16px;
  display: flex; align-items: center; gap: 10px;
}
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand__logo {
  width: 36px; height: 36px; border-radius: 11px; flex: 0 0 36px;
  display: grid; place-items: center; font-size: 1.05rem;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; box-shadow: 0 4px 10px rgba(109, 40, 217, .3);
}
.brand__txt { min-width: 0; }
.brand__name { font-weight: 800; font-size: .92rem; line-height: 1.15; }
.brand__sub { font-size: .66rem; color: var(--ink-3); letter-spacing: .04em; text-transform: uppercase; }

.icon-btn {
  position: relative;
  width: 40px; height: 40px; flex: 0 0 40px;
  border-radius: 12px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2);
  display: grid; place-items: center; font-size: 1.05rem; cursor: pointer;
  transition: .18s;
}
.icon-btn:hover { background: var(--brand-soft); color: var(--brand); border-color: var(--brand-3); }
.icon-btn__dot {
  position: absolute; top: 6px; right: 6px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--red); color: #fff;
  font-size: .62rem; font-weight: 700; line-height: 17px; text-align: center;
  border: 2px solid #fff;
}

/* Nav bawah (mobile first) */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 70;
  background: rgba(255, 255, 255, .95);
  backdrop-filter: saturate(160%) blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 18px rgba(31, 27, 46, .07);
}
.tabbar__in {
  max-width: 600px; margin-inline: auto;
  display: grid; grid-template-columns: repeat(6, 1fr);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 1px 8px; color: var(--ink-3);
  font-size: .58rem; font-weight: 600; position: relative;
  transition: .18s;
}
.tab i { font-size: 1.12rem; font-style: normal; line-height: 1; }
.tab.is-active { color: var(--brand); }
.tab.is-active::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 26px; height: 3px; border-radius: 0 0 4px 4px; background: var(--brand);
}
.tab.is-active i { transform: translateY(-1px) scale(1.08); }
.tab--scan i {
  width: 46px; height: 46px; margin-top: -20px;
  border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-size: 1.32rem;
  box-shadow: 0 6px 16px rgba(109, 40, 217, .38);
  border: 3px solid #fff;
}
.tab--scan span { margin-top: 2px; }

/* ---------- 05 Kartu & Panel ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 15px;
  box-shadow: var(--shadow-s);
}
.card--pad-lg { padding: 18px; }
.card__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 12px;
}
.card__head h3 { margin: 0; font-size: .96rem; }

.list { display: flex; flex-direction: column; }
.list__item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 0; border-bottom: 1px dashed var(--line);
}
.list__item:last-child { border-bottom: 0; }
.list__item:first-child { padding-top: 4px; }

.avatar {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 13px;
  display: grid; place-items: center;
  font-weight: 800; font-size: .9rem; color: #fff;
  box-shadow: 0 3px 8px rgba(31, 27, 46, .16);
}
.avatar--lg { width: 52px; height: 52px; flex: 0 0 52px; border-radius: 16px; font-size: 1.1rem; }

.empty {
  text-align: center; padding: 30px 16px; color: var(--ink-3);
}
.empty__ic { font-size: 2.2rem; margin-bottom: 8px; opacity: .75; }
.empty p { margin: 0; font-size: .84rem; }

/* ---------- 06 Tombol ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 18px; border-radius: 12px; border: 1px solid transparent;
  font-size: .87rem; font-weight: 650; font-family: inherit;
  cursor: pointer; transition: .18s; text-align: center;
  background: #fff; color: var(--ink-2);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.975); }
.btn--primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 5px 14px rgba(109, 40, 217, .28); }
.btn--primary:hover { filter: brightness(1.06); }
.btn--green { background: var(--green); color: #fff; box-shadow: 0 5px 14px rgba(16, 185, 129, .3); }
.btn--red { background: var(--red); color: #fff; box-shadow: 0 5px 14px rgba(239, 68, 68, .28); }
.btn--amber { background: var(--amber); color: #fff; box-shadow: 0 5px 14px rgba(245, 158, 11, .3); }
.btn--ghost { background: var(--brand-soft); color: var(--brand); }
.btn--outline { border-color: var(--line); background: #fff; }
.btn--outline:hover { border-color: var(--brand-3); color: var(--brand); }
.btn--sm { padding: 7px 12px; font-size: .76rem; border-radius: 9px; }
.btn--lg { padding: 14px 22px; font-size: .96rem; border-radius: 14px; }
.btn--block { width: 100%; }
.btn--icon { padding: 8px; width: 34px; height: 34px; border-radius: 9px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px;
  font-size: .68rem; font-weight: 700; letter-spacing: .01em;
  background: var(--brand-soft); color: var(--brand);
  white-space: nowrap;
}
.badge--green { background: var(--green-soft); color: #047857; }
.badge--amber { background: var(--amber-soft); color: #b45309; }
.badge--red { background: var(--red-soft); color: #b91c1c; }
.badge--blue { background: var(--blue-soft); color: #0369a1; }
.badge--gray { background: #f1f0f6; color: var(--ink-3); }
.badge--dot::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; flex: 0 0 6px;
}

/* Chip filter */
.chips { display: flex; gap: 7px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; padding: 7px 14px; border-radius: 20px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  font-size: .78rem; font-weight: 600; cursor: pointer; transition: .16s;
}
.chip:hover { border-color: var(--brand-3); }
.chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 3px 10px rgba(109, 40, 217, .26); }

/* ---------- 07 Form ---------- */
.field { margin-bottom: 13px; }
.field__label {
  display: block; font-size: .78rem; font-weight: 650;
  color: var(--ink-2); margin-bottom: 5px;
}
.field__label .req { color: var(--red); }
.input, .select, .textarea {
  width: 100%; padding: 11px 13px;
  border: 1.5px solid var(--line); border-radius: 11px;
  font-size: .88rem; font-family: inherit; color: var(--ink);
  background: #fff; transition: .16s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand-3);
  box-shadow: 0 0 0 3.5px rgba(139, 92, 246, .14);
}
.input::placeholder, .textarea::placeholder { color: #b9b3c9; }
.textarea { resize: vertical; min-height: 72px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath stroke='%238b85a0' stroke-width='1.6' stroke-linecap='round' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px; }
.field__hint { font-size: .7rem; color: var(--ink-3); margin-top: 4px; }
.field__err { font-size: .72rem; color: var(--red); margin-top: 4px; display: none; font-weight: 600; }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--red); background: #fffafa; }
.field.has-error .field__err { display: block; }

.form-row { display: grid; gap: 0 12px; grid-template-columns: 1fr; }

/* ---------- 08 Scan Kamera ---------- */
.scan-area {
  position: relative; border-radius: var(--radius-l); overflow: hidden;
  background: #16121f; aspect-ratio: 4 / 3;
  box-shadow: var(--shadow);
}
.scan-area video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
}
.scan-frame__box {
  width: 68%; aspect-ratio: 1; max-width: 240px;
  border-radius: 20px; position: relative;
  box-shadow: 0 0 0 100vmax rgba(22, 18, 31, .48);
}
.scan-frame__box::before, .scan-frame__box::after,
.scan-frame__box span::before, .scan-frame__box span::after {
  content: ""; position: absolute; width: 30px; height: 30px;
  border: 4px solid #a78bfa; border-radius: 4px;
}
.scan-frame__box::before { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-radius: 16px 0 0 0; }
.scan-frame__box::after { top: -2px; right: -2px; border-left: 0; border-bottom: 0; border-radius: 0 16px 0 0; }
.scan-frame__box span::before { bottom: -2px; left: -2px; border-right: 0; border-top: 0; border-radius: 0 0 0 16px; }
.scan-frame__box span::after { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-radius: 0 0 16px 0; }
.scan-line {
  position: absolute; left: 8%; right: 8%; height: 3px;
  background: linear-gradient(90deg, transparent, #c4b5fd, #a78bfa, #c4b5fd, transparent);
  border-radius: 3px; box-shadow: 0 0 14px #a78bfa;
  animation: scanMove 2.1s ease-in-out infinite;
}
@keyframes scanMove {
  0%, 100% { top: 14%; opacity: .35; }
  50% { top: 82%; opacity: 1; }
}
.scan-hint {
  position: absolute; left: 0; right: 0; bottom: 12px;
  text-align: center; color: #fff; font-size: .74rem;
  font-weight: 600; text-shadow: 0 1px 4px rgba(0, 0, 0, .7);
  padding-inline: 20px;
}
.scan-off {
  position: absolute; inset: 0; display: grid; place-items: center;
  text-align: center; color: #cdc6dd; padding: 24px; gap: 10px;
  background: linear-gradient(160deg, #1f1a2c, #16121f);
}
.scan-off__ic { font-size: 2.4rem; }

/* Hasil scan */
.scan-result {
  border-radius: var(--radius-l); padding: 20px;
  text-align: center; border: 2px solid var(--line); background: #fff;
  animation: popIn .32s cubic-bezier(.2, .9, .3, 1.4);
}
.scan-result--ok { border-color: var(--green); background: linear-gradient(180deg, var(--green-soft), #fff 70%); }
.scan-result--warn { border-color: var(--amber); background: linear-gradient(180deg, var(--amber-soft), #fff 70%); }
.scan-result--err { border-color: var(--red); background: linear-gradient(180deg, var(--red-soft), #fff 70%); }
.scan-result__ic { font-size: 2.6rem; line-height: 1; margin-bottom: 6px; }
.scan-result__name { font-size: 1.2rem; font-weight: 800; margin-bottom: 2px; }
.scan-result__meta { font-size: .8rem; color: var(--ink-2); }
.scan-result__big {
  font-size: 1.9rem; font-weight: 800; font-variant-numeric: tabular-nums;
  letter-spacing: .02em; color: var(--brand); margin: 6px 0 2px;
}

/* Mode selector */
.seg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: #f1eefb; border-radius: 13px; padding: 4px;
}
.seg__btn {
  padding: 9px; border-radius: 10px; border: 0; background: transparent;
  font-size: .82rem; font-weight: 700; color: var(--ink-3);
  cursor: pointer; transition: .16s;
}
.seg__btn.is-active { background: #fff; color: var(--brand); box-shadow: var(--shadow-s); }

/* ---------- 09 Daftar & Tabel ---------- */
.data-table { width: 100%; border-collapse: collapse; font-size: .81rem; }
.data-table th {
  text-align: left; font-size: .68rem; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ink-3);
  padding: 9px 10px; border-bottom: 1.5px solid var(--line);
  font-weight: 700; white-space: nowrap;
}
.data-table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:hover { background: #fbf9ff; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; margin-inline: -15px; padding-inline: 15px; }

/* Kartu anak dalam daftar */
.kid {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px; border-radius: 14px;
  background: #fff; border: 1px solid var(--line);
  box-shadow: var(--shadow-s); margin-bottom: 9px;
  transition: .18s;
}
.kid:hover { border-color: var(--brand-3); box-shadow: var(--shadow); }
.kid__body { flex: 1 1 auto; min-width: 0; }
.kid__nama { font-weight: 700; font-size: .9rem; line-height: 1.3; }
.kid__meta { font-size: .72rem; color: var(--ink-3); }
.kid__act { display: flex; gap: 6px; flex: 0 0 auto; }

/* Baris antrean penjemputan */
.queue {
  display: flex; gap: 12px; align-items: center;
  padding: 13px; border-radius: 15px; margin-bottom: 10px;
  background: #fff; border: 1.5px solid var(--line);
  box-shadow: var(--shadow-s);
}
.queue--late { border-color: #fca5a5; background: linear-gradient(90deg, #fff5f5, #fff); animation: pulseRed 2.4s ease-in-out infinite; }
.queue__time {
  flex: 0 0 auto; text-align: center; min-width: 54px;
  padding: 6px 4px; border-radius: 11px; background: var(--brand-soft);
}
.queue--late .queue__time { background: var(--red-soft); }
.queue__time b { display: block; font-size: .95rem; color: var(--brand); font-variant-numeric: tabular-nums; }
.queue--late .queue__time b { color: #b91c1c; }
.queue__time span { font-size: .58rem; color: var(--ink-3); font-weight: 600; text-transform: uppercase; }
.queue__body { flex: 1 1 auto; min-width: 0; }

/* ---------- 10 Notifikasi ---------- */
.notif {
  display: flex; gap: 11px; padding: 12px 13px;
  border-radius: 14px; background: #fff; border: 1px solid var(--line);
  margin-bottom: 9px; box-shadow: var(--shadow-s);
  position: relative; transition: .18s;
}
.notif--unread { border-left: 3.5px solid var(--brand); background: #fdfcff; }
.notif--urgent { border-left: 3.5px solid var(--red); background: #fffafa; }
.notif__ic {
  width: 36px; height: 36px; flex: 0 0 36px; border-radius: 11px;
  display: grid; place-items: center; font-size: 1rem;
  background: var(--brand-soft);
}
.notif__ic--hijau { background: var(--green-soft); }
.notif__ic--merah { background: var(--red-soft); }
.notif__ic--biru { background: var(--blue-soft); }
.notif__ic--ungu { background: #ede9fe; }
.notif__ic--kuning { background: var(--amber-soft); }
.notif__body { flex: 1 1 auto; min-width: 0; }
.notif__title { font-size: .82rem; font-weight: 700; margin-bottom: 1px; }
.notif__msg { font-size: .79rem; color: var(--ink-2); line-height: 1.45; margin: 0; }
.notif__meta { font-size: .68rem; color: var(--ink-3); margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Toast */
.toast-area {
  position: fixed; left: 50%; bottom: 78px; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 8px;
  width: calc(100% - 32px); max-width: 400px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 14px; border-radius: 13px;
  background: #241f33; color: #fff; font-size: .82rem; font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
  animation: toastIn .28s cubic-bezier(.2, .9, .3, 1.2);
  pointer-events: auto;
}
.toast--ok { background: #065f46; }
.toast--err { background: #991b1b; }
.toast--warn { background: #92400e; }
.toast.is-out { animation: toastOut .24s forwards; }

/* ---------- 11 Kartu Siswa (QR) ---------- */
.kartu {
  width: 100%; max-width: 300px; margin-inline: auto;
  border-radius: 18px; overflow: hidden;
  background: #fff; border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.kartu__top {
  padding: 13px 15px; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: flex; align-items: center; gap: 8px;
}
.kartu__top b { font-size: .84rem; line-height: 1.2; }
.kartu__top span { font-size: .62rem; opacity: .85; }
.kartu__body { padding: 14px 15px 16px; text-align: center; }
.kartu__qr {
  width: 168px; height: 168px; margin: 0 auto 10px;
  padding: 8px; background: #fff; border-radius: 12px;
  border: 1px solid var(--line);
}
.kartu__qr img, .kartu__qr canvas { width: 100% !important; height: 100% !important; }
.kartu__nama { font-weight: 800; font-size: .95rem; line-height: 1.25; }
.kartu__kelas { font-size: .72rem; color: var(--ink-3); margin-bottom: 8px; }
.kartu__id {
  display: inline-block; padding: 4px 12px; border-radius: 8px;
  background: #f4f1fb; font-family: ui-monospace, monospace;
  font-size: .82rem; font-weight: 700; letter-spacing: .06em; color: var(--brand);
}
.kartu__foot {
  border-top: 1px dashed var(--line); padding: 9px 15px;
  font-size: .62rem; color: var(--ink-3); text-align: center;
}

/* ---------- 12 Modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 300;
  display: none; align-items: flex-end; justify-content: center;
  background: rgba(22, 18, 31, .55);
  backdrop-filter: blur(3px);
  padding: 0;
}
.modal.is-open { display: flex; }
.modal__box {
  width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto;
  background: #fff; border-radius: var(--radius-l) var(--radius-l) 0 0;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  animation: sheetUp .3s cubic-bezier(.2, .9, .3, 1.1);
}
.modal__grip {
  width: 38px; height: 4px; border-radius: 3px; background: #ddd8ea;
  margin: 0 auto 14px;
}
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.modal__head h3 { margin: 0; font-size: 1.05rem; }
.modal__close {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; cursor: pointer;
  color: var(--ink-3); font-size: 1.1rem; display: grid; place-items: center;
}
.modal__close:hover { background: var(--red-soft); color: var(--red); border-color: #fca5a5; }

/* ---------- 13 Animasi ---------- */
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes popIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes sheetUp { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes pulseRed {
  0%, 100% { box-shadow: var(--shadow-s); }
  50% { box-shadow: 0 0 0 3px rgba(239, 68, 68, .12); }
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  animation: spin .7s linear infinite; display: inline-block;
}
.fade-up { animation: fadeUp .34s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- 14 Responsive ---------- */
@media (min-width: 560px) {
  body { font-size: 15.5px; }
  .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  h1 { font-size: 1.75rem; }
  .hero-card { padding: 28px 26px; }
  .hero-card h1 { font-size: 1.6rem; }
  .form-row--2 { grid-template-columns: 1fr 1fr; }
  .modal { align-items: center; padding: 20px; }
  .modal__box { border-radius: var(--radius-l); animation: popIn .28s cubic-bezier(.2, .9, .3, 1.2); }
  .modal__grip { display: none; }
}

@media (min-width: 860px) {
  body { padding-bottom: 32px; }
  .app { padding: 24px; }
  .tabbar {
    position: sticky; bottom: auto; top: var(--nav-h);
    border-top: 0; border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-s); border-radius: 0;
  }
  .tabbar__in { max-width: var(--maxw); grid-template-columns: repeat(6, auto); justify-content: center; gap: 6px; }
  .tab { flex-direction: row; padding: 11px 18px; font-size: .82rem; gap: 7px; }
  .tab i { font-size: 1rem; }
  .tab.is-active::before { top: auto; bottom: 0; width: 60%; height: 3px; border-radius: 4px 4px 0 0; }
  .tab--scan { background: transparent; }
  .tab--scan i { width: auto; height: auto; margin: 0; border: 0; background: none; color: var(--brand); box-shadow: none; font-size: 1rem; }
  .tab--scan span { margin: 0; }
  h1 { font-size: 2rem; }
  .hero-card { padding: 34px 32px; }
  .hero-card h1 { font-size: 1.9rem; }
  .grid--3 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .section-head { margin-top: 34px; }
  .toast-area { bottom: 24px; }
  .form-row--3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }
}

@media print {
  .topbar, .tabbar, .btn, .icon-btn, .toast-area { display: none !important; }
  body { background: #fff; padding: 0; }
  .kartu { box-shadow: none; border: 1.5px solid #bbb; page-break-inside: avoid; }
}