/* Teaology POS: shared look for the counter, the kitchen screen and the admin.
   The Teaology shop app's colours and fonts (Member Card palette, Figtree + Walone) with its plain
   working-tool finish: hairlines instead of boxes, 6-8px corners, no shadows except on what floats,
   states as a dot and a word, underlined tabs. One accent (Teaology blue); navy for the brand. */

@font-face { font-family: 'Figtree'; src: url('/fonts/figtree.woff2') format('woff2'); font-weight: 300 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212; }
@font-face { font-family: 'Walone'; src: url('/fonts/walone-400.woff2') format('woff2'); font-weight: 400; font-display: swap;
  unicode-range: U+1000-109F, U+A9E0-A9FF, U+AA60-AA7F, U+200B-200D, U+25CC; }
@font-face { font-family: 'Walone'; src: url('/fonts/walone-700.woff2') format('woff2'); font-weight: 600 900; font-display: swap;
  unicode-range: U+1000-109F, U+A9E0-A9FF, U+AA60-AA7F, U+200B-200D, U+25CC; }

:root {
  --navy: #0B2E6B;
  --blue: #1668E3;
  --blue-dark: #0F55C0;
  --tint: #E8F0FD;
  --bg: #F2F4F8;
  --surface: #FFFFFF;
  --ink: #0F172A;
  --muted: #5B6475;
  --line: #E3E7EE;
  --hover: #F5F7FA;
  --green: #12805C;
  --gold: #A36A00;
  --red: #C62828;
  --r: 8px;
  --r-sm: 6px;
  --float: 0 10px 30px rgba(15, 23, 42, 0.16);
  --font: 'Figtree', 'Walone', 'Noto Sans Myanmar', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --tap: 44px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.num, td.n, th.n { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.red { color: var(--red); }
.green { color: var(--green); }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }

/* ---- buttons: one solid blue action per screen, the rest outlined ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 16px;
  border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); font-weight: 600; white-space: nowrap; }
.btn:hover:not(:disabled) { background: var(--hover); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--blue-dark); }
.btn.danger { color: var(--red); }
.btn.primary.danger-fill { background: var(--red); border-color: var(--red); }
.btn.block { width: 100%; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
.btn:disabled { opacity: .5; cursor: default; }
.link { color: var(--blue); font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---- form fields ---- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink); }
.field small { color: var(--muted); font-size: 12.5px; }
.in, select.in, textarea.in { width: 100%; min-height: var(--tap); padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); font-size: 16px; }
textarea.in { padding: 10px 12px; min-height: 80px; resize: vertical; }
.in:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--tint); }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { min-width: 0; }
.grow { flex: 1; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 560px) { .cols { grid-template-columns: 1fr; } }

/* ---- on/off switch with its word ---- */
.switch { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; min-height: 34px; color: var(--muted); }
.switch::before { content: ''; width: 32px; height: 18px; border-radius: 9px; background: #CDD3DD; flex: none;
  background-image: radial-gradient(circle at 9px 9px, #fff 6px, transparent 6.5px); background-repeat: no-repeat; transition: background-color .15s, background-position .15s; }
.switch.on { color: var(--green); }
.switch.on::before { background-color: var(--green); background-position: 14px 0; }

/* ---- states: a dot and the word ---- */
.state { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.state::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.state.wait { color: var(--gold); } .state.go { color: var(--blue); } .state.ok { color: var(--green); }
.state.off { color: var(--muted); } .state.bad { color: var(--red); }

/* ---- underlined tabs ---- */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { min-height: 42px; padding: 0 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--navy); border-bottom-color: var(--navy); }

/* ---- tables: sentence-case headers, hairlines ---- */
.tbl { width: 100%; border-collapse: collapse; background: var(--surface); }
.tbl th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--hover); }
.tbl tfoot td { font-weight: 700; border-top: 1px solid var(--ink); border-bottom: 0; }
.scroll-x { overflow-x: auto; }

/* ---- a bordered surface split by hairlines ---- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.panel > .ph { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.panel > .ph h3 { font-size: 15px; }
.panel > .pb { padding: 14px 16px; }
.list > * + * { border-top: 1px solid var(--line); }

/* ---- sheets (dialogs) and toast: the only things with a shadow ---- */
.scrim { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.38); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--surface); width: 100%; max-width: 560px; max-height: 92vh; display: flex; flex-direction: column;
  border-radius: 12px 12px 0 0; box-shadow: var(--float); }
.sheet.wide { max-width: 860px; }
@media (min-width: 640px) { .scrim { align-items: center; padding: 24px; } .sheet { border-radius: var(--r); } }
.sh-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.sh-h h2 { font-size: 17px; flex: 1; }
.sh-x { width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--r-sm); color: var(--muted); }
.sh-x:hover { background: var(--hover); color: var(--ink); }
.sh-b { padding: 16px 18px; overflow-y: auto; flex: 1; }
.sh-f { padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); display: flex; gap: 10px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px;
  border-radius: var(--r-sm); font-weight: 600; font-size: 14px; z-index: 90; box-shadow: var(--float); max-width: calc(100vw - 32px); }
.toast.bad { background: var(--red); }

.ic { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.empty { color: var(--muted); padding: 28px 16px; text-align: center; }
.spin { width: 26px; height: 26px; border: 3px solid var(--line); border-top-color: var(--blue); border-radius: 50%; margin: 40px auto; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
