@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Manrope:wght@400;500;600;700;800&family=Playfair+Display:wght@700;800&display=swap');

/* MasterPOS design system — ported 1:1 from the design canvas (Main/POS/Login/
   Setup .dc.html tokens) so the real app matches the approved mockups exactly,
   rather than reinterpreting them through a generic component library. */

* { box-sizing: border-box; }

:root {
  /* MasterPOS design tokens — charcoal ground with a bright-gold accent
     (the original design/build; matches the 5286 install exactly). The app
     runs in the [data-theme='light'] palette by default — see index.html and
     src/theme.ts; this :root block is the dark palette the toggle falls back
     to when a user picks Dark. */
  --bg: oklch(16% 0.012 50);
  --bg2: oklch(19% 0.013 50);
  --surface: oklch(21% 0.013 50);
  --surface2: oklch(25% 0.014 50);
  --border: oklch(34% 0.015 50 / 55%);
  --border-soft: oklch(34% 0.015 50 / 28%);
  --text: oklch(95% 0.008 85);
  --text-dim: oklch(74% 0.02 75);
  --text-faint: oklch(54% 0.02 70);
  --gold: oklch(76% 0.12 83);
  --gold-bright: oklch(84% 0.12 85);
  --gold-dim: oklch(58% 0.10 80);
  --gold-soft: oklch(76% 0.12 83 / 14%);
  --success: oklch(32% 0.14 150);
  --success-soft: oklch(32% 0.14 150 / 22%);
  --success-ink: oklch(18% 0.12 152);
  --danger: oklch(28% 0.17 25);
  --danger-soft: oklch(28% 0.17 25 / 22%);
  --danger-ink: oklch(18% 0.14 28);
  --warning: oklch(38% 0.13 85);
  --warning-soft: oklch(38% 0.13 85 / 22%);
  --warning-ink: oklch(22% 0.11 85);
  --ink: oklch(18% 0.01 60); /* text color sitting on top of gold-filled surfaces */
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body: 'Manrope', -apple-system, 'Segoe UI', sans-serif;
}

/* ---- Light mode — the default. Same bright-gold/success/danger accents
   (they are NOT overridden here); only the background/surface/text/border
   scale flips. Applied as data-theme='light' on <html> (see src/theme.ts). */
:root[data-theme='light'] {
  --bg: oklch(95% 0.007 50);
  --bg2: oklch(97% 0.005 50);
  --surface: oklch(99% 0.003 50);
  --surface2: oklch(93% 0.008 50);
  --border: oklch(70% 0.02 50 / 55%);
  --border-soft: oklch(70% 0.02 50 / 25%);
  --text: oklch(20% 0.01 50);
  --text-dim: oklch(30% 0.015 58);
  --text-faint: oklch(43% 0.018 58);
}

html, body, #root { height: 100%; }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}
button, input, select, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-bright); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }

/* ---- App shell — horizontal top nav + content ---- */
.app { display: flex; flex-direction: column; width: 100%; height: 100vh; background: var(--bg); overflow: hidden; }
.topbar-nav { display: flex; align-items: center; gap: 18px; background: var(--bg2); border-bottom: 1px solid var(--border-soft); padding: 0 22px; height: 56px; flex: none; position: sticky; top: 0; z-index: 30; }.brand { display: flex; align-items: center; gap: 8px; flex: none; }
.brand-link { display: flex; align-items: center; gap: 8px; color: inherit; }
.brand-link:hover { color: inherit; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(155deg, var(--gold-bright), var(--gold-dim)); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-style: italic; font-size: 16px; color: var(--ink); flex: none; }
.brand-logo { height: 34px; width: auto; object-fit: contain; background: #fff; border: 1px solid rgba(0, 0, 0, 0.1); border-radius: 7px; padding: 3px; flex: none; display: block; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); }
.login-wrap .brand-logo, .setup-wrap .brand-logo { height: 44px; }
/* Brand lockup: MPOS wordmark in Playfair Display 700 (matches the login
   banner's Didone wordmark); the tagline stays in Manrope (nav/body font),
   bold and tracked tight (+ smaller) so it stays under the wordmark. */
.brand-word { font-family: 'Playfair Display', var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: .3px; color: var(--text); line-height: 1.1; white-space: nowrap; }
.brand-sub { font-family: var(--font-body); font-weight: 700; font-size: 8.5px; letter-spacing: .1px; text-transform: uppercase; color: var(--text-faint); line-height: 1.2; white-space: nowrap; margin-top: 2px; }
.branch-chip { display: none; }
.new-order-btn { display: flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 8px; border: none; background: linear-gradient(155deg, var(--gold-bright), var(--gold)); color: var(--ink); font-size: 12px; font-weight: 800; letter-spacing: .2px; box-shadow: 0 4px 12px -6px oklch(76% 0.12 83 / 55%); flex: none; white-space: nowrap; }
.new-order-btn svg { width: 14px; height: 14px; }
.new-order-btn:hover { filter: brightness(1.04); }
.topnav-divider { width: 1px; height: 28px; background: var(--border-soft); flex: none; }
.nav { display: flex; align-items: center; justify-content: center; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: thin; }
.nav-dropdown { position: relative; flex: none; }
.nav-trigger { display: flex; align-items: center; gap: 5px; padding: 7px 12px; border-radius: 8px; color: var(--text-dim); font-size: 13px; font-weight: 600; position: relative; background: none; border: none; text-align: left; white-space: nowrap; cursor: pointer; }
.nav-trigger:hover { color: var(--text); background: var(--surface); }
.nav-trigger.active { color: var(--gold-bright); }
.nav-trigger.open { color: var(--gold-bright); background: var(--gold-soft); }
.nav-dropdown-panel { position: absolute; top: calc(100% + 8px); left: 0; min-width: 200px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 6px; box-shadow: 0 14px 34px -12px oklch(0% 0 0 / 65%); z-index: 1000; display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - 120px); overflow: auto; }
.nav-dropdown-item { display: block; padding: 9px 12px; border-radius: 8px; color: var(--text-dim); font-size: 13px; font-weight: 500; white-space: nowrap; }
.nav-dropdown-item:hover { color: var(--text); background: var(--surface2); }
.nav-dropdown-item.active { color: var(--gold-bright); background: var(--gold-soft); }
.nav-dropdown-block { display: flex; flex-direction: column; gap: 2px; padding: 4px 0 2px; }
.nav-dropdown-heading { padding: 7px 12px 3px; font-size: 10px; letter-spacing: .4px; text-transform: uppercase; color: var(--text-faint); font-weight: 700; }
.nav-dropdown-sub { padding-left: 24px; }
.nav-dropdown-group { position: relative; }
.nav-dropdown-trigger { display: flex; align-items: center; gap: 10px; cursor: default; }
.nav-flyout { display: flex; flex-direction: column; gap: 2px; position: fixed; min-width: 190px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 6px; box-shadow: 0 14px 34px -12px oklch(0% 0 0 / 65%); z-index: 1100; }
.nav-section-label { display: none; }
.nav-item { display: none; }
.nav-item svg { display: none; }
.user-card { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border-soft); flex: none; margin-left: auto; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--surface2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: var(--gold); flex: none; }
.user-meta { flex: 1; min-width: 0; }
.user-name { font-size: 11.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { display: none; }
.logout-btn { background: none; border: none; color: var(--text-faint); flex: none; padding: 3px; }
.logout-btn:hover { color: var(--danger); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { position: relative; height: 68px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; border-bottom: 1px solid var(--border-soft); }
.page-title { font-family: var(--font-display); font-size: 23px; font-style: italic; color: var(--text); }
.page-title-sm { font-family: var(--font-display); font-size: 15px; font-style: italic; color: var(--text); line-height: 1.2; }
.page-sub { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
/* Optional slot between the title block and the topbar actions: the page's own
   tab strip, so tabs sit on the SAME line as the title (Settings). Fills the
   space it is given and scrolls sideways rather than wrapping when the tabs
   outgrow it. */
.topbar-middle { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: flex-end; margin: 0 12px 0 18px; }
.topbar-middle .tabstrip { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: thin; padding: 3px; gap: 3px; }
.topbar-middle .tabstrip-btn { flex: none; padding: 6px 11px; font-size: 11.5px; }
/* Opt-in: centre the strip on the PAGE's midline. The title and the action
   buttons are different widths, so centring it in the flex gap between them
   would sit it slightly off-centre; taking it out of the flow and pinning it to
   50% makes the tab group symmetric around the page centre. max-width keeps it
   clear of the title (left) and the buttons (right) instead of overlapping
   them, and the strip scrolls inside that width. --tb-tabs-clearance is the
   space reserved on EACH side (widest action cluster + topbar padding). */
.topbar.topbar-center-tabs .topbar-middle {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  max-width: calc(100% - 2 * var(--tb-tabs-clearance, 150px));
}
/* Left edge of the title lines up with the MPOS logo in the nav above
   (.topbar-nav pads 22px), and the right edge lines up with the nav's Sign out
   icon (nav padding 22 + .user-card inset 9 = 31px). */
.topbar.topbar-nav-align { padding-left: 22px; padding-right: 31px; }
.topbar-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; }
.chip { display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border-soft); border-radius: 20px; padding: 7px 13px; font-size: 12px; color: var(--text-dim); }
.terminal-input { width: 110px; background: transparent; border: none; font-size: 12px; color: var(--text); padding: 0; outline: none; }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; min-height: 34px; align-items: center; }
.chips-row .chip { padding: 5px 10px; font-size: 11.5px; }
.chip-x { background: none; border: none; padding: 0; margin-left: 2px; color: var(--text-faint); cursor: pointer; font-size: 11px; line-height: 1; display: inline-flex; align-items: center; }
.chip-x:hover { color: var(--danger, #e5484d); }
.search-pill { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border-soft); border-radius: 20px; padding: 8px 14px; color: var(--text-faint); font-size: 12.5px; }
.search-pill input { background: none; border: none; outline: none; color: var(--text); font-size: 12.5px; width: 100%; }
.search-pill input::placeholder { color: var(--text-faint); }
.icon-btn { width: 34px; height: 34px; border-radius: 9px; background: var(--surface); border: 1px solid var(--border-soft); display: flex; align-items: center; justify-content: center; color: var(--text-dim); position: relative; flex: none; }
.dot { position: absolute; top: 7px; right: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); border: 1.5px solid var(--bg2); }
.content { flex: 1; padding: 16px 32px 32px; overflow: auto; display: flex; flex-direction: column; gap: 16px; }
.content--bare { padding: 0; overflow: hidden; gap: 0; }
/* Align transaction pages with the header logo and sign-out button. */
.txn-content { padding: 10px 31px 32px 22px; }
/* Settings tabs: dense layout so a whole tab usually fits without scrolling.
   Same alignment as the header (cards start at the logo's 22px, end at the
   action buttons' edge), but tighter vertical rhythm: padding, card/field
   gaps, toggle rows and inputs all step down ~35-45%. Scoped to this content
   area so no other page's cards change. */
.content.settings-content { padding: 8px 31px 12px 22px; gap: 10px; }
.settings-content .card { padding: 13px 16px; border-radius: 12px; }
.settings-content .card-head { margin-bottom: 9px; }
.settings-content .card-title { font-size: 13.5px; }
.settings-content .stack { gap: 10px; }
/* Two-up field grids become as many columns as fit (3 at ~900px+): the Company
   tab's nine fields then take 3 rows instead of 5, which is what keeps the tab
   inside one screen. auto-fit keeps 2 (or 1) columns on narrower windows. */
.settings-content .grid2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 14px; }
.settings-content .field { margin-bottom: 8px; }
.settings-content .field label { margin-bottom: 3px; font-size: 10.5px; }
.settings-content .input { padding: 7px 10px; border-radius: 8px; font-size: 13px; }
.settings-content .payroll-row { padding: 8px 12px; border-radius: 11px; gap: 10px; }
.settings-content .payroll-title { font-size: 13px; }
.settings-content .payroll-desc { font-size: 11.5px; margin-top: 2px; line-height: 1.4; max-width: 560px; }
.settings-content .page-sub { font-size: 11.5px; }
.settings-content .util-row { padding: 7px 0; }
.settings-content .toolbar { margin-bottom: 8px; }
.settings-content .form-card.compact { padding: 12px 14px; gap: 10px; }
.settings-content .license-grid { margin-top: 10px; padding-top: 10px; gap: 8px 16px; }
.settings-content .btn { padding: 7px 12px; font-size: 12.5px; }
.settings-content .yn-opt { padding: 6px 13px; font-size: 12px; }
.settings-content .split.compact { gap: 12px; }
.settings-content .fiscal-split,
.settings-content .half-split { gap: 10px; }
/* Fiscal-year list lives in half the page, so its table is denser than the
   default: 4 columns, tight cells and small status badges. */
.settings-content .fy-table th { padding: 0 6px 6px; }
.settings-content .fy-table td { padding: 5px 6px; font-size: 12px; }
.settings-content .fy-table th:first-child,
.settings-content .fy-table td:first-child { padding-left: 0; }
.settings-content .fy-table th:last-child,
.settings-content .fy-table td:last-child { padding-right: 0; }
.settings-content .fy-table .badge { font-size: 9.5px; padding: 2px 6px; display: inline-block; margin-bottom: 2px; }
.fy-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.fy-form-grid .span2 { grid-column: 1 / -1; }
/* Modules & Billing: switches in two columns (modules | billing). */
.modules-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
.modules-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.modules-col-title { font-size: 10px; text-transform: uppercase; letter-spacing: .7px; color: var(--text-faint); font-weight: 700; margin-bottom: 1px; }
/* Payment Modes: one dense switch list — name | active | ledger | actions. */
.settings-content .pm-table td { vertical-align: middle; padding: 4px 8px; }
.settings-content .pm-table th { padding: 0 8px 5px; }
.settings-content .pm-table .pm-name { color: var(--text); font-weight: 600; font-size: 13px; white-space: nowrap; }
.settings-content .pm-table .pm-badge { margin-left: 8px; font-size: 9.5px; padding: 2px 6px; }
.settings-content .pm-table .pm-active { width: 62px; }
.settings-content .pm-table .pm-select { padding: 4px 8px; font-size: 12px; border-radius: 7px; height: 30px; }
.settings-content .pm-table .pm-btn { padding: 4px 9px; font-size: 11.5px; }
.settings-content .pm-table .pm-notset { font-size: 11.5px; }
.settings-content .pm-table tr.pm-off td { opacity: .55; }
.settings-content table th { padding: 0 10px 6px; }
.settings-content table td { padding: 6px 10px; font-size: 12.5px; }
.products-bare { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; padding: 16px 24px 24px; }

