:root {
  color-scheme: light;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #202836;
  background: #f1f3f6;
  --ink: #202836;
  --muted: #526071;
  --line: #d9dfe7;
  --accent: #194f9a;
  --accent-dark: #123c78;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select { font: inherit; }
button {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  min-height: 46px;
  padding: .55rem 1rem;
  cursor: pointer;
  font-weight: 650;
}
button:hover:enabled { background: #eef3f9; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 3px solid #4385de; outline-offset: 2px; }
.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.primary:hover:enabled { background: var(--accent-dark); }
.soft { background: #fff; border-color: #c6d8f2; color: var(--accent-dark); }
.plain { border-color: transparent; color: var(--accent-dark); padding-inline: .45rem; }
.full { width: 100%; }
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  background: #152238;
  color: #fff;
  padding: .6rem max(1rem, calc((100% - 1200px) / 2));
}
.header button { background: transparent; color: #e9eff8; border-color: transparent; }
.header button:hover:enabled, .header button[aria-current="page"] { background: #293c58; }
.header nav { display: flex; gap: .25rem; }
.header { flex-wrap: wrap; }
.operator-controls {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: #e9eff8;
  font-size: .9rem;
}
.brand { display: flex; align-items: center; gap: .65rem; white-space: nowrap; }
.brand-icon, .scanner-icon span {
  display: inline-block;
  background: linear-gradient(90deg, currentColor 0 9%, transparent 9% 19%, currentColor 19% 34%, transparent 34% 42%, currentColor 42% 48%, transparent 48% 58%, currentColor 58% 68%, transparent 68% 77%, currentColor 77% 92%, transparent 92% 96%, currentColor 96%);
}
.brand-icon { width: 24px; height: 17px; color: #a8ccff; }
main { max-width: 1200px; margin: auto; padding: 2.1rem 1rem; }
h1 { margin: 0 0 1rem; font-size: clamp(1.9rem, 4vw, 2.6rem); letter-spacing: -.04em; }
h2 { margin: 0 0 1rem; font-size: 1.2rem; letter-spacing: -.01em; }
p { margin: 0 0 1rem; color: var(--muted); }
.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: clamp(1rem, 3vw, 1.6rem);
  background: #fff;
  box-shadow: 0 4px 15px #15223808;
}
.scan-view { padding-top: clamp(.5rem, 3vh, 2rem); }
.scanner-panel { max-width: 620px; margin: 0 auto 1.25rem; padding: clamp(1.3rem, 4vw, 2rem); }
.scanner-icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin-bottom: 1.25rem;
  border-radius: 15px;
  background: #e8f0fc;
  color: var(--accent);
}
.scanner-icon span { width: 33px; height: 23px; }
form { display: grid; gap: .6rem; }
.scanner-panel form { margin-top: 1.8rem; }
label { font-weight: 650; font-size: .95rem; }
input:not([type="checkbox"]):not([type="radio"]), select {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border-radius: 9px;
  border: 1px solid #acb8c7;
  padding: .65rem .8rem;
  color: var(--ink);
  background: #fff;
}
form > button { justify-self: start; }
.row { display: flex; align-items: center; gap: .6rem; }
.row > button { flex-shrink: 0; }
.checkbox { display: flex; align-items: center; gap: .5rem; margin: .25rem 0; }
.notice, .shortfall {
  border-radius: 9px;
  padding: .75rem 1rem;
  background: #dff2e8;
  color: #17482e;
  overflow-wrap: anywhere;
}
.notice { margin-bottom: 1rem; }
.notice.error, .shortfall { background: #fff1db; color: #75380e; }
.shortfall { margin: .2rem 0 .75rem; }
.sale-heading, .balance-row, .total, .cart-actions, .list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
}
.sale-heading { margin-bottom: 1rem; }
.sale-heading h1 { margin-bottom: 0; }
.band-label { margin: 0 0 .2rem; overflow-wrap: anywhere; }
.sale-grid, .settings-grid { display: grid; gap: 1rem; align-items: start; }
.sale-grid { grid-template-columns: minmax(0, 1.3fr) minmax(340px, 1fr); }
.settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .65rem; }
.product-tile {
  min-height: 75px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: .25rem;
  overflow-wrap: anywhere;
}
.product-tile span, .secondary { color: var(--muted); font-size: .9rem; }
.balance-row { background: #e8f0fc; color: #153968; border-radius: 10px; padding: .8rem; margin-bottom: 1.35rem; }
.balance-row span, .balance-row strong { display: block; }
.balance-row strong { font-size: clamp(1.35rem, 4vw, 1.85rem); }
.cart-line { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(65px, auto); align-items: center; gap: .5rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.cart-line > :first-child { overflow-wrap: anywhere; }
.cart-line > :last-child { text-align: right; }
.quantity { display: flex; align-items: center; gap: .25rem; }
.quantity button { padding: .2rem; min-width: 34px; min-height: 34px; }
.quantity span { min-width: 2ch; text-align: center; }
.remove { font-size: .85rem; min-height: 30px; padding: .15rem .25rem; margin-top: .15rem; }
.total { padding: 1rem 0; font-size: 1.15rem; }
.cart-actions { margin-top: .55rem; }
.list-row { padding: .65rem 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.list-row:last-child { border-bottom: 0; }
.list-row p { margin: .2rem 0 0; }
.subtitle { margin-bottom: 1.2rem; }
.form-fields { display: grid; gap: .6rem; }
.form-fields p, .stock-form p { margin-bottom: 0; }
.catalog-title { margin-top: 1.4rem; }
.stock-form { margin-top: 1rem; padding: .85rem; background: #e8f0fc; border-radius: 10px; }
.stock-form label { margin-top: .2rem; }
.product-tile .stock-label { font-size: .85rem; }
.reports-heading, .report-filter {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: .65rem;
}
.reports-heading { justify-content: space-between; margin-bottom: 1rem; }
.reports-heading h2 { margin: 0; align-self: center; }
.report-filter label { display: block; margin-bottom: .2rem; }
.report-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; align-items: start; }
.report-card { min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: #f6f8fb; }
.report-card[data-report="sales"][open] { grid-column: 1 / -1; }
.report-card summary { cursor: pointer; padding: .9rem; color: var(--accent-dark); }
.report-card summary span { font-weight: 650; }
.report-card summary strong, .report-card summary small { display: block; }
.report-card summary strong { margin: .3rem 0; font-size: 1.55rem; color: var(--ink); }
.report-card summary small { color: var(--muted); font-size: .9rem; }
.report-entries { padding: 0 .9rem .6rem; }
.report-entries > div { border-top: 1px solid var(--line); }
.report-entries p { margin: .55rem 0; }
.report-entries .list-row strong { flex-shrink: 0; }
.report-breakdown { padding: 0 .9rem; }
.report-export {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: .55rem 1rem;
  margin-bottom: .45rem;
  border: 1px solid #c6d8f2;
  border-radius: 9px;
  background: #fff;
  color: var(--accent-dark);
  font-weight: 650;
  text-decoration: none;
}
.report-export:hover { background: #e8f0fc; }
.report-breakdown h3 { font-size: 1rem; margin: 1rem 0 .5rem; }
.report-table-wrap { overflow-x: auto; }
.report-table-wrap + .report-table-wrap { margin-top: 1rem; }
.drink-usage-note { margin: .5rem 0; }
.recipe-capacity { margin: 0; padding: 0; list-style: none; min-width: 12rem; }
.recipe-capacity li + li { margin-top: .35rem; }
.drink-plan { margin-top: 1rem; border-top: 1px solid var(--line); }
.drink-plan form { margin-bottom: .75rem; }
#drink-plan-inputs { display: grid; gap: .45rem; }
.drink-plan-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(6.5rem, 8rem);
  gap: .75rem;
  align-items: center;
  padding: .4rem 0;
  max-width: 34rem;
}
.drink-plan-row span { display: block; }
#drink-plan-status.shortfall { margin: .55rem 0; }
.plan-shortage { font-weight: 700; color: #75380e; }
.report-table-wrap table { width: 100%; min-width: 465px; border-collapse: collapse; text-align: left; }
.report-table-wrap caption { text-align: left; font-weight: 650; padding: .4rem 0 .6rem; }
.report-table-wrap th, .report-table-wrap td { vertical-align: top; padding: .6rem .5rem; }
.report-table-wrap thead { background: #e8f0fc; color: var(--accent-dark); }
.report-table-wrap tbody tr { border-bottom: 1px solid var(--line); }
.report-table-wrap tbody th { min-width: 7rem; overflow-wrap: anywhere; }
.report-table-wrap .secondary { margin-top: .2rem; }
.payment-methods {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  border: 0;
  padding: 0;
  margin: 0;
}
.payment-methods legend { margin-bottom: .45rem; font-weight: 650; }
.payment-methods label {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem .8rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
}
.payment-methods label:has(:checked) { background: #e8f0fc; border-color: #9ebce5; }
.payment-methods input { accent-color: var(--accent); margin: 0; }
#topup-hint { margin: .25rem 0; }
dialog {
  max-width: min(540px, calc(100vw - 2rem));
  width: 100%;
  max-height: 85vh;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.4rem;
  color: var(--ink);
  box-shadow: 0 12px 42px #0e142959;
}
dialog::backdrop { background: #13213880; }
.dialog-actions { justify-content: flex-end; margin-top: .6rem; }
#history-list ul { margin: .45rem 0 0; padding-left: 1.25rem; }
#history-list .list-row { align-items: flex-start; }
@media (max-width: 710px) {
  .sale-grid, .settings-grid, .report-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 430px) {
  .header { flex-wrap: wrap; }
  .header button { padding-inline: .6rem; }
  .cart-line { gap: .3rem; }
  .dialog-actions { flex-wrap: wrap; }
}
