/* HRIS Mobile PWA — gaya dasar. Warna dan tipografi mengikuti desain artifact. */
:root {
  --primary: #0E5A50;
  --primary-2: #13786B;
  --primary-soft: #E3EFEC;
  --bg: #F3F5F4;
  --card: #FFFFFF;
  --text: #15201E;
  --muted: #5B6866;
  --line: #E1E6E4;
  --accent: #E8A33D;
  --ok: #1E8A5A;   --ok-soft: #E2F3EA;
  --no: #C2412D;   --no-soft: #FBE7E3;
  --wait: #B7791F; --wait-soft: #FCF1DC;
  --draft: #5B6866; --draft-soft: #ECEFEE;
  --green: #1E8A5A; --purple: #6B4FBB; --red: #C2412D; --amber: #B7791F;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(21,32,30,.05), 0 4px 16px rgba(21,32,30,.05);
  --nav-h: 68px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: hidden; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.45 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
.app { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px); }

/* Header */
.topbar { display: flex; align-items: center; gap: 10px; padding: 16px 16px 8px; padding-top: calc(16px + env(safe-area-inset-top)); }
.topbar h1 { font-size: 19px; font-weight: 700; flex: 1; }
.topbar .back { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.hero { background: var(--primary); color: #fff; padding: 20px 16px 56px; padding-top: calc(20px + env(safe-area-inset-top)); border-radius: 0 0 24px 24px; }
.hero .salam { opacity: .8; font-size: 13px; }
.hero h1 { font-size: 21px; font-weight: 700; margin-top: 2px; }
.hero .sub { opacity: .8; font-size: 13px; margin-top: 2px; }
.hero-row { display: flex; align-items: center; gap: 12px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: rgba(255,255,255,.16); color: #fff; flex: none; }
.avatar.lg { width: 72px; height: 72px; font-size: 24px; background: var(--primary-soft); color: var(--primary); }
.lift { margin-top: -40px; }

.wrap { padding: 0 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card h2 { font-size: 15px; font-weight: 700; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.card-head a { font-size: 13px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.strong { font-weight: 700; }
.center { text-align: center; }

/* Grid stat */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { background: var(--card); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); }
.stat .n { font-size: 22px; font-weight: 700; }
.stat .l { font-size: 12px; color: var(--muted); }

.jam-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.jam-box { background: var(--bg); border-radius: 12px; padding: 10px 12px; }
.jam-box .l { font-size: 12px; color: var(--muted); }
.jam-box .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Tombol */
.btn { appearance: none; border: 0; border-radius: 14px; padding: 13px 18px; font: inherit; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:disabled { background: #9DB7B2; cursor: not-allowed; }
.btn-ghost { background: var(--primary-soft); color: var(--primary); }
.btn-danger { background: var(--no-soft); color: var(--no); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-block { width: 100%; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--no); font-weight: 600; cursor: pointer; }

/* Menu cepat */
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick a { display: grid; justify-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text); }
.quick .ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; }
.tone-green { background: var(--ok-soft); color: var(--green); }
.tone-purple { background: #EEE9FA; color: var(--purple); }
.tone-red { background: var(--no-soft); color: var(--red); }
.tone-amber { background: var(--wait-soft); color: var(--amber); }
.tone-primary { background: var(--primary-soft); color: var(--primary); }

/* Daftar */
.list { display: grid; grid-template-columns: minmax(0, 1fr); }
.item { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); color: var(--text); }
.item:first-child { border-top: 0; padding-top: 0; }
.item:last-child { padding-bottom: 0; }
.item .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.item .body { flex: 1; min-width: 0; }
.item .t, .item .s { display: block; }
.item .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .s { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.badge { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-no { background: var(--no-soft); color: var(--no); }
.badge-wait { background: var(--wait-soft); color: var(--wait); }
.badge-draft { background: var(--draft-soft); color: var(--draft); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 4px; margin: 0 -16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 7px 14px; border-radius: 999px; background: var(--card); color: var(--muted); font-size: 13px; font-weight: 600; box-shadow: var(--shadow); }
.chip.on { background: var(--primary); color: #fff; }

/* Form */
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; }
.field .hint { font-size: 12px; color: var(--muted); }
input[type=text], input[type=password], input[type=date], input[type=time], input[type=email], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--card);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 12px; min-height: 46px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14,90,80,.12); }
.form { display: grid; gap: 14px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.info { background: var(--primary-soft); color: var(--primary); border-radius: 12px; padding: 10px 12px; font-size: 13px; }

.alert { border-radius: 12px; padding: 11px 13px; font-size: 13.5px; display: flex; gap: 8px; align-items: flex-start; }
.alert svg { flex: none; margin-top: 1px; }
.alert-ok { background: var(--ok-soft); color: var(--ok); }
.alert-no { background: var(--no-soft); color: var(--no); }
.alert-wait { background: var(--wait-soft); color: var(--wait); }
.alert ul { margin: 0; padding-left: 18px; }

/* Detail */
.dl { display: grid; gap: 10px; margin: 0; }
.dl div { display: grid; grid-template-columns: 40% 1fr; gap: 8px; font-size: 14px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 600; word-break: break-word; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.timeline li { display: flex; gap: 10px; font-size: 13.5px; }
.timeline .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex: none; background: var(--line); }
.timeline .dot.ok { background: var(--ok); } .timeline .dot.no { background: var(--no); } .timeline .dot.wait { background: var(--accent); }

/* Absen */
.cam { position: relative; aspect-ratio: 4/5; max-height: 56vh; width: 100%; justify-self: center; background: #0B1A18; border-radius: var(--radius); overflow: hidden; display: grid; place-items: center; color: #CFE0DC; }
.cam video, .cam img { width: 100%; height: 100%; object-fit: cover; }
.cam video { transform: scaleX(-1); }
.cam .ph { display: grid; justify-items: center; gap: 8px; padding: 24px; text-align: center; font-size: 13px; }
.cam .ring { position: absolute; inset: 14% 18%; border: 2px dashed rgba(255,255,255,.4); border-radius: 50% / 42%; pointer-events: none; }
.geo { display: flex; gap: 10px; align-items: center; }
.geo .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.geo.ok .ic { background: var(--ok-soft); color: var(--ok); }
.geo.no .ic { background: var(--no-soft); color: var(--no); }
.geo.wait .ic { background: var(--wait-soft); color: var(--wait); }
.meter { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.meter i { display: block; height: 100%; background: var(--ok); width: 0; transition: width .3s; }
.geo.no .meter i { background: var(--no); }

/* Login */
.login { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; max-width: 480px; margin: 0 auto; }
.login .top { background: var(--primary); color: #fff; padding: 56px 24px 72px; border-radius: 0 0 28px 28px; }
.login .logo { display: block; width: 76px; height: 76px; border-radius: 50%; background: #fff; padding: 4px; margin-bottom: 18px; box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.login .top h1 { font-size: 24px; font-weight: 800; }
.login .top p { opacity: .8; margin: 6px 0 0; }
.login .card { margin: -44px 16px 24px; align-self: start; }

/* Bottom nav */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.nav ul { list-style: none; margin: 0 auto; padding: 0; max-width: 480px; display: grid; grid-template-columns: repeat(4, 1fr); height: var(--nav-h); }
.nav a { height: 100%; display: grid; place-content: center; justify-items: center; gap: 3px; color: var(--muted); font-size: 11.5px; font-weight: 600; position: relative; }
.nav a.on { color: var(--primary); }
.nav a.on::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--primary); }
.nav .dotn { position: absolute; top: 9px; margin-left: 20px; min-width: 16px; height: 16px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 10px; display: grid; place-items: center; padding: 0 4px; }

.empty { text-align: center; padding: 28px 12px; color: var(--muted); font-size: 14px; }
.empty .ic { width: 56px; height: 56px; border-radius: 18px; margin: 0 auto 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.spin { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: sp .8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.hide { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