/* ---- Shared primitives ---- */
.card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 14px; padding: 20px; }
.card-body { min-width: 0; }
.card-title { font-size: 14.5px; font-weight: 700; color: var(--text); }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.selected-chip { display: inline-flex; align-items: center; background: var(--gold-soft); border: 1px solid var(--gold); color: var(--text); border-radius: 20px; padding: 6px 12px; font-size: 12px; margin-bottom: 10px; }
.mini-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-dim); cursor: pointer; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 9px; font-size: 13px; font-weight: 600; border: 1px solid var(--border); cursor: pointer; background: var(--surface); color: var(--text-dim); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(155deg, var(--gold-bright), var(--gold)); color: var(--ink); border: none; }
.btn-ghost { background: var(--surface); color: var(--text-dim); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.btn-block { width: 100%; }
  .btn-link { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: var(--gold-bright); font-weight: 600; cursor: pointer; text-align: left; }
  .btn-link:hover { text-decoration: underline; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; font-size: 10px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-gold { background: var(--gold-soft); color: var(--gold-bright); }
.badge-neutral { background: var(--surface2); color: var(--text-faint); }
.grade-badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 20px; font-size: 10px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; }
.grade-badge.platinum { background: #312e81; color: #c7d2fe; }
.grade-badge.gold { background: var(--gold-soft); color: #b45309; }
.grade-badge.silver { background: #e2e8f0; color: #475569; }
.select-sm { width: auto; min-width: 112px; padding: 7px 10px; border-radius: 8px; font-size: 12.5px; }
.select-sm-pad { padding: 7px 14px; font-size: 12.5px; border-radius: 8px; }
.scheme-input { width: 88px; padding: 8px 10px; border-radius: 8px; font-size: 13px; text-align: right; }
.modal-body { display: flex; flex-direction: column; gap: 12px; }
table { border-collapse: collapse; width: 100%; }
th { text-align: left; font-size: 10px; letter-spacing: .8px; text-transform: uppercase; color: var(--text-faint); font-weight: 600; padding: 0 12px 10px; }
td { padding: 11px 12px; font-size: 13px; color: var(--text-dim); border-top: 1px solid var(--border-soft); }
.tabular { font-variant-numeric: tabular-nums; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 11.5px; font-weight: 600; color: var(--text-dim); margin-bottom: 7px; }

.balance-hint { display: inline-block; font-size: 10.5px; font-weight: 600; color: var(--text-dim); margin-top: 5px; white-space: nowrap; }
.balance-hint.dr { color: var(--text); }
.balance-hint.cr { color: var(--text); }
.view-value { font-size: 13px; color: var(--text); }
.input, select.input { width: 100%; padding: 12px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: 13.5px; font-family: var(--font-body); outline: none; }
.input:focus { border-color: var(--gold-dim); box-shadow: 0 0 0 3px var(--gold-soft); }
.error-text { color: var(--danger); font-size: 12px; margin-top: 8px; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; color: var(--text-faint); text-align: center; gap: 6px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--gold); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.modal-backdrop { position: fixed; inset: 0; background: oklch(0% 0 0 / 55%); display: flex; align-items: center; justify-content: center; z-index: 600; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 24px; width: 420px; max-width: calc(100vw - 40px); max-height: calc(100vh - 40px); overflow: auto; }
.modal-title { font-family: var(--font-display); font-style: italic; font-size: 19px; margin-bottom: 18px; }

/* ---- Dashboard ---- */
.greet { font-family: var(--font-display); font-style: italic; font-size: 27px; color: var(--text); }
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi-label { font-size: 11.5px; color: var(--text-faint); font-weight: 600; text-transform: uppercase; letter-spacing: .6px; }
.kpi-num { font-family: var(--font-display); font-size: 28px; margin-top: 8px; color: var(--text); }
.kpi-foot { margin-top: 8px; }
.two-col { display: grid; grid-template-columns: 1.55fr 1fr; gap: 20px; align-items: start; }
.two-col-wide { display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 14px; }
/* Two equal halves that top-align — used by Fiscal Year (list | add form) and
   Payment Modes (list | add form). */
.fiscal-split, .half-split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.alert-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--border-soft); }
.alert-row:first-of-type { border-top: none; padding-top: 2px; }

/* Dashboard compact layout — no scroll, two-col split */
.dash-kpi { font-size: 0.8em; }
.dash-kpi .card { padding: 12px 14px; }
.dash-two-col { display: grid; grid-template-columns: 1fr 1.3fr; gap: 16px; flex: 1; min-height: 0; }
.dash-left { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.dash-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.dash-panel .stack { gap: 8px; flex: 1; overflow-y: auto; }
.dash-panel .card-head { margin-bottom: 10px; }
.dash-panel .alert-row { padding: 7px 0; font-size: 12.5px; }
.dash-chart-card { display: flex; flex-direction: column; min-height: 0; }
.dash-chart-card .dash-chart-fill { flex: 1; min-height: 0; width: 100%; position: relative; }
.dash-chart-card svg.dash-line { display: block; width: 100%; height: 100%; position: absolute; inset: 0; margin: 0; }
.dash-chart-card .fc-legend { margin-top: 10px; }
.page-title.dash-title { font-size: 17px; font-weight: 700; }
.topbar.topbar-dash { height: 50px; padding: 0 32px; }
.np-date { font-family: 'Noto Sans Devanagari', 'Nirmala UI', 'Mangal', sans-serif; font-weight: 600; }
.dash-fill { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; }

/* Dashboard Sales Trend & Forecast: two-series line chart
   (gold = 14 actual days, blue = 7 forecast days, dashed divider) */
.dash-line { display: block; margin: 12px 2px 6px; }
.dash-line-hist { fill: none; stroke: var(--gold); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.dash-line-fc { fill: none; stroke: oklch(70% 0.17 240); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.dash-line-dot-h { fill: var(--gold); cursor: pointer; }
.dash-line-dot-f { fill: oklch(70% 0.17 240); cursor: pointer; }
.dash-line-dot-h.sel, .dash-line-dot-f.sel { stroke: var(--text); stroke-width: 1.5; }
.dash-line-readout { min-height: 22px; display: flex; align-items: center; gap: 10px; margin: 10px 2px 0; }
.dash-line-readout .hl { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--gold-bright); white-space: nowrap; }
.dash-line-readout .dim { color: var(--text-faint); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-line-grid { stroke: var(--border-soft); stroke-width: 1; }
.dash-line-div { stroke: var(--text-faint); stroke-width: 1; stroke-dasharray: 3 4; opacity: .55; }
.dash-line-y { font-size: 9.5px; font-weight: 600; fill: var(--text); }
.dash-line-ylbl { font-size: 9px; font-weight: 700; fill: var(--text-dim); letter-spacing: .3px; text-transform: uppercase; }
.dash-line-lbl { font-size: 9px; font-weight: 600; fill: var(--text-dim); text-transform: uppercase; }
.dash-line-lbl.today { fill: var(--gold-bright); }
.dash-line-cap { font-size: 8.5px; fill: var(--text-faint); }
.dash-chart-card .fc-swatch { width: 14px; height: 3px; border: none; border-radius: 2px; background: var(--gold); }
.dash-chart-card .fc-swatch-fc { background: oklch(70% 0.17 240); }

/* ---- Login ---- */
.login-wrap { width: 100%; height: 100vh; height: 100dvh; min-height: 100vh; display: flex; overflow: hidden; }
.login-panel-left { flex: 1.15; background: var(--bg2); padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-panel-left::before { content: ''; position: absolute; inset: 0; background: radial-gradient(600px 400px at 20% 0%, oklch(76% 0.12 83 / 0.10), transparent 60%); }
.login-headline { font-family: var(--font-display); font-style: italic; font-size: 40px; line-height: 1.2; color: var(--text); position: relative; }
.login-headline em { color: var(--gold-bright); }
.login-lede { font-size: 14px; color: var(--text-faint); max-width: 440px; margin-top: 18px; line-height: 1.7; position: relative; }
.login-stats { display: flex; gap: 40px; position: relative; }
.login-banner { display: block; width: min(460px, 100%); height: auto; border-radius: 14px; border: 1px solid var(--border-soft); box-shadow: 0 4px 18px rgba(0, 0, 0, .10); position: relative; }
.login-stat-num { font-family: var(--font-display); font-size: 24px; color: var(--gold-bright); }
.login-stat-label { font-size: 11px; color: var(--text-faint); margin-top: 4px; }
.login-panel-right { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-form-card { width: 380px; max-width: 100%; }
.form-eyebrow { font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--gold-dim); font-weight: 700; margin-bottom: 10px; }
.form-title { font-family: var(--font-display); font-size: 26px; color: var(--text); }
.form-sub { font-size: 13px; color: var(--text-faint); margin: 8px 0 30px; }
.foot-note { text-align: center; font-size: 12px; color: var(--text-faint); margin-top: 26px; }
.server-addr-wrap { position: fixed; left: 0; right: 0; bottom: 18px; z-index: 40; display: flex; justify-content: center; pointer-events: none; }
.license-warn { display: flex; align-items: center; gap: 9px; background: #fff7e6; border: 1px solid #f2c878; color: #8a6100; font-size: 12.5px; line-height: 1.5; border-radius: 10px; padding: 9px 14px; box-sizing: border-box; margin-bottom: 14px; }
.license-warn-ico { flex: none; }
.license-warn-fixed { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 60; box-shadow: 0 4px 14px rgba(0, 0, 0, .10); width: max-content; max-width: calc(100vw - 32px); margin: 0; }
.license-lock-wrap { align-items: center; justify-content: center; padding: 32px; }
.license-lock { max-width: 420px; width: 100%; background: var(--card); border: 1px solid var(--border-soft); border-radius: 16px; padding: 36px 32px; text-align: center; box-shadow: 0 8px 30px rgba(0, 0, 0, .12); }
.license-lock .brand-logo { margin: 0 auto 6px; }
.license-lock-icon { width: 54px; height: 54px; border-radius: 14px; background: var(--danger-soft, rgba(220, 38, 38, .12)); color: var(--danger, #dc2626); display: flex; align-items: center; justify-content: center; margin: 14px auto 14px; }
.license-lock h2 { font-family: var(--font-display); font-size: 22px; color: var(--text); margin-bottom: 8px; }
.license-lock-msg { font-size: 13px; color: var(--text-dim); line-height: 1.6; margin: 0 0 6px; }
.license-lock-line { font-size: 12px; color: var(--text-faint); margin: 3px 0; }
.license-lock-contact { font-size: 13px; color: var(--text); margin: 14px 0 18px; line-height: 1.6; }
.license-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.license-grid span { display: block; font-size: 11px; color: var(--text-faint); margin-bottom: 2px; }
.license-grid strong { font-size: 13px; color: var(--text); word-break: break-all; }
.server-addr-btn { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-faint); background: rgba(0, 0, 0, .28); backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; padding: 7px 14px; cursor: pointer; pointer-events: auto; transition: color .15s, border-color .15s, background .15s; }
.server-addr-btn:hover { color: var(--text); border-color: rgba(255, 255, 255, .4); background: rgba(0, 0, 0, .42); }
.login-server-pop { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); width: 380px; max-width: calc(100vw - 32px); background: var(--card); border: 1px solid var(--border-soft); border-radius: 12px; box-shadow: 0 8px 30px rgba(0, 0, 0, .12); padding: 14px; z-index: 40; }

/* ---- Setup wizard ---- */
.setup-wrap { width: 100%; min-height: 100vh; background: radial-gradient(700px 460px at 50% -10%, oklch(76% 0.12 83 / 0.09), transparent 60%); display: flex; flex-direction: column; align-items: center; padding: 52px 24px 40px; }
.steps { display: flex; align-items: center; gap: 8px; margin-top: 26px; }
.step-label { margin-top: 10px; font-size: 12px; letter-spacing: 0.6px; color: var(--text-faint); font-weight: 600; }
.step-dot { width: 26px; height: 4px; border-radius: 3px; background: var(--gold); }
.step-dot.off { background: var(--border); }
.heading { font-family: var(--font-display); font-style: italic; font-size: 34px; color: var(--text); margin-top: 22px; text-align: center; }
.subhead { font-size: 13.5px; color: var(--text-faint); margin-top: 10px; text-align: center; max-width: 480px; line-height: 1.6; }
.section { width: 100%; max-width: 920px; margin-top: 38px; }
.section-label { font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--gold-dim); font-weight: 700; margin-bottom: 16px; }
.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.type-card { border-radius: 18px; padding: 26px; border: 1.5px solid var(--border-soft); background: var(--surface); position: relative; cursor: pointer; text-align: left; }
.type-card.on { border-color: var(--gold-dim); background: var(--gold-soft); }
.type-title { font-family: var(--font-display); font-style: italic; font-size: 22px; color: var(--text); }
.type-desc { font-size: 12.5px; color: var(--text-faint); margin-top: 8px; line-height: 1.6; }
.radio { position: absolute; top: 22px; right: 22px; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--border); flex: none; }
.radio.on { border-color: var(--gold); background: var(--gold); display: flex; align-items: center; justify-content: center; }
.payroll-row { display: flex; align-items: center; justify-content: space-between; border-radius: 16px; padding: 20px 24px; border: 1px solid var(--border-soft); background: var(--surface); gap: 16px; flex-wrap: wrap; }
.payroll-title { font-size: 14px; font-weight: 700; color: var(--text); }
.payroll-desc { font-size: 12px; color: var(--text-faint); margin-top: 4px; max-width: 440px; line-height: 1.5; }
.yn { display: flex; gap: 6px; background: var(--surface2); border: 1px solid var(--border-soft); border-radius: 11px; padding: 4px; }
.yn-opt { padding: 9px 18px; border-radius: 8px; font-size: 12.5px; font-weight: 700; color: var(--text-faint); background: none; border: none; }
.yn-opt.on { background: var(--gold); color: var(--ink); }
.actions { width: 100%; max-width: 920px; margin-top: 34px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }

/* ---- POS ---- */
.pos-main { flex: 1; display: flex; min-width: 0; }
.bill-main { flex: 1; display: flex; gap: 14px; min-width: 0; min-height: 0; padding: 0; }
.note-block { padding: 4px 16px 2px; display: flex; flex-direction: column; gap: 6px; }
.note-label { font-size: 10.5px; color: var(--text-faint); letter-spacing: .4px; text-transform: uppercase; font-weight: 700; }
.note-block textarea { resize: vertical; min-height: 44px; width: 100%; }
.note-block.compact { padding: 2px 22px 10px; }
.note-block.compact .input { width: 100%; font-size: 12px; }

.note-icon-btn { flex: none; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border-soft); background: var(--surface); color: var(--text-faint); cursor: pointer; font-size: 14px; position: relative; }
.note-icon-btn:hover { border-color: var(--gold-dim); color: var(--gold-bright); }
.note-icon-btn.has { border-color: var(--gold-dim); color: var(--gold-bright); background: var(--gold-soft); }
.note-dot { position: absolute; top: -3px; right: -3px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold-bright); }
.line-note-pop { padding: 8px 0 0; }
.line-note-pop textarea { width: 100%; resize: vertical; font-size: 12px; }

.order-total-line { display: flex; align-items: baseline; justify-content: space-between; padding: 14px 22px; border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); }
.order-total-label { font-size: 12.5px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .3px; }
.order-total-val { font-family: var(--font-display); font-size: 26px; color: var(--gold-bright); }
.bill-panel { width: auto; flex: 1; min-width: 0; background: var(--bg2); display: flex; flex-direction: column; gap: 10px; padding: 12px; min-height: 0; overflow: hidden; }
.bill-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border-soft); padding-bottom: 8px; }
.bill-meta { font-size: 12px; color: var(--text-dim); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bill-number { font-size: 16px; font-weight: 700; color: var(--text); font-family: var(--font-display); }
.bill-due { display: flex; align-items: baseline; gap: 10px; text-align: right; }
.bill-due-label { font-size: 11px; color: var(--text-faint); letter-spacing: .4px; text-transform: uppercase; font-weight: 700; }
.bill-due-num { font-family: var(--font-display); font-size: 24px; color: var(--gold-bright); line-height: 1.1; font-weight: 800; }
.bill-head .seg { padding: 2px; border-radius: 8px; }
.bill-head .seg-btn { padding: 4px 10px; font-size: 10.5px; border-radius: 6px; }
.bill-foot-actions { display: flex; gap: 10px; margin-top: 4px; }
.bill-body { display: grid; grid-template-columns: 1fr 340px; grid-template-rows: minmax(0, 1fr); gap: 12px; min-height: 0; flex: 1; }
.bill-items { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface); overflow: hidden; }
.bill-items-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border-soft); font-size: 12.5px; font-weight: 700; color: var(--text); }
.bill-items-head .bi-count { flex: none; font-size: 14px; font-weight: 800; color: var(--text); font-family: var(--font-display); white-space: nowrap; }
.bill-items-head .bi-type { flex: 1; text-align: center; font-size: 11.5px; letter-spacing: .3px; text-transform: uppercase; color: var(--gold-bright); font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bill-items-head .bi-date { flex: none; font-size: 11.5px; color: var(--text-dim); font-weight: 600; white-space: nowrap; }
.bill-items-list { flex: 1; overflow: auto; padding: 12px 16px; }
.bill-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; align-content: start; }
.bill-tile { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface2); }
.bill-tile .bt-name { font-size: 12.5px; font-weight: 700; color: var(--text); line-height: 1.3; }
.bill-tile .bt-qty { font-size: 11px; color: var(--gold-bright); font-weight: 700; }
.bill-tile .bt-line { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.bill-tile .bt-unit { font-size: 10.5px; color: var(--text-faint); }
.bill-tile .bt-total { font-family: var(--font-display); font-size: 15px; color: var(--text); }
.bill-tile .bt-note { font-size: 10px; color: var(--gold-bright); font-style: italic; }
.billing-item { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border-soft); }
.billing-item:last-child { border-bottom: none; }
.bill-item-note { font-size: 10.5px; color: var(--gold-bright); margin-top: 3px; font-style: italic; }
.bill-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; overflow: auto; min-height: 0; }
.bill-sidepanel { display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--border-soft); border-radius: 14px; background: var(--surface); padding: 14px; overflow: auto; }
.bill-sidepanel .sp-title { font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--text-faint); margin-bottom: 2px; }
.bill-sidepanel .btn { justify-content: flex-start; }
/* Screen-level billing actions, OUTSIDE the table's bill panel. */
.actions-panel { flex: none; width: 210px; display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--border-soft); border-radius: 14px; background: var(--surface); padding: 14px; overflow: auto; min-height: 0; }
.actions-panel .sp-title { font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--text-faint); margin-bottom: 2px; }
.actions-panel .btn { justify-content: flex-start; }
/* The same actions as a single horizontal bar on the POS screen itself - the
   separate Operations page is gone, so they sit directly above product search.
   Used by the canteen build's top bar; the POS edition keeps .actions-panel. */
.actions-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.actions-row .btn { padding: 6px 11px; font-size: 12px; white-space: nowrap; justify-content: center; }
.actions-row .input { min-height: 30px; padding: 4px 8px; font-size: 12px; border-radius: 8px; }
.chip-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--gold-bright); margin-left: 6px; vertical-align: middle; }
.bill-list-wrap { flex: 1; overflow: auto; min-height: 0; }
.bill-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.bill-table th { position: sticky; top: 0; background: var(--surface2); text-align: left; font-size: 10.5px; letter-spacing: .3px; text-transform: uppercase; color: var(--text-faint); padding: 8px 10px; border-bottom: 1px solid var(--border-soft); white-space: nowrap; }
.bill-table td { padding: 9px 10px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.bill-table tbody tr:hover { background: var(--surface2); }
.c-sn { width: 40px; color: var(--text-faint); }
.c-name { width: auto; }
.c-unit { width: 70px; color: var(--text-faint); }
.c-rate { width: 100px; text-align: right; }
.c-qty { width: 70px; text-align: center; }
.c-total { width: 120px; text-align: right; }
.bill-table .bt-note { font-size: 10.5px; color: var(--gold-bright); font-style: italic; margin-top: 2px; }
.bill-action-row { display: flex; gap: 10px; margin-top: 4px; }
.bill-action-row .btn { flex: 1; }
.tender-row { display: flex; align-items: center; gap: 8px; }
.tender-label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .3px; font-weight: 700; }
.tender-input { width: 150px; flex: none; font-size: 16px; font-family: var(--font-display); }
.bill-summary { border: 1px solid var(--border-soft); border-radius: 12px; padding: 8px 12px; flex: none; background: var(--surface); display: flex; flex-direction: column; gap: 3px; }
.bill-summary .srow { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12.5px; padding: 2px 0; color: var(--text); }
.bill-summary .srow .tabular { font-family: var(--font-body); font-variant-numeric: tabular-nums; }
.bill-summary .srow.total { border-top: 1px dashed var(--border-soft); margin-top: 2px; padding-top: 4px; }
.bill-summary .srow.total span:first-child { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
.bill-summary .srow.total .val { font-size: 16px; color: var(--gold-bright); font-weight: 800; }
.seg { display: flex; background: var(--surface); border: 1px solid var(--border-soft); border-radius: 10px; padding: 3px; }
.seg-btn { padding: 6px 12px; border-radius: 8px; font-size: 11.5px; font-weight: 600; color: var(--text-faint); background: none; border: none; }
.seg-btn.on { background: var(--gold); color: var(--ink); }
.disc-row { display: flex; align-items: center; gap: 8px; }
.disc-row .input { flex: 1; min-width: 0; }.pos-left { flex: 1; display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--border-soft); }.pos-top { padding: 18px 26px 14px; border-bottom: 1px solid var(--border-soft); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.order-tabs { display: flex; gap: 6px; background: var(--surface); border: 1px solid var(--border-soft); border-radius: 11px; padding: 4px; }
.order-tab { padding: 8px 16px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--text-faint); background: none; border: none; }
.order-tab.on { background: var(--gold); color: var(--ink); }
.cats { display: flex; gap: 8px; padding: 16px 26px 4px; overflow-x: auto; flex: none; }
.cat-pill { flex: none; padding: 8px 15px; border-radius: 20px; font-size: 12px; font-weight: 600; color: var(--text-dim); background: var(--surface); border: 1px solid var(--border-soft); }
.cat-pill.on { background: var(--gold-soft); color: var(--gold-bright); border-color: transparent; }
.pgrid { flex: 1; overflow: auto; padding: 16px 26px 26px; display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; align-content: start; }

