:root {
  --ink: #1f1f2e; --ink-2: #2b2b3d; --lime: #d4f36b; --lime-2: #c2e650; --bg: #f2f1ec; --card: #fff; --line: #ecebe6; --muted: #8b8b98;
  --peach: #fde4d5; --lav: #e7e5fb; --mint: #e5f5d3; --sky: #dcedf9; --rose: #fbe0e2; --sand: #fbf0d3;
  --ok: #3f8f2f; --bad: #d23c3c; --r: 18px;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.45; }
a { color: inherit; }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Kerangka: sidebar + isi ---------- */
.app { display: grid; grid-template-columns: 236px 1fr; gap: 22px; padding: 18px; min-height: 100vh; }
.side { background: var(--ink); color: #c9c9d6; border-radius: 26px; padding: 22px 14px; position: sticky; top: 18px; height: calc(100vh - 36px); display: flex; flex-direction: column; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 20px; text-decoration: none; padding: 0 8px 18px; }
.logo { width: 34px; height: 34px; border-radius: 50%; background: #fff; display: grid; place-items: center; }
.logo::after { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 4px solid var(--ink); box-shadow: 7px -7px 0 -3px var(--lime); }
.side nav { display: grid; gap: 2px; }
.side .grp { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #6e6e82; padding: 14px 12px 6px; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; text-decoration: none; font-weight: 500; }
.side nav a:hover { background: var(--ink-2); color: #fff; }
.side nav a.on { background: var(--lime); color: var(--ink); font-weight: 700; }
.side .promo { margin-top: auto; background: var(--lime); color: var(--ink); border-radius: 20px; padding: 16px; position: relative; text-decoration: none; display: block; }
.side .promo .go { position: absolute; top: -16px; left: 16px; width: 38px; height: 38px; border-radius: 50%; background: #fff; display: grid; place-items: center; border: 3px solid var(--ink); }
.side .promo b { display: block; margin-top: 14px; }
.side .promo small { opacity: .75; }

.isi { min-width: 0; }
.top { display: flex; align-items: center; gap: 14px; margin: 6px 0 18px; }
.top h1 { font-size: 26px; font-weight: 800; margin: 0; letter-spacing: -.02em; }
.top .sub { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.top .kanan { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.cari { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 999px; padding: 0 14px; height: 42px; color: var(--muted); }
.cari input { border: 0; background: none; min-height: 0; padding: 0; outline: none; width: 190px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg, #f7a6c4, #a99bf6); color: #fff; display: grid; place-items: center; font-weight: 700; text-decoration: none; flex: none; }
.avatar.kecil { width: 22px; height: 22px; font-size: 10px; }
.burger { display: none; width: 42px; height: 42px; border-radius: 12px; background: #fff; place-items: center; cursor: pointer; }
.scrim { display: none; }
main { padding-bottom: 60px; }

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); padding: 12px 14px; }
  .side { position: fixed; z-index: 30; left: 10px; top: 10px; height: calc(100vh - 20px); width: 250px; transform: translateX(-110%); transition: transform .2s; }
  #nav:checked ~ .app .side { transform: none; }
  #nav:checked ~ .app .scrim { display: block; position: fixed; inset: 0; background: #0006; z-index: 20; }
  .burger { display: grid; }
  .top { gap: 10px; align-items: flex-start; }
  .top > div:first-of-type { flex: 1; min-width: 0; }
  .top h1 { font-size: 20px; }
  .top .avatar { width: 38px; height: 38px; }
  .cari { display: none; }
  main { padding-bottom: 100px; }
  .checkin, .desktop-saja { display: none !important; }
}

/* Tombol mengambang absen pegawai (HP) */
.fab { display: none; position: fixed; right: 16px; bottom: 18px; z-index: 35; }
.fab button { border-radius: 999px; padding: 10px 20px 10px 12px; gap: 10px; box-shadow: 0 10px 28px #1f1f2e40; min-height: 56px; text-align: left; }
.fab button .i { width: 34px; height: 34px; padding: 7px; border-radius: 50%; background: #ffffff8c; }
.fab button.gelap .i { background: var(--lime); color: var(--ink); }
.fab button span { display: grid; line-height: 1.2; font-size: 15px; }
.fab button small { font-weight: 500; font-size: 11px; opacity: .75; }
.fab.selesai { background: #fff; border-radius: 999px; padding: 8px 14px 8px 8px; font-size: 13px; font-weight: 600; box-shadow: 0 6px 20px #1f1f2e26; align-items: center; gap: 8px; }
.fab.selesai .i { width: 26px; height: 26px; padding: 5px; border-radius: 50%; background: var(--lime); }
@media (max-width: 900px) { .fab { display: block; } .fab.selesai { display: flex; } #antrian { bottom: 88px; } }
.status-saya form { display: inline; }
.status-saya form button { min-height: 30px; padding: 4px 14px; margin-left: 6px; }
.checkin form { margin-left: auto; }
.peta { width: 100%; height: 280px; border: 0; border-radius: 14px; background: #eee; }

/* ---------- Komponen umum ---------- */
h2 { font-size: 17px; font-weight: 700; margin: 0 0 12px; }
.card { background: var(--card); border-radius: var(--r); padding: 18px; margin-bottom: 16px; }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-h h2 { margin: 0; }
.card-h .aksi-kanan { margin-left: auto; }
.link-kecil { font-size: 12px; color: var(--muted); text-decoration: underline; }
details.card > summary { cursor: pointer; font-weight: 700; list-style: none; display: inline-flex; align-items: center; gap: 8px; }
details.card > summary::before { content: "+"; width: 24px; height: 24px; border-radius: 50%; background: var(--lime); display: grid; place-items: center; font-weight: 800; }
details.card[open] > summary::before { content: "–"; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-top: 12px; align-items: end; }
label { display: grid; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 500; }
input, select, textarea, button { font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fafaf7; color: var(--ink); min-height: 42px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--lime-2); border-color: transparent; background: #fff; }
textarea { width: 100%; }
button, .btn { background: var(--lime); color: var(--ink); border: 0; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 700; border-radius: 999px; padding: 9px 18px; min-height: 40px; }
button:hover, .btn:hover { background: var(--lime-2); }
button.sec, .btn.sec { background: #fff; border: 1px solid var(--line); font-weight: 600; }
button.sec:hover, .btn.sec:hover { background: #f6f6f1; }
.btn.gelap, button.gelap { background: var(--ink); color: #fff; }
button.link { background: none; border: 0; color: var(--bad); padding: 0; min-height: 0; font-weight: 500; text-decoration: underline; border-radius: 0; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin-bottom: 16px; }
.scroll { overflow-x: auto; background: #fff; border-radius: var(--r); margin-bottom: 16px; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; background: #fafaf6; }
tr:last-child td { border-bottom: 0; }
td.aksi { white-space: nowrap; }
td.aksi form { display: inline; }
td.aksi a { margin-right: 6px; }
td.n, th.n { text-align: center; }
.muted { color: var(--muted); }
.flash { background: var(--mint); padding: 10px 16px; border-radius: 14px; font-weight: 500; }
.warn { background: var(--sand); padding: 10px 16px; border-radius: 14px; }
.bad { color: var(--bad); font-weight: 600; }
code { background: #f1f0ea; padding: 1px 6px; border-radius: 6px; }

/* Kartu statistik & pil status */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { background: #fff; border-radius: var(--r); padding: 16px; }
.stat b { display: block; font-size: 24px; font-weight: 800; }
.chip { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.chip.kotak { border-radius: 12px; }
.c-peach { background: var(--peach); } .c-lav { background: var(--lav); } .c-mint { background: var(--mint); } .c-sky { background: var(--sky); } .c-rose { background: var(--rose); } .c-sand { background: var(--sand); } .c-lime { background: var(--lime); }
.pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }

/* ---------- Dashboard ---------- */
.dash { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.kartu-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kartu { background: #fff; border-radius: var(--r); padding: 16px; text-decoration: none; display: block; }
.kartu .atas { display: flex; gap: 10px; align-items: center; }
.kartu .atas b { display: block; font-size: 14px; }
.kartu .atas small { color: var(--muted); }
.kartu .bawah { display: flex; gap: 22px; margin-top: 16px; }
.kartu .bawah small { display: block; color: var(--muted); font-size: 11px; }
.kartu .bawah strong { font-size: 20px; font-weight: 800; }
.dua { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; }
.grafik { display: grid; grid-template-columns: 34px 1fr; height: 190px; margin-top: 8px; }
.grafik .sb-y { display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; color: var(--muted); padding-bottom: 22px; }
.grafik .area { position: relative; display: flex; align-items: flex-end; justify-content: space-around; padding-bottom: 22px; background: repeating-linear-gradient(to top, transparent 0 calc(25% - 6px), var(--line) calc(25% - 6px) calc(25% - 5px)); }
.grafik .kol { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; width: 14%; }
.grafik .bar { width: 9px; background: var(--ink); border-radius: 6px; min-height: 4px; }
.grafik .bar.on { background: var(--lime); width: 11px; }
.grafik .lbl { position: absolute; bottom: -20px; font-size: 11px; color: var(--muted); }
.grafik .tip { position: absolute; transform: translateY(-100%); margin-top: -6px; background: var(--ink); color: #fff; font-size: 11px; padding: 5px 8px; border-radius: 8px; white-space: nowrap; z-index: 2; }
.naik { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.naik .chip { width: 28px; height: 28px; background: #f3f2ee; }
.naik b { color: var(--ok); }
.daftar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.daftar .it { display: flex; align-items: center; gap: 12px; padding: 4px 0; text-decoration: none; }
.daftar .it .tx { flex: 1; min-width: 0; }
.daftar .it .tx b { display: block; font-size: 13.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.daftar .it .tx small { color: var(--muted); display: flex; align-items: center; gap: 6px; }
.daftar .it .panah { width: 26px; height: 26px; border-radius: 50%; background: #f3f2ee; display: grid; place-items: center; }
.daftar .it .panah svg { width: 14px; height: 14px; }
.baris { background: #fff; border-radius: var(--r); padding: 14px 16px; display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 12px; align-items: center; margin-bottom: 10px; }
.baris .kiri { display: flex; gap: 12px; align-items: center; min-width: 0; }
.baris b { display: block; }
.baris small { color: var(--muted); }
.ring { --p: 0; --w: var(--ok); width: 30px; height: 30px; border-radius: 50%; background: conic-gradient(var(--w) calc(var(--p) * 1%), #ececec 0); display: grid; place-items: center; flex: none; }
.ring::after { content: ""; width: 22px; height: 22px; border-radius: 50%; background: #fff; }
.persen { display: flex; align-items: center; gap: 8px; font-weight: 700; justify-content: flex-end; }
.premium { background: var(--ink); color: #fff; border-radius: var(--r); padding: 20px; position: relative; overflow: hidden; margin-bottom: 16px; min-height: 170px; }
.premium .mini { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; }
.premium .mini .logo { width: 22px; height: 22px; }
.premium .mini .logo::after { width: 8px; height: 8px; border-width: 3px; box-shadow: 5px -5px 0 -2px var(--lime); }
.premium h3 { font-size: 22px; margin: 14px 0 4px; font-weight: 800; color: var(--lime); max-width: 60%; line-height: 1.15; }
.premium p { margin: 0 0 14px; font-size: 12px; color: #b9b9c8; max-width: 58%; }
.premium svg.ilus { position: absolute; right: 8px; bottom: 0; width: 120px; height: 140px; }
.kal-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-weight: 700; }
.kal-h a { width: 28px; height: 28px; border-radius: 50%; background: #f3f2ee; display: grid; place-items: center; }
.kal-h a svg { width: 14px; height: 14px; }
.kal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; font-size: 12px; }
.kal .hd { background: #f3f2ee; border-radius: 6px; padding: 5px 0; font-weight: 700; font-size: 11px; }
.kal span { padding: 6px 0; border-radius: 50%; aspect-ratio: 1; display: grid; place-items: center; position: relative; }
.kal .lain { color: #c8c8cf; }
.kal .libur { color: var(--bad); }
.kal .now { background: var(--lime); font-weight: 800; }
.kal .dot::after { content: ""; position: absolute; bottom: 2px; width: 4px; height: 4px; border-radius: 50%; background: #8b7cf6; }
.checkin { display: flex; align-items: center; gap: 14px; background: var(--ink); color: #fff; border-radius: var(--r); padding: 14px 16px; margin-bottom: 16px; }
.checkin form { margin-left: auto; }
.status-saya { display: inline-flex; align-items: center; gap: 8px; background: #fff; border-radius: 999px; padding: 6px 14px 6px 6px; font-size: 13px; margin-bottom: 16px; }
@media (max-width: 1150px) { .dash { grid-template-columns: minmax(0, 1fr); } .kal span { aspect-ratio: auto; } }
@media (max-width: 700px) {
  .dua { grid-template-columns: minmax(0, 1fr); }
  .kartu-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kartu { padding: 14px; }
  .kartu .bawah { gap: 14px; }
  .kartu .atas small { display: none; }
  .baris { grid-template-columns: 1fr auto; }
  .baris .tengah { display: none; }
  .premium h3, .premium p { max-width: 65%; }
}

/* ---------- Presensi: pilihan H/S/I/A besar untuk jari ---------- */
.absen { display: grid; gap: 8px; }
.absen .s { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 14px; padding: 8px 10px; }
.absen .s .nm { flex: 1; font-weight: 600; }
.absen .opt { display: flex; gap: 5px; }
.absen .opt label { display: block; }
.absen .opt input { display: none; }
.absen .opt span { display: inline-block; width: 38px; text-align: center; padding: 8px 0; border-radius: 10px; cursor: pointer; font-weight: 700; background: #f3f2ee; color: var(--muted); }
.absen .opt input:checked + span { background: var(--lime); color: var(--ink); }
.absen .opt input[value=S]:checked + span { background: #f6b48c; }
.absen .opt input[value=I]:checked + span { background: #a99bf6; color: #fff; }
.absen .opt input[value=A]:checked + span { background: var(--bad); color: #fff; }
#antrian { position: fixed; bottom: 14px; left: 14px; right: 14px; text-align: center; background: var(--ink); color: #fff; padding: 12px; border-radius: 14px; display: none; z-index: 40; }

.denah { display: grid; gap: 6px; }
.denah select, .denah div { width: 100%; min-height: 40px; font-size: 12px; }
.denah div { border: 1px solid #999; padding: 6px; text-align: center; background: #fff; }
.only-print { display: none !important; }

/* Laporan */
.lap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.lap-grid .card { margin: 0; display: flex; flex-direction: column; }
.lap-grid .card .grid { margin-top: auto; padding-top: 12px; }

/* Login */
.solo { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { display: grid; grid-template-columns: 1fr 1fr; background: #fff; border-radius: 28px; overflow: hidden; width: min(860px, 100%); }
.login .gelap { background: var(--ink); color: #fff; padding: 36px; display: flex; flex-direction: column; gap: 14px; }
.login .gelap h2 { color: var(--lime); font-size: 28px; line-height: 1.15; margin: 20px 0 0; }
.login .gelap p { color: #b9b9c8; margin: 0; }
.login .gelap svg.ilus { margin-top: auto; align-self: flex-end; width: 160px; height: 150px; }
.login form { padding: 36px; display: grid; gap: 14px; align-content: center; }
@media (max-width: 700px) { .login { grid-template-columns: 1fr; } .login .gelap svg.ilus { display: none; } }

/* ---------- Cetak / laporan A4 ---------- */
.kertas { background: #fff; padding: 24px; border-radius: var(--r); }
.kertas table { font-size: 12px; }
.kertas th, .kertas td { border: 1px solid #555; padding: 3px 5px; background: none; color: #000; font-size: 12px; }
.kertas table.polos { width: auto; }
.kertas table.polos td { border: 0; padding: 2px 4px; font-size: inherit; }
.kop { display: flex; align-items: center; gap: 12px; justify-content: center; text-align: center; border-bottom: 3px double #000; padding-bottom: 6px; margin-bottom: 12px; line-height: 1.35; }
.kop img { height: 70px; }
.ttd { display: flex; justify-content: space-between; margin-top: 24px; page-break-inside: avoid; }
.ttd > div { min-width: 220px; }
.judul { text-align: center; font-weight: 700; margin: 6px 0 12px; }
@page { size: A4; margin: 12mm; }
@page land { size: A4 landscape; margin: 10mm; }
.land { page: land; }
@media print {
  body { background: #fff; font-size: 12px; font-family: Arial, sans-serif; }
  .noprint, .side, .top { display: none !important; }
  .only-print { display: grid !important; }
  .app { display: block; padding: 0; }
  main { padding: 0; }
  .kertas, .scroll, .card { border-radius: 0; padding: 0; background: #fff; }
  .pb { page-break-after: always; }
}
