/* Lapak Serba 10k v2 — tema kasir UMKM, brand via CSS var (white-label) */
:root {
  --brand: #e11d48;
  --brand-deep: #be123c;
  --brand-soft: #fde8ec;
  --brand-ink: #881337;
  --bg: #f5f5f4;
  --card: #ffffff;
  --ink: #1c1917;
  --mut: #79716b;
  --line: #e7e5e4;
  --ok: #15803d;
  --ok-soft: #dcfce7;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --bad: #b91c1c;
  --bad-soft: #fee2e2;
  --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45;
}
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- shell ---------- */
#shell { max-width: 520px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
header.top {
  position: sticky; top: 0; z-index: 40; background: var(--brand); color: #fff;
  padding: 12px 16px; display: flex; align-items: center; gap: 10px;
  border-radius: 0 0 16px 16px;
}
header.top .ttl { font-weight: 700; font-size: 17px; letter-spacing: .2px; }
header.top .sub { font-size: 12px; opacity: .85; }
header.top .sp { flex: 1; }
header.top .hbtn {
  background: rgba(255,255,255,.14); border: none; color: #fff; padding: 8px 10px;
  border-radius: 10px; font-size: 13px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 6px;
}
main { flex: 1; padding: 14px 14px calc(76px + env(safe-area-inset-bottom)); }
nav.tabs {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 520px; z-index: 50;
  background: var(--card); border-top: 1px solid var(--line);
  display: flex; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
nav.tabs a {
  flex: 1; text-align: center; text-decoration: none; color: var(--mut);
  font-size: 11px; font-weight: 600; padding: 4px 2px; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
nav.tabs a svg { width: 22px; height: 22px; }
nav.tabs a.on { color: var(--brand-deep); background: var(--brand-soft); }

/* ---------- umum ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.card h3 { font-size: 15px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.card h3 svg { width: 18px; height: 18px; color: var(--brand-deep); }
.row { display: flex; gap: 8px; align-items: center; }
.row .grow { flex: 1; }
.muted { color: var(--mut); font-size: 13px; }
.small { font-size: 12px; }
.big { font-size: 20px; font-weight: 800; }
hr.sep { border: none; border-top: 1px dashed var(--line); margin: 10px 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--brand); color: #fff; border: none; border-radius: 10px;
  padding: 11px 16px; font-weight: 700; font-size: 14px; cursor: pointer; width: 100%;
}
.btn:disabled { opacity: .55; }
.btn.ghost { background: var(--card); color: var(--brand-deep); border: 1px solid var(--brand-soft); }
.btn.soft { background: var(--brand-soft); color: var(--brand-ink); }
.btn.ok { background: var(--ok); }
.btn.sm { width: auto; padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn.danger { background: var(--bad); }
.btn svg { width: 17px; height: 17px; }

label.f { display: block; margin-bottom: 10px; }
label.f span { display: block; font-size: 12px; font-weight: 700; color: var(--mut); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .4px; }
input.i, select.i, textarea.i {
  width: 100%; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px;
  background: #fff; outline: none;
}
input.i:focus, select.i:focus, textarea.i:focus { border-color: var(--brand); }

.chip {
  display: inline-flex; align-items: center; gap: 5px; background: var(--bg);
  border: 1px solid var(--line); color: var(--mut); border-radius: 999px;
  padding: 6px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.chip.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); }
.chips { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.b-ok { background: var(--ok-soft); color: var(--ok); }
.b-warn { background: var(--warn-soft); color: var(--warn); }
.b-bad { background: var(--bad-soft); color: var(--bad); }
.b-brand { background: var(--brand-soft); color: var(--brand-ink); }
.b-mut { background: var(--bg); color: var(--mut); }

/* ---------- login ---------- */
.login-wrap { max-width: 380px; margin: 8dvh auto 0; padding: 0 18px; }
.login-hero { text-align: center; margin-bottom: 26px; }
.login-logo {
  width: 74px; height: 74px; margin: 0 auto 14px; border-radius: 22px;
  background: linear-gradient(135deg, var(--brand), var(--brand-ink));
  display: flex; align-items: center; justify-content: center; color: #fff;
  box-shadow: 0 10px 24px rgba(225, 29, 72, .35);
}
.login-logo svg { width: 38px; height: 38px; }
.login-hero h1 { font-size: 22px; }
.login-hero p { color: var(--mut); font-size: 14px; margin-top: 3px; }
.login-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: 0 6px 24px rgba(0,0,0,.05); }
.login-foot { text-align: center; margin-top: 16px; font-size: 12.5px; color: var(--mut); }
.login-foot a { color: var(--brand-deep); font-weight: 700; text-decoration: none; }

/* ---------- home ---------- */
.hello { padding: 4px 2px 12px; }
.hello h2 { font-size: 18px; }
.lapak-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.lapak-card {
  background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--brand);
  border-radius: var(--radius); padding: 13px 14px; display: block; text-decoration: none; color: inherit;
}
.lapak-card.done { border-left-color: var(--ok); }
.lapak-card .lc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lapak-card .lc-nama { font-weight: 800; font-size: 15.5px; }
.phase-track { display: flex; gap: 4px; margin-top: 9px; }
.phase-track i { height: 5px; flex: 1; border-radius: 99px; background: var(--line); }
.phase-track i.on { background: var(--brand); }
.phase-track i.all { background: var(--ok); }

/* ---------- stepper fase ---------- */
.stepper { display: flex; align-items: center; margin-bottom: 14px; }
.stepper .st { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; color: var(--mut); width: 56px; }
.stepper .st i {
  width: 26px; height: 26px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 12px;
}
.stepper .st.on i { background: var(--brand); border-color: var(--brand); color: #fff; }
.stepper .st.on { color: var(--brand-ink); }
.stepper .st.past i { background: var(--ok); border-color: var(--ok); color: #fff; }
.stepper .ln { height: 2px; flex: 1; background: var(--line); margin-bottom: 16px; }
.stepper .ln.on { background: var(--brand); }

/* ---------- spreadsheet table ---------- */
.sup-box { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; background: var(--card); }
.sup-box .sup-h {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px; font-weight: 800; font-size: 13.5px;
  border-left: 5px solid var(--dotc, var(--brand));
}
.sup-box .sup-h .n { margin-left: auto; font-size: 12px; color: var(--mut); font-weight: 600; }
.sup-row {
  display: grid; grid-template-columns: 34px 1fr 92px; gap: 8px; align-items: center;
  padding: 7px 10px; border-top: 1px solid var(--line); font-size: 14px;
}
.sup-row:nth-child(even) { background: #fafaf9; }
.sup-row .idx { color: var(--mut); font-size: 11.5px; font-weight: 700; }
.sup-row input.q {
  width: 100%; border: 1.5px solid var(--line); border-radius: 8px; padding: 7px 6px;
  text-align: center; font-weight: 700; font-size: 15px;
}
.sup-row input.q:focus { border-color: var(--brand); outline: none; }
.sup-row input.q.dirty { border-color: var(--warn); background: var(--warn-soft); }

/* ---------- etalase ---------- */
.hero {
  background: linear-gradient(135deg, var(--brand), var(--brand-ink)); color: #fff;
  border-radius: 0 0 22px 22px; padding: 26px 18px 22px; margin: -14px -14px 14px;
}
.hero h1 { font-size: 23px; letter-spacing: .2px; }
.hero p { opacity: .9; font-size: 13.5px; margin-top: 4px; }
.hero .stat { display: flex; gap: 18px; margin-top: 14px; }
.hero .stat b { font-size: 17px; display: block; }
.hero .stat span { font-size: 11.5px; opacity: .85; }
.grid-menus { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; }
.m-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; }
.m-thumb { aspect-ratio: 4/3; background: var(--bg); display: flex; align-items: center; justify-content: center; color: var(--mut); position: relative; }
.m-thumb img { width: 100%; height: 100%; object-fit: cover; }
.m-thumb svg { width: 30px; height: 30px; opacity: .5; }
.m-body { padding: 9px 10px 11px; }
.m-nama { font-weight: 700; font-size: 13.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.m-harga { color: var(--brand-deep); font-weight: 800; font-size: 14.5px; margin-top: 3px; }
.m-meta { font-size: 11px; color: var(--mut); margin-top: 2px; display: flex; align-items: center; gap: 4px; }
.m-meta svg { width: 12px; height: 12px; }

.sheet-bg { position: fixed; inset: 0; background: rgba(28,25,23,.45); z-index: 90; display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  background: var(--card); width: 100%; max-width: 520px; border-radius: 20px 20px 0 0;
  max-height: 88dvh; overflow-y: auto; padding: 16px 16px calc(20px + env(safe-area-inset-bottom));
}
.sheet .grab { width: 44px; height: 5px; border-radius: 99px; background: var(--line); margin: 0 auto 12px; }
.rev { border-top: 1px dashed var(--line); padding: 9px 0; }
.rev .who { font-weight: 700; font-size: 13px; display: flex; justify-content: space-between; }
.stars { color: #f59e0b; font-size: 12px; letter-spacing: 1px; }

/* ---------- dashboard bars ---------- */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding-top: 8px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bars .bar i { width: 100%; max-width: 34px; background: var(--brand); border-radius: 6px 6px 2px 2px; min-height: 3px; }
.bars .bar.low i { background: var(--brand-soft); }
.bars .bar span { font-size: 9.5px; color: var(--mut); font-weight: 600; }

/* ---------- toast ---------- */
#toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 84px; z-index: 99;
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px;
  font-size: 13.5px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s;
  max-width: 86vw; text-align: center;
}
#toast.show { opacity: 1; }
#toast.err { background: var(--bad); }