/* MPOS CMS (canteen) edition: compact product cards — the category sub-line is
   dropped, the price is bold, and the card + grid cell are tightened, exactly
   as the original canteen build shipped. Scoped to html.edition-canteen so the
   POS/Hotel editions keep the rules above. The two media blocks repeat the
   shared breakpoints because these scoped selectors outrank a bare `.pgrid` /
   `.pcard` and would otherwise pin the desktop values on a phone. */
.edition-canteen .pmeta { display: none; }
.edition-canteen .pprice { font-weight: 700; }
.edition-canteen .pcard { border-radius: 12px; padding: 8px; }
/* Card height: the original canteen build used a 60px product image, the repo
   raised it to 88px — that 28px is the entire height difference. No media
   variants of this rule exist, so one declaration covers every breakpoint. */
.edition-canteen .pimg-photo { height: 60px; }
/* Total payable: the original canteen build printed it black at 700 weight
   (the repo re-styled it gold and dropped the weight), with a tighter top
   padding on the rule that frames it. */
.edition-canteen .order-total-val { font-weight: 700; color: var(--text); }
.edition-canteen .order-total-line { padding: 8px 22px 14px; }
.edition-canteen .pgrid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
@media (max-width: 760px) {
  .edition-canteen .pcard { padding: 10px; }
  .edition-canteen .pgrid { padding: 12px 14px 20px; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(125px, 1fr)); }
}
@media (max-width: 480px) {
  .edition-canteen .pcard { padding: 8px; }
  .edition-canteen .pgrid { grid-template-columns: repeat(auto-fill, minmax(106px, 1fr)); gap: 8px; padding: 10px 12px 18px; }
}
.pcard { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 14px; padding: 10px; position: relative; text-align: left; cursor: pointer; }
.pcard:hover { border-color: var(--gold-dim); }
.pimg-photo { width: 100%; height: 88px; object-fit: cover; border-radius: 10px; margin-bottom: 8px; background: var(--surface2); border: 1px solid var(--border-soft); }
.pname { font-size: 11.5px; font-weight: 600; color: var(--text); line-height: 1.3; }
.pmeta { font-size: 10px; color: var(--text-faint); margin-top: 2px; }
.pprice { font-family: var(--font-display); font-size: 14px; color: var(--gold-bright); margin-top: 7px; }
.qbadge { position: absolute; top: 10px; right: 10px; background: var(--gold); color: var(--ink); font-size: 10.5px; font-weight: 800; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.precipe { position: absolute; top: 10px; left: 10px; background: var(--gold-soft); color: var(--gold-bright); border: 1px solid var(--gold-dim); font-size: 8.5px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; padding: 2px 6px; border-radius: 8px; }
.cart { width: 470px; flex: none; display: flex; flex-direction: column; background: var(--bg2); }
.cart-head { padding: 18px 22px; border-bottom: 1px solid var(--border-soft); display: flex; align-items: center; justify-content: space-between; }
.cart-title { font-family: var(--font-display); font-style: italic; font-size: 19px; }
.cart-cust { display: flex; align-items: center; gap: 8px; padding: 11px 22px; border-bottom: 1px solid var(--border-soft); font-size: 12.5px; color: var(--text-dim); }
.cart-items { flex: 1; overflow: auto; padding: 8px 22px; }
.citem { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.cimg { width: 38px; height: 38px; border-radius: 8px; flex: none; }
.cname { font-size: 12.5px; font-weight: 600; color: var(--text); }
.cunit { font-size: 10.5px; color: var(--text-faint); margin-top: 2px; }
.stepper { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border-soft); border-radius: 8px; padding: 4px 8px; }
.step-btn { width: 16px; text-align: center; font-size: 13px; color: var(--text-dim); background: none; border: none; }
.cqty { font-size: 12px; font-weight: 700; width: 14px; text-align: center; }
.cline { width: 64px; text-align: right; font-size: 12.5px; font-weight: 600; color: var(--text); }
.summary { padding: 16px 22px; border-top: 1px solid var(--border-soft); display: flex; flex-direction: column; gap: 9px; }
.srow { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-dim); }
.srow.total { font-size: 17px; font-weight: 700; color: var(--text); padding-top: 10px; border-top: 1px solid var(--border-soft); margin-top: 2px; }
.srow.total .val { font-family: var(--font-display); color: var(--gold-bright); }
.pay-methods { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; padding: 4px 22px 14px; }
.pm { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: 10px; border: 1px solid var(--border-soft); background: var(--surface); color: var(--text-faint); font-size: 10.5px; font-weight: 600; }
.pm.on { border-color: var(--gold-dim); color: var(--gold-bright); background: var(--gold-soft); }
.cart-actions { padding: 0 22px 22px; display: flex; flex-direction: column; gap: 10px; }
.split-list { display: flex; flex-direction: column; gap: 6px; padding: 0 22px 6px; }
.split-row { display: flex; align-items: center; justify-content: space-between; padding: 7px 12px; border-radius: 8px; background: var(--surface2); border: 1px solid var(--border-soft); font-size: 12.5px; color: var(--text-dim); }
.split-mode { font-weight: 700; color: var(--text); font-size: 11px; letter-spacing: .2px; text-transform: uppercase; }
.split-actions { display: flex; gap: 8px; }
.change-banner { text-align: center; padding: 8px; border-radius: 8px; background: var(--success-soft); color: var(--success); font-size: 12.5px; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(10, 12, 16, 0.6); display: flex; align-items: center; justify-content: center; z-index: 600; }
.modal-card { width: min(420px, calc(100vw - 48px)); max-height: 80vh; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; }
.split-lines { display: flex; flex-direction: column; gap: 6px; max-height: 40vh; overflow: auto; }
.split-line { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border-soft); background: var(--surface2); cursor: pointer; font-size: 12.5px; color: var(--text); }

/* ---- Toggle switch, from Masters/Settings.dc.html — used everywhere a
   boolean flag needs a real on/off control, not just decoration ---- */
.switch { width: 36px; height: 20px; border-radius: 20px; background: var(--gold); position: relative; flex: none; border: none; padding: 0; cursor: pointer; }
.switch::after { content: ''; position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); }
.switch.off { background: var(--surface2); border: 1px solid var(--border); }
.switch.off::after { left: 2px; right: auto; background: var(--text-faint); }
.switch:disabled { opacity: .6; cursor: not-allowed; }

/* ---- Generic tab strip — mtabs/wtabs/ttabs/wftabs/stabs in the mockups
   all share this one shape, so it's a single reusable class here ---- */
.tabstrip { display: flex; flex-wrap: wrap; gap: 4px; background: var(--surface); border: 1px solid var(--border-soft); border-radius: 11px; padding: 4px; flex: none; width: fit-content; max-width: 100%; }
.tabstrip-btn { padding: 8px 15px; border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--text-faint); background: none; border: none; white-space: nowrap; }
.tabstrip-btn.on { background: var(--gold); color: var(--ink); }

/* ---- Page selector dropdown (replaces tabstrip for sub-page switching) ---- */
.page-select {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  width: fit-content;
}
.page-select select {
  padding: 6px 28px 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface2);
  border: 1px solid var(--border-soft);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}
.page-select select:focus { outline: 2px solid var(--gold); outline-offset: -1px; }

/* ---- Single-column page layout (form top, list below) ---- */
.page-stack { display: flex; flex-direction: column; gap: 20px; }
.page-stack > * { min-width: 0; }
.page-stack .form-card, .page-stack .card { max-height: none; }

/* Legacy split classes — kept for pages not yet migrated */
.split { flex: 1; display: grid; grid-template-columns: 1fr 560px; gap: 20px; min-height: 0; align-items: start; }
.split-large { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(640px, 1.3fr); gap: 20px; min-height: 0; align-items: start; }
.split-equal { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; min-height: 0; align-items: start; }
.split-wide { grid-template-columns: minmax(0, 1fr) minmax(680px, 1.4fr); }
.list-card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 14px; padding: 18px; overflow: auto; max-height: 100%; }
.split.compact { grid-template-columns: 1fr 520px; gap: 16px; }
.list-card.compact { padding: 14px 16px; }
.list-card.compact th { padding: 0 12px 8px; }
.list-card.compact td { padding: 7px 12px; }
.list-card.compact table.acc-tree { border-collapse: collapse; }
.list-card.compact table.acc-tree thead th { padding: 0 12px 6px; }
.list-card.compact table.acc-tree tbody td { padding: 2px 12px; font-size: 12.5px; border-top: none; }
.list-card.compact table.acc-tree tbody { line-height: 1.3; }
table.acc-tree td .acc-caret { display: inline-block; width: 15px; margin-right: 4px; border: none; background: none; color: var(--text-faint); cursor: pointer; font-size: 11px; padding: 0; vertical-align: 1px; }
table.acc-tree td .acc-caret:hover { color: var(--gold); }
table.acc-tree td .acc-caret-noop { cursor: default; }
table.acc-tree td .acc-caret-noop:hover { color: var(--text-faint); }
.list-card tr.row-clickable { cursor: pointer; }
.list-card tr.row-clickable:hover td { color: var(--text); }
tr.row-clickable { cursor: pointer; }
tr.row-clickable:hover td { color: var(--text); }
.doc-lines-table tr.row-clickable td:first-child { color: var(--text); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn, .line-btn, .pur-disc-seg button, .type-seg-btn, .close-x, .bs-btn { -webkit-tap-highlight-color: transparent; }
.list-card tr.row-selected { background: var(--gold-soft); }

/* Members page: points scheme (top) over a compact, scrollable members list
   on the left half; the member add/view form sits fixed on the right half. */
.members-grid { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; min-height: 0; }
.members-col { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.scheme-card { flex: none; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.scheme-card-head { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; font-weight: 600; color: var(--text-dim); }
.scheme-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 10px; }
.scheme-grade { display: flex; flex-direction: column; gap: 5px; }
.scheme-grade .grade-badge { align-self: flex-start; }
.scheme-grade label { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 11px; color: var(--text-faint); font-weight: 500; }
.scheme-grade .scheme-input { width: 86px; padding: 5px 8px; font-size: 12.5px; height: auto; }
.members-list { flex: 1; min-height: 0; overflow: auto; padding: 10px 0 10px; }
.members-list th { padding: 0 14px 6px; }
.members-list td { padding: 5px 14px; font-size: 12.5px; }
.members-form { flex: none; min-height: 0; }
.members-form .form-head { flex: none; }
.thumb { width: 34px; height: 34px; border-radius: 8px; flex: none; }
img.thumb { object-fit: cover; display: block; border: 1px solid var(--border-soft); }
.thumb-empty { background: var(--surface2); border: 1px dashed var(--border-soft); }
.psku { font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.view-name { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.3; }
.view-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-top: 4px; }
.view-grid > div { font-size: 12.5px; color: var(--text); }
.view-label { display: block; font-size: 10px; letter-spacing: .3px; text-transform: uppercase; color: var(--text-faint); margin-bottom: 2px; }
.chip-secondary { background: var(--surface2); }
.check-list { border: 1px solid var(--border-soft); border-radius: 10px; background: var(--surface2); overflow: auto; max-height: 148px; }
.check-list label { display: flex; align-items: center; gap: 8px; padding: 7px 10px; font-size: 12.5px; color: var(--text); cursor: pointer; }
.check-list label:hover { background: var(--surface); }
.check-list label + label { border-top: 1px solid var(--border-soft); }
.check-list input { accent-color: var(--gold-bright); }
.check-list input:disabled, .input:disabled { opacity: .5; cursor: not-allowed; }
.type-seg-btn:disabled { opacity: .55; cursor: not-allowed; }
.form-card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 14px; padding: 22px; overflow: auto; display: flex; flex-direction: column; gap: 16px; max-height: 100%; }
.doc-form { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 14px; padding: 22px; display: flex; flex-direction: column; gap: 15px; max-width: 1400px; width: 100%; margin: 0 auto; }
.doc-form .frow { gap: 16px; }
.page-action-bar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border-soft); }
.page-action-title { font-family: var(--font-display); font-size: 19px; font-style: italic; font-weight: 600; color: var(--text); margin-right: auto; }
.page-title-txn { font-family: var(--font-display); font-size: 19px; font-style: italic; font-weight: 600; color: var(--text); }
/* Shared shell for every Transactions sub-page so the title, action buttons
   and form footprint sit in exactly the same place on all of them. */
.txn-page { display: flex; flex-direction: column; flex: 1; min-height: 0; width: 100%; max-width: 1400px; margin: 0 auto; gap: 12px; }
.txn-content > .txn-page { max-width: none; margin: 0; }
.txn-page > .page-action-bar { flex: none; margin-bottom: 0; }
.txn-page > .doc-form, .txn-page > .pur-form { flex: 1; min-height: 0; width: 100%; max-width: none; margin: 0; }
.txn-page > .doc-form { overflow: auto; }
.txn-page > .pur-form { height: auto; }
.page-invoice-no { font-family: var(--font-display); font-weight: 800; font-size: 16px; color: var(--text); letter-spacing: .4px; }
.pur-form { display: flex; flex-direction: column; gap: 10px; height: calc(100vh - 112px); max-width: 1400px; width: 100%; margin: 0 auto; overflow: hidden; }
.pur-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: none; }
.pur-head .bill-type { width: 170px; }
.pur-kv { display: grid; grid-template-columns: 150px 150px 1fr; gap: 10px; flex: none; }
.pur-kv2 { display: grid; grid-template-columns: 130px 150px 1fr; gap: 10px; flex: none; }
.pur-cheque { display: grid; grid-template-columns: 175px 150px 160px; gap: 10px; flex: none; }
.pur-ledger-row { display: grid; grid-template-columns: 220px 220px; gap: 10px; flex: none; }
.pur-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 16px; }
.pur-left { display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 0; }
.pur-items { display: flex; flex-direction: column; flex: 1; min-height: 0; background: var(--surface); border: 1px solid var(--border-soft); border-radius: 14px; overflow: hidden; }
.pur-items-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border-soft); font-size: 12.5px; font-weight: 700; color: var(--text); }
.pur-list-wrap { flex: 1; overflow: hidden; min-height: 0; }
.pur-row { display: grid; grid-template-columns: 1.5fr 0.85fr 0.55fr 0.7fr 1fr 0.55fr 0.85fr 42px; gap: 8px; padding: 6px 14px; align-items: center; border-bottom: 1px solid var(--border-soft); }
.pur-entry { display: flex; flex-direction: column; flex: none; background: var(--surface); border: 1px solid var(--border-soft); border-radius: 14px; overflow: hidden; }
.pur-entry-head { display: grid; grid-template-columns: 1.5fr 0.85fr 0.55fr 0.7fr 1fr 0.55fr 0.85fr 42px; gap: 8px; padding: 8px 14px 0; align-items: center; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-faint); }
.pur-row:nth-child(even) { background: var(--surface2); }
.pur-row .pur-name { font-weight: 600; color: var(--text); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pur-foot-row { display: grid; grid-template-columns: 1.5fr 0.85fr 0.55fr 0.7fr 1fr 0.55fr 0.85fr 42px; gap: 8px; padding: 8px 14px 10px; align-items: center; }
.pur-foot-row .input { min-width: 0; }
.pur-kind-bar { display: flex; align-items: center; padding: 8px 14px 0; }
.pur-kind-name { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pur-kind-name .input { width: 100%; }
.pur-row .pur-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pur-disc-cell { display: flex; gap: 4px; align-items: center; }
.pur-disc-seg { display: flex; gap: 2px; background: var(--surface); border: 1px solid var(--border-soft); border-radius: 7px; padding: 2px; flex: none; }
.pur-disc-seg button { width: 26px; height: 24px; border: none; background: none; border-radius: 5px; font-size: 10.5px; font-weight: 700; color: var(--text-faint); cursor: pointer; padding: 0; }
.pur-disc-seg button.on { background: var(--gold); color: var(--ink); }
.pur-side { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.bill-disc-input { display: flex; align-items: center; gap: 8px; }
.bill-disc-input .pur-disc-seg button { width: 30px; }
.bill-disc-input .input { flex: 1; min-width: 0; }
.pur-side .bill-summary { flex: none; }
.pur-side .form-foot { flex: none; }
.bs-field { position: relative; }
.bs-field > .input { width: 100%; text-align: left; cursor: pointer; font-variant-numeric: tabular-nums; }
.bs-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bs-btn svg { flex: none; opacity: .5; width: 14px; height: 14px; }
.bs-popper { position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px; box-shadow: 0 10px 28px rgba(0, 0, 0, .2); display: flex; gap: 8px; }
.bs-popper .input { min-width: 96px; }
.emp-picker { position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; width: 100%; min-width: 320px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 14px 34px -12px oklch(0% 0 0 / 65%); overflow: hidden; }
.emp-picker-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--border-soft); }
.emp-picker-head .muted { font-size: 11.5px; }
.emp-picker-list { max-height: 236px; overflow: auto; padding: 4px; display: flex; flex-direction: column; gap: 2px; }
.emp-picker-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text-dim); font-size: 13px; cursor: pointer; background: none; border: none; text-align: left; }
.emp-picker-item:hover { background: var(--surface2); }
.emp-picker-item.on { background: var(--gold-soft); color: var(--text); }
.tick { width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--border); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; color: #fff; flex: none; }
.tick.on { background: var(--gold-bright); border-color: var(--gold-bright); }
.emp-picker-name { font-weight: 600; color: inherit; flex: none; }
.emp-picker-role { margin-left: auto; font-size: 11.5px; color: var(--text-faint); }
.pur-search { width: 100%; background: var(--bg2); }
.pur-toolbar { display: flex; align-items: center; gap: 10px; }
.pur-toolbar .search-pill { flex: 1; }
.pur-foot-row .pur-disc-seg button, .pur-row .pur-disc-seg button { width: 24px; height: 23px; }
.pur-form { gap: 6px; }
.pur-form .field { margin-bottom: 0; gap: 3px; }
.pur-form .field label { font-size: 10px; margin-bottom: 0; color: var(--text-faint); }
.pur-form .input, .pur-form select.input, .pur-form .bs-btn { padding: 5px 8px; font-size: 12.5px; border-radius: 8px; min-height: 28px; }
.pur-form .input:focus, .pur-form select.input:focus { box-shadow: 0 0 0 2px var(--gold-soft); }
.pur-kv, .pur-kv2, .pur-cheque { gap: 6px; }
.pur-body { gap: 10px; }
.pur-left { gap: 6px; }
.pur-items-head { padding: 6px 10px; font-size: 11px; }
.pur-row { gap: 5px; padding: 3px 10px; }
.pur-row .pur-name { font-size: 12px; }
.pur-entry-head { gap: 5px; padding: 6px 10px 0; font-size: 9px; }
.pur-foot-row { gap: 5px; padding: 5px 10px 6px; }
.pur-side { gap: 6px; }
.pur-disc-cell { gap: 3px; }
.pur-disc-seg button { width: 22px; height: 20px; font-size: 9.5px; }
.pur-foot-row .pur-disc-seg button, .pur-row .pur-disc-seg button { width: 22px; height: 20px; }
.pur-form .bill-disc-input .pur-disc-seg button, .pur-form .pur-disc-seg button { width: 24px; height: 22px; }
.pur-form .pur-list-wrap .pur-row .input, .pur-form .pur-list-wrap .pur-row select.input { padding: 3px 5px; font-size: 12px; }
.pur-form .line-btn { width: 22px; height: 22px; font-size: 12px; border-radius: 6px; }
.pur-form .bill-summary { padding: 8px 12px; }
.pur-form .bill-summary .srow { font-size: 12px; padding: 3px 0; }
.pur-form .bill-summary .srow.total { padding-top: 6px; }
.pur-form .bill-summary .srow.total .val { font-size: 17px; }
.pur-form .form-foot .btn { padding: 7px 10px; font-size: 12px; }
.pur-form .bs-popper .input { padding: 5px 8px; font-size: 12px; min-width: 84px; }
.pur-form .bs-btn svg { width: 13px; height: 13px; }
.pur-form .page-invoice-no { font-size: 15px; }
.purchase-line-grid { display: grid; grid-template-columns: 1.6fr 0.9fr 0.55fr 0.75fr 0.6fr 0.6fr 0.95fr 58px; gap: 8px; align-items: center; }
.stl-entry-head, .stl-entry-row, .stl-row { display: grid; grid-template-columns: minmax(0, 1.7fr) 96px 104px minmax(0, 1.1fr) 34px; gap: 8px; align-items: center; }
.stl-entry-head { padding: 8px 14px 0; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-faint); }
.stl-entry-row { padding: 8px 14px 10px; }
.stl-entry-row .input, .stl-row .input { min-width: 0; }
.stl-row { padding: 4px 14px; border-bottom: 1px solid var(--border-soft); }
.stl-row:nth-child(even) { background: var(--surface2); }
.stl-name { font-weight: 600; color: var(--text); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stl-num { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-dim); }
.stl-list { flex: 1; overflow-y: auto; min-height: 0; }
.stl-fill { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.stl-fill .pur-form { height: auto; flex: 1; min-height: 0; }
.stl-fill .page-action-bar { flex: none; }
.purchase-line-grid .input { min-width: 0; }
.purchase-line-head { padding: 0 2px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--text-dim); }
.purchase-line-amt { text-align: right; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.line-btn { width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--border-soft); background: var(--surface2); color: var(--text-dim); display: flex; align-items: center; justify-content: center; font-size: 14px; line-height: 1; cursor: pointer; }
.line-btn:hover { color: var(--gold-bright); border-color: var(--gold-dim); }
.line-btn.add { background: var(--gold-soft); border-color: var(--gold-dim); color: var(--gold-bright); font-weight: 700; }
.jv-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.jv-dates .field { margin-bottom: 0; }
.jv-dates .input, .jv-dates .disabled-field { font-size: 12px; padding: 7px 10px; }
.jv-lines-head, .jv-lines .pur-row { grid-template-columns: minmax(120px, 1.4fr) 90px 90px minmax(130px, 1.5fr) 34px; }
.jv-lines-head { display: grid; gap: 6px; padding: 6px 10px 0; align-items: center; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-faint); }
.jv-lines .pur-row { padding: 5px 10px; }
.jv-lines .pur-row .input { font-size: 12px; min-width: 0; padding: 6px 8px; }
/* Opening Balance voucher lines: Party/Account | Debit | Credit | action
   (the JV line grid minus the per-line narration column). */
