/* LocalTokri Admin. Design tokens and components follow the InstantLo premium reference build. */

:root {
  color-scheme: light;
  --bg: #faf8f3; --bg-2: #f2efe7; --surface: #ffffff;
  --ink: #10291d; --ink-2: #33473c; --muted: #56665d;
  --line: #e3e5df; --line-strong: #7a887f;
  --green: #176b45; --green-hover: #125a39; --green-ink: #0f5535; --green-fill: #176b45;
  --green-tint: #e6f2eb; --green-tint-2: #f2f8f4;
  --orange: #ed8a31; --orange-ink: #a3520f; --orange-tint: #fdf1e5;
  --water-2: #eef6ff; --water-deep: #0f4f8c; --info-line: #bfdcf7;
  --danger: #b42318; --danger-fill: #b42318; --danger-tint: #fef3f2; --danger-line: #f2b8b2; --danger-surface: #fffcfb;
  --warning-ink: #8a5300; --warning-tint: #fff6e5; --warning-line: #efcf94;
  --success-line: #bddbc9;
  --input-bg: #fcfbf8;
  --ring-green: rgba(23, 107, 69, .16); --ring-danger: rgba(180, 35, 24, .14);
  --tag-bg: #f1eee6; --tag-line: #dad4c6; --tag-ink: #4a463c;
  --stage-glow: #e9f2fb;
  --focus: #0f4f8c;
  --radius-lg: 24px; --radius: 16px; --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(16, 41, 29, .06);
  --shadow: 0 1px 2px rgba(16, 41, 29, .05), 0 10px 28px rgba(16, 41, 29, .07);
  --shadow-lg: 0 18px 50px rgba(16, 41, 29, .14);
  --shadow-btn: 0 1px 2px rgba(16, 41, 29, .14), inset 0 -2px 0 rgba(0, 0, 0, .14);
  --shadow-btn-hover: 0 6px 16px rgba(23, 107, 69, .22), inset 0 -2px 0 rgba(0, 0, 0, .14);
  --shadow-inset: inset 0 1px 2px rgba(16, 41, 29, .05);
  --font-display: "Plus Jakarta Sans", "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur: .2s;
  --sidebar-w: 17.5rem;
}

