/* =============================================================
   Gubuk Lentera — Presensi Bimbel
   Tema: putih + hijau kekuningan, glassmorphism
   ============================================================= */
:root {
  --lime-50: #f8fcec;
  --lime-100: #eff8d2;
  --lime-200: #dff0a6;
  --lime-300: #c8e46e;
  --lime-400: #aed543;
  --lime-500: #92c02a;
  --lime-600: #74a01c;
  --lime-700: #587c18;
  --lime-800: #3f5a15;
  --sun: #f3d849;

  --ink: #1f2b14;
  --ink-2: #3c4a2f;
  --muted: #6f7d61;
  --line: rgba(88, 124, 24, 0.14);

  --hadir: #5fa316;
  --hadir-bg: #e8f6d3;
  --izin: #2f7fd8;
  --izin-bg: #e1eefc;
  --sakit: #d99206;
  --sakit-bg: #fdf1d3;
  --alpa: #dc4a3d;
  --alpa-bg: #fde3df;

  --glass: rgba(255, 255, 255, 0.58);
  --glass-strong: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(255, 255, 255, 0.85);
  --shadow: 0 10px 34px rgba(70, 100, 20, 0.12), 0 2px 6px rgba(70, 100, 20, 0.06);
  --shadow-lg: 0 24px 60px rgba(50, 75, 10, 0.2);

  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;
  --sidebar: 268px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  background: linear-gradient(165deg, #ffffff 0%, #f6fbe6 45%, #eef7d6 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--lime-700); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Latar hiasan ---------- */
.bg-deco { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.55; }
.b1 { width: 460px; height: 460px; background: #dff0a6; top: -120px; right: -80px; }
.b2 { width: 380px; height: 380px; background: #fff3b0; top: 30%; left: -140px; }
.b3 { width: 320px; height: 320px; background: #c8e46e; top: 8%; left: 40%; opacity: 0.3; }
.mountain {
  transition: opacity .8s ease;
  position: absolute; left: 0; right: 0; bottom: 0; width: 100%;
  min-width: 900px; object-fit: cover; object-position: bottom;
  opacity: 0.32;
  -webkit-mask-image: linear-gradient(to top, #000 45%, transparent 100%);
  mask-image: linear-gradient(to top, #000 45%, transparent 100%);
}
body.splashing .mountain { opacity: 0.85; -webkit-mask-image: linear-gradient(to top, #000 70%, transparent 100%); mask-image: linear-gradient(to top, #000 70%, transparent 100%); }

#root { position: relative; z-index: 1; min-height: 100vh; }


/* ---------- Glass ---------- */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  border-radius: var(--r-lg);
}
.glass-strong {
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
}

/* ---------- Ikon ---------- */
.ic { width: 18px; height: 18px; flex: none; }
.ic-lg { width: 22px; height: 22px; }

/* ---------- Tombol ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 12px; padding: 10px 16px;
  font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, opacity .2s;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--lime-400), var(--lime-600));
  color: #fff; box-shadow: 0 6px 16px rgba(116, 160, 28, .35);
}
.btn-primary:hover { box-shadow: 0 8px 22px rgba(116, 160, 28, .45); }
.btn-ghost { background: rgba(255,255,255,.7); border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { background: #fff; border-color: var(--lime-300); }
.btn-danger { background: var(--alpa-bg); color: var(--alpa); border-color: rgba(220,74,61,.2); }
.btn-danger:hover { background: #fbd2cc; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn.busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.busy::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.6); border-top-color: #fff; animation: spin .7s linear infinite;
}
.btn-ghost.busy::after { border-color: rgba(88,124,24,.3); border-top-color: var(--lime-700); }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid transparent; background: transparent; color: var(--ink-2);
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: rgba(174, 213, 67, .18); color: var(--lime-800); }
.icon-btn.danger:hover { background: var(--alpa-bg); color: var(--alpa); }

/* ---------- Form ---------- */
.field { display: grid; gap: 6px; align-content: start; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field small { color: var(--muted); font-size: 12px; }
.input, .select, .textarea {
  width: 100%; padding: 11px 14px; border-radius: 12px;
  border: 1px solid rgba(88,124,24,.2); background: rgba(255,255,255,.85);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 76px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--lime-500); box-shadow: 0 0 0 4px rgba(174,213,67,.25); }
.select { appearance: none; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23587c18' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.search { position: relative; }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .input { padding-left: 38px; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px 140px; }
.login-card { width: 100%; max-width: 420px; padding: 32px 28px; border-radius: 28px; }

/* ---------- Layout aplikasi ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 18px 14px; margin: 0;
  display: flex; flex-direction: column; gap: 14px;
  border-radius: 0 26px 26px 0; border-left: 0;
  z-index: 40; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 14px; border-bottom: 1px solid var(--line); }
.brand img { width: 52px; height: 52px; }
.brand b { display: block; font-size: 18px; font-weight: 800; color: var(--lime-800); letter-spacing: -.01em; }
.brand small { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.nav { display: grid; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 13px;
  color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 14.5px;
  transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(174,213,67,.16); color: var(--lime-800); }
.nav a.active {
  background: linear-gradient(135deg, var(--lime-400), var(--lime-600)); color: #fff;
  box-shadow: 0 8px 18px rgba(116,160,28,.32);
}
.side-foot { margin-top: auto; display: grid; gap: 10px; }
.kkn { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: rgba(255,255,255,.55); border: 1px solid var(--glass-border); }
.kkn img { width: 40px; height: 40px; }
.kkn span { font-size: 11px; line-height: 1.35; color: var(--muted); }
.kkn b { color: var(--ink-2); font-size: 11.5px; }

.main { min-width: 0; padding: 18px 28px 140px; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 12px 18px; margin-bottom: 22px; border-radius: 18px; position: sticky; top: 12px; z-index: 30; }
.topbar h2 { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.topbar .sub { font-size: 12.5px; color: var(--muted); }
.topbar .grow { flex: 1; min-width: 0; }
.topbar .today { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); font-weight: 600;
  padding: 8px 12px; background: rgba(255,255,255,.65); border-radius: 12px; border: 1px solid var(--glass-border); }
.mode-badge { font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: var(--sakit-bg); color: #8a5c00; }
.mode-badge.sb { background: var(--hadir-bg); color: var(--lime-700); }
.menu-btn { display: none; }
.scrim { display: none; }

/* ---------- Kartu & bagian ---------- */
.card { padding: 20px; }
.card-h { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-h h3 { font-size: 16.5px; font-weight: 700; }
.card-h p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.card-h .grow { flex: 1; min-width: 180px; }
.stack { display: grid; gap: 20px; }
.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; }
.grid-2b { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.stack > *, .grid-2 > *, .grid-2b > *, .stats > * { min-width: 0; }

.hero {
  position: relative; overflow: hidden; padding: 24px 26px;
  background: linear-gradient(120deg, rgba(174,213,67,.9), rgba(116,160,28,.92));
  color: #fff; border-radius: var(--r-lg); box-shadow: 0 14px 34px rgba(116,160,28,.32);
}
.hero h1 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.hero p { margin: 6px 0 0; opacity: .92; max-width: 560px; font-size: 14px; }
.hero .actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero .btn-light { background: #fff; color: var(--lime-700); }
.hero .btn-outline { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.5); }
.hero img.lantern { position: absolute; right: 18px; bottom: -18px; width: 150px; opacity: .95; filter: drop-shadow(0 10px 20px rgba(0,0,0,.18)); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { padding: 18px; display: flex; gap: 14px; align-items: center; }
.stat .ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--lime-100), var(--lime-200)); color: var(--lime-700); }
.stat .ico.y { background: linear-gradient(135deg, #fff7cf, #fbe9a0); color: #9a7400; }
.stat .ico.b { background: linear-gradient(135deg, #e6f1fd, #cfe3fb); color: var(--izin); }
.stat b { font-size: 26px; font-weight: 800; display: block; line-height: 1.1; letter-spacing: -.02em; }
.stat span { font-size: 12.5px; color: var(--muted); font-weight: 600; }

/* ---------- Grafik ---------- */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 200px; padding: 8px 4px 0; border-bottom: 1px dashed var(--line); }
.bar { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.bar i { display: block; width: 100%; max-width: 36px; border-radius: 9px 9px 4px 4px;
  background: linear-gradient(180deg, var(--lime-300), var(--lime-600)); min-height: 4px; transition: height .5s ease; }
.bar.none i { background: repeating-linear-gradient(45deg, #edf3dc, #edf3dc 4px, #f7faee 4px, #f7faee 8px); }
.bar em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--lime-700); }
.bar-x { display: flex; gap: 8px; padding: 6px 4px 0; }
.bar-x span { flex: 1; text-align: center; font-size: 11.5px; color: var(--muted); font-weight: 600; }

.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; justify-content: center; }
.donut { width: 160px; height: 160px; border-radius: 50%; position: relative; flex: none; }
.donut::after { content: ""; position: absolute; inset: 26px; border-radius: 50%; background: rgba(255,255,255,.92); }
.donut .c { position: absolute; inset: 0; z-index: 1; display: grid; place-content: center; text-align: center; }
.donut .c b { font-size: 28px; font-weight: 800; color: var(--lime-700); line-height: 1; }
.donut .c small { color: var(--muted); font-size: 11.5px; }
.legend { display: grid; gap: 8px; }
.legend div { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; }
.legend b { margin-left: auto; padding-left: 14px; }

.list { display: grid; gap: 8px; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.55); border: 1px solid rgba(255,255,255,.8); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item small { color: var(--muted); font-size: 12px; }
.num-badge { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; flex: none;
  background: linear-gradient(135deg, var(--lime-300), var(--lime-500)); color: #fff; }

/* ---------- Avatar ---------- */
.av { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex: none; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.av-ph { display: inline-grid; place-items: center; font-weight: 700; font-size: 14px;
  background: hsl(var(--h) 60% 88%); color: hsl(var(--h) 45% 30%); }

/* ---------- Pil status ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.pill.hadir { background: var(--hadir-bg); color: var(--hadir); }
.pill.izin { background: var(--izin-bg); color: var(--izin); }
.pill.sakit { background: var(--sakit-bg); color: #a26c00; }
.pill.alpa { background: var(--alpa-bg); color: var(--alpa); }
.pill.muted { background: rgba(0,0,0,.05); color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* ---------- Tabel ---------- */
.table-wrap { overflow-x: auto; border-radius: 14px; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700;
  padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: rgba(248,252,236,.6); }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: rgba(174,213,67,.08); }
.tbl .who { display: flex; align-items: center; gap: 12px; }
.tbl .who b { display: block; font-weight: 700; }
.tbl .who small { color: var(--muted); font-size: 12px; }
.tbl .actions { display: flex; gap: 2px; justify-content: flex-end; }
.tbl .num { text-align: center; }

.empty { text-align: center; padding: 38px 16px; color: var(--muted); }
.empty .ic { width: 42px; height: 42px; color: var(--lime-400); margin: 0 auto 10px; }
.empty b { display: block; color: var(--ink-2); font-size: 15px; margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar .search { flex: 1; min-width: 200px; }
.toolbar .select { width: auto; min-width: 160px; }

/* ---------- Presensi ---------- */
.kelas-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.7); font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
.chip:hover { border-color: var(--lime-400); }
.chip.active { background: var(--lime-700); border-color: var(--lime-700); color: #fff; }

.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 12px; }
.pnum {
  position: relative; aspect-ratio: 1 / 1; border-radius: 18px; border: 1.5px dashed var(--lime-300);
  background: rgba(255,255,255,.65); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  transition: transform .15s ease, box-shadow .2s, border-color .2s; padding: 6px;
}
.pnum:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(116,160,28,.2); border-color: var(--lime-500); }
.pnum .n { font-size: 28px; font-weight: 800; line-height: 1; color: var(--lime-700); letter-spacing: -.02em; }
.pnum .d { font-size: 11px; font-weight: 600; color: var(--muted); text-align: center; line-height: 1.2; }
.pnum .flag { position: absolute; top: 7px; right: 7px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; }
.pnum .flag .ic { width: 12px; height: 12px; }
.pnum.scheduled { border-style: solid; border-color: var(--lime-300); background: linear-gradient(160deg, #fff, var(--lime-100)); }
.pnum.partial { border-style: solid; border-color: #f0c84a; background: linear-gradient(160deg, #fff, #fff6d4); }
.pnum.partial .flag { background: #f0c84a; color: #fff; }
.pnum.done { border: 1.5px solid transparent; background: linear-gradient(145deg, var(--lime-400), var(--lime-600)); box-shadow: 0 8px 18px rgba(116,160,28,.3); }
.pnum.done .n, .pnum.done .d { color: #fff; }
.pnum.done .flag { background: rgba(255,255,255,.95); color: var(--lime-600); }
.pnum.active { outline: 3px solid var(--sun); outline-offset: 3px; }
.plegend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.plegend span { display: inline-flex; align-items: center; gap: 6px; }
.plegend i { width: 14px; height: 14px; border-radius: 5px; border: 1.5px dashed var(--lime-300); background: #fff; }
.plegend i.s { border-style: solid; background: var(--lime-100); }
.plegend i.p { border: 1.5px solid #f0c84a; background: #fff6d4; }
.plegend i.d { border: 0; background: linear-gradient(145deg, var(--lime-400), var(--lime-600)); }

.att-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.att-head .big { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; font-size: 26px; font-weight: 800;
  background: linear-gradient(145deg, var(--lime-400), var(--lime-600)); color: #fff; flex: none; box-shadow: 0 8px 18px rgba(116,160,28,.3); }
.att-head .grow { flex: 1; min-width: 200px; }
.att-head h3 { font-size: 18px; font-weight: 800; }
.att-head p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.att-sum { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.att-sum .grow { flex: 1; }
.att-list { display: grid; gap: 8px; }
.att-row { display: grid; grid-template-columns: 32px auto 1fr auto minmax(140px, 220px); gap: 12px; align-items: center;
  padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.62); border: 1px solid rgba(255,255,255,.85); transition: background .15s; }
.att-row.unset { background: rgba(255, 250, 230, .7); }
.att-row .no { color: var(--muted); font-weight: 700; font-size: 13px; text-align: center; }
.att-row .nm b { display: block; font-weight: 700; }
.att-row .nm small { color: var(--muted); font-size: 12px; }
.att-row .input { padding: 8px 12px; font-size: 13px; }
.seg { display: inline-flex; background: rgba(0,0,0,.04); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 9px; font-weight: 700; font-size: 13px; color: var(--muted); min-width: 44px; transition: background .15s, color .15s; }
.seg button:hover { background: rgba(255,255,255,.9); }
.seg button.on.hadir { background: var(--hadir); color: #fff; }
.seg button.on.izin { background: var(--izin); color: #fff; }
.seg button.on.sakit { background: var(--sakit); color: #fff; }
.seg button.on.alpa { background: var(--alpa); color: #fff; }
.seg .full { display: inline; }
.seg .short { display: none; }
.savebar { position: sticky; bottom: 14px; margin-top: 16px; padding: 12px 14px; display: flex; gap: 10px; align-items: center; border-radius: 16px; z-index: 5; }
.savebar .grow { flex: 1; font-size: 13px; color: var(--muted); }
.savebar .grow b { color: var(--ink); }
.savebar.dirty { box-shadow: 0 0 0 2px var(--sun), var(--shadow-lg); }

/* ---------- Kalender popup ---------- */
.cal { user-select: none; }
.cal-h { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.cal-h .select { padding: 9px 32px 9px 12px; }
.cal-h .m { flex: 1.4; } .cal-h .y { flex: 1; }
.cal-w, .cal-d { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-w span { text-align: center; font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cal-w span:last-child { color: var(--alpa); }
.cal-d button { aspect-ratio: 1 / 1; border: 0; border-radius: 12px; background: transparent; font-weight: 600; font-size: 14px; position: relative; transition: background .12s; }
.cal-d button:hover { background: var(--lime-100); }
.cal-d button.out { color: #c3cbb8; }
.cal-d button.sun { color: var(--alpa); }
.cal-d button.today { box-shadow: inset 0 0 0 1.5px var(--lime-500); }
.cal-d button.used::after { content: ""; position: absolute; bottom: 5px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--sakit); }
.cal-d button.sel { background: linear-gradient(145deg, var(--lime-400), var(--lime-600)); color: #fff; box-shadow: 0 6px 14px rgba(116,160,28,.35); }
.cal-sel { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: var(--lime-100); display: flex; align-items: center; gap: 10px; color: var(--lime-800); font-size: 14px; }
.cal-sel b { font-weight: 800; }
.cal-quick { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }

/* ---------- Rekap ---------- */
.rekap td.st { text-align: center; padding: 8px 4px; }
.rekap th.pc { text-align: center; padding: 8px 4px; min-width: 46px; }
.rekap th.pc small { display: block; font-weight: 600; text-transform: none; letter-spacing: 0; font-size: 10.5px; }
.rekap .sticky { position: sticky; left: 0; background: rgba(252,254,246,.97); z-index: 1; }
.rekap td.sticky { min-width: 180px; }
.cell { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; font-weight: 800; font-size: 12px; }
.cell.hadir { background: var(--hadir-bg); color: var(--hadir); }
.cell.izin { background: var(--izin-bg); color: var(--izin); }
.cell.sakit { background: var(--sakit-bg); color: #a26c00; }
.cell.alpa { background: var(--alpa-bg); color: var(--alpa); }
.cell.none { color: #c3cbb8; }
.pct { display: flex; align-items: center; gap: 8px; min-width: 130px; }
.pct .track { flex: 1; height: 8px; border-radius: 99px; background: rgba(0,0,0,.06); overflow: hidden; }
.pct .track i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--lime-300), var(--lime-600)); }
.pct .track i.low { background: linear-gradient(90deg, #f5a46a, var(--alpa)); }
.pct .track i.mid { background: linear-gradient(90deg, #fbe08a, var(--sakit)); }
.pct b { font-size: 13px; min-width: 40px; text-align: right; }

/* ---------- Modal ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
  background: rgba(30, 45, 10, .28); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  opacity: 0; transition: opacity .2s; }
.modal-wrap.show { opacity: 1; }
.modal { width: 100%; max-width: 440px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; border-radius: 24px;
  transform: translateY(14px) scale(.98); transition: transform .22s ease; }
.modal.wide { max-width: 640px; }
.modal-wrap.show .modal { transform: none; }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 18px 20px 6px; }
.modal-h h3 { flex: 1; font-size: 18px; font-weight: 800; }
.modal-b { padding: 12px 20px; overflow-y: auto; }
.modal-f { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 20px 18px; flex-wrap: wrap; }
.modal-f .left { margin-right: auto; }
.confirm-msg { color: var(--ink-2); margin: 0; }

.photo-pick { display: flex; align-items: center; gap: 16px; }
.photo-pick .ph { width: 92px; height: 92px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; flex: none;
  background: var(--lime-100); border: 3px solid #fff; box-shadow: 0 6px 16px rgba(0,0,0,.1); color: var(--lime-600); cursor: pointer; }
.photo-pick .ph img { width: 100%; height: 100%; object-fit: cover; }
.photo-pick .ph .ic { width: 30px; height: 30px; }
.photo-pick .btns { display: flex; gap: 8px; flex-wrap: wrap; }

.detail-top { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.detail-top .av { width: 84px; height: 84px; font-size: 26px; }
.detail-top h4 { font-size: 19px; font-weight: 800; }
.dl { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; font-size: 14px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 600; }
.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0; }
.mini-stats div { text-align: center; padding: 10px 6px; border-radius: 12px; }
.mini-stats b { display: block; font-size: 20px; font-weight: 800; }
.mini-stats span { font-size: 11.5px; font-weight: 600; }

/* ---------- Toast ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: grid; gap: 8px; }
.toast { padding: 12px 16px; border-radius: 14px; font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.92); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border); box-shadow: var(--shadow-lg); animation: tin .25s ease; max-width: 360px; }
.toast.ok { color: var(--lime-700); }
.toast.err { color: var(--alpa); }
@keyframes tin { from { opacity: 0; transform: translateY(10px); } }

.footer-note { text-align: center; margin-top: 30px; color: var(--muted); font-size: 12px; }
.muted { color: var(--muted); }
.mt { margin-top: 14px; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv:last-child { border-bottom: 0; }

/* ---------- Responsif ---------- */
@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .att-row { grid-template-columns: 28px auto 1fr auto; }
  .att-row .ket { grid-column: 3 / -1; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 286px; max-width: 86vw; transform: translateX(-105%); transition: transform .25s ease; }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(30,45,10,.3); }
  .menu-btn { display: inline-grid; }
  .main { padding: 12px 16px 120px; }
  .topbar { top: 8px; padding: 10px 12px; margin-bottom: 16px; }
  .topbar .today { display: none; }
  .grid-2b { grid-template-columns: 1fr; }
  .hero img.lantern { width: 110px; opacity: .35; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .card { padding: 16px; }
  .stats { gap: 10px; }
  .stat { padding: 14px; gap: 10px; flex-direction: column; align-items: flex-start; }
  .stat b { font-size: 22px; }
  .stat .ico { width: 40px; height: 40px; }
  .hero { padding: 20px; }
  .hero h1 { font-size: 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .pgrid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .pnum { border-radius: 14px; }
  .pnum .n { font-size: 22px; }
  .pnum .d { font-size: 9.5px; }
  .att-row { grid-template-columns: auto 1fr; gap: 8px 10px; }
  .att-row .no { display: none; }
  .att-row .seg { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); }
  .att-row .ket { grid-column: 1 / -1; }
  .seg .full { display: none; }
  .seg .short { display: inline; }
  .seg button { padding: 9px 6px; }
  /* Tabel murid → kartu */
  .tbl-cards thead { display: none; }
  .tbl-cards, .tbl-cards tbody, .tbl-cards tr, .tbl-cards td { display: block; width: 100%; }
  .tbl-cards tr { padding: 12px; margin-bottom: 10px; border-radius: 16px; background: rgba(255,255,255,.65); border: 1px solid var(--glass-border); position: relative; }
  .tbl-cards td { border: 0; padding: 3px 0; }
  .tbl-cards td[data-l]::before { content: attr(data-l) ": "; color: var(--muted); font-size: 12.5px; }
  .tbl-cards td.hide-m { display: none; }
  .tbl-cards .actions { position: absolute; top: 10px; right: 8px; }
  .tbl-cards .who { padding-right: 110px; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 8px; }
  .modal-wrap { place-items: end center; padding: 0; }
  .modal { max-width: 100% !important; border-radius: 24px 24px 0 0; max-height: 92vh; }
  .toasts { left: 16px; right: 16px; }
  .savebar { bottom: 8px; }
}

/* ---------- Cetak ---------- */
@media print {
  .bg-deco, .sidebar, .topbar, .no-print, .toasts { display: none !important; }
  body { background: #fff; }
  .app { display: block; }
  .main { padding: 0; }
  .glass { box-shadow: none; border: 0; background: #fff; backdrop-filter: none; }
  .print-head { display: block !important; }
  .rekap .sticky { position: static; }
}
.print-head { display: none; margin-bottom: 12px; }
.print-head h2 { font-size: 18px; }

/* ---------- Splash screen ---------- */
.splash {
  position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 24px 16px 120px;
  background: radial-gradient(circle at 50% 40%, rgba(255,255,255,.9), rgba(255,255,255,.35) 60%, rgba(255,255,255,0) 100%);
  transition: opacity .7s ease, transform .7s ease, visibility .7s;
}
.splash.hide { opacity: 0; transform: scale(1.05); visibility: hidden; pointer-events: none; }
.splash-in { display: grid; justify-items: center; text-align: center; }
.splash-logo { position: relative; width: 170px; height: 170px; display: grid; place-items: center;
  animation: popIn .9s cubic-bezier(.34, 1.56, .64, 1) both; }
.splash-logo .disc { position: relative; width: 140px; height: 140px; border-radius: 50%; background: #fff;
  box-shadow: 0 16px 40px rgba(85,122,23,.28); display: grid; place-items: center; overflow: hidden;
  animation: float 3.2s ease-in-out .9s infinite; }
.splash-logo .disc img { width: 100%; height: 100%; }
.splash-logo .flame { position: absolute; left: 50%; top: 70.5%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,214,90,.95), rgba(255,140,0,.45) 45%, rgba(255,120,0,0) 70%);
  mix-blend-mode: screen; animation: flicker 1.1s ease-in-out infinite alternate; }
.splash-logo .ring { position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(174,213,67,0) 0 55%, var(--lime-400) 80%, var(--sun) 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
  animation: spin 1.3s linear infinite; }
.splash-logo .halo { position: absolute; inset: -30px; border-radius: 50%;
  background: radial-gradient(circle, rgba(243,216,73,.45), rgba(174,213,67,.18) 50%, transparent 70%);
  animation: halo 2.4s ease-in-out infinite; }
.splash-title { margin-top: 26px; font-size: clamp(30px, 7vw, 44px); font-weight: 800; letter-spacing: -.02em; color: var(--lime-800); }
.splash-title span { display: inline-block; animation: rise .7s cubic-bezier(.2,.8,.2,1) both; }
.splash-title span:first-child { animation-delay: .45s; }
.splash-title span:last-child { animation-delay: .6s;
  background: linear-gradient(135deg, var(--lime-500), var(--lime-700)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.splash-tag { margin: 6px 0 0; color: var(--muted); font-weight: 600; font-size: 14.5px; animation: rise .7s ease .8s both; }
.splash-bar { width: 200px; height: 6px; margin-top: 24px; border-radius: 99px; background: rgba(88,124,24,.14); overflow: hidden; animation: rise .5s ease .9s both; }
.splash-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--lime-400), var(--sun));
  animation: load 1.8s cubic-bezier(.3,.7,.4,1) 1s forwards; }
.splash-bar.done i { width: 100% !important; animation: none; transition: width .3s ease; }
.splash-foot { position: absolute; bottom: 22px; left: 16px; right: 16px; display: flex; justify-content: center; align-items: center; gap: 10px;
  color: #fff; font-size: 12.5px; line-height: 1.35; text-shadow: 0 1px 3px rgba(0,0,0,.5); animation: rise .7s ease 1s both; }
.splash-foot img { width: 40px; height: 40px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.25)); }
@keyframes popIn { from { opacity: 0; transform: scale(.3) rotate(-12deg); } to { opacity: 1; transform: none; } }
@keyframes float { 50% { transform: translateY(-6px); } }
@keyframes flicker { from { opacity: .55; transform: scale(.85); } to { opacity: 1; transform: scale(1.12); } }
@keyframes halo { 50% { transform: scale(1.12); opacity: .7; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes load { from { width: 0; } to { width: 88%; } }
@media (prefers-reduced-motion: reduce) {
  .splash *, .splash { animation-duration: .01s !important; animation-iteration-count: 1 !important; }
}

/* ---------- Kamera ---------- */
.cam { position: relative; width: 100%; max-width: 380px; margin: 0 auto; aspect-ratio: 1 / 1; border-radius: 20px; overflow: hidden; background: #1d2414; }
.cam video, .cam img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam video.mirror { transform: scaleX(-1); }
.cam-guide { position: absolute; inset: 12%; border-radius: 50%; border: 2px dashed rgba(255,255,255,.75); box-shadow: 0 0 0 999px rgba(0,0,0,.18); pointer-events: none; }
.cam-msg { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: #fff; font-size: 14px; font-weight: 600; line-height: 1.5; }