.ob-lines-head, .ob-lines .pur-row { grid-template-columns: minmax(160px, 2fr) 110px 110px 34px; }
.ob-lines-head { display: grid; gap: 6px; padding: 6px 10px 0; align-items: center; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-faint); }
.ob-lines .pur-row { padding: 5px 10px; }
.ob-lines .pur-row .input { font-size: 12px; min-width: 0; padding: 6px 8px; }
/* Opening Balance form header: compact narration + the Party/Account/Both
   toggle share one line (the toggle filters what the line pickers offer). */
.ob-head-row { display: flex; gap: 10px; align-items: center; }
.ob-head-row .ob-narration { flex: 1; min-width: 0; font-size: 12px; padding: 6px 10px; }
.ob-head-row .type-seg { flex: none; }
/* The New form fills the remaining viewport height instead of stopping at
   its content (it used to end halfway down the screen, and the card's
   overflow:auto clipped the line picker's popup at that edge). Totals and
   actions pin to the bottom of the grown card. */
.ob-form { flex: 1; min-height: 0; }
.ob-form .jv-totals { margin-top: auto; }
/* Typable target dropdown for the opening-balance lines: focus opens, type
   filters, click picks (a plain <select> can't be searched). */
.combo { position: relative; min-width: 0; }
.combo .input { width: 100%; font-size: 12px; padding: 6px 8px; }
.combo-pop { position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; right: 0; max-height: min(240px, 40vh); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 28px rgba(0, 0, 0, .2); padding: 4px; display: flex; flex-direction: column; gap: 2px; }
.combo-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 9px; border: none; background: none; border-radius: 6px; font-size: 12.5px; color: var(--text); text-align: left; cursor: pointer; }
.combo-item.active { background: var(--surface2); }
.combo-item:hover { background: var(--surface2); }
.combo-item.on { background: var(--gold-soft); color: var(--gold-bright); }
.combo-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-kind { flex: none; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--text-faint); }
.combo-empty { padding: 8px 9px; font-size: 12px; }
.jv-acc { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.jv-acc .balance-hint { margin-top: 0; font-size: 9.5px; }
.jv-narration .input { font-size: 12px; padding: 6px 10px; }
.jv-totals { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 10px 0 0; font-size: 12.5px; color: var(--text-dim); flex-wrap: wrap; }
.jv-totals b { font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; }
.jv-totals-bar { opacity: .4; }
.jv-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.jv-actions .btn, .jv-actions .btn-block { width: 100%; }
.jv-dates .bs-popper .input { min-width: 0; padding: 5px 8px; font-size: 12px; }
.invoice-summary { margin-left: auto; width: 320px; padding: 14px 16px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface2); }
.invoice-summary .srow { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; font-size: 13px; color: var(--text-dim); }
.invoice-summary .srow .amt { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.invoice-summary .srow.total { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 9px; font-size: 15px; }
.invoice-summary .srow.total .lbl, .invoice-summary .srow.total .amt { color: var(--text); font-weight: 800; }
.form-head { display: flex; align-items: center; justify-content: space-between; }
.form-head-actions { display: flex; align-items: center; gap: 8px; }
.form-card-title { font-family: var(--font-display); font-style: italic; font-size: 19px; color: var(--text); }
.close-x { background: none; border: none; color: var(--text-faint); padding: 4px; }
.close-x:hover { color: var(--text); }
.upload-box { height: 90px; border-radius: 10px; border: 1.5px dashed var(--border); display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--text-faint); font-size: 12px; }
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.frow .field { margin-bottom: 0; }
.field-row { display: flex; gap: 8px; align-items: stretch; }
.field-row .input { flex: 1; }

