/* Meridian: one stylesheet, two layouts (desktop counter / mobile).
   Look: Microsoft Dynamics / Fluent — Segoe UI, neutral greys, white surfaces, one blue accent, 2px corners. */
:root {
  --bg: #faf9f8; --card: #ffffff; --ink: #201f1e; --muted: #605e5c; --line: #edebe9; --field: #8a8886; --edge: #c8c6c4;
  --accent: #0078d4; --accent-dark: #106ebe; --accent-soft: #eff6fc; --navy: #0b2a4a;
  --warn-soft: #fff4ce; --warn-ink: #6b4f00;
  --danger: #a4262c; --danger-soft: #fde7e9; --ok: #107c10; --ok-soft: #dff6dd;
  --brand: var(--accent); --brand-dark: var(--accent-dark); --brand-soft: var(--accent-soft);
  --radius: 2px; --radius-lg: 4px; --gap: 16px;
  --display: "Segoe UI", "Segoe UI Web (West European)", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;
  --shadow-hard: 0 1.6px 3.6px rgba(0, 0, 0, .13), 0 .3px .9px rgba(0, 0, 0, .1);
  --shadow-deep: 0 6.4px 14.4px rgba(0, 0, 0, .13), 0 1.2px 3.6px rgba(0, 0, 0, .1);
  font-family: var(--display);
  font-size: 14px;
  color-scheme: light;
}
@media (max-width: 760px) { :root { font-size: 16px; } }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 2px; }
h1 { font-family: var(--display); font-size: 1.9rem; font-weight: 700; letter-spacing: 0; line-height: 1.15; margin: 0; }
h2 { font-family: var(--display); font-size: 1.15rem; font-weight: 700; letter-spacing: 0; margin: 0 0 .75rem; }
small { display: block; color: var(--muted); font-size: .8rem; }
kbd { font: 500 .7rem var(--display); border: 1px solid currentColor; border-radius: 5px; padding: 0 5px; opacity: .75; }
.muted { color: var(--muted); }
.error { color: var(--danger); }
.num { text-align: end; font-family: var(--display); font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.eyebrow { font: 500 .78rem var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 .4rem; }

/* Controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--accent); color: #fff; border: 1px solid var(--accent); border-radius: var(--radius); padding: .6rem 1.1rem; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-alt { background: #fff; color: var(--ink); border-color: var(--ink); }
.btn-alt:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-small { padding: .32rem .7rem; font-size: .85rem; }
.btn-block { display: flex; width: 100%; margin-top: var(--gap); text-align: center; }
.btn-block + .btn-block { margin-top: 8px; }
.link { background: none; border: 0; color: inherit; font: inherit; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); padding: .6rem .8rem; border: 1px solid var(--field); border-radius: var(--radius); background: #fff; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--warn-soft); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: auto; }
.form label { display: block; margin-bottom: .9rem; font-weight: 600; font-size: .9rem; }
.form label input { margin-top: .3rem; font-weight: 400; }
.narrow { max-width: 400px; }
.search { display: flex; gap: 8px; margin-bottom: var(--gap); align-items: stretch; }
.search input { flex: 1; font-size: 1.05rem; }
.search input[type=search]:first-child, .search input[name=q] { border-color: var(--ink); box-shadow: var(--shadow-hard); border-radius: var(--radius-lg); padding: .7rem 1rem; }
.pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--edge); border-radius: 2px; padding: .42rem 1rem; background: #fff; color: var(--ink); font-weight: 600; font-size: .9rem; text-decoration: none; white-space: nowrap; }
.pill:hover { background: var(--ink); color: #fff; }
.pill.on { background: var(--ink); color: #fff; }
.pill.go { background: var(--accent); border-color: var(--accent); color: #fff; }
.pill.go::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.pill.go:hover { background: var(--accent-dark); }

/* Content blocks */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; margin-bottom: var(--gap); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0; margin-bottom: 24px; border-top: 1px solid var(--edge); }
.tile { padding: 14px 16px 6px 0; }
.tile span { font: 500 .75rem var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.tile strong { display: block; font-family: var(--display); font-size: 1.9rem; font-weight: 700; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.table { width: 100%; border-collapse: collapse; background: transparent; }
.table th, .table td { padding: .6rem .6rem; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
.table th { font: 500 .72rem var(--display); color: var(--muted); text-transform: uppercase; letter-spacing: .12em; border-bottom: 1px solid var(--edge); }
.table th.num, .table td.num { text-align: end; }
.table tbody tr:hover td { background: #f3f2f1; }
.card .table th:first-child, .card .table td:first-child { padding-inline-start: 0; }
.card .table th:last-child, .card .table td:last-child { padding-inline-end: 0; }
.item header { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.item h2 { margin: 0; }
.price { font-family: var(--display); font-size: 2.4rem; font-weight: 700; letter-spacing: 0; margin: .4rem 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.chip { background: var(--accent-soft); color: var(--accent-dark); border-radius: 2px; padding: 2px 10px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.chip.warn, .tag { background: var(--warn-soft); color: var(--warn-ink); }
.tag { border-radius: 2px; padding: 2px 10px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.levels { margin: 0; padding-inline-start: 1.2rem; color: var(--muted); }
.messages { list-style: none; padding: 0; margin: 0 0 var(--gap); }
.msg { padding: .65rem .9rem; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-dark); border: 1px solid #c7e0f4; margin-bottom: 6px; font-weight: 600; }
.msg-error { background: var(--danger-soft); color: var(--danger); border-color: #f5c2bc; }
.msg-warning { background: var(--warn-soft); color: var(--warn-ink); border-color: #f4dc9a; }
.scan-video { width: 100%; max-height: 260px; object-fit: cover; border-radius: var(--radius-lg); margin-bottom: var(--gap); background: #000; cursor: pointer; }
.owe { color: var(--danger); }

/* Logo: green tile with a marigold dot (the shop's sign). */
.logo { display: inline-flex; align-items: center; gap: 10px; font: 700 1.5rem var(--display); letter-spacing: 0; color: var(--ink); text-decoration: none; }
.logo i { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); position: relative; flex: none; }
.logo i::after { content: ""; position: absolute; inset-inline-end: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }

/* ---- Desktop: header, command bar, tabs, ribbon (no sidebar) ---- */
.top { display: grid; grid-template-columns: 1fr minmax(0, 560px) 1fr; align-items: center; gap: 20px; padding: 14px 40px; }
.cmd { justify-self: stretch; display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--edge); border-radius: var(--radius-lg); padding: 10px 14px 10px 16px; font: inherit; color: var(--muted); text-align: start; box-shadow: var(--shadow-hard); cursor: text; }
.cmd span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd span::before { content: ""; display: inline-block; width: 11px; height: 11px; border: 2px solid currentColor; border-radius: 50%; margin-inline-end: 10px; vertical-align: -1px; }
.cmd kbd { background: var(--ink); color: #fff; border: 0; border-radius: 6px; padding: 2px 8px; opacity: 1; font-size: .72rem; }
.cmd:hover { box-shadow: var(--shadow-deep); }
.who { justify-self: end; position: relative; font-size: .9rem; color: var(--muted); }
.who summary { cursor: pointer; list-style: none; padding: 6px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.who summary::-webkit-details-marker { display: none; }
.who summary::after { content: " ▾"; }
.who-menu { position: absolute; inset-inline-end: 0; top: 100%; z-index: 20; background: #fff; border: 1px solid var(--edge); border-radius: var(--radius); box-shadow: var(--shadow-hard); padding: 6px; min-width: 190px; display: flex; flex-direction: column; }
.who-menu a, .who-menu .link { display: block; padding: 8px 10px; color: var(--ink); text-decoration: none; border-radius: 6px; text-align: start; width: 100%; }
.who-menu a:hover, .who-menu .link:hover { background: var(--bg); }
.who-menu form { margin: 0; }
.tabs { display: flex; gap: 34px; padding: 0 40px; border-bottom: 1px solid var(--edge); overflow-x: auto; scrollbar-width: none; }
.tabs a { font: 500 1.12rem var(--display); padding: 10px 0 12px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); box-shadow: inset 0 -5px 0 var(--accent); }
.ribbon { display: flex; gap: 10px; padding: 12px 40px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.page { padding: 26px 40px 48px; min-width: 0; max-width: 1600px; }
.page-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin-inline-end: auto; }
.page-head h1:empty { display: none; }

/* Command bar dialog (desktop and phone) */
.cmd-dialog { border: 1px solid var(--edge); border-radius: var(--radius-lg); padding: 0; width: min(620px, calc(100vw - 24px)); margin-top: 12vh; box-shadow: var(--shadow-deep); background: #fff; color: var(--ink); }
.cmd-dialog::backdrop { background: rgba(18, 18, 18, .35); }
.cmd-form input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; font-size: 1.15rem; padding: 16px 18px; box-shadow: none; }
.cmd-form input:focus { box-shadow: none; border-bottom-color: var(--ink); }
.cmd-list { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow: auto; }
.cmd-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.cmd-list li small { flex: none; }
.cmd-list li[aria-selected=true] { background: var(--warn-soft); }
.cmd-list li:hover { background: var(--bg); }
.cmd-hint { margin: 0; padding: 8px 18px 12px; font-size: .8rem; color: var(--muted); border-top: 1px solid var(--line); }

/* ---- Today (dashboard) ---- */
.page-home .page-head { display: none; }
.board { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 0; }
.board-main { padding-inline-end: 44px; border-inline-end: 1px solid var(--edge); min-width: 0; }
.board-side { padding-inline-start: 44px; min-width: 0; }
.board-side h2 { margin-top: 30px; font-size: 1.35rem; }
.hero-num { font: 700 clamp(3.5rem, 8vw, 7.5rem) var(--display); letter-spacing: 0; line-height: .95; margin: .2rem 0 .6rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hero-num .cur { font-size: .34em; letter-spacing: 0; vertical-align: .95em; margin-inline-end: .12em; }
.hero-sub { font-size: 1.15rem; color: var(--muted); margin: 0 0 28px; }
.hero-sub .profit { color: var(--accent); }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 190px; margin: 0; padding-bottom: 28px; position: relative; border-bottom: 1px solid var(--edge); }
.bars .bar { flex: 1; height: max(var(--h), 2px); background: var(--ink); border-radius: 4px 4px 0 0; position: relative; }
.bars .bar.today { background: var(--accent); }
.bars .bar:hover { background: var(--accent); }
.bars .bar span { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: .78rem; padding: 3px 8px; border-radius: 6px; white-space: nowrap; opacity: 0; pointer-events: none; z-index: 2; }
.bars .bar:hover span, .bars .bar:focus span { opacity: 1; }
.bars figcaption { position: absolute; bottom: 4px; inset-inline-start: 0; font-size: .8rem; color: var(--muted); }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 16px; margin: 18px 0 0; }
.split dt { font: 500 .72rem var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.split dd { margin: 0; font: 700 1.75rem var(--display); letter-spacing: 0; font-variant-numeric: tabular-nums; }
.small-split { margin-top: 30px; padding-top: 14px; border-top: 1px solid var(--line); }
.small-split dd { font-size: 1.2rem; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.rows li a { flex: 1; min-width: 0; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.05rem; }
.rows li a:hover { text-decoration: underline; }
.rows strong { font: 700 1.15rem var(--display); font-variant-numeric: tabular-nums; }

/* ---- Mobile layout: green header, big thumb buttons, bottom tabs ---- */
.ui-mobile { padding-bottom: 76px; }
.mob-head { position: sticky; top: 0; z-index: 5; background: var(--accent); color: #fff; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); }
.mob-bar { display: flex; align-items: center; gap: 12px; min-height: 40px; }
.mob-head .logo { color: #fff; font-size: 1.3rem; }
.mob-head .logo i { background: var(--accent); width: 24px; height: 24px; }
.mob-head .logo i::after { background: #fff; }
.mob-head h1 { font-size: 1.05rem; flex: 1; font-weight: 500; opacity: .9; text-align: end; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mob-find { background: none; border: 0; color: #fff; padding: 6px; margin-inline-end: -6px; cursor: pointer; display: grid; }
.mob-head-hero { position: static; border-radius: 0 0 24px 24px; padding-bottom: 22px; }
.mob-hero .eyebrow { color: #c7e0f4; margin-top: 14px; }
.mob-hero .hero-num { color: var(--accent); font-size: clamp(3rem, 15vw, 4.2rem); margin: 0 0 .3rem; }
.mob-hero .hero-sub { color: #deecf9; font-size: 1rem; margin: 0; }
.mob-main { padding: 16px; }
.mob-foot { text-align: center; font-size: .85rem; margin: 28px 0 8px; display: flex; gap: 16px; justify-content: center; }
.mob-foot a { color: var(--muted); }
.mob-tabs { position: fixed; bottom: 0; inset-inline: 0; z-index: 6; background: #fff; border-top: 1px solid var(--edge); display: grid; grid-template-columns: repeat(4, 1fr); padding-bottom: env(safe-area-inset-bottom); }
.mob-tabs a { text-align: center; padding: 15px 0 14px; text-decoration: none; color: var(--muted); font: 500 .95rem var(--display); }
.mob-tabs a.on { color: var(--ink); font-weight: 700; box-shadow: inset 0 4px 0 var(--accent); }
.mob-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.mob-actions:empty { display: none; }
.find-box { display: block; width: 100%; text-align: start; background: #fff; border: 1px solid var(--edge); border-radius: var(--radius-lg); box-shadow: var(--shadow-hard); padding: 14px 16px; font: inherit; font-size: 1.05rem; color: var(--muted); margin: 4px 0 10px; cursor: text; }
.thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0 18px; }
.thumbs a { display: flex; align-items: flex-end; min-height: 104px; padding: 14px 16px; background: #fff; color: var(--ink); border: 1px solid var(--edge); border-radius: 4px; box-shadow: var(--shadow-hard); font: 700 1.35rem var(--display); text-decoration: none; }
.thumbs a.go { background: var(--accent); }
.thumbs a:active { box-shadow: var(--shadow-hard); }
.more-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.more-links a { border: 1px solid var(--edge); border-radius: 2px; padding: 6px 13px; font-size: .88rem; font-weight: 600; color: var(--ink); text-decoration: none; background: #fff; }
.ui-mobile .tiles { grid-template-columns: 1fr 1fr; }
.ui-mobile .btn { padding: .75rem 1.1rem; }
.ui-mobile .page-head { display: none; }
.ui-mobile h1 { font-size: 1.05rem; }
.list { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }

/* Desktop layout in a small window still has to work. */
@media (max-width: 900px) {
  .top { grid-template-columns: auto 1fr; padding: 12px 16px; }
  .who { display: none; }
  .cmd span { font-size: .9rem; }
  .tabs, .ribbon { padding-inline: 16px; gap: 22px; }
  .ribbon { gap: 8px; }
  .page { padding: 18px 16px 40px; }
  .board { grid-template-columns: 1fr; }
  .board-main { padding: 0 0 24px; border: 0; border-bottom: 1px solid var(--edge); }
  .board-side { padding: 20px 0 0; }
}
@media print {
  .top, .tabs, .ribbon, .mob-head, .mob-tabs, .search, .cmd-dialog { display: none !important; }
}

/* ---- Forms, lists, misc ---- */
.field { margin-bottom: .9rem; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
.field small { margin-top: .25rem; }
.field-check { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.field-check label { order: 2; margin: 0; }
.field-check input { width: auto; order: 1; }
.field-check small { order: 3; flex-basis: 100%; }
.inline { display: inline-flex; align-items: flex-start; gap: 6px; }
.search .inline { white-space: nowrap; align-items: center; }
.inline input { margin-top: .2em; width: auto; }
.small { font-size: .85rem; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #8f1c13; border-color: #8f1c13; }
.link.danger { color: var(--danger); text-decoration: none; font-size: 1rem; }
.tile strong.small { font-size: 1.1rem; }
.cols { display: flex; gap: 24px; align-items: flex-start; }
.cols > .card { flex: 0 0 340px; }
.cols > .grow { flex: 1 1 auto; min-width: 0; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: var(--gap); }
.list a { text-decoration: none; color: inherit; flex: 1; min-width: 0; }
.list.flat { border: 0; background: transparent; }
.filters { display: flex; gap: 8px; margin-bottom: var(--gap); flex-wrap: wrap; align-items: center; }
.filters a { text-decoration: none; color: var(--ink); border: 1px solid var(--line); border-radius: 2px; padding: 4px 12px; font-size: .88rem; font-weight: 600; background: #fff; }
.filters a:hover { border-color: var(--ink); }
.filters a.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.filters select { width: auto; }
.pager { display: flex; justify-content: center; gap: 16px; margin: var(--gap) 0; }
.line-form { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto; gap: 10px; align-items: end; }
.line-form .field { margin: 0; }
.line-form small { display: none; }
.line-form .camera-btn { align-self: end; }
.line-form-3 { grid-template-columns: 2fr 1fr 1fr auto; }
.line-form-2 { grid-template-columns: 2fr 1fr auto; }
.table tfoot th { border-top: 1px solid var(--edge); border-bottom: 0; color: var(--ink); font-size: .85rem; }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: var(--gap); }
.quick a { background: var(--card); border: 1px solid var(--edge); border-radius: var(--radius); padding: 16px 6px; text-align: center; font-weight: 700; text-decoration: none; color: var(--ink); }
.print-frame { position: absolute; width: 0; height: 0; border: 0; visibility: hidden; }
.qty-form { display: inline; }
.qty-form .cell { width: 6.5rem; padding: .3rem .4rem; text-align: end; }
.count-scan input[type=text] { font-size: 1.2rem; }
tr.just-counted td { background: var(--accent-soft); }
.table-scroll { overflow-x: auto; }
.search input[type=date] { flex: 0 1 11rem; font-size: 1rem; box-shadow: none; border-color: var(--field); border-radius: var(--radius); }
.report-nav { border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.report-dates { flex-wrap: wrap; }
input[type=file] { padding: .5rem; }
.center { text-align: center; }
.roles .yes { color: var(--ok); font-weight: 800; }
.roles .no { color: var(--field); }
#id_stores { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: .3rem; }
#id_stores label { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; margin: 0; }
#id_stores input { width: auto; margin: 0; }
.camera-btn.on, [data-camera-scan].on { background: var(--danger); border-color: var(--danger); color: #fff; }
.warn-text { color: var(--warn-ink); font-weight: 600; }

/* ---- POS ---- */
.pos { display: grid; grid-template-columns: 1fr 340px; gap: var(--gap); align-items: start; }
.pos-cart { min-width: 0; }
.pos-scan input { font-size: 1.2rem; }
.pos-results { background: var(--card); border: 1px solid var(--edge); border-radius: var(--radius); margin-bottom: var(--gap); max-height: 320px; overflow: auto; box-shadow: var(--shadow-hard); }
.pos-results .result { display: flex; justify-content: space-between; width: 100%; padding: 10px 12px; background: none; border: 0; border-bottom: 1px solid var(--line); font: inherit; color: var(--ink); text-align: start; cursor: pointer; gap: 12px; }
.pos-results .result:hover, .pos-results .result:focus { background: var(--warn-soft); outline: none; }
.pos-results p { margin: 0; padding: 10px 12px; }
.pos-mode { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.toggle { background: #fff; border: 1px solid var(--edge); border-radius: 2px; padding: 4px 12px; font: inherit; font-size: .85rem; font-weight: 600; color: var(--ink); cursor: pointer; }
.toggle.on { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.pos-lines-wrap { max-height: calc(100vh - 260px); overflow: auto; }
.pos-lines { margin: 0; }
.pos-lines td { vertical-align: middle; padding-top: .7rem; padding-bottom: .7rem; }
.pos-lines .cell { width: 6.5rem; padding: .35rem .5rem; text-align: end; font-family: var(--display); font-weight: 500; }
.pos-lines input[readonly] { background: transparent; border-color: transparent; }
.pos-lines td:nth-child(2) .cell:not([readonly]) { border-color: var(--ink); }
.pos-lines tr.is-return td { background: var(--warn-soft); }
.pos-lines .line-total { font-family: var(--display); font-weight: 700; }
.no-disc .col-disc { display: none; }
.pos-empty { padding: 40px 24px; text-align: center; margin: 0; }
.pos-side { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 10px; }
.pos-side .card { margin: 0; }
.pos-customer small { display: block; }
.pos-customer .pos-results { position: relative; margin: 6px 0; }
.pos-totals div { display: flex; justify-content: space-between; padding: 3px 0; font-variant-numeric: tabular-nums; }
.pos-totals .grand { font: 700 2rem var(--display); letter-spacing: 0; border-top: 1px solid var(--edge); margin-top: 6px; padding-top: 8px; }
.btn-pay { font: 700 1.35rem var(--display); padding: 1rem; background: var(--accent); border-color: var(--ink); color: var(--ink); border-radius: var(--radius-lg); box-shadow: var(--shadow-hard); }
.btn-pay:hover { background: #106ebe; border-color: var(--ink); }
.btn-pay:active { box-shadow: var(--shadow-hard); }
.btn-pay:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-pay kbd { border-color: var(--ink); }
.btn kbd { border-color: currentColor; }
.pos-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.dialog { border: 1px solid var(--edge); border-radius: var(--radius-lg); padding: 22px; width: min(460px, calc(100vw - 32px)); box-shadow: var(--shadow-deep); color: var(--ink); }
.dialog::backdrop { background: rgba(18, 18, 18, .45); }
.dialog .due { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.1rem; }
.dialog .due strong { font: 700 2.3rem var(--display); letter-spacing: 0; font-variant-numeric: tabular-nums; }
.pay-methods label { display: grid; grid-template-columns: 7rem 1fr; gap: 8px; align-items: center; margin-bottom: 8px; font-weight: 600; }
.pay-methods label .ref { grid-column: 2; font-size: .85rem; padding: .35rem .6rem; }
.pay-methods input { font: 500 1.15rem var(--display); text-align: end; }
.quick-cash { display: flex; gap: 6px; margin: 4px 0 10px; flex-wrap: wrap; }
.pay-status { font: 700 1.25rem var(--display); text-align: end; color: var(--accent); }

/* Desktop POS: full screen, slim header, green till panel on the right. */
.top-slim { grid-template-columns: auto 1fr auto; padding: 10px 32px; border-bottom: 1px solid var(--edge); }
.top-slim .logo { font-size: 1.3rem; }
.top-where { color: var(--muted); }
.top-where a { color: var(--ink); }
.ui-desktop .page-pos { padding: 0; max-width: none; }
.ui-desktop .page-pos > .page-head { display: none; }
.ui-desktop .page-pos > .messages, .ui-desktop .page-pos > .net-banner { margin: 16px 32px 0; }
.ui-desktop .page-pos .pos { grid-template-columns: minmax(0, 1fr) clamp(340px, 30vw, 460px); gap: 0; align-items: stretch; min-height: calc(100vh - 56px); }
.ui-desktop .page-pos .pos-cart { padding: 24px 32px; }
.ui-desktop .page-pos .pos-lines-wrap { max-height: calc(100vh - 230px); }

@media (max-width: 900px) {
  .pos, .ui-desktop .page-pos .pos { grid-template-columns: 1fr; }
  .pos-side, .ui-desktop .page-pos .pos-side { position: static; height: auto; }
  .pos-lines-wrap { max-height: none; }
  .pos-lines .cell { width: 4.5rem; }
  .cols { flex-direction: column; align-items: stretch; }
  .cols > .card { flex: auto; }
  .line-form { grid-template-columns: 1fr 1fr; }
  .line-form .field:first-child { grid-column: 1 / -1; }
}
.ui-mobile .pos-lines th:nth-child(3), .ui-mobile .pos-lines td:nth-child(3),
.ui-mobile .pos-lines .col-disc { display: none; }
.ui-mobile .btn-pay { position: sticky; bottom: 84px; z-index: 3; }
.ui-mobile .pos-totals { border-color: var(--ink); }

/* ---- Offline POS ---- */
.net-banner { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 12px; margin-bottom: 10px; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.net-banner.is-offline { background: var(--warn-soft); color: var(--warn-ink); }
.net-banner.has-failed { background: var(--danger-soft); color: var(--danger); }
.net-banner span { flex: 1 1 auto; }
#failed-list li { flex-wrap: wrap; }
tr.row-error td { background: #fdf0ee; }
tr.row-warn td { background: #fef8e6; }

/* ---- Settings ---- */
.settings { display: grid; grid-template-columns: 220px 1fr; gap: 32px; align-items: start; }
.settings-nav { display: flex; flex-direction: column; border-top: 1px solid var(--edge); }
.settings-nav a { padding: 11px 2px; text-decoration: none; color: var(--muted); border-bottom: 1px solid var(--line); font-weight: 600; }
.settings-nav a:hover { color: var(--ink); }
.settings-nav a.on { color: var(--ink); box-shadow: inset 4px 0 0 var(--accent); padding-inline-start: 14px; }
.settings-body { max-width: 760px; margin: 0; }
.settings-form .field { max-width: 560px; }
.settings-form [id$="stock_rule"] > div, .settings-form [id$="label_size"] > div { margin: 4px 0; }
.settings-form [id$="stock_rule"] label, .settings-form [id$="label_size"] label { display: inline-flex; gap: 8px; align-items: center; font-weight: 400; }
.logo-preview img { max-width: 220px; max-height: 100px; border: 1px dashed var(--field); border-radius: 8px; padding: 6px; background: #fff; }
@media (max-width: 900px) {
  .settings { grid-template-columns: 1fr; gap: 16px; }
  .settings-nav { flex-direction: row; overflow-x: auto; border-top: 0; border-bottom: 1px solid var(--edge); }
  .settings-nav a { border-bottom: 0; white-space: nowrap; padding: 10px 12px; }
  .settings-nav a.on { box-shadow: inset 0 -4px 0 var(--accent); padding-inline-start: 12px; }
}
.table td a:not(.btn) { color: var(--ink); text-decoration-color: var(--field); }
.table td a:not(.btn):hover { text-decoration-color: var(--ink); }
.ui-mobile .search { flex-wrap: wrap; }
.ui-mobile .search input[type=search], .ui-mobile .search input[name=q] { flex: 1 0 100%; }
.ui-mobile .search .btn { flex: 1 1 auto; }
.inline-edit { display: flex; gap: 6px; align-items: center; max-width: 360px; }
.inline-edit input { padding: .35rem .6rem; }
.add-counter { margin-top: 16px; max-width: 560px; }
.link:disabled { opacity: .35; cursor: not-allowed; }
.pos-lines input.shade { display: block; margin-top: 4px; width: 100%; max-width: 240px; padding: .2rem .45rem; font-size: .82rem; border-style: dashed; }
.pos-lines input.shade:not(:placeholder-shown) { border-style: solid; border-color: var(--accent); color: var(--accent-dark); font-weight: 600; }
.pos-site { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: .85rem; }
.pos-site select { padding: .3rem .5rem; }
#cust-overdue { display: inline-block; margin: 4px 0; }
.chip.bad { background: var(--danger-soft); color: var(--danger); }
.side-forms { flex: 0 0 340px; min-width: 0; }
.side-forms .card { margin-bottom: var(--gap); }
.split.ageing { margin: 0 0 22px; max-width: 720px; }
.split.ageing dd { font-size: 1.35rem; }
details > summary.link { list-style: none; display: inline-block; margin-bottom: 8px; }
details > summary.link::-webkit-details-marker { display: none; }
details.bounce { display: inline-block; text-align: start; }
details.bounce form { min-width: 220px; }
@media (max-width: 900px) { .side-forms { flex: auto; } }
.report-dates select { width: auto; flex: 0 1 14rem; }
.bill-disc { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0 6px; font-weight: 400; margin: 0; }
.bill-disc input { width: 7.5rem; padding: .3rem .5rem; text-align: end; font-family: var(--display); }
.bill-disc em { font-style: normal; min-width: 5.5rem; text-align: end; font-variant-numeric: tabular-nums; }
.no-disc .bill-disc { display: none; }
.pos-lines .col-disc .cell { width: 6rem; }
.bill-share { display: block; color: var(--muted); font-size: .72rem; white-space: nowrap; }
.pos-order { display: flex; flex-direction: column; gap: 8px; }
.order-types { display: flex; gap: 6px; flex-wrap: wrap; }
.order-types .toggle { flex: 1; }
.kds { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-bottom: 28px; align-items: start; }
.kds-card { background: #fff; border: 1px solid var(--edge); border-radius: var(--radius-lg); box-shadow: var(--shadow-hard); padding: 14px; }
.kds-card header { display: flex; align-items: baseline; gap: 10px; border-bottom: 1px solid var(--edge); padding-bottom: 8px; }
.kds-card header strong { font: 700 2rem var(--display); }
.kds-card header span { flex: 1; font-weight: 600; }
.kds-card header em { font-style: normal; color: var(--muted); font-size: .85rem; }
.kds-card ul { list-style: none; margin: 10px 0 0; padding: 0; }
.kds-card li { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 1.1rem; }
.kds-card li small { color: var(--danger); font-weight: 600; font-size: .95rem; }
.addon-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr auto; gap: 8px; align-items: center; }
.addon-row input, .addon-row select { padding: .4rem .6rem; }
.addon-row span { display: flex; gap: 10px; align-items: center; white-space: nowrap; }
.table.addons td { padding-inline: 0; }
@media (max-width: 900px) { .addon-row { grid-template-columns: 1fr 1fr; } .addon-row input[name=name] { grid-column: 1 / -1; } }
.addon-list { display: block; font-size: .85rem; font-weight: 600; color: var(--accent-dark); }
.addon-btn { display: inline-block; margin: 2px 0; }
.addon-pick { display: flex; align-items: center; gap: 10px; padding: 12px 4px; border-bottom: 1px solid var(--line); font-size: 1.05rem; cursor: pointer; }
.addon-pick span { flex: 1; }
.addon-pick input { width: 20px; height: 20px; }
.settings-body h2 + .addon-row, .table-scroll + h2 { margin-top: 18px; }


/* ================= Fluent / Dynamics look ================= */
body { font-size: 1rem; line-height: 1.43; }
a { color: var(--accent-dark); }
h1 { font-size: 1.45rem; font-weight: 600; }
h2 { font-size: 1.07rem; font-weight: 600; }
kbd { font: 600 .72rem var(--display); border-radius: 2px; }
.num { font-family: var(--display); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.eyebrow { font: 600 .86rem var(--display); letter-spacing: 0; text-transform: none; color: var(--muted); }

/* Buttons and fields */
.btn { background: var(--accent); border: 1px solid var(--accent); border-radius: 2px; padding: .43rem 1.15rem; min-height: 32px; font-weight: 600; }
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-alt { background: #fff; color: var(--ink); border-color: var(--field); }
.btn-alt:hover { background: #f3f2f1; color: var(--ink); border-color: var(--field); }
.btn-small { padding: .2rem .7rem; min-height: 26px; }
.btn-danger { background: var(--danger); border-color: var(--danger); }
input, select, textarea { border: 1px solid var(--field); border-radius: 2px; padding: .42rem .6rem; min-height: 32px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
input[type=checkbox], input[type=radio] { min-height: 0; }
.search input[type=search]:first-child, .search input[name=q] { border-color: var(--field); box-shadow: none; border-radius: 2px; padding: .42rem .7rem; }
.search input { font-size: 1rem; }
.field label, .form label { font-weight: 600; }

/* App bar, navigation, command bar */
.top { background: var(--navy); color: #fff; padding: 0 20px; min-height: 48px; grid-template-columns: 1fr minmax(0, 520px) 1fr; }
.logo { color: #fff; font: 600 1.15rem var(--display); gap: 10px; }
.logo i { width: 20px; height: 20px; border-radius: 50%; background: transparent; border: 2px solid #fff; }
.logo i::after { inset: -4px auto -4px 50%; width: 2px; height: auto; margin-inline-start: -1px; border-radius: 0; background: #fff; }
.cmd { background: rgba(255, 255, 255, .14); border: 1px solid transparent; border-radius: 2px; box-shadow: none; color: #fff; padding: 5px 10px; min-height: 32px; }
.cmd:hover { background: rgba(255, 255, 255, .22); box-shadow: none; }
.cmd kbd { background: transparent; border: 1px solid rgba(255, 255, 255, .5); color: #fff; }
.who { color: #fff; }
.who-menu { border: 1px solid var(--line); border-radius: 2px; box-shadow: var(--shadow-deep); color: var(--ink); }
.who-menu a:hover, .who-menu .link:hover { background: #f3f2f1; }
.tabs { background: #fff; gap: 4px; padding: 0 12px; border-bottom: 1px solid var(--line); }
.tabs a { font: 400 1rem var(--display); padding: 11px 12px; color: var(--ink); }
.tabs a:hover { background: #f3f2f1; }
.tabs a.on { font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
.ribbon { background: #f3f2f1; gap: 2px; padding: 4px 12px; border-bottom: 1px solid var(--line); }
.pill { border: 0; border-radius: 2px; background: transparent; padding: .42rem .8rem; font-weight: 400; font-size: 1rem; }
.pill:hover { background: #e1dfdd; color: var(--ink); }
.pill.on { background: #fff; color: var(--accent-dark); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
.pill.go { background: var(--accent); color: #fff; font-weight: 600; }
.pill.go::before { display: none; }
.pill.go:hover { background: var(--accent-dark); color: #fff; }
.top-slim { background: var(--navy); border-bottom: 0; padding: 0 20px; min-height: 44px; grid-template-columns: auto 1fr auto; }
.top-slim .pill { color: #fff; border: 1px solid rgba(255, 255, 255, .5); }
.top-slim .pill:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.top-where, .top-where a { color: #fff; }
.page { padding: 18px 24px 40px; }
.page-head { margin-bottom: 14px; }

/* Surfaces */
.card { border: 1px solid var(--line); border-radius: 2px; box-shadow: var(--shadow-hard); padding: 16px; }
.tiles { border-top: 0; gap: 12px; }
.tile { background: #fff; border: 1px solid var(--line); border-inline-start: 4px solid var(--accent); border-radius: 2px; box-shadow: var(--shadow-hard); padding: 12px 14px; }
.tile span { font: 600 .86rem var(--display); letter-spacing: 0; text-transform: none; }
.tile strong { font-size: 1.85rem; font-weight: 600; }
.table th { font: 600 .86rem var(--display); text-transform: none; letter-spacing: 0; color: var(--muted); border-bottom: 1px solid var(--edge); }
.table th, .table td { padding: .5rem .6rem; }
.table tbody tr:hover td { background: #f3f2f1; }
.table tfoot th { border-top: 1px solid var(--edge); }
.table td a:not(.btn) { color: var(--accent-dark); text-decoration: none; }
.table td a:not(.btn):hover { text-decoration: underline; }
.chip, .tag { border-radius: 2px; background: var(--accent-soft); color: var(--accent-dark); }
.chip.warn, .tag { background: var(--warn-soft); color: var(--warn-ink); }
.chip.bad { background: var(--danger-soft); color: var(--danger); }
.msg { border-radius: 2px; background: var(--ok-soft); color: #0b5a0b; border: 0; font-weight: 400; }
.msg-error { background: var(--danger-soft); color: var(--danger); }
.msg-warning { background: var(--warn-soft); color: var(--warn-ink); }
.list { border-radius: 2px; box-shadow: var(--shadow-hard); }
.filters a { border: 1px solid var(--edge); border-radius: 2px; font-weight: 400; padding: 3px 12px; }
.filters a.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); font-weight: 600; }
.price { font-size: 2rem; font-weight: 600; }
.dialog, .cmd-dialog { border: 0; border-radius: 4px; box-shadow: var(--shadow-deep); }
.cmd-list li[aria-selected=true] { background: var(--accent-soft); }
.settings-nav { border-top: 0; }
.settings-nav a.on { color: var(--accent-dark); box-shadow: inset 3px 0 0 var(--accent); background: #fff; }
.toggle { border: 1px solid var(--field); border-radius: 2px; font-weight: 400; }
.toggle.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Home */
.board-main { border-inline-end: 1px solid var(--line); padding-inline-end: 28px; }
.board-side { padding-inline-start: 28px; }
.board-side h2 { font-size: 1.07rem; }
.hero-num { font: 600 clamp(2.4rem, 4.2vw, 3.4rem) var(--display); line-height: 1.1; color: var(--accent-dark); }
.hero-num .cur { vertical-align: .55em; color: var(--muted); }
.hero-sub { font-size: 1rem; margin-bottom: 18px; }
.hero-sub .profit { color: var(--ok); }
.bars { height: 150px; border-bottom: 1px solid var(--edge); }
.bars .bar { background: #c7e0f4; border-radius: 2px 2px 0 0; }
.bars .bar.today { background: var(--accent); }
.bars .bar:hover { background: var(--accent-dark); }
.split dt { font: 600 .86rem var(--display); letter-spacing: 0; text-transform: none; }
.split dd { font: 600 1.45rem var(--display); }
.rows li { padding: 9px 0; }
.rows li a { font-size: 1rem; color: var(--accent-dark); }
.rows strong { font: 600 1rem var(--display); }

/* Point of sale: neutral till panel, one primary action */
.pos-results { border: 1px solid var(--line); box-shadow: var(--shadow-deep); }
.pos-results .result:hover, .pos-results .result:focus { background: var(--accent-soft); }
.pos-lines .cell { font-family: var(--display); font-weight: 400; }
.pos-lines .line-total { font-weight: 600; }
.pos-totals .grand { font: 600 1.7rem var(--display); border-top: 1px solid var(--edge); }
.btn-pay { font: 600 1.25rem var(--display); background: var(--accent); border-color: var(--accent); color: #fff; border-radius: 2px; box-shadow: none; min-height: 56px; }
.btn-pay:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-pay kbd { border-color: rgba(255, 255, 255, .7); }
.ui-desktop .page-pos .pos-side { position: sticky; top: 0; align-self: start; height: calc(100vh - 44px); overflow-y: auto; background: #f3f2f1; border-inline-start: 1px solid var(--line); padding: 16px 18px; gap: 12px; }
.ui-desktop .page-pos .pos-side .card { box-shadow: none; }
.ui-desktop .page-pos .pos-totals { margin-top: auto; }
.ui-desktop .page-pos .pos-totals .grand { font-size: clamp(2rem, 3vw, 2.8rem); align-items: baseline; white-space: nowrap; color: var(--ink); }
.ui-desktop .page-pos .pos-totals .grand span:first-child { font-size: 1rem; font-weight: 600; color: var(--muted); }
.ui-desktop .page-pos .pos { min-height: calc(100vh - 44px); }
.ui-desktop .page-pos .pos-cart { padding: 16px 20px; }
.pos-lines input.shade:not(:placeholder-shown) { border-color: var(--accent); color: var(--accent-dark); }
.addon-list { color: var(--accent-dark); }
.kds-card { border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: 2px; box-shadow: var(--shadow-hard); }
.kds-card header { border-bottom: 1px solid var(--line); }
.kds-card header strong { font: 600 1.8rem var(--display); }

/* Phone */
.mob-head { background: var(--navy); }
.mob-head .logo i { background: transparent; }
.mob-head .logo i::after { background: #fff; }
.mob-head-hero { border-radius: 0; }
.mob-hero .hero-num { color: #fff; }
.mob-hero .eyebrow { color: #c7e0f4; }
.mob-hero .hero-sub { color: #deecf9; }
.mob-tabs { border-top: 1px solid var(--line); box-shadow: 0 -1px 4px rgba(0, 0, 0, .08); }
.mob-tabs a { font: 400 .9rem var(--display); }
.mob-tabs a.on { color: var(--accent-dark); font-weight: 600; box-shadow: inset 0 2px 0 var(--accent); }
.find-box { border: 1px solid var(--field); border-radius: 2px; box-shadow: none; padding: 10px 12px; font-size: 1rem; }
.thumbs a { min-height: 84px; border: 1px solid var(--line); border-inline-start: 4px solid var(--accent); border-radius: 2px; box-shadow: var(--shadow-hard); font: 600 1.1rem var(--display); }
.thumbs a.go { background: var(--accent); color: #fff; border-color: var(--accent); }
.more-links a { border: 1px solid var(--edge); border-radius: 2px; font-weight: 400; }
.mob-hero .hero-num .cur { color: #c7e0f4; }
