:root {
  --brand: #e3262b;
  --brand-dark: #b81d21;
  --brand-soft: #fdecec;
  --ink: #16181d;
  --ink-2: #2a2d35;
  --muted: #6b7280;
  --line: #e7e8ec;
  --bg: #f3f4f7;
  --card: #ffffff;
  --ok: #138a4a;
  --ok-soft: #e6f5ec;
  --warn: #b26b00;
  --warn-soft: #fff4e0;
  --info: #1f5fd1;
  --info-soft: #e8f0fd;
  --violet: #6b3fd1;
  --violet-soft: #f0eafd;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 18, 24, .06), 0 4px 16px rgba(16, 18, 24, .06);
  --tabbar-h: 64px;
  --maxw: 560px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  font-family: "Segoe UI", Roboto, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); min-height: 100vh; min-height: 100dvh; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--info); }
img { max-width: 100%; }
/* Ikon: ukuran default (Safari iPhone menggambar SVG tanpa ukuran selebar layar) */
svg { flex-shrink: 0; }
.list-item > svg, .row > svg, .icon-btn > svg { width: 20px; height: 20px; }
.list-item .title, .list-item .meta { overflow-wrap: anywhere; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.bold { font-weight: 700; }
.right { text-align: right; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.boot { min-height: 100dvh; display: grid; place-items: center; }

/* ---------- Shell ---------- */
.shell { max-width: var(--maxw); margin: 0 auto; min-height: 100dvh; padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 24px); }
.appbar {
  position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.96); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; min-height: 56px;
}
.appbar::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--brand); }
.appbar img.logo { height: 26px; width: auto; display: block; }
.appbar h1 { font-size: 17px; margin: 0; font-weight: 700; }
.appbar .sub { font-size: 12px; color: var(--muted); }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; display: grid; place-items: center; color: var(--ink); }
.icon-btn:active { background: var(--bg); }
.content { padding: 16px; }
.topload { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; pointer-events: none; overflow: hidden; opacity: 0; transition: opacity .15s; }
.topload.on { opacity: 1; }
.topload::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; background: var(--ink); animation: slide 0.9s ease-in-out infinite; }
@keyframes slide { from { left: -40%; } to { left: 100%; } }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: #fff; border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
}
.tabbar-inner { max-width: var(--maxw); margin: 0 auto; display: flex; height: var(--tabbar-h); }
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600; position: relative;
}
.tabbar a svg { width: 23px; height: 23px; }
.tabbar a.active { color: var(--brand); }
.tabbar a.active::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }

/* ---------- Cards ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card + .card { margin-top: 12px; }
.card-title { font-size: 15px; font-weight: 700; margin: 0 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 22px 2px 10px; }
.list { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border: 0; background: none; width: 100%; text-align: left; border-top: 1px solid var(--line); }
.list-item:first-child { border-top: 0; }
button.list-item:active, a.list-item:active { background: #fafafb; }
a.list-item { text-decoration: none; color: inherit; }
.list-item .title { font-weight: 600; font-size: 15px; }
.list-item .meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.empty { text-align: center; padding: 32px 16px; color: var(--muted); }
.empty svg { width: 40px; height: 40px; opacity: .5; }

.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; color: #fff; background: var(--ink-2); }
.avatar.lg { width: 56px; height: 56px; font-size: 19px; }

/* ---------- Hero (beranda) ---------- */
.greet { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.greet .hello { font-size: 13px; color: var(--muted); }
.greet .name { font-size: 18px; font-weight: 700; }
.hero {
  background: linear-gradient(150deg, #1d2027 0%, #121418 100%); color: #fff; border-radius: 20px; padding: 18px;
  box-shadow: 0 10px 28px rgba(18, 20, 24, .25); position: relative; overflow: hidden;
}
.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, rgba(227,38,43,.45), rgba(227,38,43,0) 70%); }
.hero .date { font-size: 13px; opacity: .75; }
.hero .clock { font-size: 44px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; margin: 4px 0 2px; }
.hero .clock small { font-size: 18px; opacity: .6; font-weight: 600; margin-left: 2px; }
.hero .shift { font-size: 13px; opacity: .8; display: flex; align-items: center; gap: 6px; }
.hero .loc { margin-top: 12px; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 6px 10px; border-radius: 99px; background: rgba(255,255,255,.1); }
.hero .loc .dot { width: 8px; height: 8px; border-radius: 50%; background: #9ca3af; }
.hero .loc.in .dot { background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.25); }
.hero .loc.out .dot { background: #f87171; }
.hero .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; position: relative; z-index: 1; }
.hero .times { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; position: relative; z-index: 1; }
.hero .times > div { background: rgba(255,255,255,.07); border-radius: 12px; padding: 10px 12px; }
.hero .actions .btn { white-space: nowrap; padding: 12px 8px; font-size: 15px; }
.hero .times .k { font-size: 11.5px; opacity: .65; }
.hero .times .v { font-size: 18px; font-weight: 700; margin-top: 2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px;
  padding: 12px 16px; font-weight: 700; font-size: 15px; min-height: 46px; text-decoration: none; transition: transform .05s;
  background: var(--ink); color: #fff;
}
.btn:active { transform: scale(.98); }
.btn svg { width: 19px; height: 19px; }
.btn.block { width: 100%; }
.btn.lg { min-height: 54px; font-size: 16px; border-radius: 14px; }
.btn.primary { background: var(--brand); }
.btn.primary:active { background: var(--brand-dark); }
.btn.light { background: #fff; color: var(--ink); }
.btn.ghost { background: var(--bg); color: var(--ink); }
.btn.outline { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.danger { background: var(--brand-soft); color: var(--brand-dark); }
.btn.sm { min-height: 36px; padding: 7px 12px; font-size: 13.5px; border-radius: 10px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.hero .btn.outline { color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.3); }
.link-btn { background: none; border: 0; color: var(--info); font-weight: 600; padding: 4px 0; font-size: 14px; }

/* ---------- Badges / chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: var(--bg); color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--brand-soft); color: var(--brand-dark); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.violet { background: var(--violet-soft); color: var(--violet); }
.badge.teal { background: #e0f4f4; color: #0e6b6b; }
.pick-list { display: flex; flex-wrap: wrap; gap: 6px; }
.pick-list .chip { padding: 7px 12px; font-size: 13px; }
.chk { width: 22px; height: 22px; flex: none; accent-color: var(--brand); }
.bulkbar { position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-b) + 8px); z-index: 25; background: var(--ink); color: #fff; border-radius: 16px; padding: 10px 12px; margin-top: 12px; display: flex; align-items: center; gap: 8px; box-shadow: 0 10px 28px rgba(0,0,0,.3); }
.bulkbar .n { flex: 1; font-weight: 700; font-size: 14px; }
.bulkbar .btn { min-height: 40px; padding: 8px 12px; font-size: 14px; }
.quick { flex: none; border: 0; border-radius: 10px; padding: 8px 12px; font-weight: 700; font-size: 13px; background: var(--ok-soft); color: var(--ok); }
.quick.out { background: var(--info-soft); color: var(--info); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 4px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 0; border-radius: 99px; padding: 8px 14px; font-size: 13.5px; font-weight: 600; background: #fff; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); }
.chip.active { background: var(--ink); color: #fff; box-shadow: none; }
.chip .n { opacity: .6; margin-left: 4px; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--card); border-radius: 14px; padding: 12px; box-shadow: var(--shadow); }
.stat .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat .v { font-size: 22px; font-weight: 800; margin-top: 2px; }
.stat .v small { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat.ok .v { color: var(--ok); }
.stat.bad .v { color: var(--brand); }
.stat.warn .v { color: var(--warn); }
.progress { height: 8px; border-radius: 8px; background: var(--bg); overflow: hidden; display: flex; }
.progress span { display: block; height: 100%; }

/* ---------- Menu grid ---------- */
.menu-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.menu-grid a { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; text-align: center; padding: 6px 2px; border-radius: 12px; }
.menu-grid a:active { background: var(--bg); }
.menu-grid .ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; }
.menu-grid .ic svg { width: 24px; height: 24px; }

/* ---------- Date / period nav ---------- */
.datenav { display: flex; align-items: center; gap: 8px; background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; margin-bottom: 12px; }
.datenav .label { flex: 1; text-align: center; font-weight: 700; font-size: 14.5px; position: relative; }
.datenav .label .s { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.datenav input[type=date] { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }

/* ---------- Kalender mini ---------- */
.cal { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 10px 10px 8px; margin-bottom: 12px; }
.cal-head { display: flex; align-items: center; gap: 6px; padding: 0 2px; }
.cal-head + .cal-head { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.cal-head .t { flex: 1; min-width: 0; font-weight: 700; font-size: 14.5px; }
.cal-head .t small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 1px; }
.cal-head .t.month { font-size: 15px; }
.cal-btn { width: 32px; height: 32px; flex: none; border-radius: 9px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; color: var(--ink-2); padding: 0; }
.cal-btn svg { width: 17px; height: 17px; }
.cal-btn.plain { border: 0; background: none; color: var(--muted); }
.cal-btn[disabled] { opacity: .3; }
.cal-btn:active { background: var(--bg); }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); align-items: center; justify-items: center; border-radius: 12px; padding: 1px 0; }
.cal-week.cur { background: var(--brand-soft); }
.cal-dows { margin-top: 8px; }
.cal-dow { font-size: 11px; font-weight: 700; color: var(--muted); padding: 2px 0 4px; }
.cal-dow.sun { color: var(--brand); }
.cal-day { width: 34px; height: 34px; border-radius: 50%; border: 0; background: none; font-size: 14px; font-weight: 600; color: var(--ink); display: grid; place-items: center; position: relative; padding: 0; font-variant-numeric: tabular-nums; }
.cal-day.sun { color: var(--brand); }
.cal-day.out { color: #b8bcc6; }
.cal-day.today::after { content: ""; position: absolute; bottom: 3px; left: 50%; margin-left: -2px; width: 4px; height: 4px; border-radius: 50%; background: var(--brand); }
.cal-day.sel { background: var(--brand); color: #fff; box-shadow: 0 2px 6px rgba(227, 38, 43, .35); }
.cal-day.sel::after { background: #fff; }
.cal-day[disabled] { opacity: .3; }
.cal-day:not([disabled]):not(.sel):active { background: var(--bg); }
.cal-today { display: block; margin: 6px auto 0; border: 0; background: none; color: var(--info); font-weight: 700; font-size: 13px; padding: 4px 10px; }

/* ---------- Forms ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%; border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 12px 14px; font-size: 16px; min-height: 48px; outline: none;
}
textarea.input { min-height: 110px; resize: vertical; font-size: 14px; }
.input:focus { border-color: var(--ink); }
.input-group { position: relative; }
.input-group .prefix { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; font-size: 15px; pointer-events: none; }
.input-group .input { padding-left: 42px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; }
.switch input { width: 46px; height: 28px; appearance: none; background: #d1d5db; border-radius: 99px; position: relative; transition: .15s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { left: 21px; }

.seg { display: grid; grid-template-columns: repeat(var(--cols, 3), 1fr); gap: 6px; background: var(--bg); padding: 4px; border-radius: 12px; }
.seg button { border: 0; background: transparent; border-radius: 9px; padding: 9px 4px; font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
.seg button.active { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.12); color: var(--ink); }

/* Pilihan jenis kerja */
.wt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wt { border: 1.5px solid var(--line); background: #fff; border-radius: 14px; padding: 12px; text-align: left; display: flex; flex-direction: column; gap: 4px; min-height: 84px; position: relative; }
.wt .t { font-weight: 700; font-size: 14.5px; }
.wt .d { font-size: 12px; color: var(--muted); line-height: 1.35; }
.wt .ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; margin-bottom: 2px; }
.wt .ic svg { width: 17px; height: 17px; }
.wt.active { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand); }
.wt.active::after { content: "✓"; position: absolute; right: 10px; top: 8px; color: var(--brand); font-weight: 800; }
.wt.sm { min-height: 0; padding: 10px; }

/* ---------- Sheet (bottom modal) ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(12, 14, 18, .5); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease-out; }
.sheet {
  background: var(--bg); width: 100%; max-width: var(--maxw); max-height: 94dvh; border-radius: 22px 22px 0 0;
  display: flex; flex-direction: column; animation: up .2s cubic-bezier(.2,.8,.3,1); padding-bottom: var(--safe-b);
}
.sheet-head { padding: 10px 16px 12px; background: #fff; border-radius: 22px 22px 0 0; border-bottom: 1px solid var(--line); }
.sheet-head .grab { width: 40px; height: 4px; border-radius: 4px; background: #d6d8de; margin: 0 auto 10px; }
.sheet-head h2 { margin: 0; font-size: 17px; }
.sheet-head .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.sheet-body { padding: 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1; }
.sheet-foot { padding: 12px 16px; background: #fff; border-top: 1px solid var(--line); display: flex; gap: 10px; }
.sheet-foot .btn { flex: 1; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Map ---------- */
.map { height: 230px; border-radius: 14px; overflow: hidden; background: #e5e7eb; position: relative; z-index: 0; }
.map.tall { height: 280px; }
.gps-box { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: #fff; box-shadow: var(--shadow); margin-top: 10px; }
.gps-box .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.gps-box.in .ic { background: var(--ok-soft); color: var(--ok); }
.gps-box.out .ic { background: var(--brand-soft); color: var(--brand); }
.gps-box.wait .ic { background: var(--bg); color: var(--muted); }
.gps-box .t { font-weight: 700; font-size: 14.5px; }
.gps-box .m { font-size: 12.5px; color: var(--muted); }
.me-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--info); border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(31,95,209,.35), 0 2px 6px rgba(0,0,0,.3); }
.fac-pin { width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--brand); border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }

/* ---------- Day rows (riwayat) ---------- */
.day { display: flex; gap: 12px; padding: 13px 16px; border-top: 1px solid var(--line); align-items: flex-start; width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; }
.day:first-child { border-top: 0; }
.day .dnum { width: 44px; flex: none; text-align: center; border-radius: 12px; background: var(--bg); padding: 6px 0; }
.day .dnum b { display: block; font-size: 18px; line-height: 1.1; }
.day .dnum span { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.day.today .dnum { background: var(--ink); color: #fff; }
.day.today .dnum span { color: rgba(255,255,255,.7); }
.day .body { flex: 1; min-width: 0; }
.day .amt { font-weight: 700; font-size: 14px; white-space: nowrap; }

/* ---------- Slip ---------- */
.slip-total { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 18px; }
.slip-total .k { font-size: 13px; opacity: .7; }
.slip-total .v { font-size: 30px; font-weight: 800; letter-spacing: -.01em; margin-top: 2px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px dashed var(--line); font-size: 14px; }
.kv:first-child { border-top: 0; }
.kv .k { color: var(--ink-2); }
.kv .v { font-weight: 700; white-space: nowrap; }
.kv.sub .k { color: var(--muted); padding-left: 12px; font-size: 13px; }
.kv.sub .v { font-weight: 600; font-size: 13px; color: var(--muted); }
.kv.total { border-top: 2px solid var(--ink); font-size: 16px; padding-top: 12px; margin-top: 4px; }
.kv.minus .v { color: var(--brand); }

.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; font-size: 13.5px; margin-bottom: 12px; }
.banner svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.banner.info { background: var(--info-soft); color: #173f8a; }
.banner.warn { background: var(--warn-soft); color: #7a4a00; }
.banner.ok { background: var(--ok-soft); color: #0d5c32; }
.banner.bad { background: var(--brand-soft); color: #8a1418; }

.entry { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.entry:first-child { border-top: 0; }
.x-btn { width: 32px; height: 32px; border-radius: 10px; border: 0; background: var(--bg); color: var(--muted); display: grid; place-items: center; flex: none; }
.x-btn svg { width: 16px; height: 16px; }

.pin-card { background: #fff; border: 2px dashed var(--line); border-radius: 14px; padding: 16px; text-align: center; }
.pin-card .pin { font-size: 34px; letter-spacing: .25em; font-weight: 800; }
table.pins { width: 100%; border-collapse: collapse; font-size: 14px; }
table.pins td, table.pins th { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; }

/* ---------- Toast ---------- */
#toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px); transform: translate(-50%, 20px); opacity: 0; transition: .2s; z-index: 80; pointer-events: none; max-width: calc(100% - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast div { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
#toast.err div { background: var(--brand-dark); }

/* ---------- Login ---------- */
.login { min-height: 100dvh; display: flex; flex-direction: column; max-width: 440px; margin: 0 auto; padding: 0 24px; background: #fff; }
.login-top { padding-top: 12vh; padding-bottom: 28px; }
.login-top img { width: 110px; display: block; }
.login-top h1 { font-size: 26px; margin: 26px 0 6px; letter-spacing: -.01em; }
.login-top p { margin: 0; color: var(--muted); font-size: 15px; }
.login form { flex: 1; }
.login .foot { text-align: center; color: var(--muted); font-size: 12px; padding: 24px 0 calc(20px + var(--safe-b)); }
.pin-input { letter-spacing: .4em; font-size: 22px !important; font-weight: 700; }
@media (min-width: 600px) {
  body.is-login { background: var(--bg); }
  .login { min-height: auto; margin-top: 6vh; border-radius: 24px; box-shadow: var(--shadow); padding-bottom: 8px; }
  .login-top { padding-top: 40px; }
}

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(0,0,0,.1); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: grid; place-items: center; padding: 48px 0; }

/* Tabel gaji: scroll horizontal di HP */
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 360px) {
  .hero .clock { font-size: 38px; }
  .stats { gap: 8px; }
  .stat .v { font-size: 19px; }
}
/* ---------- Slip cetak A4 (format "GAJI SIT NEW") ---------- */
.shell.wide { max-width: 1140px; }
.print-wrap { zoom: var(--z, 1); }
.slip-page {
  width: 281mm; height: 194mm; background: #fff; display: flex; align-items: flex-start; margin: 0 auto 16px;
  box-shadow: 0 0 0 1px var(--line), var(--shadow); font-family: Arial, Helvetica, sans-serif; font-size: 7.6pt; color: #000; overflow: hidden;
}
.slip-col { flex: 1; min-width: 0; }
.slip-col + .slip-col { margin-left: -0.25mm; }
.sb { width: 100%; border-collapse: collapse; table-layout: fixed; border: 0.25mm solid #000; }
.sb + .sb { margin-top: -0.25mm; }
.sb td { height: 3.7mm; line-height: 3.5mm; padding: 0 1mm; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.sb td.l { font-size: 7.2pt; }
.sb td.r { text-align: right; }
.sb td.nm { overflow: visible; padding: 0 0.5mm; }
.sb .nm span { display: block; border: 0.25mm solid #000; font-weight: 700; padding: 0 0.5mm; line-height: 3mm; overflow: hidden; text-overflow: clip; letter-spacing: -0.01em; }
.sb tr.t td, .sb tr.b td { font-weight: 700; }

@media print {
  @page { size: A4 landscape; margin: 8mm; }
  .tabbar, .appbar, .no-print, #toast { display: none !important; }
  body { background: #fff; }
  .shell, .shell.wide { max-width: none; padding: 0; }
  .content { padding: 0; }
  .print-wrap { zoom: 1 !important; }
  .slip-page { box-shadow: none; margin: 0; break-after: page; page-break-after: always; }
  .slip-page:last-child { break-after: auto; page-break-after: auto; }
}