.paymt { border: 1px solid var(--border-soft); border-radius: 12px; padding: 12px 14px; background: var(--surface); display: flex; flex-direction: column; gap: 10px; }
.paymt-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.paymt-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--text); }
.paymt-note { font-size: 12px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.paymt-row { display: flex; gap: 8px; align-items: stretch; }
.paymt-row .input { flex: 1; }
.paymt-cheque { display: flex; gap: 8px; }
.paymt-cheque .input { flex: 1; }
.paymt-cheque-note { font-size: 11.5px; color: var(--text-faint); }
.quick-add { width: 38px; flex: none; border-radius: 8px; background: var(--gold-soft); border: 1px solid var(--gold-dim); color: var(--gold-bright); display: flex; align-items: center; justify-content: center; }
.toggle-field { display: flex; align-items: center; justify-content: space-between; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 0 12px; height: 40px; }
.toggle-field span { font-size: 12px; color: var(--text-dim); }
.form-foot { display: flex; gap: 10px; margin-top: 4px; }
.type-seg { display: flex; gap: 4px; background: var(--surface2); border: 1px solid var(--border); border-radius: 9px; padding: 3px; }
.type-seg-btn { flex: 1; text-align: center; padding: 7px 6px; border-radius: 7px; font-size: 11.5px; font-weight: 600; color: var(--text-faint); background: none; border: none; }
.type-seg-btn.on { background: var(--gold); color: var(--ink); }
/* Purchase/Return form segmented toggles: keep multi-word labels ("Non-trading")
   on ONE line so the control stays a single row tall instead of wrapping and
   growing taller than the VAT/PAN toggle next to it. */
.pur-form .type-seg-btn { white-space: nowrap; }
.disabled-field { width: 100%; padding: 10px 12px; border-radius: 8px; background: transparent; border: 1px dashed var(--border-soft); color: var(--text-faint); font-size: 11.5px; font-style: italic; }
.bs-date { color: var(--gold-bright); font-style: normal; border-style: solid; border-color: var(--gold-dim); }
.bom-card { border: 1px solid var(--gold-dim); background: var(--gold-soft); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.bom-head { display: flex; align-items: center; justify-content: space-between; }
.bom-title { font-size: 12px; font-weight: 700; color: var(--gold-bright); display: flex; align-items: center; gap: 7px; }
.bom-row { display: grid; grid-template-columns: 1fr 70px 70px 26px; gap: 7px; align-items: center; }
.bom-row .input { padding: 8px 10px; font-size: 12px; background: var(--surface); }
.bom-remove { width: 26px; height: 26px; border-radius: 7px; background: var(--surface); border: 1px solid var(--border-soft); color: var(--text-faint); display: flex; align-items: center; justify-content: center; flex: none; }
.bom-add { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px; border-radius: 8px; border: 1px dashed var(--gold-dim); color: var(--gold-bright); font-size: 11.5px; font-weight: 600; background: none; width: 100%; }
.bom-cost { display: flex; align-items: center; justify-content: space-between; padding-top: 8px; border-top: 1px solid var(--border-soft); }
.bom-cost span:first-child { font-size: 11px; color: var(--text-faint); }
.bom-cost span:last-child { font-size: 14px; font-weight: 700; color: var(--gold-bright); }
.type-chip { display: inline-flex; padding: 2px 8px; border-radius: 20px; font-size: 9.5px; font-weight: 700; letter-spacing: .2px; text-transform: uppercase; }
.type-chip.inventory { background: var(--success-soft); color: var(--success); }
.type-chip.service { background: oklch(70% 0.10 250 / 16%); color: oklch(72% 0.11 250); }
.type-chip.recipe { background: var(--gold-soft); color: var(--gold-bright); }
.type-chip.consumable { background: var(--surface2); color: var(--text-faint); }
.type-chip.raw { background: oklch(65% 0.13 40 / 16%); color: oklch(70% 0.14 40); }

.conv-row { display: grid; grid-template-columns: 1fr 90px 90px 26px; gap: 7px; align-items: center; }
.conv-row .input { padding: 8px 10px; font-size: 12px; background: var(--surface); }
.conv-unit-hint { font-size: 11px; color: var(--text-dim); white-space: nowrap; }

/* ---- Product master (compact layout) ---- */
.search-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.search-toolbar .search-pill { width: 260px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.ledger-browser-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 16px; align-items: stretch; }
@media (max-width: 760px) { .ledger-browser-grid { grid-template-columns: 1fr !important; gap: 12px; } }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.form-card.compact { padding: 16px 18px; gap: 12px; }
.form-card.compact .field { margin-bottom: 10px; }
.form-card.compact .field label { margin-bottom: 4px; }
.form-card.compact .bom-card { padding: 10px 12px; gap: 8px; }
.form-card.compact .bom-row, .form-card.compact .conv-row { gap: 6px; }

/* Users page heading controls: keep tabs centered on the title line.
   NOTE: .users-head-tabs is absolutely centered, so it must anchor to the
   action bar (the full page width) -- anchoring it to .users-head-actions
   (which is flex:1 and starts after the title block) pushed the tabs right
   of true center. */
.users-head-actions {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}
.users-page-action-bar {
  position: relative;
  align-items: flex-start;
}
.users-title-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-right: auto;
}
.users-title-sub {
  margin-top: 0;
}
.users-head-tabs {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

/* Users tab: tighter list + form spacing for a compact view. */
.users-compact { gap: 12px; }
.users-compact .list-card.compact { padding: 10px 12px; }
.users-compact .list-card.compact table th { padding: 0 8px 4px; font-size: 9.8px; letter-spacing: .55px; }
.users-compact .list-card.compact table td { padding: 3px 8px; line-height: 1.15; font-size: 12px; }
.users-compact .list-card.compact .emp { gap: 6px; }
.users-compact .list-card.compact .avatar-sm { width: 22px; height: 22px; font-size: 9px; }
.users-compact .form-card.compact { padding: 12px 14px; gap: 8px; }
.users-compact .form-card.compact .field { margin-bottom: 6px; }
.users-compact .form-card.compact .field label { margin-bottom: 2px; font-size: 11.5px; }
.users-compact .form-card.compact .input { padding: 6px 8px; }
.users-compact .form-card.compact { max-height: none; overflow: visible; }
.users-compact .form-card.compact .form-head { margin-bottom: 2px; }

@media (max-width: 1200px) {
  .users-page-action-bar {
    flex-wrap: wrap;
    gap: 10px;
  }
  .users-head-actions {
    width: 100%;
    justify-content: space-between;
  }
  .users-head-tabs {
    position: static;
    transform: none;
  }
}
.list-compact td { padding: 3px 8px; }
.list-compact thead th { padding: 4px 8px; }
.list-compact tr td { border-bottom: none; }
.list-compact tbody tr { line-height: 1.35; }
.list-compact .form-wrap { width: 100%; }
.lookup-groups { width: max-content; }
.lookup-groups th,
.lookup-groups td { white-space: nowrap; }
.lookup-groups th:last-child,
.lookup-groups td:last-child { white-space: normal; }
.lookup-groups tbody tr td:nth-child(2) { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.locknote { font-size: 11px; color: var(--danger); margin-top: 4px; }
.masters-products-toolbar .search-pill { padding: 5px 12px; border-radius: 16px; font-size: 12px; }
.masters-products-toolbar .search-pill input { font-size: 12px; }
.masters-products-toolbar select.input { padding: 7px 10px; border-radius: 8px; font-size: 12px; }
.masters-products-toolbar .btn { padding: 7px 12px; font-size: 12px; border-radius: 8px; }
.stock-badge { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; background: var(--surface2); border: 1px solid var(--border-soft); border-radius: 8px; padding: 4px 10px; }
.stock-badge-label { font-size: 9.5px; letter-spacing: .4px; text-transform: uppercase; color: var(--text-faint); }
.stock-badge .tabular { font-size: 13px; font-weight: 700; color: var(--text); }

/* ---- Inventory ---- */
.bar-track { height: 6px; border-radius: 4px; background: var(--surface2); overflow: hidden; width: 70px; }
.bar-fill { height: 100%; border-radius: 4px; background: var(--gold); }
.bar-fill.danger { background: var(--danger); }

/* ---- Sales forecast: one column per day, bar height = predicted amount ---- */
.fc-bars { display: flex; align-items: flex-end; gap: 10px; margin: 4px 0 12px; }
.fc-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.fc-amt { font-size: 11px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.fc-bar-wrap { width: 100%; height: 120px; display: flex; align-items: flex-end; justify-content: center; }
.fc-bar { width: 100%; max-width: 48px; min-height: 3px; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, var(--gold), var(--gold-soft)); transition: height .3s ease; }
.fc-bar.weekend { background: var(--danger); opacity: .85; }
.fc-col.today .fc-lbl { color: var(--gold-bright); }
.fc-lbl { font-size: 11px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; }
.fc-sub { font-size: 10.5px; color: var(--text-faint); white-space: nowrap; }
.fc-bars.compact .fc-bar-wrap { height: 76px; }
@media (max-width: 760px) {
  .fc-bars { gap: 4px; }
  .fc-amt { font-size: 9.5px; }
  .fc-lbl, .fc-sub { font-size: 9.5px; }
  .fc-bar-wrap { height: 84px; }
}

/* ---- Dashboard forecast line (history + forecast) ---- */
.fc-plot { position: relative; padding-left: 50px; }
.fc-svg { display: block; width: 100%; }
.fc-yaxis { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; justify-content: space-between; width: 44px; height: 120px; font-size: 10.5px; color: var(--text-faint); text-align: right; }
.fc-grid { stroke: var(--border-soft); stroke-width: 1; }
.fc-line-hist { fill: none; stroke: var(--gold); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.fc-line-fc { fill: none; stroke: var(--gold-bright); stroke-width: 2.5; stroke-dasharray: 6 6; stroke-linejoin: round; stroke-linecap: round; }
.fc-divider { stroke: var(--text-faint); stroke-width: 1; stroke-dasharray: 3 4; opacity: .55; }
.fc-dot { fill: var(--gold); }
.fc-dot-fc { fill: var(--gold-bright); }
.fc-xaxis { position: relative; min-height: 16px; margin-top: 6px; font-size: 10px; color: var(--text-faint); }
.fc-xaxis > span { position: absolute; top: 0; white-space: nowrap; }
.fc-day { color: var(--text-faint); }
.fc-day-fc { color: var(--gold-dim); }
.fc-today { color: var(--gold-bright); font-weight: 700; }
.fc-val-label { position: absolute; font-size: 9px; line-height: 1; color: var(--text-dim); white-space: nowrap; pointer-events: none; }
.fc-val-fc { color: var(--gold-dim); }
.fc-legend { display: flex; gap: 18px; margin-top: 8px; font-size: 11px; color: var(--text-dim); }
.fc-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.fc-swatch { display: inline-block; width: 18px; height: 0; border-top: 2.5px solid var(--gold); }
.fc-swatch-fc { border-top-style: dashed; border-top-color: var(--gold-bright); }
.kpi-num-sub { font-family: var(--font-body, inherit); font-size: 13px; color: var(--text-faint); }

/* ---- Global chrome: fiscal-year chip + fixed footer strip ---- */
.fy-chip { display: flex; align-items: center; background: var(--gold-soft); border: 1px solid var(--gold-dim); color: var(--text); border-radius: 8px; padding: 4px 9px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.app-footer { display: flex; align-items: center; justify-content: center; gap: 8px; flex: none; height: 30px; padding: 0 16px; background: var(--bg2); border-top: 1px solid var(--border-soft); color: var(--text-faint); font-size: 11px; white-space: nowrap; overflow: hidden; }
.app-footer .af-item { overflow: hidden; text-overflow: ellipsis; }
.app-footer .af-item + .af-item::before { content: '•'; margin-right: 8px; color: var(--border); }
.app-footer .af-strong { color: var(--text-dim); font-weight: 600; }
.app-footer .af-version { margin-left: auto; color: var(--gold); font-weight: 600; }

/* ---- Transactions (Purchase / Journal / Payment / Stock docs) ---- */
.header-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.header-grid .field { margin-bottom: 0; }
.mini-input { padding: 7px 9px; border-radius: 6px; background: var(--surface2); border: 1px solid var(--border); color: var(--text); font-size: 12px; width: 70px; text-align: right; }
.doc-lines-table input.mini-input { width: 100%; }
/* The generic `table { width: 100% }` rule otherwise squeezes this 8-column
   table down to fit its narrow form-panel container instead of ever
   overflowing — with no min-width, there's nothing for .scroll-x's
   overflow-x:auto to actually trigger on, so columns just collapse into
   unreadable slivers (an item name wrapping onto 3 lines, "Rs. 113.00"
   truncated to "11", the Add button cut down to "A"). A min-width forces a
   real horizontal scrollbar instead once the panel is narrower than this. */
.doc-lines-table { min-width: 640px; }

.doc-lines-table td,
.doc-lines-table th {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}
.doc-lines-table tr:hover td {
  background: var(--surface2);
}
.doc-lines-table td {
  color: var(--text-dim);
}
/* Box the header row (requested for Journal/Payment view lists and details). */
.table-head-bordered {
  border-collapse: separate;
  border-spacing: 0;
}
.table-head-bordered thead th {
  background: var(--surface2);
  color: var(--text-dim);
  font-weight: 700;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.table-head-bordered thead th:first-child {
  border-left: 1px solid var(--border);
  border-top-left-radius: 10px;
}
.table-head-bordered thead th + th {
  border-left: 1px solid var(--border);
}
.table-head-bordered thead th:last-child {
  border-right: 1px solid var(--border);
  border-top-right-radius: 10px;
}
/* Read-only (view) item tables: full grid — outer + inner borders — and dark
   text for both the headings and the line details. */
.doc-lines-table.view-lines {
  border: 1px solid var(--border);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 12px;
  overflow: hidden;
}
.doc-lines-table.view-lines th,
.doc-lines-table.view-lines td {
  border: 0;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.doc-lines-table.view-lines th:last-child,
.doc-lines-table.view-lines td:last-child {
  border-right: 0;
}
.doc-lines-table.view-lines tbody tr:last-child td {
  border-bottom: 0;
}
.doc-lines-table.view-lines th {
  background: var(--surface2);
  color: var(--text-dim);
  font-weight: 700;
  padding: 8px 10px;
}
.doc-lines-table.view-lines td {
  color: var(--text);
}
.doc-lines-table.view-lines tr:hover td {
  background: transparent;
}
.doc-note { font-size: 12.5px; color: var(--text-dim); }
.doc-note b { color: var(--text); }
/* Opening-stock read-only table: same full-grid treatment. */
.os-table.view-lines {
  border: 1px solid var(--border);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 12px;
  overflow: hidden;
}
.os-table.view-lines th,
.os-table.view-lines td {
  border: 0;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.os-table.view-lines th:last-child,
.os-table.view-lines td:last-child {
  border-right: 0;
}
.os-table.view-lines tbody tr:last-child td {
  border-bottom: 0;
}
.os-table.view-lines th {
  background: var(--surface2);
  color: var(--text-dim);
  font-weight: 700;
}
.os-table.view-lines tbody tr:hover {
  background: transparent;
}


/* ---- Reports ---- */
.rcats { width: 230px; flex: none; background: var(--surface); border: 1px solid var(--border-soft); border-radius: 14px; padding: 14px; overflow: auto; display: flex; flex-direction: column; gap: 6px; }
.rgroup-label { font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--text-faint); padding: 8px 8px 2px; }
.ritem { display: flex; align-items: center; justify-content: space-between; padding: 9px 10px; border-radius: 9px; font-size: 12.5px; color: var(--text-dim); background: none; border: none; text-align: left; width: 100%; }
.ritem.on { background: var(--gold-soft); color: var(--gold-bright); font-weight: 600; }
.rcat { display: flex; flex-direction: column; gap: 2px; }
.rcat-trigger { cursor: pointer; font-weight: 600; }
.rcat-trigger:hover { color: var(--text); background: var(--surface2); }
.rcat-caret { color: var(--text-faint); font-size: 10px; margin-left: 8px; flex: none; }
.rcat-items { display: flex; flex-direction: column; gap: 2px; padding-left: 10px; border-left: 1px solid var(--border-soft); margin: 2px 0 6px 8px; }
.rcat-sub { font-size: 12px; font-weight: 500; }
.reports-layout { flex: 1; display: flex; gap: 18px; min-height: 0; }
.rmain { flex: 1; position: relative; background: var(--surface); border: 1px solid var(--border-soft); border-radius: 14px; padding: 10px 18px 14px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.rmain-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.rtitle { font-family: var(--font-display); font-size: 19px; color: var(--text); }
.rsub { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; }
.r-tools { display: flex; align-items: center; gap: 8px; }
.r-tool { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text-dim); font-size: 12px; font-weight: 600; cursor: pointer; }
.r-tool:hover { color: var(--text); border-color: var(--gold-dim); }
.r-tool.on { background: var(--gold-soft); color: var(--gold-bright); border-color: var(--gold-dim); }
.r-tool:disabled { opacity: .45; cursor: not-allowed; }
.rfilter-backdrop { position: fixed; inset: 0; background: oklch(0% 0 0 / 45%); z-index: 600; display: flex; align-items: center; justify-content: center; padding: 20px; }
.rfilter-pop { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(520px, calc(100vw - 32px)); max-height: 82dvh; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 18px 44px -14px oklch(0% 0 0 / 60%); padding: 14px 16px 12px; z-index: 610; display: flex; flex-direction: column; gap: 12px; }
.rfilter-pop-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 9px; border-bottom: 1px solid var(--border-soft); }
.rfilter-pop-title { font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--text-faint); }
.rfilter-pop-close { background: none; border: none; color: var(--text-faint); font-size: 14px; cursor: pointer; padding: 2px 8px; border-radius: 6px; line-height: 1; }
.rfilter-pop-close:hover { color: var(--danger); background: var(--danger-soft); }
.rfilter-pop .rfilter-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 14px; align-items: end; }
.rfilter-pop .rfilter-actions .btn { width: auto; min-width: 150px; }
.rfilter-pop .input { min-width: 0; font-size: 12.5px; padding: 8px 10px; border-radius: 8px; }
.rfilter-pop .field { margin-bottom: 0; gap: 4px; }
.rfilter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 14px; align-items: end; }
.rfilter-card { display: flex; flex-direction: column; gap: 6px; }
.rfilter-title { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-faint); font-weight: 700; }
.rfilter-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rfilter-fields .field { margin-bottom: 0; gap: 3px; }
.rfilter-fields .flabel { font-size: 10px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .4px; }
.rfilter-fields .input { min-width: 0; }
.rfilter-cell { margin-bottom: 0; gap: 4px; }
.rfilter-cell .flabel { font-size: 10px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .4px; }
.rfilter-toggle { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text); cursor: pointer; padding: 9px 2px 0 2px; }
.rfilter-toggle input { accent-color: var(--gold, #c9a227); }
.rfilter-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--border-soft); padding-top: 11px; }
.rfilter-meta { font-size: 11.5px; color: var(--text-faint); }
.rfilter-actions { display: flex; gap: 8px; align-items: center; }

/* Customer filter dropdown — lists existing parties; typing narrows the list.
   Mirrors the .bs-popper pattern used elsewhere for popovers. */
.rf-customer { position: relative; min-width: 0; }
.rf-customer-input { position: relative; display: flex; align-items: center; }
.rf-customer-input .input { padding-right: 34px; }
.rf-customer-clear { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: none; background: none; color: var(--text-faint); font-size: 12px; cursor: pointer; padding: 4px 6px; border-radius: 6px; line-height: 1; }
.rf-customer-clear:hover { color: var(--danger); background: var(--danger-soft); }
.rf-customer-list { position: absolute; top: calc(100% + 5px); left: 0; right: 0; background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 14px 34px -12px oklch(0% 0 0 / 55%); max-height: 220px; overflow-y: auto; z-index: 40; padding: 4px; }
.rf-customer-opt { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: none; padding: 7px 9px; border-radius: 7px; font-size: 12.5px; color: var(--text); cursor: pointer; }
.rf-customer-opt:hover { background: var(--surface2); }
.rf-customer-opt:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.rf-customer-phone { color: var(--text-faint); font-size: 11px; }
.rf-customer-empty { padding: 10px 9px; font-size: 12px; color: var(--text-faint); }

/* Report letterhead — title and the period it covers are visible on screen;
   company details (name/address/reg no) are hidden on screen to save space and
   shown only on printed/PDF copies. The Excel exporter writes its own header. */
.r-report-head { text-align: center; padding: 0 0 8px; border-bottom: 1px solid var(--border-soft); margin-bottom: 2px; }
.r-head-brand, .r-head-meta { display: none; }
.r-head-title { font-size: 12.5px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; color: #7a5d1a; }
.r-head-period { font-size: 11.5px; color: var(--text-dim); margin-top: 2px; }
.r-head-period b { font-weight: 800; }
@media print {
  .r-head-brand, .r-head-meta { display: block; }
  .r-head-brand { font-family: var(--font-display); font-size: 21px; font-weight: 900; color: var(--text); letter-spacing: .2px; }
  .r-head-meta { font-size: 11.5px; color: var(--text-faint); margin-top: 4px; display: flex; gap: 6px 16px; justify-content: center; flex-wrap: wrap; }
}

/* Excel-style report grid: the whole report area scrolls, tables are bordered
   grids with a sticky header and compact rows — like a spreadsheet. */
.r-output { flex: 1; min-height: 0; overflow: auto; }
.r-output table { border-collapse: collapse; width: 100%; margin-top: 6px; }
.r-output thead th { background: var(--surface2); color: var(--text); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; border: 1px solid var(--border-soft); padding: 4px 8px; position: sticky; top: 0; z-index: 2; white-space: nowrap; text-align: left; }
.r-output thead th[style*="right"] { text-align: right; }
.r-output tbody td { border: 1px solid var(--border-soft); padding: 2px 8px; font-size: 12.5px; color: var(--text-dim); white-space: nowrap; }
.r-output tbody tr:nth-child(even) td { background: var(--bg); }
.r-output tbody tr:hover td { background: var(--gold-soft); }

/* Fixed last column in a horizontally-scrolling report grid. */
.scroll-x.sticky-last { position: relative; }
.scroll-x.sticky-last th:last-child,
.scroll-x.sticky-last td:last-child { position: sticky; right: 0; box-shadow: -10px 0 14px -12px oklch(0% 0 0 / 45%); z-index: 1; }
.scroll-x.sticky-last thead th:last-child { background: var(--surface2); z-index: 3; }
.scroll-x.sticky-last tbody tr:nth-child(even) td:last-child { background: var(--bg); }
.scroll-x.sticky-last tbody tr:hover td:last-child { background: var(--gold-soft); }

/* Sticky header row for tall, wide report grids. The wrapper is itself the
   vertical scroller (a plain overflow-x wrapper computes overflow-y:auto and
   would trap the sticky <thead> inside a non-scrolling box), so the column
   headings stay pinned while the body scrolls. */
.scroll-x.sticky-head { max-height: calc(100vh - 240px); overflow: auto; }
.scroll-x.sticky-head thead th { position: sticky; top: 0; z-index: 2; }
.r-output tfoot td { border: 1px solid var(--border-soft); padding: 6px 10px; font-size: 12.5px; font-weight: 700; color: var(--text); background: var(--surface2); white-space: nowrap; }
.r-output tfoot td[style*="right"] span { font-family: var(--font-display); color: var(--text); }
.pending-state { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 34px; }
.pending-title { font-family: var(--font-display); font-style: italic; font-size: 18px; color: var(--text); }

.pl-section { margin-top: 10px; }
.pl-section:first-of-type { margin-top: 4px; }
/* Horizontal (T-format) Profit & Loss: income left, expenses right. Mirrors
   .bs-grid so both statements lay out the same way in this orientation. */
.pl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 30px; align-items: start; }
.pl-grid .pl-section { margin-top: 4px; }
@media (max-width: 920px) { .pl-grid { grid-template-columns: 1fr; } }
.bs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 30px; align-items: start; }
@media (max-width: 920px) { .bs-grid { grid-template-columns: 1fr; } }
/* .bs-table boxes the balance sheet; .pl-table gives the horizontal
   Profit & Loss the same boxed treatment so both statements in this
   orientation read the same way. */
.r-output table.bs-table,
.r-output table.pl-table { border: 1px solid var(--border); }
.r-output table.ss-table thead th,
.r-output table.ss-table tbody td,
.r-output table.ss-table tfoot td { padding: 3px 6px; font-size: 11px; white-space: nowrap; }
.r-output table.bs-table tbody td,
.r-output table.pl-table tbody td { border: 1px solid var(--border-soft); padding: 4px 10px; }
.r-output table.bs-table tbody tr.bs-tot td { font-weight: 700; color: var(--text); background: var(--surface2); }
/* P&L totals: same shading as the balance-sheet totals, plus a firmer rule
   above so each column reads as a finished statement. */
.r-output table.pl-table tbody tr.pl-tot td { font-weight: 700; color: var(--text); background: var(--surface2); border-top: 1px solid var(--border); }
.r-output table.bs-table tbody tr.bs-outer td { border-top: 1px solid var(--border); }
.r-output table.bs-table tbody tr.bs-sub td { font-weight: 700; color: var(--text); font-size: 11px; text-transform: uppercase; letter-spacing: .4px; background: var(--bg); }
.table-link { background: none; border: none; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; }
.table-link:hover { color: var(--accent, #1a6bb0); }
.pl-label { font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: #6d5315; font-weight: 800; padding: 4px 0 4px; border-bottom: 1px solid var(--border-soft); }
.pl-row { display: flex; justify-content: space-between; padding: 3px 4px; font-size: 13px; color: var(--text-dim); border-bottom: 1px solid var(--border-soft); }
.pl-row.sub { font-weight: 700; color: var(--text); }
.pl-row.net { font-size: 16px; font-weight: 700; color: var(--text); border-bottom: none; padding-top: 7px; }
.pl-row.net span:last-child { font-family: var(--font-display); color: var(--text); }

/* ---- KOT Timeline ---- */
.kt-badge { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; background: var(--surface2); color: var(--text-dim); border: 1px solid var(--border); }
.kt-badge-Open { background: oklch(92% .04 240); color: oklch(40% .13 260); border-color: oklch(82% .09 250); }
.kt-badge-PartiallyPaid { background: oklch(93% .06 85); color: oklch(45% .13 70); border-color: oklch(85% .1 80); }
.kt-badge-Paid { background: oklch(92% .09 145); color: oklch(38% .12 150); border-color: oklch(83% .12 155); }
.kt-badge-Cancelled { background: oklch(93% .05 20); color: oklch(48% .15 25); border-color: oklch(84% .1 25); }
.kt-badge-OnHold { background: oklch(93% .06 300); color: oklch(45% .13 300); border-color: oklch(84% .1 300); }
.kt-ev-Open, .kt-ev-Note { color: var(--text-dim); }
.kt-ev-Note { font-style: italic; }
.kt-ev-Punch { color: var(--text); }
.kt-ev-Print { color: var(--gold); }
.kt-ev-Reprint { color: oklch(65% .15 45); }
.kt-ev-Payment, .kt-ev-Closed { color: oklch(45% .12 155); font-weight: 700; }
.kt-ev-Transferred, .kt-ev-Split, .kt-ev-Merge, .kt-ev-Merged, .kt-ev-Resumed, .kt-ev-Hold { color: oklch(48% .13 280); }
.kt-ev-Cancelled { color: oklch(50% .16 25); font-weight: 700; }
.kt-section-head { border-bottom: 1px solid var(--border-soft); padding-bottom: 6px; margin-bottom: 0; }
.pl-section-head { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 10px; }
.pl-section-sub { font-size: 11.5px; margin-top: 3px; }

/* ---- Workforce ---- */
.avatar-sm { width: 28px; height: 28px; border-radius: 50%; background: var(--surface2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 700; color: var(--gold); flex: none; }
.emp { display: flex; align-items: center; gap: 9px; }

/* Salary structure page — tighter list rows & settings so the three
   stacked cards don't sprawl vertically. Scoped via .sal-compact. */
.sal-compact .list-card.compact table th { padding: 0 12px 4px; }
.sal-compact .list-card.compact table td { padding: 3px 12px; }
.sal-compact .list-card.compact table tbody { line-height: 1.3; }
.sal-compact .list-card.compact table .emp { gap: 7px; }
.sal-compact .list-card.compact table .avatar-sm { width: 24px; height: 24px; font-size: 9.5px; }
.sal-compact .sal-settings .stack { gap: 2px; }
.sal-compact .sal-settings .util-row { padding: 5px 0; }
.sal-compact .sal-settings .frow { margin-bottom: 4px; }
.sal-compact .sal-settings .field { margin-bottom: 4px; }

/* ---- Settings ---- */
.rolecol { text-align: center !important; }
.perm-tick { width: 22px; height: 22px; border-radius: 6px; background: var(--success-soft); color: var(--success); display: flex; align-items: center; justify-content: center; margin: 0 auto; border: none; }
.perm-x { width: 22px; height: 22px; border-radius: 6px; background: var(--surface2); border: 1px solid var(--border-soft); margin: 0 auto; padding: 0; }
.role-chip { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); }

/* Roles & Permissions: compact spacing and adaptive head width. */
.role-perm-compact { padding: 14px 16px; }
.role-perm-head { margin-bottom: 10px; gap: 10px; align-items: flex-end; }
.role-name-box { flex: 1; min-width: 220px; max-width: 420px; }
.role-name-box .input[disabled] { opacity: 1; color: var(--text); background: var(--surface2); }
.role-perm-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.role-perm-compact table th { padding: 0 10px 6px; }
.role-perm-compact table td { padding: 4px 10px; line-height: 1.2; }
.role-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.util-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--border-soft); gap: 12px; }
.util-row:first-child { border-top: none; padding-top: 2px; }
.util-ico { width: 34px; height: 34px; border-radius: 9px; background: var(--surface2); border: 1px solid var(--border-soft); display: flex; align-items: center; justify-content: center; color: var(--gold); flex: none; }
.util-name { font-size: 12.5px; font-weight: 600; color: var(--text); }
.util-sub { font-size: 11px; color: var(--text-faint); margin-top: 2px; }

/* ---- Misc layout helpers used across the new module pages ---- */
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.muted { color: var(--text-faint); }
.scroll-x { overflow-x: auto; }

/* ---- Kitchen / Table service (cafe/restaurant floor) ---- */
.service-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; position: relative; }
.service-head.floor-head > div:first-child { align-self: flex-start; }
.floor-tabs { margin-top: 14px; }
.card.floor-card { padding-top: 56px; }
.floor-card.with-actions .floor-tabs { margin-top: -11px; }
.service-refresh { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); flex: none; }
.service-head-right { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.service-legend { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-dim); }
.legend-swatch { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.legend-swatch.vacant { background: oklch(34% 0.14 150); }
.legend-swatch.occupied { background: oklch(22% 0.18 25); }
.legend-swatch.partially { background: oklch(52% 0.13 85); }
/* Outlined rather than filled: the takeaway marker is the gold boundary
   itself, so the swatch shows an outline on the same neutral card body. */
.legend-swatch.takeaway { background: transparent; border: 2px solid var(--gold); }
.table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.table-card { border-radius: 14px; padding: 14px; border: 1.5px solid var(--border-soft); background: var(--surface); cursor: pointer; position: relative; height: 96px; display: flex; flex-direction: column; gap: 4px; }
.table-card .table-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table-card .table-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table-card .table-total { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table-card:hover { border-color: var(--gold-dim); }
.table-card.vacant { border-color: oklch(34% 0.14 150); background: oklch(34% 0.14 150 / 24%); }
.table-card.occupied { border-color: oklch(22% 0.18 25); background: oklch(22% 0.18 25 / 30%); }
.table-card.partially { border-color: oklch(52% 0.13 85); background: oklch(52% 0.13 85 / 18%); }
.table-name { font-size: 13.5px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 7px; }
.table-svc { font-size: 10.5px; color: var(--text); letter-spacing: .3px; text-transform: uppercase; font-weight: 700; }
.table-floor { letter-spacing: 0; text-transform: none; color: var(--text); }
.table-meta { font-size: 10.5px; color: var(--text); }
.table-total { font-family: var(--font-display); font-size: 16px; color: var(--text); margin-top: auto; font-weight: 700; }
.tbl-status { position: absolute; top: 12px; right: 12px; width: 9px; height: 9px; border-radius: 50%; }
.tbl-status.vacant { background: oklch(34% 0.14 150); }
.tbl-status.occupied { background: oklch(22% 0.18 25); }
.tbl-status.partially { background: oklch(52% 0.13 85); }
.table-release { position: absolute; top: 10px; right: 24px; border: 1px solid oklch(49% 0.15 25 / 50%); background: oklch(49% 0.15 25 / 18%); color: var(--text-dim); font-size: 10.5px; line-height: 1; padding: 3px 8px; border-radius: 999px; cursor: pointer; font-weight: 600; }
.table-release:hover { background: oklch(49% 0.15 25); color: #fff; border-color: oklch(49% 0.15 25); }
.table-release:disabled { opacity: .5; cursor: default; }
.floor-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.floor-tab { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 12.5px; cursor: pointer; color: var(--text-dim); display: inline-flex; align-items: center; gap: 6px; }
.floor-tab.on { border-color: var(--gold-dim); background: var(--gold-soft); color: var(--gold-bright); font-weight: 600; }
.floor-count { background: var(--bg); color: var(--text-faint); font-size: 10.5px; padding: 1px 6px; border-radius: 999px; }
.floor-tab.on .floor-count { background: var(--gold-dim); color: var(--surface); }
.kpi-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.kpi-strip .card { padding: 16px 18px; }
.kpi-strip .kpi-label { font-size: 10.5px; }
.kpi-strip .kpi-num { font-size: 22px; }
.ticket-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.ticket { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 14px; overflow: hidden; cursor: pointer; }
.ticket:hover { border-color: var(--gold-dim); }
.ticket.selected { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.ticket-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border-soft); }
.ticket-table { font-size: 13px; font-weight: 700; color: var(--text); }
.ticket-ago { font-size: 11px; color: var(--text); }
.ticket-body { padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text); }
.ticket-item { display: flex; justify-content: space-between; gap: 8px; }
.ticket-item .q { font-weight: 700; color: var(--text); }
.ticket-foot { padding: 10px 14px; border-top: 1px solid var(--border-soft); display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text); }
.ticket-foot .total { font-family: var(--font-display); font-size: 15px; color: var(--text); font-weight: 700; }

/* ---- Kitchen display (KDS) ----------------------------------------------------
   A wall board: big touch targets, age colour-banded left edge, and a very
   obvious "sent from kitchen" button. Classic max-width media queries only --
   Vite must not minify these into range syntax (see AGENTS.md / vite.config.ts). */
.content--kds { gap: 14px; }
.kds-tabs { display: flex; gap: 8px; }
.kds-tab { background: var(--surface); border: 1px solid var(--border); color: var(--text-dim); border-radius: 10px; padding: 9px 22px; font-size: 14px; font-weight: 600; cursor: pointer; }
.kds-tab.active { background: var(--gold); border-color: var(--gold); color: #1a1408; }
.kds-strip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chip--danger { color: var(--danger); border-color: var(--danger); }
.kds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 16px; align-items: start; }
.kds-ticket { background: var(--surface); border: 1px solid var(--border-soft); border-left: 5px solid var(--success); border-radius: 14px; overflow: hidden; }
.kds-ticket--warn { border-left-color: var(--gold); }
.kds-ticket--late { border-left-color: var(--danger); }
.kds-ticket-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 13px 15px; border-bottom: 1px solid var(--border-soft); }
.kds-ticket-no { font-family: var(--font-display); font-size: 19px; font-weight: 700; color: var(--text); line-height: 1.15; }
.kds-ticket-where { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.kds-ticket-age { text-align: right; }
.kds-age { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--text); }
.kds-ticket--warn .kds-age { color: var(--gold); }
.kds-ticket--late .kds-age { color: var(--danger); }
.kds-target { font-size: 11px; color: var(--text-faint); }
.kds-order-note { padding: 9px 15px; font-size: 12.5px; color: var(--gold-bright); background: var(--surface2); border-bottom: 1px solid var(--border-soft); }
.kds-lines { display: flex; flex-direction: column; }
.kds-line { display: flex; align-items: center; gap: 10px; padding: 11px 15px; border-bottom: 1px solid var(--border-soft); }
.kds-line-main { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 9px; }
.kds-qty { font-family: var(--font-display); font-size: 17px; font-weight: 700; color: var(--gold-bright); min-width: 26px; }
.kds-line-text { flex: 1; min-width: 0; }
.kds-line-name { font-size: 14px; color: var(--text); font-weight: 600; }
.kds-line-note { font-size: 12.5px; color: var(--gold-bright); margin-top: 2px; }
.kds-prep { font-size: 11px; color: var(--text-faint); border: 1px solid var(--border); border-radius: 12px; padding: 2px 8px; }
.kds-ready, .kds-reopen { flex: none; font-size: 12.5px; padding: 9px 14px; min-height: 40px; }
.kds-released { background: var(--surface2); }
.kds-released-label { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); padding: 8px 15px 0; }
.kds-line--done .kds-line-name { color: var(--text-faint); text-decoration: line-through; }
.kds-line--done .kds-qty { color: var(--text-faint); }
.kds-line--done { padding-top: 8px; padding-bottom: 8px; }
.kds-ticket-foot { padding: 12px 15px; }
.kds-ready-all { width: 100%; font-size: 14px; padding: 13px; min-height: 48px; }
.kds-all-done { display: block; text-align: center; font-size: 13px; color: var(--success); font-weight: 600; padding: 6px 0; }
/* POS row marker for a line the kitchen already released. */
.kds-locked-tag { color: var(--success); font-weight: 600; }
.step-btn:disabled { opacity: .35; cursor: not-allowed; }
@media (max-width: 760px) {
  .kds-grid { grid-template-columns: 1fr; }
  .kds-tab { padding: 8px 16px; font-size: 13px; }
}
.billing-split { flex: 1; min-height: 0; min-width: 0; overflow: hidden; }
.billing-split > div > .card { flex: 1 1 auto; min-height: 0; overflow: auto; }
@media (min-width: 761px) {
  /* Billing tab: pin the split to the content area so the shell never scrolls;
     only the floor-overview card scrolls internally, actions stay fixed.
     Closest to the /pos table page layout. */
  .floor-content-billing { position: relative; }
  .billing-split { position: absolute; top: 0; left: 32px; right: 0; bottom: 0; margin: 0; flex: none; }
  .billing-split .actions-panel { height: 100%; }
  .billing-split .floor-card { height: 100%; }
}
.floor-content { position: relative; padding: 10px 32px 16px; gap: 0; }
.floor-tabbar { position: sticky; top: 0; z-index: 6; display: flex; justify-content: center; margin-bottom: -49px; }
.floor-tabbar .tabstrip { background: var(--bg2); border: 1px solid var(--border); box-shadow: 0 2px 10px oklch(0% 0 0 / 0.12); }
/* Takeaway / delivery orders render in the same grid as real tables, so they
   need a boundary that can't be mistaken for one: a solid gold rule, heavier
   than the table cards' 1.5px status border and laid over whatever status tint
   sits underneath. This replaces the old 1px dashed rule, which was too faint
   to tell the two apart at a glance. */
.table-card.is-takeaway { border: 2px solid var(--gold); }
.table-card.is-takeaway:hover { border: 2px solid var(--gold-bright); }
.table-card.is-takeaway .table-name { color: var(--ink); }
.table-card.is-takeaway .table-total { color: var(--ink); }

/* ---- Opening Stock (OS voucher) tabs ---- */
.os-fill { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.os-edit { flex: 1; min-height: 0; height: auto; overflow: hidden; padding: 14px 18px 16px; gap: 8px; align-items: stretch; }
.os-edit > .form-head { flex: none; }
.os-edit > .pur-kv, .os-edit > .os-toolbar, .os-edit > .os-runbar { flex: none; }
.os-edit .field { gap: 3px; margin-bottom: 0; }
.os-edit .field label { font-size: 10px; margin-bottom: 0; color: var(--text-faint); text-transform: uppercase; letter-spacing: .4px; }
.os-edit .input, .os-edit select.input, .os-edit .bs-btn, .os-edit .search-pill { padding: 5px 8px; font-size: 12.5px; border-radius: 8px; min-height: 28px; }
.os-edit .input:focus, .os-edit select.input:focus, .os-edit .bs-btn:focus { box-shadow: 0 0 0 2px var(--gold-soft); }
.os-edit .bs-btn svg { width: 13px; height: 13px; }
.os-edit .form-foot .btn { padding: 6px 12px; font-size: 12.5px; }
.os-edit .page-invoice-no { font-size: 15px; }
.os-toolbar { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr) 132px 112px 96px; gap: 8px; flex: none; }
.os-toolbar .field { min-width: 0; }
.os-runbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.os-note { font-size: 11.5px; color: var(--text-faint); }
.os-scroll { flex: 1; min-height: 0; overflow: auto; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface); }
.os-table { width: 100%; border-collapse: collapse; }
.os-table th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-faint); padding: 8px 10px; border-bottom: 1px solid var(--border-soft); position: sticky; top: 0; background: var(--surface); z-index: 1; white-space: nowrap; }
.os-table td { padding: 5px 10px; border-bottom: 1px solid var(--border-soft); font-size: 12.5px; vertical-align: middle; color: var(--text); }
.os-table tbody tr:hover { background: var(--surface2); }
.os-table tbody tr.os-empty:hover { background: transparent; }
.os-table .os-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
.os-table .os-num { font-family: var(--font-display); font-weight: 700; }
.os-table .os-amt { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.os-table td .input { padding: 3px 6px; font-size: 12px; min-height: 24px; text-align: right; }
.os-table .line-btn { width: 22px; height: 22px; font-size: 12px; border-radius: 6px; }
.os-trash { flex: none; }
.os-del { margin-left: auto; }
.os-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: none; padding-top: 2px; }
.os-totals { display: flex; align-items: baseline; gap: 18px; font-size: 12.5px; color: var(--text-dim); }
.os-totals b { color: var(--text); font-variant-numeric: tabular-nums; }
.os-totals .big { font-family: var(--font-display); font-size: 17px; color: var(--gold-bright); }
.os-chip { white-space: nowrap; }

/* ---- Responsive / mobile ---- */
.hamburger { display: none; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--border-soft); background: var(--surface); color: var(--text-dim); flex: none; }
.hamburger:hover { color: var(--gold-bright); border-color: var(--gold-dim); }

.drawer-backdrop { position: fixed; inset: 0; background: oklch(0% 0 0 / 55%); z-index: 900; }
.drawer { position: fixed; top: 0; left: 0; bottom: 0; width: min(320px, 86vw); background: var(--bg2); border-right: 1px solid var(--border-soft); z-index: 1000; display: flex; flex-direction: column; overflow: hidden; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border-soft); }
.drawer-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; color: var(--text); }
.drawer-body { flex: 1; overflow-y: auto; padding: 10px 12px 24px; display: flex; flex-direction: column; gap: 4px; }
.drawer-link { display: block; padding: 11px 12px; border-radius: 9px; color: var(--text-dim); font-size: 14px; font-weight: 600; }
.drawer-link:hover { color: var(--text); background: var(--surface); }
.drawer-link.active { color: var(--gold-bright); background: var(--gold-soft); }
.drawer-group-trigger { width: 100%; text-align: left; display: flex; align-items: center; justify-content: space-between; padding: 11px 12px; border-radius: 9px; background: none; border: none; color: var(--text); font-size: 14px; font-weight: 700; }
.drawer-group-trigger.open { color: var(--gold-bright); }
.drawer-group-items { display: flex; flex-direction: column; gap: 2px; padding: 2px 0 4px 10px; border-left: 1px solid var(--border-soft); margin-left: 12px; }
.drawer-group-items .drawer-link { font-size: 13px; font-weight: 500; }
.drawer-nested { display: flex; flex-direction: column; gap: 2px; }
.drawer-nested-heading { padding: 8px 12px 4px; font-size: 11px; letter-spacing: .4px; text-transform: uppercase; color: var(--text-faint); font-weight: 700; }
.drawer-nested .drawer-link { font-size: 13px; font-weight: 500; padding-left: 22px; }

/* Narrow / tablet / small desktop windows: keep horizontal nav scrollable */
@media (max-width: 1200px) {
  .topbar-nav { overflow-x: auto; scrollbar-width: thin; }
}

