/* =========================================================
   TokoKu Mobile — tampilan khusus layar HP (Android)
   ========================================================= */
:root{
  --bg:#f2f5f9; --surface:#fff; --surface-2:#f8fafc;
  --line:#e5eaf1; --line-strong:#d5dde8;
  --ink:#0f172a; --ink-2:#334155; --muted:#64748b; --muted-2:#94a3b8;
  --brand:#0f766e; --brand-2:#0d9488; --brand-3:#14b8a6; --brand-soft:#ccfbf1;
  --danger:#dc2626; --danger-soft:#fee2e2; --warn:#b45309; --ok:#047857;
  --radius:16px; --radius-sm:12px;
  --shadow:0 10px 26px -20px rgba(15,23,42,.45);
  --font:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  --tab-h:62px;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{height:100%}
body{
  margin:0;background:var(--bg);color:var(--ink);font-family:var(--font);
  font-size:15px;line-height:1.45;-webkit-font-smoothing:antialiased;
  overscroll-behavior-y:none;
}
h1,h2,h3,h4,p{margin:0}
button{font-family:inherit;font-size:inherit}
a{color:inherit;text-decoration:none}
input,select,textarea{font-family:inherit}
:focus-visible{outline:2px solid var(--brand-3);outline-offset:2px}
.hidden{display:none!important}
.num{font-variant-numeric:tabular-nums}
.right{text-align:right}
.muted{color:var(--muted)}
.sub{font-size:12.5px;color:var(--muted)}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}

