@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
  --purple: #6B1FA8;
  --purple-700: #5A158F;
  --purple-900: #3F0D66;
  --purple-50: #F7F0FD;
  --purple-100: #F0E4FB;
  --orange: #F58220;
  --orange-2: #FF9F2E;
  --green: #22B573;
  --blue: #2D9CDB;
  --red: #EB5757;
  --ink: #241A2E;
  --muted: #80778C;
  --line: #EFE9F4;
  --bg: #F7F5FA;
  --white: #fff;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(74, 14, 107, .08);
  --shadow-sm: 0 4px 14px rgba(74, 14, 107, .06);
  --grad: linear-gradient(135deg, #7B2BB5 0%, #5A158F 60%, #480C72 100%);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #EDE8F3;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  overscroll-behavior-y: none;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: 14px; }
button { cursor: pointer; border: 0; }
a { color: var(--purple); text-decoration: none; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #D8CCE6; border-radius: 99px; }

#root { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg); position: relative; }
@media (min-width: 900px) {
  body { background: radial-gradient(circle at 20% 10%, #E9DCF7 0, #F3EEF8 45%, #E7E1EF 100%); }
  #root { margin: 24px auto; min-height: calc(100vh - 48px); border-radius: 28px; overflow: hidden;
    box-shadow: 0 30px 80px rgba(63, 13, 102, .22); border: 1px solid #fff; }
}

.screen { padding-bottom: 96px; animation: fade .28s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.pad { padding: 0 18px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.bold { font-weight: 700; }
.hidden { display: none !important; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: flex; flex-direction: column; padding: 0 24px 30px; background: #fff; }
.login-logo { padding: 30px 0 6px; }
.login-logo img { height: 84px; margin: 0 auto; }
.login h1 { font-size: 22px; margin: 10px 0 2px; text-align: center; font-weight: 700; }
.login .sub { text-align: center; color: var(--muted); font-size: 12.5px; margin-bottom: 8px; }
.login-illus { margin: 6px auto 4px; width: 100%; max-width: 330px; }
.field { margin-top: 14px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: #5C5266; margin-bottom: 6px; }
.input-wrap { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); background: #FCFAFE; border-radius: 14px; padding: 0 12px; transition: .18s; }
.input-wrap:focus-within { border-color: var(--purple); background: #fff; box-shadow: 0 0 0 4px rgba(107,31,168,.08); }
.input-wrap .ic { color: var(--muted); display: flex; }
.input-wrap input, .input-wrap select { border: 0; outline: 0; background: transparent; padding: 13px 0; width: 100%; color: var(--ink); }
.input-wrap .eye { background: none; color: var(--muted); padding: 6px; display: flex; }
textarea { width: 100%; border: 1.5px solid var(--line); background: #FCFAFE; border-radius: 14px; padding: 12px; outline: 0; resize: vertical; }
textarea:focus { border-color: var(--purple); background: #fff; }
select.plain { width: 100%; border: 1.5px solid var(--line); background: #FCFAFE; border-radius: 14px; padding: 12px; outline: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 18px; border-radius: 14px; font-weight: 600; font-size: 14px; transition: .18s; width: 100%; }
.btn:active { transform: scale(.985); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 20px rgba(90,21,143,.28); }
.btn-orange { background: linear-gradient(135deg, #FF9F2E, #F58220); color: #fff; box-shadow: 0 8px 20px rgba(245,130,32,.28); }
.btn-green { background: linear-gradient(135deg, #2BD68A, #12A263); color: #fff; box-shadow: 0 8px 20px rgba(18,162,99,.25); }
.btn-outline { background: #fff; border: 1.5px solid var(--purple-100); color: var(--purple); }
.btn-ghost { background: var(--purple-50); color: var(--purple); }
.btn:disabled { opacity: .55; box-shadow: none; cursor: not-allowed; }
.btn-sm { padding: 9px 14px; font-size: 12.5px; border-radius: 11px; width: auto; }
.link { color: var(--purple); font-weight: 600; font-size: 12.5px; background: none; padding: 4px; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.or { display: flex; align-items: center; gap: 10px; color: #A79CB3; font-size: 11.5px; margin: 18px 0; }
.or::before, .or::after { content: ''; height: 1px; background: var(--line); flex: 1; }

/* ---------- Header ---------- */
.hero { background: var(--grad); color: #fff; padding: 18px 18px 74px; border-radius: 0 0 26px 26px; position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; pointer-events: none; width: 230px; height: 230px; right: -90px; top: -100px; background: radial-gradient(circle, rgba(255,255,255,.18), transparent 65%); border-radius: 50%; }
.hero-top { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 2; }
.hero-logo { height: 38px; filter: brightness(0) invert(1); }
.hero-user { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,.65); background: #E8DDF4; }
.avatar.sm { width: 34px; height: 34px; }
.avatar.lg { width: 74px; height: 74px; }
.hero-user .nm { font-weight: 600; font-size: 15px; }
.hero-user .rl { font-size: 11.5px; opacity: .82; }
.icon-btn { width: 38px; height: 38px; border-radius: 12px; background: rgba(255,255,255,.16); display: grid; place-items: center; color: #fff; position: relative; }
.icon-btn .dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); border: 2px solid #6B1FA8; }

/* ---------- Status card ---------- */
.status-card { background: #fff; border-radius: 20px; padding: 16px; margin: -56px 16px 0; box-shadow: var(--shadow); position: relative; z-index: 2; }
.status-head { display: flex; align-items: center; justify-content: space-between; }
.status-head .t { font-size: 12px; color: var(--muted); }
.pill { padding: 5px 12px; border-radius: 99px; font-size: 11px; font-weight: 700; }
.pill-wait { background: #FFF0DF; color: #D9730B; }
.pill-ok { background: #E4F8EE; color: #0F8B54; }
.pill-bad { background: #FDE8E8; color: #C0392B; }
.pill-info { background: var(--purple-50); color: var(--purple); }
.status-big { font-size: 17px; font-weight: 700; margin-top: 6px; }
.status-sub { font-size: 12px; color: var(--muted); }
.big-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.action-tile { border-radius: 16px; padding: 14px 10px; color: #fff; display: flex; flex-direction: column; gap: 6px; align-items: center; font-weight: 600; font-size: 13px; position: relative; overflow: hidden; }
.action-tile.in { background: linear-gradient(140deg, #34D399, #0E9F6E); }
.action-tile.out { background: linear-gradient(140deg, #FFA940, #F58220); }
.action-tile .sub { font-size: 10.5px; font-weight: 500; opacity: .9; }
.action-tile svg { opacity: .95; }
.action-tile:disabled { filter: grayscale(.65); opacity: .6; }

/* ---------- Quick menu ---------- */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 8px; margin-top: 18px; }
.quick { display: flex; flex-direction: column; align-items: center; gap: 7px; background: none; font-size: 10.5px; font-weight: 500; color: #4A4054; text-align: center; line-height: 1.25; }
.quick .qi { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; color: #fff; box-shadow: 0 6px 14px rgba(74,14,107,.14); }
.qi.purple { background: linear-gradient(140deg, #9B4FD0, #6B1FA8); }
.qi.orange { background: linear-gradient(140deg, #FFB25B, #F58220); }
.qi.green { background: linear-gradient(140deg, #45D999, #12A263); }
.qi.blue { background: linear-gradient(140deg, #5CB8F2, #2D7FD3); }
.qi.pink { background: linear-gradient(140deg, #F78FB3, #E0568A); }
.qi.dark { background: linear-gradient(140deg, #6D5B84, #3F0D66); }
.qi.red { background: linear-gradient(140deg, #FF8A80, #E04A3F); }

/* ---------- Cards & sections ---------- */
.card { background: #fff; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); }
.sec-title { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 10px; }
.sec-title h3 { font-size: 14.5px; margin: 0; font-weight: 700; }
.sec-title button { font-size: 12px; color: var(--purple); font-weight: 600; background: none; }
.recap-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.recap { background: var(--purple-50); border-radius: 14px; padding: 10px 8px; text-align: center; }
.recap .v { font-size: 19px; font-weight: 800; color: var(--purple); line-height: 1.2; }
.recap .l { font-size: 10.5px; color: var(--muted); margin-top: 2px; }

.banner { border-radius: 18px; overflow: hidden; position: relative; color: #fff; padding: 16px; background: var(--grad); display: flex; align-items: center; gap: 12px; }
.banner .txt { flex: 1; }
.banner h4 { margin: 0 0 3px; font-size: 14px; line-height: 1.3; }
.banner p { margin: 0; font-size: 11px; opacity: .85; }
.banner .btn-sm { background: rgba(255,255,255,.2); color: #fff; border: 1px solid rgba(255,255,255,.35); }

.list-item { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item .li-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--purple-50); color: var(--purple); flex-shrink: 0; }
.list-item .li-t { font-weight: 600; font-size: 13px; }
.list-item .li-s { font-size: 11.5px; color: var(--muted); }
.chev { color: #B9AEC6; flex-shrink: 0; }

/* ---------- Forms / sheets ---------- */
.tabs { display: flex; gap: 6px; background: #EFE9F4; padding: 4px; border-radius: 12px; }
.tabs button { flex: 1; padding: 8px; border-radius: 9px; background: none; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.tabs button.on { background: #fff; color: var(--purple); box-shadow: 0 2px 6px rgba(0,0,0,.06); }
.sheet-wrap { position: fixed; inset: 0; background: rgba(30,10,45,.45); z-index: 60; display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet-wrap > div { width: 100%; max-width: 480px; background: #fff; border-radius: 24px 24px 0 0; padding: 18px; max-height: 86vh; overflow-y: auto; animation: up .25s ease; }
@keyframes up { from { transform: translateY(30px); } to { transform: none; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sheet-head h3 { margin: 0; font-size: 16px; }

/* ---------- Camera ---------- */
.cam-wrap { position: relative; width: 100%; aspect-ratio: 1/1; border-radius: 24px; overflow: hidden; background: #20102E; display: grid; place-items: center; }
.cam-wrap video, .cam-wrap canvas, .cam-wrap img { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.cam-wrap img { transform: none; }
.cam-overlay { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.face-ring { width: 64%; height: 64%; border: 2.5px dashed rgba(255,255,255,.75); border-radius: 50%; position: relative; }
.face-ring::before, .face-ring::after { content: ''; position: absolute; background: var(--orange); border-radius: 2px; }
.cam-hint { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; color: #fff; font-size: 11.5px; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.check-list { margin-top: 14px; display: flex; flex-direction: column; gap: 9px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.check .ok { width: 22px; height: 22px; border-radius: 50%; background: #E4F8EE; color: #0F8B54; display: grid; place-items: center; flex-shrink: 0; }
.check .no { width: 22px; height: 22px; border-radius: 50%; background: #FDE8E8; color: #C0392B; display: grid; place-items: center; flex-shrink: 0; }
.check .warn { width: 22px; height: 22px; border-radius: 50%; background: #FFF0DF; color: #D9730B; display: grid; place-items: center; flex-shrink: 0; }
.alert { border-radius: 14px; padding: 12px 14px; font-size: 12px; display: flex; gap: 10px; align-items: flex-start; }
.alert-warn { background: #FFF7E8; color: #8A5A00; border: 1px solid #FFE1A8; }
.alert-info { background: var(--purple-50); color: #4B2A63; border: 1px solid var(--purple-100); }
.alert-bad { background: #FDEBEB; color: #9B2C2C; border: 1px solid #F8C9C9; }

/* ---------- Timer ---------- */
.timer-wrap { display: grid; place-items: center; margin: 10px 0 4px; position: relative; }
.timer-label { position: absolute; text-align: center; }
.timer-label .s { font-size: 11px; color: var(--muted); }
.timer-label .v { font-size: 27px; font-weight: 800; letter-spacing: .5px; color: var(--ink); font-variant-numeric: tabular-nums; }
.timer-label .t { font-size: 11px; color: var(--muted); }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.info-box { background: #FAF7FD; border-radius: 12px; padding: 10px 12px; }
.info-box .k { font-size: 10.5px; color: var(--muted); }
.info-box .v { font-size: 12.5px; font-weight: 600; margin-top: 2px; }

/* ---------- Bottom nav ---------- */
.bottom-nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; background: #fff; display: grid; grid-template-columns: repeat(4, 1fr); padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); z-index: 40; }
.bottom-nav button { background: none; display: flex; flex-direction: column; align-items: center; gap: 3px; color: #A298AD; font-size: 10px; font-weight: 500; padding: 4px 0; }
.bottom-nav button.on { color: var(--purple); font-weight: 700; }
.bottom-nav button.on .nb { background: var(--purple-50); }
.nb { width: 40px; height: 26px; border-radius: 9px; display: grid; place-items: center; }
@media (min-width: 900px) { .bottom-nav { bottom: 24px; border-radius: 0 0 28px 28px; } }

/* ---------- Notifikasi / toast ---------- */
.toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); background: #2B1B3A; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 12.5px; z-index: 200; max-width: 90%; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: fade .2s; }
.toast.ok { background: #10875A; } .toast.err { background: #C0392B; }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.spinner.dark { border-color: var(--purple-100); border-top-color: var(--purple); }
.skeleton { background: linear-gradient(90deg, #F1ECF6 25%, #F8F4FB 50%, #F1ECF6 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 12px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- Detail rows ---------- */
.dl { display: grid; grid-template-columns: 100px 1fr; gap: 8px 10px; font-size: 12.5px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 600; text-align: right; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 7px; font-size: 10.5px; font-weight: 700; }
.b-hadir { background: #E4F8EE; color: #0F8B54; }
.b-terlambat { background: #FFF0DF; color: #C46A00; }
.b-izin { background: #E8F1FD; color: #1F6FBF; }
.b-sakit { background: #FDECEC; color: #C0392B; }
.b-cuti { background: #F1E9FD; color: #6B1FA8; }
.b-alpa { background: #FBE4E4; color: #A61B1B; }
.b-libur { background: #EEF0F3; color: #6B7280; }
.b-dinas { background: #E7F6F8; color: #0E7490; }
.b-menunggu { background: #FFF0DF; color: #C46A00; }
.b-disetujui { background: #E4F8EE; color: #0F8B54; }
.b-ditolak { background: #FBE4E4; color: #A61B1B; }
.b-dibatalkan { background: #EEF0F3; color: #6B7280; }

.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dow { text-align: center; font-size: 10px; color: var(--muted); font-weight: 600; padding: 4px 0; }
.cal .day { aspect-ratio: 1/1; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11.5px; background: #FAF7FD; position: relative; }
.cal .day .dot { width: 4px; height: 4px; border-radius: 50%; margin-top: 2px; }
.cal .day.today { outline: 2px solid var(--purple); }
.cal .day.hadir { background: #E4F8EE; color: #0F8B54; } .cal .day.hadir .dot { background: #0F8B54; }
.cal .day.terlambat { background: #FFF0DF; color: #C46A00; } .cal .day.terlambat .dot { background: #F58220; }
.cal .day.alpa { background: #FBE4E4; color: #A61B1B; } .cal .day.alpa .dot { background: #C0392B; }
.cal .day.izin { background: #E8F1FD; color: #1F6FBF; } .cal .day.izin .dot { background: #2D9CDB; }
.cal .day.sakit { background: #FDECEC; color: #C0392B; }
.cal .day.cuti { background: #F1E9FD; color: #6B1FA8; }
.cal .day.libur { background: #F4F4F6; color: #9AA0A6; }
.empty { text-align: center; color: var(--muted); font-size: 12.5px; padding: 30px 10px; }
.mono { font-variant-numeric: tabular-nums; }