/* Phone breakpoint: hamburger + drawer, content flows so the page scrolls */
@media (max-width: 760px) {
  html, body, #root { height: auto !important; min-height: 100%; }
  .app { height: auto !important; min-height: 100vh; overflow: visible !important; }
  .hamburger { display: inline-flex; }
  .nav { display: none; }
  .user-card { margin-left: auto; }
  .topbar-nav { padding: 0 12px; gap: 10px; overflow: visible; }
  .main { overflow: visible; }
  .topbar { padding: 0 16px; height: auto; min-height: 58px; flex-wrap: wrap; gap: 8px; }
  .topbar-center { position: static; transform: none; margin: 0 auto; }
  /* Header tab strip: give it its own full-width row under the title on
     phones instead of squeezing next to it. */
  .topbar-middle { flex: 1 1 100%; order: 3; margin: 0 0 8px; }
  /* The absolute page-centre positioning above cannot work on a wrapped,
     auto-height header -- drop back to a normal row here. */
  .topbar.topbar-center-tabs .topbar-middle { position: static; left: auto; top: auto; transform: none; max-width: none; }
  /* Mobile: the logo is behind the hamburger, so keep the standard padding. */
  .topbar.topbar-nav-align { padding-left: 16px; padding-right: 16px; }
  .content { padding: 16px; overflow: visible; gap: 16px; }
  .content.settings-content { padding: 12px; gap: 10px; }
  .fiscal-split, .half-split { grid-template-columns: 1fr; }
  .modules-split { grid-template-columns: 1fr; }
  .settings-content .pm-table th, .settings-content .pm-table td { padding-left: 4px; padding-right: 4px; }
  .settings-content .pm-table .pm-select { max-width: 120px; }
  .settings-content .pm-table .pm-name { white-space: normal; }
  .floor-content { padding: 10px 16px 12px; }
  .floor-tabbar { margin-bottom: -49px; }
  .service-refresh { position: static; transform: none; order: 2; margin: 0 auto; }
  .floor-card.with-actions .floor-tabs { margin-top: -21px; }
  /* The brand sub-line (Restaurant Management Software) is 190px wide — on a
     phone topbar it pushes the FY chip + avatar out of view. Word stays. */
  .brand-sub { display: none; }
  .brand-word { font-size: 15px; }
  .card { padding: 16px; }

  /* POS: stack the two panes vertically so it works on phones. max-width:100%
     is important — the product pane's flex min-content can otherwise blow the
     whole screen out to ~600px and force horizontal scroll on phones. */
  .pos-main { flex-direction: column; max-width: 100%; min-width: 0; }
  .pos-left { border-right: none; border-bottom: 1px solid var(--border-soft); height: 56vh; min-width: 0; max-width: 100%; }
  .cart { width: 100%; min-width: 0; max-height: none; height: auto; }
  .cart-items { overflow: visible; }
  .pos-top { padding: 12px 14px 10px; gap: 8px; }
  .cats { padding: 10px 14px 2px; }
  .pgrid { padding: 12px 14px 20px; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(125px, 1fr)); }
  .pcard { padding: 10px; }
  .bill-main { padding: 0; flex-direction: column; max-width: 100%; min-width: 0; }
  .bill-panel { max-height: none; border-radius: 14px; padding: 12px; min-width: 0; }
  .actions-panel { width: auto; }
  /* Billing tab split: the floor grid's flex:1 child would otherwise shrink
     to a sliver instead of wrapping, so force a full-width column stack and
     let the action buttons take the whole row. */
  .billing-split { flex-direction: column !important; align-items: stretch !important; }
  .billing-split .actions-panel { width: 100%; }
  .bill-body { grid-template-columns: 1fr !important; }
  .bill-items-head { flex-wrap: wrap; row-gap: 4px; }
  .bill-items-head .bi-type { order: 3; flex-basis: 100%; }
  .bill-head { flex-wrap: wrap; }
  .table-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .kpi-strip { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .rmain, .rcats { border-radius: 12px; }
  .rcats { width: 100%; }
  .content > div[style*="flex"] { flex-wrap: wrap; min-width: 0; }

  /* Collapse split / two-column / form layouts to a single column */
  .two-col, .two-col-wide, .split, .split-large, .grid2, .members-grid { grid-template-columns: 1fr !important; }
  .split, .split-large { display: grid !important; }
  .rcats, .rmain { display: flex; flex-direction: column; }
  .rmain { overflow: visible; }

  /* Line-item grids (purchase/purchase-return/journal): stack fields */
  .frow { grid-template-columns: 1fr !important; }
  .pur-head { flex-wrap: wrap; }
  .pur-body { grid-template-columns: 1fr !important; }
  .pur-kv, .pur-kv2 { grid-template-columns: 1fr 1fr; gap: 8px; }
  .pur-cheque { grid-template-columns: 1fr; gap: 8px; }
  .pur-ledger-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .os-toolbar { grid-template-columns: 1fr 1fr; gap: 8px; }

  /* Keep tables scannable: allow their cards to scroll horizontally */
  .card, .list-card, .form-card { overflow-x: auto; }
  .intro-cards { grid-template-columns: 1fr !important; }
  .rfilters { width: 100%; }
  .rfilters .input { width: 100% !important; }
  .search-toolbar { flex-wrap: wrap; }
  .search-toolbar .search-pill { width: 100%; }
  .topbar-center { max-width: 100%; }
  .tabstrip { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }
  .tabstrip-btn { flex: none; }

  /* Fuller modals and drawers on small screens */
  .modal { width: 100%; max-width: calc(100vw - 20px); padding: 18px; border-radius: 14px; max-height: calc(100vh - 24px); }
  .modal-card { width: min(100%, calc(100vw - 20px)); }

  /* No auto-zoom when tapping fields: inputs smaller than 16px make iOS
     Safari zoom the whole page on focus. Keep taps fixed. !important guards
     against later rules (.mpos-search input, .rfilter-pop .input). */
  .input, select.input, textarea.input, textarea, .mpos-search input { font-size: 16px !important; }

  /* Report filter popover becomes a bottom sheet on phones: fixed, full
     width, scrolls internally so long filters never fall off the screen. */
  .rfilter-pop { position: fixed; top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 85dvh; overflow-y: auto; border-radius: 18px 18px 0 0; border-bottom: none; padding: 16px; z-index: 600; }

  /* Placeholder report shells: force the 2-column filter grid to stack. */
  .report-filter-grid { grid-template-columns: 1fr !important; }

  /* Login: hide the decorative left panel on phones, center the form */
  .login-panel-left { display: none; }
  .login-panel-right { padding: 24px; }
  .login-form-card { width: 100%; margin-top: -160px; }
}

/* Small phones — tighten spacing, shrink product/table tiles to keep
   multiple columns, and stack multi-field toolbars. */
@media (max-width: 480px) {
  .content { padding: 12px; gap: 12px; }
  .floor-content { padding: 10px 12px 12px; }
  .topbar { padding: 0 12px; gap: 6px; }
  .brand-word { font-size: 13px; }
  .user-meta { display: none; }
  .card { padding: 14px; }
  .form-card, .list-card { padding: 14px; }

  .pos-left { height: 48vh; }
  .pgrid { grid-template-columns: repeat(auto-fill, minmax(106px, 1fr)); gap: 8px; padding: 10px 12px 18px; }
  .pcard { padding: 8px; }
  .pname { font-size: 11.5px; }

  .table-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .table-card { padding: 12px; height: 84px; }
  .ticket-list { grid-template-columns: 1fr; gap: 10px; }
  .kpi-strip { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  .bill-panel { padding: 12px; border-radius: 12px; }
  .bill-due-num { font-size: 24px; }
  .actions-panel { padding: 12px; }
  .bill-tile { padding: 12px; }

  .pur-kv, .pur-kv2, .pur-cheque { grid-template-columns: 1fr; }
  .pur-ledger-row { grid-template-columns: 1fr; }
  .pur-head .bill-type { width: 100%; }
  .os-toolbar { grid-template-columns: 1fr 1fr; }
  .frow { gap: 10px; }
  .kpi-grid { gap: 10px; }
  .login-panel-right { padding: 20px 16px; }
  .modal { max-width: calc(100vw - 16px); padding: 16px; }
  .modal-card { width: min(100%, calc(100vw - 16px)); }
}

/* ---- Reports: print-to-PDF (landscape A4, only the report table) ---- */
@page { size: A4 landscape; margin: 10mm; }
@media print {
  html, body, #root { height: auto !important; overflow: visible !important; }
  .app { height: auto !important; min-height: 0 !important; overflow: visible !important; }
  .topbar-nav, .topbar, .rcats, .rmain-head, .rfilter-pop, .hamburger, .drawer-backdrop, .drawer, .user-card, .app-footer { display: none !important; }
  .main { height: auto !important; overflow: visible !important; display: block !important; }
  .content { height: auto !important; overflow: visible !important; padding: 0 !important; gap: 0 !important; display: block !important; }
  .reports-layout { display: block !important; min-height: 0 !important; gap: 0 !important; }
  .rmain { border: none !important; border-radius: 0 !important; padding: 0 !important; overflow: visible !important; }
  .r-output { overflow: visible !important; }
  .r-output .scroll-x { overflow: visible !important; }
  .r-output table { font-size: 9.5px; margin-top: 6px; }
  .r-output thead th { position: static; }
  .r-output thead th, .r-output tbody td { padding: 4px 6px; }
}

/* ---- Balance Confirmation ---- */
.bc-filter { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.bc-party-pick { min-width: 280px; }
.bc-party-pick .rf-customer .input { width: 100%; }
.bc-party-list { position: absolute; top: calc(100% + 5px); left: 0; right: 0; min-width: 300px; background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 14px 34px -12px oklch(0% 0 0 / 55%); max-height: 260px; overflow-y: auto; z-index: 40; padding: 4px; }
.bc-party-opt { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: none; padding: 8px 9px; border-radius: 7px; font-size: 12.5px; color: var(--text); cursor: pointer; }
.bc-party-opt:hover { background: var(--surface2); }
.bc-party-tick { width: 16px; flex: none; text-align: center; }
.bc-party-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #111; }
.bc-party-divider { height: 1px; background: var(--border-soft); margin: 4px 6px; }
.bc-toggle-row { display: flex; align-items: center; gap: 6px; }
.bc-toggle { border: 1px solid var(--border); background: var(--surface); color: var(--text-dim); border-radius: 20px; padding: 7px 13px; font-size: 12px; cursor: pointer; }
.bc-toggle.on { background: var(--gold-soft); color: var(--gold-bright); border-color: var(--gold-dim); font-weight: 600; }
.bc-toggle:disabled { opacity: .5; cursor: not-allowed; }

.print-letter { page: bcletter; font-family: var(--font-body); color: var(--text); }
.bc-letter-head { text-align: center; border-bottom: 2px solid var(--text); padding-bottom: 8px; margin-bottom: 12px; }
.bc-letter-company { font-family: var(--font-display); font-size: 20px; font-weight: 900; }
.bc-letter-meta { font-size: 11.5px; color: var(--text-faint); margin-top: 3px; }
.bc-letter-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; letter-spacing: 3px; text-align: center; margin-top: 8px; }
.bc-letter-sub { text-align: center; font-size: 12px; color: var(--text-dim); margin: 2px 0 14px; }
.bc-letter-to { font-size: 13px; line-height: 1.6; margin-bottom: 10px; }
.bc-letter-party { font-size: 14px; font-weight: 700; }
.bc-letter-body { font-size: 13px; line-height: 1.7; margin: 12px 0; }
.bc-letter-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.bc-letter-table th { background: var(--surface2); text-align: left; padding: 6px 8px; border: 1px solid var(--border-soft); font-size: 10.5px; text-transform: uppercase; letter-spacing: .3px; }
.bc-letter-table td { padding: 5px 8px; border: 1px solid var(--border-soft); }
.bc-letter-confirm { margin-top: 18px; font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.bc-letter-check { margin-right: 6px; }
.bc-letter-sign { display: flex; justify-content: space-between; gap: 40px; margin-top: 40px; }
.bc-letter-sign div { border-top: 1px solid var(--border); padding-top: 6px; font-size: 12px; color: var(--text-faint); flex: 1; text-align: center; }
.bc-letter-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }

@media print {
  body * { visibility: hidden; }
  .print-letter, .print-letter * { visibility: visible; }
  .print-letter { position: fixed; left: 0; top: 0; width: 100%; max-height: none !important; overflow: visible !important; box-shadow: none !important; background: #fff !important; padding: 0 !important; }
  .bc-letter-actions { display: none !important; }
}
@page bcletter { size: A4 portrait; margin: 12mm; }

.print-recon { page: recon; font-family: var(--font-body); color: var(--text); }
@media print {
  .print-recon, .print-recon * { visibility: visible; }
  .print-recon { position: fixed; left: 0; top: 0; width: 100%; max-height: none !important; overflow: visible !important; box-shadow: none !important; background: #fff !important; padding: 0 !important; }
  .no-print { display: none !important; }
}
@page recon { size: A4 portrait; margin: 12mm; }

.print-payslip { page: payslip; font-family: var(--font-body); color: var(--text); }
.payslip { background: #fff; border: 1px solid var(--border-soft); border-radius: 14px; padding: 20px 24px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.payslip + .payslip { page-break-before: always; }
.ps-head { text-align: center; border-bottom: 2px solid var(--text); padding-bottom: 10px; margin-bottom: 12px; }
.ps-company { font-family: var(--font-display); font-size: 20px; font-weight: 900; }
.ps-meta { font-size: 11.5px; color: var(--text-faint); margin-top: 3px; }
.ps-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; letter-spacing: 3px; text-align: center; margin-top: 8px; }
.ps-period { text-align: center; font-size: 12px; color: var(--text-dim); margin: 2px 0 14px; }
.ps-employee { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 24px; font-size: 13px; margin-bottom: 12px; }
.ps-employee b { font-weight: 700; color: var(--text); }
.ps-tables { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.payslip table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.payslip table th { background: var(--surface2); text-align: left; padding: 6px 10px; border: 1px solid var(--border-soft); font-size: 10.5px; text-transform: uppercase; letter-spacing: .3px; }
.payslip table td { padding: 5px 10px; border: 1px solid var(--border-soft); }
.payslip table .total-row td { font-weight: 700; background: var(--surface); }
.ps-employer-note { font-size: 10.5px; color: var(--text-faint); }
.ps-net { margin-top: 14px; display: flex; justify-content: space-between; align-items: flex-end; border-top: 2px dashed var(--border); padding-top: 10px; }
.ps-net-line { font-size: 12.5px; color: var(--text-dim); }
.ps-net-line b { font-family: var(--font-display); font-size: 14px; font-weight: 800; color: var(--text); }
.ps-net-amt { font-family: var(--font-display); font-size: 20px; font-weight: 900; color: var(--text); }
.ps-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; font-size: 11px; color: var(--text-faint); }
@media print {
  body * { visibility: hidden; }
  .print-payslip, .print-payslip * { visibility: visible; }
  .print-payslip { position: fixed; left: 0; top: 0; width: 100%; max-height: none !important; overflow: visible !important; box-shadow: none !important; background: #fff !important; padding: 0 !important; }
  .no-print { display: none !important; }
}
@page payslip { size: A4 portrait; margin: 10mm; }

/* ---- Mobile ordering panel (rendered only on phone/compact viewports) ----
   Products + category rail stay full-screen so tapping an item never hides the
   menu; picked items sit in a fixed bottom bar and a slide-up cart sheet. */
.mpos { position: relative; display: flex; flex-direction: column; width: 100%; min-width: 0; max-width: 100%; height: calc(100dvh - 88px); max-height: calc(100dvh - 88px); min-height: 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
.mpos-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: none; }
.mpos-bar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mpos-back { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border-soft); background: var(--surface); color: var(--text); font-size: 19px; line-height: 1; flex: none; cursor: pointer; }
.mpos-back:active { background: var(--surface2); }
.mpos-context { min-width: 0; }
.mpos-context-title { font-size: 16px; font-weight: 700; color: var(--text); line-height: 1.2; }
.mpos-context-sub { font-size: 11px; color: var(--text-faint); margin-top: 1px; }
.mpos-bar-right { flex: none; }
.mpos-open-btn { padding: 8px 12px; border-radius: 9px; border: 1px solid var(--border-soft); background: var(--surface); font-size: 12px; font-weight: 600; color: var(--text-dim); cursor: pointer; }
.mpos-open-btn:active { background: var(--surface2); }
.mpos-openorders { position: absolute; top: 46px; right: 0; left: 0; z-index: 60; max-height: 45dvh; overflow: auto; background: var(--surface); border: 1px solid var(--border-soft); border-radius: 12px; box-shadow: 0 12px 32px rgb(0 0 0 / .18); padding: 6px; }
.mpos-open-order { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; padding: 10px; background: none; border: none; border-radius: 8px; font-size: 12.5px; cursor: pointer; color: var(--text); }
.mpos-open-order:active { background: var(--surface2); }
.mpos-search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border-soft); border-radius: 10px; padding: 0 12px; flex: none; margin-top: 10px; }
.mpos-search svg { width: 15px; height: 15px; color: var(--text-faint); flex: none; }
.mpos-search input { width: 100%; border: none; background: none; padding: 11px 0; font-size: 13.5px; color: var(--text); outline: none; }
.mpos-grid { flex: 1; min-height: 0; }
.mpos-cartbar { margin-top: 10px; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 16px; border-radius: 13px; background: var(--gold); color: var(--ink); border: none; font-weight: 700; cursor: pointer; box-shadow: 0 4px 18px rgb(0 0 0 / .2); }
.mpos-cartbar-count { font-size: 13px; }
.mpos-cartbar-total { font-size: 16px; }
.mpos-cartbar-view { font-size: 12px; opacity: .85; }
.mpos-backdrop { position: fixed; inset: 0; background: rgb(0 0 0 / .45); z-index: 500; display: flex; align-items: flex-end; }
.mpos-sheet { background: var(--surface); width: 100%; max-height: 84dvh; display: flex; flex-direction: column; border-radius: 18px 18px 0 0; padding: 16px 14px 18px; }
.mpos-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: none; }
.mpos-sheet-title { font-size: 15px; font-weight: 700; color: var(--text); }
.mpos-sheet-sub { color: var(--text-faint); font-weight: 500; }
.mpos-sheet-items { flex: 1; min-height: 0; overflow: auto; margin-top: 10px; }
.mpos-citem { flex-direction: column; align-items: stretch; }
.mpos-citem-main { display: flex; align-items: center; gap: 10px; }
.mpos-citem-info { flex: 1; min-width: 0; }
.mpos-citem-total { font-size: 12.5px; font-weight: 600; color: var(--text-dim); white-space: nowrap; }
.mpos-note-btn { margin-top: 8px; align-self: flex-start; font-size: 11px; color: var(--text-dim); background: none; border: 1px dashed var(--border-soft); border-radius: 7px; padding: 5px 9px; cursor: pointer; }
.mpos-note-btn .note-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--gold-bright); margin-right: 5px; vertical-align: 1px; }
.mpos-sheet-total { flex: none; display: flex; justify-content: space-between; align-items: baseline; padding: 12px 2px 8px; border-top: 1px solid var(--border-soft); margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--text); }
.mpos-sheet-total .tabular { font-family: var(--font-display); font-size: 20px; color: var(--gold-bright); }
.mpos-sheet-actions { flex: none; display: flex; gap: 10px; }
.mpos-sheet-actions .btn { flex: 1; padding: 13px; border-radius: 12px; }

