/* Plain, big and high-contrast: usable by anyone at a busy counter. */
:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #111111;
  --muted: #5b6270;
  --line: #d9dce1;
  --green: #12823b;
  --green-bg: #e3f5e9;
  --red: #c62828;
  --red-bg: #fdecec;
  --amber-bg: #fff6dc;
  --blue: #1f5fbf;
  --upi: #5b2fc0;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}
main { max-width: 980px; margin: 0 auto; padding: 16px; }
h1 { font-size: 26px; margin: 8px 0 16px; }
h2 { font-size: 19px; margin: 22px 0 10px; }
a { color: var(--blue); }
.muted { color: var(--muted); }
.center { text-align: center; }
.hint { color: var(--muted); font-size: 14px; margin: 4px 0 12px; }
.bad { color: var(--red); }
[hidden] { display: none !important; }

/* ---------------------------------------------------------- nav */
.nav {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  background: #1b1f27; color: #fff; padding: 8px 12px;
  position: sticky; top: 0; z-index: 10;
}
.nav .who { font-weight: 600; margin-right: auto; padding: 6px 4px; }
.nav a { color: #e6e8ec; text-decoration: none; padding: 9px 12px; border-radius: 8px; font-weight: 600; }
.nav a.on { background: #fff; color: #111; }
.nav a.logout { color: #ffb4b4; }

/* ------------------------------------------------------ controls */
input, select, textarea {
  width: 100%; font: inherit; padding: 12px; border: 2px solid var(--line);
  border-radius: 10px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); }
input[type=checkbox] { width: 24px; height: 24px; margin: 0; flex: none; }
button, .btn {
  display: inline-block; font: inherit; font-weight: 700; cursor: pointer;
  border: 0; border-radius: 10px; padding: 12px 18px; text-decoration: none;
  background: var(--blue); color: #fff; text-align: center;
}
button:disabled { opacity: .45; cursor: not-allowed; }
.big { display: block; width: 100%; font-size: 20px; padding: 18px; margin: 10px 0; }
.primary { background: var(--green); color: #fff; }
.secondary { background: #fff; color: var(--ink); border: 2px solid var(--line); }
.danger { background: var(--red); color: #fff; }
button.link { background: none; color: var(--muted); text-decoration: underline; display: block; margin: 4px auto; font-weight: 400; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 12px 0; }
.form label { display: block; font-weight: 600; margin: 0 0 14px; }
.form label input, .form label select, .form label textarea { margin-top: 6px; font-weight: 400; }
.form label.check { display: flex; gap: 10px; align-items: center; }
.form h2:first-of-type { margin-top: 0; }

.box { padding: 14px 16px; border-radius: 12px; margin: 12px 0; background: #eef2f8; font-weight: 600; }
.box.ok { background: var(--green-bg); color: #0b5a28; }
.box.error { background: var(--red-bg); color: var(--red); }
.box.warn { background: var(--amber-bg); color: #6b4e00; }

.login { max-width: 420px; margin: 40px auto; }
.login h1 { text-align: center; }

/* ------------------------------------------------------- counter */
.today {
  display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 14px; font-size: 15px; color: var(--muted);
}
.today b { color: var(--ink); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.tab { background: #fff; color: var(--ink); border: 3px solid var(--line); font-size: 20px; padding: 16px; }
.tab.on { border-color: var(--green); background: var(--green-bg); color: #0b5a28; }
.step-title { font-weight: 700; margin: 10px 0 8px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile {
  position: relative; background: #fff; color: var(--ink); border: 2px solid var(--line);
  min-height: 96px; padding: 12px; display: flex; flex-direction: column;
  justify-content: center; gap: 4px; text-align: center;
}
.tile.picked { border-color: var(--green); background: var(--green-bg); }
.tile .pname { font-size: 17px; }
.tile .pprice { font-size: 20px; }
.tile .pstock { font-size: 13px; font-weight: 400; color: var(--muted); }
.tile .badge {
  position: absolute; top: -8px; right: -8px; background: var(--green); color: #fff;
  min-width: 30px; height: 30px; border-radius: 15px; line-height: 30px; font-size: 16px;
}
.huge { font-size: 32px; font-weight: 700; text-align: center; padding: 14px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.quick button { background: #fff; color: var(--ink); border: 2px solid var(--line); flex: 1 0 80px; }

.bill .line { display: grid; grid-template-columns: 1fr auto 90px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.bill .lamt { text-align: right; font-weight: 700; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button { width: 44px; height: 44px; padding: 0; font-size: 24px; background: #fff; color: var(--ink); border: 2px solid var(--line); }
.stepper b { min-width: 24px; text-align: center; font-size: 19px; }
.total-row { display: flex; justify-content: space-between; font-size: 28px; font-weight: 800; padding-top: 12px; }

.collect { text-align: center; font-size: 22px; margin: 18px 0 6px; }
.collect b { display: block; font-size: 52px; line-height: 1.1; }
.paychoice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; }
.pay { font-size: 26px; padding: 30px 10px; line-height: 1.3; }
.pay.cash { background: var(--green); }
.pay.upi { background: var(--upi); }
.change { font-size: 24px; font-weight: 800; text-align: center; padding: 12px; border-radius: 10px; }
.change.good { background: var(--green-bg); color: #0b5a28; }
.change.bad { background: var(--red-bg); color: var(--red); }
.qr { display: block; width: 100%; max-width: 380px; margin: 10px auto; border: 2px solid var(--line); border-radius: 12px; background: #fff; }
.qr.small { max-width: 200px; margin: 0 0 12px; }
.steps { font-size: 18px; background: var(--amber-bg); border-radius: 12px; padding: 14px 14px 14px 36px; }
.steps li { margin: 4px 0; }

/* ------------------------------------------------------- receipt */
.saved { background: var(--green); color: #fff; font-size: 22px; padding: 18px; border-radius: 14px; text-align: center; margin: 8px 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions .big { flex: 1 1 200px; margin: 6px 0; }
.paper {
  background: #fff; max-width: 380px; margin: 16px auto; padding: 18px;
  border: 1px dashed #999; font-size: 15px; line-height: 1.5;
}
.paper .org { font-size: 18px; }
.paper hr { border: 0; border-top: 1px dashed #777; margin: 8px 0; }
.paper .spread, .spread { display: flex; justify-content: space-between; gap: 10px; }
.paper .grand { font-size: 20px; font-weight: 800; }
.paper.void { background: repeating-linear-gradient(-45deg, #fff, #fff 12px, #fdeaea 12px, #fdeaea 24px); }
.items { width: 100%; border-collapse: collapse; font-size: 14px; }
.items th, .items td { text-align: left; padding: 2px 4px 2px 0; }
.items th:nth-child(n+2), .items td:nth-child(n+2) { text-align: right; }
.danger-zone summary { cursor: pointer; font-weight: 700; color: var(--red); }

/* ------------------------------------------------------- lists */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filters label { flex: 1 1 140px; font-size: 14px; font-weight: 600; }
.filters input, .filters select { padding: 9px; margin-top: 4px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 12px 0; }
.stats div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.stats span { display: block; color: var(--muted); font-size: 14px; }
.stats b { font-size: 24px; }
.big-stats b { font-size: 30px; }
.stats .grand { background: var(--green-bg); border-color: var(--green); }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.list { width: 100%; border-collapse: collapse; }
.list th, .list td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.list th { background: #f0f1f4; font-size: 14px; }
.list tr.cancelled td { color: #999; text-decoration: line-through; }
.list tr.cancelled td .tag { text-decoration: none; }
.tag { display: inline-block; font-size: 13px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: #eee; }
.tag.cash { background: var(--green-bg); color: #0b5a28; }
.tag.upi { background: #ece5fb; color: var(--upi); }
.tag.bad { background: var(--red-bg); color: var(--red); }
.pager { display: flex; justify-content: center; gap: 20px; margin: 14px 0; font-weight: 600; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .collect b { font-size: 42px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
}

/* -------------------------------------------------------- print */
@media print {
  @page { margin: 4mm; }
  body { background: #fff; font-size: 12px; }
  .no-print, .nav, .actions, .saved, .box { display: none !important; }
  main { padding: 0; max-width: none; }
  .paper { border: 0; margin: 0; padding: 0; max-width: 76mm; font-size: 12px; }
  .paper.void { background: none; }
}
