/* ==========================================================================
   Pos Hijab - gaya dasar
   Nuansa buku kas: kertas hangat, garis tipis, angka rapi. Mobile dulu.
   ========================================================================== */

:root {
  --paper: #f6f1e8;
  --paper-2: #ede5d6;
  --card: #fffdf8;
  --ink: #27211c;
  --ink-2: #5d5249;
  --ink-3: #8b8076;
  --rule: #e0d6c6;
  --rule-2: #cdbfaa;

  --green: #27594c;
  --green-d: #1b3f35;
  --green-t: #e1ece5;
  --clay: #b4532f;
  --clay-t: #f6e4d9;
  --gold: #a87a1c;
  --gold-t: #f6ecd0;
  --red: #a8322a;
  --red-t: #f7dedb;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;

  --r: 10px;
  --bottom-h: 64px;
  --side-w: 236px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.45 var(--font);
  font-variant-numeric: tabular-nums lining-nums;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--bottom-h) + var(--safe-b) + 12px);
}
body.no-bottom-nav { padding-bottom: 0; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
.i { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.22em; }

/* ---------- Kerangka ---------- */
.side { display: none; }
.shell { min-height: 100vh; }
.m-logo { display: flex; justify-content: center; padding: 16px 16px 0; }
.m-logo img { height: 88px; width: auto; }
body.pos-body .m-logo { display: none; }
.page { padding: 20px 16px 28px; max-width: 760px; margin: 0 auto; }
.page > * + * { margin-top: 20px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.page-head > div:first-child { min-width: 0; }
h1 { font: 600 27px/1.15 var(--serif); letter-spacing: -0.01em; }
h2 { font: 600 19px/1.25 var(--serif); }
h3 { font-size: 15px; font-weight: 650; }
.eyebrow { font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.sub { color: var(--ink-2); font-size: 14.5px; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.pos-n { color: var(--green); }
.neg-n { color: var(--red); }
.right { text-align: right; }
@media (max-width: 899.98px) { .hide-m { display: none !important; } }

.stack > * + * { margin-top: 14px; }
.stack-s > * + * { margin-top: 8px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.mt { margin-top: 20px !important; }

/* ---------- Bilah bawah (HP) ---------- */
.bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--card); border-top: 1px solid var(--rule);
  height: calc(var(--bottom-h) + var(--safe-b)); padding-bottom: var(--safe-b);
}
.bottom a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--ink-3); font-size: 11.5px; font-weight: 600; position: relative;
}
.bottom a.is-active { color: var(--green); }
.bottom a.is-active:not(.is-main)::before {
  content: ""; position: absolute; top: -1px; left: 28%; right: 28%; height: 2px; background: var(--green);
}
.bottom .i { font-size: 22px; }
.bottom a.is-main .bottom-ic {
  display: grid; place-items: center; width: 50px; height: 38px; border-radius: 12px;
  background: var(--green); color: #fff; margin-top: -14px; border: 3px solid var(--paper);
}
.bottom a.is-main { color: var(--green); }

/* ---------- Komponen umum ---------- */
.card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); padding: 16px; }
.card-flat { background: transparent; border: 0; padding: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.section > .card-h, .section-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.section-h a, .more { font-size: 14px; color: var(--green); font-weight: 600; }
.rule-top { border-top: 1px solid var(--rule); padding-top: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: var(--r);
  border: 1px solid var(--rule-2); background: var(--card); color: var(--ink);
  font-weight: 650; font-size: 15px; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, transform .06s;
}
.btn:active { transform: translateY(1px); }
.btn:hover { border-color: var(--ink-3); }
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-d); border-color: var(--green-d); }
.btn-danger { color: var(--red); border-color: #dcb5b0; background: transparent; }
.btn-danger:hover { background: var(--red-t); border-color: var(--red); }
.btn-ghost { background: transparent; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn-block { display: flex; width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.linkish { background: none; border: 0; padding: 0; color: var(--green); font-weight: 600; cursor: pointer; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--rule-2); background: var(--card); cursor: pointer; flex: none;
}
.icon-btn .i { font-size: 18px; }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 650;
  background: var(--paper-2); color: var(--ink-2); white-space: nowrap; line-height: 1.5;
}
.badge-ok { background: var(--green-t); color: var(--green-d); }
.badge-warn { background: var(--gold-t); color: #7b5710; }
.badge-bad { background: var(--red-t); color: var(--red); }
.badge-clay { background: var(--clay-t); color: #8c3a1b; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 99px;
  border: 1px solid var(--rule-2); background: transparent; color: var(--ink-2); font-weight: 600; font-size: 14px; cursor: pointer;
}
.chip.is-on { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.flash {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  margin: 12px 16px 0; padding: 12px 14px; border-radius: var(--r); font-size: 15px; font-weight: 550;
  border: 1px solid; max-width: 728px;
}
.flash-ok { background: var(--green-t); border-color: #b9d3c3; color: var(--green-d); }
.flash-err { background: var(--red-t); border-color: #e6b8b3; color: #7d211b; }
.flash-info { background: var(--gold-t); border-color: #e6d49d; color: #6b4c10; }
.flash-x { background: none; border: 0; padding: 2px; cursor: pointer; color: inherit; opacity: .7; }

.empty { text-align: center; padding: 36px 16px; color: var(--ink-2); }
.empty h3 { font: 600 18px var(--serif); color: var(--ink); margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }
.empty-page { padding-top: 15vh; }
.empty-page h1 { margin-bottom: 8px; }

/* ---------- Form ---------- */
.field { display: block; }
.field > .lb, .lb { display: block; font-size: 13.5px; font-weight: 650; color: var(--ink-2); margin-bottom: 6px; }
.field .hint { display: block; font-size: 13px; color: var(--ink-3); margin-top: 5px; font-weight: 400; }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; border-radius: var(--r);
  border: 1px solid var(--rule-2); background: var(--card); font-size: 16px; appearance: none; -webkit-appearance: none;
}
.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1.5 5 5 5-5' fill='none' stroke='%238b8076' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}
.textarea { min-height: 84px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--green); outline-offset: 0; border-color: var(--green); }
.input::placeholder { color: #b0a595; }
.affix { display: flex; align-items: stretch; border: 1px solid var(--rule-2); border-radius: var(--r); background: var(--card); overflow: hidden; }
.affix:focus-within { outline: 2px solid var(--green); border-color: var(--green); }
.affix > span { display: grid; place-items: center; padding: 0 10px; color: var(--ink-3); font-weight: 600; background: var(--paper-2); font-size: 14px; }
.affix > span.post { order: 2; }
.affix .input { border: 0; border-radius: 0; outline: 0 !important; min-width: 0; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--green); flex: none; }
.check span small { display: block; color: var(--ink-3); font-size: 13px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--rule-2); border-radius: var(--r); overflow: hidden; background: var(--card); }
.seg label { cursor: pointer; text-align: center; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 11px 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); border-left: 1px solid var(--rule); }
.seg label:first-child span { border-left: 0; }
.seg input:checked + span { background: var(--ink); color: var(--paper); }
.seg input:focus-visible + span { outline: 2px solid var(--green); outline-offset: -2px; }
.form-actions { display: flex; gap: 10px; }
.form-actions .btn-primary { flex: 1; }
.form-section { padding-top: 18px; border-top: 1px solid var(--rule); }
.form-section > h2 { margin-bottom: 12px; }
.err-text { color: var(--red); font-size: 14px; }

/* ---------- Daftar bergaya buku kas ---------- */
.list { border-top: 1px solid var(--rule); }
.li { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--rule); min-height: 58px; }
a.li:active { background: var(--paper-2); }
.li-main { flex: 1; min-width: 0; }
.li-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-sub { font-size: 13.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-end { text-align: right; flex: none; }
.li-end strong { display: block; font-weight: 650; }
.li-end small { color: var(--ink-3); font-size: 13px; }
.day-head { display: flex; justify-content: space-between; padding: 14px 0 6px; font-size: 13px; font-weight: 650; color: var(--ink-2); letter-spacing: .02em; }
.day-head + .list { border-top-color: var(--rule-2); }
.thumb {
  width: 46px; height: 46px; border-radius: 8px; background: var(--paper-2); flex: none; overflow: hidden;
  display: grid; place-items: center; color: var(--ink-3); font: 600 18px var(--serif); border: 1px solid var(--rule);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-lg { width: 72px; height: 72px; border-radius: 10px; font-size: 26px; }

/* Tabel */
.table-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.t th { text-align: left; font-size: 12.5px; color: var(--ink-3); font-weight: 650; padding: 8px 8px 8px 0; border-bottom: 1px solid var(--rule-2); white-space: nowrap; }
.t td { padding: 10px 8px 10px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.t .r, .t th.r { text-align: right; padding-right: 0; }
.t tr.total td { font-weight: 700; border-top: 2px solid var(--ink); border-bottom: 0; }
.t tr.sub td { color: var(--ink-3); }
.ledger { width: 100%; border-collapse: collapse; }
.ledger td { padding: 9px 0; border-bottom: 1px solid var(--rule); }
.ledger td:last-child { text-align: right; white-space: nowrap; font-weight: 600; }
.ledger tr.strong td { font-weight: 700; border-bottom: 2px solid var(--ink); border-top: 1px solid var(--ink); }
.ledger tr.indent td:first-child { padding-left: 14px; color: var(--ink-2); }
.ledger tr.indent td:last-child { font-weight: 500; }

/* ---------- Angka ringkas ---------- */
.stats { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--rule-2); border-bottom: 1px solid var(--rule); }
.stat { padding: 14px 0; min-width: 0; }
.stat:nth-child(odd) { padding-right: 14px; border-right: 1px solid var(--rule); }
.stat:nth-child(even) { padding-left: 16px; }
.stat:nth-child(n+3) { border-top: 1px solid var(--rule); }
.stat-l { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.stat-v { font: 600 22px/1.2 var(--font); letter-spacing: -0.015em; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; }
.stat-s { font-size: 13px; color: var(--ink-3); margin-top: 1px; }
.stat-v.big { font: 600 30px/1.1 var(--serif); }
.stats-3 { grid-template-columns: repeat(3, 1fr); }
.stats-3 .stat:nth-child(n) { border-top: 0; border-right: 1px solid var(--rule); padding: 14px 10px; }
.stats-3 .stat:first-child { padding-left: 0; }
.stats-3 .stat:last-child { border-right: 0; }
.stats-3 .stat-v { font-size: 18px; }

/* ---------- Target / progres ---------- */
.goal { background: var(--card); border: 1px solid var(--rule-2); border-radius: 14px; padding: 18px 16px 16px; position: relative; }
.goal-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.goal-title { font: 600 19px/1.25 var(--serif); }
.goal-meta { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.goal-now { margin-top: 16px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.goal-now strong { font: 600 31px/1 var(--serif); letter-spacing: -0.02em; }
.goal-now span { color: var(--ink-3); font-size: 14.5px; }
.bar { position: relative; height: 12px; border-radius: 99px; background: var(--paper-2); margin-top: 14px; overflow: visible; }
.bar-fill { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--green); min-width: 12px; transition: width .5s ease; }
.bar-fill.is-clay { background: var(--clay); }
.bar-fill.is-gold { background: var(--gold); }
.bar-pace { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); opacity: .55; border-radius: 2px; }
.bar-ticks { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-3); margin-top: 6px; }
.goal-msg { margin-top: 12px; font-size: 15px; font-weight: 550; }
.goal-facts { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--rule-2); font-size: 14px; color: var(--ink-2); }
.goal-facts b { color: var(--ink); }
.goal-reward { margin-top: 12px; padding: 10px 12px; background: var(--gold-t); border-radius: 8px; font-size: 14px; color: #5f4410; }
.goal.is-done { border-color: var(--green); background: linear-gradient(0deg, var(--green-t), var(--green-t)) , var(--card); background-blend-mode: normal; }
.goal.is-done .goal-title::after { content: "Tercapai"; margin-left: 10px; font: 700 11px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--green-d); border: 1.5px solid var(--green-d); padding: 2px 6px; border-radius: 4px; vertical-align: 3px; }

/* ---------- Grafik batang ---------- */
.bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; align-items: end; height: 120px; padding-top: 8px; }
.bars .b { position: relative; height: 100%; display: flex; align-items: flex-end; }
.bars .b i { display: block; width: 100%; background: #b9cfc4; border-radius: 3px 3px 0 0; min-height: 2px; height: var(--h); }
.bars .b.is-today i { background: var(--green); }
.bars .b.is-zero i { background: var(--rule); }
.bars-x { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; font-size: 11px; color: var(--ink-3); text-align: center; margin-top: 5px; }
.bars-x .is-today { color: var(--green); font-weight: 700; }

/* ---------- Bottom sheet & modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(39, 33, 28, .45); z-index: 50; opacity: 0; pointer-events: none; transition: opacity .18s; }
.overlay.is-open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--paper);
  border-radius: 18px 18px 0 0; max-height: 92vh; max-height: 92dvh; display: flex; flex-direction: column;
  transform: translateY(105%); visibility: hidden; transition: transform .24s cubic-bezier(.2,.8,.2,1), visibility 0s .24s; box-shadow: none;
  max-width: 640px; margin: 0 auto;
}
.sheet.is-open { transform: translateY(0); visibility: visible; transition: transform .24s cubic-bezier(.2,.8,.2,1), visibility 0s; box-shadow: 0 -8px 30px rgba(39,33,28,.18); }
.sheet-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--rule); flex: none; }
.sheet-h h2 { font-size: 18px; }
.sheet-b { overflow-y: auto; padding: 14px 16px; flex: 1; overscroll-behavior: contain; }
.sheet-f { padding: 12px 16px calc(12px + var(--safe-b)); border-top: 1px solid var(--rule); background: var(--card); flex: none; }

/* ---------- Kasir ---------- */
body.pos-body { padding-bottom: 0; }
.pos-top { display: flex; align-items: center; gap: 10px; }
.pos-top h1 { font-size: 22px; flex: none; }
.pos-search { position: relative; flex: 1; }
.pos-search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.pos-search .input { padding-left: 38px; }
.pos-list { padding-bottom: 96px; }
.pos-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; cursor: pointer; min-height: 66px; }
.pos-item:active { background: var(--paper-2); }
.pos-item.is-out { opacity: .5; }
.pos-item .li-title { white-space: normal; display: block; overflow: visible; line-height: 1.3; }
.pos-qty { min-width: 26px; height: 26px; padding: 0 7px; border-radius: 99px; background: var(--green); color: #fff; font-size: 13px; font-weight: 700; display: inline-grid; place-items: center; margin-left: 6px; vertical-align: 1px; }
.cartbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 10px 16px calc(10px + var(--safe-b));
  background: var(--card); border-top: 1px solid var(--rule-2);
}
.cartbar .btn { width: 100%; min-height: 52px; justify-content: space-between; padding: 0 18px; font-size: 16px; }
.cartbar[hidden] { display: none; }
.cart-line { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.cart-line:first-child { padding-top: 0; }
.cart-line-top { display: flex; justify-content: space-between; gap: 10px; }
.cart-line-name { font-weight: 600; line-height: 1.3; }
.cart-line-name small { display: block; font-weight: 400; color: var(--ink-3); font-size: 13.5px; }
.cart-line-ctl { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--rule-2); border-radius: 10px; background: var(--card); }
.stepper button { width: 40px; height: 38px; display: grid; place-items: center; background: none; border: 0; cursor: pointer; border-radius: 10px; }
.stepper button:active { background: var(--paper-2); }
.stepper b { min-width: 30px; text-align: center; font-weight: 700; }
.price-in { width: 112px; min-height: 38px; padding: 4px 8px; text-align: right; font-size: 15px; }
.pay-quick { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.sum-rows > div { display: flex; justify-content: space-between; padding: 4px 0; color: var(--ink-2); }
.sum-rows > div.total { color: var(--ink); font: 600 24px/1.2 var(--serif); padding-top: 10px; margin-top: 6px; border-top: 1px solid var(--rule-2); }
.sum-rows .change { color: var(--green); font-weight: 650; }
.sum-rows .owed { color: var(--clay); font-weight: 650; }
.done-box { text-align: center; padding: 8px 0 4px; }
.done-box .mark { width: 56px; height: 56px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; margin: 0 auto 12px; }
.done-box .mark .i { font-size: 28px; stroke-width: 2.4; }
.done-box h2 { margin-bottom: 4px; }
.var-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--rule); }

