/* REIN CORP — portal internal. Sedikit warna, sedikit kotak. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2"); }

:root {
  --bg: #f7f7f5; --surface: #ffffff; --ink: #141414; --muted: #6b6b6b; --line: #e6e5e1; --line-strong: #cfcdc7;
  --accent: #141414; --accent-ink: #ffffff; --good: #0f7a4a; --bad: #b3261e; --warn: #9a6200; --warn-bg: #fff6df; --bad-bg: #fdecea; --good-bg: #e8f5ee;
  --radius: 10px; --side: 232px; --side-min: 64px;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.45; font-feature-settings: "tnum" 1, "cv11" 1; }
[hidden] { display: none !important; }
h1 { font-size: 20px; margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 15px; margin: 0 0 10px; font-weight: 600; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.good { color: var(--good); } .bad { color: var(--bad); }
.nowrap { white-space: nowrap; }

/* ---------- tombol & isian */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-weight: 550; white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: #9d9b94; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .nav a:focus-visible { outline: 2px solid #2b6fff; outline-offset: 1px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #2a2a2a; }
.btn.danger { color: var(--bad); border-color: #e3b6b2; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: #ecebe7; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.lg { height: 52px; font-size: 16px; padding: 0 22px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: default; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], input[type=tel], select, textarea {
  height: 36px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); width: 100%; min-width: 0;
}
textarea { height: auto; padding: 8px 10px; }
label.field { display: block; }
label.field > span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.field + .field { margin-top: 12px; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: 16px; height: 16px; }