/* Dark theme. Applied as data-theme on <html>: index.html sets it before first paint,
   js/ui/theme.js flips it when the theme button is pressed. Anyone who has never used
   the button keeps following their system setting. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1114; --bg-2: #14171a; --surface: #181b1f;
  --ink: #eef0f2; --ink-2: #c8cdd2; --muted: #9ba1a8;
  --line: #2a2e34; --line-strong: #6b727c;
  --green: #4cc38f; --green-hover: #1e8154; --green-ink: #7fd9ad; --green-fill: #1b7a50;
  --green-tint: #1b2d26; --green-tint-2: #172320;
  --orange-ink: #f5a65e; --orange-tint: #2d2013;
  --water-2: #10263b; --water-deep: #acd3f8; --info-line: #24496b;
  --danger: #ff9a8d; --danger-fill: #b83a2e; --danger-tint: #2f1714; --danger-line: #74332b; --danger-surface: #1c1412;
  --warning-ink: #f2c46d; --warning-tint: #2b2312; --warning-line: #6b5524;
  --success-line: #2e4a3e;
  --input-bg: #121417;
  --ring-green: rgba(76, 195, 143, .22); --ring-danger: rgba(255, 154, 141, .2);
  --tag-bg: #1f2226; --tag-line: #3a3e44; --tag-ink: #cfd3d8;
  --stage-glow: #132a40;
  --focus: #8ec8ff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 30px rgba(0, 0, 0, .35);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, .55);
  --shadow-btn: 0 1px 2px rgba(0, 0, 0, .4), inset 0 -2px 0 rgba(0, 0, 0, .2);
  --shadow-btn-hover: 0 6px 18px rgba(76, 195, 143, .18), inset 0 -2px 0 rgba(0, 0, 0, .2);
  --shadow-inset: inset 0 1px 2px rgba(0, 0, 0, .35);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.55;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1, h2, h3 { text-wrap: balance; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); font-weight: 400; }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100; padding: .75rem 1rem;
  border-radius: var(--radius-sm); background: var(--surface); color: var(--green-ink);
  font: 700 1rem var(--font-display); text-decoration: none;
}
.skip-link:focus { top: 1rem; box-shadow: var(--shadow-lg); }

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--ink); text-decoration: none; }
.brand-mark { flex: none; display: block; width: 2.5rem; height: 2.5rem; }
.brand-name { font: 800 1.5rem/1 var(--font-display); letter-spacing: -.025em; white-space: nowrap; }
.brand-name span { color: var(--green); }
.brand-lg .brand-mark { width: 3.25rem; height: 3.25rem; }
.brand-lg .brand-name { font-size: 1.875rem; }
.demo-tag {
  display: inline-flex; align-items: center; padding: .05rem .55rem; border: 1px solid var(--tag-line);
  border-radius: 999px; background: var(--tag-bg); color: var(--tag-ink);
  font: 700 .875rem/1.5 var(--font-body); white-space: nowrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 3.5rem; padding: 0 1.5rem; border: 2px solid transparent; border-radius: var(--radius-sm);
  font: 700 1.0625rem/1.2 var(--font-display); letter-spacing: -.005em; text-align: center; cursor: pointer;
  text-decoration: none;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform .12s var(--ease);
}
.btn-md { min-height: 3rem; padding: 0 1.125rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--green-fill); color: #fff; box-shadow: var(--shadow-btn); }
.btn-primary:hover:not(:disabled) { background: var(--green-hover); box-shadow: var(--shadow-btn-hover); }
.btn-primary:active:not(:disabled) { transform: translateY(1px); }
.btn-secondary { background: var(--surface); border-color: var(--green); color: var(--green-ink); }
.btn-secondary:hover:not(:disabled) { background: var(--green-tint-2); }
.btn-ghost { background: transparent; color: var(--green-ink); }
.btn-ghost:hover:not(:disabled) { background: var(--green-tint-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.is-loading { opacity: 1; cursor: progress; }

.icon-btn {
  display: inline-grid; place-items: center; flex: none; width: 2.75rem; height: 2.75rem;
  border: 0; border-radius: 10px; background: none; color: var(--ink-2); cursor: pointer;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.icon-btn:hover { background: var(--green-tint-2); color: var(--green-ink); }

.spinner { width: 1.15em; height: 1.15em; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.spinner-lg { width: 1.6rem; height: 1.6rem; color: var(--green); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Forms ---------- */
.form { display: grid; gap: 1.25rem; }
.form-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.field { display: grid; gap: .4rem; }
.field-label { font: 700 1.0625rem var(--font-body); color: var(--ink); }
.field-error { margin: 0; display: flex; align-items: flex-start; gap: .4rem; color: var(--danger); font-weight: 700; font-size: 1rem; }
.field-error svg { flex: none; margin-top: .15rem; }
.input-box {
  position: relative; display: flex; align-items: center; min-width: 0; min-height: 3.5rem;
  border: 1.5px solid var(--line-strong); border-radius: 14px; background: var(--input-bg); box-shadow: var(--shadow-inset);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.input-box:hover { border-color: var(--ink-2); }
.input-box:focus-within { border-color: var(--green); background: var(--surface); box-shadow: 0 0 0 1.5px var(--green), 0 0 0 6px var(--ring-green); }
.input-box.is-invalid { border: 2px solid var(--danger); background: var(--danger-surface); }
.input-box.is-invalid:focus-within { box-shadow: 0 0 0 1px var(--danger), 0 0 0 6px var(--ring-danger); }
.input-icon { display: flex; flex: none; margin-left: 1rem; color: var(--muted); transition: color var(--dur) var(--ease); }
.input-box:focus-within .input-icon { color: var(--green); }
.input-box.is-invalid .input-icon { color: var(--danger); }
.input {
  flex: 1; width: 100%; min-width: 0; min-height: calc(3.5rem - 3px); padding: .75rem 1rem .75rem .7rem;
  border: 0; border-radius: 0 13px 13px 0; background: transparent; color: var(--ink); font: 400 1.125rem var(--font-body);
}
.input:focus-visible { outline: none; }
.input::placeholder { color: var(--muted); opacity: .8; }
.input:disabled { cursor: not-allowed; }
.input-toggle { margin-right: .35rem; }

/* ---------- Notices ---------- */
.notice { display: flex; align-items: flex-start; gap: .75rem; padding: 1rem 1.1rem; border: 1px solid; border-radius: var(--radius); }
.notice:focus { outline: 3px solid var(--focus); outline-offset: 3px; }
.notice-icon { flex: none; margin-top: .1rem; }
.notice-body { display: grid; gap: .35rem; min-width: 0; }
.notice-title { margin: 0; font: 800 1.0625rem var(--font-display); }
.notice-text { margin: 0; }
.notice-text code { font-size: .95em; padding: .05rem .3rem; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); overflow-wrap: anywhere; }
.notice-info { background: var(--water-2); border-color: var(--info-line); }
.notice-info .notice-icon { color: var(--water-deep); }
.notice-warning { background: var(--warning-tint); border-color: var(--warning-line); }
.notice-warning .notice-icon { color: var(--warning-ink); }
.notice-error { background: var(--danger-tint); border-color: var(--danger-line); }
.notice-error .notice-icon { color: var(--danger); }

