/* ============================================================
   zhookaffie dashboard — operator SPA styles (brand tokens)
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; font-weight: 700; }
button { font: inherit; cursor: pointer; background: transparent; border: 0; color: inherit; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
input, select, textarea { font: inherit; color: var(--ink); font-size: 16px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; line-height: 1.15; }
.hidden { display: none !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px;
  background: var(--accent); color: var(--on-accent);
  border: 2px solid var(--ink); border-radius: var(--r-pill);
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  box-shadow: var(--pop-2);
  transition: transform .14s var(--snap), box-shadow .14s ease;
}
.btn:active { transform: translate(2px, 3px); box-shadow: 0 1px 0 var(--ink); }
.btn.ghost { background: var(--surface); color: var(--ink); }
.btn.inkbtn { background: var(--ink); color: var(--on-ink); }
.btn.sm { padding: 7px 14px; font-size: 13.5px; box-shadow: var(--pop); }
.btn.danger { background: var(--surface); color: var(--accent); }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 13px;
  background: var(--surface);
  border: 2px solid var(--ink); border-radius: var(--r-pill);
  font-family: var(--font-display); font-weight: 600; font-size: 13px;
  box-shadow: var(--pop);
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }

/* ---------- gate ---------- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 22px; }
.gate-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 2px solid var(--ink); border-radius: var(--r-lg);
  box-shadow: var(--pop-3);
  padding: 28px;
  text-align: center;
}
.gate-logo { height: 52px; margin: 0 auto 8px; }
.gate-tag {
  display: inline-block; padding: 4px 12px;
  background: var(--ink); color: var(--on-ink);
  border-radius: var(--r-pill);
  font-family: var(--font-display); font-weight: 700; font-size: 12px;
  margin-bottom: 16px;
}
.gate h1 { font-size: 24px; font-weight: 800; }
.gate-sub { color: var(--ink-60); font-size: 14px; margin: 8px 0 18px; }
.gate input {
  width: 100%; margin-bottom: 12px;
  background: var(--cream);
  border: 2px solid var(--ink); border-radius: var(--r-md);
  padding: 13px 14px;
}
.gate .btn { width: 100%; }
.gate-msg { margin: 14px 0 0; font-size: 14px; font-weight: 700; color: var(--accent); }
.gate-foot { margin: 18px 0 0; font-size: 13px; }

/* ---------- shell ---------- */
.dtop {
  display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap;
  background: var(--cream);
  border-bottom: 2px solid var(--ink);
  padding: 12px 16px;
  position: sticky; top: 0; z-index: 50;
}
.demo-pill { white-space: nowrap; }
.dlogo { height: 56px; } /* +3 sizes per client */
@media (max-width: 480px) { .dlogo { height: 44px; } }
.dtag {
  padding: 3px 10px;
  background: var(--accent); color: var(--on-accent);
  border-radius: var(--r-pill);
  font-family: var(--font-display); font-weight: 700; font-size: 11.5px;
}
.demo-pill {
  padding: 4px 12px;
  background: var(--ink); color: var(--on-ink);
  border-radius: var(--r-pill);
  font-family: var(--font-display); font-weight: 700; font-size: 11.5px;
}
.live-pill {
  padding: 4px 12px;
  background: var(--veg); color: #fff;
  border-radius: var(--r-pill);
  font-family: var(--font-display); font-weight: 700; font-size: 11.5px;
  white-space: nowrap;
}
.gate input + input { margin-top: -4px; }
.dspacer { flex: 1; }
.dwho { font-size: 13px; color: var(--ink-60); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.dout { font-family: var(--font-display); font-weight: 700; font-size: 13px; color: var(--accent); }
.dtabs {
  display: flex; gap: 8px;
  padding: 12px 16px 0;
  max-width: 1060px; margin: 0 auto; width: 100%;
  overflow-x: auto; scrollbar-width: none;
}
.dtabs::-webkit-scrollbar { display: none; }
.dtab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px;
  background: var(--surface);
  border: 2px solid var(--ink); border-radius: var(--r-pill);
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  box-shadow: var(--pop);
  white-space: nowrap;
}
.dtab[aria-current="page"] { background: var(--ink); color: var(--on-ink); }
.dbadge {
  min-width: 19px; height: 19px; padding: 0 5px;
  background: var(--accent); color: var(--on-accent);
  border-radius: var(--r-pill);
  font-size: 11.5px; line-height: 19px; text-align: center;
}
.dview { max-width: 1060px; margin: 0 auto; padding: 16px 16px 60px; }
.dhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 10px 0 14px; }
.dhead h2 { font-size: 22px; font-weight: 800; }
.dsub { font-size: 13px; color: var(--ink-60); margin: -8px 0 14px; }
.dtools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.dsearch {
  flex: 1; min-width: 180px; height: 42px; padding: 0 14px;
  background: var(--surface);
  border: 2px solid var(--ink); border-radius: var(--r-pill);
  box-shadow: var(--pop);
}