/* ---------- Kalkulator HPP ---------- */
.calc-result { background: var(--ink); color: var(--paper); border-radius: 14px; padding: 18px 16px; }
.calc-result .eyebrow { color: #b8ad9f; }
.calc-big { font: 600 34px/1.1 var(--serif); letter-spacing: -0.02em; margin-top: 4px; }
.calc-result dl { margin: 14px 0 0; display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; font-size: 14.5px; }
.calc-result dt { color: #c9bfb1; }
.calc-result dd { margin: 0; text-align: right; font-weight: 600; }
.calc-result .warn { margin-top: 12px; color: #f3c6a8; font-size: 14px; }
.rep-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px; gap: 8px; align-items: center; margin-bottom: 8px; }
.rep-row .icon-btn { border-color: transparent; background: transparent; color: var(--ink-3); }
.var-edit { display: grid; grid-template-columns: 1fr 76px 40px; gap: 8px; align-items: end; margin-bottom: 10px; }
.var-edit .lb { margin-bottom: 4px; font-size: 12.5px; }
.var-edit .icon-btn { border-color: transparent; background: transparent; color: var(--ink-3); }
.margin-pill { display: inline-block; font-weight: 650; font-size: 13.5px; padding: 3px 9px; border-radius: 99px; background: var(--green-t); color: var(--green-d); }
.margin-pill.low { background: var(--gold-t); color: #7b5710; }
.margin-pill.neg { background: var(--red-t); color: var(--red); }

.photo-pick { display: flex; align-items: center; gap: 14px; }
.photo-pick .thumb { cursor: pointer; }
.photo-pick input[type=file] { font-size: 14px; max-width: 100%; }

/* ---------- Menu ---------- */
.menu-list a { display: flex; align-items: center; gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--rule); }
.menu-list a:first-child { border-top: 1px solid var(--rule); }
.menu-list .i { font-size: 22px; color: var(--green); }
.menu-list b { display: block; font-weight: 650; }
.menu-list small { color: var(--ink-3); font-size: 13.5px; }
.menu-list .chev { margin-left: auto; color: var(--ink-3); font-size: 16px; }

/* ---------- Halaman login ---------- */
body.plain { padding: 0; }
.auth { min-height: 100vh; display: grid; align-content: center; justify-items: center; padding: 28px 20px; }
.auth-box { width: 100%; max-width: 380px; }
.auth-box h1 { margin: 4px 0 6px; font-size: 30px; }
.auth-box .sub { margin-bottom: 22px; }
.auth-logo { width: min(210px, 68%); height: auto; margin: 0 auto 8px; }
body.plain .flash { max-width: 380px; margin: 12px auto 0; }

/* ---------- Struk ---------- */
.struk-wrap { max-width: 380px; margin: 0 auto; padding: 16px; }
.struk { background: #fff; border: 1px solid var(--rule); border-radius: 6px; padding: 18px 16px; font: 13.5px/1.45 "Courier New", ui-monospace, monospace; color: #111; }
.struk-logo { width: 108px; height: auto; margin: 0 auto 8px; }
.struk h1 { font: 700 17px var(--font); text-align: center; }
.struk .c { text-align: center; }
.struk hr { border: 0; border-top: 1px dashed #888; margin: 10px 0; }
.struk .r2 { display: flex; justify-content: space-between; gap: 8px; }
.struk .tot { font-weight: 700; font-size: 15px; }
.struk-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.struk-actions .btn { flex: 1; }

/* ---------- Desktop ---------- */
@media (min-width: 900px) {
  body { padding-bottom: 0; padding-left: var(--side-w); }
  body.plain { padding-left: 0; }
  .bottom { display: none; }
  .side {
    display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: var(--side-w);
    background: var(--card); border-right: 1px solid var(--rule); padding: 22px 14px 16px; z-index: 20;
  }
  .m-logo { display: none; }
  .brand { display: flex; justify-content: center; padding: 2px 8px 18px; }
  .brand-logo { width: auto; max-width: 168px; max-height: 148px; }
  .side nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
  .side nav a { display: flex; align-items: center; gap: 12px; padding: 10px 10px; border-radius: 8px; color: var(--ink-2); font-weight: 600; font-size: 15px; }
  .side nav a:hover { background: var(--paper); }
  .side nav a.is-active { background: var(--green-t); color: var(--green-d); }
  .side-foot { border-top: 1px solid var(--rule); padding: 14px 8px 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
  .who { font-size: 14px; color: var(--ink-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-foot .linkish { color: var(--ink-3); font-size: 14px; display: inline-flex; gap: 5px; align-items: center; }
  .page { padding: 36px 36px 48px; max-width: 980px; margin: 0; }
  .flash { margin: 20px 36px 0; }
  .hide-d { display: none !important; }
  h1 { font-size: 32px; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .stats .stat:nth-child(n) { border-top: 0; padding: 16px 18px; border-right: 1px solid var(--rule); }
  .stats .stat:first-child { padding-left: 0; }
  .stats .stat:last-child { border-right: 0; }
  .stats.stats-2 { grid-template-columns: repeat(2, 1fr); }
  .stats-3 { grid-template-columns: repeat(3, 1fr); }
  .cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 36px; align-items: start; }
  .cols > * + * { margin-top: 0; }
  .chips { margin-left: 0; margin-right: 0; padding: 2px 0 4px; flex-wrap: wrap; overflow: visible; }
  .bars { height: 150px; }
  .grid-d2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

  /* kasir dua kolom */
  body.pos-body .page { max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 32px; align-items: start; padding-right: 28px; }
  body.pos-body .page > * + * { margin-top: 0; }
  .pos-left > * + * { margin-top: 16px; }
  .pos-right { position: sticky; top: 24px; }
  body.pos-body .cartbar { display: none !important; }
  .pos-list { padding-bottom: 20px; }
  .sheet.cart-sheet { position: static; transform: none; max-height: none; border-radius: var(--r); box-shadow: none; border: 1px solid var(--rule-2); background: var(--card); max-width: none; }
  .sheet.cart-sheet .sheet-f { background: transparent; }
  .sheet.cart-sheet .sheet-h .icon-btn { display: none; }
  .overlay.cart-overlay { display: none; }
  .sheet.cart-sheet .sheet-b { max-height: calc(100vh - 330px); }
  .sheet { bottom: 50%; left: 50%; right: auto; width: 520px; transform: translate(-50%, 60%); opacity: 0; pointer-events: none; border-radius: 14px; max-height: 86vh; margin: 0; }
  .sheet.is-open { transform: translate(-50%, 50%); opacity: 1; pointer-events: auto; }
  .sheet.cart-sheet.is-open, .sheet.cart-sheet { opacity: 1; pointer-events: auto; visibility: visible; }
}

@media (min-width: 900px) and (max-height: 760px) {
  .sheet.cart-sheet .sheet-b { max-height: calc(100vh - 360px); }
}

@media print {
  .side, .bottom, .no-print, .flash { display: none !important; }
  body { background: #fff; padding: 0 !important; }
  .struk { border: 0; }
  .struk-wrap { padding: 0; }
}

/* ---------- Tambahan ---------- */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 90;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 99px; font-size: 14.5px; font-weight: 600;
  max-width: calc(100vw - 32px); text-align: center; box-shadow: 0 6px 20px rgba(39,33,28,.25);
}
.cols > * + * { margin-top: 20px; }
.calc-side { margin-top: 20px; scroll-margin-top: 12px; }
.calc-mini {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; display: flex; align-items: center; gap: 14px;
  padding: 10px 16px calc(10px + var(--safe-b)); background: var(--ink); color: var(--paper);
}
.calc-mini > div { flex: 1; min-width: 0; }
.calc-mini small { display: block; font-size: 11.5px; color: #b8ad9f; }
.calc-mini b { font-size: 15px; white-space: nowrap; }
.calc-mini .btn-primary { background: var(--paper); color: var(--ink); border-color: var(--paper); }
body.no-bottom-nav:has(.calc-mini) { padding-bottom: 76px; }

@media (min-width: 900px) {
  .calc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 36px; align-items: start; }
  .calc-side { position: sticky; top: 24px; margin-top: 0; }
  .calc-mini { display: none; }
  .cols > * + * { margin-top: 0; }
  .sheet.cart-sheet { width: auto; left: auto; bottom: auto; margin: 0; }
}
.calc-result .input { color: var(--ink); }
@media (min-width: 900px) { .page > form:not(#hform) { max-width: 640px; } .page > .stack { max-width: 640px; } .page > .card { max-width: 640px; } }