/* ---------- Boot / loading ---------- */
.boot { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; }
.loading { display: flex; align-items: center; gap: .75rem; color: var(--ink-2); }
.loading p { margin: 0; }

/* ---------- Login ---------- */
.auth {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center;
  padding: 2rem max(1rem, env(safe-area-inset-right)) 2rem max(1rem, env(safe-area-inset-left));
  background: radial-gradient(circle at 50% 0%, var(--stage-glow), var(--bg) 70%);
}
.auth-inner { width: 100%; max-width: 28rem; display: grid; gap: 1.75rem; }
.auth-brand { justify-self: center; }
.auth-card {
  display: grid; gap: 1.5rem; padding: 2rem 1.5rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.auth-head { display: grid; gap: .35rem; }
.eyebrow { margin: 0; color: var(--orange-ink); font: 800 .9375rem/1.2 var(--font-display); text-transform: uppercase; letter-spacing: .14em; }
.auth-title { margin: 0; font: 800 1.875rem/1.15 var(--font-display); letter-spacing: -.02em; }
.auth-title:focus { outline: none; }
.auth-sub { margin: 0; color: var(--muted); }
#auth-error:empty { display: none; }
.auth-foot { margin: 0; text-align: center; color: var(--muted); font-size: 1rem; }
@media (min-width: 480px) { .auth-card { padding: 2.25rem 2.25rem 2.5rem; } }

/* ---------- Admin layout ---------- */
.admin { min-height: 100vh; min-height: 100dvh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40; width: var(--sidebar-w); max-width: 86vw;
  display: flex; flex-direction: column; gap: 1rem;
  padding: 1.25rem 1rem max(1rem, env(safe-area-inset-bottom));
  background: var(--surface); border-right: 1px solid var(--line);
  overflow-y: auto; overscroll-behavior: contain;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: 0 .25rem 1rem; border-bottom: 1px solid var(--line); }
.sidebar-head .brand-mark { width: 2.25rem; height: 2.25rem; }
.sidebar-head .brand-name { font-size: 1.375rem; }
.sidebar-close { display: none; }

.nav { flex: 1; }
.nav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: .8rem; min-height: 3rem; padding: 0 .9rem;
  border-radius: var(--radius-sm); color: var(--ink-2); font: 600 1.0625rem var(--font-display); text-decoration: none;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav-link svg { flex: none; color: var(--muted); transition: color var(--dur) var(--ease); }
.nav-link:hover { background: var(--green-tint-2); color: var(--green-ink); }
.nav-link:hover svg { color: var(--green); }
.nav-link[aria-current="page"] { background: var(--green-tint); color: var(--green-ink); font-weight: 800; }
.nav-link[aria-current="page"] svg { color: var(--green); }
.nav-link[aria-current="page"]::before {
  content: ""; position: absolute; left: -1rem; top: .6rem; bottom: .6rem; width: 4px;
  border-radius: 0 4px 4px 0; background: var(--green);
}

.sidebar-foot { display: grid; gap: .75rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.account { display: flex; align-items: center; gap: .65rem; min-width: 0; padding: 0 .25rem; }
.account-avatar {
  flex: none; width: 2.25rem; height: 2.25rem; display: grid; place-items: center; border-radius: 50%;
  background: var(--orange-tint); color: var(--orange-ink); font: 800 1rem var(--font-display); text-transform: uppercase;
}
.account-text { display: grid; min-width: 0; line-height: 1.3; }
.account-role { font: 700 .875rem var(--font-display); color: var(--muted); }
.account-email { font-size: .9375rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-btn { justify-content: flex-start; padding: 0 .9rem; }

.topbar {
  position: sticky; top: 0; z-index: 20; display: none; align-items: center; gap: .5rem;
  min-height: 4rem; padding: .4rem max(.75rem, env(safe-area-inset-right)) .4rem max(.5rem, env(safe-area-inset-left));
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.topbar .brand-mark { width: 2rem; height: 2rem; }
.topbar .brand-name { font-size: 1.25rem; }

.scrim { position: fixed; inset: 0; z-index: 35; background: rgba(16, 41, 29, .4); opacity: 0; pointer-events: none; transition: opacity var(--dur) var(--ease); }

.content { margin-left: var(--sidebar-w); }
.main { width: 100%; max-width: 72rem; margin: 0 auto; padding: 2.5rem 2.5rem 4rem; }
.page { display: grid; gap: 1.5rem; align-content: start; }
.page-head { display: grid; gap: .25rem; }
.page-title { margin: 0; font: 800 2.375rem/1.15 var(--font-display); letter-spacing: -.02em; color: var(--ink); overflow-wrap: anywhere; }
.page-title:focus { outline: none; }
.page-sub { margin: 0; color: var(--muted); }

.empty {
  display: grid; justify-items: center; gap: .75rem; padding: 3.5rem 1.25rem; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
}
.empty-icon { width: 4rem; height: 4rem; display: grid; place-items: center; border-radius: 50%; background: var(--green-tint); color: var(--green); }
.empty-title { margin: 0; font: 800 1.375rem var(--font-display); }

/* Collapsed sidebar (drawer) on smaller screens */
@media (max-width: 1023.98px) {
  .topbar { display: flex; }
  .content { margin-left: 0; }
  .main { padding: 1.5rem max(1rem, env(safe-area-inset-right)) 3rem max(1rem, env(safe-area-inset-left)); }
  .page-title { font-size: 2rem; }
  .sidebar { transform: translateX(-100%); visibility: hidden; box-shadow: none; transition: transform .25s var(--ease), visibility 0s linear .25s; }
  .sidebar-close { display: inline-grid; }
  .admin.is-nav-open .sidebar { transform: none; visibility: visible; box-shadow: var(--shadow-lg); transition: transform .25s var(--ease), visibility 0s; }
  .admin.is-nav-open .scrim { opacity: 1; pointer-events: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar, .scrim, .btn, .nav-link, .input-box { transition: none !important; }
  .spinner { animation-duration: 1.6s; }
}

/* ===== T26 Prices by floor ===== */
.price-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.price-status { margin: 0; color: var(--muted); font-weight: 600; }
.price-list { display: grid; gap: 1rem; }

.price-row {
  display: grid; gap: 1rem 1.25rem; align-items: start; padding: 1.25rem;
  grid-template-columns: minmax(0, 1.2fr) minmax(9rem, 11rem) minmax(0, 1fr) auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
}
.price-name { display: grid; gap: .25rem; min-width: 0; }
.price-name strong { color: var(--ink); font: 700 1.1rem var(--font-display); overflow-wrap: anywhere; }
.price-name span { color: var(--muted); font-size: .875rem; }

.price-field { display: grid; gap: .4rem; min-width: 0; }
.price-input-label { color: var(--muted); font-weight: 700; font-size: .875rem; }
.price-input {
  width: 100%; min-height: 3rem; padding: .65rem .8rem; color: var(--ink);
  background: var(--input-bg); border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm); font: 600 1rem var(--font-body);
}
.price-input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-color: var(--green); }
.price-input[aria-invalid="true"] { border-color: var(--danger); background: var(--danger-surface); }
.price-error { margin: 0; color: var(--danger); font-size: .875rem; font-weight: 600; }

.price-plans { display: grid; gap: .4rem; align-content: center; min-width: 0; }
.price-plans.is-stale { opacity: .45; }
.price-plan { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; font-size: .9rem; }
.price-plan-label { color: var(--muted); }
.price-plan strong { color: var(--ink); font: 700 1rem var(--font-display); white-space: nowrap; }

.price-save { align-self: end; white-space: nowrap; }

@media (max-width: 1100px) {
  .price-row { grid-template-columns: minmax(0, 1fr) minmax(9rem, 11rem); }
  .price-plans { grid-column: 1 / -1; padding-top: .75rem; border-top: 1px dashed var(--line); }
  .price-save { grid-column: 1 / -1; width: 100%; align-self: stretch; }
}
@media (max-width: 560px) {
  .price-row { grid-template-columns: 1fr; }
}

/* ===== Theme button ===== */
/* In the sidebar it matches the Log out button; on the login screen it floats top-right. */
[data-theme-toggle] { transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.auth { position: relative; }
.theme-float {
  position: absolute; z-index: 2;
  top: max(1rem, env(safe-area-inset-top));
  right: max(1rem, env(safe-area-inset-right));
}

/* ===== Filters bar (Orders, Subscriptions) ===== */
.filters { display: flex; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.filter { display: grid; gap: .4rem; }
.filter-label { color: var(--muted); font-weight: 700; font-size: .875rem; }
.filter-input {
  min-height: 3rem; padding: .6rem .8rem; color: var(--ink); background: var(--input-bg);
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
  font: 600 1rem var(--font-body);
}
.filter-input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-color: var(--green); }
.filter-actions { display: flex; align-items: center; gap: .75rem; margin-left: auto; }
.filter-note { margin: 0; color: var(--muted); font-size: .875rem; font-weight: 600; white-space: nowrap; }

/* Segmented filter (Subscriptions) */
.seg { display: inline-flex; padding: .25rem; gap: .25rem; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); flex-wrap: wrap; }
.seg-btn {
  min-height: 2.5rem; padding: .4rem .9rem; border: 0; border-radius: 10px; cursor: pointer;
  color: var(--ink-2); background: transparent; font: 700 .9rem var(--font-body);
}
.seg-btn:hover { color: var(--ink); }
.seg-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.seg-btn[aria-selected="true"] { color: #fff; background: var(--green-fill); }

/* ===== Stat tiles ===== */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin: 0 0 1.25rem; }
.stat { margin: 0; padding: 1rem 1.125rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.stat dt { color: var(--muted); font-weight: 700; font-size: .875rem; }
.stat dd { margin: .25rem 0 0; color: var(--ink); font: 800 1.875rem var(--font-display); line-height: 1.1; }
.stat-of { color: var(--muted); font-size: 1.125rem; font-weight: 700; }
.stat-over { border-color: var(--danger-line); background: var(--danger-surface); }
.stat-over dd { color: var(--danger); }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ===== Chips ===== */
.chip {
  display: inline-block; padding: .3rem .65rem; border-radius: 999px;
  font: 700 .8125rem var(--font-body); white-space: nowrap; border: 1px solid transparent;
}
.chip-neutral  { color: var(--ink-2);      background: var(--bg-2);        border-color: var(--line); }
.chip-muted    { color: var(--muted);      background: var(--bg-2);        border-color: var(--line); }
.chip-ok       { color: var(--green-ink);  background: var(--green-tint);  border-color: var(--success-line); }
.chip-ok-solid { color: #fff;              background: var(--green-fill);  border-color: var(--green-fill); }
.chip-info     { color: var(--water-deep); background: var(--water-2);     border-color: var(--info-line); }
.chip-warn     { color: var(--warning-ink);background: var(--warning-tint);border-color: var(--warning-line); }
.chip-bad      { color: var(--danger);     background: var(--danger-tint); border-color: var(--danger-line); }

/* ===== Table ===== */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: .9rem 1rem; text-align: left; vertical-align: middle; }
.table thead th { color: var(--muted); font: 700 .8125rem var(--font-body); text-transform: uppercase; letter-spacing: .04em; background: var(--bg-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table tbody tr + tr { border-top: 1px solid var(--line); }
.table tbody tr:hover { background: var(--green-tint-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-strong { display: block; color: var(--ink); font-weight: 700; }
.cell-sub { display: block; color: var(--muted); font-size: .8125rem; margin-top: .15rem; }

.progress { display: block; width: 100%; max-width: 6rem; height: .35rem; margin: .4rem 0 0 auto; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress-fill { display: block; height: 100%; background: var(--green-fill); }

.loading { display: grid; justify-items: center; gap: .75rem; padding: 3rem 1rem; color: var(--muted); }
.loading p { margin: 0; }

/* Stacked cards on narrow screens: each row becomes its own block with inline labels. */
@media (max-width: 860px) {
  .table-wrap { background: transparent; border: 0; border-radius: 0; overflow: visible; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .table tbody tr { margin-bottom: 1rem; padding: .5rem .25rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
  .table tbody tr + tr { border-top: 1px solid var(--line); }
  .table td { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .55rem 1rem; text-align: right; }
  .table td::before { content: attr(data-label); color: var(--muted); font-weight: 700; font-size: .8125rem; text-align: left; flex: 0 0 auto; }
  .table .num { text-align: right; }
  .cell-strong, .cell-sub { display: block; text-align: right; }
  .progress { margin-left: auto; }
  .filters { align-items: stretch; }
  .filter-actions { margin-left: 0; }
}

/* ===== Confirm dialog ===== */
.confirm { padding: 0; max-width: min(30rem, calc(100vw - 2rem)); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
.confirm::backdrop { background: rgba(16, 41, 29, .45); }
.confirm-inner { display: grid; gap: .75rem; padding: 1.5rem; margin: 0; }
.confirm-title { margin: 0; font: 800 1.375rem var(--font-display); color: var(--ink); }
.confirm-text { margin: 0; color: var(--ink-2); }
.confirm-note { margin: 0; padding: .75rem .875rem; color: var(--warning-ink); background: var(--warning-tint); border: 1px solid var(--warning-line); border-radius: var(--radius-sm); font-size: .9rem; }
.confirm-actions { display: flex; justify-content: flex-end; gap: .75rem; flex-wrap: wrap; margin-top: .25rem; }
@media (max-width: 420px) {
  .confirm-actions { flex-direction: column-reverse; }
  .confirm-actions .btn { width: 100%; }
}

/* ===== Today dashboard (added 20 Nov 2026) =====
   New components only. No existing rule above was changed, and every value below
   comes from the tokens already defined at the top of this file. */
.panel {
  display: grid; gap: .875rem; padding: 1.25rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.panel-title { margin: 0; font: 800 1.1875rem var(--font-display); color: var(--ink); }
.panel-link { color: var(--green); font-weight: 700; font-size: .875rem; text-decoration: none; white-space: nowrap; }
.panel-link:hover { text-decoration: underline; }
.panel-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.panel .stats { margin: 0; }
.panel .stat { background: var(--bg-2); }
.stat-sub { margin: .3rem 0 0; color: var(--muted); font-size: .8125rem; font-weight: 600; }

.flag-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.flag {
  display: flex; align-items: center; gap: .75rem; padding: .7rem .9rem;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.flag-text { flex: 1; min-width: 0; color: var(--ink-2); font-size: .9375rem; }
@media (max-width: 560px) { .flag { flex-wrap: wrap; } .flag-text { flex-basis: 100%; order: 3; } }

/* ===== Prices: Add floor (added 20 Nov 2026) ===== */
.toolbar-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.price-row.is-new { border-color: var(--green); background: var(--green-tint-2); }
.price-new-actions { display: flex; gap: .5rem; align-items: end; }
@media (max-width: 900px) { .price-new-actions { grid-column: 1 / -1; } }

/* T24 — "Ready to receive?" answered by the office.
   V1 has no push and the customer site has no Ready screen, so the answer arrives by
   phone and is typed here. Additive only: no existing rule is changed. */
.reply-cell { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.reply-actions { display: inline-flex; gap: .25rem; }
.reply-btn { font-size: .78rem; padding: .2rem .55rem; line-height: 1.4; border-radius: 999px; }
.reply-btn[disabled] { opacity: .45; cursor: default; }
.reply-cell .field-error { flex-basis: 100%; margin: 0; }