/* ---------- print queue ---------- */
.job {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface);
  border: 2px solid var(--ink); border-radius: var(--r-md);
  box-shadow: var(--pop);
  padding: 13px 14px;
  margin-bottom: 10px;
}
.job .jico { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; background: var(--accent-soft); border-radius: 11px; font-size: 19px; }
.job .jmeta { flex: 1; min-width: 0; }
.job .jname { font-family: var(--font-display); font-weight: 700; font-size: 14.5px; word-break: break-all; }
.job .jdetail { font-size: 12.5px; color: var(--ink-60); margin-top: 2px; }
.job .jact { display: flex; flex-direction: column; gap: 7px; align-items: flex-end; }
.jstatus {
  display: inline-block; padding: 3px 11px;
  border: 2px solid var(--ink); border-radius: var(--r-pill);
  font-family: var(--font-display); font-weight: 700; font-size: 11px;
}
.jstatus.new { background: var(--accent); color: var(--on-accent); }
.jstatus.paid { background: var(--ink); color: var(--on-ink); }
.jstatus.printing { background: var(--accent-soft); }
.jstatus.finished { background: var(--surface); color: var(--ink-60); }
.jstatus.confirmed { background: var(--ink); color: var(--on-ink); }
.jstatus.ready { background: var(--accent-soft); }
.jstatus.completed, .jstatus.cancelled { background: var(--surface); color: var(--ink-60); }
.oitems { font-size: 12.5px; color: var(--ink-60); margin-top: 4px; line-height: 1.5; }
.job .pb { vertical-align: 1px; }
.jprivacy { font-size: 11.5px; color: var(--ink-60); margin: 12px 2px 0; }

/* ---------- products ---------- */
.prow {
  display: flex; gap: 12px; align-items: center;
  background: var(--surface);
  border: 2px solid var(--ink); border-radius: var(--r-md);
  box-shadow: var(--pop);
  padding: 11px 13px;
  margin-bottom: 9px;
}
.prow.unpub { opacity: .55; }
.prow .pmeta { flex: 1; min-width: 0; }
.prow .pname { font-weight: 600; font-size: 14.5px; }
.prow .pdetail { font-size: 12.5px; color: var(--ink-60); }
.prow .pprice { font-family: var(--font-display); font-weight: 800; font-size: 15.5px; white-space: nowrap; }
.prow .pact { display: flex; gap: 6px; }
.pbadges { display: inline-flex; gap: 5px; margin-left: 6px; vertical-align: middle; }
.pb { font-size: 10px; font-family: var(--font-display); font-weight: 700; padding: 2px 7px; border-radius: var(--r-pill); border: 1.5px solid var(--ink); }
.pb.best { background: var(--accent); color: var(--on-accent); }
.pb.veg { border-color: var(--veg); color: var(--veg); }
.pb.out { background: var(--ink); color: var(--on-ink); }

/* ---------- categories ---------- */
.cgroup { margin-bottom: 20px; }
.cgroup h3 { font-size: 16px; font-weight: 800; margin-bottom: 9px; }
.crow {
  display: flex; gap: 8px 10px; align-items: center; flex-wrap: wrap;
  background: var(--surface);
  border: 2px solid var(--ink); border-radius: var(--r-md);
  box-shadow: var(--pop);
  padding: 10px 13px;
  margin-bottom: 8px;
}
.crow .cname { min-width: 120px; }
.crow.sub { margin-left: 26px; background: var(--accent-soft); }
.crow .cname { flex: 1; font-weight: 600; font-size: 14px; }
.crow .ccount { font-size: 12px; color: var(--ink-60); }