/* ---------- Kerangka ---------- */
.app{min-height:100dvh;display:flex;flex-direction:column}
.appbar{
  position:sticky;top:0;z-index:40;
  display:flex;align-items:center;gap:.6rem;
  padding:calc(.55rem + env(safe-area-inset-top)) 1rem .6rem;
  background:rgba(242,245,249,.92);backdrop-filter:blur(12px);
  border-bottom:1px solid var(--line);
}
.appbar .titles{flex:1;min-width:0}
.appbar h1{font-size:1.14rem;font-weight:750;letter-spacing:-.015em;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.appbar p{font-size:12px;color:var(--muted);margin-top:1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.view{
  flex:1;width:100%;max-width:640px;margin:0 auto;
  padding:.9rem .9rem calc(var(--tab-h) + 34px + env(safe-area-inset-bottom));
}
.view.fade{animation:fade .2s ease-out}
@keyframes fade{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:none}}

/* ---------- Tombol ---------- */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:.4rem;
  min-height:44px;padding:0 1rem;border-radius:12px;border:1px solid transparent;
  font-size:.92rem;font-weight:650;cursor:pointer;white-space:nowrap;
  transition:filter .15s,background .15s,border-color .15s,transform .06s;
}
.btn:active{transform:scale(.985)}
.btn svg{width:18px;height:18px;flex:none}
.btn-primary{background:linear-gradient(180deg,#0d9488,#0f766e);color:#fff;box-shadow:0 10px 20px -14px rgba(13,148,136,1)}
.btn-outline{background:#fff;border-color:var(--line-strong);color:var(--ink-2)}
.btn-soft{background:var(--brand-soft);color:#0f766e}
.btn-ghost{background:transparent;color:var(--ink-2)}
.btn-danger{background:var(--danger);color:#fff}
.btn-danger-soft{background:var(--danger-soft);color:#991b1b}
.btn-block{width:100%}
.btn-sm{min-height:36px;padding:0 .7rem;font-size:.82rem;border-radius:10px}
.btn:disabled{opacity:.45;cursor:not-allowed;box-shadow:none}
.icon-btn{
  display:inline-grid;place-items:center;width:40px;height:40px;flex:none;
  border-radius:12px;border:1px solid transparent;background:transparent;color:var(--ink-2);cursor:pointer;
}
.icon-btn:active{background:#e9eef6}
.icon-btn svg{width:20px;height:20px}
.icon-btn.danger{color:var(--danger)}

/* ---------- Kartu ---------- */
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden}
.card + .card{margin-top:.75rem}
.card-head{display:flex;align-items:center;gap:.6rem;padding:.85rem 1rem;border-bottom:1px solid var(--line)}
.card-head h2{font-size:.95rem;font-weight:700;flex:1;min-width:0}
.card-head .link{font-size:.82rem;font-weight:650;color:var(--brand);background:none;border:0;padding:.25rem}
.card-body{padding:1rem}
.section-title{font-size:.72rem;text-transform:uppercase;letter-spacing:.1em;font-weight:800;color:var(--muted-2);margin:1.1rem .15rem .5rem}

/* ---------- Hero beranda ---------- */
.hero{
  position:relative;overflow:hidden;color:#e6fffb;
  background:radial-gradient(120% 120% at 100% 0%,#0d9488 0%,#0f766e 45%,#134e4a 100%);
  border-radius:20px;padding:1.05rem 1.1rem 1.1rem;
  box-shadow:0 18px 34px -26px rgba(15,118,110,.9);
}
.hero::after{
  content:"";position:absolute;right:-46px;top:-56px;width:170px;height:170px;border-radius:50%;
  background:rgba(255,255,255,.08);
}
.hero-top{display:flex;align-items:center;gap:.5rem;font-size:11.5px;color:#99f6e4}
.hero-date{margin-left:auto;color:#bff7ee}
.hero h1{font-size:1.3rem;font-weight:750;letter-spacing:-.02em;margin-top:.4rem;color:#fff}
.hero p{font-size:12.5px;color:#b6f2e9;margin-top:.15rem}
.hero-figures{display:flex;gap:1.4rem;margin-top:.95rem}
.hero-figures .fig{min-width:0}
.fig-label{font-size:10.5px;text-transform:uppercase;letter-spacing:.09em;color:#8ce8db;font-weight:700}
.fig-value{font-size:1.22rem;font-weight:750;letter-spacing:-.02em;line-height:1.3;font-variant-numeric:tabular-nums;white-space:nowrap}
.hero-money{font-size:2rem;font-weight:800;letter-spacing:-.03em;line-height:1.15;font-variant-numeric:tabular-nums;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hero-pill{display:inline-flex;align-items:center;gap:.3rem;background:rgba(255,255,255,.16);padding:.14rem .5rem;border-radius:99px;font-size:10.5px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}
.hero-pill svg{width:12px;height:12px}

/* ---------- Stat kecil ---------- */
.mini-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:.55rem;margin-top:.7rem}
.mini{background:#fff;border:1px solid var(--line);border-radius:14px;padding:.65rem .7rem;box-shadow:var(--shadow);min-width:0}
.mini .k{font-size:10px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mini .v{font-size:.98rem;font-weight:750;letter-spacing:-.02em;margin-top:.1rem;font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* ---------- Aksi cepat ---------- */
.quick{display:grid;grid-template-columns:repeat(4,1fr);gap:.55rem;margin-top:.75rem}
.quick a{
  display:flex;flex-direction:column;align-items:center;gap:.35rem;
  background:#fff;border:1px solid var(--line);border-radius:14px;padding:.7rem .3rem .6rem;
  font-size:11.5px;font-weight:650;color:var(--ink-2);box-shadow:var(--shadow);
}
.quick a:active{background:var(--surface-2)}
.quick .qi{width:36px;height:36px;border-radius:11px;display:grid;place-items:center}
.quick .qi svg{width:19px;height:19px}
.qi.teal{background:#ccfbf1;color:#0f766e}
.qi.blue{background:#dbeafe;color:#1d4ed8}
.qi.amber{background:#fef3c7;color:#b45309}
.qi.violet{background:#ede9fe;color:#6d28d9}

/* ---------- Daftar ---------- */
.list{display:flex;flex-direction:column}
.row{
  display:flex;align-items:center;gap:.75rem;padding:.75rem 1rem;
  border-top:1px solid var(--line);background:#fff;width:100%;border-left:0;border-right:0;border-bottom:0;
  text-align:left;color:inherit;cursor:pointer;font:inherit;
}
.list > .row:first-child{border-top:0}
.row:active{background:#f8fbfd}
button.row:disabled{opacity:.45;cursor:not-allowed}
.row-main{flex:1;min-width:0}
.row-title{font-size:.9rem;font-weight:650;letter-spacing:-.01em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.row-sub{font-size:12px;color:var(--muted);margin-top:.1rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.row-end{text-align:right;flex:none}
.row-amt{font-size:.9rem;font-weight:750;font-variant-numeric:tabular-nums;white-space:nowrap}
.row-amt.pos{color:var(--ok)}
.avatar{width:40px;height:40px;border-radius:12px;display:grid;place-items:center;flex:none}
.avatar svg{width:20px;height:20px}
.avatar.sale{background:#ccfbf1;color:#0f766e}
.avatar.buy{background:#dbeafe;color:#1d4ed8}

/* ---------- Badge & chip ---------- */
.badge{display:inline-flex;align-items:center;gap:.25rem;padding:.1rem .45rem;border-radius:99px;font-size:11px;font-weight:700;background:#eef2f7;color:#475569;white-space:nowrap}
.badge.ok{background:#dcfce7;color:#166534}
.badge.warn{background:#fef3c7;color:#92400e}
.badge.danger{background:#fee2e2;color:#991b1b}
.badge.info{background:#dbeafe;color:#1e40af}
.badge svg{width:12px;height:12px}
.rep-grid{display:grid;grid-template-columns:1fr 1fr;gap:.6rem}
.rep-stat{background:var(--surface-2);border:1px solid var(--line);border-radius:12px;padding:.6rem .7rem;min-width:0}
.rep-stat .k{display:block;font-size:10.5px;text-transform:uppercase;letter-spacing:.07em;font-weight:800;color:var(--muted)}
.rep-stat .v{display:block;font-size:.98rem;font-weight:750;letter-spacing:-.02em;margin-top:.15rem;font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rep-stat.teal{background:#f0fdfa;border-color:#99f6e4}
.rep-stat.teal .v{color:#0f766e}
.rep-stat.violet{background:#f5f3ff;border-color:#ddd6fe}
.rep-stat.violet .v{color:#6d28d9}
.rep-stat.blue{background:#eff6ff;border-color:#bfdbfe}
.rep-stat.blue .v{color:#1d4ed8}
.rep-stat.amber{background:#fffbeb;border-color:#fde68a}
.rep-stat.amber .v{color:#b45309}
.chips{display:flex;gap:.4rem;overflow-x:auto;padding:.15rem 0 .35rem;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.chips::-webkit-scrollbar{display:none}
.chip{
  flex:none;min-height:34px;padding:0 .8rem;border-radius:99px;border:1px solid var(--line-strong);
  background:#fff;color:var(--ink-2);font-size:.82rem;font-weight:600;cursor:pointer;display:inline-flex;align-items:center;gap:.3rem;
  white-space:nowrap;
}
.chip.active{background:var(--brand);border-color:var(--brand);color:#fff}
.chip svg{width:15px;height:15px}

/* ---------- Form ---------- */
.field{margin-bottom:.8rem}
.field:last-child{margin-bottom:0}
.field > label{display:block;font-size:.78rem;font-weight:700;color:var(--ink-2);margin-bottom:.3rem}
.field .hint{font-size:11.5px;color:var(--muted-2);margin-top:.25rem}
.input,.select,textarea.input{
  width:100%;min-height:48px;border-radius:12px;border:1px solid var(--line-strong);background:#fff;
  padding:.6rem .8rem;font-size:16px;color:var(--ink);
}
textarea.input{min-height:72px;resize:vertical;line-height:1.45}
.input:focus,.select:focus,textarea.input:focus{outline:none;border-color:var(--brand-3);box-shadow:0 0 0 3px rgba(20,184,166,.16)}
.input::placeholder{color:var(--muted-2)}
.input-money{font-variant-numeric:tabular-nums}
.input-group{position:relative;display:flex;align-items:center}
.input-group .prefix{position:absolute;left:.8rem;font-weight:650;color:var(--muted);pointer-events:none}
.input-group .input{padding-left:2.4rem}
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:.65rem}
.search{position:relative;margin-bottom:.7rem}
.search svg{position:absolute;left:.75rem;top:50%;transform:translateY(-50%);width:18px;height:18px;color:var(--muted-2);pointer-events:none}
.search .input{padding-left:2.4rem;min-height:46px;background:#fff}
.switch{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.7rem .85rem;background:var(--surface-2);border-radius:12px;border:1px solid var(--line)}
.switch b{font-size:.88rem;font-weight:650;display:block}
.switch small{font-size:11.5px;color:var(--muted)}
.switch input{width:22px;height:22px;accent-color:var(--brand-2)}

/* ---------- Keranjang ---------- */
.cart-item{display:flex;gap:.6rem;align-items:center;padding:.7rem 1rem;border-top:1px solid var(--line)}
.cart-item:first-child{border-top:0}
.cart-info{flex:1;min-width:0}
.cart-name{font-size:.88rem;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cart-meta{font-size:11.5px;color:var(--muted);margin-top:.08rem}
.stepper{display:flex;align-items:center;gap:.15rem;background:var(--surface-2);border:1px solid var(--line);border-radius:10px;padding:2px}
.stepper button{width:32px;height:32px;border:0;background:transparent;border-radius:8px;display:grid;place-items:center;color:var(--ink-2);cursor:pointer}
.stepper button:active{background:#e2e8f0}
.stepper button:disabled{opacity:.35}
.stepper svg{width:16px;height:16px}
.stepper .qty{min-width:30px;text-align:center;font-size:.85rem;font-weight:700;font-variant-numeric:tabular-nums}
.summary{padding:.85rem 1rem;border-top:1px solid var(--line);background:var(--surface-2);display:flex;flex-direction:column;gap:.5rem}
.sum-row{display:flex;align-items:center;justify-content:space-between;gap:1rem;font-size:.86rem;color:var(--ink-2)}
.sum-row.total{font-size:1.02rem;font-weight:750;color:var(--ink);border-top:1px dashed var(--line-strong);padding-top:.55rem;margin-top:.1rem}
.sum-row .v{font-variant-numeric:tabular-nums;font-weight:700}
.sum-row.total .v{font-size:1.12rem;color:var(--brand)}
.pay-box{background:#fff;border:1px solid var(--line);border-radius:12px;padding:.7rem .8rem;margin-top:.2rem}
.change-line{display:flex;justify-content:space-between;font-size:.85rem;margin-top:.5rem;font-weight:650}
.change-line.pos{color:var(--ok)}
.change-line.neg{color:var(--danger)}

/* ---------- Bar aksi bawah ---------- */
.actionbar{
  position:sticky;bottom:calc(var(--tab-h) + 10px + env(safe-area-inset-bottom));z-index:20;
  margin-top:.9rem;display:flex;gap:.7rem;align-items:center;
  background:rgba(255,255,255,.96);backdrop-filter:blur(10px);
  border:1px solid var(--line);border-radius:16px;padding:.6rem .7rem;
  box-shadow:0 16px 30px -22px rgba(15,23,42,.55);
}
.actionbar .total{flex:1;min-width:0}
.actionbar .total span{display:block;font-size:10.5px;text-transform:uppercase;letter-spacing:.07em;color:var(--muted);font-weight:700}
.actionbar .total b{font-size:1.05rem;font-variant-numeric:tabular-nums;letter-spacing:-.01em}
.actionbar .btn{flex:none;padding:0 1.15rem}

/* ---------- Navigasi bawah ---------- */
.tabbar{
  position:fixed;left:0;right:0;bottom:0;z-index:50;
  display:grid;grid-template-columns:repeat(5,1fr);align-items:end;
  height:calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding:0 .35rem env(safe-area-inset-bottom);
  background:rgba(255,255,255,.97);backdrop-filter:blur(14px);
  border-top:1px solid var(--line);
  box-shadow:0 -10px 26px -24px rgba(15,23,42,.6);
}
.tab{
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
  height:var(--tab-h);font-size:10.5px;font-weight:600;color:var(--muted-2);
  background:none;border:0;padding:0;cursor:pointer;position:relative;
}
.tab svg{width:22px;height:22px}
.tab.active{color:var(--brand)}
.tab .dot{position:absolute;top:9px;right:calc(50% - 17px);width:7px;height:7px;border-radius:50%;background:#f59e0b;border:1.5px solid #fff}
.tab-fab{display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:var(--tab-h);background:none;border:0;padding:0;cursor:pointer;font-size:10.5px;font-weight:700;color:var(--brand)}
.tab-fab .fab{
  width:56px;height:56px;border-radius:20px;display:grid;place-items:center;margin-top:-24px;
  background:linear-gradient(160deg,#14b8a6,#0f766e);color:#fff;
  box-shadow:0 12px 24px -10px rgba(13,148,136,.85),0 0 0 5px #fff;
}
.tab-fab .fab svg{width:26px;height:26px}
.tab-fab:active .fab{transform:scale(.96)}
.tab-fab span{margin-top:2px}

/* ---------- Sheet / modal ---------- */
.backdrop{position:fixed;inset:0;background:rgba(15,23,42,.45);z-index:80;animation:fadeIn .18s ease-out}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
.sheet{
  position:fixed;left:0;right:0;bottom:0;z-index:90;
  background:var(--surface);border-radius:22px 22px 0 0;
  max-height:92dvh;display:flex;flex-direction:column;
  box-shadow:0 -20px 50px -30px rgba(15,23,42,.7);
  animation:slideUp .24s cubic-bezier(.2,.9,.3,1);
  padding-bottom:env(safe-area-inset-bottom);
}
@keyframes slideUp{from{transform:translateY(16px);opacity:.6}to{transform:none;opacity:1}}
.sheet-grip{width:38px;height:4px;border-radius:99px;background:var(--line-strong);margin:.55rem auto .2rem;flex:none}
.sheet-head{display:flex;align-items:flex-start;gap:.5rem;padding:.35rem 1rem .7rem;flex:none}
.sheet-head .titles{flex:1;min-width:0}
.sheet-head h2{font-size:1.05rem;font-weight:750;letter-spacing:-.01em}
.sheet-head p{font-size:12px;color:var(--muted);margin-top:.1rem}
.sheet-body{padding:0 1rem 1rem;overflow:auto;-webkit-overflow-scrolling:touch}
.sheet-foot{
  display:flex;gap:.6rem;padding:.7rem 1rem calc(.8rem + env(safe-area-inset-bottom));
  border-top:1px solid var(--line);background:#fff;flex:none;
}
.sheet-foot .btn{flex:1}
.toast-root{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(var(--tab-h) + 26px + env(safe-area-inset-bottom));z-index:120;display:flex;flex-direction:column;gap:.4rem;width:min(92vw,420px);pointer-events:none}
.toast{
  display:flex;align-items:center;gap:.5rem;padding:.7rem .85rem;border-radius:12px;
  background:#0f172a;color:#f8fafc;font-size:.85rem;font-weight:600;
  box-shadow:0 14px 30px -18px rgba(15,23,42,.8);animation:toastIn .2s ease-out;
}
.toast svg{width:18px;height:18px;flex:none}
.toast.ok svg{color:#5eead4}
.toast.error{background:#7f1d1d}
.toast.error svg{color:#fecaca}
@keyframes toastIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}

/* ---------- Empty state ---------- */
.empty{text-align:center;padding:1.5rem 1.1rem}
.empty .ico{width:58px;height:58px;border-radius:18px;margin:0 auto .7rem;display:grid;place-items:center;background:var(--brand-soft);color:var(--brand)}
.empty .ico svg{width:28px;height:28px}
.empty h3{font-size:.95rem;font-weight:700}
.empty p{font-size:12.5px;color:var(--muted);margin-top:.2rem}
.empty .btn{margin-top:.8rem}

/* ---------- Info bar ---------- */
.info{display:flex;gap:.55rem;align-items:flex-start;padding:.7rem .85rem;border-radius:12px;background:#ecfdf5;border:1px solid #a7f3d0;color:#065f46;font-size:12.5px;margin-bottom:.75rem}
.info svg{width:17px;height:17px;flex:none;margin-top:1px}
.info.amber{background:#fffbeb;border-color:#fde68a;color:#92400e}
.info.blue{background:#eff6ff;border-color:#bfdbfe;color:#1e40af}

/* ---------- Nota / print ---------- */
.print-root{display:none}
.receipt{font-family:ui-monospace,"SFMono-Regular",Menlo,Consolas,monospace;font-size:12px;line-height:1.55;color:#111}
.receipt .r-center{text-align:center}
.receipt .r-title{font-size:14px;font-weight:700;margin-bottom:2px}
.receipt hr{border:0;border-top:1px dashed #94a3b8;margin:.55rem 0}
.receipt table{width:100%;border-collapse:collapse}
.receipt td{padding:1px 0;vertical-align:top}
.receipt .r-row{display:flex;justify-content:space-between;gap:.5rem}
.receipt .r-total{font-weight:700;font-size:13px}
.receipt .r-items{margin:.2rem 0}
.receipt .r-item-name{font-weight:600}
.receipt .r-item-sub{color:#334155}

/* ---------- Cetak ---------- */
@media print{
  body{background:#fff}
  .app,.tabbar,.toast-root,.backdrop,.sheet{display:none!important}
  .print-root{
    display:block!important;position:static;padding:0;margin:0;background:#fff;
  }
  .print-root .receipt{width:80mm;margin:0 auto;font-size:11px}
  .print-root .report{width:100%;padding:0 6mm;font-family:var(--font);font-size:11px}
  .print-root .report h1{font-size:15px;margin-bottom:2px}
  .print-root .report table{width:100%;border-collapse:collapse;margin-top:.5rem}
  .print-root .report th,.print-root .report td{border-bottom:1px solid #cbd5e1;padding:4px 6px;text-align:left;font-size:10.5px}
  .print-root .report th{background:#f1f5f9;font-size:10px;text-transform:uppercase;letter-spacing:.04em}
  .print-root .report .r{text-align:right}
  @page{margin:8mm}
}

/* ---------- Layar lebar (tablet) ---------- */
@media (min-width:720px){
  :root{--tab-h:66px}
  .view{max-width:720px;padding-left:1.2rem;padding-right:1.2rem}
  .hero{padding:1.3rem 1.35rem}
  .hero h1{font-size:1.5rem}
  .fig-value{font-size:1.4rem}
  .sheet{left:50%;right:auto;transform:translateX(-50%);width:min(560px,100%);border-radius:22px 22px 0 0}
}
@media (prefers-reduced-motion:reduce){
  *{animation:none!important;transition:none!important}
}
