:root {
  --bg: #f3f5f9;
  --card: #ffffff;
  --text: #1c2333;
  --muted: #6b7489;
  --border: #e2e6ee;
  /* Warna brand Toping Art: hitam + magenta/cyan/kuning */
  --primary: #e6007e;
  --primary-dark: #b60064;
  --cyan: #00aeef;
  --green: #17a35a;
  --green-bg: #e3f6ec;
  --orange: #d97a0b;
  --orange-bg: #fdf0dd;
  --red: #d23b3b;
  --red-bg: #fbe5e5;
  --blue-bg: #e0f4fd;
  --purple: #7a4bd1;
  --purple-bg: #efe8fb;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(20, 30, 60, 0.07);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
}
h1, h2, h3 { margin: 0 0 12px; }
a { color: var(--primary); }
.muted { color: var(--muted); }
.hidden { display: none !important; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

label { display: block; font-weight: 600; font-size: 13px; margin: 12px 0 6px; color: var(--muted); }
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  background: #fff;
  color: var(--text);
}
input[readonly] { background: #f3f5f9; color: var(--text); font-weight: 600; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: transparent; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border: none; border-radius: 8px;
  font: inherit; font-weight: 600; cursor: pointer;
  background: var(--primary); color: #fff;
  text-decoration: none;
}
.btn:hover { background: var(--primary-dark); }
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn.secondary { background: #eef1f6; color: var(--text); }
.btn.secondary:hover { background: #e2e6ee; }
.btn.danger { background: var(--red); }
.btn.green { background: var(--green); }
.btn.orange { background: var(--orange); }
.btn.small { padding: 6px 10px; font-size: 13px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #f8f9fc; }
tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }
td.num, th.num { text-align: center; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; text-transform: capitalize; }
.badge.hadir { background: var(--green-bg); color: var(--green); }
.badge.terlambat { background: var(--orange-bg); color: var(--orange); }
.badge.izin, .badge.cuti { background: var(--blue-bg); color: #0079a8; }
.badge.sakit { background: var(--purple-bg); color: var(--purple); }
.badge.belum, .badge.alpha { background: var(--red-bg); color: var(--red); }
.badge.libur { background: #eef1f6; color: var(--muted); }
.badge.nonaktif { background: #eef1f6; color: var(--muted); }

.alert { padding: 14px 16px; border-radius: 10px; margin-top: 16px; font-weight: 500; }
.alert.sukses { background: var(--green-bg); color: #0f6b3b; }
.alert.peringatan { background: var(--orange-bg); color: #8a4c04; }
.alert.gagal { background: var(--red-bg); color: #8f2020; }

/* ---------- Halaman absen (kiosk) ---------- */
.hal-absen {
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 0% -10%, rgba(0, 174, 239, .14), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, rgba(230, 0, 126, .12), transparent 60%),
    #f4f6fb;
}
.kiosk { max-width: 1080px; margin: 0 auto; padding: 20px 16px 40px; }
.kiosk header {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-bottom: 20px; padding: 10px 12px 10px 10px;
  background: rgba(255, 255, 255, .75); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, .9); border-radius: 18px; box-shadow: 0 4px 24px rgba(20, 30, 60, .06);
  position: sticky; top: 10px; z-index: 10;
}
.kiosk header h1 { font-size: 18px; margin: 0; font-weight: 800; letter-spacing: -.01em; }
.kiosk header .muted { font-size: 13px; }
.hal-absen .brand .logo { width: 48px; height: 48px; border-radius: 12px; }
.hal-absen .btn-admin { border-radius: 999px; padding: 8px 16px; background: #111; color: #fff; }
.hal-absen .btn-admin:hover { background: #2a2a2a; }
.aksi-header { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.hal-absen .btn-pasang { border-radius: 999px; padding: 8px 14px; background: linear-gradient(135deg, var(--primary), #ff4fa8); box-shadow: 0 6px 16px rgba(230, 0, 126, .3); }
.panduan-ios { margin: -8px 0 20px; color: var(--text) !important; }
.panduan-ios ol { margin: 8px 0 10px; padding-left: 20px; }
.kiosk-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 20px; align-items: start; }
.hal-absen .card { border: 1px solid rgba(226, 230, 238, .8); border-radius: 22px; box-shadow: 0 10px 40px rgba(20, 30, 60, .07); padding: 22px; }

/* Panel jam */
.hero-jam {
  position: relative; overflow: hidden; color: #fff; border-radius: 18px; padding: 22px 22px 20px;
  background: linear-gradient(135deg, #14161f 0%, #1d2030 100%);
}
.hero-jam::before, .hero-jam::after { content: ""; position: absolute; border-radius: 50%; filter: blur(40px); opacity: .55; pointer-events: none; }
.hero-jam::before { width: 220px; height: 220px; right: -60px; top: -80px; background: var(--primary); }
.hero-jam::after { width: 200px; height: 200px; left: -70px; bottom: -110px; background: var(--cyan); }
.hero-jam > * { position: relative; }
.hero-jam .strip { position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--cyan), var(--primary), #fff212); }
.tanggal-besar { color: rgba(255, 255, 255, .7); font-size: 14px; font-weight: 500; }
.jam-besar { font-size: 64px; line-height: 1.05; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin: 4px 0 6px; }
.hero-jam .jadwal { color: rgba(255, 255, 255, .75); }
.jadwal { font-size: 13px; color: var(--muted); }
.syarat-chip:not(:empty) { display: inline-flex; gap: 6px; margin-top: 10px; padding: 5px 12px; border-radius: 999px; background: rgba(255, 255, 255, .12); color: #fff; font-size: 12px; font-weight: 600; }

/* Form absen */
.hal-absen label { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; margin: 16px 0 6px; }
.hal-absen input, .hal-absen select, .hal-absen textarea {
  padding: 13px 14px; border-radius: 12px; border: 1.5px solid var(--border); background: #fbfcfe; font-size: 16px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.hal-absen input:focus, .hal-absen select:focus, .hal-absen textarea:focus {
  outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(230, 0, 126, .12);
}
.hal-absen input[readonly] { background: #f1f3f8; }
.hal-absen #pin { letter-spacing: .4em; font-weight: 700; }
.hal-absen #pin::placeholder { letter-spacing: normal; font-weight: 400; }
.hal-absen .btn { border-radius: 12px; transition: transform .12s, box-shadow .15s, background .15s; }
.hal-absen .btn:active:not(:disabled) { transform: scale(.98); }
.tombol-absen { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.tombol-absen .btn { padding: 16px; font-size: 16px; }
.btn-absen { flex-direction: column; gap: 4px !important; padding: 18px 12px !important; border-radius: 16px !important; font-size: 17px !important; }
.btn-absen .ikon { font-size: 22px; line-height: 1; }
.btn-absen.green { background: linear-gradient(135deg, #1fbf6c, #128a4b); box-shadow: 0 8px 20px rgba(23, 163, 90, .3); }
.btn-absen.orange { background: linear-gradient(135deg, #f39a2b, #d0660a); box-shadow: 0 8px 20px rgba(217, 122, 11, .3); }
.btn-absen:hover:not(:disabled) { transform: translateY(-2px); }
.btn-izin { width: 100%; margin-top: 12px; padding: 14px; font-size: 15px; background: transparent !important; color: var(--text) !important; border: 1.5px dashed #cdd3de !important; }
.btn-izin:hover { border-color: var(--primary) !important; color: var(--primary) !important; }
.panel-izin { margin-top: 16px; padding: 18px; border: 1px solid var(--border); border-radius: 16px; background: #fafbfd; }
.panel-izin label:first-of-type { margin-top: 12px; }

/* Kamera */
.kamera { position: relative; margin-top: 14px; border-radius: 10px; overflow: hidden; background: #111; }
.hal-absen .kamera { border-radius: 18px; box-shadow: 0 0 0 3px #fff, 0 0 0 5px rgba(230, 0, 126, .25); }
.kamera video { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transform: scaleX(-1); }
.kamera-info { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 20px; color: #fff; background: rgba(0,0,0,.75); }
.kamera-info a { color: #9cc0ff; }

/* Pesan */
.alert.kabar { margin: 0 0 14px; border-left: 5px solid currentColor; box-shadow: var(--shadow); }
.alert.info { background: var(--blue-bg); color: var(--primary-dark); }
.hal-absen .alert { border-radius: 14px; animation: muncul .25s ease-out; }
@keyframes muncul { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Daftar sudah absen */
.judul-daftar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.judul-daftar h3 { margin: 0; font-size: 17px; }
.jumlah-absen { min-width: 28px; padding: 3px 10px; border-radius: 999px; background: #111; color: #fff; font-size: 13px; font-weight: 700; text-align: center; }
.daftar-hari-ini { max-height: 560px; overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
.orang { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; transition: background .15s; }
.orang + .orang { margin-top: 4px; }
.orang:hover { background: #f5f7fb; }
.avatar { flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px; }
.orang .info { flex: 1; min-width: 0; }
.orang .nama { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.orang .jabatan { font-size: 12px; color: var(--muted); }
.orang .waktu { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 13px; font-variant-numeric: tabular-nums; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.chip.masuk { background: var(--green-bg); color: var(--green); }
.chip.telat { background: var(--orange-bg); color: var(--orange); }
.chip.pulang { background: #eef1f6; color: var(--text); }
.chip.belum { background: transparent; color: var(--muted); font-weight: 500; }
.kosong { text-align: center; padding: 36px 10px; color: var(--muted); }
.kosong .ikon { font-size: 34px; display: block; margin-bottom: 6px; }

/* Bukti foto & lokasi di tabel admin */
.bukti { display: flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; }
.bukti + .bukti { margin-top: 4px; }
.bukti .lbl { width: 42px; color: var(--muted); }
.thumb { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; cursor: zoom-in; border: 1px solid var(--border); }
.foto-besar { display: block; width: 100%; border-radius: 8px; }
.inline-cek { display: flex !important; align-items: center; gap: 8px; color: var(--text) !important; font-weight: 500 !important; }
.inline-cek input { width: auto; }

/* ---------- Halaman admin ---------- */
.login-box { max-width: 380px; margin: 10vh auto; }
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #111; color: #d6d6d6; padding: 20px 12px; flex-shrink: 0; border-top: 4px solid; border-image: linear-gradient(90deg, var(--cyan), var(--primary), #fff212) 1; }
.sidebar h2 { color: #fff; font-size: 17px; padding: 0 8px; margin-bottom: 20px; }
.sidebar .logo-tile { display: block; width: 100px; height: 100px; margin: 0 auto 10px; background: #fff; border-radius: 14px; padding: 4px; }
.sidebar h2 { text-align: center; }

/* Logo */
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo { width: 64px; height: 64px; object-fit: contain; background: #fff; border-radius: 12px; border: 1px solid var(--border); }
.login-box .logo { display: block; width: 140px; margin: 0 auto 8px; }
.pratinjau-wa { white-space: pre-wrap; font-family: inherit; font-size: 13px; background: #e7fbe6; border: 1px solid #c9eec6; border-radius: 10px; padding: 12px 14px; margin: 0; max-height: 360px; overflow-y: auto; }
.nav-badge { display: inline-block; min-width: 20px; padding: 1px 7px; margin-left: 6px; border-radius: 999px; background: #fff212; color: #111; font-size: 12px; font-weight: 700; text-align: center; }
.banner { background: var(--red-bg); color: #8f2020; padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 500; }
.banner a { color: inherit; font-weight: 700; cursor: pointer; }
.sidebar button {
  display: block; width: 100%; text-align: left; padding: 10px 12px; margin-bottom: 4px;
  background: none; border: none; color: inherit; font: inherit; border-radius: 8px; cursor: pointer;
}
.sidebar button:hover { background: rgba(255,255,255,.07); }
.sidebar button.aktif { background: var(--primary); color: #fff; }
.sidebar .bawah { margin-top: 24px; border-top: 1px solid rgba(255,255,255,.1); padding-top: 12px; }
.konten { flex: 1; padding: 24px; min-width: 0; }
.konten-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.konten-header h1 { margin: 0; font-size: 22px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 16px; }
.toolbar > div { min-width: 150px; }
.toolbar label { margin-top: 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { padding: 16px; }
.stat .angka { font-size: 28px; font-weight: 700; }
.stat .label { color: var(--muted); font-size: 13px; }

.hari-pilih { display: flex; flex-wrap: wrap; gap: 8px; }
.hari-pilih label { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 500; color: var(--text); border: 1px solid var(--border); padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.hari-pilih input { width: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.aksi { display: flex; gap: 6px; flex-wrap: wrap; }

dialog { border: none; border-radius: var(--radius); padding: 0; width: min(480px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(15, 20, 35, .45); }
dialog form { padding: 22px; }
dialog .tombol { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.toast { position: fixed; bottom: 20px; right: 20px; padding: 12px 18px; border-radius: 10px; color: #fff; font-weight: 500; box-shadow: var(--shadow); z-index: 100; }
.toast.sukses { background: var(--green); }
.toast.gagal { background: var(--red); }

@media (max-width: 800px) {
  .kiosk-grid, .form-grid { grid-template-columns: 1fr; }
  .jam-besar { font-size: 48px; }
  .hal-absen .card { padding: 16px; border-radius: 18px; }
  .kiosk header { top: 6px; }
  .kiosk header .muted, .teks-lebar { display: none; }
  .layout { flex-direction: column; }
  .sidebar { width: 100%; display: flex; flex-wrap: wrap; gap: 4px; padding: 12px; }
  .sidebar h2 { width: 100%; margin-bottom: 8px; }
  .sidebar .logo-tile { width: 56px; height: 56px; margin: 0; }
  .sidebar button { width: auto; }
  .sidebar .bawah { margin: 0; border: none; padding: 0; display: flex; gap: 4px; }
  .konten { padding: 16px; }
}
