/* PharmaPOS boss view. Same look as the app and the download page: ink blue, cool paper, IBM Plex.
   Amber is only ever the main action on a screen. Phone first; a centred column on bigger screens. */

@font-face { font-family: "Plex"; font-weight: 400; font-display: swap; src: url("/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex"; font-weight: 500; font-display: swap; src: url("/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex"; font-weight: 600; font-display: swap; src: url("/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex Condensed"; font-weight: 500; font-display: swap; src: url("/fonts/ibm-plex-sans-condensed-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex Condensed"; font-weight: 600; font-display: swap; src: url("/fonts/ibm-plex-sans-condensed-latin-600-normal.woff2") format("woff2"); }

:root {
  --ink: #14212b; --ink-2: #2a3947; --ink-3: #54646f;
  --paper: #f4f6f7; --label: #ffffff; --line: #d3dadf; --line-2: #e4e9ed;
  --vial: #e9a100; --vial-press: #d18f00; --focus: #1d5fa8;
  --ok: #17663f; --ok-bg: #e1f2e8; --warn: #7a4a00; --warn-bg: #fff0cc; --bad: #a8231b; --bad-bg: #fce4e1;
  --on-ink: #c7d2da;
  --body: "Plex", "Segoe UI", system-ui, sans-serif;
  --display: "Plex Condensed", "Plex", "Segoe UI", sans-serif;
  --column: 720px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
img { display: block; }
a { color: inherit; }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1:focus { outline: none; }
.loading { padding: 48px 20px; text-align: center; color: var(--ink-3); }

/* ---------- buttons and links ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 24px; border: 0; border-radius: 8px; font: 600 17px/1 var(--body); text-decoration: none; cursor: pointer; transition: background-color .15s, box-shadow .15s; }
.btn:active { transform: translateY(1px); }
.btn-go { background: var(--vial); color: var(--ink); width: 100%; }
.btn-go:hover { background: var(--vial-press); }
.btn-quiet { background: var(--label); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-quiet:hover { box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: 15px; }
.link { background: none; border: 0; padding: 12px 0; color: var(--ink-2); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-light { color: var(--on-ink); padding: 8px 0; text-decoration: none; font-size: 15px; }

/* ---------- signing in ---------- */
.auth { min-height: 100dvh; max-width: 460px; margin: 0 auto; padding: 24px 20px 40px; display: flex; flex-direction: column; justify-content: center; }
.auth-brand { margin-bottom: 28px; }
.auth-brand .brand { color: var(--ink); }
.auth h1 { margin: 0 0 14px; font: 600 clamp(30px, 8.5vw, 40px)/1.05 var(--display); letter-spacing: -.005em; text-wrap: balance; }
.lede { margin: 0 0 24px; color: var(--ink-2); font-size: 18px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 500; }
input { min-height: 52px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--label); color: var(--ink); font: 400 18px/1 var(--body); }
input:hover { border-color: var(--ink-3); }
.code-input { font: 600 34px/1 var(--display); letter-spacing: .35em; text-align: center; }
.error { margin: 0; color: var(--bad); font-weight: 500; }
.notice { margin: 0; color: var(--ok); font-weight: 500; }
.fine { margin: 16px 0 0; color: var(--ink-3); font-size: 14px; }
.links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 16px; margin-top: 12px; }

/* ---------- app frame ---------- */
.page { max-width: var(--column); min-height: 100dvh; margin: 0 auto; display: flex; flex-direction: column; background: var(--paper); }
.appbar { display: flex; align-items: center; justify-content: space-between; padding: max(10px, env(safe-area-inset-top)) 16px 10px; background: var(--ink); }
.brand { display: flex; align-items: center; gap: 9px; color: #fff; font: 600 21px/1 var(--display); letter-spacing: .01em; text-decoration: none; }
.body { flex: 1; padding: 16px 16px 40px; }
.page-shop .body { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
.body > h1, .shop-head h1 { margin: 0 0 4px; font: 600 clamp(28px, 7.5vw, 36px)/1.08 var(--display); letter-spacing: -.005em; }
.lede + .steps { margin-top: -8px; }
.steps { margin: 0 0 20px; padding-left: 1.3em; color: var(--ink-2); }
.steps li { margin: .5em 0; }
.actions { margin: 20px 0 0; }
.actions .link { padding: 8px 0; }
.code { margin: 14px 0; padding: 20px 12px; border: 2px solid var(--ink); border-radius: 10px; background: var(--label); text-align: center; font: 600 clamp(40px, 13vw, 58px)/1 var(--display); letter-spacing: .1em; }

.shop-head { padding: 12px 16px 12px; }
.back { display: inline-block; padding: 4px 0; color: var(--ink-3); font-size: 14px; text-decoration: none; }
.back:hover { color: var(--ink); }

/* how fresh the data is: always in the same place, always readable at a glance */
.banner { display: flex; flex-direction: column; gap: 1px; padding: 10px 16px; font-size: 15px; }
.banner span { font-size: 14px; }
.banner-ok { background: var(--ok-bg); color: var(--ok); }
.banner-stale { background: var(--warn-bg); color: var(--warn); }
.banner-old { background: var(--bad-bg); color: var(--bad); }
.banner-never { background: var(--line-2); color: var(--ink-2); }
.fresh-ok { color: var(--ok); }
.fresh-stale { color: var(--warn); }
.fresh-old { color: var(--bad); }

/* bottom tabs */
.tabs { position: fixed; left: 50%; bottom: 0; z-index: 5; width: min(var(--column), 100%); transform: translateX(-50%); display: grid; grid-template-columns: repeat(5, 1fr); padding-bottom: env(safe-area-inset-bottom); background: var(--label); border-top: 1px solid var(--line); }
.tab { position: relative; display: flex; align-items: center; justify-content: center; min-height: 58px; color: var(--ink-3); font-size: 14px; font-weight: 500; text-decoration: none; }
.tab.is-active { color: var(--ink); font-weight: 600; box-shadow: inset 0 3px 0 var(--ink); }
.badge { position: absolute; top: 7px; left: calc(50% + 14px); min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--bad); color: #fff; font-size: 12px; font-weight: 600; line-height: 20px; text-align: center; }

/* ---------- lists ---------- */
h2 { margin: 24px 0 8px; font: 600 21px/1.2 var(--display); }
.count { display: inline-block; min-width: 24px; margin-left: 4px; padding: 0 8px; border-radius: 12px; background: var(--line-2); color: var(--ink-2); font: 600 14px/24px var(--body); text-align: center; }
.rows { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.rows li, .rows .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 12px 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
/* a list item that is itself a link: the link carries the row, the item stays a plain block */
.rows li.li-link { display: block; min-height: 0; padding: 0; }
.rows .row { min-height: 64px; border-bottom: 0; }
.rows .row:hover { background: var(--line-2); }
.row-main { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.row-main strong { font-weight: 600; overflow-wrap: anywhere; }
.sub { color: var(--ink-3); font-size: 14px; }
.amount { font: 600 19px/1.2 var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chev { color: var(--ink-3); font-size: 26px; }
.empty { margin: 0; padding: 14px 0; color: var(--ink-3); }
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); font-size: 13px; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.chip-bad { background: var(--bad-bg); color: var(--bad); }
.chip-warn { background: var(--warn-bg); color: var(--warn); }
.chip-rx { background: var(--ok-bg); color: var(--ok); }
.is-void .amount { color: var(--ink-3); text-decoration: line-through; }
.meter { display: block; width: 100%; height: 6px; margin-top: 6px; border-radius: 3px; }
.meter-bg { fill: var(--line-2); }
.meter-fill { fill: var(--ink); }

/* ---------- today ---------- */
.day { margin: 0; color: var(--ink-3); }
.big { margin: 2px 0 4px; font: 600 clamp(52px, 17vw, 80px)/1 var(--display); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.change { margin: 0 0 20px; font-weight: 500; }
.change-up { color: var(--ok); }
.change-down { color: var(--bad); }
.change-flat, .change-none { color: var(--ink-3); }
.week svg { display: block; width: 100%; height: 96px; }
.bar { fill: #b3bec6; }
.bar-today { fill: var(--ink); }
.week-labels { display: grid; grid-template-columns: repeat(7, 1fr); margin: 4px 0 0; padding: 0; list-style: none; color: var(--ink-3); font-size: 12px; text-align: center; }
.week-labels .is-today { color: var(--ink); font-weight: 600; }
.facts { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 16px 0; padding: 14px 0; list-style: none; border-block: 1px solid var(--line); }
.split svg { display: block; width: 100%; height: 10px; border-radius: 5px; }
.legend { display: flex; justify-content: space-between; margin: 8px 0 0; padding: 0; list-style: none; font-size: 15px; }

@media (min-width: 760px) {
  body { background: var(--line-2); }
  .page { box-shadow: 0 0 0 1px var(--line); }
}
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }
