/* ROZE panel — design system (colours and font follow rozeskin.com) */

/* Light palette matches the sign-in page: peach page, warm white header, side panel and cards,
   terracotta accents, deep brown text. Accent hues (info, violet, teal) stay in the same warm family;
   success and danger keep their meaning. */
:root {
  --bg: #faf3f3;
  --surface: #fffdfc;
  --surface-2: #fbf4ef;
  --border: #f4e9e3;
  --border-strong: #eddcd3;
  --text: #2f1a14;
  --text-2: #5c3d33;
  --muted: #997a70;
  --faint: #cbbbb6;

  --brand: #d78358;
  --brand-hover: #cf6c36;
  --brand-ink: #b6604d;
  --brand-soft: #fbf0e9;
  --brand-line: #f4ddd0;

  --success: #2f7a4f; --success-bg: #f3f8f3; --success-line: #dcecdf;
  --warning: #9a6416; --warning-bg: #fcf5e9; --warning-line: #f2e5c8;
  --danger: #b42318;  --danger-bg: #fdf4f2;  --danger-line: #f6dad5;
  --info: #b6604d;    --info-bg: #fbf2ed;    --info-line: #f3dfd6;
  --violet: #b46571;  --violet-bg: #fbefef;
  --teal: #9c5d3a;    --teal-bg: #f9f1ea;
  --neutral-bg: #f9f2ed;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgb(17 20 24 / 4%), 0 2px 6px rgb(17 20 24 / 5%);
  --shadow-lg: 0 12px 32px rgb(17 20 24 / 13%);
  --topbar-h: 64px;
  --sidebar-w: 96px;
  --sidebar-w-collapsed: 64px;
  --font: 'Manrope Variable', 'Manrope', -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
/* The page scrolls (wheel, trackpad, keyboard, touch) without showing a scrollbar. With no scrollbar, short and long
   pages are the same width, so the centred menu never shifts. Form popups scroll without one too. */
html { -webkit-text-size-adjust: 100%; scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);

}
a { color: var(--brand-ink); text-decoration: none; }
a:hover { color: var(--text); }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 16px; font-weight: 620; }
h3 { font-size: 14px; font-weight: 620; }
p { margin: 0; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.ico { width: 18px; height: 18px; flex: none; stroke-width: 1.9; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: var(--radius-sm); }
.skip-link:focus { left: 8px; }

/* ---------- Top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; flex: none; margin-right: 12px; line-height: 1; }
.brand img { display: block; height: 30px; width: auto; }
.brand-lg { margin: 0 0 22px; }
.brand-lg img { height: 46px; }
/* The menu button is only needed on small screens, where it opens the side panel */
.topbar .sidebar-toggle { display: none; }
@media (max-width: 1100px) { .topbar .sidebar-toggle { display: inline-grid; } }

/* Centered menu; the active section has an orange underline on the header's bottom edge */
.mainnav {
  display: flex; gap: 6px; flex: 1; min-width: 0; align-self: stretch;
  justify-content: safe center;
  overflow-x: auto; scrollbar-width: none;
}
.mainnav::-webkit-scrollbar { display: none; }
/* Main menu, Icon Reveal: pill-shaped items; the open section is a peach pill showing its icon */
.mainnav { align-items: center; gap: 4px; }
.mainnav a {
  position: relative; display: inline-grid; place-items: center; flex: none;
  height: 38px; padding: 0 14px; border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--text-2); white-space: nowrap;
  transition: color .12s, background-color .12s;
}
/* Both layers share one grid cell: the invisible sizer (icon + bold text) fixes the width, the face shows */
.mainnav a > span { grid-area: 1 / 1; display: inline-flex; align-items: center; gap: 7px; }
.mainnav .nav-sizer { visibility: hidden; font-weight: 750; }
.mainnav a:hover { color: var(--text); background: rgb(238 247 251 / 45%); }
.mainnav a.active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 750; }
.mainnav a .ico { width: 16px; height: 16px; color: var(--brand); }
:root[data-theme='dark'] .mainnav a:hover { background: var(--neutral-bg); }
.topbar-right { display: flex; align-items: center; gap: 16px; margin-left: auto; }
/* Clock: one line in a hairline capsule, e.g. "🕐 17:09  Tue, 27 Oct" */
/* Top-right corner, Ringed Icons: peach clock pill, bell in a ringed peach circle, initials with a peach ring */
.clock {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: none;
  min-width: 172px; height: 38px; padding: 0 15px;
  border-radius: 999px; background: var(--brand-soft);
  font-size: 13px; white-space: nowrap;
}
.clock .ico { width: 16px; height: 16px; stroke-width: 2; color: var(--brand); }
.clock strong { font-weight: 800; color: var(--brand-ink); font-variant-numeric: tabular-nums; }
.clock span { font-weight: 500; color: var(--text-2); }
.topbar .bellmenu > summary.bell {
  width: 38px; height: 38px; border-radius: 50%; background: var(--brand-soft); color: var(--brand);
  box-shadow: 0 0 0 3px var(--surface), 0 4px 10px -3px rgb(17 20 24 / 30%);
}
.topbar .bellmenu > summary.bell:hover, .topbar .bellmenu[open] > summary.bell { background: var(--brand); color: #fff; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); color: var(--brand-ink); font-size: 12.5px; font-weight: 800; letter-spacing: .02em;
  box-shadow: 0 0 0 3px var(--brand-soft), inset 0 0 0 1.5px var(--brand);
  cursor: pointer; list-style: none;
  transition: background .12s;
}
.avatar:hover, .usermenu[open] .avatar { background: var(--brand-soft); }
/* Account button, Split Button: one white pill split by a thin line — initials | arrow; the arrow flips while open */
.avatar-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 11px 0 4px;
  border-radius: 999px; background: var(--surface); cursor: pointer; list-style: none;
  box-shadow: 0 0 0 1px var(--border), 0 4px 12px -8px rgb(17 20 24 / 30%);
  transition: box-shadow .12s;
}
.avatar-btn::-webkit-details-marker { display: none; }
.avatar-btn .avatar { width: 36px; height: 36px; background: var(--brand-soft); box-shadow: none; }
.avatar-btn:hover, .usermenu[open] .avatar-btn { box-shadow: 0 0 0 1.5px var(--brand-line), 0 6px 16px -8px rgb(17 20 24 / 35%); }
.avatar-btn:hover .avatar, .usermenu[open] .avatar-btn .avatar { background: var(--brand-soft); }
.avatar-sep { width: 1px; height: 22px; background: rgb(17 20 24 / 15%); }
.avatar-caret { width: 16px; height: 16px; color: var(--brand); transition: transform .15s; }
.usermenu[open] .avatar-caret { transform: rotate(180deg); }
.avatar-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 999px; }

/* ---------- Shell / sidebar ---------- */
.shell { padding-top: var(--topbar-h); display: flex; min-height: 100vh; }
/* Light tile rail: icon above label */
.sidebar {
  position: fixed; top: var(--topbar-h); bottom: 0; left: 0; z-index: 30;
  width: var(--sidebar-w);
  padding: 14px 8px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  /* Scrolls (wheel, trackpad, touch) without showing a scrollbar */
  overflow-y: auto; scrollbar-width: none;
  transition: width .18s ease, transform .2s ease;
}
.sidebar::-webkit-scrollbar { display: none; }
.side-title { display: none; font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 4px 10px 8px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-link {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  min-height: 60px; padding: 9px 4px; border-radius: 12px;
  color: var(--text-2); font-size: 11px; font-weight: 650; line-height: 1.25; text-align: center;
}
.side-link .ico { width: 20px; height: 20px; }
.side-link:hover { background: var(--neutral-bg); color: var(--text); }
.side-link.active { background: var(--brand-soft); color: var(--brand-ink); box-shadow: inset 0 0 0 1px var(--brand-line); }
.side-link.active .ico { color: var(--brand); }
/* Side menu, Ringed Icons: each icon sits in a small ringed circle like the card icons; the open page's
   circle fills peach with a white ring and its label turns terracotta (no tile behind the item) */
.side-nav .side-link { gap: 6px; padding: 8px 4px; }
.side-nav .side-link .ico {
  box-sizing: content-box; width: 18px; height: 18px; padding: 10px; border-radius: 50%;
  background: var(--surface); color: var(--muted); box-shadow: 0 0 0 1px rgb(17 20 24 / 10%);
  transition: background-color .12s, color .12s, box-shadow .12s;
}
.side-nav .side-link:hover, .side-nav .side-link.active { background: none; box-shadow: none; }
.side-nav .side-link:hover { color: var(--text); }
.side-nav .side-link:hover .ico { color: var(--brand); box-shadow: 0 0 0 1.5px var(--brand-line); }
.side-nav .side-link.active { color: var(--brand-ink); font-weight: 750; }
.side-nav .side-link.active .ico { background: var(--brand-soft); color: var(--brand); box-shadow: 0 0 0 3px var(--surface), 0 6px 14px -4px rgb(17 20 24 / 30%); }
.side-sections { display: none; }
.content { flex: 1; min-width: 0; margin-left: var(--sidebar-w); padding: 24px; transition: margin .18s ease; }
.backdrop { display: none; }

body.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
body.sidebar-collapsed .sidebar .side-link span,
body.sidebar-collapsed .sidebar .side-title { display: none; }
body.sidebar-collapsed .sidebar .side-link { min-height: 44px; }
body.sidebar-collapsed .content { margin-left: var(--sidebar-w-collapsed); }

@media (max-width: 1100px) {
  .mainnav, .clock { display: none; }
  .sidebar, body.sidebar-collapsed .sidebar { transform: translateX(-100%); width: 240px; padding: 16px 12px; background: var(--surface); box-shadow: var(--shadow-lg); }
  .side-title { display: block; }
  .side-link { flex-direction: row; justify-content: flex-start; gap: 10px; min-height: 0; padding: 9px 10px; font-size: 14px; font-weight: 520; text-align: left; }
  .side-link .ico { width: 18px; height: 18px; }
  .side-nav .side-link .ico { width: 16px; height: 16px; padding: 7px; }
  .content, body.sidebar-collapsed .content { margin-left: 0; padding: 16px; }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .backdrop { display: block; position: fixed; inset: var(--topbar-h) 0 0 0; z-index: 20; background: rgb(17 20 24 / 35%); }
  body.sidebar-collapsed .sidebar .side-link span, body.sidebar-collapsed .sidebar .side-title { display: initial; }
  .side-sections { display: flex; flex-direction: column; gap: 2px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
  .side-sections .side-link.current { color: var(--brand-hover); font-weight: 650; }
}

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
/* Page header: buttons pushed right with their icons in ringed circles */
.page-head > .actions { margin-left: auto; }
.page-head .actions .btn { border-radius: 999px; }
.page-head .actions .btn:has(> .ico) { padding-left: 6px; }
.page-head .actions .btn > .ico {
  box-sizing: content-box; width: 14px; height: 14px; padding: 7px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand); box-shadow: 0 0 0 2px var(--surface), 0 2px 6px -2px rgb(17 20 24 / 25%);
}
/* Outline main buttons keep a plain icon, no ringed circle */
.page-head .actions .btn.btn-primary:has(> .ico) { padding-left: 16px; }
.page-head .actions .btn-primary > .ico { box-sizing: border-box; width: 16px; height: 16px; padding: 0; background: none; color: currentColor; box-shadow: none; }
:root:not([data-theme='dark']) .page-head .actions .btn-secondary {
  background: rgb(255 255 255 / 70%); border-color: #fff; box-shadow: 0 0 0 1px rgb(17 20 24 / 6%), 0 4px 10px -4px rgb(17 20 24 / 18%);
}
.subtitle { color: var(--muted); margin-top: 4px; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.back-link .ico { width: 16px; height: 16px; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card + .card, .stack > * + * { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.card-head h2 .ico { color: var(--muted); }
.card-body { padding: 16px; }
.card-foot { padding: 12px 16px; border-top: 1px solid var(--border); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-2 > .card + .card, .grid-3 > .card + .card { margin-top: 0; }
.section-gap { margin-top: 16px; }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ---------- Stats ---------- */
/* Stat cards always fill the full width: 4 per row, or 2/3 per row when the row holds 2, 3 or 6 cards */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.stats:has(> :nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats:has(> :nth-child(3):last-child),
.stats:has(> :nth-child(6):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .stats, .stats:has(> :nth-child(3):last-child), .stats:has(> :nth-child(6):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .stats, .stats:has(> *) { grid-template-columns: minmax(0, 1fr); } }
.stat { display: flex; align-items: flex-start; gap: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.stat-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.stat-icon .ico { width: 20px; height: 20px; }
.stat-body { display: flex; flex-direction: column; min-width: 0; }
.stat-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 22px; font-weight: 680; font-variant-numeric: tabular-nums; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tone-brand { background: var(--brand-soft); color: var(--brand); }
.tone-blue { background: var(--info-bg); color: var(--info); }
.tone-green { background: var(--success-bg); color: var(--success); }
.tone-amber { background: var(--warning-bg); color: var(--warning); }
.tone-red { background: var(--danger-bg); color: var(--danger); }
.tone-violet { background: var(--violet-bg); color: var(--violet); }
.tone-teal { background: var(--teal-bg); color: var(--teal); }
.tone-slate { background: var(--neutral-bg); color: var(--text-2); }
/* Dashboard card icons, "Sage, Rose, Lilac" (chosen 29 Oct 2026): sage, rose and lilac taking turns across the row */
.tone-sage { background: #edf4ef; color: #4a7556; }
.tone-rose { background: #f9eaf0; color: #c46c89; }
.tone-lilac { background: #f1effb; color: #7b6dc6; }
:root[data-theme='dark'] .tone-sage { background: rgb(74 117 86 / 24%); color: #9cc7a8; }
:root[data-theme='dark'] .tone-rose { background: rgb(194 87 122 / 24%); color: #f0a3bd; }
:root[data-theme='dark'] .tone-lilac { background: rgb(106 88 196 / 26%); color: #b9aeea; }
/* Light theme: decorative stat icons stay in the warm sign-in palette (green is kept for status badges) */
:root:not([data-theme='dark']) :is(.stat-icon, .glance-icon).tone-green { background: #fcf3e9; color: #a8642a; }
.up { color: var(--success); }
.down { color: var(--danger); }

/* ---------- Forms ---------- */
input, select, textarea, button { font: inherit; color: inherit; }
input[type='text'], input[type='search'], input[type='email'], input[type='password'], input[type='number'],
input[type='date'], input[type='datetime-local'], input[type='tel'], input[type='file'], input:not([type]), select, textarea {
  width: 100%; min-height: 38px;
  padding: 8px 11px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color .12s, box-shadow .12s;
}
input[type='month'] {
  min-height: 38px; padding: 8px 11px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
.card-head .actions input, .card-head .actions select { width: auto; }
textarea { min-height: 120px; resize: vertical; }
input[type='file'] { padding: 6px; }
select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a6f66' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgb(142 153 224 / 20%); }
/* Dropdown menus: frosted-glass list where the browser supports customizable selects (Chrome/Edge);
   elsewhere the native list is used. The closed select keeps its own look and chevron above. */
@supports (appearance: base-select) {
  select:not([multiple]):not([size]), select:not([multiple]):not([size])::picker(select) { appearance: base-select; }
  /* A long choice ("Complimentary") stops before the chevron instead of running under it */
  select:not([multiple]):not([size]) { display: inline-flex; align-items: center; white-space: nowrap; overflow: clip; overflow-clip-margin: content-box; }
  select:not([multiple]):not([size])::picker-icon { display: none; }
  select::picker(select) {
    margin-top: 6px; padding: 6px; max-block-size: min(22rem, 70vh);
    border: 1px solid #fff; border-radius: 14px; color: var(--text); font-size: 14px;
    background: rgb(255 255 255 / 78%);
    -webkit-backdrop-filter: blur(20px) saturate(1.5); backdrop-filter: blur(20px) saturate(1.5);
    box-shadow: 0 16px 36px -10px rgb(17 20 24 / 25%), inset 0 1px 0 #fff;
  }
  select option { gap: 8px; padding: 8px 10px; border-radius: 9px; color: var(--text); font-weight: 500; cursor: pointer; }
  select option:hover, select option:focus-visible { background: rgb(238 247 251 / 55%); outline: none; }
  select option:checked { background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; }
  select option:disabled { opacity: .45; cursor: default; }
  select option::checkmark { order: 1; margin-left: auto; color: var(--brand); font-weight: 800; }
  select optgroup { font-size: 11.5px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
  :root[data-theme='dark'] select::picker(select) {
    border-color: var(--border); background: rgb(17 20 24 / 92%); box-shadow: 0 16px 36px -10px rgb(0 0 0 / 60%);
  }
  :root[data-theme='dark'] select option:hover { background: var(--neutral-bg); }
}
[aria-invalid='true'] { border-color: var(--danger) !important; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field .help { color: var(--muted); font-size: 12px; }
.error { color: var(--danger); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; }
/* Confirm popup "Rose header" (chosen 31 Oct 2026; public/js/app.js, forms with data-confirm): a card with a tinted
   band holding the pressed action's icon, the question, and Cancel beside the action */
.confirm-dlg {
  width: min(344px, calc(100vw - 32px)); max-width: none; margin: auto; padding: 0; overflow: hidden;
  border: 0; border-radius: 24px; background: var(--surface); color: var(--text); text-align: center;
  box-shadow: 0 0 0 1px var(--border), 0 24px 48px -16px rgb(17 20 24 / 40%);
}
.confirm-dlg[open] { animation: confirm-pop .4s cubic-bezier(.2, .9, .25, 1.12); }
.confirm-dlg::backdrop { background: rgb(17 20 24 / 30%); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: confirm-fade .25s; }
@keyframes confirm-pop { from { opacity: 0; transform: scale(1.1); } }
@keyframes confirm-fade { from { opacity: 0; } }
.cd-band { display: grid; place-items: center; height: 86px; background: var(--brand-soft); }
.cd-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--surface); color: var(--brand-ink); box-shadow: 0 0 0 1.5px var(--brand-line); }
.cd-icon svg { width: 22px; height: 22px; }
.confirm-dlg.is-danger .cd-icon { color: var(--danger); box-shadow: 0 0 0 1.5px var(--danger-line); }
.cd-body { padding: 14px 20px 20px; }
.cd-body h2 { margin: 0; font-size: 16px; font-weight: 750; letter-spacing: -.01em; text-wrap: balance; overflow-wrap: anywhere; }
.cd-body p { margin: 6px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.cd-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.cd-actions .btn { width: 100%; padding-left: 10px; padding-right: 10px; }
@media (prefers-reduced-motion: reduce) { .confirm-dlg[open], .confirm-dlg::backdrop { animation: none; } }

/* Form popup (public/js/app.js): a glass dialog holding the form page in a frame */
.form-modal {
  position: fixed; width: min(1180px, 94vw); max-width: none; max-height: 92vh; margin: auto; padding: 0; overflow: hidden;
  border: 1px solid rgb(255 255 255 / 85%); border-radius: 22px; color: var(--text);
  background: var(--bg);
  -webkit-backdrop-filter: blur(24px) saturate(1.4); backdrop-filter: blur(24px) saturate(1.4);
  box-shadow: 0 30px 80px -20px rgb(17 20 24 / 45%), inset 0 1px 0 #fff;
  opacity: 0; transform: translateY(12px) scale(.98); transition: opacity .18s ease, transform .18s ease;
}
.form-modal[open] { opacity: 1; transform: none; }
.form-modal.narrow { width: min(560px, 94vw); }
.form-modal.medium { width: min(900px, 94vw); }
/* Text box with a dropdown arrow, for inputs that suggest values from a datalist */
.combo { position: relative; display: block; }
.combo input { padding-right: 34px; }
/* The box sits where a field label would, so reset the small label text styles */
.field > span.combo, form.stack .field > span.combo { font-size: 14px; font-weight: 400; color: var(--text); }
.combo > .ico { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.combo input::-webkit-calendar-picker-indicator { opacity: 0; }
/* Suggestion list for [data-combo] boxes (public/js/app.js): same frosted glass as the dropdown menus */
.combo-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 70; max-height: 260px; overflow-y: auto;
  margin: 0; padding: 6px; list-style: none; border: 1px solid #fff; border-radius: 14px; color: var(--text); font-size: 14px;
  background: rgb(255 255 255 / 92%); -webkit-backdrop-filter: blur(20px) saturate(1.5); backdrop-filter: blur(20px) saturate(1.5);
  box-shadow: 0 16px 36px -10px rgb(17 20 24 / 25%), inset 0 1px 0 #fff;
  scrollbar-width: thin; scrollbar-color: rgb(142 153 224 / 35%) transparent;
}
.combo-list[hidden] { display: none; }
.combo-list li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 9px; font-weight: 500; cursor: pointer; }
.combo-list li:hover, .combo-list li.on { background: rgb(238 247 251 / 60%); }
.combo-list li[aria-selected='true'] { background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; }
.combo-list li[aria-selected='true']::after { content: "✓"; margin-left: auto; color: var(--brand); font-weight: 800; }
.combo-list .combo-empty { color: var(--muted); font-size: 13px; cursor: default; }
.combo-list .combo-empty:hover { background: none; }
.combo:has(input[aria-expanded='true']) > .ico { transform: translateY(-50%) rotate(180deg); }
.combo > .ico { transition: transform .15s; }
:root[data-theme='dark'] .combo-list { border-color: var(--border); background: rgb(17 20 24 / 96%); }
/* Editor inside forms: a soft peach toolbar band like a document editor */
form.stack .rte { border-radius: 12px; overflow: hidden; background: rgb(255 255 255 / 80%); }
:root:not([data-theme='dark']) form.stack .rte-toolbar { background: rgb(238 247 251 / 50%); border-bottom-color: rgb(255 255 255 / 90%); padding: 6px 8px; }
form.stack .rte-btn:hover, form.stack .rte-btn[aria-pressed='true'] { background: #fff; color: var(--brand); }
.modal-page form.stack .rte-content { min-height: 200px; max-height: 340px; }
.modal-page form.stack.narrow { max-width: none; }
.form-modal::backdrop { background: rgb(17 20 24 / 38%); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.form-modal iframe { display: block; width: 100%; height: 240px; border: 0; background: transparent; opacity: 0; transition: opacity .15s; }
.form-modal.ready iframe { opacity: 1; }
.modal-close {
  position: absolute; top: 16px; right: 16px; z-index: 2; display: grid; place-items: center; width: 38px; height: 38px;
  border: 0; border-radius: 50%; background: var(--brand-soft); color: var(--brand); cursor: pointer;
  box-shadow: 0 0 0 3px #fff, 0 4px 12px -2px rgb(17 20 24 / 25%);
}
.modal-close:hover { background: var(--brand); color: #fff; }
/* On form popups the close button sits half outside the top-right corner; the dialog lets it overflow and the
   frame keeps the rounded corners itself */
.form-modal { overflow: visible; }
.form-modal iframe { border-radius: inherit; }
.form-modal .modal-close { top: -19px; right: -19px; }
.modal-close .ico { width: 18px; height: 18px; }
.modal-loading { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.modal-loading span { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--brand-soft); border-top-color: var(--brand); animation: modal-spin .8s linear infinite; }
.form-modal.ready .modal-loading { display: none; }
@keyframes modal-spin { to { transform: rotate(360deg); } }
:root[data-theme='dark'] .form-modal { border-color: var(--border); }
:root[data-theme='dark'] .modal-page .form-actions { background: linear-gradient(to top, var(--bg) 72%, transparent); }
/* Quick view (double-click a row with data-quickview): small glass popup with image, details, Close / Edit */
.quick-view {
  position: fixed; width: min(440px, 92vw); margin: auto; padding: 0; overflow: hidden;
  border: 1px solid rgb(255 255 255 / 85%); border-radius: 22px; color: var(--text); background: var(--bg);
  box-shadow: 0 30px 80px -20px rgb(17 20 24 / 45%), inset 0 1px 0 #fff;
}
.quick-view::backdrop { background: rgb(17 20 24 / 38%); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.qv-head { display: flex; align-items: center; gap: 12px; padding: 18px 64px 14px 20px; }
.qv-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); box-shadow: 0 0 0 3px #fff, 0 4px 10px -2px rgb(17 20 24 / 18%); }
.qv-icon .ico { width: 19px; height: 19px; }
.qv-title { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.qv-title strong { font-size: 17px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qv-title small { align-self: flex-start; margin-top: 3px; padding: 1px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); font-size: 11.5px; font-weight: 700; letter-spacing: .02em; }
.quick-view .modal-close { top: 18px; }
.qv-media { display: grid; place-items: center; height: 220px; margin: 0 20px; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1px rgb(17 20 24 / 6%); }
.qv-media img { max-width: 100%; max-height: 200px; object-fit: contain; }
.qv-noimg { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--faint); }
.qv-noimg .ico { width: 40px; height: 40px; }
.qv-list { margin: 14px 20px 0; padding: 4px 16px; border-radius: 14px; background: rgb(255 255 255 / 60%); border: 1px solid #fff; }
.qv-list > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.qv-list > div + div { border-top: 1px solid rgb(17 20 24 / 8%); }
.qv-list dt { font-size: 13px; color: var(--muted); }
.qv-list dd { margin: 0; font-size: 13.5px; font-weight: 650; text-align: right; }
.qv-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 20px 18px; }
.qv-foot .btn { border-radius: 999px; min-height: 40px; padding: 0 18px; }
:root:not([data-theme='dark']) .qv-foot .btn-secondary { background: rgb(255 255 255 / 75%); border-color: #fff; box-shadow: 0 0 0 1px rgb(17 20 24 / 6%), 0 4px 10px -4px rgb(17 20 24 / 18%); }
:root[data-theme='dark'] .quick-view { border-color: var(--border); }
:root[data-theme='dark'] .qv-media { background: var(--surface-2); }
tr[data-quickview], tr[data-dblhref] { cursor: pointer; }
tr[data-dblhref]:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
/* List + details pages (Vendors, Purchase orders): list on the left, the chosen record on the right (glass panels) */
.md-split { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.md-split > .card { margin: 0; border-radius: 18px; }
:root:not([data-theme='dark']) .md-split > .card {
  background: rgb(255 255 255 / 55%); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  border-color: rgb(255 255 255 / 85%); box-shadow: 0 10px 28px -8px rgb(17 20 24 / 14%), inset 0 1px 0 #fff;
}
.md-list { position: sticky; top: calc(var(--topbar-h) + 16px); display: flex; flex-direction: column; max-height: calc(100vh - var(--topbar-h) - 40px); }
.vl-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 10px; }
.vl-head h2 { font-size: 17px; font-weight: 750; }
.vl-add { margin-left: auto; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--brand); color: var(--brand); }
.vl-add:hover { background: var(--brand); color: #fff; }
.vl-add .ico { width: 16px; height: 16px; stroke-width: 2.4; }
.vl-search { padding: 0 14px 10px; }
.vl-search .toolbar-search { min-width: 0; }
.vl-search input { min-height: 38px; }
.vl-items { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 10px; scrollbar-width: thin; scrollbar-color: rgb(142 153 224 / 35%) transparent; }
.vl-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 8px; padding: 10px 12px; border-radius: 12px; color: var(--text); }
.vl-item + .vl-item { margin-top: 2px; }
.vl-item:hover { background: rgb(255 255 255 / 65%); }
.vl-item.on { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.vl-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vl-item small { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.vd-bar { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 18px 18px 0 0; background: linear-gradient(120deg, #faebe2, rgb(251 244 239 / 60%)); border-bottom: 1px solid rgb(255 255 255 / 80%); }
.vd-bar h1 { font-size: 18px; font-weight: 750; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vd-back { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: #fff; color: var(--brand); box-shadow: 0 0 0 1px rgb(17 20 24 / 8%), 0 3px 8px -3px rgb(17 20 24 / 25%); }
.vd-back:hover { background: var(--brand); color: #fff; }
.vd-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.vd-actions .btn { border-radius: 999px; min-height: 38px; padding: 0 16px; }
:root:not([data-theme='dark']) .vd-actions .btn-secondary { background: rgb(255 255 255 / 75%); border-color: #fff; box-shadow: 0 0 0 1px rgb(17 20 24 / 6%), 0 4px 10px -4px rgb(17 20 24 / 18%); }
.vd-actions .btn.vd-delete, .vd-actions .vd-delete .ico { color: var(--danger); }
.vd-actions .btn.vd-delete:hover { background: var(--danger-bg); }
.vd-profile { display: flex; align-items: center; gap: 16px; padding: 22px 24px 8px; }
.vd-avatar { display: grid; place-items: center; flex: none; width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(150deg, #f0bda0, #d78358); color: #fff; font-size: 22px; font-weight: 800; letter-spacing: .02em; box-shadow: 0 0 0 4px #fff, 0 8px 18px -6px rgb(142 153 224 / 60%); }
.vd-profile h2 { font-size: 21px; font-weight: 750; }
.vd-profile p { margin: 2px 0 6px; font-size: 13.5px; color: var(--muted); }
.vd-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 32px; padding: 8px 24px 12px; }
.vd-section { padding: 12px 0; }
.vd-section h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 11.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.vd-section h3 .ico { width: 15px; height: 15px; color: var(--brand); }
.vd-kv { display: grid; grid-template-columns: 130px minmax(0, 1fr); margin: 0; border-radius: 14px; background: rgb(255 255 255 / 60%); border: 1px solid #fff; overflow: hidden; }
.vd-kv dt, .vd-kv dd { margin: 0; padding: 10px 14px; font-size: 13.5px; }
.vd-kv dt { color: var(--muted); }
.vd-kv dd { font-weight: 600; overflow-wrap: anywhere; }
.vd-kv dt:not(:first-of-type), .vd-kv dt:not(:first-of-type) + dd { border-top: 1px solid rgb(17 20 24 / 7%); }
.vd-address { display: flex; flex-direction: column; margin: 0; padding: 12px 14px; border-radius: 14px; background: rgb(255 255 255 / 60%); border: 1px solid #fff; font-size: 13.5px; font-weight: 600; }
.vd-notes { padding: 0 24px 22px; }
.vd-notes p { margin: 0; padding: 12px 14px; border-radius: 14px; background: rgb(255 255 255 / 60%); border: 1px solid #fff; }
/* Purchase order list items: vendor + amount, PO no + date, status */
.pd-item { grid-template-columns: minmax(0, 1fr) auto; }
.pd-amt { font-weight: 750; font-size: 13px; white-space: nowrap; }
.pd-badge { grid-column: 1 / -1; margin-top: 4px; }
.vd-actions .menu > summary.btn { list-style: none; cursor: pointer; }
.vd-actions .menu > summary.btn::-webkit-details-marker { display: none; }
/* Purchase order shown as a document */
.pd-doc { padding: 24px 28px 26px; }
.pd-top { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px 48px; }
.pd-title { font-size: 24px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.pd-no { margin: 2px 0 0; font-size: 14px; color: var(--text-2); }
.pd-label { margin: 22px 0 8px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pd-top > div:last-child .pd-label:first-child { margin-top: 4px; }
.pd-kv { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px 12px; margin: 0; font-size: 13.5px; }
.pd-kv dt { color: var(--muted); }
.pd-kv dd { margin: 0; font-weight: 600; }
.pd-meta { margin-top: 18px; padding-top: 14px; border-top: 1px solid rgb(17 20 24 / 8%); }
.pd-ok { color: var(--success); } .pd-warn { color: var(--warning); } .pd-bad { color: var(--danger); } .pd-muted { color: var(--muted); }
.pd-addr { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 12px 14px; border-radius: 14px; background: rgb(255 255 255 / 60%); border: 1px solid #fff; font-size: 13.5px; color: var(--text-2); }
.pd-addr .strong { color: var(--text); }
.pd-receive-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; padding: 10px 12px 10px 16px; border-radius: 14px; background: var(--brand-soft); font-size: 13px; font-weight: 600; color: var(--brand-ink); }
.pd-receive-bar > span { display: inline-flex; align-items: center; gap: 8px; }
.pd-receive-bar .btn { border-radius: 999px; }
.pd-doc .table-wrap { margin-top: 18px; border-radius: 14px; background: rgb(255 255 255 / 60%); border: 1px solid #fff; }
.pd-lines th { background: rgb(238 247 251 / 55%); }
.pd-lines td { vertical-align: middle; }
.pd-item-cell { display: flex; align-items: center; gap: 12px; }
.pd-item-cell .thumb { width: 44px; height: 44px; }
.pd-totals { width: min(360px, 100%); margin: 18px 0 0 auto; display: grid; gap: 10px; font-size: 14px; }
.pd-totals > div { display: flex; justify-content: space-between; gap: 16px; }
.pd-totals small { display: block; font-size: 12px; color: var(--muted); }
.pd-grand { padding-top: 12px; border-top: 1px solid rgb(17 20 24 / 12%); font-size: 20px; font-weight: 750; }
.pd-extra { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 32px; margin-top: 18px; }
.pd-box { margin: 0; padding: 12px 14px; border-radius: 14px; background: rgb(255 255 255 / 60%); border: 1px solid #fff; }
@media (max-width: 1000px) {
  .md-split { grid-template-columns: minmax(0, 1fr); }
  .md-list { position: static; max-height: 320px; }
  .vd-grid, .pd-top, .pd-extra { grid-template-columns: minmax(0, 1fr); }
}
tr[data-quickview]:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
/* The page inside the popup: no shell, transparent so the dialog glass shows. The content area is the only
   scroller, inset from the dialog edge so its thin scrollbar clears the rounded corners; the title bar and the
   Cancel / Submit bar stay pinned while the fields scroll between them. */
html:has(> body.modal-page), body.modal-page { height: 100%; overflow: hidden; }
body.modal-page { background: transparent; }
.modal-page .content {
  height: calc(100% - 12px); margin: 6px; padding: 0 20px; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: none; /* scrolls without showing a scrollbar, like the pages behind it */
}
.modal-page .content::-webkit-scrollbar { display: none; }
.modal-page .page-head {
  position: sticky; top: 0; z-index: 5; margin: 0 -20px 12px; padding: 16px 64px 12px 20px; background: var(--bg);
}
.modal-page .form-actions {
  position: sticky; bottom: 0; z-index: 5; margin: 4px -20px 0; padding: 14px 20px 16px;
  background: linear-gradient(to top, var(--bg) 72%, rgb(250 243 243 / 0));
}
.modal-page form.stack { padding-bottom: 0; }
/* Glass Classic, compact: forms in the popup use tighter spacing so a whole form fits without scrolling.
   Customer info runs in three columns and Address 1 / Address 2 sit side by side. */
.modal-page .stack > * + * { margin-top: 12px; }
.modal-page .page-head { padding-top: 14px; padding-bottom: 8px; margin-bottom: 8px; }
.modal-page .page-head h1 { font-size: 21px; }
.modal-page form.stack .card-head { padding: 9px 14px; }
.modal-page form.stack .card-head h2 { font-size: 14.5px; font-weight: 700; }
.modal-page form.stack .card-head h2 .ico { width: 14px; height: 14px; padding: 7px; }
.modal-page form.stack .card-body { padding: 10px 14px 14px; }
.modal-page form.stack .form-grid { gap: 8px 12px; }
.modal-page form.stack .card-body.form-grid:has(> .field:nth-child(6):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.modal-page [data-address] > .span-2:not([data-saved-wrap]) { grid-column: auto; }
.modal-page form.stack .field { gap: 4px; }
.modal-page form.stack .field > span { font-size: 11.5px; font-weight: 650; }
.modal-page form.stack :is(input:not([type='checkbox'], [type='radio'], [type='hidden'], [type='file']), select) { min-height: 36px; padding-top: 6px; padding-bottom: 6px; }
.modal-page form.stack .grid-2 { gap: 12px; }
.modal-page .form-actions { padding-top: 12px; padding-bottom: 14px; }
.modal-page .form-actions .btn { min-height: 40px; }
.modal-page .back-link { display: none; }
/* Form pages: glass cards with ringed heading icons, and pill buttons with ringed icons (like the page header) */
:root:not([data-theme='dark']) form.stack > .card, :root:not([data-theme='dark']) form.stack > .grid-2 > .card {
  background: rgb(255 255 255 / 55%);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  border-color: rgb(255 255 255 / 85%); border-radius: 16px;
  box-shadow: 0 10px 28px -8px rgb(17 20 24 / 14%), inset 0 1px 0 #fff;
}
:root:not([data-theme='dark']) form.stack .card-head { border-bottom-color: rgb(255 255 255 / 75%); }
:root:not([data-theme='dark']) form.stack .card :is(input:not([type='checkbox'], [type='radio'], [type='hidden']), select, textarea) { background-color: rgb(255 255 255 / 70%); }
form.stack .card-head h2 .ico {
  box-sizing: content-box; width: 16px; height: 16px; padding: 8px; margin-right: 2px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand); box-shadow: 0 0 0 3px var(--surface), 0 4px 10px -2px rgb(17 20 24 / 18%);
}
form.stack .form-actions .btn { border-radius: 999px; min-height: 42px; }
form.stack .form-actions .btn:has(> .ico) { padding-left: 6px; padding-right: 18px; }
form.stack .form-actions .btn > .ico {
  box-sizing: content-box; width: 14px; height: 14px; padding: 7px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand); box-shadow: 0 0 0 2px var(--surface), 0 2px 6px -2px rgb(17 20 24 / 25%);
}
form.stack .form-actions .btn.btn-primary:has(> .ico) { padding-left: 16px; }
form.stack .form-actions .btn-primary > .ico { box-sizing: border-box; width: 16px; height: 16px; padding: 0; background: none; color: currentColor; box-shadow: none; }
:root:not([data-theme='dark']) form.stack .form-actions .btn-secondary {
  background: rgb(255 255 255 / 70%); border-color: #fff; box-shadow: 0 0 0 1px rgb(17 20 24 / 6%), 0 4px 10px -4px rgb(17 20 24 / 18%);
}
.form.narrow { max-width: 720px; }
.form-section-title { font-size: 13px; font-weight: 650; color: var(--text-2); grid-column: 1 / -1; padding-top: 4px; }
@media (max-width: 700px) { .form-grid, .form-grid-3 { grid-template-columns: 1fr; } .span-2 { grid-column: auto; } }

.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 550; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 38px; height: 22px; border-radius: 999px; background: var(--border-strong); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow); transition: transform .15s; }
.switch input:checked + .track { background: var(--success); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Filter bar */
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; align-items: end; padding: 16px; margin-bottom: 16px; }
.filters .wide { grid-column: span 2; }
/* A filter form followed by its table reads as one card: filters on a cream band at the top */
.card.filters:has(+ .card) {
  margin-bottom: 0;
  background: #fffbf9;
  border-bottom-color: var(--border);
  border-bottom-left-radius: 0; border-bottom-right-radius: 0;
  box-shadow: none;
}
.card.filters + .card { margin-top: 0; border-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; }
.filter-actions { display: flex; gap: 8px; }
.range { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
@media (max-width: 700px) { .filters .wide { grid-column: auto; } }

/* List toolbar: search + filter chips (selects styled as pills) */
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 16px; border-bottom: 1px solid #f6efea; }
.toolbar-search { position: relative; flex: 1 1 280px; display: flex; align-items: center; min-width: 220px; }
.toolbar-search .ico { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--faint); pointer-events: none; }
.toolbar-search input { min-height: 38px; padding-left: 36px; border-color: #ece1db; border-radius: 10px; }
.chip-select {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 0 0 12px; border: 1px solid #ece1db; border-radius: 999px; background: var(--surface);
  color: var(--text-2); cursor: pointer;
}
.chip-select .ico { width: 15px; height: 15px; color: var(--muted); flex: none; }
.chip-select select {
  width: auto; min-height: 0; height: 34px; padding: 0 30px 0 0; border: 0; border-radius: 999px;
  background-color: transparent; background-position: right 10px center;
  font-size: 12.5px; font-weight: 650; color: inherit; cursor: pointer;
}
.chip-select select:focus { box-shadow: none; }
.chip-select:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgb(142 153 224 / 20%); }
.chip-select.on { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-ink); }
.chip-select.on .ico { color: var(--brand); }
.toolbar-dates { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.toolbar-dates input { width: auto; min-height: 36px; padding: 4px 10px; border-color: #ece1db; border-radius: 10px; font-size: 12.5px; }
.list-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px; background: #fcf9f7; border-bottom: 1px solid #f6efea; font-size: 12.5px; color: var(--muted); }
.list-meta b { color: var(--text-2); }
.list-meta a { font-weight: 700; color: var(--brand-ink); }
/* Light theme: list pages use the dashboard's frosted-glass card, with white separator lines */
:root:not([data-theme='dark']) .list-card {
  background: rgb(255 255 255 / 55%);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  border-color: rgb(255 255 255 / 85%); border-radius: 16px;
  box-shadow: 0 10px 28px -8px rgb(17 20 24 / 14%), inset 0 1px 0 #fff;
}
:root:not([data-theme='dark']) .list-card .toolbar { border-bottom-color: rgb(255 255 255 / 75%); }
:root:not([data-theme='dark']) .list-card .list-meta { background: rgb(255 255 255 / 25%); border-bottom-color: rgb(255 255 255 / 75%); }
:root:not([data-theme='dark']) .list-card .table th { background: rgb(255 255 255 / 35%); border-bottom-color: rgb(255 255 255 / 80%); }
:root:not([data-theme='dark']) .list-card .table td { border-bottom-color: rgb(255 255 255 / 80%); }
:root:not([data-theme='dark']) .list-card .table tbody tr:hover { background: rgb(255 255 255 / 45%); }
:root:not([data-theme='dark']) .list-card .pagination { background: rgb(255 255 255 / 25%); border-top-color: rgb(255 255 255 / 75%); }
:root:not([data-theme='dark']) .list-card :is(.toolbar-search input, .chip-select:not(.on), .cust-filter--chip:not(.on), .pagination select, .of-field:not(.on) select, .cust-filter--field:not(.on), .of-range) { background-color: rgb(255 255 255 / 70%); }
/* Apple-style table: sentence-case headers, hairline separators, rounded row highlight, dot status labels */
:root:not([data-theme='dark']) .list-card .table { border-collapse: separate; border-spacing: 0; padding: 0 8px 6px; }
:root:not([data-theme='dark']) .list-card .table th {
  padding: 12px 12px 9px; background: transparent; border-bottom: 1px solid rgb(17 20 24 / 10%);
  text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 600; color: var(--muted);
}
:root:not([data-theme='dark']) .list-card .table td { padding: 13px 12px; border-bottom: 1px solid rgb(17 20 24 / 6%); }
:root:not([data-theme='dark']) .list-card .table tbody tr:last-child td { border-bottom-color: transparent; }
:root:not([data-theme='dark']) .list-card .table tbody tr:hover { background: none; }
:root:not([data-theme='dark']) .list-card .table tbody tr:hover td { background: rgb(255 255 255 / 80%); border-bottom-color: transparent; }
:root:not([data-theme='dark']) .list-card .table tbody tr:hover td:first-child { border-radius: 10px 0 0 10px; }
:root:not([data-theme='dark']) .list-card .table tbody tr:hover td:last-child { border-radius: 0 10px 10px 0; }
/* Status pills in the lists: text only (17 Nov 2026: the leading coloured dot was removed on request) */
:root:not([data-theme='dark']) .list-card .table .badge { padding: 3px 10px; border-color: transparent; }
:root:not([data-theme='dark']) .list-card .table .pay { padding: 2px 9px; border-radius: 999px; font-weight: 650; }

/* Filter bar (Sales analysis): wide product select first, compact dates with labels inside */
.filter-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 12px; margin-bottom: 16px; }
.fb-product, .fb-date {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 0 0 12px;
  border: 1px solid #ece1db; border-radius: 10px; background: var(--surface);
}
.fb-product { flex: 1 1 320px; min-width: 240px; }
.fb-product .ico { width: 16px; height: 16px; color: var(--muted); }
.fb-product select { flex: 1; min-width: 0; height: 40px; min-height: 0; border: 0; padding-left: 0; background-color: transparent; font-weight: 600; }
.fb-date { padding-right: 4px; }
.fb-date span { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.fb-date input { width: auto; min-height: 0; height: 38px; padding: 4px 6px; border: 0; background: transparent; font-weight: 600; }
.fb-product select:focus, .fb-date input:focus { box-shadow: none; }
.fb-product:focus-within, .fb-date:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgb(142 153 224 / 20%); }
.filter-bar .btn { min-height: 42px; }
.fb-product input { flex: 1; min-width: 0; height: 40px; min-height: 0; border: 0; padding-left: 0; background: transparent; font-weight: 600; }
.fb-product input:focus { box-shadow: none; }
.fb-check { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border: 1px solid #ece1db; border-radius: 10px; background: var(--surface); font-size: 13px; font-weight: 600; cursor: pointer; }
.fb-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }
/* Stock report */
.stock-report .sr-sku { display: block; font-size: 12px; }
.stock-report .sr-closing { font-weight: 700; }
.stock-report tfoot th { font-weight: 700; border-top: 2px solid var(--border); }

/* Switch inside a toolbar, styled as a pill like the filter chips */
.toolbar-switch { height: 36px; padding: 0 12px; border: 1px solid #ece1db; border-radius: 999px; background: var(--surface); font-size: 12.5px; font-weight: 650; color: var(--text-2); }
/* As a labelled filter field: same height as the other fields, peach while on */
.of-switch { flex: none; }
.of-field .toolbar-switch { height: 40px; padding: 0 14px; border-radius: 10px; background: rgb(255 255 255 / 70%); }
.of-field .toolbar-switch.on { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-ink); }
/* Orders: labelled filter fields (Search, Customers, dropdowns, date range, Submit) */
.order-filters { align-items: flex-end; gap: 10px 12px; }
.of-field { display: flex; flex-direction: column; gap: 5px; flex: 1 1 130px; min-width: 0; }
.of-field > * { flex: none; min-width: 0; }
.of-field .toolbar-search { width: 100%; }
.of-field > label, .of-label { font-size: 11.5px; font-weight: 650; color: var(--muted); white-space: nowrap; }
.of-search { flex: 2.7 1 170px; }
.of-customers { flex: 1.2 1 160px; }
.of-dates { flex: 1.6 1 250px; }
/* With only a few filters, single dropdowns stay a sensible width and the search box takes the rest */
.order-filters:not(.of-grid) .of-field:not(.of-search, .of-dates, .of-customers) { max-width: 260px; }
.of-field select, .of-field .toolbar-search input, .of-field .cust-filter--field { min-height: 40px; border-radius: 10px; border-color: #ece1db; }
.of-field.on select { background-color: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-ink); font-weight: 600; }
.of-range { display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 10px; border: 1px solid #ece1db; border-radius: 10px; background: var(--surface); color: var(--muted); }
.of-range:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgb(142 153 224 / 20%); }
.of-range input { flex: 1; min-width: 0; min-height: 0; padding: 6px 0; border: 0; background: none; font-size: 13.5px; }
.of-range input:focus { box-shadow: none; }
/* Date range picker (public/js/date-range.js): From and To buttons + frosted-glass calendar, like the dropdown menus */
.of-range.dr-ready { position: relative; gap: 2px; padding: 2px; }
.dr-trigger {
  flex: 1; display: flex; align-items: center; gap: 7px; min-width: 0; min-height: 34px; padding: 0 8px;
  border: 0; border-radius: 8px; background: none; font: inherit; color: var(--text); cursor: pointer; text-align: left;
}
.dr-trigger:hover, .dr-trigger.active { background: var(--brand-soft); }
.dr-trigger .ico { width: 15px; height: 15px; flex: none; color: var(--brand); }
.dr-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.dr-t small { font-size: 10.5px; font-weight: 650; color: var(--muted); }
.dr-t b { font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dr-sep { flex: none; color: var(--muted); }
.dr-pop {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; width: 316px; padding: 12px;
  border: 1px solid #fff; border-radius: 16px; color: var(--text);
  background: rgb(255 254 253 / 97%);
  -webkit-backdrop-filter: blur(20px) saturate(1.5); backdrop-filter: blur(20px) saturate(1.5);
  box-shadow: 0 18px 40px -12px rgb(17 20 24 / 30%), inset 0 1px 0 #fff;
}
.dr-pop[hidden] { display: none; }
.dr-presets { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 10px; margin-bottom: 8px; border-bottom: 1px solid rgb(17 20 24 / 8%); }
.dr-preset { padding: 5px 10px; border: 1px solid #f3e2d9; border-radius: 999px; background: rgb(255 255 255 / 70%); font: inherit; font-size: 12px; font-weight: 650; color: var(--text-2); cursor: pointer; }
.dr-preset:hover { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-ink); }
.dr-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dr-head strong { font-size: 15px; font-weight: 750; }
.dr-nav { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--text-2); cursor: pointer; }
.dr-nav:hover { background: var(--brand-soft); color: var(--brand-ink); }
.dr-nav .ico { width: 18px; height: 18px; }
.dr-week, .dr-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.dr-week span { padding: 4px 0 6px; text-align: center; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.dr-day { position: relative; height: 38px; padding: 0; border: 0; background: none; font: inherit; font-size: 13.5px; font-weight: 550; color: var(--text); cursor: pointer; }
.dr-day span { position: relative; z-index: 1; display: grid; place-items: center; width: 34px; height: 34px; margin: 0 auto; border-radius: 50%; }
.dr-day:hover span { background: var(--brand-soft); color: var(--brand-ink); }
.dr-day.out { color: #d3c5bf; }
.dr-day.today span { box-shadow: inset 0 0 0 1.5px var(--brand); color: var(--brand-ink); font-weight: 750; }
/* Range band behind the days, rounded where it starts and ends */
.dr-day.in::before, .dr-day.start:not(.end)::before, .dr-day.end:not(.start)::before { content: ""; position: absolute; top: 2px; bottom: 2px; left: 0; right: 0; background: rgb(238 247 251 / 85%); }
.dr-day.start:not(.end)::before { left: 50%; }
.dr-day.end:not(.start)::before { right: 50%; }
.dr-day.start span, .dr-day.end span { background: linear-gradient(180deg, #ebb495, #d78358); color: #fff; font-weight: 750; box-shadow: 0 4px 10px -4px #d78358; }
.dr-day:focus-visible { outline: none; }
.dr-day:focus-visible span { outline: 2px solid var(--brand); outline-offset: 1px; }
.dr-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; padding-top: 10px; border-top: 1px solid rgb(17 20 24 / 8%); }
.dr-hint { font-size: 12px; color: var(--muted); }
.dr-done { padding: 6px 14px; border: 0; border-radius: 8px; background: var(--brand); color: #fff; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.dr-done:hover { background: var(--brand-hover); }
:root[data-theme='dark'] .dr-pop { border-color: var(--border); background: rgb(17 20 24 / 94%); box-shadow: 0 18px 40px -12px rgb(0 0 0 / 60%); }
:root[data-theme='dark'] .dr-day.in::before, :root[data-theme='dark'] .dr-day.start:not(.end)::before, :root[data-theme='dark'] .dr-day.end:not(.start)::before { background: var(--neutral-bg); }
:root[data-theme='dark'] .dr-preset { background: var(--surface-2); border-color: var(--border); }

/* Single date / date-time calendar (public/js/date-picker.js): the range calendar's look, plus hour, minute and
   AM-PM columns. html.dp-on is set only where the script runs; elsewhere the browser's own picker stays. */
html.dp-on :is(input[type='date'], input[type='datetime-local']):not([data-date-range] *) {
  padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a7f90' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
html.dp-on :is(input[type='date'], input[type='datetime-local']):not([data-date-range] *)::-webkit-calendar-picker-indicator { display: none; }
.dp-pop { position: fixed; inset: auto; right: auto; width: auto; margin: 0; overflow: visible; grid-template-columns: 292px; column-gap: 14px; }
.dp-pop:popover-open { display: grid; }
.dp-pop.dp-has-time { grid-template-columns: 292px 172px; }
.dp-pop .dr-foot { grid-column: 1 / -1; }
.dp-pop .dr-day:disabled { cursor: default; opacity: .35; }
.dp-pop .dr-day:disabled:hover span { background: none; color: inherit; }
.dr-day.sel span { background: linear-gradient(180deg, #ebb495, #d78358); color: #fff; font-weight: 750; box-shadow: 0 4px 10px -4px #d78358; }
/* The time columns are as tall as the calendar beside them and scroll inside */
.dp-time { position: relative; padding-left: 14px; border-left: 1px solid rgb(17 20 24 / 8%); }
.dp-time-head { display: flex; align-items: center; justify-content: center; height: 32px; margin-bottom: 6px; font-size: 15px; font-weight: 750; font-variant-numeric: tabular-nums; }
.dp-cols { position: absolute; top: 38px; bottom: 0; left: 14px; right: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.dp-col { display: flex; flex-direction: column; gap: 2px; min-height: 0; padding: 2px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.dp-col::-webkit-scrollbar { display: none; }
.dp-col button {
  flex: none; height: 32px; border: 0; border-radius: 9px; background: none; font: inherit; font-size: 13.5px; font-weight: 550;
  font-variant-numeric: tabular-nums; color: var(--text); cursor: pointer;
}
.dp-col button:hover { background: var(--brand-soft); color: var(--brand-ink); }
.dp-col button[aria-pressed='true'] { background: linear-gradient(180deg, #ebb495, #d78358); color: #fff; font-weight: 750; }
.dp-col button:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.dp-links { display: flex; gap: 4px; }
.dp-link { padding: 6px 8px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 12.5px; font-weight: 650; color: var(--brand-ink); cursor: pointer; }
.dp-link:hover { background: var(--brand-soft); }
/* Phones: the time columns go under the calendar */
@media (max-width: 540px) {
  .dp-pop.dp-has-time { grid-template-columns: min(292px, calc(100vw - 42px)); }
  .dp-time { margin-top: 8px; padding: 8px 0 0; border-left: 0; border-top: 1px solid rgb(17 20 24 / 8%); }
  .dp-time-head { height: auto; margin-bottom: 4px; }
  .dp-cols { position: static; height: 136px; }
}
:root[data-theme='dark'] .dp-time { border-color: var(--border); }
:root[data-theme='dark'] .dp-col button:hover, :root[data-theme='dark'] .dp-link:hover { background: var(--neutral-bg); }
.of-actions { display: flex; align-items: center; gap: 8px; }
/* Grid version for pages with many filters (Invoices): columns line up across rows */
.order-filters.of-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: end; gap: 12px; }
.of-grid .of-span-2 { grid-column: span 2; }
.of-grid .of-span-4 { grid-column: span 4; }
.of-grid .of-actions { min-width: 0; }
@media (max-width: 1400px) { .order-filters.of-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .order-filters.of-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .of-grid .of-actions { grid-column: 1 / -1; }
  .of-grid .of-span-4 { grid-column: 1 / -1; }
}
.of-actions .btn { min-height: 40px; padding: 0 22px; }
/* Clear filters: a glass button the same height as Submit, with the icon in a small ringed circle */
.toolbar-clear {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px 0 8px;
  border: 1px solid #ece1db; border-radius: 10px; background: rgb(255 255 255 / 70%);
  font-size: 13px; font-weight: 650; color: var(--text-2); white-space: nowrap;
  transition: background-color .12s, border-color .12s, color .12s;
}
.toolbar-clear .ico {
  box-sizing: content-box; width: 12px; height: 12px; padding: 4px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand); box-shadow: 0 0 0 2px #fff, 0 2px 6px -2px rgb(17 20 24 / 25%);
}
.toolbar-clear:hover { border-color: var(--brand-line); background: var(--brand-soft); color: var(--brand-ink); }
.toolbar-clear:hover .ico { background: var(--brand); color: #fff; }
:root[data-theme='dark'] .toolbar-clear { border-color: var(--border-strong); background: var(--surface-2); }
:root[data-theme='dark'] .toolbar-clear .ico { box-shadow: none; }
.toolbar-switch .track { width: 30px; height: 18px; }
.toolbar-switch .track::after { width: 12px; height: 12px; }
.toolbar-switch input:checked + .track::after { transform: translateX(12px); }

/* Inventory list: item + SKU in one cell, click-to-edit low stock alert */
.stock-table td { padding-top: 11px; padding-bottom: 11px; }
.stock-table .sub.mono { font-size: 11px; margin-top: 2px; }
.stock-table.orders-table .alert-edit input[type='number'] { text-align: center; }
.alert-edit { display: inline-flex; align-items: center; gap: 2px; padding: 0 4px 0 2px; border: 1px solid transparent; border-radius: 8px; transition: background .12s, border-color .12s; }
.alert-edit input[type='number'] {
  width: 64px; min-height: 30px; padding: 3px 6px; border: 0; background: transparent;
  text-align: right; font-weight: 700; color: var(--text); -moz-appearance: textfield; appearance: textfield;
}
.alert-edit input::-webkit-outer-spin-button, .alert-edit input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.alert-edit input:focus { box-shadow: none; }
.alert-pencil { display: inline-grid; color: var(--border-strong); }
.alert-pencil .ico { width: 13px; height: 13px; }
.alert-save { display: none; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 6px; background: var(--success-bg); color: var(--success); cursor: pointer; }
.alert-save .ico { width: 14px; height: 14px; }
tr:hover .alert-edit { background: var(--surface-2); }
tr:hover .alert-pencil { color: var(--brand); }
.alert-edit:focus-within { background: var(--surface); border-color: var(--brand); box-shadow: 0 0 0 3px rgb(142 153 224 / 18%); }
.alert-edit:focus-within .alert-pencil { display: none; }
.alert-edit:focus-within .alert-save { display: inline-grid; }

/* Orders table: grouped two-line cells */
.orders-table td { padding-top: 12px; padding-bottom: 12px; }
/* Every Orders column, headers included, is centred */
.table.orders-table :is(th, td) { text-align: center; }
.orders-table .ref { font-weight: 750; color: var(--brand-ink); }
.orders-table .sub { margin-top: 2px; font-size: 11.5px; }
.orders-table .amount { font-weight: 800; font-size: 14px; }
.sub-icon { display: flex; align-items: center; gap: 4px; }
.sub-icon .ico { width: 13px; height: 13px; flex: none; }
.channel { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.channel .ico { width: 15px; height: 15px; color: var(--faint); }
.pay { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 750; white-space: nowrap; }
.pay-cod { background: var(--brand-soft); color: var(--brand-ink); }
.pay-tabby { background: var(--violet-bg); color: var(--violet); }
.pay-card, .pay-bank { background: var(--teal-bg); color: var(--teal); }
.pay-free, .pay-other { background: var(--neutral-bg); color: var(--text-2); }

.search { position: relative; display: flex; align-items: center; flex: 1; max-width: 360px; }
.search .ico { position: absolute; left: 10px; color: var(--faint); width: 16px; height: 16px; }
.search input { padding-left: 34px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 8px 14px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 13px; line-height: 1.2; white-space: nowrap;
  cursor: pointer; transition: background .12s, border-color .12s, color .12s;
}
.btn .ico { width: 16px; height: 16px; }
/* Main actions: terracotta outline and text, filling orange on hover (the sign-in button keeps its solid fill) */
.btn-primary { background: rgb(255 255 255 / 60%); border: 1.5px solid var(--brand); color: var(--brand); font-weight: 700; }
.btn-primary:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary .ico { stroke-width: 2.4; }
:root[data-theme='dark'] .btn-primary { background: transparent; }
:root[data-theme='dark'] .btn-primary:hover { background: var(--brand); }
.btn-secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-secondary:hover { background: var(--surface-2); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--neutral-bg); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #912018; color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #17603f; color: #fff; }
.btn-sm { min-height: 30px; padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  background: transparent; border: 0; color: var(--text-2); cursor: pointer; list-style: none;
}
.icon-btn:hover { background: var(--neutral-bg); color: var(--text); }
.icon-btn.disabled { color: var(--border-strong); cursor: default; background: none; }
summary::-webkit-details-marker { display: none; }
.inline-form { display: inline; }

/* ---------- Tables ---------- */
/* Paint containment keeps a wide table's width inside its own scroll box: without it a phone widened the whole page to
   the table (New order, New purchase order and Users scrolled sideways, 5 Nov 2026). Row menus and pickers open in
   the top layer, so they are not clipped by it. */
.table-wrap { overflow-x: auto; contain: paint; }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th {
  text-align: left; white-space: nowrap;
  font-size: 11.5px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
  padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.table td { padding: 11px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fffbf9; }
.table tr[data-href] { cursor: pointer; }
.table .num { text-align: right; }
.table .center { text-align: center; }
.table .actions-col { width: 56px; text-align: right; }
.table .empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.table tfoot td { font-weight: 650; background: var(--surface-2); border-top: 1px solid var(--border); }
.table-compact td { padding: 8px 16px; }
.strong { font-weight: 600; }
.muted { color: var(--muted); }
.sub { display: block; font-size: 12px; color: var(--muted); }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace; font-size: 12.5px; }
.right { text-align: right; }
.center { text-align: center; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--neutral-bg); border: 1px solid var(--border); display: block; }
.thumb-empty { display: grid; place-items: center; color: var(--faint); }
.thumb-lg { width: 96px; height: 96px; }

/* ---------- Badges & chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 999px; border: 1px solid transparent;
  font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.5;
}
.badge-success { background: var(--success-bg); color: var(--success); border-color: var(--success-line); }
.badge-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-line); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger);  border-color: var(--danger-line); }
.badge-info    { background: var(--info-bg);    color: var(--info);    border-color: var(--info-line); }
.badge-neutral { background: var(--neutral-bg); color: var(--text-2); border-color: var(--border); }
.badge-brand   { background: var(--brand-soft); color: var(--brand-ink); border-color: var(--brand-line); }
/* Dashboard cards: the "returning" badge in the sage of its card's icon, and "None" in a neutral grey (not peach) */
.badge-sage    { background: #edf4ef; color: #3f6a4b; border-color: #dde9e0; }
.glance-foot .badge-neutral { background: #f4f3f5; color: #5f5763; border-color: #eae8ed; }
:root[data-theme='dark'] .badge-sage { background: rgb(74 117 86 / 24%); color: #9cc7a8; border-color: transparent; }
:root[data-theme='dark'] .glance-foot .badge-neutral { background: var(--neutral-bg); color: var(--text-2); border-color: var(--border); }
.count-pill { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 12px; font-weight: 650; }
.qty-pill { display: inline-block; min-width: 48px; padding: 2px 10px; border-radius: 999px; text-align: center; font-weight: 650; font-size: 12.5px; }
.qty-ok { background: var(--success-bg); color: var(--success); }
.qty-low { background: var(--danger-bg); color: var(--danger); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 6px; background: var(--neutral-bg); border: 1px solid var(--border); font-size: 12px; color: var(--text-2); }
.chip b { color: var(--text); font-weight: 650; }

/* Segmented control / tabs */
.segmented { display: inline-flex; padding: 3px; background: var(--neutral-bg); border-radius: 10px; gap: 2px; }
.segmented a { padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 550; color: var(--text-2); }
.segmented a:hover { color: var(--text); }
.segmented a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); padding: 0 16px; overflow-x: auto; }
.tabs a, .tabs button { padding: 12px 12px; border: 0; background: none; font-weight: 600; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.tabs a.active, .tabs button[aria-selected='true'] { color: var(--brand-ink); border-bottom-color: var(--brand); }
[role='tabpanel'][hidden] { display: none; }

/* ---------- Row action menu ---------- */
.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; }
.menu-list {
  position: absolute; z-index: 50; top: calc(100% + 4px); left: 0; min-width: 190px;
  display: flex; flex-direction: column; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg);
  text-align: left;
}
.menu-right { left: auto; right: 0; }
/* Open menus are lifted into the top layer by public/js/app.js and placed with left/top */
.menu-list:popover-open { position: fixed; inset: auto; right: auto; bottom: auto; margin: 0; overflow: visible; color: var(--text); }
.menu-list a, .menu-list button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 10px; border: 0; border-radius: 6px; background: none;
  font-size: 13px; font-weight: 500; color: var(--text); text-align: left; cursor: pointer; white-space: nowrap;
}
.menu-list .ico { width: 16px; height: 16px; color: var(--muted); }
.menu-list a:hover, .menu-list button:hover { background: var(--neutral-bg); color: var(--text); }
.menu-list .danger, .menu-list .danger .ico { color: var(--danger); }
.menu-list .disabled { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--faint); cursor: not-allowed; white-space: nowrap; }
.menu-list .disabled .ico { width: 16px; height: 16px; color: var(--border-strong); }
.menu-list hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }
.menu-head { display: flex; flex-direction: column; padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu-head span { color: var(--muted); font-size: 12px; }

/* ---------- Pagination ---------- */
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 16px; padding: 10px 16px; background: #fcf9f7; border-top: 1px solid #f6efea; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.per-page label { display: flex; align-items: center; gap: 8px; }
.per-page select { width: auto; min-height: 32px; padding: 4px 28px 4px 10px; }
.page-btns { display: flex; gap: 2px; }

/* ---------- Flash / callouts ---------- */
.flash { display: flex; align-items: center; gap: 10px; padding: 11px 14px; margin-bottom: 16px; border-radius: 10px; border: 1px solid; font-weight: 520; }
.flash > span { flex: 1; }
.flash .icon-btn { width: 28px; height: 28px; }
.flash-success { background: var(--success-bg); border-color: var(--success-line); color: var(--success); }
.flash-error { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger); }
.flash-warning { background: var(--warning-bg); border-color: var(--warning-line); color: var(--warning); }
.flash-warning a { color: inherit; font-weight: 700; text-decoration: underline; }
/* Stock mapping: "Same as …? Use same stock" on an unlinked product (list row and its mapping page) */
.map-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.map-suggest .sub { display: block; }
.map-suggest-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 16px; border-color: var(--warning-line); background: var(--warning-bg); }
.map-suggest-card p { margin: 0; flex: 1 1 320px; }
.map-suggest-card .ico { width: 16px; height: 16px; vertical-align: -3px; color: var(--warning); }
.callout { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; border: 1px solid; }
.callout-success { background: var(--success-bg); border-color: var(--success-line); color: #17603f; }
.callout-warning { background: var(--warning-bg); border-color: var(--warning-line); color: #6b4410; }
.callout-info { background: var(--info-bg); border-color: var(--info-line); color: #0c5753; }
.callout-neutral { background: var(--surface-2); border-color: var(--border); color: var(--text-2); }

/* ---------- Lists / breakdowns ---------- */
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 520; }
.breakdown { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.breakdown li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: baseline; }
.breakdown .bar { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: var(--neutral-bg); overflow: hidden; }
.breakdown .bar > span { display: block; height: 100%; width: 0; background: var(--brand); border-radius: inherit; }
.breakdown .val { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }
.rank-list { list-style: none; margin: 0; padding: 0; counter-reset: rank; }
.rank-list li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); counter-increment: rank; }
.rank-list li:last-child { border-bottom: 0; }
.rank-list li::before { content: counter(rank); width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 6px; background: var(--neutral-bg); font-size: 12px; font-weight: 650; color: var(--text-2); }
.rank-list .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-list .val { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart-box { position: relative; height: 300px; }

/* Editable line items */
.lines td { padding: 8px 10px; }
.lines input, .lines select { min-height: 34px; }
.lines .qty { width: 90px; }
.lines .money { width: 120px; }
.totals { margin-left: auto; width: min(320px, 100%); display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; padding: 16px; }
.totals .grand { font-size: 16px; font-weight: 700; border-top: 1px solid var(--border); padding-top: 8px; }
.totals input { width: 120px; min-height: 32px; text-align: right; }

/* ---------- Auth & error ---------- */
body.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 600px at 10% -10%, #f8e7de 0%, transparent 60%), var(--bg); }
.auth-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 32px; }
.auth-card h1 { margin-bottom: 6px; }
.auth-card > .muted { margin-bottom: 20px; }
.auth-card .flash { margin-bottom: 16px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.auth-card.center { text-align: center; }
.error-code { font-size: 48px; font-weight: 750; color: var(--brand); line-height: 1; margin-bottom: 8px; }
.auth-card.center .btn { margin-top: 20px; }
.error-detail { text-align: left; font-size: 11px; max-height: 240px; overflow: auto; background: var(--surface-2); padding: 12px; border-radius: 8px; margin-top: 16px; }

/* ---------- Dashboard: "at a glance" with period switcher ---------- */
.glance-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.glance-head h1 { font-size: 22px; font-weight: 750; }
.glance-head .segmented a { font-weight: 650; }
.glance-head .segmented a.active { color: var(--brand-ink); }
.glance-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
/* Card: coloured icon tile beside label + number; change and note in a footer under a thin line */
.glance-card {
  display: flex; flex-direction: column; min-width: 0;
  padding: 18px 18px 0;
  background: var(--surface);
  border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 1px 2px rgb(17 20 24 / 5%);
  overflow: hidden;
}
.glance-main { flex: 1; display: flex; align-items: center; gap: 14px; min-width: 0; padding-bottom: 16px; }
.glance-icon { flex: none; width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; }
.glance-icon .ico { width: 24px; height: 24px; }
.glance-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.glance-label { font-size: 12px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.glance-value { font-size: clamp(18px, 1.45vw, 26px); font-weight: 800; letter-spacing: -.01em; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.glance-foot { display: flex; align-items: center; gap: 8px; min-width: 0; margin: 0 -18px; padding: 10px 18px; background: #fcf9f7; border-top: 1px solid #f6efea; }
.glance-foot .badge, .glance-foot .delta { flex: none; }
.glance-sub { min-width: 0; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Light theme: frosted-glass cards with a bright top edge; icons in a soft-colour circle with a white ring */
:root:not([data-theme='dark']) .glance-card {
  background: rgb(255 255 255 / 55%);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  border-color: rgb(255 255 255 / 85%);
  box-shadow: 0 10px 28px -8px rgb(17 20 24 / 14%), inset 0 1px 0 #fff;
}
:root:not([data-theme='dark']) .glance-card .glance-foot { background: rgb(255 255 255 / 25%); border-top-color: rgb(255 255 255 / 75%); }
:root:not([data-theme='dark']) .glance-card .glance-icon { border-radius: 50%; box-shadow: 0 0 0 3px #fff, 0 4px 12px -2px rgb(17 20 24 / 18%); }
.cur { font-size: .5em; font-weight: 750; letter-spacing: .02em; color: var(--muted); margin-right: 4px; vertical-align: .15em; }
.delta { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.delta.up { background: var(--success-bg); color: var(--success); }
.delta.down { background: var(--danger-bg); color: var(--danger); }
.delta.flat { background: var(--neutral-bg); color: var(--muted); }
@media (max-width: 1500px) {
  .glance-main { gap: 12px; }
  .glance-icon { width: 44px; height: 44px; border-radius: 12px; }
  .glance-icon .ico { width: 21px; height: 21px; }
}
@media (max-width: 1100px) { .glance-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .glance-value { font-size: 24px; } }
@media (max-width: 600px) { .glance-cards { grid-template-columns: minmax(0, 1fr); } }

/* Inventory dashboard: dates in the header, six dashboard-style cards, movements + low stock */
.head-dates { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.page-head > .head-dates { margin-left: auto; }
/* Date range in a page or card header: one frosted-glass pill holding From and To (public/js/date-range.js) */
.head-range {
  position: relative; z-index: 30; display: flex; align-items: center; gap: 2px; height: 44px; padding: 0 4px;
  border-radius: 999px; background: rgb(255 255 255 / 62%); font-size: 13px;
  -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgb(255 255 255 / 90%), 0 8px 20px -10px rgb(17 20 24 / 30%);
}
.head-range:focus-within { box-shadow: inset 0 1px 0 #fff, 0 0 0 1px var(--brand-line), 0 0 0 4px rgb(142 153 224 / 16%); }
.head-range input { width: auto; min-height: 0; padding: 4px 8px; border: 0; background: none; font-size: 13px; }
.head-range input:focus { box-shadow: none; }
.head-range .dr-trigger { flex: none; height: 36px; min-height: 0; padding: 0 12px; gap: 8px; border-radius: 999px; }
.head-range .dr-trigger[data-which='to'] .ico { display: none; }
.head-range .dr-t { flex-direction: row; align-items: baseline; gap: 6px; }
.head-range .dr-t small { font-size: 12.5px; font-weight: 600; }
.head-range .dr-t b { font-size: 13px; font-weight: 700; }
.head-range .dr-sep { width: 1px; height: 20px; background: var(--border-strong); font-size: 0; }
.head-dates .btn { height: 44px; border-radius: 999px; }
.head-dates .btn-primary, :root[data-theme='dark'] .head-dates .btn-primary { padding: 0 20px; border-color: transparent; background: var(--brand); color: #fff; box-shadow: 0 6px 14px -6px rgb(91 107 220 / 70%); }
.head-dates .btn-primary:hover { background: var(--brand-hover); }
.head-dates .btn-ghost { color: var(--muted); }
.card-head .head-range, .card-head .head-dates .btn { height: 38px; }
.card-head .head-range .dr-trigger { height: 32px; }
.glance-cards.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
/* Dashboard period filter: the dates on screen on the left, quick periods and custom dates on the right */
.dash-filter { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.dash-range { display: inline-flex; align-items: center; gap: 8px; margin: 0 auto 0 0; font-size: 13.5px; }
.dash-range .ico { width: 16px; height: 16px; color: var(--muted); }
.dash-range .muted { font-weight: 500; margin-left: 4px; }
.dash-filter .segmented { flex-wrap: wrap; }
.dash-filter .segmented a { font-weight: 650; }
.dash-filter .segmented a.active { color: var(--brand-ink); }
.dash-filter .acc-range > summary { height: 36px; }
@media (max-width: 600px) {
  .dash-filter { justify-content: flex-start; }
  .dash-range { width: 100%; }
  .dash-filter .acc-range-pop { right: auto; left: 0; width: min(280px, calc(100vw - 32px)); }
}
/* Four summary cards above a list (Invoices) */
.glance-cards.four { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
@media (max-width: 1100px) { .glance-cards.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .glance-cards.four { grid-template-columns: minmax(0, 1fr); } }
.inv-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: stretch; margin-top: 16px; }
/* Both cards keep the same height: the lists fill the card and the footer stays at the bottom */
.inv-grid > .card { display: flex; flex-direction: column; }
.inv-grid > .card > .card-body { flex: 1; }
.inv-grid.dash-analytics { margin-top: 16px; }
.inv-grid .top-products li[data-href] { cursor: pointer; }
.inv-grid .top-products li[data-href]:hover { filter: brightness(.97); }
.inv-grid .tp-name a { color: inherit; }
.inv-grid .tp-num b.text-danger, .inv-grid .tp-num b.text-success { font-weight: 800; }
:root:not([data-theme='dark']) .inv-grid .pagination { background: rgb(255 255 255 / 25%); border-top-color: rgb(255 255 255 / 75%); }
.field .req { color: var(--danger); font-weight: 700; }
/* Stock mapping toolbar: search, status tabs and the unmapped count on one line, refresh on the right */
.map-unmapped { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border: 1px solid var(--danger); border-radius: 999px; color: var(--danger); font-size: 12.5px; font-weight: 650; white-space: nowrap; }
.map-unmapped:hover { background: var(--danger-bg); }
/* Sales analysis: note under the filters, cards in the dashboard style */
.analyse-note { display: flex; align-items: flex-start; gap: 8px; margin: -6px 0 16px; font-size: 12.5px; color: var(--muted); }
.analyse-note .ico { flex: none; width: 15px; height: 15px; margin-top: 2px; }
.analyse-note strong { color: var(--text-2); }
.filter-bar.head-dates .btn { height: 42px; }
.filter-bar .head-range { height: 42px; box-shadow: inset 0 1px 0 #fff, 0 0 0 1px var(--border-strong); }
.analyse-cards .glance-value[title] { font-size: clamp(16px, 1.2vw, 21px); }
/* Two rows of five on laptop screens too: titles wrap to a second line instead of being cut off */
@media (max-width: 1500px) {
  .analyse-cards .glance-label { white-space: normal; line-height: 1.25; }
}
/* Smaller icon and number on narrow laptops, so six-figure amounts still fit */
@media (min-width: 1101px) and (max-width: 1340px) {
  .analyse-cards .glance-card { padding-left: 14px; padding-right: 14px; }
  .analyse-cards .glance-foot { margin: 0 -14px; padding-left: 14px; padding-right: 14px; }
  .analyse-cards .glance-main { gap: 10px; }
  .analyse-cards .glance-icon { width: 36px; height: 36px; }
  .analyse-cards .glance-icon .ico { width: 18px; height: 18px; }
  .analyse-cards .glance-value:not([title]) { font-size: 16px; }
}
@media (min-width: 1101px) and (max-width: 1180px) {
  .analyse-cards .glance-value:not([title]) { font-size: 14.5px; }
  .analyse-cards .glance-value .cur { margin-right: 2px; }
}
/* Chart and month-on-month share a row with a Top 10 list: both cards keep the same height, the chart fills its card */
.analyse-row > .card { display: flex; flex-direction: column; }
.analyse-row > .card > .card-body { flex: 1; display: flex; flex-direction: column; }
.analyse-row .chart-box { flex: 1; min-height: 300px; height: auto; }
.analyse-row .chart-box canvas { position: absolute; inset: 0; }
.analyse-row > .card > .table-wrap { flex: 1; }
.mom-table { height: 100%; }
.mom-table td, .mom-table th { white-space: nowrap; }
.mom-table .mom-product { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.inv-grid > .card + .card { margin-top: 0; }
.card-link { font-size: 12.5px; font-weight: 700; color: var(--brand-ink); }
/* Six cards fit one row only on wide screens; below that their titles and amounts were cut off */
@media (max-width: 1850px) { .glance-cards.six { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .inv-grid { grid-template-columns: minmax(0, 1fr); } .glance-cards.six { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .glance-cards.six { grid-template-columns: minmax(0, 1fr); } }

/* Dashboard analytics: revenue bars, top products, donut trio */
.dash-analytics { margin-top: 28px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.section-head h2 { font-size: 18px; font-weight: 750; }
.analytics-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
.analytics-grid > .card + .card { margin-top: 0; }
.chart-legend { display: flex; gap: 14px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend span::before { content: ''; width: 10px; height: 10px; border-radius: 3px; }
.chart-legend .lg-cur::before { background: var(--brand); }
.chart-legend .lg-prev::before { background: #efe4de; }

.top-products { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.top-products li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--surface-2); }
.top-products li:first-child { padding-top: 0; }
.top-products li:last-child { border-bottom: 0; padding-bottom: 0; }
.tp-thumb { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; overflow: hidden; background: var(--surface-2); border: 1px solid #f6efea; }
.tp-thumb img { width: 100%; height: 100%; object-fit: contain; }
.tp-initials { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-ink); font-size: 12px; font-weight: 800; letter-spacing: .02em; }
.tp-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.tp-name b { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-name small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-num { text-align: right; line-height: 1.25; }
.tp-num b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; }
.tp-num small { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

.mix-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.mix-cards > .card + .card { margin-top: 0; }
.mix-body { display: flex; align-items: center; gap: 20px; min-width: 0; }
.donut { position: relative; flex: none; width: 112px; height: 112px; }
.donut svg { display: block; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.donut-center b { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.donut-center small { font-size: 11px; color: var(--muted); }
.mix-legend { flex: 1; min-width: 0; }
.mix-legend ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.mix-legend li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 48px; align-items: center; gap: 9px; font-size: 13px; }
.mix-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mix-legend li b { font-variant-numeric: tabular-nums; }
.mix-legend li em { font-style: normal; font-size: 12px; color: var(--muted); text-align: right; }
.sw { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface); }
/* Same Rose Lilac swatches as the donut gradients in dashboard/_analytics.ejs and analyse/index.ejs */
.sw-0 { background: linear-gradient(135deg, #f1c0d1, #d998ae); } .sw-1 { background: linear-gradient(135deg, #d7d2f3, #bbb2e5); }
.sw-2 { background: linear-gradient(135deg, #e9cfeb, #d5b3da); } .sw-3 { background: linear-gradient(135deg, #f7dee6, #ebc4d2); }
.sw-4 { background: linear-gradient(135deg, #e4e0f5, #cec7ed); } .sw-5 { background: linear-gradient(135deg, #ecdbec, #d6bed6); }
/* "Share Pills": each share sits in a pill of its item's colour, white text */
.mix-legend li em.pp { padding: 2px 7px; border-radius: 999px; color: #fff; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.pp-0 { background: #d998ae; } .pp-1 { background: #bbb2e5; } .pp-2 { background: #d5b3da; }
.pp-3 { background: #ebc4d2; } .pp-4 { background: #cec7ed; } .pp-5 { background: #d6bed6; }
/* Dashboard breakdown cards, "Apple Card Spending" (chosen 29 Oct 2026): one row per item with its icon in a ringed
   circle, a thin share bar and the takings; header icons in the KPI cards' sage / rose / lilac */
.spend-body { display: block; }
.spend-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.spend-list li { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 9px 0; border-bottom: 1px solid rgb(255 255 255 / 70%); }
.spend-list li:first-child { padding-top: 0; }
.spend-list li:last-child { padding-bottom: 0; border-bottom: 0; }
.spend-ic { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; box-shadow: 0 0 0 2.5px #fff, 0 3px 9px -3px rgb(17 20 24 / 22%); }
.spend-ic .ico { width: 16px; height: 16px; }
.si-0 { background: #f9eaf0; color: #b35678; } .si-1 { background: #f1effb; color: #6e5fbb; }
.si-2 { background: #f6ecf7; color: #8a3f8e; } .si-3 { background: #edf4ef; color: #3f6a4b; }
.spend-main { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.spend-main b { overflow: hidden; font-size: 13.5px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.spend-bar { display: block; width: 100%; height: 5px; }
.spend-bar .trk { fill: rgb(187 178 229 / 14%); }
.sf-0 { fill: #d998ae; } .sf-1 { fill: #bbb2e5; } .sf-2 { fill: #d5b3da; } .sf-3 { fill: #8daf96; }
.spend-num { display: flex; flex-direction: column; align-items: flex-end; flex: none; line-height: 1.3; }
.spend-num b { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.spend-num small { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

/* Order page: Customer (left) and Order details (right) in the dashboard's look: ringed icon circles (.spend-ic)
   on glass tiles, initials avatar on the Rose Lilac blend, addresses and the invoice in soft wells */
.od-grid { align-items: stretch; }
.od-card { display: flex; flex-direction: column; }
.od-card .card-head { min-height: 58px; }
.od-card .card-head h2 .ico.hi-tone { color: #b35678; }
.od-card + .od-card .card-head h2 .ico.hi-tone { color: #6e5fbb; }
.od-body { display: flex; flex-direction: column; gap: 14px; flex: 1; }
.od-person { display: flex; align-items: center; gap: 14px; }
.od-avatar { display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(120deg, #f2ccd8, #e9d4eb, #cec7ed); color: #3a2a48; font-size: 17px; font-weight: 750; letter-spacing: .5px;
  box-shadow: 0 0 0 3px #fff, 0 6px 16px -6px rgb(61 42 79 / 35%); }
.od-who { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-width: 0; }
.od-who strong { font-size: 17px; font-weight: 750; overflow-wrap: anywhere; }
.od-chip { padding: 2px 10px; border-radius: 999px; background: rgb(187 178 229 / 20%); color: #6e5fbb; font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
.od-tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.od-contacts { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.od-facts { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.od-tile { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 11px 12px; border-radius: 14px;
  background: rgb(255 255 255 / 55%); border: 1px solid rgb(255 255 255 / 85%); }
.od-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.od-text small { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.od-text b { font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.od-text b.od-none { color: var(--muted); font-weight: 500; }
.od-text em { color: var(--muted); font-size: 11.5px; font-style: normal; overflow-wrap: anywhere; }
.od-wells { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.od-well { padding: 12px 14px; border-radius: 14px; background: rgb(249 234 240 / 45%); border: 1px solid rgb(255 255 255 / 85%); }
.od-well + .od-well { background: rgb(241 239 251 / 55%); }
.od-well-h { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; color: var(--muted); font-size: 11.5px; font-weight: 650; }
.od-well-h .ico { width: 14px; height: 14px; color: #b35678; }
.od-well + .od-well .od-well-h .ico { color: #6e5fbb; }
.od-well p { margin: 0; font-size: 13.5px; font-weight: 520; line-height: 1.55; overflow-wrap: anywhere; }
.od-invoice { display: flex; align-items: center; gap: 12px; background: rgb(241 239 251 / 55%); }
.od-inv-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.od-inv-line a { font-size: 14px; font-weight: 700; }
:root[data-theme='dark'] :is(.od-tile, .od-well, .od-invoice) { background: var(--surface-2); border-color: var(--border); }
:root[data-theme='dark'] .od-avatar { box-shadow: 0 0 0 3px var(--surface); }
:root:not([data-theme='dark']) .dash-analytics .card-head h2 .ico.hi-sage { background: #edf4ef; color: #4a7556; }
:root:not([data-theme='dark']) .dash-analytics .card-head h2 .ico.hi-rose { background: #f9eaf0; color: #c46c89; }
:root:not([data-theme='dark']) .dash-analytics .card-head h2 .ico.hi-lilac { background: #f1effb; color: #7b6dc6; }
:root[data-theme='dark'] .spend-list li { border-bottom-color: var(--border); }
:root[data-theme='dark'] .spend-ic { box-shadow: 0 0 0 2px var(--surface); }
:root[data-theme='dark'] .si-0 { background: rgb(194 87 122 / 24%); color: #f0a3bd; } :root[data-theme='dark'] .si-1 { background: rgb(106 88 196 / 26%); color: #b9aeea; }
:root[data-theme='dark'] .si-2 { background: rgb(154 74 160 / 26%); color: #e2b9e6; } :root[data-theme='dark'] .si-3 { background: rgb(74 117 86 / 24%); color: #9cc7a8; }
/* Light theme: analytics panels match the frosted-glass cards (ringed icons, pill counts, glass donut centres) */
:root:not([data-theme='dark']) .dash-analytics .card {
  background: rgb(255 255 255 / 55%);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  border-color: rgb(255 255 255 / 85%);
  box-shadow: 0 10px 28px -8px rgb(17 20 24 / 14%), inset 0 1px 0 #fff;
}
:root:not([data-theme='dark']) .dash-analytics .card-head { border-bottom-color: rgb(255 255 255 / 75%); }
:root:not([data-theme='dark']) .dash-analytics .card-head h2 .ico {
  box-sizing: content-box; width: 16px; height: 16px; padding: 8px; margin-right: 2px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand); box-shadow: 0 0 0 3px #fff, 0 4px 10px -2px rgb(17 20 24 / 18%);
}
:root:not([data-theme='dark']) .dash-analytics .card-head > .muted {
  padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--text-2);
  background: rgb(255 255 255 / 70%); border: 1px solid #fff;
}
:root:not([data-theme='dark']) .dash-analytics .chart-legend span::before { border-radius: 50%; }
:root:not([data-theme='dark']) .dash-analytics .chart-legend .lg-cur::before { background: linear-gradient(#f0bda0, #d78358); }
:root:not([data-theme='dark']) .dash-analytics .donut-center {
  /* Disc sits just over the ring's inner edge, leaving a slim coloured band */
  inset: 11px; border-radius: 50%; background: rgb(255 255 255 / 75%);
  box-shadow: 0 0 0 3px #fff, 0 4px 12px -2px rgb(17 20 24 / 18%);
}
:root:not([data-theme='dark']) .dash-analytics .top-products li { border-bottom-color: rgb(255 255 255 / 70%); }
:root:not([data-theme='dark']) .dash-analytics .tp-thumb { border: 0; background: rgb(255 255 255 / 70%); box-shadow: 0 0 0 2px #fff, 0 3px 8px -2px rgb(17 20 24 / 16%); }
:root:not([data-theme='dark']) .dash-analytics .tp-initials { border-radius: 50%; background: var(--brand-soft); }
.empty-note { padding: 20px 0; text-align: center; color: var(--muted); }
@media (max-width: 1100px) {
  .analytics-grid, .mix-cards { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Sign-in page: organic blob split ---------- */
body.auth-split {
  min-height: 100vh;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  position: relative; overflow-x: hidden;
  background: #fdf9f6;
}
.auth-art { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.auth-art .blob { position: absolute; }
/* One large ellipse centred on the left edge: fills the page edge, curves out to ~55% width */
.auth-art .blob-1 {
  left: -55vw; top: -25vh; width: 110vw; height: 140vh; border-radius: 50%;
  background: radial-gradient(ellipse at 70% 40%, #fbebe2 0%, #f8e2d6 55%, #f5d9ca 100%);
}
.auth-brand { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(32px, 5.6vw, 110px); }
.auth-logo { display: block; align-self: flex-start; height: 56px; width: auto; max-width: 100%; object-fit: contain; margin-bottom: 22px; }
.auth-brand h2 { font-size: clamp(30px, 2.8vw, 46px); font-weight: 700; line-height: 1.12; color: #2f1a14; letter-spacing: -.01em; }
.auth-brand p { margin-top: 18px; font-size: 17px; color: var(--text-2); }
.auth-illo { display: block; width: min(100%, 680px); height: auto; margin-top: 28px; }
.auth-panel { position: relative; z-index: 1; display: grid; place-items: center; padding: 40px 24px; }
.auth-form { width: min(520px, 100%); }
.auth-form h1 { font-size: clamp(30px, 2.4vw, 38px); font-weight: 700; color: #2f1a14; letter-spacing: -.01em; margin-bottom: 8px; }
.auth-sub { margin-bottom: 30px; font-size: 17px; color: #a8705c; }
.auth-form .flash { margin-bottom: 18px; }
.auth-form form { display: flex; flex-direction: column; gap: 20px; }
.auth-form .field label { font-size: 15px; font-weight: 650; color: #2f1a14; }
.auth-form input[type='email'], .auth-form input[type='password'], .auth-form input[type='text'] {
  min-height: 58px; border-radius: 10px; border-color: #efd9cc; background: #fffaf7; font-size: 15px;
}
.auth-form input::placeholder { color: #b9a097; }
.auth-form input:focus { border-color: #e2a07f; box-shadow: 0 0 0 4px rgb(91 107 220 / 12%); }
/* Keep saved logins on the peach field instead of the browser's blue autofill */
.auth-form input:-webkit-autofill { -webkit-box-shadow: 0 0 0 100px #fffaf7 inset; -webkit-text-fill-color: #2f1a14; caret-color: #2f1a14; }
.auth-form input:-webkit-autofill:focus { -webkit-box-shadow: 0 0 0 100px #fffaf7 inset, 0 0 0 4px rgb(91 107 220 / 12%); }
.auth-form .check input {
  appearance: none; flex: none; width: 22px; height: 22px; margin: 0;
  border: 1.5px solid #e2b9a4; border-radius: 6px; background: #fffaf7; cursor: pointer;
  transition: background-color .12s, border-color .12s;
}
.auth-form .check input:checked {
  border-color: var(--brand);
  background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 15px no-repeat;
}
.auth-form .check input:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.input-ico { position: relative; }
.input-ico > .ico { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: #7a5a4f; pointer-events: none; }
.input-ico input { padding-left: 56px; }
.auth-form .check { gap: 12px; color: #2f1a14; font-size: 14.5px; }
.auth-form .btn-primary { min-height: 56px; border-radius: 8px; border-color: transparent; background: #d9733f; color: #fff; font-size: 17px; font-weight: 600; box-shadow: 0 10px 24px rgb(91 107 220 / 26%); }
.auth-form .btn-primary:hover { background: var(--brand-hover); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 60px; }
.pw-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; padding: 8px; border: 0; border-radius: 8px; background: none;
  color: #7a5a4f; cursor: pointer;
}
.pw-toggle .ico { width: 20px; height: 20px; }
.pw-toggle .pw-hide, .pw-toggle[aria-pressed='true'] .pw-show { display: none; }
.pw-toggle[aria-pressed='true'] .pw-hide { display: block; }
.pw-toggle:hover { background: var(--neutral-bg); color: var(--text); }
.auth-foot { margin-top: 26px; text-align: center; font-size: 14px; color: #a08479; }
@media (max-width: 900px) {
  body.auth-split { grid-template-columns: 1fr; align-content: start; }
  .auth-art { bottom: auto; height: 320px; }
  .auth-art .blob-1 { left: 0; top: 0; width: 100%; height: 100%; border-radius: 0 0 58% 42% / 0 0 34% 26%; }
  .auth-brand { padding: 40px 24px 8px; }
  .auth-logo { height: 44px; margin-bottom: 20px; }
  .auth-brand h2 { font-size: 26px; }
  .auth-brand p { font-size: 14px; }
  .auth-illo { display: none; }
  .auth-panel { place-items: start center; padding-top: 32px; }
}

/* ---------- Print documents (invoice, manifest, AWB, PDF lists) ---------- */
/* Screen background around the sheets: "Lilac Mist", the panel's page colour (17 Nov 2026; was peach #efe2da) */
.print-body { background: linear-gradient(160deg, #ece9f6, #f4f3fa 60%) fixed; }
.print-toolbar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: center; gap: 8px; padding: 12px; background: var(--surface); border-bottom: 1px solid var(--border); }
/* Print / Save as PDF button: "Soft Navy" (17 Nov 2026, picked from 9 samples; was the orange outline) */
.print-toolbar .btn-primary { background: #e8edf5; border-color: #e8edf5; color: #33476e; box-shadow: none; }
.print-toolbar .btn-primary:hover { background: #dbe3ef; border-color: #c9d4e6; color: #26395e; }
.print-toolbar .btn-primary:focus-visible { outline: 2px solid #6d82a8; outline-offset: 2px; }
:root[data-theme='dark'] .print-toolbar .btn-primary { background: rgb(109 130 168 / 22%); border-color: transparent; color: #c9d4e6; }
:root[data-theme='dark'] .print-toolbar .btn-primary:hover { background: rgb(109 130 168 / 34%); color: #e3e9f3; }
.print-doc { width: 210mm; min-height: 297mm; margin: 24px auto; padding: 16mm; background: #fff; box-shadow: var(--shadow-lg); color: #111; font-size: 12px; }
.print-doc.landscape { width: 297mm; min-height: 210mm; }
.print-doc h1 { font-size: 20px; }
.print-doc .table th { background: #f3f4f6; font-size: 10.5px; padding: 7px 8px; }
.print-doc .table td { padding: 7px 8px; font-size: 11.5px; }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 2px solid var(--text); }
.doc-meta { display: grid; grid-template-columns: auto auto; gap: 2px 12px; font-size: 12px; }
.doc-meta dt { color: var(--muted); }
.doc-meta dd { margin: 0; font-weight: 600; text-align: right; }
.doc-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 20px; }
.doc-parties h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
.doc-foot { margin-top: 28px; padding-top: 12px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11px; text-align: center; }
.awb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; }
.awb { border: 1.5px dashed #111; border-radius: 6px; padding: 5mm; break-inside: avoid; font-size: 12px; }
.awb .brand img { height: 22px; }
.doc-head .brand img { height: 40px; }
.awb-big { font-size: 18px; font-weight: 750; letter-spacing: .02em; }
.awb .sub { color: inherit; }
.awb-row { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; border-bottom: 1px solid #eee; }
.page-break { break-after: page; }

/* Orders report (orders/print.ejs), page by page like the Invoices report (.rep-*): fixed widths for its 12 columns.
   Order ref · Tracking ID · Customer · Date · Payment · Source · Delivery · Shipping · Discount · Total · Invoice · Status */
.rep-table.rep-orders col.op-ref { width: 13%; }
.rep-table.rep-orders col.op-track { width: 11%; }
.rep-table.rep-orders col.op-cust { width: 12.5%; }
.rep-table.rep-orders col.op-date { width: 9%; }
.rep-table.rep-orders col.op-pay { width: 7.5%; }
.rep-table.rep-orders col.op-src { width: 6.5%; }
.rep-table.rep-orders col.op-del { width: 7.5%; }
.rep-table.rep-orders col.op-num { width: 5.5%; }
.rep-table.rep-orders col.op-total { width: 6%; }
.rep-table.rep-orders col.op-inv { width: 8%; }
.rep-table.rep-orders col.op-status { width: 8%; }
.rep-table.rep-orders td:is(:first-child, :nth-child(2)) { font-variant-numeric: tabular-nums; }
.rep-table .rep-nowrap { white-space: nowrap; overflow-wrap: normal; }
/* Orders report: headings and cells centred in their columns (the total label stays at the left) */
.rep-table.rep-orders :is(th, td), .rep-table.rep-orders :is(th, td).num { text-align: center; }
.rep-table.rep-orders tfoot td:first-child { text-align: left; }

@page { size: A4; margin: 10mm; }
@media print {
  .no-print, .topbar, .sidebar, .print-toolbar { display: none !important; }
  /* Roze AI (robot button and panel) and reminder pop-ups float over every page: never on paper or in a PDF */
  .vb-launcher, .vb-wrap, .rem-toasts { display: none !important; }
  .print-body { background: #fff; }
  .print-doc, .print-doc.landscape { width: auto; min-height: 0; margin: 0; padding: 0; box-shadow: none; }
  .table tbody tr:hover { background: none; }
  a { color: inherit; }
}

/* Invoices report, Apple style (30 Oct 2026): the "White Band" header and the "Capsules & Stripes" table */
/* Shown page by page (16 Nov 2026): each .rep-page is one A4 landscape sheet; app.js paginateReports() fills them */
.print-doc.rep-apple {
  width: auto; min-height: 0; margin: 0; padding: 0; background: none; box-shadow: none;
  font-family: "Inter Variable", Inter, -apple-system, "SF Pro Text", system-ui, sans-serif; font-size: 11px; color: #1d1d1f;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.rep-pages { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 22px 0 40px; }
.rep-page { box-sizing: border-box; display: flex; flex-direction: column; flex: none; width: 297mm; height: 210mm; padding: 10mm 12mm 7mm; overflow: hidden; background: #fff; border-radius: 3px; box-shadow: 0 10px 30px rgba(60, 30, 20, .12); }
.rep-body { flex: 1; min-height: 0; overflow: hidden; }
.rep-apple .rep-band { display: flex; align-items: center; gap: 22px; margin: 0 0 14px; padding: 2px 0 14px; border-bottom: 1px solid #e8e8ed; }
.rep-apple .rep-band-slim { gap: 16px; margin-bottom: 10px; padding: 0 0 9px; }
.rep-apple .rep-band-slim img { height: 22px; padding-right: 16px; }
.rep-apple .rep-band-slim .rep-title { display: flex; align-items: baseline; gap: 12px; }
.rep-apple .rep-band-slim h1 { font-size: 14px; }
.rep-apple .rep-band-slim p { margin: 0; font-size: 11px; }
.rep-band-slim .rep-pno { color: #86868b; font-size: 11px; font-weight: 600; }
.rep-apple .rep-band img { width: auto; height: 34px; padding-right: 22px; border-right: 1px solid #e0e0e5; }
.rep-apple .rep-title { flex: 1; }
.rep-apple .rep-title h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.rep-apple .rep-title p { margin: 2px 0 0; color: #86868b; font-size: 12.5px; }
.rep-apple .rep-meta { display: grid; grid-template-columns: auto auto; gap: 3px 22px; margin: 0; font-size: 12px; }
.rep-apple .rep-meta dt { color: #86868b; }
.rep-apple .rep-meta dd { margin: 0; font-weight: 600; text-align: right; }
/* Fixed column widths (colgroup in invoices/print.ejs) keep all 11 columns inside the landscape page; long names,
   phone numbers and tracking IDs wrap inside their column instead of pushing the table past the paper. */
.rep-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 11px; line-height: 1.35; }
.rep-table th, .rep-table td { padding: 6px; text-align: left; vertical-align: middle; overflow-wrap: anywhere; }
/* Invoice # · Date · Customer · Phone · Delivery · Order ref · Tracking ID · Total · Payment mode · Payment · Status */
.rep-table col:nth-child(1), .rep-table col:nth-child(2), .rep-table col:nth-child(8), .rep-table col:nth-child(10) { width: 8.5%; }
.rep-table col:nth-child(3) { width: 11.5%; }
.rep-table col:nth-child(4), .rep-table col:nth-child(7) { width: 9.5%; }
.rep-table col:nth-child(5) { width: 6%; }
.rep-table col:nth-child(6) { width: 13%; }
.rep-table col:nth-child(9) { width: 9%; }
.rep-table col:nth-child(11) { width: 7.5%; }
.rep-table th:first-child, .rep-table td:first-child { padding-left: 4px; }
.rep-table th:last-child, .rep-table td:last-child { padding-right: 4px; }
.rep-table .rep-time { display: block; color: #a1a1a6; font-size: 10px; }
.rep-table th { font-size: 10px; font-weight: 600; color: #86868b; border-bottom: 1px solid #e5e5ea; }
.rep-table tbody tr:nth-child(even) td { background: #f7f7f9; }
.rep-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rep-table .rep-strong { font-weight: 600; }
.rep-table .rep-soft { color: #6e6e73; }
.rep-table .rep-empty { padding: 28px; text-align: center; color: #86868b; }
.rep-table tfoot td { padding-top: 11px; border-top: 1.5px solid #1d1d1f; font-size: 12.5px; font-weight: 700; }
.rep-table .rep-unpaid { color: #c93400; font-weight: 600; text-align: right; }
.rep-cap { display: inline-block; padding: 2px 7px; border-radius: 999px; background: #f2f2f5; color: #515154; font-size: 10px; font-weight: 600; line-height: 1.5; }
.rep-cap-paid { background: #e8f7ec; color: #1f7a3a; }
.rep-cap-unpaid { background: #fff3e2; color: #b25000; }
.rep-cap-partial { background: #e8f1ff; color: #0a5ad6; }
.rep-cap-cancelled { background: #fdecec; color: #c4141f; }
.rep-cap-returned { background: #f3ecfc; color: #7a3fb0; }
/* Order statuses (orders report): each status its own colour */
.rep-cap-completed { background: #e8f7ec; color: #1f7a3a; }
.rep-cap-processing { background: #e8f1ff; color: #0a5ad6; }
.rep-cap-pending { background: #fff6dc; color: #8a6100; }
.rep-foot { display: flex; justify-content: space-between; flex: none; margin-top: 8px; padding-top: 8px; border-top: 1px solid #f0f0f2; color: #a1a1a6; font-size: 10px; }
.rep-foot .rep-pno { color: #6e6e73; font-weight: 600; }
@page rep-wide { size: A4 landscape; margin: 0; }
@media print {
  .print-doc.rep-apple { page: rep-wide; }
  .rep-pages { display: block; padding: 0; zoom: 1 !important; }
  /* A hair under 210mm so rounding never spills a page onto a blank one */
  .rep-page { height: 209.5mm; border-radius: 0; box-shadow: none; break-after: page; }
  .rep-page:last-child { break-after: auto; }
}

/* ════ Features from the old app: each area adds its rules inside its own section only ════ */
/* ── section: users & roles, notifications, theme ── */
/* Role form: pages grouped by top section */
.perm-body { border-top: 1px solid var(--border); }
.perm-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.perm-head .check small { margin-left: 2px; font-size: 12px; }
.perm-error { margin: -6px 0 12px; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.perm-group { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 12px 14px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); min-width: 0; }
.perm-group legend { padding: 0 6px; margin-left: -6px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.perm-group .check { font-size: 13px; color: var(--text-2); }
.perm-group .check .ico { width: 16px; height: 16px; color: var(--muted); }
.perm-group[disabled] .check { cursor: default; opacity: .75; }
.perm-body > .help { margin-top: 12px; font-size: 12px; }

/* Notification bell */
.bell { position: relative; }
.bell-count {
  position: absolute; top: -5px; right: -9px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--danger); color: #fff; box-shadow: 0 0 0 2px var(--surface);
  font-size: 10.5px; font-weight: 700; line-height: 18px; text-align: center;
}
.bell-list { width: 300px; }
.menu-list.bell-list a { gap: 10px; white-space: normal; }
.bell-icon { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; }
.menu-list .bell-icon .ico { color: inherit; }
.bell-label { flex: 1; min-width: 0; }
.bell-num { font-weight: 700; font-variant-numeric: tabular-nums; }
.bell-empty { display: flex; align-items: center; gap: 8px; padding: 10px; font-size: 13px; color: var(--muted); }
.menu-list .bell-empty .ico { color: var(--success); }

/* Light / Dark switch in the account menu */
.theme-switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 4px 6px 10px; }
.theme-switch > span { font-size: 13px; font-weight: 500; color: var(--text-2); }
.menu-list .theme-switch .segmented button { width: auto; gap: 5px; padding: 5px 10px; border-radius: 8px; font-size: 12.5px; color: var(--text-2); }
.menu-list .theme-switch .segmented button:hover { background: none; color: var(--text); }
.menu-list .theme-switch .segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.menu-list .theme-switch .segmented .ico { width: 14px; height: 14px; }

/* Dark theme: same layout, warm dark surfaces (sign-in and print pages stay light) */
:root { --chart-prev: #efe4de; --chart-prev-top: #f7ede8; --chart-cur-top: #f0bda0; }
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #17110f;
  --surface: #211915;
  --surface-2: #2a201b;
  --border: #3a2d27;
  --border-strong: #4e3d35;
  --text: #f4e9e3;
  --text-2: #dccbc2;
  --muted: #a99289;
  --faint: #7f6b62;
  --brand: #e27d44;
  --brand-hover: #ec9160;
  --brand-ink: #f1a678;
  --brand-soft: #3b2519;
  --brand-line: #5c3a26;
  --success: #52c18b; --success-bg: #14291f; --success-line: #245239;
  --warning: #e3b55c; --warning-bg: #2f2512; --warning-line: #5b4621;
  --danger: #f27c6e;  --danger-bg: #351917;  --danger-line: #612b26;
  --info: #52c2b9;    --info-bg: #10292a;    --info-line: #1f4e4b;
  --violet: #cf95c2;  --violet-bg: #2f1f2c;
  --teal: #52c2b9;    --teal-bg: #10292a;
  --neutral-bg: #2f2520;
  --shadow: 0 1px 2px rgb(0 0 0 / 35%), 0 1px 3px rgb(0 0 0 / 40%);
  --shadow-lg: 0 12px 32px rgb(0 0 0 / 55%);
  --chart-prev: #4d3c34;
  --chart-prev-top: #4d3c34;
  --chart-cur-top: #e27d44;
}
:root[data-theme='dark'] .clock,
:root[data-theme='dark'] .toolbar-search input,
:root[data-theme='dark'] .chip-select,
:root[data-theme='dark'] .toolbar-dates input,
:root[data-theme='dark'] .toolbar-switch,
:root[data-theme='dark'] .fb-product,
:root[data-theme='dark'] .fb-date,
:root[data-theme='dark'] .head-range { background: rgb(255 255 255 / 5%); box-shadow: inset 0 1px 0 rgb(255 255 255 / 6%), 0 0 0 1px var(--border-strong); }
:root[data-theme='dark'] .toolbar { border-bottom-color: var(--border); }
:root[data-theme='dark'] .list-meta,
:root[data-theme='dark'] .pagination,
:root[data-theme='dark'] .glance-foot { background: var(--surface-2); border-color: var(--border); }
:root[data-theme='dark'] .card.filters:has(+ .card),
:root[data-theme='dark'] .table tbody tr:hover { background: var(--surface-2); }
:root[data-theme='dark'] .callout-success { color: var(--success); }
:root[data-theme='dark'] .callout-warning { color: var(--warning); }
:root[data-theme='dark'] .callout-info { color: var(--info); }
:root[data-theme='dark'] .chart-legend .lg-prev::before { background: var(--chart-prev); }
:root[data-theme='dark'] .tp-thumb { border-color: var(--border); }
:root[data-theme='dark'] .dash-analytics svg > circle { stroke: var(--border); }
:root[data-theme='dark'] .backdrop { background: rgb(0 0 0 / 55%); }
/* end section: users & roles, notifications, theme */

/* ── section: customers & order fields ── */
[data-saved-wrap][hidden], [data-billing-block][hidden] { display: none; }
.addr-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.addr-heading { margin-bottom: 8px; }
.addr-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.addr-list li { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); font-size: 13px; line-height: 1.45; }
.addr-list .icon-btn { width: 28px; height: 28px; flex: none; }
.addr-add { border-top: 1px solid var(--border); }
.addr-add > summary { display: flex; align-items: center; gap: 6px; padding: 12px 16px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--brand-ink); list-style: none; }
.addr-add > summary::-webkit-details-marker { display: none; }
.addr-add > summary .ico { width: 15px; height: 15px; }
.addr-add[open] > summary { border-bottom: 1px solid var(--border); }
@media (max-width: 700px) { .addr-cols { grid-template-columns: 1fr; } }
/* end section: customers & order fields */

/* ── section: invoices, payments, bill slip ── */
/* Invoice page as in the old app: invoice list on the left; toolbar and the invoice paper on the right */
.inv-view { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 16px; align-items: start; }
.inv-side { position: sticky; top: calc(var(--topbar-h) + 16px); display: flex; flex-direction: column; max-height: calc(100vh - var(--topbar-h) - 40px); overflow: hidden; }
.inv-side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 12px; }
.inv-side-head .back-link { margin: 0; font-weight: 650; }
.inv-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.inv-list a {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name amt" "no amt" "st amt";
  gap: 1px 10px; align-items: center; padding: 10px 12px; border-radius: 10px; color: var(--text);
}
.inv-list li + li a { margin-top: 2px; }
.inv-list a:hover { background: var(--neutral-bg); }
.inv-list a.on { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.il-name { grid-area: name; min-width: 0; font-size: 12px; font-weight: 700; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.il-no { grid-area: no; font-size: 14px; }
.il-amt { grid-area: amt; font-size: 14px; font-variant-numeric: tabular-nums; }
.il-st { grid-area: st; font-size: 12.5px; font-weight: 600; }
.inv-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.inv-toolbar { position: sticky; top: calc(var(--topbar-h) + 16px); z-index: 5; display: flex; align-items: center; flex-wrap: wrap; gap: 2px 4px; padding: 8px 10px; }
.inv-toolbar .inline-form { display: inline-flex; }
.inv-toolbar summary .ico:last-child:not(:first-child) { width: 14px; height: 14px; }
.btn.is-off { opacity: .45; cursor: not-allowed; }
.inv-end { display: flex; align-items: center; gap: 6px; min-width: 0; margin-left: auto; }
.inv-company { min-width: 0; }
.inv-company label { display: flex; flex-direction: column; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted); }
.inv-company select { height: 34px; min-height: 0; min-width: 270px; padding-top: 0; padding-bottom: 0; font-size: 13px; }
.inv-close { flex: none; }
/* Forms and lists inside the toolbar menus */
.menu-wide { min-width: 320px; }
.menu-form { width: min(330px, calc(100vw - 16px)); padding: 12px; }
.menu-list .pay-form, .menu-list .awb-form { display: flex; flex-direction: column; gap: 10px; padding: 4px 6px 6px; }
.menu-list .btn { width: 100%; justify-content: center; padding: 8px 14px; font-weight: 700; }
.menu-list .btn-primary { border: 1.5px solid var(--brand); background: var(--brand); color: #fff; }
.menu-list .btn-primary:hover { background: var(--brand-hover); color: #fff; }
.menu-list .btn-secondary { border: 1px solid var(--border-strong); }
.menu-list .icon-btn { flex: none; width: 32px; height: 32px; padding: 0; justify-content: center; }
.menu-list .icon-btn.danger:hover { color: var(--danger); }
.menu-note { margin: 4px 10px; font-size: 12px; font-weight: 600; color: var(--muted); }
.inv-sums { display: flex; justify-content: space-between; gap: 18px; margin: 0; padding: 6px 10px; }
.inv-sums div { display: flex; flex-direction: column; align-items: flex-end; }
.inv-sums dt { font-size: 11px; color: var(--muted); }
.inv-sums dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.pay-row { display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 10px; }
.pay-row > span { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pay-row small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pay-row form { display: contents; }
/* The invoice itself: a white sheet like the printed copy */
.inv-paper { width: 100%; max-width: 820px; margin: 0 auto; padding: 48px 56px 56px; background: #fff; color: #222; border-radius: 4px; box-shadow: var(--shadow-lg); font-size: 13px; line-height: 1.6; }
.ip-head { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 36px; }
.ip-from { display: flex; flex-direction: column; max-width: 340px; }
.ip-from img { width: 110px; height: auto; margin-bottom: 28px; }
.ip-from strong { font-weight: 500; }
.ip-from a { color: #4a7fd0; text-decoration: underline; }
.ip-title { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.ip-title h1 { margin: 0 0 8px; font-size: 34px; font-weight: 500; letter-spacing: .02em; color: #222; }
.ip-title > span { font-size: 15px; }
.ip-title dl { display: flex; flex-direction: column; align-items: flex-end; margin: 28px 0 0; }
.ip-title dd { margin: 0; }
.ip-stamp { margin-top: 12px; padding: 2px 10px; border: 2px solid var(--danger); border-radius: 6px; color: var(--danger); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.ip-parties { display: flex; justify-content: space-between; gap: 32px; margin-bottom: 26px; }
.ip-parties > div { display: flex; flex-direction: column; }
.ip-ship { max-width: 300px; margin: 0; text-align: right; }
.ip-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ip-table th, .ip-table td { padding: 10px 8px; border: 1px solid #dcdcdc; vertical-align: middle; }
.ip-table th { background: #f3f3f3; font-weight: 600; text-align: left; }
.ip-table .num { text-align: right; white-space: nowrap; }
.ip-table .ip-total td { font-weight: 700; }
.ip-terms { margin-top: 40px; }
.ip-terms h3 { margin: 0 0 10px; font-size: 16px; font-weight: 500; }
.ip-terms p { max-width: 60ch; margin: 0; font-size: 11.5px; }
@media (max-width: 1100px) {
  .inv-view { grid-template-columns: minmax(0, 1fr); }
  .inv-side { position: static; max-height: 300px; }
  .inv-toolbar { position: static; }
  .inv-paper { padding: 28px 22px; }
}
@media (max-width: 560px) {
  .inv-end { flex: 1 1 100%; }
  .inv-company { flex: 1; }
  .inv-company select { width: 100%; min-width: 0; }
}
/* Invoice page: View (panel layout) / PDF (printable sheet) switch. Printing always uses the sheet. */
.inv-mode { flex: none; }
.inv-mode a { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; }
.inv-mode a .ico { width: 15px; height: 15px; }
.inv-mode a.active { color: var(--brand-ink); }
.inv-sep { width: 1px; height: 22px; margin: 0 6px; background: var(--border); }
@media screen {
  .inv-main:not(.is-pdf) .inv-paper { display: none; }
  .inv-main.is-pdf .inv-app { display: none; }
}
.inv-app { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.inv-app .od-grid { margin: 0; }
.inv-app > .card + .card, .inv-app .od-grid > .card + .card { margin-top: 0; }
.iv-hero { padding: 18px 20px; display: flex; flex-direction: column; gap: 16px; }
.iv-hero-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.iv-hero-ic { width: 48px; height: 48px; }
.iv-hero-ic .ico { width: 20px; height: 20px; }
.iv-hero-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.iv-hero-title small { color: var(--muted); font-size: 11.5px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.iv-hero-title h1 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.iv-hero-sub { color: var(--muted); font-size: 12.5px; }
.iv-hero-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.iv-hero-badges .badge, .iv-hero-badges .pay { font-size: 12.5px; padding: 3px 11px; border-radius: 999px; }
.iv-sums { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.iv-sums .od-text b { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.iv-lines { table-layout: fixed; min-width: 680px; }
.iv-lines col.c-id { width: 112px; }
.iv-lines col.c-qty { width: 70px; }
.iv-lines col.c-money { width: 104px; }
.iv-lines col.c-amount { width: 124px; }
.iv-lines td { vertical-align: top; }
.iv-lines td .sub { margin-top: 3px; line-height: 1.45; }
.iv-lines tfoot td { border-top: 0; padding-top: 6px; padding-bottom: 6px; color: var(--text-2); }
.iv-lines tfoot tr:first-child td { padding-top: 12px; border-top: 1px solid var(--border); }
.iv-lines tfoot .iv-total td { padding-top: 10px; padding-bottom: 12px; color: var(--text); font-size: 15px; font-weight: 800; }
.iv-lines tfoot .iv-total td:last-child { color: var(--brand-ink); }
.iv-pays li { gap: 12px; }
.iv-pays .spend-main small { font-size: 11.5px; }
.iv-empty { display: flex; align-items: center; gap: 10px; margin: 0; padding: 14px 16px; border-radius: 14px; background: rgb(241 239 251 / 55%); border: 1px dashed rgb(187 178 229 / 60%); color: var(--text-2); font-size: 13.5px; }
.iv-empty .ico { width: 18px; height: 18px; color: #6e5fbb; flex: none; }
:root[data-theme='dark'] .iv-empty { background: var(--surface-2); border-color: var(--border); }
.iv-hero-title h1 { white-space: nowrap; }
.iv-m { display: none; }
/* Phones: each item becomes one row (name + "qty × rate" on the left, amount on the right), no sideways scroll */
@media (max-width: 640px) {
  .iv-lines { min-width: 0; }
  .iv-lines, .iv-lines tbody, .iv-lines tfoot { display: block; }
  .iv-lines colgroup, .iv-lines thead { display: none; }
  .iv-lines tr { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 6px 16px; }
  .iv-lines tbody tr { padding: 12px 16px; border-bottom: 1px solid var(--border); }
  .iv-lines tbody td:not(:nth-child(2)):not(:last-child) { display: none; }
  .iv-lines td, .iv-lines tfoot td, .iv-lines tfoot tr:first-child td, .iv-lines tfoot .iv-total td { display: block; padding: 0; border: 0; }
  .iv-lines tbody td:nth-child(2) { flex: 1; min-width: 0; }
  .iv-lines tfoot tr:first-child { padding-top: 12px; }
  .iv-lines tfoot .iv-total { padding-bottom: 14px; }
  .iv-m { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
}
@media (max-width: 560px) {
  .iv-hero { padding: 16px; }
  .iv-hero-title { flex: 1 1 calc(100% - 62px); }
  .iv-hero-badges { flex-basis: 100%; }
  .iv-hero-title h1 { font-size: 20px; }
  .inv-sep { display: none; }
}
@media print {
  body:has(.inv-paper) .content { margin: 0; padding: 0; }
  .inv-view { display: block; }
  .inv-app { display: none !important; }
  .inv-paper { max-width: none; padding: 0; border-radius: 0; box-shadow: none; }
}
.letterhead { display: flex; flex-direction: column; gap: 2px; max-width: 95mm; font-size: 11px; }
.letterhead strong { font-size: 12px; margin-top: 6px; }
.letterhead a { color: inherit; }
.doc-terms { margin-top: 18px; max-width: 110mm; }
.doc-terms h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 4px; }
.doc-terms p { font-size: 10px; line-height: 1.5; margin: 0; }
.box-choice { border: 0; padding: 0; margin: 0; }
.box-choice legend { font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.box-options { display: flex; gap: 20px; flex-wrap: wrap; }

/* Payment slip */
.pay-slip { max-width: 120mm; margin: 0 auto; }
.pay-slip-head { display: flex; flex-direction: column; gap: 2px; font-size: 11px; padding-bottom: 12px; border-bottom: 1px solid #ddd; }
.pay-slip-head .brand img { height: 40px; }
.pay-slip-head strong { margin-top: 6px; font-size: 12px; }
.pay-slip-title { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; margin: 14px 0 10px; padding-bottom: 4px; border-bottom: 1px solid #ddd; display: inline-block; }
.pay-slip-rows { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; margin: 0 0 16px; font-size: 12px; }
.pay-slip-rows dt { color: #555; }
.pay-slip-rows dd { margin: 0; font-weight: 600; }
.pay-slip-amount { display: flex; align-items: center; justify-content: center; min-height: 100px; border-radius: 6px; background: #1f8a5b; color: #fff; font-size: 22px; font-weight: 750; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

/* AWB label (two per A4 page) */
.awb-label { border: 1.5px solid #111; padding: 4mm; margin-bottom: 6mm; break-inside: avoid; font-size: 10.5px; }
.awb-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 3mm; }
.awb-top .brand img { height: 22px; }
.awb-printed { display: flex; flex-direction: column; align-items: flex-end; font-size: 9.5px; }
.awb-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 3mm; margin-bottom: 3mm; }
.awb-box { width: 100%; border-collapse: collapse; }
.awb-box th { text-align: left; background: #eee; padding: 2px 5px; font-size: 10.5px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.awb-box td { border: 1px solid #ccc; padding: 2px 5px; vertical-align: top; }
.awb-box td:first-child { width: 32%; color: #444; }
.awb-box .num { text-align: right; }
.awb-wide { margin-bottom: 3mm; }
.awb-wide td:first-child { width: 18%; }
.awb-code { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1px solid #ccc; padding: 3mm; text-align: center; }
.barcode { width: 100%; max-width: 70mm; height: 16mm; }
.awb-code .awb-big { font-size: 15px; }

/* Courier bill slip (landscape) */
.slip { font-size: 9.5px; color: #111; }
.slip-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 8px; background: #555; color: #fff; font-size: 11px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.slip-top { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; align-items: center; margin: 8px 0; }
.slip-code { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.slip-code .barcode { max-width: 90mm; height: 14mm; }
.slip-branches { line-height: 1.35; font-size: 9px; }
.slip-cols { display: flex; gap: 6px; margin-bottom: 6px; align-items: stretch; }
.slip-col { flex: 1 1 0; min-width: 0; }
.slip-wide { flex: 2 1 0; }
.slip-t { width: 100%; border-collapse: collapse; border: 1px solid #111; }
.slip-t th { background: #555; color: #fff; text-align: left; padding: 3px 5px; font-size: 9.5px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.slip-t td { border: 1px solid #999; padding: 3px 5px; height: 17px; vertical-align: top; }
.slip-t td:first-child { white-space: nowrap; width: 1%; }
.slip-grid td:first-child { width: 50%; white-space: normal; }
.slip-pair { display: grid; grid-template-columns: 1fr auto 1fr; }
.slip-pair span:nth-child(2) { padding: 0 6px; border-left: 1px solid #999; }
.slip-small { font-size: 8px; line-height: 1.35; margin: 6px 0 0; }
/* Edit button that doesn't apply: still hoverable so its title explains why */
.btn.is-off { opacity: .55; cursor: not-allowed; }
/* end section: invoices, payments, bill slip */

/* ── section: accounts reports ── */
.pin-card { max-width: 380px; margin: 48px auto; padding: 28px 28px 24px; text-align: center; }
.pin-card h1 { font-size: 20px; margin: 12px 0 4px; }
.pin-card .muted { margin: 0 0 18px; font-size: 13px; }
.pin-card .field { text-align: left; margin-bottom: 14px; }
.pin-card .field input { letter-spacing: .4em; text-align: center; font-size: 18px; }
.pin-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); box-shadow: 0 0 0 4px var(--surface), 0 8px 18px -6px rgb(17 20 24 / 25%); }
.pin-icon .ico { width: 28px; height: 28px; }
/* Lock screen: glass card and four PIN digit boxes */
.pin-card { border-radius: 22px; padding: 32px 30px 26px; }
.pin-card h1 { font-size: 22px; font-weight: 750; margin-top: 16px; }
:root:not([data-theme='dark']) .pin-card {
  background: rgb(255 255 255 / 60%); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border-color: #fff; box-shadow: 0 18px 40px -16px rgb(17 20 24 / 25%), inset 0 1px 0 #fff;
}
.pin-boxes { display: flex; justify-content: center; gap: 12px; margin: 4px 0 10px; }
/* The script hides the plain PIN box and Unlock button once the digit boxes are ready */
.pin-card [hidden] { display: none !important; }
.pin-boxes .pin-box {
  width: 58px; height: 64px; min-height: 0; padding: 0; border: 1.5px solid var(--line, #f2e4dc); border-radius: 14px;
  background: var(--surface); text-align: center; font-size: 30px; font-weight: 700; color: var(--text); caret-color: var(--brand);
}
.pin-boxes .pin-box.filled { border-color: #f1d4c5; background: #fffbfa; }
.pin-boxes .pin-box:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgb(142 153 224 / 15%); outline: none; }
.pin-error .pin-box { border-color: var(--danger); animation: pin-shake .35s ease-in-out; }
.pin-sending .pin-box { opacity: .6; }
@keyframes pin-shake { 25% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
.pin-message { display: block; margin: 0 0 8px; }
.pin-hint { margin: 0; font-size: 12px; color: var(--muted); }
:root[data-theme='dark'] .pin-box.filled { background: var(--surface-2); border-color: var(--border-strong); }
.pin-form { max-width: 420px; }
.stats.stats-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) { .stats.stats-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .stats.stats-5 { grid-template-columns: minmax(0, 1fr); } }
.btn.disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.rep-controls { border-bottom: 0; gap: 12px; }
.rep-caption { margin: 8px 2px 14px; font-size: 12.5px; }
.rep-bottom { max-width: 620px; }
.rep-totals td { padding: 10px 16px; }
.rep-totals tr.rep-net td { font-weight: 700; background: var(--success-bg); color: var(--success); }
.rep-daily td, .rep-daily th { white-space: nowrap; }
.rep-note { padding: 14px 16px; }
.rep-note p { margin: 0; }
.rep-note p + p { margin-top: 4px; font-size: 12.5px; }
.rep-total { margin-left: auto; font-size: 13.5px; }
.rep-callout { margin: 0 16px 12px; }
.rep-stats { padding: 0 16px 4px; }
.refund-card { max-width: 720px; }
.refund-find { display: flex; align-items: flex-end; gap: 10px; }
.refund-find .field { flex: 1; margin: 0; }
.refund-found { border-top: 1px solid var(--border); }
.refund-found .muted { margin: 0; font-size: 12.5px; }
.refund-entry { border-top: 1px solid var(--border); }
.terms-search { flex: 1 1 320px; }
.prod-block .card-head h2 { font-size: 14px; }
.rate-sum { display: inline-block; margin-right: 14px; white-space: nowrap; }
/* Accounts overview: period controls beside the title, cards with the icon on top, tables with a side panel */
.acc-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.acc-range { position: relative; }
.acc-range > summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); font-size: 13.5px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.acc-range > summary::-webkit-details-marker { display: none; }
.acc-range > summary .ico { width: 16px; height: 16px; color: var(--muted); }
.acc-range.on > summary { border-color: var(--brand-line); color: var(--brand-ink); }
.acc-range-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: 280px; display: grid; gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 18px 40px -16px rgb(17 20 24 / 30%); }
.acc-range-actions { display: flex; justify-content: flex-end; gap: 8px; }
.acc-ib { display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--border-strong); border-radius: 50%; background: var(--surface); color: var(--text-2); cursor: pointer; }
.acc-ib .ico { width: 17px; height: 17px; }
/* Print and Download (PDF / Excel / CSV): labelled buttons in the same shape and colours as the date chip */
.acc-btn { list-style: none; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text); font-size: 13.5px; font-weight: 600; white-space: nowrap; text-decoration: none; cursor: pointer; }
.acc-btn .ico { width: 16px; height: 16px; color: var(--muted); }
.acc-btn:hover, .acc-download[open] > .acc-btn { background: var(--neutral-bg); }
.acc-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.acc-download > summary::-webkit-details-marker { display: none; }
.acc-download .menu-list { min-width: 180px; }
/* Accounts overview print view, Rose Lilac (6 Nov 2026, the "Dot grid" layout without dots): a soft lilac header
   with a hairline under it, the five totals as separate white cards, lilac table heads with rounded ends and quiet rows.
   Landscape with no printer margins, so the browser adds no date, title or link; the outer .dg-pages table's head and
   foot repeat on every sheet as its top and bottom margins. */
@page acc-lilac { size: A4 landscape; margin: 0; }
.print-doc.acc-lilac {
  page: acc-lilac; padding: 0 0 6mm; color: #2f2433;
  font-family: "Manrope Variable", Manrope, system-ui, sans-serif; font-size: 11px;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.dg-top { display: flex; align-items: center; gap: 18px; padding: 9mm 14mm 6mm; border-bottom: 1px solid #ece6f1; background: linear-gradient(#f8f6fd, #fff); }
.dg-top img { height: 34px; width: auto; }
.dg-title h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.01em; color: #3a2a48; }
.dg-title p { margin: 2px 0 0; font-size: 11.5px; color: #8a7f90; }
.dg-when { margin-left: auto; text-align: right; font-size: 11px; line-height: 1.5; color: #8a7f90; }
.dg-when b { display: block; font-size: 14px; color: #3a2a48; }
.dg-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3.5mm; margin: 6mm 14mm 0; }
.dg-kpi { display: grid; gap: 1px; padding: 3.2mm 4mm; border: 1px solid #ece6f1; border-radius: 12px; background: #fff; }
.dg-kpi small { font-size: 9px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #8a7f90; }
.dg-kpi b { font-size: 17px; font-weight: 800; white-space: nowrap; color: #2f2433; }
.dg-kpi span { font-size: 10.5px; color: #8a7f90; }
.dg-kpi.lilac b { color: #7b6dc6; }
.dg-kpi.good b { color: #4a7556; }
.dg-kpi.bad b { color: #b35678; }
.dg-kpi.void b { color: #a759ad; }
.dg-pages { width: 100%; border-collapse: collapse; }
.dg-pages > thead > tr > td, .dg-pages > tfoot > tr > td, .dg-pages > tbody > tr > td { padding: 0 14mm; border: 0; }
.dg-gap { height: 7mm; }
.dg-foot { display: flex; justify-content: space-between; gap: 16px; margin-top: 2mm; padding: 2.5mm 0 6mm; border-top: 1px solid #ece6f1; font-size: 9.5px; color: #8a7f90; }
.dg-section { margin-bottom: 7mm; }
.dg-section.keep { break-inside: avoid; }
.dg-section h2 { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0 0 2.5mm; font-size: 14px; font-weight: 800; color: #3a2a48; break-after: avoid; }
.dg-section h2 span { font-size: 10.5px; font-weight: 600; color: #8a7f90; }
.dg-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.dg-table th { padding: 2mm 2.6mm; background: #f1effb; color: #8a7f90; font-size: 9px; font-weight: 700; letter-spacing: .07em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.dg-table th:first-child { border-radius: 8px 0 0 8px; }
.dg-table th:last-child { border-radius: 0 8px 8px 0; }
.dg-table td { padding: 1.8mm 2.6mm; border-bottom: 1px solid #ece6f1; font-size: 11px; white-space: nowrap; }
.dg-table td.wrap { white-space: normal; }
.dg-table .num { text-align: right; }
.dg-table tbody tr.dg-total td { padding-top: 2.2mm; border-top: 1.5px solid #cec7ed; border-bottom: 0; font-weight: 800; color: #3a2a48; }
.dg-table tr { break-inside: avoid; }
/* A total never starts a sheet on its own: it stays with the last line above it */
.dg-table tbody tr:nth-last-child(2) { break-after: avoid; }
.dg-table tbody tr.dg-total { break-before: avoid; }
.dg-empty { color: #8a7f90; }
.acc-kpis .stat { flex-direction: column; align-items: flex-start; gap: 12px; }
.acc-kpis .stat-label { white-space: nowrap; }
.acc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.acc-main, .acc-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.acc-main > .card, .acc-side > .card { margin: 0; }
.acc-modes li { align-items: flex-start; }
.acc-mrow { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-width: 0; }
.acc-mrow b:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-mrow .acc-amt { flex: none; font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.acc-modes .spend-main small { font-size: 11.5px; color: var(--muted); }
@media (max-width: 1100px) { .acc-layout { grid-template-columns: minmax(0, 1fr); } }
.acc-charts { padding: 16px; }
.acc-chart-title { font-size: 13px; font-weight: 650; margin: 0 0 8px; color: var(--text-2); }
.acc-chart { height: 360px; }
@media print {
  .rep-bottom { max-width: none; }
  .prod-block, .rep-note { break-inside: avoid; }
}
/* end section: accounts reports */

/* ── section: whatsapp ── */
.card-sub { margin: 3px 0 0; font-size: 12px; font-weight: 450; color: var(--muted); }
/* "Pearl outline": hairline cards, outline icons in ink, the accent only where something is on or chosen.
   The light theme sets the exact pearl colours in rose-lilac.css. */
.wa-page {
  --wa-ink: var(--text); --wa-accent: var(--brand-ink); --wa-hair: var(--border); --wa-card: var(--surface); --wa-ring: var(--brand-soft);
  --wa-tile-ring: var(--brand-line); --wa-icon-ring: var(--border-strong); --wa-pill-bg: var(--neutral-bg); --wa-pill-ink: var(--text-2); --wa-btn-edge: var(--brand-line);
}
.wa-hero { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.wa-mark { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; flex: none; color: var(--wa-accent); background: var(--wa-card); box-shadow: 0 0 0 3px var(--wa-tile-ring); }
.wa-mark svg { width: 32px; height: 32px; }
.wa-hero-text { flex: 1; min-width: 240px; }
.wa-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wa-title h1 { margin: 0; }
.wa-pill, .wa-tag { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; border: 1px solid var(--wa-hair); background: var(--wa-pill-bg); color: var(--wa-pill-ink); font-weight: 600; white-space: nowrap; }
.wa-pill { padding: 2px 10px; font-size: 12px; }
.wa-pill .ico { width: 13px; height: 13px; }
.wa-tag { padding: 1px 7px; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.wa-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.wa-pill-connected .wa-dot { background: var(--success); }
.wa-pill-waiting .wa-dot { background: var(--warning); }
.wa-pill-attention .wa-dot { background: var(--danger); }
.wa-hero .subtitle { margin: 4px 0 0; }
.wa-sender { margin: 3px 0 0; font-size: 13px; color: var(--text-2); }
.wa-sender strong { color: var(--text); font-weight: 650; }
.wa-master { display: flex; align-items: center; gap: 18px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.wa-master-text { display: flex; flex-direction: column; gap: 1px; }
.wa-master-text strong { font-size: 14px; }
.wa-master-text small { font-size: 12px; color: var(--muted); }
.wa-alert { display: flex; align-items: center; gap: 10px; padding: 11px 14px; margin-bottom: 16px; border-radius: 12px; border: 1px solid var(--danger-line); background: var(--danger-bg); color: var(--danger); font-size: 13.5px; }
.wa-alert .ico { flex: none; width: 18px; height: 18px; }
.wa-stats .stat { color: inherit; text-decoration: none; align-items: center; transition: border-color .15s, transform .15s; }
.wa-stats .stat:hover { border-color: var(--wa-btn-edge); transform: translateY(-1px); }
.wa-stats .stat-icon { background: transparent; color: var(--wa-ink); border-radius: 50%; box-shadow: inset 0 0 0 1px var(--wa-icon-ring); }
.wa-stats .stat-value small { font-size: 14px; font-weight: 550; color: var(--muted); }
.wa-stats .stat-sub { margin-top: 0; }
.wa-tabs { padding: 0 0 1px; margin: 2px 0 18px; overflow-y: hidden; border-bottom-color: var(--wa-hair); }
.wa-tabs a.active { color: var(--wa-accent); border-bottom-color: var(--wa-accent); }
.wa-page .switch input:checked + .track { background: var(--wa-accent); }
.wa-tabs a { display: inline-flex; align-items: center; gap: 7px; }
.wa-tabs .ico { width: 16px; height: 16px; }

/* Provider cards */
.wa-providers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.wa-provider { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.wa-provider:hover { border-color: var(--wa-btn-edge); }
.wa-provider:has(input:checked) { border-color: var(--wa-accent); box-shadow: 0 0 0 3px var(--wa-ring), var(--shadow); }
.wa-provider:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.wa-provider-mark { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; background: transparent; color: var(--wa-ink); box-shadow: inset 0 0 0 1px var(--wa-icon-ring); }
.wa-provider-mark .ico { width: 22px; height: 22px; }
.wa-provider-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding-right: 20px; }
.wa-provider-name { font-weight: 680; font-size: 13.5px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.wa-provider-text small { color: var(--muted); font-size: 12px; line-height: 1.45; }
.wa-provider-tick { position: absolute; top: 12px; right: 12px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--wa-accent); color: #fff; opacity: 0; transform: scale(.6); transition: opacity .15s, transform .15s; }
.wa-provider-tick .ico { width: 12px; height: 12px; stroke-width: 3; }
.wa-provider:has(input:checked) .wa-provider-tick { opacity: 1; transform: none; }

/* Connection: settings on the left, test / security / recipients on the right */
.wa-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.wa-main, .wa-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.wa-main > .card, .wa-side > .card, .wa-automations > .card { margin: 0; }
.wa-secret { position: relative; display: block; }
.wa-secret input { padding-right: 44px; }
.wa-secret .icon-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; }
.wa-secret .icon-btn[aria-pressed='true'] { color: var(--wa-accent); background: var(--wa-pill-bg); }
.wa-main textarea.mono, .wa-main textarea[data-chips] { min-height: 0; }
.wa-callout { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 11px 14px; border-radius: 12px; background: var(--wa-card); border: 1px solid var(--wa-hair); color: var(--wa-ink); font-size: 13px; line-height: 1.5; }
.wa-callout .ico { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--wa-ink); }
.wa-callout a { font-weight: 600; }
.wa-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.wa-actions .danger { color: var(--danger); }
.wa-phone { display: flex; }
.wa-phone select { width: auto; flex: none; border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: -1px; }
.wa-phone input { flex: 1; min-width: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.wa-phone :focus { position: relative; z-index: 1; }
.wa-wide { width: 100%; justify-content: center; margin-top: 14px; }
.wa-checks, .wa-who { list-style: none; margin: 0; display: flex; flex-direction: column; gap: 10px; font-size: 13px; line-height: 1.5; color: var(--text-2); }
.wa-checks li, .wa-who li { display: flex; gap: 10px; align-items: flex-start; }
.wa-checks .ico { flex: none; width: 18px; height: 18px; color: var(--wa-ink); }
.wa-who .ico { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--wa-ink); }
.wa-who strong { color: var(--text); }
.wa-guide { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.wa-guide .ico { width: 14px; height: 14px; }

/* Admin numbers as chips (the textarea stays the real field) */
.wa-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 38px; padding: 4px 6px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); cursor: text; transition: border-color .12s, box-shadow .12s; }
.wa-chips:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgb(142 153 224 / 20%); }
.wa-chips[aria-invalid='true'] { border-color: var(--danger); }
.wa-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--wa-pill-bg); border: 1px solid var(--wa-hair); color: var(--wa-pill-ink); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.wa-chip button { display: grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: none; color: inherit; cursor: pointer; }
.wa-chip button:hover { background: rgb(0 0 0 / 8%); }
.wa-chip .ico { width: 12px; height: 12px; }
.wa-chips input { flex: 1; min-width: 140px; min-height: 28px; padding: 2px 4px; border: 0 !important; box-shadow: none !important; background: none; }

/* Automations */
.wa-automations { display: flex; flex-direction: column; gap: 16px; }
.wa-event { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; }
.wa-event + .wa-event { border-top: 1px solid var(--border); }
.wa-event-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.wa-event textarea { min-height: 0; }
.wa-event:has(.switch input:not(:checked)) :is(textarea, .wa-ph, .wa-template-ids) { opacity: .55; }
.wa-time { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.wa-time input { width: auto; min-height: 34px; padding: 5px 9px; }
.wa-ph { display: flex; flex-wrap: wrap; gap: 6px; }
.wa-ph button { padding: 4px 9px; border-radius: 999px; border: 1px solid var(--wa-hair); background: var(--wa-card); color: var(--wa-ink); font: 500 11.5px/1.3 ui-monospace, 'SFMono-Regular', Consolas, monospace; cursor: pointer; }
.wa-ph button:hover { border-color: var(--wa-btn-edge); color: var(--wa-accent); }
.wa-template-ids { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; max-width: 560px; margin-top: 4px; }
.wa-template-ids:has(> :only-child) { grid-template-columns: minmax(0, 1fr); max-width: 372px; }
.wa-automations .form-actions { justify-content: flex-start; }

/* Message log */
.wa-log-msg { min-width: 260px; max-width: 520px; }
.wa-log-msg > * { display: block; }
.wa-log-msg .muted { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12.5px; }
.wa-log-msg .text-danger { font-size: 12px; }

@media (max-width: 1280px) { .wa-grid { grid-template-columns: minmax(0, 1fr) 320px; } }
@media (max-width: 980px) { .wa-grid, .wa-providers { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) {
  .wa-providers { grid-template-columns: minmax(0, 1fr); }
  .wa-master { width: 100%; justify-content: space-between; }
  .wa-template-ids { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .wa-provider, .wa-provider-tick, .wa-stats .stat { transition: none; } }
/* end section: whatsapp */

/* ── section: inventory, purchase orders, products ── */
.pre-line { white-space: pre-line; margin: 0; }
.vendor-line { display: block; }

/* Purchase order form */
.po-delivery { display: grid; grid-template-columns: minmax(200px, 280px) minmax(0, 1fr); gap: 12px 20px; align-items: start; }
.po-address { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); max-width: 460px; font-size: 13px; }
.po-address span { color: var(--muted); }
.po-destination { grid-column: 1 / -1; }
.po-destination summary { cursor: pointer; color: var(--brand-ink); font-size: 13px; font-weight: 600; width: max-content; }
.po-destination[open] summary { margin-bottom: 10px; }
.po-destination .field { max-width: 460px; }
.po-lines select[data-tax] { min-width: 170px; }
.po-totals { width: min(380px, 100%); }
.po-discount-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.po-discount { display: inline-flex; gap: 6px; }
.po-discount input { width: 90px; }
.po-discount select { width: 76px; min-height: 32px; }
.po-totals [hidden] { display: none; }
/* Purchase order form: labels beside fields, item pictures, notes + totals and terms + upload side by side */
.pf-rows { display: grid; gap: 10px; }
.pf-row { display: grid; grid-template-columns: 160px minmax(0, 1fr); align-items: start; gap: 6px 16px; }
.pf-row.pf-pair { grid-template-columns: 160px minmax(0, 1fr) 130px minmax(0, 1fr); }
.pf-label { padding-top: 9px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.pf-label.req { color: var(--brand-ink); }
.pf-label.req::after { content: " *"; color: var(--danger); }
.pf-ctl { display: flex; flex-direction: column; gap: 6px; min-width: 0; max-width: 560px; }
.pf-half { max-width: 360px; }
.pf-address { display: flex; flex-direction: column; gap: 2px; max-width: 460px; padding: 12px 14px; border-radius: 12px; background: rgb(255 255 255 / 65%); border: 1px solid #fff; box-shadow: inset 0 0 0 1px rgb(17 20 24 / 6%); font-size: 13px; }
.pf-address span { color: var(--muted); white-space: pre-line; }
.pf-destination summary { width: max-content; cursor: pointer; list-style: none; font-size: 12.5px; font-weight: 700; color: var(--brand); }
.pf-destination summary::-webkit-details-marker { display: none; }
.pf-destination[open] summary { margin-bottom: 6px; }
.pf-item { display: flex; align-items: center; gap: 10px; }
.pf-item select { flex: 1; min-width: 200px; }
.pf-thumb { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 9px; overflow: hidden; background: #fff; box-shadow: inset 0 0 0 1px rgb(17 20 24 / 10%); color: var(--faint); }
.pf-thumb img { width: 100%; height: 100%; object-fit: contain; }
.pf-thumb .ico { width: 16px; height: 16px; }
.pf-lines th { background: rgb(238 247 251 / 45%); }
.pf-remove { color: var(--danger); }
.pf-addrow { padding: 8px 16px 4px; }
.pf-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 12.5px; font-weight: 750; letter-spacing: .03em; text-transform: uppercase; color: var(--brand); cursor: pointer; }
.pf-link:hover { background: var(--brand-soft); }
.pf-link .ico { width: 15px; height: 15px; stroke-width: 2.4; }
.pf-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 24px; align-items: start; padding: 12px 16px 16px; }
.card-body.pf-split { padding: 16px; }
.pf-totals { display: grid; gap: 10px; padding: 14px 16px; border-radius: 14px; background: rgb(238 247 251 / 40%); border: 1px solid #fff; font-size: 13.5px; }
.pf-totals > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pf-totals > div[hidden] { display: none; }
.pf-discount-ctl { display: inline-flex; gap: 6px; margin-left: auto; }
.pf-discount-ctl input { width: 90px; min-height: 34px; }
.pf-discount-ctl select { width: 78px; min-height: 34px; }
.pf-grand { padding-top: 10px; border-top: 1px solid rgb(17 20 24 / 12%); font-size: 18px; font-weight: 750; }
.pf-drop { position: relative; display: grid; place-items: center; min-height: 92px; padding: 12px; border: 1.5px dashed #e7cdc0; border-radius: 14px; background: rgb(255 255 255 / 55%); cursor: pointer; text-align: center; }
.pf-drop:hover, .pf-drop:focus-within { border-color: var(--brand); background: var(--brand-soft); }
.pf-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.pf-drop-text { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; color: var(--brand); overflow-wrap: anywhere; }
.pf-drop-text .ico { width: 17px; height: 17px; }
@media (max-width: 800px) {
  .pf-row, .pf-row.pf-pair, .pf-split { grid-template-columns: minmax(0, 1fr); }
  .pf-label { padding-top: 0; }
}
.attach-list { list-style: none; margin: 0 0 10px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); max-width: 520px; }
.attach-list li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; font-size: 13px; }
.attach-list li + li { border-top: 1px solid var(--border); }
.attach-list li a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-list .ico { width: 14px; height: 14px; color: var(--muted); flex: none; }
.attach-list form { display: contents; }
.attach-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
@media (max-width: 700px) { .po-delivery { grid-template-columns: minmax(0, 1fr); } }

/* Printable purchase order (same layout as the old PO document) */
.po-doc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.po-doc-grid .brand img { height: 36px; margin-bottom: 14px; }
.po-doc-title { font-size: 24px; font-weight: 800; letter-spacing: .02em; }
.po-doc-no { margin: 2px 0 16px; }
.po-h { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }
.po-h-gap { margin-top: 18px; }
.po-status, .po-meta { display: grid; grid-template-columns: 110px auto; gap: 3px 12px; margin: 0 0 14px; }
.po-status dt, .po-meta dt { color: var(--muted); font-size: 11px; }
.po-status dd, .po-meta dd { margin: 0; font-weight: 600; }
.po-item { display: flex; align-items: center; gap: 10px; }
.po-item .thumb { width: 36px; height: 36px; flex: none; }
.po-doc-table th { white-space: nowrap; }
.po-doc-totals { display: flex; justify-content: flex-end; margin-top: 16px; }
.po-doc-totals .totals { margin: 0; padding: 0; }

/* Stock card */
.glance-alert input[type='number'] { width: 80px; font-size: 22px; font-weight: 800; text-align: left; padding-left: 2px; }
.sold-chart { height: 280px; }
.sold-summary { margin: 12px 0 0; font-size: 13px; }
.card-head .segmented a { display: inline-grid; place-items: center; padding: 6px 10px; }
.card-head .segmented .ico { width: 16px; height: 16px; }
/* end section: inventory, purchase orders, products */

/* ── section: email editor ── */
.rte.rte-ready { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; transition: border-color .12s, box-shadow .12s; }
.rte.rte-ready:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgb(142 153 224 / 20%); }
.rte.rte-ready.rte-invalid { border-color: var(--danger); }
.rte-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.rte-toolbar[hidden], .rte-content[hidden] { display: none; }
.rte-btn { width: 30px; height: 30px; display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); cursor: pointer; }
.rte-btn:hover { background: var(--neutral-bg); color: var(--text); }
.rte-btn[aria-pressed='true'] { background: var(--brand-soft); color: var(--brand-ink); }
.rte-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.rte-btn .ico { width: 16px; height: 16px; }
.rte-sep { width: 1px; height: 20px; margin: 0 4px; background: var(--border); }
.rte-content { min-height: 240px; max-height: 520px; overflow-y: auto; padding: 12px 14px; outline: none; }
.rte-prose { line-height: 1.6; color: var(--text); overflow-wrap: anywhere; }
.rte-prose > :first-child { margin-top: 0; }
.rte-prose p { margin: 0 0 .75em; }
.rte-prose h1 { font-size: 22px; font-weight: 700; margin: .7em 0 .4em; }
.rte-prose h2 { font-size: 18px; font-weight: 700; margin: .7em 0 .4em; }
.rte-prose h3 { font-size: 15.5px; font-weight: 700; margin: .7em 0 .4em; }
.rte-prose ul, .rte-prose ol { margin: 0 0 .75em; padding-left: 1.4em; }
.rte-prose ul { list-style: disc; }
.rte-prose ol { list-style: decimal; }
.rte-prose blockquote { margin: 0 0 .75em; padding: 4px 12px; border-left: 3px solid var(--brand-line); color: var(--text-2); }
.rte-prose code { font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace; font-size: .9em; padding: 1px 5px; border-radius: 4px; background: var(--neutral-bg); }
.rte-prose hr { border: 0; border-top: 1px solid var(--border); margin: 1em 0; }
.rte-prose a { color: var(--brand-ink); text-decoration: underline; }
.rte-prose img { max-width: 100%; height: auto; }
.rte-vars { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.rte-var { cursor: pointer; font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace; }
.rte-var:hover { border-color: var(--brand-line); color: var(--brand-ink); }
.rte-var:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.email-meta { display: grid; grid-template-columns: 90px 1fr; gap: 4px 12px; margin: 0 0 14px; }
.email-meta dt { color: var(--muted); font-size: 12px; font-weight: 600; align-self: center; }
.email-meta dd { margin: 0; font-weight: 600; }
.email-preview { padding: 18px 20px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
/* end section: email editor */

/* ── section: list filters ── */
/* Customers filter: a pill in the Orders toolbar, a field box in the Invoices filter form */
.cust-filter { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; min-width: 0; background: var(--surface); border: 1px solid var(--border-strong); }
.cust-filter:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgb(142 153 224 / 20%); }
.cust-filter--chip { display: inline-flex; min-height: 36px; padding: 2px 4px 2px 12px; border-radius: 999px; max-width: 100%; }
.cust-filter--chip.on { background: var(--brand-soft); border-color: var(--brand-line); }
.cust-filter--field { min-height: 38px; padding: 3px 6px 3px 11px; border-radius: var(--radius-sm); }
.cust-input { display: inline-flex; align-items: center; gap: 6px; flex: 1 1 120px; min-width: 110px; }
.cust-input .ico { width: 15px; height: 15px; color: var(--muted); flex: none; }
.cust-filter.on .cust-input .ico { color: var(--brand); }
.cust-input input[type='search'] {
  width: 100%; min-height: 0; height: 30px; padding: 0; border: 0; background: transparent; box-shadow: none;
  font-size: 12.5px; font-weight: 650; color: var(--text-2);
}
.cust-filter--field .cust-input input[type='search'] { font-size: 14px; font-weight: 400; color: var(--text); }
.cust-input input[type='search']:focus { box-shadow: none; }
.cust-input input::placeholder { color: var(--text-2); opacity: 1; }
.cust-filter--field .cust-input input::placeholder { color: var(--faint); }
.cust-chip {
  display: inline-flex; align-items: center; gap: 2px; max-width: 200px; height: 26px; padding: 0 2px 0 9px;
  border: 1px solid var(--brand-line); border-radius: 999px; background: var(--surface);
  color: var(--brand-ink); font-size: 12px; font-weight: 650;
}
.cust-filter--field .cust-chip { background: var(--brand-soft); }
/* Search box: picked customers and the typed text share one line; long names shorten instead of wrapping */
.cust-filter--field { flex-wrap: nowrap; }
.cust-filter--field .cust-chip { flex: 0 1 auto; min-width: 58px; }
.cust-filter--field .cust-input { flex: 1 0 74px; min-width: 74px; }
.cust-filter--field.on .cust-input input::placeholder { color: transparent; }
.cust-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cust-chip-x {
  display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--brand-ink); font-size: 15px; line-height: 1; cursor: pointer;
}
.cust-chip-x .ico { width: 13px; height: 13px; }
.cust-chip-x:hover { background: var(--brand-line); color: var(--text); }
.cust-results {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 280px; max-width: min(360px, 90vw);
  max-height: 300px; overflow-y: auto; margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
}
.cust-option { display: flex; flex-direction: column; gap: 1px; padding: 7px 10px; border-radius: 6px; cursor: pointer; }
.cust-option span { font-size: 13px; font-weight: 600; color: var(--text); }
.cust-option small { font-size: 11.5px; color: var(--muted); }
.cust-option:hover, .cust-option[aria-selected='true'] { background: var(--brand-soft); }
.cust-empty { padding: 8px 10px; font-size: 12.5px; color: var(--muted); }
/* end section: list filters */

/* ---------- Page changes without a reload (public/js/app.js) ---------- */
/* While the next page loads: a thin moving bar along the top and a slightly faded page; shows only after 150ms */
html.is-loading { cursor: progress; }
html.is-loading body::before {
  content: ""; position: fixed; inset: 0 0 auto; z-index: 1000; height: 3px;
  background: linear-gradient(90deg, transparent, var(--brand), transparent) 0 0 / 40% 100% no-repeat;
  opacity: 0; animation: page-load 1s linear .15s infinite;
}
html.is-loading main.content { opacity: .6; transition: opacity .2s .15s; }
@keyframes page-load { from { opacity: 1; background-position: -40% 0; } to { opacity: 1; background-position: 140% 0; } }
@media (prefers-reduced-motion: reduce) { html.is-loading body::before { animation: none; opacity: 1; background: var(--brand); } }

/* ── section: reminders & voice ── */
/* Voice assistant (public/js/voice.js): a robot button in the bottom-right corner opens a dark voice bar at the
   bottom of the screen. Both live outside <body> (page swaps keep them), so they set their own font and colours. */
.vb-launcher {
  position: fixed; right: max(20px, env(safe-area-inset-right, 0px)); bottom: max(20px, env(safe-area-inset-bottom, 0px)); z-index: 900;
  width: 84px; height: 84px; padding: 0; border: 0; background: none; cursor: grab;
  filter: drop-shadow(0 10px 18px rgb(47 33 64 / 22%));
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
/* While being dragged (voice.js): lifted a little higher, with a deeper shadow */
.vb-launcher.vb-dragging { cursor: grabbing; filter: drop-shadow(0 18px 24px rgb(47 33 64 / 32%)); }
.vb-launcher.vb-dragging .vb-robot { transform: scale(1.06); }
/* Soft lilac glow behind the Kitty Bot */
.vb-launcher::before {
  content: ""; position: absolute; inset: 6px 8px 18px; z-index: -1; border-radius: 50%;
  background: radial-gradient(circle, rgb(206 199 237 / 55%), rgb(206 199 237 / 0%) 70%); filter: blur(8px);
}
.vb-launcher[hidden] { display: none; }
.vb-robot { display: block; width: 100%; height: 100%; }
/* The robot floats and gently tilts its head; its shadow on the ground stays still */
.vb-tilt { transform-origin: 60px 84px; animation: vb-float 3.2s ease-in-out infinite, vb-tilt 4s ease-in-out infinite; }
.vb-launcher:hover .vb-tilt { animation-duration: 1.6s, 4s; }
.vb-pulse { animation: vb-pulse 1.8s ease-in-out infinite; }
.vb-launcher:focus-visible { outline: 3px solid rgb(196 108 137 / 60%); outline-offset: 2px; border-radius: 18px; }
.vb-eyes { animation: vb-blink 5s infinite; transform-box: fill-box; transform-origin: center; }
@keyframes vb-float { 50% { transform: translateY(-6px); } }
@keyframes vb-tilt { 0%, 100% { rotate: -6deg; } 50% { rotate: 6deg; } }
@keyframes vb-pulse { 50% { opacity: .45; } }
@keyframes vb-blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.15); } }

/* Voice Mode (30 Oct 2026): one centred rose-lilac glass card. Sound and close sit in the top corners, then a
   big orb, the status and message, the voice / mic / chat buttons and, when open, the typing box.
   Answers (cards, forms, the voice list) open between the message and the buttons. */
.vb-wrap {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom, 0px)); z-index: 900; transform: translateX(-50%);
  width: min(560px, calc(100vw - 32px));
  font: 14px/1.45 var(--font); color: var(--text);
  --vb-glass: rgb(255 255 255 / 80%); --vb-edge: rgb(255 255 255 / 92%); --vb-ink: #3a2a48; --vb-muted: #6f6274;
  --vb-field: rgb(118 118 128 / 12%); --vb-track: rgb(118 118 128 / 12%); --vb-grad: linear-gradient(180deg, #e58fac, #9d8fe0);
  /* the answer cards and their buttons follow the rose-lilac theme */
  --brand: #8a7bd6; --brand-hover: #7b6cc9; --brand-ink: #5a4bb0; --brand-soft: #efeaf9; --brand-line: #e3dcf3;
}
.vb-wrap[hidden] { display: none; }
.vb-bar {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px 18px; border-radius: 28px; text-align: center;
  background: var(--vb-glass); -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6);
  box-shadow: 0 0 0 1px var(--vb-edge), inset 0 1px 0 rgb(255 255 255 / 90%), 0 22px 48px -20px rgb(61 42 79 / 42%);
}
.vb-bar > .vb-mute, .vb-bar > .vb-close { position: absolute; top: 12px; }
.vb-bar > .vb-mute { left: 12px; }
.vb-bar > .vb-close { right: 12px; }
.vb-orb {
  flex: none; width: 96px; height: 96px; margin-top: 2px; border-radius: 50%;
  box-shadow: 0 0 0 4px #fff, 0 0 0 9px rgb(229 143 172 / 18%), 0 14px 30px -8px rgb(157 143 224 / 70%);
}
.vb-text { max-width: 460px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.vb-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #b4466a; }
.vb-status i { width: 7px; height: 7px; border-radius: 50%; background: #e26985; }
.vb-status b { font-weight: 700; }
.vb-bar[data-mode='listening'] .vb-status i { background: #e26956; animation: vb-pulse 1.1s ease-out infinite; }
.vb-bar[data-mode='thinking'] .vb-status i { background: #9d8fe0; }
.vb-bar[data-mode='speaking'] .vb-status i { background: #3aa66a; }
@keyframes vb-pulse { 0% { box-shadow: 0 0 0 0 rgb(226 105 86 / 55%); } 100% { box-shadow: 0 0 0 8px rgb(226 105 86 / 0%); } }
.vb-msg { margin: 0; font-size: 15px; font-weight: 500; color: var(--vb-ink); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
/* The drawer only groups the answer and the typing box; each takes its own place in the card */
.vb-drawer { display: contents; }
.vb-drawer[hidden], .vb-content[hidden], .vb-type[hidden] { display: none; }
.vb-content { order: 1; width: 100%; max-height: min(38vh, 340px); overflow-y: auto; padding: 2px; text-align: left; }
.vb-ctrl { order: 2; width: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; }
.vb-ctrl > .vb-mic { grid-column: 2; }
.vb-ctrl > .vb-chat { grid-column: 3; justify-self: start; }
/* "Answer on my other screen" (testing aid): left of the mic, shown only while another screen is open */
.vb-ctrl > .vb-relay { grid-column: 1; grid-row: 1; justify-self: end; }
.vb-ctrl > .vb-relay[hidden] { display: none; }
.vp-voices { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow-y: auto; }
.vp-voice { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border: 1px solid transparent; border-radius: 10px; background: #f7f4fb; color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.vp-voice:hover { border-color: var(--brand-line); }
.vp-voice.on { border-color: var(--brand); background: var(--brand-soft); font-weight: 650; }
.vp-voice small { font-size: 11px; font-weight: 650; color: var(--muted); }
.vp-voice.on small { color: var(--brand-ink); }
:root[data-theme='dark'] .vp-voice { background: rgb(255 255 255 / 5%); color: var(--vb-ink); }
.vb-type { order: 3; width: 100%; display: flex; align-items: center; gap: 4px; height: 46px; padding: 0 5px 0 16px; border-radius: 14px; background: var(--vb-field); text-align: left; }
.vb-type input { flex: 1; min-width: 0; min-height: 0; height: 100%; padding: 0; border: 0; background: none; color: var(--vb-ink); font-size: 14px; }
.vb-type input::placeholder { color: rgb(77 63 85 / 50%); }
.vb-type input:focus { box-shadow: none; outline: none; }
.vb-type:focus-within { box-shadow: 0 0 0 1.5px #c9bff0, 0 0 0 5px rgb(157 143 224 / 16%); }
.vb-type .vb-icon { color: #8a7bd6; }
.vb-icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--vb-muted); cursor: pointer; }
.vb-icon:hover { background: var(--vb-track); color: var(--vb-ink); }
/* Lavender Mist buttons: a light pastel mic with a dark plum icon (rose while listening) and an icon-only chat ring */
.vb-ctrl > .vb-chat, .vb-ctrl > .vb-relay { width: 40px; height: 40px; background: none; color: var(--vb-muted); box-shadow: inset 0 0 0 1px #e6dfee; }
.vb-ctrl > .vb-chat:hover, .vb-ctrl > .vb-relay:hover { background: var(--vb-track); color: var(--vb-ink); }
.vb-icon[aria-pressed='true'], .vb-ctrl > .vb-chat[aria-pressed='true'] { background: #efeaf9; color: #5a4bb0; box-shadow: inset 0 0 0 1px #ddd4f3; }
.vb-icon .ico { width: 18px; height: 18px; }
.vb-mic {
  flex: none; display: grid; place-items: center; width: 60px; height: 60px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: linear-gradient(160deg, #f8d6e2, #d8cff7); color: #3a2a48;
  box-shadow: inset 0 1px 0 #fff, 0 8px 18px -10px rgb(157 143 224 / 80%);
}
.vb-mic .ico { width: 26px; height: 26px; }
.vb-mic:hover { filter: brightness(1.02) saturate(1.15); }
.vb-bar[data-mode='listening'] .vb-mic { background: linear-gradient(160deg, #fbc6d4, #f19ab3); color: #8e2a4f; box-shadow: inset 0 1px 0 #fff, 0 0 0 6px rgb(229 143 172 / 18%); }
.vb-wrap button:focus-visible { outline: 2px solid #8a7bd6; outline-offset: 2px; }
/* Answers in the panel above the bar: confirm forms, help, notes */
.vb-content p { margin: 0; }
.vp-ok { color: var(--success); font-weight: 600; }
.vp-note { color: #4d3f55; font-size: 13px; }
.vp-link { padding: 0; border: 0; background: none; color: var(--brand-ink); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.vp-open { align-self: flex-start; padding: 7px 14px; border: 1px solid var(--brand-line); border-radius: 999px; background: #fff; color: var(--brand-ink); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
.vp-open:hover { background: var(--brand-soft); border-color: var(--brand); }
.vp-card { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 1px var(--brand-line); }
.vp-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.vp-card-head b { font-size: 14px; font-weight: 750; color: var(--brand-ink); }
.vp-card-head span { font-size: 12px; color: var(--muted); }
.vp-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #4d3f55; }
.vp-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.vp-do { background: var(--brand-soft); border-color: var(--brand-line); }
.vp-related { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding-top: 8px; border-top: 1px solid #eee8f3; }
.vp-related span { width: 100%; font-size: 10.5px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.vp-related button { padding: 4px 10px; border: 1px solid var(--brand-line); border-radius: 999px; background: #fff; color: #4d3f55; font: inherit; font-size: 12px; cursor: pointer; }
.vp-related button:hover { background: var(--brand-soft); color: var(--brand-ink); }
:root[data-theme='dark'] .vp-steps { color: var(--vb-ink); }
:root[data-theme='dark'] .vp-related button { background: rgb(255 255 255 / 6%); color: var(--vb-ink); border-color: rgb(255 255 255 / 12%); }
.vp-rows { display: flex; flex-direction: column; margin: 0; }
.vp-rows div { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; border-top: 1px solid #eee8f3; font-size: 13px; }
.vp-rows div:first-child { border-top: 0; }
.vp-rows dt { color: #4d3f55; min-width: 0; }
.vp-rows dd { margin: 0; font-weight: 700; color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
:root[data-theme='dark'] .vp-card { background: rgb(255 255 255 / 5%); }
:root[data-theme='dark'] .vp-rows div { border-top-color: rgb(255 255 255 / 8%); }
:root[data-theme='dark'] .vp-rows dt, :root[data-theme='dark'] .vp-rows dd { color: var(--vb-ink); }
.vb-content .vp-help p { margin-top: 2px; }
.vp-confirm { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 14px; background: rgb(239 234 249 / 60%); box-shadow: inset 0 0 0 1px var(--brand-line); }
/* Two questions asked together: one card under the other */
.vb-content > .vp-card + .vp-card { margin-top: 8px; }
/* A walk-in order to confirm: quantity, product, price (can be changed), line total */
.vp-lines { width: 100%; border-collapse: collapse; font-size: 13px; }
.vp-lines td { padding: 5px 4px; border-top: 1px solid #eee8f3; vertical-align: middle; }
.vp-lines tbody tr:first-child td { border-top: 0; }
.vp-lines td:first-child { white-space: nowrap; color: var(--muted); }
.vp-lines td:last-child { text-align: right; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.vp-confirm .vp-lines input { width: 76px; min-height: 30px; padding: 3px 8px; border-radius: 8px; text-align: right; font-size: 13px; }
.vp-confirm .vp-lines input:placeholder-shown { box-shadow: 0 0 0 2px rgb(229 143 172 / 45%); }
.vp-lines tfoot td { border-top: 1px solid var(--brand-line); font-weight: 750; color: var(--brand-ink); }
/* A report opened out of sight to print as PDF (voice assistant) */
iframe.vb-print { position: fixed; right: 0; bottom: 0; width: 1px; height: 1px; border: 0; opacity: 0; pointer-events: none; }
.vp-confirm label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 650; color: #4d3f55; }
.vp-confirm input { min-height: 38px; border-color: var(--brand-line); background: #fff; color: var(--vb-ink); font-size: 14px; }
.vp-actions { display: flex; gap: 8px; }
.vp-actions .btn-primary { border-color: transparent; background: var(--brand); color: #fff; }
.vp-actions .btn-primary:hover { background: var(--brand-hover); color: #fff; }
.vp-actions .btn-ghost { color: #4d3f55; }
.vp-help { display: flex; flex-direction: column; gap: 10px; font-size: 12.5px; }
.vp-help > div { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.vp-help b { width: 100%; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--vb-muted); }
.vp-help button { padding: 5px 11px; border: 1px solid var(--brand-line); border-radius: 999px; background: #fff; font: inherit; color: #4d3f55; cursor: pointer; }
.vp-help button:hover { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); }
/* Dark theme: the same bar as smoked glass */
:root[data-theme='dark'] .vb-wrap { --vb-glass: rgb(36 27 44 / 90%); --vb-edge: rgb(255 255 255 / 9%); --vb-ink: #f3ecf7; --vb-muted: #c3b5cc; --vb-field: rgb(255 255 255 / 8%); --vb-track: rgb(255 255 255 / 10%); }
:root[data-theme='dark'] .vb-status { color: #f3a9c2; }
:root[data-theme='dark'] .vb-icon:hover { background: rgb(255 255 255 / 8%); }
:root[data-theme='dark'] .vb-ctrl > .vb-chat { box-shadow: inset 0 0 0 1px rgb(255 255 255 / 16%); }
:root[data-theme='dark'] .vb-ctrl > .vb-chat[aria-pressed='true'] { background: rgb(255 255 255 / 16%); color: #fff; box-shadow: none; }
:root[data-theme='dark'] .vp-confirm { background: rgb(255 255 255 / 5%); }
:root[data-theme='dark'] .vp-confirm input, :root[data-theme='dark'] .vp-help button { background: rgb(255 255 255 / 6%); border-color: rgb(255 255 255 / 12%); }
:root[data-theme='dark'] .vb-orb { box-shadow: 0 0 0 4px rgb(255 255 255 / 10%), 0 0 0 9px rgb(229 143 172 / 12%), 0 14px 30px -8px rgb(0 0 0 / 55%); }
@media (max-width: 560px) {
  .vb-bar { gap: 10px; padding: 14px 12px; }
  .vb-orb { width: 72px; height: 72px; }
  .vb-msg { font-size: 14px; }
  .vb-ctrl { gap: 12px; }
  .vb-launcher { width: 64px; height: 64px; }
}
@media (prefers-reduced-motion: reduce) { .vb-robot, .vb-tilt, .vb-pulse, .vb-eyes, .vb-bar[data-mode='listening'] .vb-status i { animation: none; } }
/* Due reminders: cards in the bottom-right corner of any page */
.rem-toasts { position: fixed; right: 16px; bottom: 116px; z-index: 950; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); font: 14px/1.4 var(--font); }
.rem-toast {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; padding: 14px; color: var(--text);
  background: rgb(255 254 253 / 97%); border: 1px solid var(--brand-line); border-radius: 16px; box-shadow: 0 18px 40px -12px rgb(17 20 24 / 35%);
}
.rt-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); grid-row: span 2; }
.rt-text { display: flex; flex-direction: column; min-width: 0; }
.rt-text small { font-size: 11px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; color: var(--brand-ink); }
.rt-text strong { overflow-wrap: anywhere; }
.rt-actions { display: flex; align-items: center; gap: 6px; }
.rt-actions .icon-btn { margin-left: auto; }
:root[data-theme='dark'] .rem-toast { background: rgb(17 20 24 / 96%); border-color: var(--border); }
/* Reminders page */
.rem-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; align-items: start; }
.rem-list { list-style: none; margin: 0; padding: 0; }
.rem-list li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); }
.rem-list li:first-child { border-top: 0; }
.rem-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.rem-text small { color: var(--muted); font-size: 12px; }
.rem-actions { display: flex; align-items: center; gap: 6px; }
.rem-due .card-head h2 .ico { color: var(--danger); }
.rem-done .rem-text strong { color: var(--muted); text-decoration: line-through; font-weight: 500; }
.rem-grid .empty-note { margin: 0; padding: 14px 16px; text-align: left; font-size: 13px; }
@media (max-width: 1000px) { .rem-grid { grid-template-columns: minmax(0, 1fr); } }
/* end section: reminders & voice */

/* ── section: settings fixes (30 Oct 2026) ── */
/* Room under the last row and the form buttons, so the assistant robot (fixed bottom-right, 84px) never sits on
   top of a Save button once the page is scrolled to the end */
body:not(.modal-page) main.content { padding-bottom: 112px; }
@media (max-width: 760px) { body:not(.modal-page) main.content { padding-bottom: 96px; } }

/* Wide tables that scroll sideways fade at the edge that has more columns (app.js sets data-more) */
.table-wrap[data-more='right'] {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent);
}
.table-wrap[data-more='left'] {
  -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 44px), transparent);
  mask-image: linear-gradient(to left, #000 calc(100% - 44px), transparent);
}
.table-wrap[data-more='left right'] {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 44px, #000 calc(100% - 44px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 44px, #000 calc(100% - 44px), transparent);
}

/* An error shown inside a form popup (views/errors/error.ejs) */
.modal-error .card-body { text-align: center; padding: 28px 24px 8px; }
.modal-error .error-code { margin: 0; font-size: 32px; font-weight: 800; color: var(--brand); }
.modal-error h1 { margin: 4px 0 6px; font-size: 20px; }
.modal-error .form-actions { justify-content: center; }
/* end section: settings fixes */

/* ── section: form popup title (30 Oct 2026) ── */
/* app.js moves everything under the popup's title into .modal-scroll: the title stays fixed on the popup's own
   glass (no band of its own) and only the fields scroll, cut off cleanly under it */
.modal-page main.content.has-head { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.modal-page main.content.has-head > .page-head {
  position: static; flex: none; margin: 0; padding: 14px 64px 10px 20px;
  background: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  transition: box-shadow .15s;
}
.modal-page main.content.has-head.scrolled > .page-head { box-shadow: 0 1px 0 rgb(61 42 79 / 9%); }
:root[data-theme='dark'] .modal-page main.content.has-head.scrolled > .page-head { box-shadow: 0 1px 0 rgb(255 255 255 / 9%); }
.modal-page .modal-scroll {
  flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 2px 20px 0;
  scrollbar-width: none;
}
.modal-page .modal-scroll::-webkit-scrollbar { display: none; }
/* A form clicked a moment before it finished loading opens as soon as it's ready: busy cursor meanwhile */
html.popup-opening, html.popup-opening * { cursor: progress !important; }
/* end section: form popup title */

/* WhatsApp's "Same as phone" tick box sits on the label row (5 Nov 2026); while ticked the box shows the phone
   number, greyed, and can't be typed in */
.field-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 18px; min-width: 0; }
.field-head > label { flex: none; }
.field-head .check { flex: none; gap: 6px; font-size: 12px; font-weight: 500; color: var(--muted); }
.field-head .check input { width: 14px; height: 14px; margin: 0; }
/* Line under a box (Phone: "Finds saved customers", then the customer it found; WhatsApp: "Same as phone"),
   one line each so the two boxes and their lines stay level */
.field-foot { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 18px; }
.field-foot .check { flex: none; gap: 6px; font-size: 12px; font-weight: 500; color: var(--muted); }
.field-foot .check input { width: 14px; height: 14px; margin: 0; }
.field-note { min-width: 0; overflow: hidden; font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; text-overflow: ellipsis; }
.field-note.found { color: #3f7a52; }

/* Phone / WhatsApp: one box holding the country code dropdown and the number, split by a short line (5 Nov 2026).
   The list shows "Country  +code"; the closed box only the code. Where customizable selects aren't supported the
   plain list is used. */
.tel-group {
  display: flex; align-items: center; min-width: 0; min-height: 38px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface);
  transition: border-color .12s, box-shadow .12s, background-color .12s;
}
.tel-group:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgb(142 153 224 / 20%); }
.tel-group:has([aria-invalid='true']) { border-color: var(--danger); }
.tel-group > :is(input, select) { min-height: 36px; border: 0; border-radius: 0; background-color: transparent; box-shadow: none; }
.tel-group > :is(input, select):focus { border: 0; box-shadow: none; }
.tel-group > input {
  flex: 1; min-width: 0; padding-left: 12px;
  background-image: linear-gradient(rgb(61 42 79 / 14%), rgb(61 42 79 / 14%));
  background-size: 1px 20px; background-position: left center; background-repeat: no-repeat;
}
.tel-group > .cc-select { flex: none; width: 82px; padding: 0 22px 0 12px; background-position: right 6px center; font-variant-numeric: tabular-nums; }
.tel-group > .cc-select:focus-visible { outline: none; }
/* WhatsApp while "Same as phone" is ticked: the copied code and number in grey */
.tel-group:has(input[readonly]) { cursor: default; }
.tel-group > input[readonly], .tel-group > .cc-select:disabled { color: var(--muted); cursor: default; opacity: 1; }
.cc-select selectedcontent .cc-name { display: none; }
.cc-select::picker(select) { min-inline-size: 280px; }
/* Options are in normal case (the group headings' capitals don't carry over), names fill the row and codes line up
   on the right; the picked row is shown by its colour, so no tick */
.cc-select option { font-size: 14px; font-weight: 500; letter-spacing: normal; text-transform: none; }
.cc-select option .cc-name { flex: 1; min-width: 0; }
.cc-select option .cc-code { padding-left: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cc-select option::checkmark { display: none; }

/* Order form "Other info" card (5 Nov 2026): three fields to a row and Notes across the bottom; two to a row on
   tablets and one on phones */
.form-grid.other-info { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.other-info > .field.full { grid-column: 1 / -1; }
@media (max-width: 1000px) { .form-grid.other-info { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .form-grid.other-info { grid-template-columns: 1fr; } }

/* Billing address while "Use as billing address" is ticked: a locked copy of the shipping address */
[data-billing-block].is-copied [data-saved-wrap] { display: none; }
[data-billing-block].is-copied [data-addr-field] { background: var(--surface-2, #f7f5f9); cursor: default; opacity: 1; color: var(--text); }

/* ---------- Order form: item rows (views/orders/_line.ejs) and the product picker (public/js/product-picker.js) ---------- */
.order-lines { table-layout: fixed; min-width: 720px; }
.order-lines col.c-qty { width: 96px; }
.order-lines col.c-money { width: 124px; }
.order-lines col.c-amount { width: 116px; }
.order-lines col.c-remove { width: 52px; }
.order-lines th, .order-lines td { padding-left: 8px; padding-right: 8px; }
.order-lines th:first-child, .order-lines td:first-child { padding-left: 16px; }
.order-lines th:last-child, .order-lines td:last-child { padding-right: 12px; }
.order-lines td { padding-top: 10px; padding-bottom: 10px; vertical-align: top; }
.order-lines .qty, .order-lines .money { width: 100%; text-align: right; font-variant-numeric: tabular-nums; }
.order-lines input, .order-lines .pp-btn { min-height: 40px; }
.order-lines .line-amount { line-height: 40px; font-size: 14.5px; }
.order-lines .actions-col { width: auto; }
.order-lines .actions-col .icon-btn { margin-top: 2px; }
.order-lines tbody tr:hover { background: none; }
.order-lines .line-product .help { display: block; margin-top: 5px; }
.order-form .totals { align-items: center; width: min(340px, 100%); padding: 16px 64px 16px 16px; }
.order-form .totals input { font-variant-numeric: tabular-nums; }

/* The picker button looks like the other fields; long names wrap to two lines */
.pp-native { display: none !important; }
.pp-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 11px; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color .12s, box-shadow .12s; font-weight: 500; line-height: 1.35;
}
:root:not([data-theme='dark']) form.stack .card .pp-btn { background-color: rgb(255 255 255 / 70%); }
.pp-btn:hover { border-color: var(--brand); }
.pp-btn:focus-visible, .pp-btn[aria-expanded='true'] { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgb(142 153 224 / 20%); }
.pp-btn .pp-name { flex: 1; min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pp-btn.is-empty .pp-name { color: var(--muted); font-weight: 400; }
.pp-btn svg { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.pp-btn[aria-expanded='true'] svg { transform: rotate(180deg); }

/* The panel: search box on top, the products below, same frosted glass as the other dropdowns */
.pp-pop {
  position: fixed; z-index: 90; display: flex; flex-direction: column; max-height: min(360px, 60vh); padding: 6px;
  border: 1px solid #fff; border-radius: 14px; color: var(--text); font-size: 14px;
  background: rgb(255 255 255 / 94%); -webkit-backdrop-filter: blur(20px) saturate(1.5); backdrop-filter: blur(20px) saturate(1.5);
  box-shadow: 0 18px 40px -10px rgb(17 20 24 / 28%), inset 0 1px 0 #fff;
}
.pp-pop[hidden] { display: none; }
.pp-search { position: relative; display: block; margin-bottom: 6px; }
.pp-search svg { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.pp-pop .pp-search input { min-height: 38px; padding-left: 34px; background: var(--surface); }
.pp-list { margin: 0; padding: 0; list-style: none; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgb(142 153 224 / 35%) transparent; }
.pp-list li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; font-weight: 500; line-height: 1.35; cursor: pointer; }
.pp-list li:hover, .pp-list li.on { background: rgb(238 247 251 / 70%); }
.pp-list li[aria-selected='true'] { background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; }
.pp-list li[aria-selected='true']::after { content: "✓"; margin-left: auto; padding-left: 8px; color: var(--brand); font-weight: 800; }
.pp-list .pp-empty { color: var(--muted); font-size: 13px; cursor: default; }
.pp-list .pp-empty:hover { background: none; }
:root[data-theme='dark'] .pp-pop { border-color: var(--border); background: rgb(17 20 24 / 96%); box-shadow: 0 18px 40px -10px rgb(0 0 0 / 60%); }
:root[data-theme='dark'] .pp-list li:hover, :root[data-theme='dark'] .pp-list li.on { background: rgb(255 255 255 / 7%); }

/* Phones: each item is a small card: the product on top, then quantity, rate and tax, then the amount */
@media (max-width: 700px) {
  .order-lines, .order-lines tbody { display: block; min-width: 0; }
  .order-lines colgroup, .order-lines thead { display: none; }
  .order-lines tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
  .order-lines td, .order-lines th:first-child, .order-lines td:first-child, .order-lines td:last-child { display: block; padding: 0; border: 0; }
  .order-lines td.line-product { grid-column: 1 / -1; }
  .order-lines td[data-label]:not(.line-product)::before {
    content: attr(data-label); display: block; margin-bottom: 4px; text-align: left;
    font-size: 11px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
  }
  .order-lines td.line-amount { grid-column: 1 / 3; display: flex; align-items: baseline; gap: 8px; line-height: 1.4; font-size: 15px; }
  .order-lines td.line-amount::before { margin: 0; }
  .order-lines td.actions-col { grid-column: 3; text-align: right; }
  .order-form .totals { padding: 16px; }
}

/* "Choose 3 products" box under a pick-your-own bundle (public/js/product-picker.js) */
.bp { margin-top: 8px; padding: 10px 12px; border: 1px dashed var(--border-strong); border-radius: 12px; background: rgb(255 255 255 / 40%); }
.bp[hidden] { display: none; }
.bp-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 8px; }
.bp-title { font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
.bp-status { font-size: 12.5px; font-weight: 600; }
.bp-status.is-warn { color: #b7791f; }
.bp-status.is-ok { color: #2f855a; }
.bp-status.is-bad { color: #c53030; }
.bp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bp-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 4px 4px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); font-size: 13px; font-weight: 600; }
.bp-chip-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 300px; }
.bp-chip b { font-weight: 800; }
.bp-chip button { display: grid; place-items: center; width: 22px; height: 22px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 16px; line-height: 1; cursor: pointer; }
.bp-chip button:hover { background: rgb(0 0 0 / 8%); }
.bp-add { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; }
.bp-add:hover, .bp-add[aria-expanded='true'] { border-color: var(--brand); color: var(--brand-ink); }
.bp-add svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }

/* The checkbox list */
.bp-pop { max-height: min(460px, 70vh); }
.bp-pop-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; padding: 6px 6px 8px; }
.bp-pop-head strong { font-size: 14px; }
.bp-pop-foot { display: flex; justify-content: flex-end; padding: 8px 4px 2px; border-top: 1px solid var(--border); margin-top: 6px; }
.bp-list li { gap: 12px; }
.bp-list li[aria-selected='true']::after { content: none; }
.bp-list li[aria-disabled='true'] { opacity: .45; cursor: not-allowed; }
.bp-list li[aria-disabled='true']:hover { background: none; }
.bp-name { flex: 1; min-width: 0; }
.bp-box { flex: none; width: 18px; height: 18px; border: 2px solid var(--border-strong); border-radius: 5px; background: var(--surface); }
.bp-list li[aria-selected='true'] .bp-box { border-color: var(--brand); background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center / 12px no-repeat; }
.bp-step { flex: none; display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 999px; background: var(--surface); box-shadow: 0 0 0 1px var(--border-strong); color: var(--text); }
.bp-step b { min-width: 18px; text-align: center; font-size: 13px; }
.bp-step button { display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 50%; background: none; color: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.bp-step button:hover:not(:disabled) { background: var(--brand-soft); color: var(--brand-ink); }
.bp-step button:disabled { opacity: .35; cursor: not-allowed; }
:root[data-theme='dark'] .bp { background: rgb(255 255 255 / 3%); }
:root[data-theme='dark'] .bp-status.is-warn { color: #f6c26b; }
:root[data-theme='dark'] .bp-status.is-ok { color: #7fd6a0; }
:root[data-theme='dark'] .bp-status.is-bad { color: #f39a9a; }
@media (max-width: 700px) { .bp-chip-name { max-width: 200px; } }

/* Inventory list: the Low Stock Alert value with its edit button, and the "Set Reorder Level" popup */
.reorder-cell { display: inline-flex; align-items: center; gap: 6px; }
.reorder-val { min-width: 34px; font-weight: 650; font-variant-numeric: tabular-nums; }
.reorder-val.is-unset { color: var(--muted); font-weight: 400; }
.reorder-edit { width: 30px; height: 30px; color: var(--muted); }
.reorder-edit .ico { width: 15px; height: 15px; }
.reorder-edit:hover { background: var(--brand-soft); color: var(--brand-ink); }
.reorder-dlg {
  width: min(440px, calc(100vw - 32px)); max-width: none; margin: auto; padding: 0; overflow: hidden;
  border: 0; border-radius: 22px; background: var(--surface); color: var(--text);
  box-shadow: 0 0 0 1px var(--border), 0 24px 48px -16px rgb(17 20 24 / 40%);
}
.reorder-dlg[open] { animation: confirm-pop .35s cubic-bezier(.2, .9, .25, 1.12); }
.reorder-dlg::backdrop { background: rgb(17 20 24 / 30%); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: confirm-fade .25s; }
.rd-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 16px 20px; background: var(--brand-soft); }
.rd-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--surface); color: var(--brand-ink); box-shadow: 0 0 0 1.5px var(--brand-line); }
.rd-icon .ico { width: 19px; height: 19px; }
.rd-titles { flex: 1; min-width: 0; }
.rd-titles h2 { margin: 0; font-size: 16px; font-weight: 750; letter-spacing: -.01em; }
.rd-item { margin: 2px 0 0; font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-sku { color: var(--muted); font-size: 12px; }
.rd-close { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.rd-close:hover { background: var(--surface); color: var(--text); }
.rd-close .ico { width: 17px; height: 17px; }
.rd-body { padding: 18px 20px 4px; }
.rd-body input[type='number'] { font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }
.rd-help { margin: 10px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.rd-help b { color: var(--text); }
.rd-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 20px 20px; }
.rd-actions .btn { min-width: 96px; justify-content: center; }
@media (prefers-reduced-motion: reduce) { .reorder-dlg[open], .reorder-dlg::backdrop { animation: none; } }
:root:not([data-theme='dark']) .reorder-dlg { background: #fffdfe; box-shadow: 0 0 0 1px #f1e3ee, 0 24px 48px -16px rgb(61 42 79 / 40%); }
:root:not([data-theme='dark']) .reorder-dlg::backdrop { background: rgb(58 42 72 / 24%); }