/* ---------- login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login { width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px 24px; }
.brand { font-weight: 750; letter-spacing: .14em; font-size: 15px; }
.brand small { display: block; font-weight: 450; letter-spacing: 0; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.login .brand { margin-bottom: 22px; }
.login .btn { margin-top: 14px; }
.msg { margin-top: 12px; padding: 9px 11px; border-radius: 8px; font-size: 13px; }
.msg.err { background: var(--bad-bg); color: var(--bad); }
.msg.ok { background: var(--good-bg); color: var(--good); }
.msg.warn { background: var(--warn-bg); color: var(--warn); }
.env-banner { position: sticky; top: 0; z-index: 60; background: #6b3fd4; color: #fff; text-align: center; font-size: 12px; padding: 4px 8px; }

/* ---------- rangka */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.shell.collapsed { grid-template-columns: var(--side-min) 1fr; }
.side { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 14px 10px; gap: 4px; }
.side .brand { padding: 4px 8px 12px; white-space: nowrap; overflow: hidden; }
.side .mod { font-size: 11px; letter-spacing: .1em; color: var(--muted); padding: 10px 10px 4px; text-transform: uppercase; }
.nav a { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border-radius: 8px; text-decoration: none; color: #333; white-space: nowrap; overflow: hidden; }
.nav a:hover { background: #f0efeb; }
.nav a.on { background: var(--ink); color: #fff; }
.nav svg { flex: none; width: 18px; height: 18px; }
.side .grow { flex: 1; }
.side .who { padding: 8px 10px; font-size: 12.5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.side .who b { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; }
.collapsed .side .label, .collapsed .side .mod, .collapsed .side .who, .collapsed .side .brand small { display: none; }
.collapsed .side .brand { letter-spacing: 0; text-align: center; padding-left: 0; padding-right: 0; }
.collapsed .nav a { justify-content: center; padding: 0; }
.col { min-width: 0; }
.main { min-width: 0; padding: 22px 26px 60px; }
.topbar { display: none; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head .spacer { flex: 1; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
.toolbar label.field { flex: 0 1 160px; margin: 0; }
.toolbar label.field.wide { flex: 1 1 220px; }
.toolbar .spacer { flex: 1; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 9px 12px; cursor: pointer; color: var(--muted); font-weight: 550; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-color: var(--ink); }

/* ---------- isi */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card.pad { padding: 16px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.tile .k { color: var(--muted); font-size: 12.5px; }
.tile .v { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; margin-top: 2px; }
.tile .v.sm { font-size: 19px; }
.alert { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 8px; background: var(--warn-bg); color: #5c3b00; margin-bottom: 10px; flex-wrap: wrap; }
.alert.bad { background: var(--bad-bg); color: #7a1a14; }
.alert a { font-weight: 600; }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 550; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: var(--surface); }
td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child > td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover > td { background: #faf9f6; }
tr.void > td { color: #9a9a9a; text-decoration: line-through; }
tr.void > td.keep { text-decoration: none; }
tr.detail > td { background: #faf9f6; padding: 8px 12px 12px 28px; }
tr.group > td { background: #f1f0ec; padding: 8px 12px; font-size: 13px; letter-spacing: .01em; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: #eeede9; }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.empty { padding: 34px 12px; text-align: center; color: var(--muted); }
.pager { display: flex; align-items: center; gap: 10px; justify-content: flex-end; padding: 10px 12px; color: var(--muted); font-size: 13px; }
.itemlist { margin: 0; padding: 0; list-style: none; }
.itemlist li { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.sum { color: var(--muted); font-size: 13px; margin: 0 0 8px; }

/* ---------- modal */
.overlay { position: fixed; inset: 0; background: rgba(20,20,20,.38); z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal.wide { max-width: 760px; }
.modal > header { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal > header h2 { margin: 0; flex: 1; }
.modal > .body { padding: 16px 18px; overflow: auto; }
.modal > footer { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.x { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.x:hover { background: #ecebe7; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 80; max-width: calc(100vw - 32px); box-shadow: 0 6px 22px rgba(0,0,0,.2); }
.toast.err { background: var(--bad); }

/* ---------- catat penjualan / kirim stok */
.suggest { border: 1px solid var(--line-strong); border-radius: 8px; margin-top: 4px; max-height: 240px; overflow: auto; background: var(--surface); }
.suggest button { display: flex; width: 100%; justify-content: space-between; gap: 10px; text-align: left; border: 0; background: none; padding: 9px 11px; cursor: pointer; border-bottom: 1px solid var(--line); }
.suggest button:last-child { border-bottom: 0; }
.suggest button:hover, .suggest button.hi { background: #f3f2ee; }
.cart { margin-top: 12px; }
.cart .row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.cart .row.priced { grid-template-areas: "name qty del" "price price price"; row-gap: 8px; }
.cart .row.priced > :nth-child(1) { grid-area: name; } .cart .row.priced > :nth-child(2) { grid-area: qty; } .cart .row.priced > :nth-child(3) { grid-area: del; }
.pricerow { grid-area: price; display: flex; align-items: center; gap: 6px; }
.pricerow input.price { max-width: 190px; text-align: right; font-weight: 600; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.qty button { width: 34px; height: 34px; border: 0; background: #f3f2ee; cursor: pointer; font-size: 17px; }
.qty input { width: 54px; height: 34px; border: 0; border-radius: 0; text-align: center; padding: 0; }
.searchrow { display: flex; gap: 8px; }
.searchrow input { flex: 1; }
#qr-reader, #face-box { width: 100%; max-width: 420px; margin: 0 auto; border-radius: 10px; overflow: hidden; background: #000; }
#face-box { position: relative; aspect-ratio: 4 / 3; }
#face-box video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.multi { position: relative; }
.multi .panel { position: absolute; z-index: 20; top: 40px; left: 0; width: min(320px, 86vw); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px; box-shadow: 0 8px 26px rgba(0,0,0,.12); }
.multi .panel .opts { max-height: 240px; overflow: auto; margin-top: 6px; }
.multi .panel label { display: flex; gap: 8px; padding: 5px 4px; align-items: center; }
.multi .panel input[type=checkbox] { width: 16px; height: 16px; flex: none; }

/* ---------- absensi */
.btn.xl { height: 64px; font-size: 18px; letter-spacing: .04em; border-radius: 14px; font-weight: 700; }
.att { max-width: 460px; margin: 0 auto; }
.att-top { text-align: center; padding: 8px 0 14px; }
.att-hello { font-size: 17px; font-weight: 600; }
.att-store { color: var(--muted); margin-top: 2px; }
.att-clock { font-size: 46px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; margin-top: 6px; font-variant-numeric: tabular-nums; }
.att-done { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 10px; background: var(--good-bg); color: var(--good); font-weight: 600; margin-bottom: 10px; flex-wrap: wrap; }
.att-note { text-align: center; margin: 10px 4px 14px; }
.att-card { margin-top: 12px; }
dl.kv { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 6px 14px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }
.wz-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.wz-n { font-size: 12px; background: var(--ink); color: #fff; border-radius: 999px; padding: 2px 9px; font-variant-numeric: tabular-nums; }
.wz-body .field + .field, .wz-body .choice + div, .wz-body .choice + div .field:first-child { margin-top: 12px; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice button { text-align: left; border: 1.5px solid var(--line-strong); background: var(--surface); border-radius: 12px; padding: 12px; cursor: pointer; }
.choice button b { display: block; font-size: 15px; }
.choice button span { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.choice button.on { border-color: var(--ink); background: #f3f2ee; box-shadow: inset 0 0 0 1px var(--ink); }
.choice button[disabled] { opacity: .5; cursor: default; }
.geo-wait, .geo-ok { display: flex; gap: 10px; align-items: center; padding: 14px; border-radius: 10px; background: #f3f2ee; }
.geo-ok { background: var(--good-bg); color: var(--good); }
.geo-ok .muted { color: #3d6b55; }
.geo-line { margin: 0; }
.selfie-box { width: 100%; max-width: 360px; margin: 0 auto; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: #000; }
.selfie-box video, .selfie-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.selfie-box video { transform: scaleX(-1); }
.wz-body .btn.block + .btn.block { margin-top: 8px; }
.wz-done { text-align: center; }
.wz-done .tick { width: 54px; height: 54px; border-radius: 50%; background: var(--good-bg); color: var(--good); display: grid; place-items: center; margin: 4px auto 10px; }
.wz-done .tick svg { width: 28px; height: 28px; }
.wz-done dl.kv { text-align: left; margin: 14px 0 18px; }
.tile.as-btn { text-align: left; cursor: pointer; font: inherit; color: inherit; }
.tile.as-btn:hover { border-color: #9d9b94; }
.tile.as-btn.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.att-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.det-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 14px 0; }
.modal h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 16px 0 8px; font-weight: 600; }
.det-col h3 { margin-top: 0; }
.det-col .btn { margin-top: 8px; }
.photo { margin-top: 10px; }
.photo img { width: 100%; max-width: 240px; border-radius: 10px; display: block; background: #eee; aspect-ratio: 3 / 4; object-fit: cover; }
.photo.none { padding: 14px; border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--muted); font-size: 13px; }
.minimap-wrap { margin-top: 8px; }
.minimap { border: 1px solid var(--line); border-radius: 10px; background: #fafaf8; max-width: 100%; height: auto; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin: 0 4px 0 8px; }
.dot:first-child { margin-left: 0; }
ul.plain { margin: 0; padding: 0; list-style: none; }
ul.plain li { padding: 5px 0; border-bottom: 1px solid var(--line); }
ul.plain li:last-child { border-bottom: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.two .field + .field { margin-top: 0; }
.daypick { display: flex; flex-wrap: wrap; gap: 6px 14px; }
div.field { margin-top: 12px; }
input[type=time], input[type=month] { height: 36px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); width: 100%; min-width: 0; }

.mapbox { height: 320px; border-radius: 10px; border: 1px solid var(--line); margin-top: 10px; background: #e9e8e3; z-index: 0; }
.map-pin span { display: block; width: 28px; height: 28px; border-radius: 50% 50% 50% 0; background: #b3261e; border: 3px solid #fff; transform: rotate(-45deg); box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.map-where { margin-top: 8px; }
.map-help { margin-top: 6px; font-size: 13px; color: var(--muted); }
.map-help summary { cursor: pointer; }
.map-help ol { margin: 6px 0 0; padding-left: 20px; }
.leaflet-container { font: inherit; }

/* ---------- HP & tablet */
@media (max-width: 860px) {
  .shell, .shell.collapsed { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .18s; }
  .shell.open .side { box-shadow: 0 0 40px rgba(0,0,0,.18); }
  .shell.open .side { transform: none; }
  .shell.open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 30; }
  .collapsed .side .label, .collapsed .side .mod, .collapsed .side .who, .collapsed .side .brand small { display: revert; }
  .collapsed .nav a { justify-content: flex-start; padding: 0 10px; }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; background: var(--bg); padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .main { padding: 14px 14px 80px; }
  .toolbar label.field { flex: 1 1 140px; }
  td, th { padding: 8px 9px; }
  .hide-sm { display: none; }
  .toast { bottom: auto; top: 12px; }
  input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], input[type=tel], input[type=time], input[type=month], select { height: 42px; font-size: 16px; }
  textarea { font-size: 16px; }
  .det-grid { grid-template-columns: 1fr; }
  .mapbox { height: 260px; }
  .att-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .btn.xl { height: 68px; }
  .btn { height: 42px; }
  .btn.sm { height: 34px; }
  .overlay { padding: 0; place-items: end center; }
  .modal { border-radius: 16px 16px 0 0; max-height: 94vh; max-width: none; }
}
@media print { .side, .topbar, .toolbar, .btn { display: none !important; } .shell { display: block; } }

/* ---------- daftar akun baru + antrean persetujuan */
.login-alt { margin: 16px 0 0; text-align: center; font-size: 13.5px; color: var(--muted); }
.login-alt a { font-weight: 600; }
.trap { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.picked { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: 8px; background: #f7f6f2; }
.login .picked .btn { margin-top: 0; }
.nav a .badge, .tabs .badge { margin-left: auto; min-width: 20px; padding: 0 6px; height: 20px; line-height: 20px; border-radius: 999px; background: #c2410c; color: #fff; font-size: 12px; font-weight: 650; text-align: center; }
.tabs .badge { display: inline-block; margin-left: 6px; }
.collapsed .side .nav a .badge { display: none; }
.card.queue { border-color: #e3b77a; margin-bottom: 14px; }
.card.queue > h2 { margin: 0; padding: 12px 14px; font-size: 15px; background: var(--warn-bg); color: #5c3b00; border-radius: var(--radius) var(--radius) 0 0; }
.queue-foot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 12px; font-size: 13px; color: var(--muted); }
@media (max-width: 860px) { .collapsed .side .nav a .badge { display: revert; } }
.badge[hidden] { display: none !important; }
