/* NoviClinic till. Same colours and font as the website; laid out for a laptop at the counter. */

@font-face { font-family: "Satoshi"; src: url("/fonts/Satoshi-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url("/fonts/Satoshi-medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url("/fonts/Satoshi-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #f9f6f0;
  --black: #260e01;
  --primary: #772d08;
  --primary-soft: #f3e4da;
  --white: #ffffff;
  --ivory: #f3ebdd;
  --line: rgba(38, 14, 1, 0.14);
  --muted: rgba(38, 14, 1, 0.62);
  --good: #1f6b3a;
  --good-soft: #e3f1e6;
  --warn: #8a5a00;
  --warn-soft: #fbefd0;
  --bad: #b42318;
  --bad-soft: #fde7e5;
  --radius: 14px;
  --header: 60px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--black);
  font-family: "Satoshi", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 500;
  font-size: 15px;
  line-height: 1.4;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 26px; font-weight: 500; }
h2 { font-size: 20px; font-weight: 500; }
h3 { font-size: 16px; font-weight: 500; }
button, input, select, textarea { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--bad); }
.right { text-align: right; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.loading { padding: 40px; text-align: center; color: var(--muted); }
.stack { display: grid; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.hidden { display: none !important; }

/* ---------- controls ---------- */
input, select, textarea {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  background: var(--white);
}
textarea { height: auto; min-height: 70px; padding: 10px 12px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: var(--primary); }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.field { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.field > input, .field > select, .field > textarea { color: var(--black); font-size: 15px; }
label.check { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 42px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--white); cursor: pointer; white-space: nowrap;
  font-weight: 500; text-decoration: none;
}
.btn:hover { border-color: var(--primary); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--white); }
.btn.primary:hover { background: #5f2406; }
.btn.danger { color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.big { height: 54px; font-size: 17px; padding: 0 24px; }
.btn.block { width: 100%; }
.link { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--ivory); white-space: nowrap; }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.p { background: var(--primary-soft); color: var(--primary); }

.card { background: var(--white); border-radius: var(--radius); padding: 20px; }
.card.narrow { width: 100%; max-width: 420px; }
.notice { padding: 12px 14px; border-radius: 10px; background: var(--ivory); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- sign-in pages ---------- */
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; text-align: center; }
.center-page .card { padding: 36px 28px; }
.logo-lg { height: 40px; margin: 0 auto 24px; display: block; }
.staff-tiles { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 20px; }
.staff-tile { width: 140px; height: 96px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--white); cursor: pointer; font-size: 16px; }
.staff-tile:hover { border-color: var(--primary); }
.pin-dots { display: flex; gap: 12px; justify-content: center; margin: 18px 0; }
.pin-dots span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--primary); }
.pin-dots span.on { background: var(--primary); }
.keypad { display: grid; grid-template-columns: repeat(3, 72px); gap: 10px; justify-content: center; }
.keypad button { height: 60px; border-radius: 14px; border: 1px solid var(--line); background: var(--white); font-size: 22px; cursor: pointer; }
.keypad button:hover { border-color: var(--primary); }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-rows: var(--header) 1fr; height: 100vh; }
.topbar { display: flex; align-items: center; gap: 18px; padding: 0 20px; background: var(--white); border-bottom: 1px solid var(--line); }
.topbar img { height: 26px; }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav button { height: 38px; padding: 0 14px; border: 0; border-radius: 999px; background: none; cursor: pointer; }
.topbar nav button:hover { background: var(--ivory); }
.topbar nav button[aria-current="page"] { background: var(--primary); color: var(--white); }
.who { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.who strong { color: var(--black); font-weight: 500; }
.page { overflow: auto; padding: 24px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }

/* ---------- sell ---------- */
.sell { display: grid; grid-template-columns: minmax(0, 1fr) 420px; height: calc(100vh - var(--header)); }
.catalogue { display: flex; flex-direction: column; min-height: 0; padding: 18px 20px 0; gap: 12px; }
.scan { position: relative; }
.scan input { height: 52px; font-size: 17px; padding-left: 46px; border-radius: 999px; }
.scan svg { position: absolute; left: 16px; top: 15px; width: 22px; height: 22px; color: var(--muted); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.chip { height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); cursor: pointer; white-space: nowrap; font-size: 14px; }
.chip[aria-pressed="true"] { background: var(--black); border-color: var(--black); color: var(--white); }
.tiles { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; align-content: start; padding-bottom: 20px; }
.tile {
  display: flex; flex-direction: column; justify-content: space-between; gap: 8px;
  min-height: 92px; padding: 12px; text-align: left;
  border: 1px solid var(--line); border-radius: 12px; background: var(--white); cursor: pointer;
}
.tile:hover { border-color: var(--primary); }
.tile .name { font-size: 14px; line-height: 1.3; }
.tile .meta { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.tile .price { font-weight: 700; }
.empty { padding: 30px; text-align: center; color: var(--muted); }

.basket { display: flex; flex-direction: column; background: var(--white); border-left: 1px solid var(--line); min-height: 0; }
.basket-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.basket-lines { flex: 1; overflow-y: auto; }
.bline { padding: 12px 18px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; }
.bline .name { font-size: 14px; }
.bline .total { font-weight: 700; text-align: right; }
.bline .controls { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; }
.qty button { width: 32px; height: 30px; border: 0; background: none; cursor: pointer; font-size: 18px; }
.qty span { min-width: 26px; text-align: center; }
.basket-foot { padding: 16px 18px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.sum { display: flex; justify-content: space-between; }
.sum.total { font-size: 22px; font-weight: 700; margin-top: 4px; }
.basket-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.basket-actions .pay { grid-column: 1 / -1; }

/* ---------- tables ---------- */
.table-wrap { background: var(--white); border-radius: var(--radius); overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 13px; font-weight: 500; color: var(--muted); background: var(--white); position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--bg); }
tr.inactive td { opacity: 0.5; }
td.wrap { max-width: 360px; }

/* ---------- reports / cash up ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--white); border-radius: var(--radius); padding: 16px; }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 24px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.panels { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.panel h3 { padding: 14px 14px 0; }
.coins { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 12px; }
.coins label { display: grid; grid-template-columns: 48px 1fr; align-items: center; gap: 6px; font-size: 14px; }
.coins input { height: 36px; }
.diff.over { color: var(--good); }
.diff.short { color: var(--bad); }

/* ---------- modal ---------- */
dialog {
  border: 0; border-radius: 18px; padding: 0; width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 40px); color: var(--black); background: var(--white);
  box-shadow: 0 24px 60px rgba(38, 14, 1, 0.25);
}
dialog.wide { width: min(860px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(38, 14, 1, 0.4); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--white); z-index: 1; }
.modal-body { padding: 20px 22px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--white); }
.close { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--ivory); cursor: pointer; font-size: 20px; line-height: 1; }