/* ---------- modal ---------- */
.dmodal {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(43, 16, 13, .58);
  display: flex; align-items: flex-end; justify-content: center;
}
@media (min-width: 640px) { .dmodal { align-items: center; padding: 24px; } }
.dmodal-card {
  width: min(560px, 100%);
  max-height: 92vh; overflow-y: auto;
  background: var(--cream);
  border: 2px solid var(--ink);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 22px;
}
@media (min-width: 640px) { .dmodal-card { border-radius: var(--r-lg); } }
.dmodal-card h3 { font-size: 20px; font-weight: 800; margin-bottom: 14px; }
.dfield { display: block; margin-bottom: 12px; }
.dfield > span { display: block; font-family: var(--font-display); font-weight: 700; font-size: 12.5px; margin-bottom: 5px; }
.dfield input, .dfield select {
  width: 100%;
  background: var(--surface);
  border: 2px solid var(--ink); border-radius: var(--r-md);
  padding: 11px 13px;
}
.dgrid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dchecks { display: flex; flex-wrap: wrap; gap: 14px; margin: 4px 0 14px; }
.dchecks label { display: inline-flex; gap: 7px; align-items: center; font-size: 14px; }
.dchecks input { accent-color: var(--accent); width: 17px; height: 17px; }
.dmodal-act { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 6px; }
.dempty { text-align: center; color: var(--ink-60); padding: 40px 14px; font-size: 14.5px; }
.dhead-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.csv-preview { margin: 6px 0 14px; background: var(--accent-soft); border-radius: var(--r-md); padding: 12px; }
.csv-preview p { margin: 0 0 8px; font-size: 13.5px; }
.csv-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.csv-tbl th, .csv-tbl td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.csv-tbl th { font-family: var(--font-display); font-weight: 700; color: var(--ink-60); }
.csv-preview .hidden { display: none; }

/* ---------- toasts ---------- */
.toasts {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 18px; z-index: 300;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  width: min(94vw, 480px); pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  background: var(--ink); color: var(--on-ink);
  border: 2px solid var(--ink); border-radius: var(--r-pill);
  box-shadow: var(--pop-2);
  padding: 10px 18px;
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  pointer-events: auto;
  animation: tin .25s var(--snap);
}
@keyframes tin { from { opacity: 0; transform: translateY(12px) scale(.92); } to { opacity: 1; transform: none; } }

/* ---------- POS ---------- */
.posgrid { display: grid; gap: 16px; grid-template-columns: 1fr; }
.pos-left .dsearch { width: 100%; }
/* stacked inputs used by POS customer + fulfil-style cards */
.faddr { display: flex; flex-direction: column; gap: 9px; }
.faddr input {
  width: 100%;
  background: var(--cream);
  border: 2px solid var(--ink); border-radius: var(--r-md);
  padding: 11px 13px; font-size: 14px;
}
.fulfil {
  background: var(--surface);
  border: 2px solid var(--ink); border-radius: var(--r-lg);
  box-shadow: var(--pop-2);
  padding: 16px;
}
.fulfil h3 { font-size: 16px; font-weight: 800; margin-bottom: 8px; }
.exp-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.exp-row label { display: flex; flex-direction: column; gap: 4px; font-family: var(--font-display); font-weight: 700; font-size: 12px; }
.exp-row input[type="date"] {
  background: var(--cream);
  border: 2px solid var(--ink); border-radius: 10px;
  padding: 8px 10px; font-size: 13.5px;
}
.dfoot {
  max-width: 1060px; margin: 30px auto 0; padding: 16px;
  border-top: 2px solid var(--ink);
  display: flex; flex-wrap: wrap; gap: 6px 22px;
  font-size: 12.5px; color: var(--ink-60);
}
.dfoot a { font-weight: 700; }
@media (min-width: 880px) { .posgrid { grid-template-columns: 1.4fr 1fr; align-items: start; } }
.pos-prods { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; max-height: 56vh; overflow-y: auto; padding: 2px; }
.pos-prod {
  display: flex; flex-direction: column; gap: 4px; text-align: left;
  background: var(--surface);
  border: 2px solid var(--ink); border-radius: var(--r-md);
  box-shadow: var(--pop);
  padding: 10px 11px;
  transition: transform .1s var(--snap);
}
.pos-prod:active { transform: scale(.95); }
.pp-name { font-size: 12.5px; font-weight: 600; line-height: 1.25; }
.pp-price { font-family: var(--font-display); font-weight: 800; font-size: 14px; color: var(--accent); }
.pos-right {
  background: var(--surface);
  border: 2px solid var(--ink); border-radius: var(--r-lg);
  box-shadow: var(--pop-2);
  padding: 14px;
  position: sticky; top: 76px;
}
.pos-right h3 { font-size: 16px; font-weight: 800; margin-bottom: 10px; }
.tk-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.tk-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; line-height: 1.2; }
.tk-name small { display: block; color: var(--ink-60); font-weight: 400; font-size: 11px; }
.tkstep { height: 28px; }
.tkstep button { width: 24px; }
.tk-amt { font-family: var(--font-display); font-size: 13.5px; white-space: nowrap; }
.tk-x { color: var(--accent); font-size: 13px; padding: 4px; }
.pos-tot { background: var(--accent-soft); border-radius: var(--r-md); padding: 10px 13px; margin-bottom: 12px; }
.trw { display: flex; justify-content: space-between; font-size: 13.5px; padding: 2px 0; }
.trw.big { font-family: var(--font-display); font-weight: 800; font-size: 17px; }