/* Phone rotated to landscape: the width passes 760px so the width breakpoints
   above stop applying, but PosPage's isMobile still treats a short wide
   touchscreen as mobile and renders MobileOrderPanel. Compact its chrome so
   the product grid keeps room and the gold cartbar stays reachable in the
   short viewport (the grid itself scrolls via .pgrid's overflow). */
@media (orientation: landscape) and (max-width: 1100px) and (max-height: 700px) {
  .mpos { height: calc(100dvh - 80px); max-height: calc(100dvh - 80px); }
  .mpos-search { margin-top: 8px; }
  .cats { padding-top: 6px; padding-bottom: 6px; }
  .pgrid { padding-top: 10px; }
  .mpos-cartbar { margin-top: 8px; padding: 11px 14px; }
}

/* ---- Thermal print preview (80mm paper) : Settings > Printer Setup ---- */
.tp-stage { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 22px; border: 1px solid var(--border-soft); border-radius: 16px; background: var(--surface2); overflow-x: auto; }
.tp-caption { font-size: 11px; letter-spacing: .5px; text-transform: uppercase; color: var(--text-faint); font-weight: 600; }
.tp-roll { position: relative; display: flex; padding: 0 12px; }
.tp-paper { position: relative; background: linear-gradient(90deg, #f6f1e4 0%, #fdfcf7 6%, #fdfcf7 94%, #f6f1e4 100%); color: #111; border-radius: 3px; padding: 14px 18px 10px; box-shadow: 0 14px 34px rgb(0 0 0 / .4), inset 0 0 0 1px rgb(0 0 0 / .07); }
.tp-paper::after { content: ''; position: absolute; left: 18px; right: 18px; bottom: 4px; border-top: 1px dashed rgb(0 0 0 / .18); }
.tp-slip { font-family: 'Courier New', Consolas, 'Lucida Console', monospace; line-height: 1.4; white-space: pre; margin: 0; color: #111; }
.tp-edge { position: absolute; top: 0; bottom: 0; width: 12px; pointer-events: none; }
.tp-edge-l { left: 0; background: repeating-linear-gradient(to bottom, #f6f1e4 0 6px, transparent 6px 12px); }
.tp-edge-r { right: 0; background: repeating-linear-gradient(to bottom, transparent 0 6px, #f6f1e4 6px 12px); }
.tp-cut { display: flex; align-items: center; gap: 7px; color: var(--text-faint); font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase; white-space: nowrap; }
.tp-cut::before, .tp-cut::after { content: ''; flex: 1; border-top: 2px dashed var(--text-faint); opacity: .55; min-width: 26px; }
.tp-large .tp-paper { padding: 22px 26px 12px; }
.tp-large .tp-edge { display: none; }



/* ---------------------------------------------------------------------------
   Appointments (barber/salon booking) -- /appointments screens
   --------------------------------------------------------------------------- */
.apt-page { display: flex; flex-direction: column; gap: 14px; }
.apt-toolbar { margin-bottom: 0; }
.apt-datenav { display: flex; align-items: center; gap: 6px; }
.apt-date { width: 150px; }
.apt-filter, select.apt-filter { width: 155px; flex: none; }
.apt-search { min-width: 210px; flex: 1; max-width: 300px; }

/* Week strip: seven day chips (count of bookings) for quick jumps. */
.apt-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.apt-day { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 12px; padding: 8px 4px; cursor: pointer; text-align: center; color: var(--text); font: inherit; display: flex; flex-direction: column; gap: 1px; transition: border-color .12s ease, background .12s ease; }
.apt-day:hover { border-color: var(--text-dim); }
.apt-day .d { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); }
.apt-day .n { font-size: 17px; font-weight: 700; }
.apt-day .c { font-size: 10.5px; color: var(--text-dim); }
.apt-day.on { border-color: var(--gold); background: var(--gold-soft); }
.apt-day.on .n { color: var(--gold-bright); }
.apt-day.today .n { text-decoration: underline; text-underline-offset: 3px; }

.apt-sub { display: block; color: var(--text-dim); font-size: 11px; margin-top: 2px; }
.apt-actions { white-space: nowrap; text-align: right; }
.apt-mini { padding: 3px 8px; font-size: 11px; border-radius: 7px; }
.apt-actions .apt-mini { margin-left: 2px; }
.apt-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--border-soft); font-size: 12px; }

/* New/edit appointment modal form. */
.apt-form { display: flex; flex-direction: column; gap: 12px; }
.apt-form .form-foot { margin-top: 4px; justify-content: flex-end; }

/* Reports tab (hotel-report layout: sidebar list + main output). */
.apt-rbtn { display: flex; flex-direction: column; gap: 2px; text-align: left; width: 100%; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); font: inherit; font-size: 14px; cursor: pointer; margin-bottom: 8px; color: var(--text); }
.apt-rbtn small { display: block; color: var(--text-dim); margin-top: 2px; }
.apt-rbtn:hover { border-color: var(--text-dim); }
.apt-rbtn.on { border-color: var(--gold); background: var(--gold-soft); }
.apt-report table h2, .apt-report .cd h2 { margin-bottom: 10px; }

@media (max-width: 760px) {
  .apt-week { display: flex; overflow-x: auto; padding-bottom: 4px; }
  .apt-day { flex: 0 0 62px; }
  .apt-search { max-width: none; min-width: 160px; }
  .apt-date { width: 134px; }
  .apt-filter, select.apt-filter { width: 138px; }
}

@media print {
  .apt-page { display: block !important; }
  .apt-tabstrip, .apt-toolbar, .apt-week, .apt-rside, .apt-tools .tbs, .apt-foot, .apt-actions { display: none !important; }
  .apt-report .cols { display: block !important; }
  .apt-report .cd { border: none !important; padding: 0 !important; }
  .apt-report .kp { display: grid !important; grid-template-columns: repeat(3, 1fr) !important; gap: 10px !important; margin-bottom: 10px; }
  .apt-report .vl { font-size: 20px; }
  .apt-report h1 { font-size: 18px; }
  .apt-report h2 { font-size: 13px; margin-top: 10px; }
  .apt-report table { font-size: 10px; }
  .apt-list table { font-size: 10.5px; }
}


/* ---------------------------------------------------------------------------
   Appointments -- compact refinements, centered title-line tabs, month grid
   --------------------------------------------------------------------------- */
/* Bookings/Reports switcher sits on the topbar title line, centered. */
.apt-tabstrip { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }

/* Tighter page rhythm + smaller controls. */
.apt-page { gap: 10px; }
.apt-toolbar { gap: 8px; }
.apt-toolbar .input { padding: 8px 10px; font-size: 12.5px; }
.apt-viewseg { padding: 3px; gap: 3px; }
.apt-viewseg .tabstrip-btn { padding: 5px 10px; font-size: 11.5px; border-radius: 7px; }
.apt-week { gap: 6px; }
.apt-day { padding: 6px 3px; border-radius: 10px; }
.apt-day .n { font-size: 15px; }
.apt-day .c { font-size: 10px; }
.apt-list { padding: 10px 12px; }
.apt-list th, .apt-list td { padding: 6px 8px; }
.apt-list th { font-size: 11px; }
.apt-foot { padding-top: 8px; margin-top: 2px; }
.apt-mini { padding: 2px 7px; font-size: 10.5px; }

/* Month grid (calendar) view. */
.apt-monthwrap { display: flex; flex-direction: column; gap: 5px; }
.apt-month-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.apt-month-head span { text-align: center; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); }
.apt-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.apt-mcell { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 9px; padding: 4px 2px; cursor: pointer; color: var(--text); font: inherit; display: flex; flex-direction: column; align-items: center; line-height: 1.15; transition: border-color .12s ease, background .12s ease; }
.apt-mcell .n { font-size: 13px; font-weight: 600; }
.apt-mcell .c { font-size: 9.5px; color: var(--text-dim); }
.apt-mcell:hover { border-color: var(--text-dim); }
.apt-mcell.on { border-color: var(--gold); background: var(--gold-soft); }
.apt-mcell.on .n { color: var(--gold-bright); }
.apt-mcell.today .n { text-decoration: underline; text-underline-offset: 2px; }
.apt-mcell.blank { background: none; border-color: transparent; cursor: default; }
.apt-mcell.blank:hover { border-color: transparent; }

/* Reports tab -- compact. */
.apt-report .mainc { gap: 10px; }
.apt-report .cd { padding: 12px 14px; }
.apt-report h1 { font-size: 19px; }
.apt-report h2 { font-size: 13.5px; margin-bottom: 6px; }
.apt-report .kp { gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.apt-report .kp .cd { padding: 9px 11px; }
.apt-report .kp .lb { font-size: 10.5px; }
.apt-report .kp .vl { font-size: 21px; margin-top: 3px; }
.apt-rbtn { padding: 8px 11px; margin-bottom: 6px; border-radius: 11px; font-size: 13px; }
.apt-rbtn small { font-size: 11px; margin-top: 1px; }
.apt-tools { gap: 8px; }
.apt-tools .bt { padding: 6px 13px; font-size: 12.5px; border-radius: 9px; }
.apt-range .fm { gap: 8px; }
.apt-range .fd label { font-size: 11px; margin-bottom: 3px; }
.apt-range .fd input, .apt-range .fd select { padding: 7px 9px; font-size: 13px; border-radius: 9px; }
.apt-report table th, .apt-report table td { padding: 5px 8px; }

@media (max-width: 760px) {
  .apt-tabstrip { position: static; transform: none; }
  .apt-month-head, .apt-month { gap: 4px; }
}
/* ============================================================================
   HMS UI Design system
   Ported from the "HMS UI Design" export (D:\ARTECHNOHUB\mPOS HMS).
   Charcoal + gold palette driven by the shared CSS variables in global.css
   (dark by default, warm-paper in the opt-in [data-theme='light'] block);
   Newsreader (serif) headings and Plus Jakarta Sans body (see fonts.css).

   Class rules are global (their names are unique to this system, so they do
   not clash with the legacy MasterPOS classes). Element-level rules (h1/h2/
   table/th/td) are scoped to `.hms-page` so newly-built screens get the design
   typography while every legacy page keeps its own headings.
   ============================================================================ */

/* ---- shell ---- */
.hms { display: flex; flex-direction: column; height: 100vh; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--font-body); }

.hd { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px; background: var(--bg2); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.lg { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 20px; }
.mk { width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(155deg, var(--gold-bright), var(--gold-dim)); border: none; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--ink); font-family: var(--font-display); }
.mn { display: flex; align-items: center; justify-content: center; gap: 2px; flex: 1; min-width: 0; }
.us { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 6px 10px; font-size: 14px; }
.us-name { font-weight: 600; }
.fy { border: 1px solid var(--text); border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; background: var(--gold-soft); }
.av { width: 28px; height: 28px; border-radius: 50%; background: var(--gold-soft); color: var(--gold); display: flex; align-items: center; justify-content: center; font-size: 12px; }

.gr { display: flex; justify-content: space-between; align-items: center; padding: 14px 36px; border-bottom: 1px solid var(--border); gap: 12px; flex-wrap: wrap; flex: none; }
.gr i, .hms-greet { font-family: var(--font-display); font-size: 22px; font-style: normal; }
.hms-subtitle { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.gr-head { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tbs-row { flex: none; padding: 10px 36px 12px; }
.gr-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ch { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 8px 18px; font-size: 14px; font-family: var(--font-display); }

.tbs { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tb { padding: 8px 16px; border-radius: 999px; font-size: 14px; color: var(--text); text-decoration: none; background: none; border: none; cursor: pointer; font-family: inherit; }
.tb.on { background: var(--text); color: var(--bg); }

.pg { flex: 1; padding: 20px 36px 28px; display: flex; flex-direction: column; gap: 16px; }

.ft { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 16px; font-size: 13px; color: var(--text-dim); border-top: 1px solid var(--border); background: var(--bg2); }

/* ---- nav overflow menu (sections with grouped children, e.g. Reports) ---- */
.hms-sub { position: relative; }
.hms-sub > button { appearance: none; }
.hms-menu { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; min-width: 210px; max-height: 60vh; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35); padding: 6px; }
.hms-menu a { display: block; padding: 8px 12px; border-radius: 10px; color: var(--text); text-decoration: none; font-size: 14px; }
.hms-menu a:hover { background: var(--bg); }
.hms-menu a.on { color: var(--gold); font-weight: 700; }
.hms-menu-head { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); padding: 8px 12px 4px; }

/* ---- components ---- */
.cd { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 18px; padding: 20px 24px; box-sizing: border-box; }
.lb { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); }
.vl { font-family: var(--font-display); font-size: 32px; margin-top: 6px; }
.vl small { font-size: 14px; color: var(--text-dim); }
.kp { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.g2 { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.7fr); gap: 16px; }
.col { display: flex; flex-direction: column; gap: 16px; }
.bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; margin-bottom: 12px; }
.li { display: flex; justify-content: space-between; align-items: center; font-size: 14px; padding: 6px 0; border-bottom: 1px solid var(--border-soft); }
.li b { font-family: var(--font-display); font-size: 18px; }
.dt { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }
.hc { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }

.pl { display: inline-block; margin-top: 8px; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; background: var(--surface); border: 1px solid var(--border); }
.pl.gn { background: var(--success-soft); color: var(--success-ink); border-color: var(--success-soft); }
.pl.am { background: var(--gold-soft); color: var(--gold-dim); border-color: var(--gold-soft); }
.pl.rd { background: var(--danger-soft); color: var(--danger-ink); border-color: var(--danger-soft); }
.pl.ink { background: var(--text); color: var(--bg); border-color: var(--text); }

.bt { padding: 9px 18px; border-radius: 12px; border: 1px solid var(--text); background: var(--text); color: var(--bg); font-size: 14px; font-family: inherit; cursor: pointer; }
.bt.bo { background: var(--surface); color: var(--text); }
.bt.dis { background: var(--border-soft); color: var(--text-dim); border-color: var(--border-soft); cursor: not-allowed; }
.bt:disabled { opacity: .6; cursor: not-allowed; }

.tp { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

.rm { padding: 8px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-size: 14px; font-weight: 600; cursor: pointer; }
.rm.on { background: var(--text); color: var(--bg); border-color: var(--text); }

.cols { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.mainc { flex: 2; min-width: 360px; display: flex; flex-direction: column; gap: 16px; }
.sd { flex: 1; min-width: 260px; display: flex; flex-direction: column; gap: 10px; }
.sd small, .ck small { display: block; color: var(--text-dim); margin-top: 2px; }

.fm { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.fd label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 4px; }
.fd input, .fd select { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); font: inherit; font-size: 14px; color: var(--text); }

.tot { display: flex; justify-content: space-between; font-size: 14px; }
.bal { font-family: var(--font-display); font-size: 24px; border-top: 1px solid var(--text); padding-top: 10px; margin-top: 4px; }

.ar { padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); font-size: 14px; display: flex; flex-direction: column; gap: 2px; cursor: pointer; }
.ar.on { border-color: var(--text); }
.ar small { color: var(--text-dim); }

.ck { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border-soft); font-size: 14px; }

.fl { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); }
.gd { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.t { padding: 12px; border-radius: 14px; display: flex; flex-direction: column; gap: 2px; font-size: 12px; border: 1px solid transparent; }
.t b { font-family: var(--font-display); font-size: 22px; font-weight: 600; }
.t i { font-style: normal; font-weight: 700; }
.t u { text-decoration: none; font-size: 11px; background: var(--surface); color: var(--text); border-radius: 6px; padding: 1px 6px; align-self: flex-start; margin-top: 3px; }
.t.cl { background: var(--success-soft); color: var(--success-ink); border-color: var(--success-soft); }
.t.di { background: var(--gold-soft); color: var(--gold-dim); border-color: var(--gold-soft); }
.t.oc { background: var(--text); color: var(--bg); }
.t.oo { background: var(--surface2); color: var(--text-dim); border-color: var(--border); }
.t.oc u, .t.oo u { background: var(--surface); }

.sc { overflow-x: auto; }
.in { min-width: 640px; }
.r { display: grid; grid-template-columns: 140px 1fr; border-bottom: 1px solid var(--border-soft); align-items: center; font-size: 13px; }
.tk { display: grid; grid-template-columns: repeat(7, 1fr); padding: 7px 0; gap: 0 4px; }
.tk span { text-align: center; color: var(--text-dim); }
.tk em { font-style: normal; padding: 7px 10px; border-radius: 10px; font-size: 12px; font-weight: 600; overflow: hidden; white-space: nowrap; }
.tk em.ci { background: var(--text); color: var(--bg); }
.tk em.cf { background: var(--gold-dim); color: var(--ink); }
.tk em.gp { background: var(--success-soft); color: var(--success-ink); }
.tk em.tn { background: var(--surface); color: var(--text); border: 1px dashed var(--text-faint); }

/* chart legend swatches used by the dashboard */
.hms-chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; margin-top: 8px; }
.hms-chart-legend .dt { margin-right: 6px; }

/* ---- element typography scoped to newly-built screens ---- */
.hms-page { display: flex; flex-direction: column; gap: 16px; }
.hms-page h1 { margin: 0; font-family: var(--font-display); font-size: 26px; font-weight: 600; }
.hms-page h2 { margin: 0 0 10px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); font-weight: 700; }
.hms-page table { width: 100%; border-collapse: collapse; font-size: 13px; }
.hms-page th { text-align: left; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); border-bottom: 1px solid var(--border); padding: 8px 6px; font-weight: 700; }
.hms-page td { padding: 9px 6px; border-bottom: 1px solid var(--border-soft); }
.hms-page th.n, .hms-page td.n { text-align: right; }

/* small screens: let the nav and content breathe */
@media (max-width: 760px) {
  .pg { padding: 16px 14px 20px; }
  .gr { padding: 12px 14px; }
  .tbs-row { padding: 8px 14px 10px; }
  .hd { padding: 10px 14px; }
  .mn { gap: 14px; display: none; }
  .us-name { display: none; }
}

/* print-to-PDF: the fixed-height shell must expand and drop its chrome */
@media print {
  .hms { height: auto !important; overflow: visible !important; display: block !important; }
  .hd, .gr { display: none !important; }
}