.pay-total { text-align: center; padding: 6px 0 2px; }
.pay-total .big { font-size: 40px; font-weight: 700; font-variant-numeric: tabular-nums; }
.methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.methods button { height: 64px; border-radius: 14px; border: 1px solid var(--line); background: var(--white); cursor: pointer; font-size: 17px; }
.methods button[aria-pressed="true"] { border: 2px solid var(--primary); background: var(--primary-soft); }
.quick { display: flex; flex-wrap: wrap; gap: 8px; }
.change { text-align: center; padding: 14px; border-radius: 12px; background: var(--good-soft); color: var(--good); }
.change .big { font-size: 34px; font-weight: 700; }
.paylist { display: grid; gap: 6px; }
.paylist div { display: flex; justify-content: space-between; padding: 8px 12px; background: var(--bg); border-radius: 8px; }
.code-list { display: flex; flex-wrap: wrap; gap: 6px; }
.code-list .badge { font-size: 13px; padding: 3px 4px 3px 10px; display: inline-flex; align-items: center; gap: 4px; }
.code-list button { border: 0; background: none; cursor: pointer; font-size: 15px; line-height: 1; color: var(--muted); }

/* ---------- toasts ---------- */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 50; pointer-events: none; }
.toast { padding: 12px 18px; border-radius: 12px; background: var(--black); color: var(--white); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2); max-width: 520px; }
.toast.warn { background: var(--warn); }
.toast.bad { background: var(--bad); }

/* ---------- receipt (printed on an 80mm receipt printer, or A4) ---------- */
#print { display: none; }
.receipt { width: 72mm; margin: 0 auto; font-family: "Satoshi", system-ui, sans-serif; font-size: 12px; line-height: 1.35; color: #000; }
.receipt .center { text-align: center; }
.receipt h2 { font-size: 16px; margin-bottom: 2px; }
.receipt .rule { border-top: 1px dashed #000; margin: 8px 0; }
.receipt .rl { display: flex; justify-content: space-between; gap: 8px; }
.receipt .rl span:last-child { white-space: nowrap; }
.receipt .sub { padding-left: 10px; font-size: 11px; }
.receipt .tot { font-size: 15px; font-weight: 700; }
.receipt pre { font: inherit; white-space: pre-wrap; margin: 0; }

@media print {
  @page { margin: 4mm; }
  body { background: #fff; }
  #app, #toasts, dialog { display: none !important; }
  #print { display: block; }
  #print.report { font-size: 12px; }
  #print.report table { font-size: 12px; }
  #print.report th, #print.report td { padding: 4px 8px; }
}

@media (max-width: 1100px) {
  .sell { grid-template-columns: minmax(0, 1fr) 360px; }
  .topbar nav button { padding: 0 10px; }
}