/* ---------- payment modal ---------- */
.paygrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.paybtn {
  background: var(--surface);
  border: 2px solid var(--ink); border-radius: var(--r-md);
  box-shadow: var(--pop);
  padding: 14px 6px;
  font-family: var(--font-display); font-weight: 700; font-size: 13.5px;
  text-align: center; line-height: 1.6;
  transition: transform .12s var(--snap);
}
.paybtn:active { transform: scale(.93); }

/* ---------- invoice ---------- */
.inv {
  background: #fff; color: #1a1a1a;
  border: 1.5px dashed var(--ink-40); border-radius: 8px;
  padding: 16px; margin: 8px 0 4px;
  font-family: 'DM Sans', system-ui, sans-serif; font-size: 12.5px;
  max-width: 360px;
}
.inv-head { text-align: center; line-height: 1.45; margin-bottom: 8px; }
.inv-head b { font-family: var(--font-display); font-size: 16px; }
.inv-meta { display: flex; justify-content: space-between; font-size: 11.5px; border-top: 1px dashed #bbb; border-bottom: 1px dashed #bbb; padding: 5px 0; margin-bottom: 6px; }
.inv-cust { font-size: 11.5px; margin-bottom: 6px; }
.inv-table { width: 100%; border-collapse: collapse; }
.inv-table th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; padding: 3px 2px; border-bottom: 1px solid #ddd; }
.inv-table td { padding: 4px 2px; font-size: 12px; border-bottom: 1px dotted #eee; vertical-align: top; }
.inv-tot { margin-top: 8px; }
.inv-tot .trw { font-size: 12px; }
.inv-tot .trw.big { font-size: 15px; border-top: 1px dashed #bbb; margin-top: 4px; padding-top: 6px; }
.inv-note { font-size: 10.5px; color: #777; margin: 4px 0; }
.inv-foot { text-align: center; margin-top: 10px; font-size: 11.5px; line-height: 1.6; }

@media print {
  body > * { display: none !important; }
  #modal { display: block !important; position: static !important; background: none !important; }
  #modal .dmodal-card { all: unset; display: block; }
  #modal .dmodal-card > *:not(#invPrint) { display: none !important; }
  #invPrint { display: block !important; border: 0; max-width: 80mm; margin: 0; }
}

/* ---------- reports ---------- */
.rep-open { border-width: 2.5px; }
.gst-master {
  background: var(--accent-soft);
  border: 2px solid var(--ink); border-radius: var(--r-md);
  padding: 12px 14px; margin-bottom: 12px;
  font-size: 14px;
}
.gst-master.off { background: var(--ink); color: var(--on-ink); }
.gst-master label { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.gst-master input { accent-color: var(--accent); width: 18px; height: 18px; }
.gst-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.gst-row span { flex: 1; }
.gst-row input { width: 72px; background: var(--cream); border: 2px solid var(--ink); border-radius: 10px; padding: 6px 9px; text-align: right; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
