/* ============================================================
   Brand Foundry Manufacturing — Inventory System
   Design System: Dark Navy + Gold
   ============================================================ */

:root {
  /* v2.17 — Night mode is BRAND-dark: warm maroon-charcoal surfaces (was navy)
     so the dark theme carries the same maroon + gold identity as the light
     theme. These values only show in night mode — body.theme-light overrides
     every one of them, so the light look is untouched. */
  /* v2.17 — refined night surfaces: warmer mahogany, slightly desaturated (less
     harsh blood-red), with a clearer page→card→elevated step so cards gently
     lift off the background instead of blending into one flat wine wash. */
  --navy-900: #1F1F23;   /* page background */
  --navy-800: #28282D;   /* cards (noticeably lifted for separation) */
  --navy-700: #323238;   /* elevated / hover */
  --navy-600: #3E3E45;   /* rows / dividers */
  --navy-500: #606069;   /* borders (lifted so card edges read on dark) */
  --navy-400: #72727C;   /* muted lines */

  --gold-600: #9A7B1E;
  --gold-500: #C0912F;
  --gold-400: #D6AC4E;
  --gold-300: #E8CE8A;

  /* Maroon — primary brand action color (pairs with gold accent) */
  --maroon-700: #5C1420;
  --maroon-600: #7C1D2A;
  --maroon-500: #9A2C3A;
  --maroon-tint: rgba(154, 44, 58, 0.16);

  /* v2.17 — Night-mode text is WARM neutral gray (was cool blue-gray) so labels
     and muted copy read clearly on the maroon-charcoal surfaces. The muted stops
     are brightened for contrast. body.theme-light overrides all of these, so the
     light theme is untouched. */
  --text-100: #F6F1F3;
  --text-200: #E2D9DE;
  --text-300: #CBC1C7;
  --text-400: #B2A7AE;
  --text-500: #9B8F96;
  --text-700: #7C6F76;
  --text-900: #574C52;

  --success: #10B981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --warning: #F59E0B;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --danger: #EF4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --info: #3B82F6;
  --info-bg: rgba(59, 130, 246, 0.12);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;

  --sidebar-w: 248px;
  --topbar-h: 68px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;
  /* Display serif for brand moments (login hero) — matches the company profile
     deck. The fallbacks are real serifs so a blocked/offline Google Fonts still
     renders in the right voice rather than dropping to the sans. */
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;

  --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Light theme overrides ---------- */
body.theme-light {
  --navy-900: #ECE3DA;
  --navy-800: #F4EDE4;
  --navy-700: #FFFFFF;
  --navy-600: #F1E7E7;
  --navy-500: #D9CEC4;
  --navy-400: #C3B7AB;
  --maroon-tint: #F6E7E9;
  --text-100: #221A1C;
  --text-200: #3F3437;
  --text-300: #594E51;
  --text-400: #6E6164;
  --text-500: #897C7E;
  --text-700: #4E4346;
  --text-900: #1A1416;
  --shadow-sm: 0 1px 3px rgba(60, 28, 20, 0.10);
  --shadow-md: 0 6px 18px rgba(60, 28, 20, 0.13);
  --shadow-lg: 0 16px 40px rgba(60, 28, 20, 0.17);
}
/* Lift cards/windows off the page for clearer separation in the light theme. */
body.theme-light .card,
body.theme-light .kpi { box-shadow: var(--shadow-sm); }
body.theme-light .topbar { backdrop-filter: blur(8px); background: rgba(255, 255, 255, 0.85); }
body.theme-light .brand-mark,
body.theme-light .user-avatar,
body.theme-light .login-brand-mark {
  /* keep gold */
}
/* LOGIN PHOTO BG — light theme: cream wash + diagonal readability layer
   The actual photo layer is on .login-shell::after (defined further down). */
body.theme-light .login-shell {
  background-color: #F5F7FA;
}
body.theme-light .login-shell::before {
  background-image: none;
  background:
    linear-gradient(180deg,
      rgba(245, 247, 250, 0.55) 0%,
      rgba(245, 247, 250, 0)    18%,
      rgba(245, 247, 250, 0)    82%,
      rgba(245, 247, 250, 0.65) 100%),
    linear-gradient(135deg,
      rgba(245, 247, 250, 0.55) 0%,
      rgba(245, 247, 250, 0.35) 50%,
      rgba(248, 244, 236, 0.45) 100%);
  mask-image: none;
  background-size: auto;
}
body.theme-light .kpi:hover { box-shadow: 0 6px 18px rgba(212, 175, 55, 0.15); }
body.theme-light table.data tbody tr:hover { background: #FAF6E8; }
body.theme-light .channel-tiktok { background: rgba(15, 26, 46, 0.08); color: #0F1A2E; }
body.theme-light input[type="date"] { color-scheme: light; }
/* Night mode renders native form controls (date pickers, selects) dark. */
body:not(.theme-light) input[type="date"] { color-scheme: dark; }

/* ---------- v2.17 — Night / Light theme switch (topbar) ----------
   Branded pill: maroon-tinted track, gold gradient knob, sun ↔ moon ends.
   aria-checked="true" = night mode (knob slides to the moon). */
.theme-switch {
  position: relative;
  width: 50px; height: 26px; flex: 0 0 auto;
  padding: 0;
  border-radius: 999px;
  background: var(--maroon-tint);
  border: 1px solid var(--navy-500);
  cursor: pointer;
  transition: var(--transition);
}
.theme-switch:hover { border-color: var(--gold-500); }
.theme-switch:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 2px; }
.theme-switch .ts-icon {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 13px; height: 13px; pointer-events: none;
}
.theme-switch .ts-sun  { left: 6px;  color: var(--gold-500); }
.theme-switch .ts-moon { right: 6px; color: var(--text-400); }
.theme-switch .ts-knob {
  position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-300), var(--gold-500));
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.theme-switch[aria-checked="true"] .ts-knob { transform: translateX(24px); }

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
/* The HTML5 hidden attribute must win over our display:grid/flex layouts */
[hidden] { display: none !important; }
body {
  font-family: var(--font-sans);
  background: var(--navy-800);
  color: var(--text-100);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
img, svg { display: block; max-width: 100%; }

/* ---------- App Layout ---------- */
#app {
  display: block;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--navy-700);
  border-right: 1px solid var(--navy-500);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  /* overflow: visible so the .sidebar-collapse-btn (right: -10px) shows. The
     actual scrolling happens on .nav (the middle region); .brand sits above,
     .sidebar-footer below — both pinned naturally by flex layout. */
  overflow: visible;
  /* Stop scroll chaining: wheel events inside the sidebar shouldn't bubble to the page. */
  overscroll-behavior: contain;
}
/* The nav is the only scrollable region. .brand sits above (pinned), footer sits below (pinned). */
.nav {
  flex: 1 1 auto;
  min-height: 0;             /* required so flex child can shrink + scroll */
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  /* No visible scrollbar. The nav list is taller than most viewports so it must
     still scroll (wheel / trackpad / touch, and the collapsible groups let you
     shorten it) — but the track was drawing a hard line down the rail. */
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* legacy Edge */
}
.nav::-webkit-scrollbar { width: 0; height: 0; }
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--navy-500); border-radius: 3px; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 24px;
  border-bottom: 1px solid var(--navy-500);
}
.brand-mark {
  width: 42px;
  height: 42px;
  background: transparent;
  display: block;
  overflow: visible;
}
.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.brand-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-100);
  line-height: 1.2;
}
.brand-sub {
  font-size: 11px;
  color: var(--gold-500);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 2px;
  font-weight: 500;
}

.nav { padding: 16px 12px; flex: 1; }
.nav-section { margin-bottom: 20px; }
.nav-label {
  font-size: 10px;
  color: var(--text-500);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  padding: 0 12px 8px;
}
/* v2.15 — collapsible "More" nav group */
.nav-more-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.nav-more-toggle:hover { color: var(--maroon-600); }
.nav-more-chevron { opacity: 0.6; flex-shrink: 0; transition: transform 0.2s ease; }
.nav-section--more.is-open .nav-more-chevron { transform: rotate(180deg); }
.nav-more-items { overflow: hidden; max-height: 0; transition: max-height 0.28s ease; }
.nav-section--more.is-open .nav-more-items { max-height: 680px; }

/* Home sits alone above the grouped sections, closed off by a hairline so it
   reads as its own thing rather than the first item of Overview. */
.nav-section--solo {
  margin-bottom: 14px; padding-bottom: 12px;
  border-bottom: 1px solid rgba(192, 145, 47, .18);
}

/* v2.17 — collapsible primary nav groups (Inventory / Finance / Operations).
   These start EXPANDED (unlike "More"), so the collapsed state is the modifier.
   The chevron points down when open and rotates to point right when collapsed. */
.nav-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.nav-group-toggle:hover { color: var(--maroon-600); }
.nav-group-chevron { opacity: 0.55; flex-shrink: 0; transition: transform 0.2s ease; }
.nav-section.is-collapsed .nav-group-chevron { transform: rotate(-90deg); }
.nav-group-items { overflow: hidden; max-height: 900px; transition: max-height 0.28s ease; }
.nav-section.is-collapsed .nav-group-items { max-height: 0; }
/* A collapsed group shouldn't keep the full open-section gap below it. */
.nav-section.is-collapsed { margin-bottom: 10px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-300);
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 2px;
  position: relative;
}
.nav-link:hover {
  background: var(--navy-600);
  color: var(--text-100);
}
.nav-link.active {
  background: var(--maroon-tint);
  color: var(--maroon-600);
  font-weight: 600;
}
.nav-link.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 22px;
  background: var(--gold-500);
  border-radius: 0 3px 3px 0;
}
.nav-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex-shrink: 0;
  opacity: 0.85;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--navy-500);
}
.sidebar-version {
  font-size: 11px;
  color: var(--text-500);
  font-family: var(--font-mono);
}

/* ---------- Maroon sidebar accents (v2.16) ----------
   Text, active-tab and control refinements that sit on top of the MAROON RAIL
   panel (defined lower in this file). Scoped to .sidebar so they override the
   theme's navy tokens in BOTH the light and dark app themes. */
.sidebar .brand-name { color: #f7f2ea; }
.sidebar .brand-sub { color: var(--gold-400, #e6b455); }
/* Keep the logo mark on a white chip so it stays crisp on the maroon panel. */
.sidebar .brand-mark { background: #ffffff; border-radius: 10px; padding: 5px; }
.sidebar .brand-mark img { object-fit: contain; }
.sidebar .nav-label { color: rgba(224, 164, 55, 0.62); }
.sidebar .nav-link { color: rgba(247, 242, 234, 0.74); }
.sidebar .nav-link .nav-icon { opacity: 0.82; }
.sidebar .nav-link:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}
.sidebar .nav-link:hover .nav-icon { opacity: 1; }
/* Selected tab — solid gold pill with dark-maroon text/icon. */
.sidebar .nav-link.active {
  background: linear-gradient(180deg, var(--gold-400, #e6b455) 0%, var(--gold-600, #c98a2a) 100%);
  color: #4a0e15;
  font-weight: 700;
  box-shadow: 0 6px 16px -4px rgba(224, 164, 55, 0.45);
}
.sidebar .nav-link.active .nav-icon { opacity: 1; fill: #4a0e15; }
.sidebar .nav-link.active::before { display: none; }
.sidebar .nav-link.active .note-badge { background: #4a0e15; color: var(--gold-400, #e6b455); }
.sidebar-footer { border-top: 1px solid rgba(255, 255, 255, 0.09); }
.sidebar-version { color: rgba(247, 242, 234, 0.5); }
.sidebar::-webkit-scrollbar-thumb,
.nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); }
.sidebar-collapse-btn {
  background: #59101a;
  border-color: rgba(224, 164, 55, 0.3);
  color: #f7f2ea;
}
.sidebar-collapse-btn:hover {
  background: var(--gold-500);
  color: #4a0e15;
  border-color: var(--gold-500);
}

/* ---------- Main ---------- */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-left: var(--sidebar-w);
}

/* ---------- Topbar ---------- */
.topbar {
  height: var(--topbar-h);
  background: var(--navy-800);
  border-bottom: 1px solid var(--navy-500);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.sidebar-toggle { display: none; }

.page-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-100);
  line-height: 1.1;
}
.breadcrumb {
  font-size: 12px;
  color: var(--text-500);
  margin-top: 2px;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
}
.search svg {
  position: absolute;
  left: 10px;
  width: 16px;
  height: 16px;
  fill: var(--text-500);
}
.search input {
  background: var(--navy-700);
  border: 1px solid var(--navy-500);
  border-radius: var(--radius-md);
  padding: 8px 12px 8px 34px;
  color: var(--text-100);
  width: 240px;
  outline: none;
  transition: var(--transition);
}
.search input:focus {
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}
.search input::placeholder { color: var(--text-500); }

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  color: var(--text-300);
  transition: var(--transition);
  position: relative;
}
.icon-btn:hover { background: var(--navy-700); color: var(--text-100); }
.icon-btn svg { width: 18px; height: 18px; fill: currentColor; }
.badge-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--navy-800);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 4px 4px;
  border-radius: var(--radius-lg);
  background: var(--navy-700);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.12s, border-color 0.12s;
  user-select: none;
}
.user-chip:hover { background: var(--navy-600); border-color: var(--navy-500); }
.user-chip:focus-visible { outline: none; border-color: var(--gold-500); }
.user-chip-caret { color: var(--text-400); flex-shrink: 0; }
.user-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-600));
  color: var(--navy-900);
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 700;
  font-size: 11px;
}
.user-name { font-size: 13px; font-weight: 600; line-height: 1.1; }
.user-role { font-size: 11px; color: var(--text-500); }

/* ---------- View Container ---------- */
.view {
  padding: 24px 28px 40px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Page Header (within view) ---------- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.page-header-text h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.page-header-text p {
  margin: 4px 0 0;
  color: var(--text-400);
  font-size: 13px;
}
.page-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn svg { width: 14px; height: 14px; fill: currentColor; }
.btn-primary {
  background: var(--maroon-600);
  color: #fff;
}
.btn-primary:hover { background: var(--maroon-700); box-shadow: 0 4px 12px rgba(124, 29, 42, 0.28); }

/* Split-button — primary action + dropdown chevron in one visual group.
   Used on the Stock Requests toolbar to consolidate New / Share view /
   Saved views into one CTA + one menu. */
.split-button {
  display: inline-flex;
  align-items: stretch;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.split-button > .btn {
  border-radius: 0;
  box-shadow: none;
}
.split-button > .btn:hover {
  box-shadow: none;
}
.split-button-main {
  padding-right: 14px;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
}
.split-button-chev {
  padding-left: 10px;
  padding-right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.split-button-chev svg {
  margin: 0;
}
.btn-secondary {
  background: var(--navy-700);
  color: var(--text-100);
  border-color: var(--navy-500);
}
.btn-secondary:hover { background: var(--navy-600); border-color: var(--gold-500); color: var(--gold-500); }
.btn-ghost {
  background: transparent;
  color: var(--text-300);
}
.btn-ghost:hover { background: var(--navy-700); color: var(--text-100); }
.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover { background: #DC2626; }
.btn-outline {
  background: transparent;
  color: var(--gold-500);
  border-color: var(--gold-500);
}
.btn-outline:hover { background: var(--gold-500); color: var(--navy-900); }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Cards ---------- */
.card {
  background: var(--navy-700);
  border: 1px solid var(--navy-500);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--transition);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-100);
}
.card-subtitle {
  font-size: 12px;
  color: var(--text-400);
  margin-top: 2px;
}

/* ---------- KPI Cards ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
/* Compact KPI strip — used on busy list views (e.g. Stock Requests) where
   large KPI cards would steal attention from the data table below. Each
   chip is wrapped in a subtle bordered box for clean separation. */
.kpi-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  font-size: 12.5px;
  color: var(--text-300);
}
.kpi-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
  padding: 5px 11px;
  background: var(--navy-700);
  border: 1px solid var(--navy-500);
  border-radius: var(--radius-md);
  transition: var(--transition);
}
.kpi-chip:hover {
  border-color: var(--gold-500);
}
/* Small status-color dot on each KPI chip (kept compact). */
.kpi-chip--pending::before,
.kpi-chip--approved::before,
.kpi-chip--fulfilled::before,
.kpi-chip--stale::before,
.kpi-chip--total::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  flex: none; align-self: center;
  background: var(--text-500);
}
.kpi-chip--pending::before { background: #c1820c; }
.kpi-chip--approved::before { background: #2f74c0; }
.kpi-chip--fulfilled::before { background: #2e8b4f; }
.kpi-chip--stale::before { background: #b3261e; }
.kpi-chip--total::before { background: #9a938a; }
.kpi-chip-num {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-100);
  font-variant-numeric: tabular-nums;
}
.kpi-chip-lbl {
  color: var(--text-400);
  text-transform: none;
  letter-spacing: 0;
}
/* Stage filter chips (count + label, click to filter) — shared by Billing
   Accounts (payment stage) and Production Orders (production status). */
.stage-filters { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 12px; width: 100%; }
.stage-filter {
  flex: 0 0 auto;                 /* size to content — compact, not full-width */
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 5px 12px;
  background: var(--navy-700);
  border: 1px solid var(--navy-500);
  border-radius: 4px;             /* squared edge (no pill curve) */
  cursor: pointer; white-space: nowrap;
  transition: var(--transition);
}
.stage-filter:hover { border-color: var(--gold-500); }
.stage-filter.is-active { border-color: var(--gold-500); background: rgba(212, 175, 55, 0.08); box-shadow: inset 0 0 0 1px var(--gold-500); }
.stage-filter-num { font-size: 13px; font-weight: 800; color: var(--text-100); line-height: 1; font-variant-numeric: tabular-nums; }
.stage-filter-lbl { font-size: 11.5px; font-weight: 600; color: var(--text-400); }
.kpi {
  background: var(--navy-700);
  border: 1px solid var(--navy-500);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
/* Every .kpi used to carry a full-height 3px gold bar. Four side by side read as
   four loud stripes competing with the numbers, so it's now a short, muted tab
   that still marks the card without shouting. */
.kpi::before {
  content: '';
  position: absolute;
  top: 14px; left: 0;
  height: 20px;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: var(--gold-500);
  opacity: .5;
}
.kpi:hover { border-color: var(--gold-500); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-400);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.kpi-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-100);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.kpi-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-400);
}
.kpi-trend { font-weight: 600; }
.kpi-trend.up { color: var(--success); }
.kpi-trend.down { color: var(--danger); }
.kpi-icon {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 28px;
  height: 28px;
  opacity: 0.18;
  fill: var(--gold-500);
}

/* ---------- Tables ---------- */
.table-wrap {
  background: var(--navy-700);
  border: 1px solid var(--navy-500);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--navy-500);
  flex-wrap: wrap;
}
.table-toolbar-left { display: flex; align-items: center; gap: 10px; flex: 1; flex-wrap: wrap; }
.table-toolbar-right { display: flex; align-items: center; gap: 8px; }

/* Activity timeline */
.timeline { padding: 8px 4px; }
.timeline-entry { display: flex; gap: 14px; padding: 12px 0; position: relative; }
.timeline-entry::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 36px;
  bottom: -12px;
  width: 2px;
  background: var(--navy-500);
}
.timeline-entry:last-child::before { display: none; }
.timeline-dot {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--navy-700);
  border: 2px solid var(--navy-500);
  z-index: 1;
}
.timeline-dot.gold { background: rgba(212,175,55,0.15); border-color: var(--gold-500); }
.timeline-dot.success { background: rgba(16,185,129,0.15); border-color: var(--success); }
.timeline-dot.info { background: rgba(59,130,246,0.15); border-color: var(--info); }
.timeline-dot svg { width: 16px; height: 16px; fill: var(--text-100); }
.timeline-dot.gold svg { fill: var(--gold-500); }
.timeline-dot.success svg { fill: var(--success); }
.timeline-dot.info svg { fill: var(--info); }
.timeline-content { flex: 1; min-width: 0; }
.timeline-head { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.timeline-details { font-size: 13px; color: var(--text-300); margin-top: 4px; }
.timeline-when { font-size: 11px; color: var(--text-500); margin-top: 4px; }

/* Notes panel */
.notes-list { max-height: 360px; overflow-y: auto; padding-right: 4px; }
.note-item {
  background: var(--navy-800);
  border: 1px solid var(--navy-500);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 8px;
}
.note-head { display: flex; gap: 8px; align-items: center; font-size: 12px; margin-bottom: 4px; }
.note-text { font-size: 13px; color: var(--text-100); line-height: 1.5; white-space: pre-wrap; }
.note-del {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--text-500);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 4px;
}
.note-del:hover { color: var(--danger); }
.note-composer textarea {
  width: 100%;
  background: var(--navy-800);
  border: 1px solid var(--navy-500);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  color: var(--text-100);
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
}
.note-composer textarea:focus { outline: none; border-color: var(--gold-500); }
.note-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--gold-500);
  color: var(--navy-900);
  font-size: 9px;
  font-weight: 700;
  min-width: 14px;
  height: 14px;
  border-radius: 8px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Help center */
.help-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--navy-500);
  margin-bottom: 18px;
}
.help-tab {
  background: transparent;
  border: none;
  color: var(--text-300);
  padding: 8px 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-weight: 600;
  font-size: 13px;
}
.help-tab:hover { color: var(--text-100); }
.help-tab.active { color: var(--gold-500); border-bottom-color: var(--gold-500); }
.help-body { max-height: 56vh; overflow-y: auto; padding-right: 6px; }
.help-section { margin-bottom: 20px; }
.help-cat {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-500);
  font-weight: 700;
  margin-bottom: 10px;
}
.help-faq {
  background: var(--navy-800);
  border: 1px solid var(--navy-500);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  padding: 10px 14px;
}
.help-faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-100);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.help-faq summary::after { content: '+'; color: var(--gold-500); font-size: 18px; }
.help-faq[open] summary::after { content: '−'; }
.help-faq-a {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-300);
  line-height: 1.6;
}
.help-list { padding-left: 20px; color: var(--text-300); line-height: 1.8; font-size: 13px; }
.help-list li { margin-bottom: 4px; }
.help-list code, .help-faq-a code {
  background: var(--navy-800);
  border: 1px solid var(--navy-500);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
}
kbd {
  display: inline-block;
  background: var(--navy-800);
  border: 1px solid var(--navy-500);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gold-500);
}

/* Onboarding wizard */
.onb-progress {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 18px;
}
.onb-dot {
  width: 32px;
  height: 4px;
  border-radius: 2px;
  background: var(--navy-500);
  transition: background 0.2s;
}
.onb-dot.active { background: var(--gold-500); }
.onb-dot.done { background: var(--gold-400); opacity: 0.7; }
.onb-step { min-height: 280px; }

/* Bulk select bar */
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 12px;
  background: linear-gradient(90deg, rgba(212,175,55,0.10), rgba(212,175,55,0.04));
  border: 1px solid rgba(212,175,55,0.35);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
  animation: slideInDown 0.18s ease;
}
.bulk-bar[hidden] { display: none; }
.bulk-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-400);
  padding: 4px 10px;
  background: var(--navy-800);
  border-radius: 999px;
  margin-right: 4px;
}
tr.row-selected td { background: rgba(212,175,55,0.07) !important; }
tr.row-selected td:first-child { box-shadow: inset 3px 0 0 var(--gold-500); }
.bulk-check-all, .bulk-check-row { accent-color: var(--gold-500); cursor: pointer; width: 16px; height: 16px; }
@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.table-search {
  position: relative;
  flex: 1;
  max-width: 320px;
}
.table-search input {
  width: 100%;
  background: var(--navy-800);
  border: 1px solid var(--navy-500);
  border-radius: var(--radius-md);
  padding: 7px 12px 7px 32px;
  color: var(--text-100);
  outline: none;
}
.table-search svg {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  fill: var(--text-500);
}

.table-scroll { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data th, table.data td {
  padding: 9px 14px;
  text-align: left;
  border-bottom: 1px solid var(--navy-500);
  vertical-align: middle;
}
table.data th {
  vertical-align: middle;
  white-space: nowrap;
}
/* Cells can wrap by default; specific short fields stay single-line */
table.data td {
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}
table.data td.mono,
table.data td.num,
table.data td .badge,
table.data td .row-link--inline,
table.data td .row-link {
  white-space: nowrap;
}
table.data td .row-link--inline,
table.data td .row-link {
  display: inline;
  font-weight: 500;
}
table.data td .row-sub { line-height: 1.3; }
/* Let columns negotiate widths naturally; long cells wrap rather than overflow */
.table-scroll table.data { width: 100%; }

/* Density: compact mode */
body.density-compact table.data th,
body.density-compact table.data td { padding: 6px 12px; font-size: 12px; }
body.density-compact .card { padding: 14px; }
body.density-compact .kpi { padding: 14px; }
body.density-compact .kpi-value { font-size: 24px; }
body.density-compact .section { padding: 16px; }
body.density-compact .section-header { padding-bottom: 10px; margin-bottom: 12px; }
body.density-compact .page-header { margin-bottom: 16px; }
body.density-compact .form-grid { gap: 10px; }
body.density-compact .field input,
body.density-compact .field select,
body.density-compact .field textarea { padding: 6px 10px; font-size: 13px; }
body.density-compact .btn { padding: 6px 12px; font-size: 12px; }
body.density-compact .btn-sm { padding: 4px 8px; font-size: 11px; }
body.density-compact .table-toolbar { padding: 8px 14px; }

/* Skeleton loading */
@keyframes sk-shimmer {
  0% { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}
.sk-bar, .sk-cell, .sk-card {
  background: linear-gradient(90deg, var(--navy-700) 0%, var(--navy-600) 50%, var(--navy-700) 100%);
  background-size: 200px 100%;
  background-repeat: no-repeat;
  border-radius: 6px;
  animation: sk-shimmer 1.4s ease-in-out infinite;
}
.sk-bar { height: 14px; }
.sk-bar-lg { height: 28px; }
.sk-card { height: 120px; border-radius: var(--radius-lg); border: 1px solid var(--navy-500); }
.sk-table { background: var(--navy-700); border: 1px solid var(--navy-500); border-radius: var(--radius-lg); overflow: hidden; }
.sk-row { display: flex; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--navy-500); }
.sk-row:last-child { border-bottom: none; }
.sk-cell { flex: 1; height: 16px; }
.skeleton-page { animation: fadeIn 0.15s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
table.data th {
  background: var(--navy-800);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-400);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  position: sticky;
  top: 0;
  user-select: none;
}
table.data th.sortable { cursor: pointer; }
table.data th.sortable:hover { color: var(--gold-500); }
table.data th .sort-ind { opacity: 0.4; margin-left: 4px; font-size: 10px; }
table.data th.sorted .sort-ind { opacity: 1; color: var(--gold-500); }
table.data tbody tr { transition: background 0.12s ease; }
table.data tbody tr:hover { background: var(--navy-600); }
.table-scroll.table-rows-clickable tbody tr { cursor: pointer; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data td.mono { font-family: var(--font-mono); font-size: 12px; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
/* Right-align numeric column HEADERS too, so they line up with their
   right-aligned values. The generic `table.data th` rule (text-align:left)
   has higher specificity than the `.text-right` class renderTable puts on the
   header, so without this the header sat left while the values sat right. */
table.data th.text-right { text-align: right; }
table.data td.actions { text-align: right; white-space: nowrap; }
table.data .row-link { color: var(--text-100); font-weight: 500; }
table.data .row-link:hover { color: var(--gold-500); }
table.data .row-sub { font-size: 11px; color: var(--text-500); margin-top: 2px; }

.empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-400);
}
.empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  background: var(--navy-600);
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.empty-icon svg { width: 24px; height: 24px; fill: var(--gold-500); opacity: 0.7; }
.empty h3 { color: var(--text-200); font-size: 15px; margin-bottom: 6px; }
.empty p { margin: 0 0 16px; font-size: 13px; }
/* Compact empty-state for in-card / in-panel contexts (one consistent padding
   instead of the assorted inline 30/32/34/40px overrides). */
.empty--compact { padding: 32px 20px; }
/* Standard modal-footer destructive action: red text, pushed to the left.
   Replaces the repeated inline style="color:var(--danger);margin-right:auto;". */
.btn.modal-foot-delete { color: var(--danger); margin-right: auto; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;          /* v2.15 — calmer: was 600 */
  text-transform: none;      /* v2.15 — calmer: was uppercase */
  letter-spacing: 0;         /* v2.15 — calmer: was 0.04em */
  white-space: nowrap;
}
.badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
/* v2.15 — softer, lower-saturation badge fills (status still legible via the dot + text). */
.badge.success { background: rgba(16, 185, 129, 0.09); color: var(--success); }
.badge.warning { background: rgba(245, 158, 11, 0.09); color: var(--warning); }
.badge.danger { background: rgba(239, 68, 68, 0.09); color: var(--danger); }
.badge.info { background: rgba(59, 130, 246, 0.09); color: var(--info); }
.badge.neutral { background: var(--navy-600); color: var(--text-300); }
.badge.gold { background: rgba(192, 145, 47, 0.10); color: var(--gold-600, var(--gold-500)); }
.badge.no-dot::before { display: none; }

/* ---------- Forms ---------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  /* Top-align siblings so a tall hint on one column doesn't push its neighbour
     down — input boxes line up regardless of hint line-count. */
  align-items: start;
}
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
/* Hints don't affect input vertical alignment because .field is top-anchored
   inside its grid cell — but reserve consistent line-height so they look tidy. */
.field .hint { line-height: 1.35; }
.field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-300);
}
.field label .required { color: var(--gold-500); margin-left: 2px; }
.field input,
.field select,
.field textarea {
  background: var(--navy-800);
  border: 1px solid var(--navy-500);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  color: var(--text-100);
  outline: none;
  transition: var(--transition);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}
.field textarea { resize: vertical; min-height: 80px; }
.field .hint { font-size: 11px; color: var(--text-500); }
.field .error { font-size: 11px; color: var(--danger); }
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23887F82'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 18px;
  padding-right: 32px;
}

/* Inline form-select (used in view modals for status pickers) */
.form-select {
  appearance: none;
  background: var(--navy-700);
  color: var(--text-100);
  border: 1px solid var(--navy-500);
  border-radius: var(--radius-sm);
  padding: 6px 30px 6px 10px;
  font-size: 13px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23887F82'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
}
.form-select:focus { outline: none; border-color: var(--gold-500); box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12); }
.ml-2 { margin-left: 8px; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 14, 27, 0.7);
  backdrop-filter: blur(6px);
  /* v2.11.0 fix: raised above .side-panel (1200) so confirm/edit modals
     invoked from within a side-panel render on TOP of the panel, not under it.
     Layer scale: nav=50, partner-tab=800, install=850, bulk=900, side-panel=1200, modal=1300, toast=1400, peek=1500, cmd-palette=1600. */
  z-index: 1300;
  display: grid;
  place-items: center;
  padding: 20px;
  animation: backdropIn 0.18s ease;
}
@keyframes backdropIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--navy-700);
  border: 1px solid var(--navy-500);
  border-radius: var(--radius-xl);
  max-width: 640px;
  width: 100%;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal.lg { max-width: 880px; }
.modal.xl { max-width: min(1320px, 94vw); max-height: min(820px, 92vh); }

/* Ads-Manager-style date-range picker (Staff Monitoring) */
.drp { display: flex; gap: 18px; align-items: flex-start; }
.drp__presets { display: flex; flex-direction: column; gap: 2px; min-width: 138px; padding-right: 16px; border-right: 1px solid rgba(0, 0, 0, 0.09); }
.drp-preset { text-align: left; padding: 7px 11px; border: 0; background: none; border-radius: 8px; font-size: 13px; color: var(--text-100); cursor: pointer; transition: background 0.12s, color 0.12s; }
.drp-preset:hover { background: var(--maroon-tint); color: var(--maroon-600); }
.drp-preset.is-active { background: var(--maroon-600); color: #fff; font-weight: 600; }
.drp__cal { flex: 1; min-width: 0; }
.drp__nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.drp__months { display: flex; gap: 22px; }
.drp-month { flex: 1; min-width: 0; }
.drp-month__name { text-align: center; font-weight: 600; font-size: 13px; color: var(--text-100); margin-bottom: 8px; }
.drp-weekdays, .drp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.drp-weekdays span { text-align: center; font-size: 11px; font-weight: 600; color: var(--text-400); padding-bottom: 2px; }
.drp-day { aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; border: 0; padding: 0; background: none; border-radius: 8px; font-size: 12.5px; color: var(--text-100); cursor: pointer; }
.drp-day--pad { visibility: hidden; cursor: default; }
.drp-day:hover:not(.drp-day--pad) { background: var(--maroon-tint); color: var(--maroon-600); }
.drp-day.is-in { background: var(--maroon-tint); color: var(--maroon-600); border-radius: 0; }
.drp-day.is-start { border-top-left-radius: 8px; border-bottom-left-radius: 8px; }
.drp-day.is-end { border-top-right-radius: 8px; border-bottom-right-radius: 8px; }
.drp-day.is-start, .drp-day.is-end { background: var(--maroon-600); color: #fff; font-weight: 600; }
.drp-day.is-today:not(.is-start):not(.is-end) { box-shadow: inset 0 0 0 1px var(--gold-500); }
.drp__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 13px; border-top: 1px solid rgba(0, 0, 0, 0.09); flex-wrap: wrap; }
.drp__range { font-size: 13.5px; font-weight: 600; color: var(--text-100); }
.drp__foot-btns { display: inline-flex; gap: 8px; }
@media (max-width: 620px) {
  .drp { flex-direction: column; }
  .drp__presets { flex-direction: row; flex-wrap: wrap; min-width: 0; border-right: 0; border-bottom: 1px solid rgba(0, 0, 0, 0.09); padding-right: 0; padding-bottom: 10px; }
  .drp__months { flex-direction: column; gap: 14px; }
}

/* Staff Monitoring — view tabs + Day/Week/Month segmented control */
.sm-tabs { display: inline-flex; gap: 4px; background: var(--navy-800); border: 1px solid var(--navy-600); border-radius: 11px; padding: 4px; margin-bottom: 14px; }
.sm-tab { padding: 7px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text-300); background: transparent; transition: background .15s ease, color .15s ease; }
.sm-tab:hover { color: var(--text-100); }
.sm-tab.is-active { background: var(--maroon-600); color: #fff; }
.sm-seg { display: inline-flex; gap: 2px; background: var(--navy-800); border: 1px solid var(--navy-600); border-radius: 9px; padding: 3px; }
.sm-seg-btn { padding: 6px 14px; border-radius: 6px; font-size: 13px; font-weight: 600; color: var(--text-300); background: transparent; transition: background .15s ease, color .15s ease; }
.sm-seg-btn:hover { color: var(--text-100); }
.sm-seg-btn.is-active { background: var(--maroon-600); color: #fff; }
.sm-att { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }

/* ---- Staff Performance toolbar: one strip holding the period switch, the date
   navigator and the target field, instead of four loose controls in a row. ---- */
.sm-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 12px; margin-bottom: 12px;
  background: var(--navy-700); border: 1px solid var(--navy-600);
  border-radius: var(--radius-lg);
}
.sm-bar-nav { display: inline-flex; align-items: center; gap: 4px; }
.sm-navbtn {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--navy-600);
  background: var(--navy-800); color: var(--text-200); font-size: 17px; line-height: 1;
  display: grid; place-items: center; transition: background .15s ease, color .15s ease;
}
.sm-navbtn:hover { background: var(--maroon-tint); color: var(--maroon-500); }
.sm-period {
  min-width: 218px; text-align: center; font-size: 13.5px; font-weight: 700;
  color: var(--text-100); font-variant-numeric: tabular-nums;
}
.sm-today {
  margin-left: 4px; padding: 6px 12px; border-radius: 8px; background: transparent;
  border: 1px solid transparent; font-size: 12.5px; font-weight: 600; color: var(--text-400);
}
.sm-today:hover { color: var(--maroon-500); border-color: var(--navy-600); background: var(--navy-800); }
.sm-target { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.sm-target span { font-size: 12px; color: var(--text-400); white-space: nowrap; }
.sm-target input {
  width: 92px; padding: 6px 10px; font-size: 13px; text-align: right;
  background: var(--navy-800); color: var(--text-100);
  border: 1px solid var(--navy-500); border-radius: 8px;
  font-variant-numeric: tabular-nums;
}
.sm-target input:focus { outline: none; border-color: var(--maroon-500); box-shadow: 0 0 0 3px var(--maroon-tint); }

/* ---- Compact stat tiles ---- */
.sm-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px; margin-bottom: 12px;
}
.sm-stat {
  display: flex; flex-direction: column; gap: 5px;
  padding: 12px 14px; background: var(--navy-700);
  border: 1px solid var(--navy-600); border-radius: var(--radius-md);
}
.sm-stat-lbl {
  font-size: 10.5px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--text-500);
}
.sm-stat-val {
  font-size: 24px; font-weight: 800; line-height: 1.1; color: var(--text-100);
  font-variant-numeric: tabular-nums;
}
.sm-stat--name .sm-stat-val { font-size: 14.5px; font-weight: 700; line-height: 1.3; }
.sm-stat--bad .sm-stat-val { color: var(--danger); }

.sm-card { padding: 14px 18px; margin-top: 12px; }
.sm-alert {
  margin-top: 12px; padding: 12px 16px; border-radius: 0;
  border-left: 3px solid var(--danger);
}
.sm-alert-hd { font-weight: 700; font-size: 13.5px; color: var(--danger); margin-bottom: 3px; }

/* ---- Table: let the staff name take the slack and keep the numeric columns in
   tidy fixed tracks, so values sit under their headers on wide screens. ---- */
.sm-table { table-layout: auto; }
.sm-table th:not(:first-child), .sm-table td:not(:first-child) { width: 104px; }
.sm-table th:first-child, .sm-table td:first-child { min-width: 160px; }
.sm-table tbody tr:hover { background: var(--maroon-tint); }
.sm-table td, .sm-table th { font-variant-numeric: tabular-nums; }
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--navy-500);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  color: var(--text-400);
  display: grid;
  place-items: center;
  transition: var(--transition);
}
.modal-close:hover { background: var(--navy-600); color: var(--text-100); }
.modal-close svg { width: 16px; height: 16px; fill: currentColor; }
.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.modal.xl .modal-body { padding: 32px 40px 28px; }
.modal.xl .modal-footer { padding: 20px 40px; }
.modal.xl.modal--sr-edit .modal-body { padding: 20px 32px 12px; }
.modal.xl.modal--sr-edit .modal-footer { padding: 10px 32px; }

/* Mobile: every modal goes fullscreen with a fixed header + footer and an
   internal scroll region, so long forms (esp. the Stock Request Edit ledger)
   never overflow. Uses dvh so the height matches the VISIBLE viewport — 92vh
   otherwise hides the footer behind the phone's address bar. */
@media (max-width: 640px) {
  .modal-backdrop {
    padding: 0; place-items: stretch;
    /* --vv-h / --vv-top are set on this element by openModal() from
       window.visualViewport, which is the only viewport the software keyboard
       actually shrinks. Falling back to dvh keeps the old behaviour wherever
       visualViewport is missing. `bottom: auto` is required: inset:0 pins both
       edges, and a pinned bottom cancels the height we are trying to set. */
    top: var(--vv-top, 0px);
    bottom: auto;
    height: var(--vv-h, 100dvh);
  }
  .modal,
  .modal.lg,
  .modal.xl {
    max-width: 100%;
    width: 100%;
    max-height: 100vh;
    max-height: var(--vv-h, 100dvh);
    height: 100vh;
    height: var(--vv-h, 100dvh);
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
  .modal-header { padding: 13px 16px; }
  .modal-body,
  .modal.xl .modal-body,
  .modal.xl.modal--sr-edit .modal-body { padding: 14px 16px; }
  .modal-footer,
  .modal.xl .modal-footer,
  .modal.xl.modal--sr-edit .modal-footer { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .modal-close { width: 40px; height: 40px; }   /* ≥40px tap target */
  .modal .btn { min-height: 42px; }              /* comfortable tap targets */
}

/* v2.12.51 — Floating Back + Close buttons on Stock Request Edit modal.
   Positioned absolutely in the top corners so they overlay the ledger
   content without taking layout space. Subtle by default, maroon on hover. */
.modal--sr-edit { position: relative; }
.modal--sr-edit .modal-nav-back,
.modal--sr-edit .modal-nav-close {
  position: absolute;
  top: 12px;
  z-index: 6;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(15, 26, 46, 0.10);
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
  color: #4a5568;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  transition: transform 0.16s ease, background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  box-shadow: 0 2px 6px rgba(15, 26, 46, 0.08);
}
.modal--sr-edit .modal-nav-back  { left: 12px; }
.modal--sr-edit .modal-nav-close { right: 12px; }
.modal--sr-edit .modal-nav-back svg,
.modal--sr-edit .modal-nav-close svg { width: 16px; height: 16px; fill: currentColor; }
.modal--sr-edit .modal-nav-back:hover,
.modal--sr-edit .modal-nav-close:hover {
  background: var(--maroon-600);
  color: #fff;
  border-color: var(--maroon-600);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(122, 17, 17, 0.28);
}
.modal--sr-edit .modal-nav-back:active,
.modal--sr-edit .modal-nav-close:active { transform: translateY(0); }
.modal--sr-edit .modal-nav-back:focus-visible,
.modal--sr-edit .modal-nav-close:focus-visible {
  outline: 2px solid var(--gold-500);
  outline-offset: 2px;
}
/* Dark theme baseline (body has no theme-light class) — softer surface, same maroon hover */
body:not(.theme-light) .modal--sr-edit .modal-nav-back,
body:not(.theme-light) .modal--sr-edit .modal-nav-close {
  background: rgba(30, 45, 69, 0.85);
  border-color: rgba(255, 255, 255, 0.10);
  color: var(--text-300);
}
/* v2.12.54: padding for the corner buttons lives on the more-specific
   .ledger-head.ledger-head--compact rule below (line ~3219) — the
   compact variant has higher specificity and the padding shorthand
   would override here regardless. */
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--navy-500);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
/* Grouped Production Order footer — destructive zone pushed far left, primary
   + manage + Close on the right, kept scannable on narrow modals via wrap. */
.modal-footer .mo-foot-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.modal-footer .mo-foot-group--danger { margin-right: auto; }
.modal-footer .mo-foot-group--main { justify-content: flex-end; }
.mo-foot-divider {
  width: 1px;
  align-self: stretch;
  min-height: 22px;
  background: var(--navy-500);
  opacity: 0.7;
  margin: 0 3px;
}
.btn.mo-foot-danger { color: var(--danger); }
.btn.mo-foot-danger:hover {
  color: var(--danger);
  background: rgba(124, 28, 38, 0.08);
}

/* ---------- Minimal Ledger modal (Stock Request Edit / New) ----------
   Generated from a multi-agent design workflow. Hero ID, transparent
   inputs, gold underline on the primary action, hidden chrome. */
.ledger {
  padding: 4px 2px 0;
}
.ledger-head {
  padding: 4px 0 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--navy-500);
}
.ledger-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-600);
  margin-bottom: 6px;
}
.ledger-id {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-100);
  font-feature-settings: "tnum" 1;
  line-height: 1.1;
}
.ledger-meta {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-400);
}
.ledger-meta .ledger-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-500);
  opacity: 0.6;
}
.ledger-notice {
  font-size: 13px;
  color: var(--text-400);
  margin: 0 0 16px;
  padding: 10px 14px;
  background: rgba(200, 160, 75, 0.07);
  border-left: 2px solid var(--gold-500);
  border-radius: 0 6px 6px 0;
}
.ledger-body { padding: 0; }
.ledger-body .form-grid { gap: 22px 28px; }

/* Inputs feel like editable text, not form chrome */
.ledger-body .field {
  gap: 4px;
}
.ledger-body .field > label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-500);
  margin: 0;
}
.ledger-optional {
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-500);
  margin-left: 6px;
  opacity: 0.85;
}
.ledger-body .field input,
.ledger-body .field select,
.ledger-body .field textarea {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--navy-500);
  border-radius: 0;
  padding: 6px 0 7px;
  font-size: 15px;
  color: var(--text-100);
  transition: border-color 0.15s ease;
  box-shadow: none;
}
.ledger-body .field input:hover,
.ledger-body .field select:hover,
.ledger-body .field textarea:hover {
  border-bottom-color: var(--text-400);
}
.ledger-body .field input:focus,
.ledger-body .field select:focus,
.ledger-body .field textarea:focus {
  outline: none;
  border-bottom-color: var(--gold-500);
  box-shadow: none;
}
.ledger-body .field input:disabled {
  color: var(--text-400);
  cursor: default;
  border-bottom-style: dashed;
}
.ledger-body .field textarea {
  min-height: 64px;
  resize: vertical;
  line-height: 1.5;
}
.ledger-body .field .hint {
  font-size: 11.5px;
  color: var(--text-500);
  margin-top: 2px;
}
.ledger-body .field select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-400) 50%),
    linear-gradient(135deg, var(--text-400) 50%, transparent 50%);
  background-position: calc(100% - 10px) 16px, calc(100% - 6px) 16px;
  background-size: 4px 4px;
  background-repeat: no-repeat;
  padding-right: 20px;
}

/* Advanced disclosure for the auto-approve toggle */
.ledger-advanced {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px dashed var(--navy-500);
}
.ledger-advanced > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-400);
  user-select: none;
  transition: color 0.15s ease;
}
.ledger-advanced > summary::-webkit-details-marker { display: none; }
.ledger-advanced > summary:hover { color: var(--text-200); }
.ledger-chev {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform 0.15s ease;
  transform: rotate(-90deg);
}
.ledger-advanced[open] .ledger-chev { transform: rotate(0deg); }
.ledger-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  cursor: pointer;
  font-size: 13px;
}
.ledger-toggle input[type="checkbox"] {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: var(--gold-500);
}
.ledger-toggle-title {
  display: block;
  color: var(--text-200);
  font-weight: 500;
}
.ledger-toggle-hint {
  display: block;
  color: var(--text-500);
  font-size: 12px;
  margin-top: 2px;
}

/* Footer override — gold underline accent on Save */
.modal-footer.ledger-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--navy-500);
}
/* v2.12.23 — Save Changes button: plain maroon primary, no gold underline.
   The gold underline (kept as a "ledger signature" in v2.12.16) competed
   with the maroon button itself and read as a glitch on the screenshot. */
.modal-footer.ledger-footer .ledger-save {
  position: relative;
}

/* ---------- Receipt-Ledger sections (v2.12.19) ----------
   Adds semantic Context / Order / Pricing sections + a maroon Total Order
   Value card to the existing ledger modal. From design workflow wf_eac86f85-dd6. */
.ledger-section {
  padding: 0;
  margin: 0 0 22px;
}
.ledger-section + .ledger-section {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px dashed var(--navy-500);
}
.ledger-section-title {
  margin: 0 0 14px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-500);
  line-height: 1;
}

/* Context — read-only receipt rows, no input chrome */
.ledger-section--context .ledger-receipt {
  margin: 0;
  display: grid;
  gap: 8px;
}
.ledger-receipt-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  align-items: baseline;
  gap: 16px;
  font-size: 14px;
}
.ledger-receipt-row dt {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-500);
}
.ledger-receipt-row dd {
  margin: 0;
  color: var(--text-200);
  font-weight: 500;
  font-feature-settings: "tnum" 1;
}

/* Pricing — peso-prefixed money input */
.ledger-price-field { max-width: none; min-width: 0; }
.ledger-money {
  display: flex;
  align-items: baseline;
  gap: 6px;
  border-bottom: 1px solid var(--navy-500);
  transition: border-color 0.15s ease;
}
.ledger-money:hover { border-bottom-color: var(--text-400); }
.ledger-money:focus-within { border-bottom-color: var(--gold-500); }
.ledger-money-sym {
  font-size: 16px;
  color: var(--gold-600);
  font-weight: 600;
  padding-bottom: 7px;
}
.ledger-body .ledger-money input {
  border-bottom: none;
  padding: 6px 0 7px;
  flex: 1;
  min-width: 0;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.ledger-body .ledger-money input:hover,
.ledger-body .ledger-money input:focus { border-bottom: none; }
/* Clean number fields — drop the native ▲▼ spinner on the ledger form's
   Quantity + Unit Price so the inputs read as plain underlined text. */
.ledger-body .field input[type="number"]::-webkit-outer-spin-button,
.ledger-body .field input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.ledger-body .field input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

/* Total Order Value — the climax card */
.ledger-total {
  margin-top: 22px;
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-items: baseline;
  column-gap: 16px;
  row-gap: 4px;
  background: linear-gradient(
    180deg,
    rgba(124, 28, 38, 0.04) 0%,
    rgba(124, 28, 38, 0.06) 100%
  );
  border: 1px solid rgba(124, 28, 38, 0.12);
  border-left: 3px solid var(--maroon-600);
  border-radius: 4px;
  position: relative;
}
.ledger-total::before {
  content: "";
  position: absolute;
  top: -1px;
  right: -1px;
  width: 64px;
  height: 2px;
  background: var(--gold-500);
  border-top-right-radius: 4px;
}
.ledger-total-label {
  grid-column: 1;
  grid-row: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--maroon-600);
}
.ledger-marker {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(200, 160, 75, 0.14);
}
.ledger-total-amount {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-100);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  line-height: 1.1;
  text-align: right;
  position: relative;
  padding-bottom: 2px;
  background-image: linear-gradient(var(--gold-500), var(--gold-500));
  background-repeat: no-repeat;
  background-position: 100% 100%;
  background-size: 0 1.5px;
  transition: background-size 0.25s ease;
}
.ledger-total-sym {
  font-size: 20px;
  font-weight: 500;
  color: var(--gold-600);
}
.ledger-total-amount.is-pulse { background-size: 100% 1.5px; }
.ledger-total-breakdown {
  grid-column: 1;
  grid-row: 2;
  font-size: 12px;
  color: var(--text-400);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.ledger-total-x { color: var(--text-500); opacity: 0.7; }

/* Mobile tuning */
@media (max-width: 480px) {
  .ledger-id { font-size: 24px; }
  .ledger-head { padding-bottom: 18px; margin-bottom: 18px; }
  .ledger-body .form-grid { gap: 18px; }
  .ledger-advanced { margin-top: 22px; }
  .ledger-section + .ledger-section { margin-top: 18px; padding-top: 18px; }
  .ledger-receipt-row { grid-template-columns: 1fr; gap: 2px; }
  .ledger-receipt-row dt { font-size: 10.5px; }
  .ledger-price-field { max-width: 100%; }
  .ledger-total {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    padding: 14px 16px;
    row-gap: 6px;
  }
  .ledger-total::before { width: 48px; }
  .ledger-total-amount {
    grid-column: 1;
    grid-row: 2;
    justify-content: flex-start;
    text-align: left;
    font-size: 26px;
    background-position: 0 100%;
  }
  .ledger-total-sym { font-size: 17px; }
  .ledger-total-breakdown { grid-column: 1; grid-row: 3; }
}

/* ---------- Invoice section (v2.12.20) — calm receipt-row, ghost actions */
.ledger-invoice-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 6px 0 2px;
  text-align: center;
}
.ledger-invoice-empty-line {
  margin: 0;
  font-size: 13px;
  color: var(--text-400);
  font-style: italic;
}
.ledger-invoice-empty-hint {
  margin: 0;
  font-size: 11.5px;
  color: var(--text-500);
  max-width: 360px;
  line-height: 1.4;
}
.ledger-invoice-receipt {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 16px;
  row-gap: 10px;
}
.ledger-invoice-code {
  grid-column: 1; grid-row: 1;
  display: flex; align-items: baseline; gap: 10px; min-width: 0;
}
.ledger-invoice-eyebrow {
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-500);
}
.ledger-invoice-id {
  font-size: 15px; font-weight: 600;
  color: var(--text-100);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: 0.02em;
}
.ledger-invoice-meta {
  grid-column: 1; grid-row: 2;
  display: flex; align-items: baseline; flex-wrap: wrap;
  gap: 6px 10px; margin: 0;
  font-size: 13px; color: var(--text-300);
  font-variant-numeric: tabular-nums;
}
.ledger-invoice-meta-cell {
  display: inline-flex; align-items: baseline; gap: 6px; margin: 0;
}
.ledger-invoice-meta-cell dt {
  margin: 0; font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-500);
}
.ledger-invoice-meta-cell dd {
  margin: 0; color: var(--text-200); font-weight: 500;
}
.ledger-invoice-sym {
  color: var(--text-400); font-weight: 500; margin-right: 1px;
}
.ledger-invoice-sep { color: var(--text-500); opacity: 0.55; }

.ledger-invoice-status {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  background: rgba(0, 0, 0, 0.045);
  color: var(--text-300);
  border: 1px solid rgba(0, 0, 0, 0.06);
  line-height: 1.4;
}
.ledger-invoice-status.is-pending {
  background: rgba(200, 160, 75, 0.10);
  color: var(--gold-600);
  border-color: rgba(200, 160, 75, 0.22);
}
.ledger-invoice-status.is-paid {
  background: rgba(36, 110, 64, 0.08);
  color: #246e40;
  border-color: rgba(36, 110, 64, 0.18);
}
/* DP acknowledged by Finance but not yet fully paid — distinct teal so it
   reads as positive progress without looking like a fully-settled invoice. */
.ledger-invoice-status.is-downpayment-paid {
  background: rgba(38, 110, 120, 0.09);
  color: #1f6b76;
  border-color: rgba(38, 110, 120, 0.24);
}
.ledger-invoice-status.is-cancelled {
  background: rgba(124, 28, 38, 0.06);
  color: var(--maroon-600);
  border-color: rgba(124, 28, 38, 0.16);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.ledger-invoice-actions {
  grid-column: 2; grid-row: 1 / span 2;
  display: inline-flex; align-items: center; gap: 6px;
  align-self: center;
}
.ledger-invoice-btn {
  appearance: none; background: transparent;
  border: 1px solid transparent;
  padding: 5px 9px;
  font-size: 11.5px; font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-300);
  border-radius: 3px; cursor: pointer; line-height: 1.2;
  transition: color 0.15s ease, border-color 0.15s ease, background-size 0.25s ease;
}
/* v2.12.23 — Invoice action buttons made clearly visible.
   Edit: outlined navy ghost with light tint background → reads as button, not link.
   Send to Partner: solid maroon primary → primary CTA, can't miss it.
   Generate: solid gold → warm CTA, encourages the "open offer". */
.ledger-invoice-btn {
  background: var(--navy-700);
  border: 1px solid var(--navy-500);
  color: var(--text-100);
  font-weight: 600;
}
.ledger-invoice-btn:hover {
  background: var(--navy-600);
  border-color: var(--text-400);
  color: var(--text-100);
}
.ledger-invoice-btn:focus-visible {
  outline: none;
  border-color: var(--gold-500);
  box-shadow: 0 0 0 2px rgba(200, 160, 75, 0.25);
}
.ledger-invoice-btn--send {
  background: var(--maroon-600);
  border-color: var(--maroon-600);
  color: #fff;
}
.ledger-invoice-btn--send:hover {
  background: var(--maroon-700, #6a1820);
  border-color: var(--maroon-700, #6a1820);
  color: #fff;
  box-shadow: 0 2px 6px rgba(124, 28, 38, 0.22);
}
.ledger-invoice-btn--generate {
  padding: 7px 14px;
  font-size: 12.5px;
  background: var(--gold-500);
  border-color: var(--gold-500);
  color: var(--navy-900);
  font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
}
.ledger-invoice-btn--generate:hover {
  background: var(--gold-600);
  border-color: var(--gold-600);
  color: var(--navy-900);
  box-shadow: 0 2px 6px rgba(200, 160, 75, 0.30);
}
.ledger-invoice-btn--generate .ledger-invoice-plus {
  color: var(--navy-900);
}
.ledger-invoice-plus {
  font-size: 14px; font-weight: 400;
  color: var(--text-400); line-height: 1; margin-top: -1px;
}

/* ---------- Send-to-Partner dialog ---------- */
.ledger-send-dialog {
  display: grid; gap: 14px;
  padding: 0;
  width: 100%;
}
.ledger-send-lede {
  margin: 0; font-size: 14px;
  color: var(--text-200);
  line-height: 1.45;
}
.ledger-send-lede strong { color: var(--text-100); font-weight: 600; }

.ledger-send-channels {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 10px;
}
.ledger-send-channel {
  display: grid; grid-template-columns: auto 1fr auto;
  align-items: center; gap: 10px;
  padding: 8px 10px;
  border: 1px dashed var(--navy-500);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.012);
}
.ledger-send-channel > div { display: grid; gap: 1px; }
.ledger-send-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(200, 160, 75, 0.14);
}
.ledger-send-channel-title {
  font-size: 13px; font-weight: 500;
  color: var(--text-200);
}
.ledger-send-channel-hint {
  font-size: 11.5px; color: var(--text-500);
}
.ledger-send-tag {
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-500);
}

.ledger-send-email-toggle {
  display: grid; grid-template-columns: auto 1fr;
  align-items: start; gap: 10px;
  padding: 10px;
  border: 1px solid var(--navy-500);
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.ledger-send-email-toggle:hover { border-color: var(--text-400); }
.ledger-send-email-toggle:has(input:checked) {
  border-color: rgba(200, 160, 75, 0.5);
  background: rgba(200, 160, 75, 0.04);
}
.ledger-send-email-toggle.is-disabled,
.ledger-send-email-toggle[data-has-email="false"] {
  opacity: 0.55; cursor: not-allowed;
  background: rgba(0, 0, 0, 0.015);
}
.ledger-send-email-toggle input[type="checkbox"] {
  width: 14px; height: 14px; margin-top: 3px;
  accent-color: var(--gold-600);
}
.ledger-send-email-body { display: grid; gap: 2px; }
.ledger-send-email-title {
  font-size: 13px; font-weight: 500;
  color: var(--text-200);
}
.ledger-send-email-addr {
  font-size: 12.5px; color: var(--text-300);
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}
.ledger-send-email-hint {
  font-size: 11.5px; color: var(--text-500);
  margin-top: 1px;
}

.ledger-send-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  border-top: 1px dashed var(--navy-500);
  margin-top: 2px; padding-top: 14px;
}

@media (max-width: 480px) {
  .ledger-invoice-receipt {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    row-gap: 8px;
  }
  .ledger-invoice-actions {
    grid-column: 1; grid-row: 3;
    justify-self: stretch; justify-content: flex-end;
  }
}

/* ============================================================
   v2.12.21 Stock Request Edit — Split-Card (Fit-on-Screen)
   Two-column lg modal: editable form (left) + sticky maroon
   Summary Rail (right). Engineered to fit ~640px content height
   so the user never sees a scrollbar on a typical desktop.
   ============================================================ */

/* HERO: compact single row */
.ledger.ledger--split { padding: 2px 2px 0; }
.ledger-head.ledger-head--compact {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 4px 0 22px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--navy-500);
  position: relative;
}
.ledger-head.ledger-head--compact::after {
  content: "";
  position: absolute;
  left: 0; bottom: -1px;
  width: 64px; height: 2px;
  background: var(--gold-500);
}
.ledger-head--compact .ledger-head-left { min-width: 0; }
.ledger-head--compact .ledger-eyebrow { margin-bottom: 6px; font-size: 11.5px; }
.ledger-head--compact .ledger-id { font-size: 34px; line-height: 1.05; margin: 0; letter-spacing: -0.02em; }
.ledger-head-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-400);
  padding-bottom: 2px;
  white-space: nowrap;
}
.ledger-meta-chip {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--gold-600);
  background: rgba(200, 160, 75, 0.10);
  border: 1px solid rgba(200, 160, 75, 0.22);
  line-height: 1.4;
}
.ledger-meta-chip.is-approved,
.ledger-meta-chip.is-fulfilled,
.ledger-meta-chip.is-done-dp {
  color: #246e40;
  background: rgba(36, 110, 64, 0.08);
  border-color: rgba(36, 110, 64, 0.22);
}
.ledger-meta-chip.is-rejected,
.ledger-meta-chip.is-cancelled {
  color: var(--maroon-600);
  background: rgba(124, 28, 38, 0.06);
  border-color: rgba(124, 28, 38, 0.18);
}
.ledger-head-meta-line {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* SPLIT: form (left) + sticky summary (right) — XL airy edition */
.ledger-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  column-gap: 48px;
  align-items: start;
}
.modal.xl .ledger.ledger--split { padding: 8px 8px 0; }
.ledger-pane { min-width: 0; }

/* Dashed column rule on right edge of LEFT pane */
.ledger-pane--form {
  position: relative;
  padding-right: 48px;
  display: grid;
  gap: 22px;
}
.ledger-pane--form::after {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  right: -1px;
  width: 1px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    var(--navy-500) 10%,
    var(--navy-500) 90%,
    transparent 100%
  );
  opacity: 0.55;
}

/* v2.12.24 — Readability boost for left pane.
   Labels lifted from text-500 → text-300 and bumped to 11.5px for clear
   visibility. Inputs bumped from 14px → 15.5px so values dominate over
   labels. Field gap loosened from 3px → 6px so rows breathe. */
.ledger-pane-title {
  margin: 0 0 12px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-200);
  line-height: 1;
}

/* LEFT PANE: airy field rhythm for the XL modal */
.ledger-pane--form .field { gap: 9px; }
.ledger-pane--form .field > label {
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.10em;
  color: var(--text-300);
}
.ledger-pane--form .field input,
.ledger-pane--form .field select,
.ledger-pane--form .field textarea {
  font-size: 16px;
  padding: 8px 0 9px;
  color: var(--text-100);
  font-weight: 500;
}
.ledger-pane--form .field input::placeholder,
.ledger-pane--form .field textarea::placeholder {
  color: var(--text-500);
  opacity: 1;
}
.ledger-pane--form textarea {
  min-height: 54px;
  line-height: 1.45;
  font-size: 13.5px;
  resize: vertical;
  padding: 6px 0;
  /* Wrap long unbroken strings instead of overflowing the box. */
  overflow-wrap: anywhere;
  word-break: break-word;
}
.ledger-pane--form .ledger-optional {
  font-size: 10.5px;
  color: var(--text-500);
}
.ledger-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 32px;
  align-items: start;
}
.ledger-row-2--even { grid-template-columns: 1fr 1fr; align-items: start; }
/* v2.12.30 — Lock both Unit Price (.ledger-money) and Notes (textarea) to the
   SAME fixed height so their bottom underlines align pixel-perfectly. Also
   disable user-resize on the textarea (was breaking alignment when dragged),
   shrink it to a single visible line, and reduce padding so typed text sits
   close to the underline instead of floating at the top of an empty box. */
.ledger-row-2--even .field { display: flex; flex-direction: column; }
.ledger-row-2--even .ledger-money,
.ledger-row-2--even .field textarea {
  height: 38px;
  min-height: 38px;
  max-height: 38px;
  box-sizing: border-box;
}
.ledger-row-2--even .field textarea {
  resize: none;
  padding: 8px 0 9px;
  line-height: 1.3;
  font-size: 16px;
  overflow: hidden;
}
.ledger-row-2--even .ledger-money {
  align-items: flex-end;
}
.ledger-row-2--even .ledger-money input,
.ledger-row-2--even .ledger-money .ledger-money-sym {
  padding-bottom: 9px;
}

/* Advanced — inline, dashed top border, tighter */
.ledger-advanced--inline {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px dashed var(--navy-500);
}
.ledger-advanced--inline > summary {
  font-size: 12.5px;
  color: var(--text-300);
  font-weight: 600;
}
.ledger-advanced--inline > summary:hover { color: var(--text-100); }
.ledger-advanced--inline .ledger-toggle {
  margin-top: 10px;
  font-size: 12.5px;
}
.ledger-advanced--inline .ledger-toggle-hint { font-size: 11.5px; }

/* RIGHT PANE: sticky maroon Summary Rail */
.ledger-pane--summary {
  position: sticky;
  top: 0;
  align-self: start;
}
.ledger-summary-card {
  display: grid;
  gap: 22px;
  padding: 24px 24px 22px;
  background: linear-gradient(
    180deg,
    rgba(124, 28, 38, 0.035) 0%,
    rgba(124, 28, 38, 0.07) 100%
  );
  border: 1px solid rgba(124, 28, 38, 0.14);
  border-left: 4px solid var(--maroon-600);
  border-radius: 10px;
  position: relative;
  box-shadow: 0 8px 24px -12px rgba(124, 28, 38, 0.18);
}
/* v2.12.32: removed gold capstop (.ledger-summary-card::before) for cleaner look */

/* Context block in summary */
.ledger-summary-context {
  margin: 0;
  display: grid;
  gap: 12px;
  padding-bottom: 22px;
  border-bottom: 1px dashed rgba(124, 28, 38, 0.20);
}
.ledger-summary-context-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  /* v2.12.67 (Patch 4D) — was align-items: baseline which left long
     wrapping values (e.g. business names) drifting above/below the
     key. center + tighter line-height keeps the value column
     vertically locked to the key. */
  align-items: center;
  gap: 14px;
  font-size: 14.5px;
  line-height: 1.35;
}
.ledger-summary-context-row > dd { line-height: 1.35; }
.ledger-summary-context-row dt {
  margin: 0;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-400);
}
.ledger-summary-context-row dd {
  margin: 0;
  color: var(--text-100);
  font-weight: 600;
  font-feature-settings: "tnum" 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Total Order Value — vertical climax */
.ledger-summary-total {
  display: grid;
  gap: 4px;
}
.ledger-summary-total {
  display: grid;
  gap: 8px;
}
.ledger-summary-total-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--maroon-600);
}
.ledger-summary-total-label .ledger-marker {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(200, 160, 75, 0.18);
}
.ledger-summary-total-amount {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-100);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  line-height: 1.0;
  padding-bottom: 4px;
}
.ledger-summary-total-amount .ledger-total-sym {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-400);
  margin-right: 4px;
}
.ledger-summary-total-breakdown {
  font-size: 13px;
  color: var(--text-300);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-weight: 500;
  margin-top: 2px;
}

/* Invoice sub-block in summary */
.ledger-summary-invoice {
  padding-top: 14px;
  border-top: 1px dashed rgba(124, 28, 38, 0.20);
  display: grid;
  gap: 8px;
}
.ledger-eyebrow.ledger-eyebrow--sm {
  font-size: 10px;
  margin: 0 0 2px;
}
.ledger-summary-invoice-empty {
  display: grid;
  gap: 8px;
  justify-items: start;
}
.ledger-summary-invoice-empty-line {
  margin: 0;
  font-size: 12px;
  color: var(--text-400);
  font-style: italic;
  line-height: 1.35;
}
.ledger-summary-invoice-linked {
  display: grid;
  gap: 8px;
}
.ledger-summary-invoice-id-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ledger-summary-invoice-linked .ledger-invoice-id {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-100);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.ledger-summary-invoice-meta {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 10px;
  font-size: 11.5px;
}
.ledger-summary-invoice-meta > div {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
}
.ledger-summary-invoice-meta dt {
  margin: 0;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-500);
}
.ledger-summary-invoice-meta dd {
  margin: 0;
  color: var(--text-200);
  font-weight: 500;
  font-feature-settings: "tnum" 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ledger-summary-invoice-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}
.ledger-summary-invoice-actions .ledger-invoice-btn {
  padding: 5px 9px;
  font-size: 11.5px;
}

/* MOBILE FALLBACK */
@media (max-width: 720px) {
  .ledger-head.ledger-head--compact {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .ledger-head--compact .ledger-id { font-size: 22px; }
  .ledger-head-meta { flex-wrap: wrap; white-space: normal; }
  .ledger-split {
    grid-template-columns: 1fr;
    column-gap: 0;
    row-gap: 18px;
  }
  .ledger-pane--form {
    padding-right: 0;
  }
  .ledger-pane--form::after { display: none; }
  .ledger-pane--summary {
    position: static;
    order: -1;
  }
  .ledger-row-2 { grid-template-columns: 1fr 1fr; gap: 12px; }
}
@media (max-width: 480px) {
  .ledger-row-2,
  .ledger-row-2--even { grid-template-columns: 1fr; }
  .ledger-summary-context-row { grid-template-columns: 96px 1fr; }
  .ledger-summary-invoice-meta { grid-template-columns: 1fr; }
}

/* ======================================================================
   v2.12.31 — Liveliness pass (Illustrated Receipt + grafts)
   Workflow ref: wf_c23c037f-574
   ====================================================================== */

/* === Context: illustrated receipt header (P1 base + P2 staggered edge) === */
.ledger-summary-context--illustrated {
  gap: 12px;
  padding-bottom: 18px;
}
.ledger-summary-context--illustrated .ledger-ctx-row {
  position: relative;
  display: grid;
  grid-template-columns: 152px 1fr;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 4px 10px;
  border-radius: 7px;
  transition: background 180ms ease;
}
.ledger-summary-context--illustrated .ledger-ctx-row:hover {
  background: linear-gradient(90deg, rgba(200, 160, 75, 0.09), rgba(200, 160, 75, 0) 75%);
}
.ledger-ctx-edge {
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--gold-500), rgba(200, 160, 75, 0.25));
  transform: scaleY(0);
  transform-origin: top center;
  animation: srCtxEdgeIn 460ms cubic-bezier(.22, .9, .3, 1) forwards;
  transition: background 180ms ease, box-shadow 180ms ease;
}
.ledger-ctx-row[data-sr-ctx-stagger="0"] .ledger-ctx-edge { animation-delay: 120ms; }
.ledger-ctx-row[data-sr-ctx-stagger="1"] .ledger-ctx-edge { animation-delay: 260ms; }
.ledger-ctx-row:hover .ledger-ctx-edge {
  background: var(--gold-500);
  box-shadow: 0 0 6px rgba(200, 160, 75, 0.45);
}
@keyframes srCtxEdgeIn {
  0%   { transform: scaleY(0); opacity: 0; }
  60%  { opacity: 1; }
  100% { transform: scaleY(1); opacity: 1; }
}
.ledger-ctx-key {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-400);
  white-space: nowrap;
}
.ledger-ctx-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(200, 160, 75, 0.16), rgba(200, 160, 75, 0.08));
  border: 1px solid rgba(200, 160, 75, 0.30);
  color: var(--gold-600);
  flex: 0 0 26px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.ledger-ctx-row--company:hover .ledger-ctx-glyph {
  transform: rotate(-3deg) scale(1.06);
  border-color: var(--gold-500);
  box-shadow: 0 2px 6px -2px rgba(200, 160, 75, 0.35);
}
.ledger-ctx-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fdf6e6, #f4e6c4);
  border: 1.5px solid var(--gold-500);
  color: var(--maroon-600);
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  font-family: inherit;
  flex: 0 0 28px;
  box-shadow: 0 1px 3px rgba(124, 28, 38, 0.12), inset 0 0 0 2px #fff;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.ledger-ctx-row--person:hover .ledger-ctx-avatar {
  transform: scale(1.08);
  box-shadow: 0 3px 8px -2px rgba(124, 28, 38, 0.22), inset 0 0 0 2px #fff;
}
.ledger-ctx-val {
  margin: 0;
  color: var(--text-100);
  font-weight: 600;
  font-size: 14.5px;
  font-feature-settings: "tnum" 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 180ms ease;
}
.ledger-ctx-val--person { font-weight: 600; }
@media (max-width: 480px) {
  .ledger-summary-context--illustrated .ledger-ctx-row {
    grid-template-columns: 128px 1fr;
    gap: 9px;
  }
}

/* === Breakdown: QTY x UNIT = TOTAL as three chips === */
.ledger-summary-total-breakdown--calc {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 6px;
  margin-top: 6px;
  font-feature-settings: "tnum" 1;
  font-variant-numeric: tabular-nums;
}
.ledger-calc-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 3px 8px 4px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(124, 28, 38, 0.14);
  border-radius: 5px;
  font-size: 12px;
  color: var(--text-200);
  font-weight: 600;
  line-height: 1.3;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.24s ease;
}
.ledger-calc-chip:hover {
  border-color: rgba(124, 28, 38, 0.28);
  background: rgba(255, 255, 255, 0.85);
}
.ledger-calc-chip-label {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-500);
}
.ledger-calc-chip-val { color: var(--text-100); }
.ledger-calc-chip--total {
  padding: 3px 9px 4px;
  background: linear-gradient(180deg, rgba(200, 160, 75, 0.14), rgba(200, 160, 75, 0.08));
  border-color: rgba(200, 160, 75, 0.34);
  color: var(--maroon-600);
  font-weight: 700;
}
.ledger-calc-op {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-500);
  opacity: 0.7;
  padding: 0 1px;
}
.ledger-calc-op--eq { color: var(--gold-600); opacity: 0.95; }

/* === Invoice: faux-paper card with gold rule + glyph + time-to-due ring === */
.ledger-invoice-paper {
  position: relative;
  padding: 9px 11px 8px;
  background: linear-gradient(180deg, #fffdf7 0%, #ffffff 70%);
  border: 1px solid rgba(124, 28, 38, 0.14);
  border-radius: 7px;
  box-shadow:
    0 2px 4px rgba(124, 28, 38, 0.05),
    0 8px 18px -10px rgba(124, 28, 38, 0.18);
  overflow: hidden;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.ledger-invoice-paper:hover {
  box-shadow:
    0 3px 6px rgba(124, 28, 38, 0.07),
    0 14px 24px -12px rgba(124, 28, 38, 0.25);
}
.ledger-invoice-paper-stripe {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-500) 0%, var(--gold-600) 50%, var(--gold-500) 100%);
}
.ledger-invoice-paper-head {
  padding-top: 1px;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ledger-invoice-id-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.ledger-invoice-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  border-radius: 4px;
  background: rgba(124, 28, 38, 0.06);
  border: 1px solid rgba(124, 28, 38, 0.18);
  color: var(--maroon-600);
  flex: 0 0 19px;
}
.ledger-invoice-glyph svg { width: 11px; height: 12px; }
.ledger-invoice-paper .ledger-invoice-id {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-100);
  font-variant-numeric: tabular-nums;
}
.ledger-invoice-paper .ledger-invoice-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px 2px 7px;
}
.ledger-invoice-paper .ledger-invoice-status.is-paid     { color: #2F7F4F; background: rgba(70, 185, 125, 0.10); border-color: rgba(70, 185, 125, 0.32); }
.ledger-invoice-paper .ledger-invoice-status.is-overdue  { color: var(--maroon-600); background: rgba(124, 28, 38, 0.08); border-color: rgba(124, 28, 38, 0.32); }
.ledger-invoice-status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.ledger-invoice-status.is-pending .ledger-invoice-status-dot,
.ledger-invoice-status.is-draft .ledger-invoice-status-dot,
.ledger-invoice-status.is-in-review .ledger-invoice-status-dot {
  animation: srInvDotPulse 1.6s ease-in-out infinite;
}
@keyframes srInvDotPulse {
  0%, 100% { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
  50%      { box-shadow: 0 0 0 4px transparent; opacity: 0.55; }
}
.ledger-invoice-paper-meta {
  padding: 5px 0 4px;
  border-top: 1px dashed rgba(124, 28, 38, 0.14);
  border-bottom: 1px dashed rgba(124, 28, 38, 0.14);
  margin-bottom: 5px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 10px;
}
.ledger-invoice-paper-meta dt {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-500);
  margin: 0;
}
.ledger-invoice-paper-meta dd {
  margin: 0;
  color: var(--text-100);
  font-weight: 600;
  font-size: 11.5px;
  font-feature-settings: "tnum" 1;
}
.ledger-invoice-paper-meta .ledger-invoice-sym {
  color: var(--gold-600);
  font-weight: 600;
  margin-right: 2px;
}
.ledger-invoice-due {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ledger-invoice-ring {
  --p: 50;
  --ring-color: var(--gold-500);
  width: 18px; height: 18px;
  border-radius: 50%;
  background: conic-gradient(var(--ring-color) calc(var(--p) * 1%), rgba(124, 28, 38, 0.10) 0);
  position: relative;
  flex: 0 0 18px;
}
.ledger-invoice-ring::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--navy-700);
  box-shadow: inset 0 0 0 1px rgba(124, 28, 38, 0.08);
}
.ledger-invoice-paper[data-status="overdue"] .ledger-invoice-ring { --ring-color: var(--maroon-600); }
.ledger-invoice-paper[data-status="paid"] .ledger-invoice-ring { --ring-color: #46B97D; --p: 100; }
.ledger-invoice-paper-actions {
  display: flex;
  gap: 6px;
}
.ledger-invoice-paper-actions .ledger-invoice-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.ledger-invoice-paper-actions .ledger-invoice-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px -2px rgba(124, 28, 38, 0.22);
}
.ledger-invoice-paper-actions .ledger-invoice-btn svg { flex: 0 0 11px; }

/* === Extras — animations, focus glow, section icons, ambient polish === */

/* 1. Hero status pill: pulsing dot for in-flight states */
.ledger-meta-chip.is-pending,
.ledger-meta-chip.is-submitted,
.ledger-meta-chip.is-in-review,
.ledger-meta-chip.is-draft {
  position: relative;
  padding-left: 18px;
}
.ledger-meta-chip.is-pending::before,
.ledger-meta-chip.is-submitted::before,
.ledger-meta-chip.is-in-review::before,
.ledger-meta-chip.is-draft::before {
  content: "";
  position: absolute;
  left: 8px; top: 50%;
  width: 6px; height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 currentColor;
  animation: srPulseDot 1.8s ease-out infinite;
}
@keyframes srPulseDot {
  0%   { box-shadow: 0 0 0 0   rgba(200, 160, 75, 0.55); }
  70%  { box-shadow: 0 0 0 6px rgba(200, 160, 75, 0);    }
  100% { box-shadow: 0 0 0 0   rgba(200, 160, 75, 0);    }
}

/* 2. Section title icons: replaces flat gold tick when modifier classes set */
.ledger-pane-title.ledger-pane-title--icon {
  padding-left: 22px;
  overflow: visible;
}
.ledger-pane-title.ledger-pane-title--icon::before {
  width: 14px;
  height: 14px;
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px 14px;
  border-radius: 0;
  background-image: none;
  /* override the v2.12.28 gold tick: width 14, height 14 */
}
.ledger-eyebrow.ledger-pane-title--icon {
  position: relative;
  padding-left: 18px;
}
.ledger-eyebrow.ledger-pane-title--icon::before {
  content: "";
  position: absolute;
  left: 0; top: 50%; transform: translateY(-50%);
  width: 12px; height: 12px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px 12px;
}
.ledger-pane-title--order::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%239A7B1E' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M2 5l6-3 6 3-6 3z'/><path d='M2 5v6l6 3 6-3V5'/><path d='M8 8v6'/></svg>");
}
.ledger-pane-title--pricing::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%239A7B1E' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M3 1.5h10v13l-1.7-1.2L9.6 14.5 8 13.3 6.4 14.5 4.7 13.3 3 14.5z'/><path d='M5.5 5h5M5.5 7.5h5M5.5 10h3.5'/></svg>");
}
.ledger-pane-title--invoice::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%239A7B1E' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M2.5 1.5h11v13.2l-1.8-1.4-1.8 1.4-1.9-1.4-1.8 1.4-1.9-1.4-1.8 1.4z'/><path d='M5 5.2h6M5 8h6M5 10.6h4'/></svg>");
}

/* 3. Field focus glow — replaces bare underline-only */
.ledger-body .field input:focus,
.ledger-body .field select:focus,
.ledger-body .field textarea:focus,
.ledger-body .ledger-money:focus-within {
  outline: none;
  box-shadow:
    0 1px 0 0 var(--gold-500),
    0 0 0 3px rgba(200, 160, 75, 0.16),
    0 4px 14px -8px rgba(124, 28, 38, 0.22);
  transition: box-shadow 180ms ease;
}
/* The peso money input sits INSIDE .ledger-money, which already shows the focus
   ring via :focus-within. Suppress the inner input's own ring so there isn't a
   doubled box/line around the number. */
.ledger-body .ledger-money input:focus { box-shadow: none; }

/* 4. Total Order Value — no glow/kick/breath animation (kept static). */

/* 5. Summary Rail entrance lift */
.ledger-pane--summary .ledger-summary-card {
  animation: srCardRise 460ms cubic-bezier(.22, .9, .3, 1) both;
}
.ledger-pane--summary .ledger-summary-card:hover {
  box-shadow:
    0 14px 32px -16px rgba(124, 28, 38, 0.28),
    0 2px 6px rgba(124, 28, 38, 0.06);
}
@keyframes srCardRise {
  0%   { transform: translateY(6px); opacity: 0; }
  100% { transform: translateY(0);   opacity: 1; }
}

/* 6. Ticket perforation hint on Summary Rail's left edge */
.ledger-summary-card::after {
  content: "";
  position: absolute;
  left: -5px;
  top: 28px;
  bottom: 28px;
  width: 4px;
  background-image: radial-gradient(circle at 2px 4px, rgba(124, 28, 38, 0.22) 1.5px, transparent 2px);
  background-size: 4px 10px;
  background-repeat: repeat-y;
  pointer-events: none;
  opacity: 0.65;
}

/* 7. Reduced-motion kill switch */
@media (prefers-reduced-motion: reduce) {
  .ledger-ctx-edge { animation: none; transform: scaleY(1); }
  .ledger-meta-chip.is-pending::before,
  .ledger-meta-chip.is-submitted::before,
  .ledger-meta-chip.is-in-review::before,
  .ledger-meta-chip.is-draft::before { animation: none; }
  .ledger-summary-total-amount,
  .ledger-summary-total-amount.is-pulse {
    animation: none;
    text-shadow: none;
    transition: none;
  }
  .ledger-pane--summary .ledger-summary-card { animation: none; }
  .ledger-invoice-status.is-pending .ledger-invoice-status-dot,
  .ledger-invoice-status.is-draft .ledger-invoice-status-dot,
  .ledger-invoice-status.is-in-review .ledger-invoice-status-dot { animation: none; }
}

/* ======================================================================
   v2.12.38 — Partner-side invoice card + read-only Unit Price +
   smooth fresh-bill entrance animation
   Workflow ref: wf_d5b6a07f-8c9
   ====================================================================== */

/* === Partner-side invoice card — calm receipt variant === */
.ledger-invoice-paper--partner {
  position: relative;
  cursor: default;
  background: linear-gradient(180deg, #fffefb 0%, #fdfbf5 100%);
  border-color: rgba(124, 28, 38, 0.14);
}
.ledger-invoice-paper--partner:hover {
  transform: none;
  box-shadow: 0 1px 2px rgba(20, 8, 10, 0.04);
}
.ledger-invoice-paper--partner .ledger-invoice-fresh-ribbon {
  display: inline-flex;
  position: absolute;
  top: 6px;
  right: 8px;
  align-items: center;
  gap: 5px;
  padding: 3px 9px 3px 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #5a3a06;
  background: linear-gradient(180deg, #fde9a3 0%, #f6cf6a 100%);
  border: 1px solid rgba(168, 124, 24, 0.45);
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(184, 134, 28, 0.25);
  line-height: 1;
  z-index: 1;
}
/* In compact modal, give the head row top padding so the ribbon sits above
   the BL-XXXX without overlapping the eyebrow above the card. */
.modal--sr-edit .ledger-invoice-paper--partner.is-fresh .ledger-invoice-paper-head {
  padding-top: 18px;
}
.ledger-invoice-fresh-time {
  font-weight: 500;
  color: #7a5510;
  opacity: 0.9;
  letter-spacing: 0.01em;
  text-transform: none;
}
.ledger-invoice-fresh-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #b8721a;
  box-shadow: 0 0 0 0 rgba(184, 114, 26, 0.55);
  animation: partnerFreshPulse 1.6s ease-out infinite;
}
@keyframes partnerFreshPulse {
  0%   { box-shadow: 0 0 0 0 rgba(184, 114, 26, 0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(184, 114, 26, 0); }
  100% { box-shadow: 0 0 0 0 rgba(184, 114, 26, 0); }
}
.ledger-invoice-paper--partner .ledger-invoice-sent-line {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 2px 0 5px;
  padding: 4px 0 0;
  font-size: 10px;
  color: var(--text-500, #6b5f63);
  border-top: 1px dashed rgba(124, 28, 38, 0.10);
}
.ledger-invoice-paper--partner.is-fresh .ledger-invoice-sent-line {
  color: var(--maroon-600, var(--maroon-600));
  font-weight: 600;
}
.ledger-invoice-paper-actions--partner {
  display: block;
  margin-top: 4px;
}
.ledger-invoice-btn--view-full {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 7px 11px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--maroon-600, var(--maroon-600));
  background: var(--navy-700);
  border: 1px solid rgba(124, 28, 38, 0.32);
  border-radius: 7px;
  text-decoration: none;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease, transform 80ms ease;
}
.ledger-invoice-btn--view-full:hover {
  background: var(--maroon-600, var(--maroon-600));
  color: #fff;
  border-color: var(--maroon-600, var(--maroon-600));
}
.ledger-invoice-btn--view-full:active { transform: translateY(1px); }
.ledger-invoice-btn--view-full svg { transition: transform 140ms ease; }
.ledger-invoice-btn--view-full:hover svg { transform: translateX(2px); }
.ledger-invoice-settled-pill {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #2F7F4F;
  background: rgba(70, 185, 125, 0.10);
  border: 1px solid rgba(70, 185, 125, 0.40);
  border-radius: 7px;
}
@media (max-width: 640px) {
  .ledger-invoice-paper--partner { padding: 12px 12px 11px; }
  .ledger-invoice-paper--partner .ledger-invoice-fresh-ribbon { right: 8px; top: -8px; font-size: 9.5px; }
}

/* === Read-only Unit Price (partner view) === */
.ledger-money--readonly {
  background: rgba(20, 8, 10, 0.025);
  border-bottom-color: rgba(20, 8, 10, 0.10) !important;
  cursor: not-allowed;
}
.ledger-money--readonly:hover { border-bottom-color: rgba(20, 8, 10, 0.10) !important; }
.ledger-money--readonly:focus-within { border-bottom-color: rgba(20, 8, 10, 0.10) !important; }
.ledger-money--readonly .ledger-money-sym {
  color: var(--text-400, #8a7f82);
}
.ledger-money-sym--gold {
  color: var(--gold-600, #B98C1F) !important;
  font-weight: 700;
}
.ledger-body .ledger-money--readonly input,
.ledger-money--readonly input {
  color: var(--text-100, #4a4145);
  font-weight: 500;
  cursor: not-allowed;
  caret-color: transparent;
  -webkit-text-fill-color: var(--text-100, #4a4145);
  background: transparent;
}
.ledger-money--readonly input::-webkit-outer-spin-button,
.ledger-money--readonly input::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}
.ledger-money--readonly input[type=number] { -moz-appearance: textfield; }
.ledger-price-lock-glyph {
  display: inline-flex;
  margin-left: 4px;
  color: var(--text-400, #8a7f82);
  vertical-align: -1px;
}
.ledger-price-readonly-hint {
  margin: 4px 0 0;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-400, #8a7f82);
  font-style: italic;
}
.ledger-price-field--readonly label .ledger-optional { display: none; }

/* === Fresh-bill entrance animation === */
@keyframes partnerInvoiceRise {
  0%   { opacity: 0; transform: translateY(10px) scale(0.985); }
  60%  { opacity: 1; transform: translateY(-1px) scale(1.003); }
  100% { opacity: 1; transform: translateY(0)    scale(1); }
}
@keyframes partnerInvoiceGoldGlow {
  0%   { box-shadow: 0 0 0 0 rgba(214, 168, 56, 0.0),  0 1px 2px rgba(20, 8, 10, 0.04); }
  35%  { box-shadow: 0 0 0 6px rgba(214, 168, 56, 0.22), 0 6px 18px rgba(214, 168, 56, 0.18); }
  100% { box-shadow: 0 0 0 0 rgba(214, 168, 56, 0.0),  0 1px 2px rgba(20, 8, 10, 0.04); }
}
@keyframes partnerInvoiceStripeShimmer {
  0%   { background-position: -120% 0; }
  100% { background-position: 220% 0; }
}
.ledger-invoice-paper--partner.is-fresh {
  animation: partnerInvoiceRise 520ms cubic-bezier(0.22, 0.61, 0.36, 1) both,
             partnerInvoiceGoldGlow 1800ms ease-out 300ms 1;
}
.ledger-invoice-paper--partner.is-fresh .ledger-invoice-paper-stripe {
  background-image: linear-gradient(
    90deg,
    rgba(214, 168, 56, 0.0) 0%,
    rgba(255, 230, 150, 0.95) 50%,
    rgba(214, 168, 56, 0.0) 100%
  );
  background-size: 200% 100%;
  animation: partnerInvoiceStripeShimmer 1400ms ease-out 200ms 1 forwards;
}
.ledger-invoice-paper--partner:not(.is-fresh) {
  animation: partnerInvoiceRise 320ms ease-out both;
}
@media (prefers-reduced-motion: reduce) {
  .ledger-invoice-paper--partner,
  .ledger-invoice-paper--partner.is-fresh,
  .ledger-invoice-paper--partner.is-fresh .ledger-invoice-paper-stripe,
  .ledger-invoice-fresh-dot {
    animation: none !important;
  }
}

/* ======================================================================
   v2.12.39 — Status Pipeline Rail + Schedule + DP Upload + status picker
   Workflow ref: w2ibpm1a1
   ====================================================================== */

/* === Pipeline Rail (8-step horizontal stepper) === */
.sr-pipeline {
  margin: 12px 0 18px;
  padding: 12px 14px 14px;
  background: linear-gradient(180deg, #fffdf7 0%, #ffffff 100%);
  border: 1px solid rgba(124, 28, 38, 0.10);
  border-radius: 10px;
  box-shadow: 0 1px 0 rgba(124, 29, 42, 0.04), 0 1px 3px rgba(0, 0, 0, 0.04);
}
.sr-pipeline__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; gap: 8px;
}
.sr-pipeline__title {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--maroon-600);
}
.sr-sidebadge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(124, 28, 38, 0.08);
  color: var(--maroon-600);
  border: 1px solid rgba(124, 28, 38, 0.32);
  border-radius: 999px;
  line-height: 1.4;
}
.sr-sidebadge small {
  font-weight: 500;
  letter-spacing: 0;
  text-transform: lowercase;
  opacity: 0.7;
}
/* v2.14.2 — phase-grouped pipeline: clean 5-phase bar + expandable full rail. */
.sr-pipeline--phased .srp-stepcount {
  font-size: 11px; font-weight: 600; color: var(--maroon-600);
  background: rgba(124, 28, 38, 0.08); padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.srp-phases { display: flex; gap: 6px; margin: 2px 0 8px; }
.srp-seg { flex: 1; height: 7px; border-radius: 999px; background: rgba(124, 28, 38, 0.12); }
.srp-seg.is-done { background: var(--gold-600); }
.srp-seg.is-active { background: var(--maroon-600); }
.srp-phase-labels { display: flex; gap: 6px; margin-bottom: 14px; }
.srp-plabel { flex: 1; font-size: 11px; line-height: 1.25; color: var(--text-400); }
.srp-plabel.is-done { color: var(--gold-600); }
.srp-plabel.is-active { color: var(--maroon-600); font-weight: 600; }
.srp-current { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.srp-pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--maroon-600); color: #fff;
  font-size: 13.5px; font-weight: 600; padding: 6px 13px; border-radius: 8px;
}
.srp-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold-500); flex-shrink: 0; }
.srp-next { font-size: 12.5px; color: var(--text-400); }
.srp-detail { margin-top: 12px; }
.srp-detail__summary {
  cursor: pointer; font-size: 12.5px; color: var(--maroon-600); font-weight: 500;
  padding: 6px 0; list-style: none; user-select: none;
}
.srp-detail__summary::-webkit-details-marker { display: none; }
.srp-detail__summary::before { content: "▾ "; }
.srp-detail[open] .srp-detail__summary::before { content: "▴ "; }
/* ============================================================
   v2.12.66 — Pipeline rail (SCROLLING FLEX variant)
   Winning design (35/50) from workflow wywi2uray. Replaces the
   8-column grid that couldn't fit the 11-status canonical pipeline.
   Steps remain readable; the rail scrolls horizontally with thin
   gold scrollbar + edge fade-mask. Auto-centers the current step
   on modal mount (see js/views/requests.js).
   ============================================================ */
/* v2.12.70 — Pipeline rail no-scroll mode.
   11 canonical steps × 88px + 10 × 4px gaps = 1008px, fits the 1320px
   modal with room. All steps visible at once; no scrollbar, no fade
   mask, no auto-center JS needed.
   Steps shrink responsively at narrower viewports via a single max-
   width rule on the rail container. */
.sr-pipeline {
  overflow: hidden;
}
.sr-pipeline__rail {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
  margin: 0;
  padding: 6px 12px 10px;
  list-style: none;
  position: relative;
  width: 100%;
}

.sr-step {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 1;
  position: relative;
  text-align: center;
}
/* v2.12.70 — connector line spans from prev step center → current step
   center. Uses dynamic offsets (-50% to +50%) so it works regardless
   of flex-share step width. */
.sr-step + .sr-step::before {
  content: "";
  position: absolute;
  top: 13px;
  left: -50%;
  right: 50%;
  height: 2px;
  background: rgba(124, 28, 38, 0.18);
  z-index: -1;
}
.sr-step.is-done + .sr-step::before,
.sr-step.is-done + .sr-step.is-done::before,
.sr-step.is-current::before {
  background: linear-gradient(90deg, var(--gold-600), var(--maroon-600));
}

.sr-step__node {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--navy-700);
  border: 2px solid rgba(124, 28, 38, 0.28);
  font-size: 11px; font-weight: 700;
  color: var(--text-400, #8a7f82);
  transition: background 200ms ease, border-color 200ms ease, color 200ms ease, transform 180ms ease;
}
.sr-step__num { font-style: normal; }
.sr-step__check { display: none; color: #fff; }
.sr-step__label {
  /* v2.12.67 (Patch 1A) — word-SAFE wrap. Was word-break: break-word
     which split "DOWNPAYMENT" mid-character as "DOWNPAYMEN T".
     overflow-wrap: break-word + word-break: normal + hyphens: none
     forces breaks at spaces only. 2-line clamp via -webkit-box. */
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-300, #6d5f64);
  text-align: center;
  line-height: 1.15;
  max-width: 100%;
  min-height: 2.3em;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sr-step.is-done .sr-step__node {
  background: var(--gold-600);   /* v2.12.70 — darker gold for AA contrast against white check */
  border-color: var(--gold-600);
  color: #fff;
}
.sr-step.is-done .sr-step__num { display: none; }
.sr-step.is-done .sr-step__check { display: inline-block; }
.sr-step.is-done .sr-step__check svg,
.sr-step.is-done .sr-step__check {
  color: #fff;
}
.sr-step.is-current .sr-step__node {
  background: var(--maroon-600);
  border-color: var(--maroon-600);
  color: #fff;
  transform: scale(1.12);
  box-shadow: 0 0 0 4px rgba(124, 28, 38, 0.14);
  animation: srPipelinePulse 1.8s ease-out infinite;
}
.sr-step.is-current .sr-step__label {
  color: var(--maroon-600);
  font-weight: 700;
}
@keyframes srPipelinePulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(124, 28, 38, 0.14); }
  50%      { box-shadow: 0 0 0 7px rgba(124, 28, 38, 0.06); }
}

/* === Pipeline status picker (under the rail) === */
.sr-pipeline__picker {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(124, 28, 38, 0.12);
}
.sr-pipeline__picker-label {
  display: block;
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-400, #8a7f82);
  margin-bottom: 6px;
}
.sr-pipeline__picker-row {
  display: flex; gap: 8px; align-items: stretch;
}
.sr-pipeline__select {
  flex: 1;
  padding: 7px 12px;
  font-size: 13px;
  background: var(--navy-700);
  border: 1px solid rgba(124, 28, 38, 0.22);
  border-radius: 6px;
  color: var(--text-100);
  font-weight: 500;
  font-family: inherit;
}
.sr-pipeline__select:focus {
  outline: none;
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(200, 160, 75, 0.20);
}
.sr-pipeline__apply {
  padding: 7px 16px;
  background: var(--maroon-600);
  color: #fff;
  border: 1px solid var(--maroon-600);
  border-radius: 6px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 140ms ease, transform 80ms ease;
}
.sr-pipeline__apply:hover { background: #6a1820; }
.sr-pipeline__apply:active { transform: translateY(1px); }

/* === Schedule band (Lead time + DP upload) in Summary Rail === */
.ledger-summary-schedule {
  padding-top: 18px;
  border-top: 1px dashed rgba(124, 28, 38, 0.16);
  display: grid; gap: 12px;
}
.sr-leadtime {
  display: grid; gap: 4px;
}
.sr-leadtime__lbl {
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-400, #8a7f82);
}
.sr-leadtime__input {
  width: 100%;
  padding: 6px 10px;
  font-size: 13px; font-weight: 500;
  background: var(--navy-700);
  border: 1px solid rgba(124, 28, 38, 0.18);
  border-radius: 6px;
  color: var(--text-100);
  font-family: inherit;
}
.sr-leadtime__input:focus {
  outline: none;
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(200, 160, 75, 0.18);
}
.sr-leadtime__val {
  font-size: 14px; font-weight: 600;
  color: var(--text-100);
  padding: 6px 0;
}

/* === DP proof upload === */
.sr-dp-upload {
  display: block;
}
.sr-dp-trigger {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(200, 160, 75, 0.08), rgba(200, 160, 75, 0.04));
  border: 1.5px dashed rgba(200, 160, 75, 0.50);
  border-radius: 8px;
  color: var(--maroon-600);
  cursor: pointer;
  font-size: 12px;
  transition: background 160ms ease, border-color 160ms ease;
}
.sr-dp-trigger:hover {
  background: linear-gradient(180deg, rgba(200, 160, 75, 0.14), rgba(200, 160, 75, 0.07));
  border-color: var(--gold-600);
}
.sr-dp-trigger strong {
  display: block;
  font-weight: 700; font-size: 12px;
  color: var(--maroon-600);
}
.sr-dp-trigger small {
  display: block;
  font-size: 10.5px; color: var(--text-400, #8a7f82);
  margin-top: 2px;
  font-weight: 500;
}
.sr-dp-uploaded {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: rgba(70, 185, 125, 0.10);
  border: 1px solid rgba(70, 185, 125, 0.40);
  border-radius: 7px;
  color: #2F7F4F;
  font-size: 12px; font-weight: 600;
}
.sr-dp-uploaded__name {
  flex: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sr-dp-uploaded__view {
  background: var(--navy-700);
  border: 1px solid rgba(70, 185, 125, 0.40);
  color: #2F7F4F;
  padding: 3px 9px;
  font-size: 11px; font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  transition: background 140ms ease;
}
.sr-dp-uploaded__view:hover {
  background: rgba(70, 185, 125, 0.15);
}
/* Down-payment submission — clean numbered steps (amount → review proof →
   submit). Attaching stages a preview; nothing sends until the partner submits. */
.sr-dp-upload { min-width: 0; max-width: 100%; }
.sr-dp-steps {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}
.sr-dp-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}
.sr-dp-step__no {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--maroon-600);
  color: #fff;
  font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.sr-dp-step__body { flex: 1 1 auto; min-width: 0; max-width: 100%; }
.sr-dp-preview { margin-top: 8px; min-width: 0; }
/* Compact uploaded-file chip — filename only, no big image. Filename truncates
   with an ellipsis so a long name can never push the ticket wider. */
.sr-dp-filechip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid rgba(70, 185, 125, 0.40);
  background: rgba(70, 185, 125, 0.08);
  border-radius: 8px;
  color: #2F7F4F;
  font-size: 12px;
  min-width: 0;
}
.sr-dp-filechip__icon { flex: 0 0 auto; }
.sr-dp-filechip__name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.sr-dp-filechip__btn {
  flex: 0 0 auto;
  background: var(--navy-700);
  border: 1px solid rgba(70, 185, 125, 0.40);
  color: #2F7F4F;
  padding: 3px 9px;
  font-size: 11px; font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
}
.sr-dp-filechip__btn:hover { background: rgba(70, 185, 125, 0.14); }
.sr-dp-submit-btn { width: 100%; }
/* Shown when the order is at Waiting for Downpayment but admin hasn't sent the
   invoice yet — the partner waits before any proof upload appears. */
.sr-dp-await-invoice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 11px;
  border: 1px dashed rgba(200, 160, 75, 0.45);
  background: rgba(200, 160, 75, 0.06);
  border-radius: 8px;
  color: var(--text-300);
  font-size: 12px;
  line-height: 1.4;
}
.sr-dp-await-invoice svg { flex: 0 0 auto; color: var(--gold-600); margin-top: 1px; }
/* DP vs Full payment choice — two selectable cards that auto-fill the amount. */
.sr-dp-choice {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 10px;
  min-width: 0;
}
.sr-dp-choice__btn {
  flex: 1 1 130px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 8px 10px;
  border: 1.5px solid rgba(124, 28, 38, 0.18);
  border-radius: 8px;
  background: var(--navy-700);
  cursor: pointer;
  text-align: left;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}
.sr-dp-choice__btn strong { font-size: 12px; font-weight: 700; color: var(--maroon-600); }
.sr-dp-choice__btn small { font-size: 11px; color: var(--text-400); font-weight: 600; white-space: nowrap; }
.sr-dp-choice__btn:hover { border-color: rgba(124, 28, 38, 0.40); }
.sr-dp-choice__btn.is-active {
  border-color: var(--maroon-600);
  background: rgba(124, 28, 38, 0.05);
  box-shadow: 0 0 0 1px var(--maroon-600) inset;
}
/* Request-time Payment Method block in the summary rail. */
.ledger-summary-paymethod {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(124, 28, 38, 0.14);
}
.ledger-summary-paymethod-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-600);
  margin-bottom: 8px;
}
.sr-paymethod-choice { margin: 0; }
.sr-paymethod-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.sr-paymethod-badge--downpayment {
  color: #1f6b76;
  background: rgba(38, 110, 120, 0.10);
  border: 1px solid rgba(38, 110, 120, 0.24);
}
.sr-paymethod-badge--full {
  color: #246e40;
  background: rgba(36, 110, 64, 0.10);
  border: 1px solid rgba(36, 110, 64, 0.22);
}

/* v2.12.66 — rail stays a horizontal scroller on every viewport; only the
   step basis + gap tighten on phones. */
@media (max-width: 720px) {
  .sr-pipeline__rail { gap: 10px; padding: 6px 14px 8px; }
  .sr-step { flex-basis: 78px; }
  .sr-step__label { max-width: 74px; font-size: 8.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .sr-pipeline__rail { scroll-behavior: auto; }
  .sr-step.is-current .sr-step__node { animation: none; }
}

/* ======================================================================
   v2.12.40 — Compact "Fit on Screen" overrides for Stock Request modal
   Scoped to .modal--sr-edit so other ledger modals are unaffected.
   Workflow ref: w2ldh1x8j (Compact-Everything won 9/7).
   ====================================================================== */

/* HERO — 90px → 64px */
.modal--sr-edit .ledger-head.ledger-head--compact {
  /* v2.12.54: horizontal padding clears the floating corner buttons
     (back-arrow + close-X are at left/right:10px, 32px wide → occupy
     10-42px from each modal edge). 50px keeps the eyebrow/id/badge/date
     well away from the buttons with no visual collision. */
  padding: 14px 50px 12px;
  margin-bottom: 12px;
}
.modal--sr-edit .ledger-head--compact .ledger-eyebrow {
  font-size: 9.5px;
  letter-spacing: 0.14em;
  margin-bottom: 2px;
}
.modal--sr-edit .ledger-head--compact .ledger-id {
  font-size: 22px;
  line-height: 1.05;
  cursor: default;
  position: relative;
}
.modal--sr-edit .ledger-head.ledger-head--compact::after {
  width: 48px;
  height: 1px;
}
.modal--sr-edit .ledger-head--compact .ledger-meta-chip {
  padding: 3px 12px;
  font-size: 11px;
  font-weight: 700;
}
/* Status pulse dot eats 18px on the left — restore that padding when the
   .is-pending / .is-submitted / .is-in-review / .is-draft modifier is set
   so the dot doesn't overlap the label text inside the compact modal. */
.modal--sr-edit .ledger-head--compact .ledger-meta-chip.is-pending,
.modal--sr-edit .ledger-head--compact .ledger-meta-chip.is-submitted,
.modal--sr-edit .ledger-head--compact .ledger-meta-chip.is-in-review,
.modal--sr-edit .ledger-head--compact .ledger-meta-chip.is-draft {
  padding-left: 22px;
}
.modal--sr-edit .ledger-head-meta {
  font-size: 11.5px;
  gap: 8px;
}
@media (max-height: 800px) {
  .modal--sr-edit .ledger-head-meta-line { display: none; }
}

/* PIPELINE RAIL — bigger labels + numbers for clarity */
.modal--sr-edit .sr-pipeline {
  margin: 6px 0 8px;
  padding: 8px 14px 10px;
}
.modal--sr-edit .sr-pipeline__head {
  margin-bottom: 8px;
}
.modal--sr-edit .sr-pipeline__title { font-size: 11px; }
/* v2.12.66 — modal-scoped trims to the scrolling rail.
   Smaller flex-basis + slightly bolder labels to keep visual weight inside
   the compact SR edit modal without breaking the global scrolling defaults. */
/* v2.12.70 — modal rail: each step expands to its share of the
   available width via flex: 1 1 0 (set in the base rule). No fixed
   width so all 11 steps fit on screen regardless of viewport. */
.modal--sr-edit .sr-pipeline__rail { gap: 4px; padding: 6px 10px 8px; }
.modal--sr-edit .sr-step {
  flex: 1 1 0;
  min-width: 0;
}
.modal--sr-edit .sr-step__node {
  width: 24px; height: 24px;
  font-size: 11.5px;
  font-weight: 800;
  border-width: 2px;
}
.modal--sr-edit .sr-step.is-todo .sr-step__node {
  color: var(--text-200);
  border-color: rgba(124, 28, 38, 0.30);
}
.modal--sr-edit .sr-step.is-current .sr-step__node {
  transform: scale(1.15);
  box-shadow: 0 0 0 3px rgba(124, 28, 38, 0.18);
}
/* v2.12.67 (Patch 1C) — readability bump (9.5 → 10) + max-width matches
   new 110px step. word-break: normal so words never split mid-character. */
.modal--sr-edit .sr-step__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-300);
  max-width: 102px;
  line-height: 1.2;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: none;
  min-height: 2.4em;
}
.modal--sr-edit .sr-step.is-current .sr-step__label {
  color: var(--maroon-600);
  font-weight: 800;
}
/* v2.12.70 — Done labels were text-200 which read as washed-out grey on
   the cream pipeline background. text-400 + weight 700 + maroon accent
   for completed steps gives proper readability. */
.modal--sr-edit .sr-step.is-done .sr-step__label {
  color: var(--maroon-600);
  font-weight: 700;
}
/* v2.12.70 — Tighten label font at narrow viewports since flex-share
   now controls width. */
@media (max-width: 1100px) {
  .modal--sr-edit .sr-step__label { font-size: 9px; }
}
@media (max-width: 900px) {
  .modal--sr-edit .sr-step__label { font-size: 8.5px; }
}
/* v2.12.44 — Status picker on the LEFT pane (above Order), maroon card */
.modal--sr-edit .sr-status-update--left {
  display: grid;
  gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(124, 28, 38, 0.05), rgba(124, 28, 38, 0.02));
  border: 1px solid rgba(124, 28, 38, 0.18);
  border-left: 3px solid var(--maroon-600);
  border-radius: 8px;
  margin-bottom: 14px;
}
.modal--sr-edit .sr-status-update__label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--maroon-600);
}
.modal--sr-edit .sr-status-update__row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.modal--sr-edit .sr-status-update__select {
  flex: 1;
  padding: 6px 12px;
  font-size: 13px;
  font-family: inherit;
  background: var(--navy-700);
  border: 1px solid rgba(124, 28, 38, 0.22);
  border-radius: 6px;
  color: var(--text-100);
  min-width: 0;
}
.modal--sr-edit .sr-status-update__select:focus {
  outline: none;
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(200, 160, 75, 0.20);
}
.modal--sr-edit .sr-status-update__apply {
  padding: 6px 18px;
  font-size: 12.5px;
  font-weight: 700;
  background: var(--maroon-600);
  color: #fff;
  border: 1px solid var(--maroon-600);
  border-radius: 6px;
  cursor: pointer;
  transition: background 140ms ease;
}
.modal--sr-edit .sr-status-update__apply:hover { background: #6a1820; }

/* SPLIT — tighter padding */
.modal--sr-edit .ledger-split {
  column-gap: 32px;
  align-items: start;
}
.modal--sr-edit .ledger-pane--form {
  padding-right: 32px;
  gap: 12px;
}

/* FORM PANE — tighten to make room for the picker */
.modal--sr-edit .ledger-notice {
  padding: 6px 12px;
  font-size: 11.5px;
  margin: 0 0 8px;
}
.modal--sr-edit .reorder-grid {
  gap: 6px;
  margin-top: 4px;
}
.modal--sr-edit .reorder-chip {
  padding: 6px 10px;
  font-size: 11.5px;
}
.modal--sr-edit .ledger-pane-title {
  font-size: 11.5px;
  margin-bottom: 8px;
}
.modal--sr-edit .ledger-pane--form .field { gap: 4px; }
.modal--sr-edit .ledger-pane--form .field > label {
  font-size: 10.5px;
  margin-bottom: 1px;
}
.modal--sr-edit .ledger-pane--form .field input,
.modal--sr-edit .ledger-pane--form .field select,
.modal--sr-edit .ledger-pane--form .field textarea {
  font-size: 14px;
  padding: 5px 0 6px;
}
.modal--sr-edit .ledger-pane--form textarea#srNotes {
  height: 28px; min-height: 28px;
}
.modal--sr-edit .ledger-row-2,
.modal--sr-edit .ledger-row-2--even {
  gap: 12px 24px;
}
.modal--sr-edit .ledger-advanced--inline {
  margin-top: 4px;
  padding-top: 8px;
}
.modal--sr-edit .ledger-advanced--inline > summary {
  font-size: 11px;
}

/* SUMMARY RAIL — picker on left now, so right rail can have moderate spacing */
.modal--sr-edit .ledger-summary-card {
  padding: 12px 14px;
  gap: 12px;
}
.modal--sr-edit .ledger-summary-context {
  gap: 6px;
  padding-bottom: 10px;
}
.modal--sr-edit .ledger-summary-context--illustrated .ledger-ctx-row {
  padding: 4px 4px 4px 8px;
  /* v2.12.67 (Patch 2) — uniform 28px row height + 20px key/val flex
     boxes so the COMPANY (with glyph) and REQUESTED BY (text-only)
     rows sit on the same vertical centerline. Without this, the
     Requested By row collapses to ~12px because v2.12.66 removed the
     S avatar — the values then stagger instead of centering. */
  grid-template-columns: 104px 1fr;
  align-items: center;
  min-height: 28px;
  column-gap: 10px;
}
.modal--sr-edit .ledger-ctx-avatar,
.modal--sr-edit .ledger-ctx-glyph {
  width: 20px; height: 20px;
  flex-basis: 20px;
  font-size: 10px;
}
.modal--sr-edit .ledger-ctx-key {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-300, #6b5e60);
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.modal--sr-edit .ledger-ctx-val {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-900);
  display: inline-flex;
  align-items: center;
  min-height: 20px;
}
.modal--sr-edit .ledger-summary-total {
  gap: 3px;
}
.modal--sr-edit .ledger-summary-total-label {
  font-size: 9.5px;
}
.modal--sr-edit .ledger-eyebrow.ledger-eyebrow--sm {
  font-size: 9.5px;
  margin: 0 0 4px;
}
.modal--sr-edit .ledger-summary-total-amount {
  font-size: 28px;
}
.modal--sr-edit .ledger-summary-total-amount .ledger-total-sym {
  font-size: 15px;
}
.modal--sr-edit .ledger-summary-total-breakdown {
  font-size: 10.5px;
  margin-top: 0;
}
.modal--sr-edit .ledger-calc-chip {
  font-size: 10.5px;
  padding: 1px 6px 2px;
}
.modal--sr-edit .ledger-calc-chip-label { font-size: 8px; }
.modal--sr-edit .ledger-summary-schedule {
  padding-top: 10px;
  gap: 8px;
}
.modal--sr-edit .sr-leadtime__lbl {
  font-size: 9.5px;
}
.modal--sr-edit .sr-leadtime__input {
  font-size: 11.5px;
  padding: 3px 8px;
}
.modal--sr-edit .sr-dp-trigger {
  padding: 6px 10px;
  font-size: 11px;
}
.modal--sr-edit .sr-dp-trigger strong { font-size: 11px; }
.modal--sr-edit .sr-dp-trigger small { font-size: 10px; }
.modal--sr-edit .ledger-summary-invoice {
  padding-top: 10px;
  gap: 8px;
}
/* Invoice paper card — tighter */
.modal--sr-edit .ledger-invoice-paper {
  padding: 8px 12px 10px;
}
.modal--sr-edit .ledger-invoice-paper-head { margin-bottom: 6px; }
.modal--sr-edit .ledger-invoice-paper--partner .ledger-invoice-sent-line {
  margin: 2px 0 6px;
  padding: 4px 0 0;
  font-size: 10.5px;
}
.modal--sr-edit .ledger-invoice-btn--view-full {
  padding: 7px 10px;
  font-size: 11.5px;
}
/* DP upload zone — tighter */
.modal--sr-edit .sr-dp-trigger { padding: 6px 10px; }
.modal--sr-edit .sr-dp-trigger svg { width: 14px; height: 14px; }
.modal--sr-edit .sr-dp-trigger small { font-size: 9.5px; }
.modal--sr-edit .ledger-invoice-paper-meta {
  padding: 6px 0 5px;
  margin-bottom: 8px;
}
/* v2.12.67 (Patch 4A) — readability bump on the invoice paper card.
   Was dt 8.5px (sub-AA) / dd 11.5px. Now 10px / 12.5px with AA contrast. */
.modal--sr-edit .ledger-invoice-paper-meta dt {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-300, #6b5e60);
  letter-spacing: 0.03em;
}
.modal--sr-edit .ledger-invoice-paper-meta dd {
  font-size: 12.5px;
  color: var(--text-900);
}
.modal--sr-edit .ledger-invoice-paper .ledger-invoice-id { font-size: 12.5px; }
.modal--sr-edit .ledger-invoice-paper-actions .ledger-invoice-btn {
  padding: 5px 10px;
  font-size: 11px;
}

/* FOOTER 60 → 48 */
.modal--sr-edit .modal-footer.ledger-footer {
  padding: 10px 24px;
}
.modal--sr-edit .modal-footer.ledger-footer .btn {
  padding: 6px 14px;
  font-size: 12.5px;
}

/* SURPRISE TOUCHES — zero added height */
/* 1. Active pipeline node gets a soft gold halo on top of maroon pulse */
.modal--sr-edit .sr-step.is-current .sr-step__node {
  box-shadow: 0 0 0 3px rgba(124, 28, 38, 0.14),
              0 0 0 6px rgba(200, 160, 75, 0.10);
}
/* 2. Total Order Value — plain, static number (no gold sheen/animation). */
.modal--sr-edit #srTotal {
  color: var(--text-100);
}
/* 3. Hero ID gets a pulsing gold # caret on hover */
.modal--sr-edit .ledger-head--compact .ledger-id:hover::before {
  content: "#";
  position: absolute;
  left: -16px;
  top: 0;
  color: var(--gold-600);
  opacity: 0.55;
  font-size: 22px;
  font-weight: 600;
  animation: srHeroPulse 1.4s ease-in-out infinite;
}
@keyframes srHeroPulse {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 0.75; }
}

/* v2.12.42 — Edit history (under Advanced in left pane, visible to both roles) */
.modal--sr-edit .sr-edit-history { margin-top: 4px; }
.modal--sr-edit .sr-edit-history > summary {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-300);
}
.modal--sr-edit .sr-edit-history__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  padding: 0 6px;
  margin-left: 6px;
  height: 16px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(124, 28, 38, 0.10);
  color: var(--maroon-600);
  border-radius: 999px;
  letter-spacing: 0;
}
.modal--sr-edit .sr-edit-history__list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  max-height: 180px;
  overflow-y: auto;
  border-left: 2px solid rgba(124, 28, 38, 0.18);
  padding-left: 12px;
  display: grid;
  gap: 8px;
}
.modal--sr-edit .sr-edit-history__item {
  position: relative;
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 6px;
  align-items: start;
}
.modal--sr-edit .sr-edit-history__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold-500);
  margin-top: 5px;
  margin-left: -16px;
  box-shadow: 0 0 0 2px #fff;
}
.modal--sr-edit .sr-edit-history__item:first-child .sr-edit-history__dot {
  background: var(--maroon-600);
}
.modal--sr-edit .sr-edit-history__body {
  display: grid;
  gap: 1px;
}
.modal--sr-edit .sr-edit-history__row1 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.modal--sr-edit .sr-edit-history__status {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-100);
}
.modal--sr-edit .sr-edit-history__when {
  font-size: 10.5px;
  color: var(--text-400);
  font-weight: 500;
}
.modal--sr-edit .sr-edit-history__row2 {
  font-size: 10.5px;
  color: var(--text-400);
  font-weight: 500;
}
.modal--sr-edit .sr-edit-history__note {
  margin-left: 4px;
  font-style: italic;
}
/* Account the change came from: @username + a small role chip. */
.modal--sr-edit .sr-edit-history__acct {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 5px;
  color: var(--text-500);
}
.modal--sr-edit .sr-edit-history__acct::before { content: '·'; margin-right: 1px; opacity: 0.6; }
.modal--sr-edit .sr-edit-history__role {
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--maroon-tint);
  color: var(--maroon-600);
  font-weight: 600;
  font-size: 9.5px;
}
.modal--sr-edit .sr-edit-history__acct--gone { font-style: italic; color: var(--text-400); }

/* Viewport safety: collapse decorative bits on tight viewports */
@media (max-height: 820px) {
  .modal--sr-edit .ledger-head-meta-line { display: none; }
  .modal--sr-edit .ledger-summary-card { gap: 8px; padding: 10px 12px; }
  .modal--sr-edit .ledger-summary-total-amount { font-size: 24px; }
  .modal--sr-edit .ledger-summary-total-amount .ledger-total-sym { font-size: 13px; }
  .modal--sr-edit .sr-pipeline { padding: 6px 12px 8px; margin: 4px 0 6px; }
  .modal--sr-edit .ledger-head.ledger-head--compact {
    padding: 10px 44px 8px;
    margin-bottom: 8px;
  }
  .modal--sr-edit .ledger-head--compact .ledger-id { font-size: 20px; }
}
@media (max-height: 720px) {
  .modal--sr-edit .ledger-summary-context { padding-bottom: 6px; }
  .modal--sr-edit .ledger-summary-context .ledger-ctx-row { padding-top: 0; padding-bottom: 0; }
  .modal--sr-edit .sr-pipeline__head { margin-bottom: 6px; }
  .modal--sr-edit .ledger-summary-total-amount { font-size: 22px; }
}

/* Mobile fallback */
@media (max-width: 720px) {
  .modal--sr-edit .ledger-split { grid-template-columns: 1fr; }
  .modal--sr-edit .ledger-pane--summary { position: static; }
}

@media (prefers-reduced-motion: reduce) {
  .modal--sr-edit .ledger-head--compact .ledger-id:hover::before { animation: none; }
}

/* ---------- Toast ---------- */
.toast-root {
  position: fixed;
  bottom: 24px;
  right: 24px;
  /* v2.12.53: was 200 — toasts were rendering BEHIND modal backdrops (z=1300).
     Documented layer scale puts toast at 1400, above modal but below peek/cmd-palette. */
  z-index: 1400;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: var(--navy-700);
  border: 1px solid var(--navy-500);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  min-width: 280px;
  max-width: 380px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--info); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast-icon { width: 18px; height: 18px; flex-shrink: 0; }
.toast.success .toast-icon { fill: var(--success); }
.toast.error .toast-icon { fill: var(--danger); }
.toast.info .toast-icon { fill: var(--info); }
.toast.warning .toast-icon { fill: var(--warning); }
.toast-text { font-size: 13px; flex: 1; }
.toast-title { font-weight: 600; margin-bottom: 2px; }
.toast-desc { color: var(--text-400); font-size: 12px; }

/* ---------- Layout helpers ---------- */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.mt-0 { margin-top: 0 !important; }
/* .mt-1..8 / .mb-1..8 canonical defs live in the --space token block below.
   (Removed the old hardcoded 8/16/24 duplicates that were silently overridden.) */
.text-muted { color: var(--text-400); }
.text-mono { font-family: var(--font-mono); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-gold { color: var(--gold-500); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }
/* Hide number-input spinners across all form fields (matches the ledger forms) */
.field input[type="number"]::-webkit-outer-spin-button,
.field input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.field input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.fw-600 { font-weight: 600; }
.tabular { font-variant-numeric: tabular-nums; }

/* ---------- Action icon button (in tables) ---------- */
.row-actions { display: inline-flex; gap: 4px; }
.row-actions button {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  color: var(--text-400);
  transition: var(--transition);
}
.row-actions button:hover { background: var(--navy-500); color: var(--gold-500); }
.row-actions button.danger:hover { color: var(--danger); }
.row-actions svg { width: 14px; height: 14px; fill: currentColor; }
/* Collapsed cluster: a single "⋯" menu trigger replaces the icon row. */
.row-actions-collapsed { gap: 0; }
.row-actions-trigger svg { width: 16px; height: 16px; }

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--navy-500);
  margin-bottom: 20px;
}
.tab {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-400);
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  margin-bottom: -1px;
}
.tab:hover { color: var(--text-100); }
.tab.active { color: var(--gold-500); border-color: var(--gold-500); }

/* ---------- Chips ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--navy-600);
  border: 1px solid var(--navy-500);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-300);
}
.chip.gold { background: rgba(212, 175, 55, 0.12); border-color: var(--gold-500); color: var(--gold-500); }

/* ---------- Stat row ---------- */
.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--navy-500);
}
.stat-row:last-child { border-bottom: none; }
.stat-row .lbl { color: var(--text-400); font-size: 13px; }
.stat-row .val { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Activity feed ---------- */
.activity { display: flex; flex-direction: column; gap: 4px; }
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--navy-600);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 32px; height: 32px;
  background: var(--navy-600);
  border-radius: 50%;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.activity-dot svg { width: 14px; height: 14px; fill: var(--gold-500); }
.activity-dot.in { background: var(--success-bg); }
.activity-dot.in svg { fill: var(--success); }
.activity-dot.out { background: var(--warning-bg); }
.activity-dot.out svg { fill: var(--warning); }
.activity-body { flex: 1; min-width: 0; }
.activity-title { font-size: 13px; color: var(--text-100); }
.activity-meta { font-size: 11px; color: var(--text-500); margin-top: 2px; }

/* ---------- Line items editor ---------- */
.line-items {
  background: var(--navy-800);
  border: 1px solid var(--navy-500);
  border-radius: var(--radius-md);
  padding: 8px;
}
.line-items-row {
  display: grid;
  grid-template-columns: 2fr 80px 110px 32px;
  gap: 8px;
  align-items: center;
  padding: 4px 0;
}
.line-items-head {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-500);
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 4px 0;
}
.line-items input, .line-items select {
  background: var(--navy-700);
  border: 1px solid var(--navy-500);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  color: var(--text-100);
  outline: none;
  width: 100%;
}
.line-items input:focus, .line-items select:focus { border-color: var(--gold-500); }
.line-items-total {
  display: flex;
  justify-content: space-between;
  padding: 10px 8px 4px;
  margin-top: 6px;
  border-top: 1px dashed var(--navy-500);
  font-weight: 600;
}

/* ---------- Settings sections ---------- */
.section {
  background: var(--navy-700);
  border: 1px solid var(--navy-500);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
}
.section-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--navy-500);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.section-header h3 { font-size: 14px; font-weight: 600; }
.section-header p { font-size: 12px; color: var(--text-400); margin: 2px 0 0; }
.section-body { padding: 20px; }

/* ---------- Channel pills ---------- */
.channel-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.channel-shopify { background: rgba(149, 191, 70, 0.15); color: #95BF46; }
.channel-shopee { background: rgba(238, 77, 45, 0.15); color: #EE4D2D; }
.channel-lazada { background: rgba(15, 20, 110, 0.25); color: #7589FF; }
.channel-tiktok { background: rgba(255, 255, 255, 0.08); color: #E6E6E6; }
.channel-website { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.channel-manual { background: var(--navy-600); color: var(--text-300); }

/* ---------- Charts ---------- */
.chart-wrap {
  position: relative;
  height: 280px;
}

/* ---------- Confirm dialog ---------- */
.confirm-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: grid; place-items: center;
  margin: 0 auto 12px;
}
.confirm-icon svg { width: 22px; height: 22px; }
.confirm-icon.danger { background: var(--danger-bg); }
.confirm-icon.danger svg { fill: var(--danger); }
.confirm-icon.warning { background: var(--warning-bg); }
.confirm-icon.warning svg { fill: var(--warning); }
.confirm-message { text-align: center; }
.confirm-message h3 { font-size: 16px; margin-bottom: 6px; }
.confirm-message p { color: var(--text-400); font-size: 13px; margin: 0; }

/* ---------- Login Screen ---------- */
/* LOGIN SHELL — BFM building hero photo background
   Strategy: low-opacity blurred photo behind a cream/navy wash + radial
   fade-to-edge mask so the .login-card stays the visual anchor.
   Photo = ambient atmosphere, never the subject.
   File: ./login-bg.jpg */
.login-shell {
  position: relative;
  isolation: isolate;
  /* Scroll when the card is taller than the viewport (e.g. the longer register
     form). "safe center" keeps it centered when it fits but aligns to the top
     and stays scroll-reachable when it overflows, so the logo is never clipped. */
  overflow-y: auto;
  overflow-x: hidden;
  height: 100vh;
  max-height: 100vh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;
  padding: 24px;
  background-color: var(--navy-900);
}

/* Photo layer — behind everything, dimmed + blurred + radially masked.
   Uses `cover` so the photo fills the viewport edge-to-edge with no empty
   bands. The 4:3 photo will be cropped vertically on 16:9 viewports — the
   wordmark stays centered so the brand still reads through the card. */
.login-shell::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: url('../login-bg.jpg?v=3');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: 0.30;
  filter: blur(4px) saturate(0.85) contrast(0.95) brightness(0.95);
  -webkit-mask-image: radial-gradient(
    ellipse 110% 110% at 50% 50%,
    #000 30%,
    rgba(0, 0, 0, 0.92) 65%,
    rgba(0, 0, 0, 0.65) 90%,
    rgba(0, 0, 0, 0.4) 100%
  );
          mask-image: radial-gradient(
    ellipse 110% 110% at 50% 50%,
    #000 30%,
    rgba(0, 0, 0, 0.92) 65%,
    rgba(0, 0, 0, 0.65) 90%,
    rgba(0, 0, 0, 0.4) 100%
  );
  pointer-events: none;
  will-change: transform;
}

/* Wash layer — readability gradient (default = dark theme variant) */
.login-shell::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg,
      rgba(11, 18, 32, 0.65) 0%,
      rgba(11, 18, 32, 0)    18%,
      rgba(11, 18, 32, 0)    82%,
      rgba(11, 18, 32, 0.78) 100%),
    linear-gradient(135deg,
      rgba(11, 18, 32, 0.72) 0%,
      rgba(11, 18, 32, 0.55) 50%,
      rgba(28, 22, 18, 0.60) 100%);
  pointer-events: none;
}

/* Light theme: photo recedes less, wash uses cream tones — overrides at top of file */
body.theme-light .login-shell::after {
  opacity: 0.30;
  filter: blur(4px) saturate(0.90) contrast(0.95) brightness(1.0);
}
.login-card {
  position: relative;
  z-index: 1;
  background-color: rgba(22, 28, 44, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-xl);
  padding: 36px 36px 32px;
  width: 100%;
  max-width: 420px;
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
          backdrop-filter: blur(16px) saturate(1.1);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 20px 56px -16px rgba(0, 0, 0, 0.65),
    0 4px 14px -4px rgba(0, 0, 0, 0.45);
  animation: loginIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
body.theme-light .login-card {
  /* Opaque pure white (#fff) — the exact same ground as the logo PNG — so the
     logo lockup blends flush with no visible plate (the frosted translucency
     used to tint the card off-white and break the match). */
  background-color: #ffffff;
  border: 1px solid rgba(38, 24, 28, 0.08);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 18px 48px -16px rgba(38, 24, 28, 0.28),
    0 4px 12px -4px rgba(38, 24, 28, 0.14);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .login-card { background-color: rgba(22, 28, 44, 0.96); }
  body.theme-light .login-card { background-color: #ffffff; }
}
@keyframes loginIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
/* Full logo lockup on the login / awaiting screens. The PNG has a white
   ground, so rounded corners make it read as a clean plate on the dark-theme
   card and blend seamlessly on the light-theme (default) card. */
.login-logo-wrap { text-align: center; margin-bottom: 16px; }
.login-logo-full {
  /* logo-login.png is the pre-trimmed lockup (~1.68:1), so display it at its
     natural aspect — no object-fit crop (which squished + overlapped the text). */
  display: block;
  width: 100%;
  max-width: 200px;
  height: auto;
  margin: 0 auto;
  border-radius: 12px;
}
/* The light-theme login card is now opaque pure white (#fff) — the same ground
   as the logo PNG — so the white box is invisible on the card with no blend mode
   needed. (Dark theme, if ever re-enabled, would still want multiply.) */
.login-card { isolation: isolate; }
.login-brand-mark {
  width: 48px;
  height: 48px;
  background: transparent;
  display: block;
  overflow: visible;
}
.login-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.login-brand-name {
  font-size: 16px;
  font-weight: 600;
}
.login-brand-sub {
  font-size: 11px;
  color: var(--gold-500);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 2px;
  font-weight: 600;
}
.login-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.login-subtitle {
  color: var(--text-400);
  font-size: 13px;
  margin: 0 0 20px;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-form .field input {
  padding: 8px 12px;
  font-size: 13.5px;
}
/* Show / hide password toggle (eye button inside the password field) */
.password-wrap { position: relative; }
.password-wrap input { width: 100%; padding-right: 44px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-500);
  transition: color 0.12s, background 0.12s;
}
.password-toggle:hover { color: var(--maroon-600); background: rgba(0, 0, 0, 0.05); }
.password-toggle svg { display: block; }
/* Account-type picker on the registration screen */
.role-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}
@media (max-width: 480px) {
  .role-picker { grid-template-columns: 1fr; }
}
.role-option {
  position: relative;
  display: block;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--navy-500, #cbd5e1);
  background: var(--navy-900, #fff);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .08s ease;
}
.role-option:hover {
  border-color: var(--gold-500, #c8a04b);
}
.role-option.active {
  border-color: var(--gold-500, #c8a04b);
  background: rgba(200, 160, 75, 0.08);
}
.role-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.role-option-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-100, #0f172a);
  margin-bottom: 2px;
}
.role-option-desc {
  font-size: 12px;
  color: var(--text-400, #64748b);
  line-height: 1.35;
}
.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-300);
  cursor: pointer;
  user-select: none;
}
.login-remember input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--gold-500);
}
.login-error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 500;
}
.login-submit {
  padding: 12px 16px !important;
  font-size: 14px !important;
  margin-top: 4px;
}
.login-submit:disabled { opacity: 0.7; cursor: progress; }
.login-switch {
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-400);
}
.login-switch a {
  color: var(--gold-500);
  font-weight: 600;
}
.login-switch a:hover { color: var(--gold-400); text-decoration: underline; }
.login-info {
  margin-top: 20px;
  padding: 12px 14px;
  background: var(--navy-800);
  border: 1px solid var(--navy-500);
  border-left: 3px solid var(--gold-500);
  border-radius: var(--radius-md);
  font-size: 12.5px;
  color: var(--text-300);
  line-height: 1.5;
}
.login-info strong { color: var(--gold-500); }
.login-info code {
  background: var(--navy-900);
  border: 1px solid var(--navy-500);
  color: var(--gold-400);
  padding: 1px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
}
.login-info .text-xs { font-size: 11px; color: var(--text-500); }
.login-footer {
  margin-top: 28px;
  text-align: center;
  font-size: 12px;
  color: var(--text-500);
  position: relative;
  z-index: 1;
}

/* ---------- Report nav (grouped tabs) ---------- */
/* Two-level report picker: a row of category tabs, then only that category's
   reports. Listing all 21 reports at once burned ~250px of chrome before any
   data appeared, and the category labels drifted out of alignment. */
.rp-cats {
  display: flex; gap: 4px; flex-wrap: wrap;
  border-bottom: 1px solid var(--navy-500); margin-bottom: 12px;
}
.rp-cat {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; background: transparent; border: 0;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  font-size: 13.5px; font-weight: 600; color: var(--text-400);
  transition: color .15s ease, border-color .15s ease;
}
.rp-cat:hover { color: var(--text-100); }
.rp-cat.is-active { color: var(--maroon-500); border-bottom-color: var(--maroon-500); }
.rp-cat-n {
  font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px;
  background: var(--navy-600); color: var(--text-500); font-variant-numeric: tabular-nums;
}
.rp-cat.is-active .rp-cat-n { background: var(--maroon-tint); color: var(--maroon-500); }
.rp-list { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }

/* Report header — names what you're looking at and holds its Print action, so the
   page header no longer carries a button detached from the report it prints. */
.rp-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--navy-600);
}
.rp-head-text { min-width: 0; }
.rp-title { font-size: 18px; font-weight: 700; color: var(--text-100); margin: 0; }
.rp-desc { margin: 3px 0 0; font-size: 12.5px; color: var(--text-400); }
.report-nav-btn {
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-300);
  background: var(--navy-800);
  border: 1px solid var(--navy-600);
  border-radius: 7px;
  transition: var(--transition);
  white-space: nowrap;
}
.report-nav-btn:hover { color: var(--text-100); border-color: var(--gold-500); }
.report-nav-btn.active { background: var(--gold-500); color: #241203; border-color: var(--gold-500); font-weight: 700; }
@media (max-width: 720px) {
  .rp-cats { flex-wrap: nowrap; overflow-x: auto; }
  .rp-cat { flex: 0 0 auto; padding: 9px 12px; font-size: 13px; }
  .rp-head { flex-direction: column; gap: 10px; }
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-top: 1px solid var(--navy-500);
  background: var(--navy-800);
  gap: 12px;
  flex-wrap: wrap;
}
.pagination-info { font-size: 12px; color: var(--text-400); }
.pagination-info strong { color: var(--text-100); }
.pagination-controls { display: flex; gap: 4px; align-items: center; }
.pagination-pages {
  padding: 0 10px;
  font-size: 12px;
  color: var(--text-300);
}
.pagination-pages strong { color: var(--gold-500); }

/* ---------- Date filter ---------- */
.date-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.date-filter select,
.date-filter input[type="date"] {
  background: var(--navy-800);
  border: 1px solid var(--navy-500);
  border-radius: var(--radius-md);
  padding: 7px 10px;
  color: var(--text-100);
  font-size: 12px;
  outline: none;
  font-family: inherit;
}
.date-filter input[type="date"] {
  color-scheme: dark;
}
.date-filter select:focus,
.date-filter input[type="date"]:focus {
  border-color: var(--gold-500);
}

/* ---------- Notifications dropdown ---------- */
.notif-popover {
  position: fixed;
  top: calc(var(--topbar-h) + 8px);
  right: 16px;
  width: 380px;
  max-height: 70vh;
  background: var(--navy-700);
  border: 1px solid var(--navy-500);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: notifIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes notifIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.notif-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--navy-500);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.notif-title { font-weight: 600; font-size: 14px; }
.notif-body { overflow-y: auto; flex: 1; }
.notif-section {
  padding: 12px 18px;
  border-bottom: 1px solid var(--navy-600);
}
.notif-section:last-child { border-bottom: none; }
.notif-section-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-500);
  margin-bottom: 8px;
  font-weight: 700;
}
.notif-item {
  display: flex;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s;
  align-items: flex-start;
}
.notif-item:hover { background: var(--navy-600); }
.notif-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.notif-icon svg { width: 14px; height: 14px; }
.notif-icon.warn { background: var(--warning-bg); }
.notif-icon.warn svg { fill: var(--warning); }
.notif-icon.info { background: var(--info-bg); }
.notif-icon.info svg { fill: var(--info); }
.notif-icon.success { background: var(--success-bg); }
.notif-icon.success svg { fill: var(--success); }
.notif-text { flex: 1; min-width: 0; }
.notif-text-title { font-size: 13px; color: var(--text-100); font-weight: 500; }
.notif-text-sub { font-size: 11px; color: var(--text-500); margin-top: 2px; }
.notif-empty {
  padding: 30px 20px;
  text-align: center;
  color: var(--text-500);
}
.notif-empty svg { width: 32px; height: 32px; fill: var(--gold-500); opacity: 0.5; margin-bottom: 8px; }

/* ---------- Password strength meter ---------- */
.strength-meter {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.strength-bar {
  height: 4px;
  background: var(--navy-500);
  border-radius: 2px;
  overflow: hidden;
}
.strength-fill {
  height: 100%;
  width: 0;
  transition: width 0.2s ease, background 0.2s ease;
  border-radius: 2px;
}
.strength-fill.danger { background: var(--danger); }
.strength-fill.warning { background: var(--warning); }
.strength-fill.info { background: var(--info); }
.strength-fill.success { background: var(--success); }
.strength-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}
.strength-danger { color: var(--danger); font-weight: 600; }
.strength-warning { color: var(--warning); font-weight: 600; }
.strength-info { color: var(--info); font-weight: 600; }
.strength-success { color: var(--success); font-weight: 600; }
.strength-hint { color: var(--text-500); font-style: italic; }

/* ---------- User chip role indicators ---------- */
.user-role {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.user-role::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  /* Green "active" indicator for every role. */
  background: var(--success);
}
.user-role.is-admin::before,
.user-role.is-staff::before { background: var(--success); }

/* Admin badge in topbar */
.role-badge {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}
.role-badge.admin { background: rgba(212, 175, 55, 0.18); color: var(--gold-500); }
.role-badge.admin-staff { background: rgba(124, 28, 42, 0.16); color: #b23a4a; }
.role-badge.production_manager { background: rgba(168, 124, 24, 0.22); color: #c89933; }
.role-badge.staff { background: rgba(107, 119, 148, 0.22); color: var(--text-200); }
.role-badge.partner { background: rgba(59, 130, 246, 0.18); color: var(--info); }
/* VIP (sister company) — gold badge with maroon text, shown beside Partner. */
.role-badge.vip { background: linear-gradient(135deg, #f3e2b8, #e6c878); color: #7a1420; }
/* VIP terms note on the Stock Request ticket (replaces the DP/Full picker). */
.sr-vip-terms { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: var(--text-300); line-height: 1.4; }
.sr-vip-badge { flex: none; font-size: 10px; font-weight: 800; letter-spacing: .03em; color: #7a1420; background: linear-gradient(135deg, #f3e2b8, #e6c878); padding: 2px 8px; border-radius: 999px; }
/* v2.17 — Admin dashboard read-only overview (checking only, nothing clickable):
   three compact side-by-side cards — Orders stages · Money · Attention. */
.ov-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px; max-width: 1080px;
}
.ov-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-card {
  background: var(--navy-700); border: 1px solid var(--navy-500);
  border-radius: 10px; padding: 12px 14px;
}
.ov-card-lbl {
  font-size: 10.5px; font-weight: 800; letter-spacing: .05em;
  text-transform: uppercase; color: var(--gold-500); margin-bottom: 7px;
}
body.theme-light .ov-card-lbl { color: var(--maroon-600); }
.ov-row { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; color: var(--text-400); padding: 2.5px 0; }
.ov-row b { font-size: 14.5px; font-weight: 800; color: var(--text-100); font-variant-numeric: tabular-nums; }
.ov-row--zero { opacity: .5; }
.ov-row--zero b { font-weight: 600; }
.ov-row--clear { color: var(--success); font-weight: 600; font-size: 13px; }

/* User Management — grouped per company. */
/* The toolbar sits inside the panel, so the shared .table-toolbar padding and
   bottom hairline are correct again -- they were only zeroed while this list
   had no panel to align to. The panel itself takes the full content width;
   .view already caps that at 1600px for very wide monitors. */
.um-toolbar { margin-bottom: 0; }
/* Company groups read as section labels, not as cards. Each was a bordered,
   filled panel with a 3px accent edge and a folder glyph -- a lot of furniture
   for one line of text, and three of the four groups here hold a single person.
   The rows underneath are the content; the label just names them. */
.um-groups { display: flex; flex-direction: column; gap: 22px; padding: 14px 0 2px; }
.um-gcard { border: 0; border-radius: 0; background: none; overflow: visible; }
/* A caption over its rows, not a control -- the group no longer collapses. */
.um-ghead {
  width: 100%; display: flex; align-items: center; gap: 8px;
  /* 14px matches table.data's cell padding so the caption lines up with the
     names below it. The three lines on this panel are deliberately ranked:
     caption --navy-500, row separators --navy-600 (softer). An identical
     weight made the caption read as just another row. */
  padding: 0 14px 7px; border-bottom: 1px solid var(--navy-500);
}
.um-group-lbl {
  font-size: 12px; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-100);
}
body.theme-light .um-group-lbl { color: var(--maroon-700); }
.um-group-n {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 19px; padding: 0 7px; border-radius: 999px;
  font-size: 11px; font-weight: 800;
  /* Maroon text on the maroon tint composites to 2.3:1 on the dark page --
     unreadable. Gold is the dark theme's accent and clears AA at 6:1. */
  background: var(--maroon-tint); color: var(--gold-500);
}
body.theme-light .um-group-n { color: var(--maroon-600); }
.um-gtable { width: 100%; margin: 2px 0 0; }
/* Every row the same height, whether or not the account carries an email under
   its name -- without this the one user with no email sat 2px shorter, which
   the separators made obvious. 56px clears the 34px avatar plus its padding. */
.um-gtable tr { height: 56px; }
/* The shared table rule draws separators in --navy-500, the token labelled
   "borders". On a white panel that reads as a hard rule between every person.
   --navy-600 is the token this file actually labels "rows / dividers".
   Both classes are needed: "table.data td" outweighs a bare ".um-gtable td". */
table.data.um-gtable td { border-bottom-color: var(--navy-600); }
/* Percentages, not pixels. Each company renders its own <table>, so the widths
   must be declared to line the groups up with each other -- but fixed pixels
   meant every screen wider than the columns dumped ALL the leftover into one
   column, opening a single 250px+ hole. Percentages spread that slack across
   the row instead, so the panel can take the full width without one huge gap.
   Last-login is right-aligned so the date sits beside the kebab rather than
   stranded mid-row. */
.um-gtable td:first-child { width: 38%; }
.um-gtable td.um-col-role { width: 26%; }
.um-gtable td.um-col-login { width: 24%; text-align: right; }
.um-gtable td.um-col-act { width: 12%; }
/* A percentage can land under what the content needs, and when it did,
   "Production Staff (Production)" broke apart -- the badge on one line, the
   staff type orphaned on the next. These three hold their line and let the
   name column, which wraps gracefully under its email, absorb the squeeze. */
.um-gtable td.um-col-role,
.um-gtable td.um-col-login,
.um-gtable td.um-col-act { white-space: nowrap; }
/* On a phone the desktop widths total more than the table gets, so let them
   distribute instead. Nothing is dropped: .table-scroll gives every table in
   the app a 600px floor on mobile and scrolls the panel horizontally, and all
   four columns fit inside that -- 221 + 217 + 104 + 58. */
@media (max-width: 720px) {
  .um-gtable td:first-child,
  .um-gtable td.um-col-role,
  .um-gtable td.um-col-act { width: auto; }
}
.um-gtable tr:last-child td { border-bottom: 0; }
.um-row-click { cursor: pointer; }

/* User Management — avatar with status dot (green active / gray inactive /
   amber pending); replaced the all-"Active" STATUS column. */
.um-avatar {
  position: relative; width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 11px; overflow: visible;
}
.um-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.um-status-dot {
  position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px;
  border-radius: 50%; border: 2px solid var(--navy-700);
}
/* "Online now" — activity within the last 10 minutes gets a soft green halo. */
.um-status-dot--online { box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25); }
/* Recent Activity block inside the Edit User modal (read-only, from audit log). */
.um-activity { margin-top: 14px; border-top: 1px solid var(--navy-500); padding-top: 10px; }
.um-activity-title { font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text-500); margin-bottom: 6px; }
.um-activity-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 3px 0; font-size: 12px; }
.um-act-what { color: var(--text-300); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.um-act-when { flex: none; color: var(--text-500); font-size: 11px; }

/* Compact inline VIP chip — request rows, ticket hero, billing rows, aging report. */
.tk-vip {
  display: inline-block; vertical-align: middle;
  font-size: 9.5px; font-weight: 800; letter-spacing: .04em;
  color: #7a1420; background: linear-gradient(135deg, #f3e2b8, #e6c878);
  padding: 1px 7px; border-radius: 999px; margin-left: 2px;
}
/* VIP Finance-acknowledge card on the SR ticket (no down payment → one-click queue). */
.sr-vip-ack { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; margin-bottom: 14px; border: 1px solid var(--gold-500); background: linear-gradient(135deg, rgba(212,175,55,0.10), rgba(124,29,42,0.05)); border-radius: var(--radius-md); }
.sr-vip-ack__txt { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: var(--text-200); line-height: 1.45; }
.sr-vip-ack__btn { align-self: flex-start; padding: 9px 16px; border-radius: 8px; border: 0; background: var(--maroon-600); color: #fff; font-weight: 700; font-size: 13px; cursor: pointer; transition: background .15s; }
.sr-vip-ack__btn:hover { background: var(--maroon-700); }
.user-role.is-partner { color: var(--info); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .search input { width: 160px; }
  .user-meta { display: none; }
  .form-grid { grid-template-columns: 1fr; }
}
/* The sidebar stays fixed on the left on laptops and tablets. It only folds
   into an off-canvas drawer on small phones (<600px). */
@media (max-width: 600px) {
  #app { grid-template-columns: 1fr; }
  .main { margin-left: 0; }
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    transform: translateX(-100%);
    z-index: 50;
    width: var(--sidebar-w);
    transition: transform var(--transition);
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
}
@media (max-width: 600px) {
  .topbar { padding: 0 16px; }
  .view { padding: 16px; }
  .search { display: none; }
  .line-items-row { grid-template-columns: 1fr; }
  .line-items-head { display: none; }
}

/* ---------- Print ---------- */
@media print {
  body { background: white; color: black; }
  .sidebar, .topbar, .page-header-actions, .table-toolbar, .modal-backdrop, .report-nav, .stage-filters, .filter-pills { display: none !important; }
  .main, .view { padding: 0; }
  .card, .kpi, .table-wrap, .section {
    background: white; color: black; border-color: #ccc;
    box-shadow: none; page-break-inside: avoid;
  }
  .kpi-label, .kpi-meta, .card-title { color: #333 !important; }
  .kpi-value, .page-title, .page-header-text h2 { color: black !important; }
  table.data th { background: #f5f5f5; color: black; }
  table.data td, table.data th { border-color: #ddd; }
  .text-gold, .badge.gold { color: #B8941F !important; }
  .kpi::before, .nav-link.active::before { background: #B8941F !important; }
}

/* ---------- Public Order Tracking ---------- */
.track-screen { min-height: 100vh; display: grid; place-items: center; background: var(--navy-900); padding: 24px; }
.track-card { background: var(--navy-700); border: 1px solid var(--navy-500); border-radius: 16px; padding: 32px; max-width: 560px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,0.4); }
.track-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.track-mark { width: 40px; height: 40px; border-radius: 8px; background: linear-gradient(135deg, var(--gold-500), var(--gold-600)); color: var(--navy-900); display: grid; place-items: center; font-weight: 800; }
.track-co { font-weight: 700; font-size: 16px; color: var(--text-100); }
.track-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 28px; }
.track-code { font-size: 18px; font-weight: 700; color: var(--text-100); }
.track-sub { font-size: 12px; color: var(--text-500); margin-top: 4px; }
.track-timeline { display: flex; align-items: center; margin: 24px 0; }
.track-step { display: flex; flex-direction: column; align-items: center; gap: 8px; flex-shrink: 0; }
.track-dot { width: 36px; height: 36px; border-radius: 50%; background: var(--navy-800); border: 2px solid var(--navy-500); color: var(--text-500); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.track-step.done .track-dot { background: var(--success); border-color: var(--success); color: #fff; }
.track-step.active .track-dot { background: var(--gold-500); border-color: var(--gold-500); color: var(--navy-900); box-shadow: 0 0 0 4px rgba(212,175,55,0.2); }
.track-label { font-size: 11px; color: var(--text-500); }
.track-step.done .track-label, .track-step.active .track-label { color: var(--text-100); }
.track-line { flex: 1; height: 2px; background: var(--navy-500); margin: 0 4px; margin-bottom: 26px; }
.track-note { font-size: 13px; color: var(--text-300); text-align: center; margin-top: 16px; }
.track-foot { font-size: 12px; color: var(--text-500); text-align: center; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--navy-500); }
.track-empty { text-align: center; padding: 20px; }
.track-empty h2 { margin: 12px 0 8px; }
.track-empty p { color: var(--text-300); }

/* ---------- Mobile bottom nav ---------- */
.mobile-nav { display: none; }
@media (max-width: 600px) {
  .mobile-nav {
    display: flex;
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--navy-700); border-top: 1px solid var(--navy-500);
    z-index: 50; padding: 4px 0 calc(4px + env(safe-area-inset-bottom));
  }
  .mobile-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 6px 0; color: var(--text-500); text-decoration: none; font-size: 10px;
  }
  .mobile-nav a.active { color: var(--gold-500); }
  .mobile-nav a svg { width: 20px; height: 20px; fill: currentColor; }
  .main { padding-bottom: 64px; }
}

/* ---------- Command palette ---------- */
.cmdp-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200; display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; }
.cmdp { width: 100%; max-width: 520px; background: var(--navy-700); border: 1px solid var(--navy-500); border-radius: 12px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.cmdp input { width: 100%; padding: 16px; background: var(--navy-800); border: none; border-bottom: 1px solid var(--navy-500); color: var(--text-100); font-size: 15px; outline: none; }
.cmdp-list { max-height: 320px; overflow-y: auto; }
.cmdp-item { display: flex; align-items: center; gap: 10px; padding: 11px 16px; cursor: pointer; color: var(--text-300); }
.cmdp-item.active, .cmdp-item:hover { background: var(--navy-600); color: var(--text-100); }
.cmdp-item svg { width: 16px; height: 16px; fill: currentColor; opacity: 0.7; }
.cmdp-empty { padding: 20px; text-align: center; color: var(--text-500); font-size: 13px; }

/* Toast action button (e.g. Undo) */
.toast-action {
  margin-left: auto;
  background: var(--gold-500);
  color: var(--navy-900);
  font-weight: 700;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  align-self: center;
}
.toast-action:hover { background: var(--gold-400); }

/* Inline cell editing */
td.editable-cell { cursor: text; position: relative; }
td.editable-cell:hover { background: var(--navy-600); }
td.editable-cell::after {
  content: '✎';
  opacity: 0;
  font-size: 10px;
  margin-left: 6px;
  color: var(--gold-500);
}
td.editable-cell:hover::after { opacity: 0.6; }
.inline-edit-input {
  width: 100%;
  background: var(--navy-900);
  border: 1px solid var(--gold-500);
  border-radius: 4px;
  padding: 4px 8px;
  color: var(--text-100);
  font-size: 13px;
  outline: none;
  text-align: inherit;
}

/* ---------- Messaging ---------- */
.msg-thread {
  max-height: 420px;
  overflow-y: auto;
  padding: 8px 4px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--navy-900);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}
.msg-bubble {
  max-width: 72%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
}
.msg-bubble.mine { background: linear-gradient(135deg, var(--gold-500), var(--gold-600)); color: var(--navy-900); align-self: flex-end; border-bottom-right-radius: 4px; }
.msg-bubble.other { background: var(--navy-700); color: var(--text-100); align-self: flex-start; border-bottom-left-radius: 4px; border: 1px solid var(--navy-500); }
.msg-meta { font-size: 10px; margin-bottom: 4px; opacity: 0.8; }
.msg-text { white-space: pre-wrap; word-wrap: break-word; }
.msg-composer { display: flex; gap: 8px; align-items: flex-end; }
.msg-composer textarea {
  flex: 1;
  background: var(--navy-800);
  border: 1px solid var(--navy-500);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  color: var(--text-100);
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
  min-height: 60px;
}
.msg-composer textarea:focus { outline: none; border-color: var(--gold-500); }

/* Today's Tasks tiles */
.task-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.task-tile {
  background: var(--navy-800);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--navy-500);
}
.task-tile:hover { background: var(--navy-600); transform: translateY(-1px); }
.task-count { font-size: 22px; font-weight: 800; color: var(--text-100); line-height: 1; }
.task-label { font-size: 12px; font-weight: 600; color: var(--text-200); margin-top: 4px; }
.task-sub { font-size: 10px; color: var(--text-500); margin-top: 2px; }

/* ---------- Compact dashboard ---------- */
/* Tighter cards / KPIs / empty-states so the whole overview reads at a glance
   instead of forcing a long scroll. Scoped to .dash-view so other pages keep
   their roomier card spacing. */
.dash-view .card { padding: 14px; }
.dash-view .card-header { margin-bottom: 10px; }
.dash-view .kpi { padding: 13px 15px; }
.dash-view .kpi-label { margin-bottom: 4px; }
.dash-view .kpi-value { font-size: 21px; }
.dash-view .kpi-meta { margin-top: 6px; font-size: 11px; }
.dash-view .kpi-grid { gap: 12px; margin-bottom: 14px; }
.dash-view .task-tile { padding: 9px 11px; }
.dash-view .task-count { font-size: 18px; }
.dash-view .grid { gap: 12px; }
.dash-view .chart-wrap { height: 190px; }
.dash-view .empty--compact { padding: 14px 12px; }
.dash-view .empty--compact .empty-icon { width: 38px; height: 38px; margin-bottom: 8px; }
.dash-view .empty--compact .empty-icon svg { width: 18px; height: 18px; }
.dash-view .empty--compact h3 { font-size: 13px; margin-bottom: 3px; }
.dash-view .empty--compact p { font-size: 12px; margin-bottom: 0; }
/* Tighter Recent Activity / Recent Edits rows */
.dash-view .activity-item { padding: 7px 0; gap: 10px; }
.dash-view .activity-dot { width: 26px; height: 26px; }
.dash-view .activity-dot svg { width: 12px; height: 12px; }
.dash-view .activity-title { font-size: 12.5px; }
.dash-view .recent-activity-widget .recent-activity-group + .recent-activity-group { margin-top: 10px; }

/* ---------- Order pipeline — connected stage flow ---------- */
.pipeline-flow { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; }
.pipeline-stage {
  flex: 1 1 0; min-width: 78px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 11px 8px;
  border: 1px solid var(--navy-500); border-radius: var(--radius-md);
  background: transparent; cursor: pointer; transition: var(--transition);
}
.pipeline-stage:hover { border-color: var(--gold-500); transform: translateY(-1px); }
.pipeline-stage__count { font-size: 20px; font-weight: 800; line-height: 1; color: var(--text-200); }
.pipeline-stage__label { font-size: 11px; font-weight: 600; color: var(--text-400); text-align: center; }
.pipeline-stage.is-active { background: rgba(212, 175, 55, 0.08); border-color: var(--gold-500); }
.pipeline-stage.is-active .pipeline-stage__count { color: var(--gold-500); }
.pipeline-stage.is-active .pipeline-stage__label { color: var(--text-200); }
.pipeline-arrow { display: flex; align-items: center; justify-content: center; flex: 0 0 auto; padding: 0 1px; }
.pipeline-arrow svg { fill: var(--text-500); }
@media (max-width: 560px) { .pipeline-arrow { display: none; } }

/* ---------- Status Timeline (request view modal) ---------- */
.status-timeline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
  margin: 16px 0 12px;
  padding: 16px 8px 8px;
  background: var(--navy-700);
  border-radius: var(--radius-md);
  position: relative;
}
.status-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  min-width: 0;
}
.status-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 14px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--navy-500);
  z-index: 0;
}
.status-step.done:not(:last-child)::after { background: var(--gold-500); }
.status-step.rejected:not(:last-child)::after { background: var(--danger); }
.status-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--navy-500);
  display: grid;
  place-items: center;
  color: var(--text-500);
  font-size: 13px;
  font-weight: 700;
  z-index: 1;
  border: 2px solid var(--navy-700);
}
.status-step.done .status-dot { background: var(--gold-500); color: var(--navy-900); }
.status-step.current .status-dot {
  background: var(--gold-500);
  color: var(--navy-900);
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.22);
  animation: pulse 1.6s ease-in-out infinite;
}
.status-step.rejected .status-dot { background: var(--danger); color: white; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.22); }
  50% { box-shadow: 0 0 0 8px rgba(212, 175, 55, 0.08); }
}
.status-step-label { font-size: 10px; color: var(--text-300); margin-top: 6px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; line-height: 1.2; padding: 0 2px; }
.status-step.done .status-step-label,
.status-step.current .status-step-label { color: var(--text-100); }
.status-step-sub { font-size: 9px; color: var(--text-500); margin-top: 2px; line-height: 1.3; word-break: break-word; padding: 0 2px; }

/* ---------- Filter Pills ---------- */
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
}
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  background: var(--navy-700);
  border: 1px solid var(--navy-500);
  color: var(--text-200);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.filter-pill:hover { border-color: var(--gold-500); color: var(--text-100); }
.filter-pill.active {
  background: linear-gradient(135deg, var(--gold-500), var(--gold-600));
  color: var(--navy-900);
  border-color: var(--gold-500);
}
.filter-dropdown-btn { padding-right: 10px; }
.filter-dropdown-prefix {
  font-weight: 500;
  opacity: 0.75;
  margin-right: 4px;
}
.filter-pill .pill-count {
  background: rgba(0, 0, 0, 0.15);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 700;
}
.filter-pill.active .pill-count { background: rgba(15, 26, 46, 0.22); }

/* Quick re-order chips (request form) */
.reorder-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.reorder-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 12px;
  background: var(--navy-800);
  border: 1px solid var(--navy-500);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
}
.reorder-chip:hover { border-color: var(--gold-500); }
.reorder-chip.active { border-color: var(--gold-500); background: rgba(192, 145, 47, 0.10); }
.reorder-name { font-size: 13px; font-weight: 600; color: var(--text-100); }
.reorder-meta { font-size: 11px; color: var(--text-400); }

/* Feasibility banner (request review) */
.feasibility-banner { border-radius: var(--radius-md); padding: 10px 12px; margin: 10px 0; font-size: 13px; border: 1px solid var(--navy-500); background: var(--navy-800); color: var(--text-200); }
.feasibility-banner.ok { border-color: var(--success); }
.feasibility-banner.warn { border-color: var(--warning); }
.feasibility-actions { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Partner status card (plain-language "what's happening + what to do") ---------- */
.partner-status-card {
  border: 1px solid var(--navy-500);
  border-left-width: 4px;
  border-radius: var(--radius-md);
  background: var(--navy-800);
  color: var(--text-200);
  padding: 12px 14px;
  margin: 12px 0 14px;
}
.partner-status-card .psc-eyebrow {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-400); margin-bottom: 2px;
}
.partner-status-card .psc-title {
  font-size: 17px; font-weight: 700; color: var(--text-100);
  display: flex; align-items: center; gap: 8px;
}
.partner-status-card .psc-icon { font-size: 18px; line-height: 1; }
.partner-status-card .psc-desc { font-size: 13px; margin-top: 6px; }
.partner-status-card .psc-amount { font-size: 13px; margin-top: 6px; }
.partner-status-card .psc-next {
  font-size: 13px; margin-top: 8px; padding-top: 8px;
  border-top: 1px dashed var(--navy-500); color: var(--text-300);
}
.partner-status-card .psc-next::before { content: "→ "; color: var(--gold-500); font-weight: 700; }
.partner-status-card .psc-eta { font-size: 12.5px; margin-top: 6px; color: var(--text-300); }
.partner-status-card .psc-actions { margin-top: 12px; }
/* Tone accents (left border + title color) */
.partner-status-card.tone-info    { border-left-color: var(--info, var(--info)); }
.partner-status-card.tone-success { border-left-color: var(--success); }
.partner-status-card.tone-warning { border-left-color: var(--warning); background: rgba(192, 145, 47, 0.06); }
.partner-status-card.tone-danger  { border-left-color: var(--danger); }
.partner-status-card.tone-muted   { border-left-color: var(--text-400); }
.partner-status-card.tone-warning .psc-title { color: var(--gold-600, var(--text-100)); }

/* ---------- SLA Badge ---------- */
.sla-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(15, 168, 122, 0.16);
  color: #2BB287;
  margin-left: 6px;
}
.sla-badge.slow { background: rgba(245, 158, 11, 0.16); color: var(--warning); }
.sla-badge.danger { background: rgba(239, 68, 68, 0.16); color: var(--danger); }

/* ---------- Mobile-friendly stat-rows ---------- */
@media (max-width: 540px) {
  .stat-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 8px 0;
  }
  .stat-row .lbl { font-size: 11px; opacity: 0.7; }
  .stat-row .val { font-size: 14px; }
  .status-timeline { padding: 12px 4px 6px; }
  .status-step-label { font-size: 9px; }
  .filter-pills { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .filter-pill { white-space: nowrap; flex-shrink: 0; }
}

/* ---------- Keyboard shortcut cheatsheet ---------- */
.kbd-cheats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; }
@media (max-width: 540px) { .kbd-cheats { grid-template-columns: 1fr; } }
.kbd-cheats .kbd-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--navy-500); }
.kbd-cheats .kbd-row:last-child { border: none; }
.kbd { background: var(--navy-600); color: var(--text-100); border: 1px solid var(--navy-500); padding: 2px 8px; border-radius: 4px; font-family: var(--font-mono); font-size: 11px; font-weight: 600; box-shadow: 0 1px 0 var(--navy-500); }
.kbd-label { color: var(--text-200); font-size: 13px; }

/* ---------- Star rating ---------- */
.star-rating { display: inline-flex; gap: 2px; }
.star-rating .star { color: var(--navy-500); cursor: pointer; font-size: 18px; line-height: 1; transition: var(--transition); }
.star-rating .star.filled { color: var(--gold-500); }
.star-rating.readonly .star { cursor: default; }
.star-rating:not(.readonly) .star:hover,
.star-rating:not(.readonly) .star:hover ~ .star { color: var(--gold-500); }
.rating-summary { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-200); }

/* ---------- Language switcher ---------- */
/* v2.10.4 — Tagalog language switcher removed. Hard-hide any stale markup. */
.lang-switch { display: none !important; }

/* ==========================================================================
   v2.7.2 — Stock Requests UI cleanup
   Tighter spacing, smaller KPIs, compact badges, integrated table search.
   ========================================================================== */

/* Tighter KPI grid */
.kpi-grid { gap: 12px; margin-bottom: 16px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.kpi { padding: 14px 16px; }
.kpi-label { margin-bottom: 4px; font-size: 10.5px; }
.kpi-value { font-size: 22px; font-weight: 700; }

/* Tighter page header */
.page-header { margin-bottom: 14px; }
.page-header-text p { margin-top: 4px; font-size: 12.5px; color: var(--text-400); }

/* Filter pills row — slightly smaller */
.filter-pills { margin: 0 0 10px; gap: 5px; }
.filter-pill { padding: 5px 11px; font-size: 11.5px; }
.filter-pill .pill-count { font-size: 9.5px; padding: 1px 5px; }

/* Make table search inline with toolbar instead of floating above */
.table-toolbar { padding-bottom: 8px; gap: 8px; flex-wrap: wrap; }
.table-search { max-width: 260px; }
.table-search input { font-size: 12.5px; padding: 7px 10px 7px 32px; }

/* Tighter table padding */
table.data th, table.data td { padding: 10px 14px; font-size: 12.5px; }
table.data th { font-size: 10.5px; }
table.data .row-sub { font-size: 10.5px; margin-top: 2px; color: var(--text-500); }
table.data .row-link { font-size: 13px; line-height: 1.3; }

/* Compact badges everywhere */
.badge { padding: 2px 7px; font-size: 10px; line-height: 1.4; }
.badge.no-dot { padding: 2px 6px; font-size: 9.5px; }
.badge::before { width: 5px; height: 5px; }

/* Long-status badge stays on one line + softer wrap */
table.data td .badge { white-space: nowrap; display: inline-flex; align-items: center; }

/* Status badge color tweak — Waiting/In-progress nicer tones */
.badge.warning { background: rgba(245, 158, 11, 0.14); color: var(--warning); }
.badge.gold { background: rgba(212, 175, 55, 0.16); color: var(--gold-500); }

/* SLA badge — tighter to align with status badge */
.sla-badge { padding: 1px 6px; font-size: 9.5px; margin-left: 4px; vertical-align: middle; }

/* Action icons — slightly smaller */
.row-actions button { width: 28px; height: 28px; }
.row-actions svg { width: 14px; height: 14px; }

/* Requested-by cell — keep role badge on the SAME line as the name when possible */
.cell-requester { display: flex; flex-direction: column; gap: 1px; }
.cell-requester .ru-line { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; min-width: 0; }
.cell-requester .ru-name { font-weight: 500; color: var(--text-100); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cell-requester .ru-sub { font-size: 10.5px; color: var(--text-500); }

/* Hide extra noise in Approved column when null */
.cell-actor { display: flex; flex-direction: column; gap: 1px; }
.cell-actor .ac-name { font-size: 12.5px; line-height: 1.3; }
.cell-actor .ac-when { font-size: 10.5px; color: var(--text-500); }

/* Section breathing room reduced */
#reqPills, #rsPills { margin-bottom: 8px; }
#reqTable, #rsTable { margin-top: 0; }

/* ---------- Collapsible Status History dropdown ---------- */
.history-dropdown {
  background: var(--navy-700);
  border: 1px solid var(--navy-500);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-top: 10px;
}
.history-dropdown summary {
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-200);
  list-style: none;
  outline: none;
}
.history-dropdown summary::-webkit-details-marker { display: none; }
.history-dropdown summary::marker { content: ''; }
.history-dropdown[open] summary { margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--navy-500); color: var(--text-100); }
.history-dropdown .chevron { transition: transform 0.2s ease; font-size: 14px; color: var(--text-400); }
.history-dropdown[open] .chevron { transform: rotate(180deg); }
.history-dropdown:hover summary { color: var(--gold-500); }
.history-list { display: flex; flex-direction: column; gap: 6px; }
.history-item { padding: 6px 10px; background: var(--navy-800); border-radius: 6px; }
.history-line { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.history-line strong { color: var(--text-100); }
.history-note { margin-top: 4px; font-size: 11.5px; color: var(--text-300); padding-left: 8px; border-left: 2px solid var(--gold-500); padding: 4px 0 4px 8px; }

/* ---------- Status Picker form (in view modal) ---------- */
.status-picker {
  background: var(--navy-700);
  border: 1px solid var(--navy-500);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.status-picker-row { display: flex; align-items: center; gap: 10px; }
.status-picker-row .picker-lbl { font-size: 12px; color: var(--text-300); min-width: 100px; flex-shrink: 0; }
.status-picker .form-input {
  flex: 1;
  background: var(--navy-800);
  color: var(--text-100);
  border: 1px solid var(--navy-500);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 13px;
  font-family: inherit;
}
.status-picker .form-input:focus { outline: none; border-color: var(--gold-500); box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12); }
.status-picker textarea.form-input { resize: vertical; min-height: 38px; }
@media (max-width: 540px) {
  .status-picker-row { flex-direction: column; align-items: stretch; gap: 4px; }
  .status-picker-row .picker-lbl { min-width: unset; }
}

/* ============================================================
   v2.7.4 — Request UX additions (priority, ETA, stale, attachments,
   comments, mentions, quick-reason chips, diff confirm)
   ============================================================ */

/* Priority colored dot before the request code */
.prio-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.prio-dot.prio-urgent { background: var(--danger); box-shadow: 0 0 6px rgba(239, 68, 68, 0.7); }
.prio-dot.prio-high   { background: var(--warning); }
.prio-dot.prio-normal { background: #6B7280; }
.prio-dot.prio-low    { background: var(--info); }

/* Priority row indicators (used when row class is applied) */
.row-priority-urgent { box-shadow: inset 3px 0 0 var(--danger); }
.row-priority-high   { box-shadow: inset 3px 0 0 var(--warning); }
.row-priority-normal { box-shadow: inset 3px 0 0 transparent; }
.row-priority-low    { box-shadow: inset 3px 0 0 var(--info); }

/* ETA badge — countdown / overdue */
.eta-badge {
  display: inline-block;
  padding: 1px 7px;
  font-size: 9.5px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.14);
  color: #93C5FD;
  font-weight: 600;
  line-height: 1.6;
  vertical-align: middle;
}
.eta-badge.soon { background: rgba(245, 158, 11, 0.14); color: var(--warning); }
.eta-badge.overdue { background: rgba(239, 68, 68, 0.16); color: #FCA5A5; animation: pulse-overdue 2s ease-in-out infinite; }
@keyframes pulse-overdue {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Stale badge (pending > 3 days) */
.stale-badge {
  display: inline-block;
  padding: 1px 7px;
  font-size: 9.5px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.16);
  color: var(--warning);
  font-weight: 600;
  line-height: 1.6;
  vertical-align: middle;
}

/* Quick-reason chip row inside status picker (#14) */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.chip-row .chip {
  background: var(--navy-800);
  color: var(--text-300);
  border: 1px solid var(--navy-500);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 10.5px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.chip-row .chip:hover {
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold-500);
  border-color: var(--gold-500);
}

/* History edit pencil (#4) */
.history-edit-btn {
  background: transparent;
  border: none;
  color: var(--text-500);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  transition: color 0.15s ease, background 0.15s ease;
}
.history-edit-btn:hover {
  color: var(--gold-500);
  background: rgba(212, 175, 55, 0.1);
}

/* Attachments grid + thumbnails (#6) */
.attachments-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.attachment-thumb {
  background: var(--navy-700);
  border: 1px solid var(--navy-500);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.attachment-thumb:hover {
  transform: translateY(-1px);
  border-color: var(--gold-500);
}
.attachment-thumb img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  display: block;
}
.attachment-thumb .attachment-name {
  font-size: 10px;
  color: var(--text-400);
  padding: 4px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 540px) {
  .attachments-grid { grid-template-columns: repeat(2, 1fr); }
  /* Status diff modal: stack vertically on phone */
  .diff-confirm { flex-direction: column; gap: 6px; }
  .diff-arrow { transform: rotate(90deg); align-self: center; }
}

/* Comments thread (#7) */
.comments-thread { background: var(--navy-700); }
.comments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.comment-item {
  background: var(--navy-800);
  border-radius: 6px;
  padding: 8px 10px;
  border-left: 3px solid var(--gold-500);
}
.comment-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  font-size: 11.5px;
  gap: 8px;
}
.comment-head strong { color: var(--text-100); }
.comment-body {
  font-size: 12.5px;
  color: var(--text-200);
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.comment-compose {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--navy-500);
}
.comment-compose textarea {
  background: var(--navy-800);
  color: var(--text-100);
  border: 1px solid var(--navy-500);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12.5px;
  font-family: inherit;
  resize: vertical;
  min-height: 40px;
}
.comment-compose textarea:focus {
  outline: none;
  border-color: var(--gold-500);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.12);
}
.comment-compose button { align-self: flex-end; }

/* @mention highlight (#8) */
.mention {
  display: inline-block;
  background: rgba(212, 175, 55, 0.16);
  color: var(--gold-500);
  padding: 0 4px;
  border-radius: 3px;
  font-weight: 600;
}

/* Diff confirm modal (#2) */
.diff-confirm {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--navy-700);
  border: 1px solid var(--navy-500);
  border-radius: 8px;
  padding: 14px;
  margin: 8px 0 12px;
}
.diff-confirm .diff-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.diff-confirm .diff-label {
  font-size: 10.5px;
  color: var(--text-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.diff-confirm .diff-arrow {
  font-size: 22px;
  color: var(--gold-500);
}
.diff-meta {
  background: var(--navy-800);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
}
.diff-meta-row {
  display: flex;
  gap: 8px;
}
.diff-meta-row .diff-label {
  color: var(--text-500);
  min-width: 50px;
  font-weight: 600;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================================
 * v2.8.0 UI/UX additions (51-85)
 * ============================================================ */

/* #51 Sidebar collapse */
.sidebar-collapse-btn {
  position: absolute;
  top: 18px;
  right: -11px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--navy-700);
  border: 1px solid var(--navy-500);
  color: var(--text-200);
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 25;
  padding: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.sidebar-collapse-btn:hover {
  background: var(--gold-500);
  color: var(--navy-900);
  border-color: var(--gold-500);
}
/* Hide collapse button in mobile drawer mode — the hamburger in the topbar
   handles open/close there instead. */
@media (max-width: 600px) {
  .sidebar-collapse-btn { display: none; }
}
.sidebar-collapse-btn svg { width: 12px; height: 12px; fill: currentColor; transition: transform 0.18s; }
body.sidebar-collapsed .sidebar-collapse-btn svg { transform: rotate(180deg); }
body.sidebar-collapsed .sidebar { width: 60px !important; min-width: 60px; }
body.sidebar-collapsed .main { margin-left: 60px; }
body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .brand-sub,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-link span:not(.note-badge),
body.sidebar-collapsed .nav-recent-text,
body.sidebar-collapsed .nav-pin-star,
body.sidebar-collapsed .sidebar-version,
body.sidebar-collapsed .nav-section > .nav-label { display: none; }

/* v2.11.1 fix — nav-link labels in index.html are RAW TEXT NODES (not wrapped
   in <span>), so the `span:not(.note-badge)` rule above doesn't hide them.
   Collapse the link's font-size to 0 so the text node shrinks to nothing while
   keeping the SVG icon at its intrinsic size. Re-set font-size on note-badge
   so its count remains readable. */
body.sidebar-collapsed .nav-link {
  justify-content: center;
  padding: 10px 0;
  position: relative;
  font-size: 0;
  color: transparent;
  gap: 0;
}
body.sidebar-collapsed .nav-link .nav-icon,
body.sidebar-collapsed .nav-link svg.nav-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
body.sidebar-collapsed .nav-link .note-badge {
  font-size: 9px;
  color: var(--text-100);
}

/* Brand area: center the logo, drop the asymmetric padding so it doesn't
   stretch horizontally in the 60px-wide sidebar. */
body.sidebar-collapsed .brand {
  padding: 14px 0;
  justify-content: center;
  gap: 0;
}
body.sidebar-collapsed .brand-mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

/* Active route indicator pill stays at the link's left edge */
body.sidebar-collapsed .nav-link.active::before {
  left: 0;
}
/* Hover tooltip showing the link's human title (set via data-tip in app.js
   so we don't expose the kebab-case data-route slug). Falls back to slug if
   data-tip missing. */
body.sidebar-collapsed .nav-link::after {
  content: attr(data-tip);
  position: absolute;
  left: 60px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--navy-900);
  color: var(--text-100);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  transition: opacity 0.12s ease;
}
body.sidebar-collapsed .nav-link:hover::after { opacity: 1; }

/* #52 Pinned routes (sidebar Quick Access section) */
.nav-pinned, .nav-recent {
  padding: 6px 14px;
  border-top: 1px solid var(--navy-700);
  margin-top: 6px;
}
.nav-pinned .nav-label, .nav-recent .nav-label {
  font-size: 10.5px;
  color: var(--text-500);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 6px 0 4px;
}
/* v2.10.3 — Pin stars removed from nav-links (visual noise).
   Hard-hide any stale stars from cached older builds. */
.nav-pin-star { display: none !important; }

/* #56 Smart back button */
.smart-back-btn { color: var(--text-200); }
.smart-back-btn:hover { color: var(--gold-500); }

/* #55 Breadcrumb dropdown */
.breadcrumb-section {
  color: var(--text-200);
  text-decoration: none;
  cursor: pointer;
  border-bottom: 1px dashed transparent;
}
.breadcrumb-section:hover { color: var(--gold-500); border-bottom-color: var(--gold-500); }
.breadcrumb-dropdown {
  position: fixed;
  background: var(--navy-800);
  border: 1px solid var(--navy-500);
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.4);
  z-index: 200;
  min-width: 180px;
}
.breadcrumb-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 8px 12px;
  color: var(--text-100);
  cursor: pointer;
  border-radius: 6px;
  font-size: 13px;
}
.breadcrumb-dropdown button:hover { background: var(--navy-700); color: var(--gold-500); }

/* #57 Sticky table headers + scroll cap */
.table-scroll { max-height: 70vh; overflow-y: auto; outline: none; }
.table-scroll table.data thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--navy-700);
}

/* #58 Hidden columns (right-click hide) helper */
.table-col-hidden { display: none !important; }

/* #66 Inline error highlighting */
.field-error,
input.field-error, select.field-error, textarea.field-error {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15) !important;
}
.field-error-msg {
  color: var(--danger);
  font-size: 11.5px;
  margin-top: 4px;
  font-weight: 500;
}

/* #67 Auto-save draft banner */
.draft-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(212, 175, 55, 0.10);
  border: 1px solid var(--gold-500);
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 12.5px;
  color: var(--text-100);
}
.draft-banner svg { color: var(--gold-500); }
.draft-banner button { margin-left: auto; padding: 2px 8px; font-size: 11.5px; }

/* #68 Bulk preview modal */
.bulk-preview-modal table th { background: var(--navy-700); position: sticky; top: 0; }
.bulk-preview-modal .diff-before {
  background: rgba(239, 68, 68, 0.10);
  color: #fca5a5;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-mono, monospace);
  font-size: 11.5px;
}
.bulk-preview-modal .diff-after {
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-mono, monospace);
  font-size: 11.5px;
}
.bulk-preview-modal .diff-arrow { color: var(--gold-500); }

/* #69 Confetti */
.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}
.confetti {
  position: absolute;
  top: -20px;
  border-radius: 2px;
  opacity: 0.95;
  will-change: transform, opacity;
}
@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* #70 Hold-to-confirm progress bar */
.btn-hold { position: relative; overflow: hidden; }
.btn-hold .hold-progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: var(--gold-500);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.04s linear;
  pointer-events: none;
}
.btn-hold.holding { background: rgba(239, 68, 68, 0.85); }

/* #71 Toast queue badge */
.toast-queue-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--gold-500);
  color: var(--navy-900);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.toast { position: relative; }

/* #73 Progress bar */
.progress-bar {
  background: var(--navy-700);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0 4px;
}
.progress-fill {
  background: linear-gradient(90deg, var(--gold-500), var(--gold-600, #b8941f));
  height: 100%;
  transition: width 0.3s ease;
}

/* #74 View-mode toggle */
.view-mode-toggle {
  display: inline-flex;
  border: 1px solid var(--navy-500);
  border-radius: 8px;
  overflow: hidden;
  margin-right: 6px;
}
.view-mode-toggle button {
  background: transparent;
  border: none;
  color: var(--text-300);
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  border-right: 1px solid var(--navy-500);
}
.view-mode-toggle button:last-child { border-right: none; }
.view-mode-toggle button.active { background: var(--gold-500); color: var(--navy-900); }
.view-mode-toggle button:hover:not(.active) { background: var(--navy-700); color: var(--text-100); }

/* #74 Kanban */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(200px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.kanban-col {
  background: var(--navy-800);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  min-height: 360px;
  border: 1px solid var(--navy-700);
}
.kanban-col-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--navy-700);
  position: sticky;
  top: 0;
  background: var(--navy-800);
  z-index: 1;
}
.kanban-col-title { font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-200); }
.kanban-col-count { background: var(--navy-700); color: var(--text-200); padding: 2px 8px; border-radius: 10px; font-size: 11px; }
.kanban-col-body { padding: 8px; display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 200px; }
.kanban-col-body.drag-over { background: rgba(212, 175, 55, 0.08); outline: 2px dashed var(--gold-500); outline-offset: -4px; }
.kanban-card {
  background: var(--navy-700);
  border-left: 3px solid var(--gold-500);
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.1s ease;
}
.kanban-card:hover { transform: translateY(-1px); border-left-color: var(--gold-500); background: var(--navy-600, var(--navy-700)); }
.kanban-card.dragging { opacity: 0.4; }
.kanban-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; font-size: 11.5px; }
.kanban-card-body { font-size: 12.5px; margin-bottom: 4px; }
.kanban-card-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-400); }
.kanban-empty { color: var(--text-500); font-size: 12px; padding: 16px; text-align: center; font-style: italic; }

/* #75 Calendar */
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  font-size: 11px;
  color: var(--text-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 0;
  border-bottom: 1px solid var(--navy-700);
}
.calendar-weekdays > div { text-align: center; }
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: 8px 0;
}
.calendar-day {
  background: var(--navy-800);
  min-height: 60px;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
}
.calendar-day:hover { border-color: var(--gold-500); }
.calendar-day.empty { background: transparent; cursor: default; }
.calendar-day.today { background: rgba(212, 175, 55, 0.12); border-color: var(--gold-500); }
.calendar-day-num { font-size: 11px; color: var(--text-300); font-weight: 600; }
.calendar-day-dots { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 4px; }
.calendar-day-dot { width: 8px; height: 8px; border-radius: 50%; }
.calendar-day-more { font-size: 10px; color: var(--text-400); margin-left: 2px; }
.calendar-day-detail { margin-top: 10px; padding: 10px; background: var(--navy-700); border-radius: 8px; }
.calendar-day-list { list-style: none; padding: 0; margin: 4px 0 0; }
.calendar-day-list li { padding: 4px 6px; cursor: pointer; border-radius: 4px; font-size: 12px; }
.calendar-day-list li:hover { background: var(--navy-800); }

/* #76 Timeline */
.timeline-wrap { display: flex; flex-direction: column; gap: 4px; }
.timeline-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 8px;
  align-items: center;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
}
.timeline-row:hover { background: var(--navy-700); }
.timeline-label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.timeline-track {
  position: relative;
  height: 18px;
  background: var(--navy-800);
  border-radius: 9px;
  overflow: hidden;
}
.timeline-bar {
  position: absolute;
  top: 2px;
  height: 14px;
  border-radius: 7px;
  opacity: 0.9;
}

/* #77 Heatmap */
.heatmap-grid {
  display: grid;
  grid-template-columns: 40px repeat(24, 1fr);
  gap: 2px;
  padding: 8px 0;
}
.heatmap-corner { background: transparent; }
.heatmap-hour { font-size: 9px; color: var(--text-500); text-align: center; line-height: 14px; }
.heatmap-day-label { font-size: 10px; color: var(--text-400); display: flex; align-items: center; padding-right: 4px; }
.heatmap-cell { height: 18px; border-radius: 2px; background: var(--navy-800); }

/* #78 Sparkline */
.sparkline { display: inline-block; vertical-align: middle; }

/* #79 Activity feed (vertical timeline) */
.activity-feed { list-style: none; padding: 0; margin: 0; max-height: 360px; overflow-y: auto; }
.activity-feed .activity-item {
  display: flex;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--navy-700);
  position: relative;
}
.activity-feed .activity-item:last-child { border-bottom: none; }
.activity-feed .activity-icon {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: var(--navy-700);
  border-radius: 50%;
  font-size: 13px;
  flex-shrink: 0;
}
.activity-feed .activity-body { font-size: 12.5px; flex: 1; min-width: 0; }
.activity-feed .activity-title { color: var(--text-100); margin-bottom: 2px; word-break: break-word; }
.activity-feed .activity-meta { color: var(--text-400); font-size: 11.5px; }

/* #80 Right-click context menu */
.ctx-menu {
  position: fixed;
  z-index: 9000;
  background: var(--navy-800);
  border: 1px solid var(--navy-500);
  border-radius: 8px;
  padding: 4px;
  min-width: 180px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.4);
  font-size: 13px;
}
.ctx-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  border: none;
  background: transparent;
  color: var(--text-100);
  text-align: left;
  cursor: pointer;
  border-radius: 4px;
}
.ctx-item:hover:not(.ctx-disabled) { background: var(--navy-700); }
.ctx-item.ctx-danger { color: var(--danger); }
.ctx-item.ctx-danger:hover { background: rgba(239, 68, 68, 0.12); }
.ctx-item.ctx-disabled { opacity: 0.4; cursor: not-allowed; }
.ctx-sep { height: 1px; background: var(--navy-700); margin: 4px 6px; }
.ctx-icon-spacer { width: 14px; height: 14px; display: inline-block; }

/* #82 Keyboard nav active row + shift-click selected reuse */
table.data tbody tr.row-active {
  outline: 2px solid var(--gold-500);
  outline-offset: -2px;
  background: rgba(212, 175, 55, 0.07);
}

/* Mobile breakpoint adjustments */
@media (max-width: 540px) {
  .kanban-board { grid-template-columns: repeat(5, 80vw); }
  .heatmap-grid { font-size: 8px; }
  .heatmap-hour { font-size: 7px; }
  .timeline-row { grid-template-columns: 100px 1fr; }
  .view-mode-toggle button { padding: 5px 8px; font-size: 11px; }
  .calendar-day { min-height: 44px; padding: 3px; }
  .breadcrumb-dropdown { min-width: 140px; }
  .ctx-menu { min-width: 160px; }
  body.sidebar-collapsed .sidebar { width: 0 !important; min-width: 0; }
  body.sidebar-collapsed .main { margin-left: 0; }
}

/* ==========================================================================
   v2.8.1 — Workflow review fixes
   ========================================================================== */

/* #69 confetti / kanban / progress: respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .confetti, .kanban-card, .progress-fill, .sidebar-collapse-btn svg,
  .status-step.current .status-dot { animation: none !important; transition: none !important; }
  .kanban-card:hover, .filter-pill:hover { transform: none !important; }
}

/* View-mode toggle accessibility — visible focus + aria-pressed state */
.view-mode-toggle button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--gold-500);
  z-index: 1;
}
.view-mode-toggle button[aria-pressed="true"] {
  background: var(--gold-500);
  color: var(--navy-900);
}

/* Kanban card keyboard accessibility */
.kanban-card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--gold-500);
  border-color: var(--gold-500);
}

/* Mobile rules for components missed in earlier batch */
@media (max-width: 540px) {
  .bulk-preview-modal { font-size: 11px; }
  .bulk-preview-modal table th,
  .bulk-preview-modal table td { padding: 4px 6px; }
  .activity-feed { max-height: 260px; overflow-y: auto; }
  .draft-banner { font-size: 11.5px; padding: 6px 8px; }
  /* On mobile, ignore the collapsed sidebar state — hamburger controls width */
  body.sidebar-collapsed .sidebar { width: 280px !important; }
}

/* ---------- v2.9.0 Partner-Admin Automation (PA1-PA6) ---------- */

/* PA4 — Awaiting Verification landing screen (renderAwaitingVerification) */
.verification-pending-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(160deg, var(--navy-900) 0%, var(--navy-800) 100%);
}
.verification-card {
  max-width: 480px;
  width: 100%;
  background: var(--navy-800);
  border: 1px solid var(--navy-500);
  border-radius: 14px;
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}
.verification-icon {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-600));
  color: var(--navy-900);
  display: grid;
  place-items: center;
  margin: 0 auto 20px;
}
.verification-card h1 {
  font-size: 22px;
  margin: 0 0 12px;
  color: var(--text-100);
}
.verification-card .lead {
  font-size: 15px;
  color: var(--text-100);
  margin: 0 0 12px;
  line-height: 1.5;
}
.verification-card p { color: var(--text-300); font-size: 13px; line-height: 1.55; margin: 0 0 10px; }
.verification-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
  flex-wrap: wrap;
}

/* PA5 — Credit hold banner inside request form */
.credit-hold-banner {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.55);
  color: var(--text-100);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.45;
}
.credit-hold-banner strong { color: var(--danger); margin-right: 4px; }

/* System-generated message bubble (sender role "system") — softer visual than partner/admin */
.msg-bubble.system,
.msg-bubble.other.system,
.system-message {
  background: var(--navy-800) !important;
  border-style: dashed !important;
  border-color: var(--gold-500) !important;
  color: var(--text-300) !important;
}

/* PA3 — Reminder cadence badge on bill rows (1d/3d/7d) */
.reminder-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.4);
  margin-left: 4px;
  letter-spacing: 0.04em;
}
.reminder-badge.final { background: rgba(239, 68, 68, 0.35); color: #fff; }

@media (max-width: 540px) {
  .verification-card { padding: 22px 16px; }
  .verification-card h1 { font-size: 18px; }
  .verification-card .lead { font-size: 13.5px; }
  .credit-hold-banner { font-size: 12px; padding: 8px 10px; }
}

/* ---------- Cloud Sync indicator (topbar) ---------- */
.sync-indicator { position: relative; }
.sync-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--navy-800);
  background: var(--text-500);
  pointer-events: none;
}
.sync-dot[data-status="connected"] { background: var(--success); }
.sync-dot[data-status="connecting"] { background: var(--warning); animation: pulse 1.2s infinite; }
.sync-dot[data-status="error"] { background: var(--danger); }
.sync-dot[data-status="off"] { background: var(--text-500); }

/* App-wide sync banner. A small topbar dot is easy to miss, and the whole
   failure mode this guards against is someone working all day on a device that
   quietly stopped syncing (offline, or encrypted with no passphrase) while every
   local save still looked fine. This bar is deliberately loud, shows for every
   role, and is only present when there is something to act on. */
.sync-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; font-size: 13px; font-weight: 500;
  background: var(--warning-tint, rgba(224, 164, 55, .16));
  color: var(--warning-ink, var(--text-100));
  border-bottom: 1px solid var(--warning, #e0a437);
}
.sync-banner[data-kind="error"] {
  background: var(--danger-tint, rgba(197, 58, 58, .16));
  border-bottom-color: var(--danger, #c53a3a);
}
.sync-banner svg { flex: 0 0 auto; color: var(--warning, #e0a437); }
.sync-banner[data-kind="error"] svg { color: var(--danger, #c53a3a); }
.sync-banner__btn {
  margin-left: auto; flex: 0 0 auto;
  padding: 3px 12px; font-size: 12.5px; font-weight: 600;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid currentColor; background: transparent; color: inherit;
  cursor: pointer;
}
.sync-banner__btn:hover { background: rgba(0, 0, 0, .06); }
.sync-banner__btn:empty { display: none; }

/* Shared bar used by the update prompt. Same shape as .sync-banner so the two
   read as one system; a calmer palette because this one is an offer, not a
   fault. Persistent on purpose -- a toast would time out, and a tab that
   silently keeps running old code across a schema change is its own hazard. */
.app-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; font-size: 13px; font-weight: 500;
  /* A gold wash rather than a flat surface colour: on the light theme the panel
     token is plain white, which left the bar indistinguishable from the page.
     Tinting with the accent works on both grounds without a per-theme block. */
  background: rgba(192, 145, 47, 0.10); color: var(--text-100);
  border-bottom: 1px solid var(--gold-500);
}
.app-banner--update svg { flex: 0 0 auto; color: var(--gold-500); }
.app-banner__btn {
  margin-left: auto; flex: 0 0 auto;
  padding: 3px 12px; font-size: 12.5px; font-weight: 600;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid var(--gold-500); background: transparent; color: var(--gold-500);
  cursor: pointer;
}
.app-banner__btn:hover { background: var(--gold-500); color: var(--navy-900); }
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* ---------- Partner Orders (22-step PO workflow) ---------- */
.po-pipeline {
  display: flex;
  align-items: stretch;
  gap: 4px;
  flex-wrap: wrap;
  padding: 8px 0;
}
.po-pipeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
  flex: 1;
  min-width: 80px;
  border-radius: 8px;
  background: var(--navy-800);
  border: 1px solid var(--navy-500);
  position: relative;
  font-size: 11px;
  text-align: center;
}
.po-pipeline-step .po-pipeline-dot {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--navy-700);
  color: var(--text-300);
  font-weight: 700;
  font-size: 12px;
  border: 1.5px solid var(--navy-500);
}
.po-pipeline-step.done {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.4);
}
.po-pipeline-step.done .po-pipeline-dot {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}
.po-pipeline-step.current {
  background: rgba(212, 175, 55, 0.1);
  border-color: var(--gold-500);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}
.po-pipeline-step.current .po-pipeline-dot {
  background: var(--gold-500);
  color: var(--navy-900);
  border-color: var(--gold-500);
}
.po-pipeline-step.terminal {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.4);
}
.po-pipeline-step.terminal .po-pipeline-dot {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.po-pipeline-label { font-weight: 600; color: var(--text-100); line-height: 1.2; }
.po-pipeline-when { font-size: 10px; color: var(--text-300); }
.po-pipeline.detailed .po-pipeline-step { min-width: 70px; padding: 6px 4px; }

/* Stage panels inside the View modal */
.po-stage-panel {
  background: var(--navy-800);
  border: 1px solid var(--navy-500);
  border-radius: 10px;
  margin-top: 10px;
}
.po-stage-panel-head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--navy-500);
  font-weight: 600;
  font-size: 13px;
  color: var(--gold-500);
}
.po-stage-panel-body { padding: 12px; font-size: 13px; }
.po-stage-panel-body .row { display: flex; align-items: center; }

.po-view-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
}
.po-totals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 16px;
  padding: 10px 12px;
  background: var(--navy-700);
  border-radius: 8px;
  font-size: 13px;
}
.po-totals strong { float: right; }

/* Discrepancy form rows */
.po-discrepancy,
.po-discrepancy-form {
  padding: 8px;
  border: 1px solid var(--navy-500);
  border-radius: 8px;
  background: var(--navy-700);
}
.po-discrepancy + .po-discrepancy { margin-top: 8px; }

/* Kanban-style pipeline board */
.po-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(180px, 1fr));
  gap: 10px;
  overflow-x: auto;
}
.po-board-col {
  background: var(--navy-800);
  border: 1px solid var(--navy-500);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  min-height: 200px;
}
.po-board-head {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  border-bottom: 1px solid var(--navy-500);
  font-weight: 600;
  font-size: 13px;
  color: var(--gold-500);
}
.po-board-count {
  background: var(--navy-700);
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 11px;
  color: var(--text-100);
}
.po-board-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.po-board-empty {
  font-size: 12px;
  color: var(--text-300);
  text-align: center;
  padding: 18px 8px;
}
.po-board-card {
  background: var(--navy-700);
  border: 1px solid var(--navy-500);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.po-board-card-code { font-weight: 700; color: var(--text-100); }
.po-board-card-meta { font-size: 11px; color: var(--text-300); }

.po-items-table { overflow-x: auto; }

@media (max-width: 540px) {
  .po-pipeline-step { min-width: 60px; padding: 6px; font-size: 10px; }
  .po-pipeline-step .po-pipeline-dot { width: 20px; height: 20px; font-size: 10px; }
  .po-view-grid { grid-template-columns: 1fr; }
  .po-board { grid-template-columns: repeat(2, 1fr); }
  .po-totals { grid-template-columns: 1fr; }
}

/* ==========================================================================
   v2.10.2 — Settings → Sidebar Order editor
   (Replaces the v2.10.1 in-sidebar drag interaction. The sidebar itself is
   no longer draggable; reordering lives in a dedicated Settings panel.)
   ========================================================================== */

/* Screen-reader-only utility */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

#navOrderEditor { display: flex; flex-direction: column; gap: 14px; }
.nav-order-section {
  background: var(--navy-800);
  border: 1px solid var(--navy-500);
  border-radius: 10px;
  padding: 10px 12px 12px;
}
.nav-order-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--navy-500);
}
.nav-order-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.nav-order-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-order-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--navy-700);
  border-radius: 6px;
  border: 1px solid transparent;
  transition: var(--transition);
}
.nav-order-item:hover { border-color: var(--navy-500); }
.nav-order-icon {
  display: grid;
  place-items: center;
  color: var(--text-300);
}
.nav-order-icon svg { width: 18px; height: 18px; }
.nav-order-label {
  font-size: 13px;
  color: var(--text-100);
  font-weight: 500;
}
.nav-order-controls { display: inline-flex; gap: 4px; }
.nav-order-controls .icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--navy-800);
  border: 1px solid var(--navy-500);
  color: var(--text-200);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: var(--transition);
}
.nav-order-controls .icon-btn:hover:not(:disabled) {
  border-color: var(--gold-500);
  color: var(--gold-500);
}
.nav-order-controls .icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

@media (max-width: 540px) {
  .nav-order-item { grid-template-columns: 24px 1fr auto; padding: 6px 8px; gap: 8px; }
  .nav-order-icon svg { width: 16px; height: 16px; }
  .nav-order-label { font-size: 12.5px; }
  .nav-order-controls .icon-btn { width: 30px; height: 30px; } /* a bit larger for finger taps */
}

/* ==========================================================================
   v2.11.0 — UI/UX polish round
   New tokens, side-panel, empty-state illustrations, floating bulk bar,
   page transition fade, toast stroke icons, shimmer skeletons, partner
   bottom tab bar, pull-to-refresh, swipe actions, PWA install banner,
   multi-tab record bar, quick-view peek, saved-views menu, notification
   center, recent-activity widget, last-edited badge.
   ========================================================================== */

/* ---------- #6 Spacing scale tokens (new code; existing CSS untouched) ----- */
:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 40px;
  --space-8: 48px;

  /* ---------- #7 Border-radius tokens (additive; aliases keep back-compat) ---------- */
  --radius-1: 4px;
  --radius-2: 8px;
  --radius-3: 12px;
  --radius-4: 16px;
  --radius-full: 9999px;

  --partner-tab-h: 56px;
}

/* Utility classes for spacing — applied to new markup only. */
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }
.gap-7 { gap: var(--space-7); }
.gap-8 { gap: var(--space-8); }
.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }
.p-7 { padding: var(--space-7); }
.p-8 { padding: var(--space-8); }
.mt-1 { margin-top: var(--space-1); } .mb-1 { margin-bottom: var(--space-1); }
.mt-2 { margin-top: var(--space-2); } .mb-2 { margin-bottom: var(--space-2); }
.mt-3 { margin-top: var(--space-3); } .mb-3 { margin-bottom: var(--space-3); }
.mt-4 { margin-top: var(--space-4); } .mb-4 { margin-bottom: var(--space-4); }
.mt-5 { margin-top: var(--space-5); } .mb-5 { margin-bottom: var(--space-5); }
.mt-6 { margin-top: var(--space-6); } .mb-6 { margin-bottom: var(--space-6); }
.mt-7 { margin-top: var(--space-7); } .mb-7 { margin-bottom: var(--space-7); }
.mt-8 { margin-top: var(--space-8); } .mb-8 { margin-bottom: var(--space-8); }
.mx-auto { margin-left: auto; margin-right: auto; }

/* ---------- #4 / #11 Page transition fade ---------- */
#view { transition: opacity 180ms ease; }
#view.view-fading-in { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  #view { transition: none; }
}

/* ---------- #5 / #12 Toast checkmark draw-in animation ---------- */
@keyframes toast-icon-draw {
  from { stroke-dashoffset: var(--toast-icon-dash, 100); }
  to   { stroke-dashoffset: 0; }
}
.toast-icon.toast-icon-animate path,
.toast-icon.toast-icon-animate circle {
  animation: toast-icon-draw 240ms ease-out forwards;
}
@keyframes toast-progress-shrink {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}
.toast-progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: var(--gold-500);
  transform-origin: left center;
  animation: toast-progress-shrink var(--toast-progress-ms, 6000ms) linear forwards;
  border-radius: 0 0 var(--radius-2) var(--radius-2);
}
.toast { position: relative; overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
  .toast-icon.toast-icon-animate path,
  .toast-icon.toast-icon-animate circle { animation: none; stroke-dashoffset: 0; }
  .toast-progress { animation: none; }
}

/* ---------- #8 Card hover lift ---------- */
.card-interactive {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  cursor: pointer;
}
@media (hover: hover) {
  .card-interactive:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
  }
}
@media (prefers-reduced-motion: reduce) {
  .card-interactive { transition: none; }
  .card-interactive:hover { transform: none; }
}

/* ---------- #10 Shimmer skeleton kinds ---------- */
@keyframes bfm-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.sk-shimmer {
  background: linear-gradient(90deg, var(--navy-700) 0%, var(--navy-600) 50%, var(--navy-700) 100%);
  background-size: 800px 100%;
  animation: bfm-shimmer 1.4s infinite linear;
  border-radius: var(--radius-2);
}
.sk-widget { height: 80px; width: 100%; }
.sk-chart  { height: 240px; width: 100%; display: flex; align-items: flex-end; padding: 16px; }
.sk-chart-bars { display: flex; align-items: flex-end; gap: 10px; width: 100%; height: 100%; }
.sk-chart-bar  { flex: 1; background: var(--navy-500); border-radius: var(--radius-1) var(--radius-1) 0 0; }
@media (prefers-reduced-motion: reduce) { .sk-shimmer { animation: none; } }

/* ---------- #1 Side panel ---------- */
.side-panel-backdrop {
  position: fixed; inset: 0;
  background: rgba(11, 20, 38, 0.55);
  z-index: 1200; /* above modal (1000) */
  display: flex; justify-content: flex-end;
  opacity: 0;
  transition: opacity 200ms ease;
}
.side-panel-backdrop.open { opacity: 1; }
.side-panel-backdrop.closing { opacity: 0; }
.side-panel {
  width: 60vw;
  min-width: 480px;
  max-width: 880px;
  height: 100%;
  background: var(--navy-800);
  border-left: 1px solid var(--navy-500);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 220ms cubic-bezier(0.4, 0, 0.2, 1);
}
.side-panel-backdrop.open .side-panel { transform: translateX(0); }
.side-panel-backdrop.closing .side-panel { transform: translateX(100%); }
.side-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--navy-500);
}
.side-panel-title {
  font-size: 15px;
  font-weight: 600;
  display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
}
.side-panel-record-code { color: var(--text-100); }
.side-panel-close {
  background: transparent;
  border: 1px solid var(--navy-500);
  color: var(--text-200);
  width: 32px; height: 32px;
  border-radius: var(--radius-2);
  display: grid; place-items: center;
  cursor: pointer;
}
.side-panel-close svg { width: 16px; height: 16px; fill: currentColor; }
.side-panel-close:hover { color: var(--gold-500); border-color: var(--gold-500); }
.side-panel-body { flex: 1; padding: 18px; overflow-y: auto; }
.side-panel-footer {
  display: flex; justify-content: flex-end; gap: var(--space-2);
  padding: 12px 18px;
  border-top: 1px solid var(--navy-500);
}
@media (max-width: 768px) {
  .side-panel { width: 100vw; min-width: 0; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .side-panel-backdrop, .side-panel { transition: none; }
}

/* Last-edited badge in side-panel header */
.last-edited-badge {
  font-size: 11px;
  color: var(--text-400);
  background: var(--navy-700);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--navy-500);
  white-space: nowrap;
}

/* ---------- #2 Empty-state illustrations ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 20px;
  gap: var(--space-3);
}
.empty-state-illust {
  width: 160px; height: 160px;
  opacity: 0.95;
}
.empty-state-illust svg { width: 100%; height: 100%; display: block; }
.empty-state-title { margin: 0; font-size: 16px; color: var(--text-100); }
.empty-state-desc  { margin: 0; max-width: 360px; color: var(--text-400); font-size: 13px; }
.empty-state-cta { margin-top: var(--space-3); }

/* ---------- #3 Floating bulk action bar ---------- */
@keyframes floatingBulkSlideUp {
  from { transform: translate(-50%, 24px); opacity: 0; }
  to   { transform: translate(-50%, 0);    opacity: 1; }
}
.floating-bulk-bar {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  background: var(--navy-700);
  border: 1px solid var(--gold-500);
  border-radius: var(--radius-3);
  box-shadow: 0 12px 32px rgba(212, 175, 55, 0.25), var(--shadow-lg);
  padding: 8px 12px;
  animation: floatingBulkSlideUp 220ms ease-out;
  display: flex; gap: var(--space-2); align-items: center;
}
.floating-bulk-bar .btn { font-size: 13px; }
@media (prefers-reduced-motion: reduce) {
  .floating-bulk-bar { animation: none; }
}
/* Lift above partner tab bar on small screens */
body:has(#partnerBottomTabs:not([hidden])) .floating-bulk-bar {
  bottom: calc(var(--partner-tab-h) + 16px);
}

/* v2.11.0 fix — Floating elements (bulk bar, toast root, PWA install banner)
   were overlapping the regular .mobile-nav for non-partner users on phones.
   Lift them all above the mobile nav (~64px tall) on small viewports. */
@media (max-width: 768px) {
  .mobile-nav ~ .floating-bulk-bar,
  body:not(:has(#partnerBottomTabs:not([hidden]))) .floating-bulk-bar { bottom: calc(64px + 16px); }
  body:not(:has(#partnerBottomTabs:not([hidden]))) .toast-root { bottom: calc(64px + 16px); }
}

/* Partner-bottom-tabs visible → push main content above the bar so the last
   row of any table isn't hidden under the fixed bar. */
body:has(#partnerBottomTabs:not([hidden])) .main {
  padding-bottom: calc(var(--partner-tab-h) + env(safe-area-inset-bottom, 0px) + 16px);
}

/* Landscape phones — shrink the partner tab bar so it doesn't crowd the viewport */
@media (max-width: 900px) and (orientation: landscape) {
  :root { --partner-tab-h: 44px; }
  .partner-bottom-tabs a { font-size: 9px; }
  .partner-bottom-tabs a svg { width: 16px; height: 16px; }
}

/* ---------- #13 Partner bottom tab bar ---------- */
.partner-bottom-tabs {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: var(--partner-tab-h);
  display: grid;
  /* Six: the five partner destinations plus the drawer trigger, which lives in
     .mobile-nav for everyone else -- and .mobile-nav is hidden for partners. */
  grid-template-columns: repeat(6, 1fr);
  background: var(--navy-900);
  border-top: 1px solid var(--navy-500);
  z-index: 800;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.partner-bottom-tabs a {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-decoration: none;
  color: var(--text-300);
  font-size: 10px;
  gap: 2px;
}
.partner-bottom-tabs a svg { width: 20px; height: 20px; fill: currentColor; }
.partner-bottom-tabs a.active { color: var(--gold-500); }
.partner-bottom-tabs a:active { background: var(--navy-800); }

/* ---------- #14 Pull-to-refresh indicator ---------- */
.ptr-indicator {
  position: absolute;
  top: 0; left: 50%;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: var(--navy-700);
  border: 1px solid var(--navy-500);
  border-radius: var(--radius-full);
  color: var(--gold-500);
  transform: translate(-50%, -100%);
  z-index: 50;
  transition: transform 0.18s ease;
  pointer-events: none;
}
.ptr-indicator svg { width: 20px; height: 20px; }
.ptr-indicator.ptr-ready { color: var(--gold-300); }
.ptr-indicator.ptr-loading { animation: ptr-spin 0.9s linear infinite; }
@keyframes ptr-spin { from { transform: translate(-50%, 0) rotate(0deg); } to { transform: translate(-50%, 0) rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .ptr-indicator, .ptr-indicator.ptr-loading { animation: none; transition: none; }
}

/* ---------- #15 Swipe actions on rows ---------- */
.data tbody tr {
  position: relative;
}
.data tbody tr.swipe-show-right::before,
.data tbody tr.swipe-show-left::after {
  position: absolute;
  top: 0; height: 100%;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
  padding: 0 16px;
  color: #fff;
}
.data tbody tr.swipe-show-right::before {
  content: attr(data-swipe-right-label);
  left: 0;
  background: var(--success);
}
.data tbody tr.swipe-show-left::after {
  content: attr(data-swipe-left-label);
  right: 0;
  background: var(--danger);
}

/* ---------- #18 Multi-tab record bar ---------- */
.record-tabs {
  display: flex; gap: 4px;
  padding: 6px 16px 0 16px;
  background: var(--navy-800);
  border-bottom: 1px solid var(--navy-500);
  overflow-x: auto;
}
.record-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  background: var(--navy-700);
  border: 1px solid var(--navy-500);
  border-bottom: none;
  border-radius: var(--radius-2) var(--radius-2) 0 0;
  font-size: 12px;
  color: var(--text-300);
  cursor: pointer;
  white-space: nowrap;
}
.record-tab.active { background: var(--navy-600); color: var(--gold-500); border-color: var(--gold-500); }
.record-tab-close {
  background: transparent; border: none; color: inherit;
  font-size: 14px; line-height: 1; cursor: pointer; padding: 0 4px;
}
.record-tab-close:hover { color: var(--danger); }

/* ---------- #20 Optimistic 'Saving…' badge state ---------- */
.badge.is-saving { position: relative; opacity: 0.85; }
.badge.is-saving::after {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold-500);
  margin-left: 6px;
  animation: bfm-pulse 1.1s ease-in-out infinite;
  vertical-align: middle;
}
@keyframes bfm-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50%      { opacity: 1;   transform: scale(1.1); }
}
@media (prefers-reduced-motion: reduce) {
  .badge.is-saving::after { animation: none; }
}

/* ---------- #21 Quick view peek ---------- */
.quick-peek {
  position: absolute;
  z-index: 1500;
  background: var(--navy-700);
  border: 1px solid var(--gold-500);
  border-radius: var(--radius-2);
  box-shadow: var(--shadow-lg);
  padding: 10px 12px;
  min-width: 240px;
  max-width: 320px;
  font-size: 12px;
  color: var(--text-100);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
  pointer-events: none;
}
.quick-peek.open { opacity: 1; transform: translateY(0); }
.quick-peek-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.quick-peek-row { display: flex; justify-content: space-between; gap: var(--space-3); padding: 2px 0; }
.quick-peek-row .lbl { color: var(--text-400); }

/* ---------- #22 Saved views menu ---------- */
.saved-views-menu {
  position: absolute;
  top: 100%; right: 0;
  min-width: 240px;
  background: var(--navy-700);
  border: 1px solid var(--navy-500);
  border-radius: var(--radius-2);
  box-shadow: var(--shadow-lg);
  margin-top: 6px;
  padding: 6px;
  z-index: 500;
}
.saved-views-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 8px;
  border-radius: var(--radius-1);
  cursor: pointer;
}
.saved-views-item:hover { background: var(--navy-600); }
.saved-views-name { font-size: 13px; color: var(--text-100); }
.saved-views-del {
  background: transparent; border: none; color: var(--text-400);
  cursor: pointer; font-size: 14px;
}
.saved-views-del:hover { color: var(--danger); }
.saved-views-menu-empty { padding: 8px; font-size: 12px; color: var(--text-400); }
.saved-views-actions { border-top: 1px solid var(--navy-500); padding-top: 6px; margin-top: 6px; display: flex; justify-content: flex-end; }

/* ---------- #23 Recent activity widget ---------- */
.recent-activity-widget .recent-activity-group + .recent-activity-group { margin-top: var(--space-3); }
.recent-activity-entity {
  font-size: 11px; font-weight: 700;
  color: var(--gold-500);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.recent-activity-item {
  display: flex; justify-content: space-between; gap: var(--space-3);
  padding: 4px 0;
  cursor: pointer;
  border-radius: var(--radius-1);
}
.recent-activity-item:hover { background: var(--navy-600); padding-left: 6px; padding-right: 6px; }
.recent-activity-ref { color: var(--text-100); font-size: 13px; font-weight: 500; }
.recent-activity-meta { color: var(--text-400); font-size: 11px; }

/* ---------- #24 Notification center (side-panel content) ---------- */
.notif-center-filters {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: var(--space-3);
}
.notif-chip {
  background: var(--navy-700);
  border: 1px solid var(--navy-500);
  color: var(--text-200);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.notif-chip.active { border-color: var(--gold-500); color: var(--gold-500); }
.notif-chip-count {
  background: var(--navy-800);
  border-radius: var(--radius-full);
  padding: 0 6px;
  font-size: 10px;
}
.notif-center-actions { display: flex; justify-content: flex-end; margin-bottom: var(--space-2); }
.notif-center-group { margin-top: var(--space-3); }
.notif-center-group-title {
  font-size: 11px; font-weight: 700;
  color: var(--gold-500);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: var(--space-2);
}
.notif-center-list .notif-item {
  display: flex; align-items: flex-start; gap: var(--space-3);
  padding: 10px;
  background: var(--navy-700);
  border-radius: var(--radius-2);
  margin-bottom: 6px;
  cursor: pointer;
  position: relative;
}
.notif-center-list .notif-item:hover { background: var(--navy-600); }
.notif-center-list .notif-item.is-unread { border-left: 3px solid var(--gold-500); }
.notif-unread-dot {
  position: absolute; top: 12px; right: 12px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold-500);
}
.notif-empty { padding: 28px; text-align: center; color: var(--text-400); }
.notif-empty svg { width: 28px; height: 28px; fill: var(--success); margin-bottom: 6px; display: inline-block; }

/* Make sure mobile-nav hides cleanly when partner bar is shown */
@media (max-width: 540px) {
  .partner-bottom-tabs:not([hidden]) ~ .mobile-nav,
  body:has(.partner-bottom-tabs:not([hidden])) .mobile-nav { display: none !important; }
}

/* ============================================================
   LOGIN PHOTO BG — mobile + accessibility overrides
   On small viewports the photo center collides with the card.
   De-emphasize photo, lean harder on a top-down wash.
   ============================================================ */
@media (max-width: 640px) {
  .login-shell::after {
    opacity: 0.22;
    filter: blur(6px) saturate(0.85);
    background-size: cover;
    background-position: center center;
    -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.7) 65%, rgba(0, 0, 0, 0.4) 100%);
            mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.7) 65%, rgba(0, 0, 0, 0.4) 100%);
  }
  body.theme-light .login-shell::after {
    opacity: 0.24;
  }
  .login-shell::before {
    background: linear-gradient(180deg, rgba(11, 18, 32, 0.80) 0%, rgba(11, 18, 32, 0.94) 100%);
  }
  body.theme-light .login-shell::before {
    background: linear-gradient(180deg, rgba(245, 247, 250, 0.65) 0%, rgba(245, 247, 250, 0.88) 100%);
  }
  .login-card {
    -webkit-backdrop-filter: blur(8px);
            backdrop-filter: blur(8px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .login-shell::after { will-change: auto; }
}
@media (prefers-reduced-transparency: reduce) {
  .login-card { backdrop-filter: none; -webkit-backdrop-filter: none; background-color: rgba(22, 28, 44, 0.99); }
  body.theme-light .login-card { backdrop-filter: none; -webkit-backdrop-filter: none; background-color: rgba(255, 255, 255, 0.99); }
}

/* ============================================================
   v2.12.63 — Phase 1 of 14-step billing/production workflow
   ============================================================ */

/* Partner DP amount input (above the file picker) */
.sr-dp-amount {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
  padding: 8px 10px;
  background: rgba(212, 175, 55, 0.06);
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: 8px;
}
.sr-dp-amount__lbl {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold-600);
}
.sr-dp-amount__input {
  font-size: 15px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--navy-500);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-100);
}
body.theme-light .sr-dp-amount__input { background: #fff; color: var(--text-900); }
.sr-dp-amount__input:focus {
  outline: none;
  border-color: var(--gold-500);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.25);
}
.sr-dp-amount__hint {
  font-size: 10.5px;
  color: var(--text-400);
}

/* DP paid + balance row on the invoice paper card */
.ledger-invoice-paper-meta--dp {
  border-top: 1px dashed rgba(168, 124, 24, 0.35);
  margin-top: 6px;
  padding-top: 6px;
}
/* Editable Down Payment setup block on the SR ticket invoice card. Each row is
   label-left / value-right; the % is an inline underlined input (no box). */
.ledger-invoice-dp-setup {
  display: block;
  border-top: 1px dashed rgba(168, 124, 24, 0.35);
  border-bottom: none;
  margin-top: 6px;
  padding-top: 5px;
}
.ledger-invoice-dp-setup > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 1px 0;
}
.ledger-invoice-dp-setup dt {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-500);
}
.ledger-invoice-dp-setup dd {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-100);
  font-feature-settings: "tnum" 1;
}
.ledger-invoice-dp-setup .ledger-dp-setup-row dt { color: var(--gold-600); }
.ledger-invoice-dp-setup .ledger-dp-setup-foot {
  justify-content: flex-end;
  padding-top: 3px;
}
.ledger-dp-pct-wrap {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  border-bottom: 1.5px solid var(--gold-500);
}
.ledger-dp-pct-input {
  width: 38px;
  border: none;
  background: transparent;
  text-align: right;
  font-size: 13px;
  font-weight: 700;
  color: var(--maroon-600);
  padding: 0 0 1px;
  font-feature-settings: "tnum" 1;
}
.ledger-dp-pct-input:focus { outline: none; }
.ledger-dp-pct-input::-webkit-outer-spin-button,
.ledger-dp-pct-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ledger-dp-pct-input { -moz-appearance: textfield; appearance: textfield; }
.ledger-dp-pct-sign {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--gold-600);
}
/* v2.12.67 (Patch 3A) — Pre-payment DP-due hint, restructured to stack
   the amount above the chip in a flex-column. v2.12.66 inherited the
   parent's 2-column grid which squeezed the amount + chip side-by-side,
   clipping the chip text to "...". Now: display: block on the dl
   overrides the grid; the inner <div> uses 1-column grid; the <dd>
   becomes a flex-column with amount on its own row and chip below. */
.ledger-invoice-paper-meta--dp-expected {
  display: block;
  border-top: 1px dashed rgba(168, 124, 24, 0.35);
  margin-top: 8px;
  padding-top: 8px;
}
.ledger-invoice-paper-meta--dp-expected > div {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}
.ledger-invoice-paper-meta--dp-expected dt {
  font-size: 10px;
  font-weight: 700;
  color: var(--gold-600);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ledger-invoice-paper-meta--dp-expected dd {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-900);
  margin: 0;
}
.ledger-invoice-paper-meta--dp-expected .ledger-invoice-sym {
  margin-right: 2px;
  color: var(--text-500);
}
.ledger-invoice-paper-meta--dp-expected .ledger-invoice-dp-ack {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.18);
  color: var(--gold-600);
  border: 1px solid rgba(168, 124, 24, 0.35);
  margin-left: 0;
  max-width: 100%;
}
.ledger-invoice-dp-ack {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.ledger-invoice-dp-ack.is-acked {
  background: rgba(46, 200, 130, 0.18);
  color: #2ec882;
}
.ledger-invoice-dp-ack.is-pending {
  background: rgba(212, 175, 55, 0.18);
  color: var(--gold-500);
}

/* "For Production" admin shortcut */
.sr-status-update__shortcut {
  margin-top: 8px;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--maroon-600);
  background: var(--maroon-600);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.14s ease, opacity 0.14s ease;
}
.sr-status-update__shortcut:hover { background: #5a0b0b; transform: translateY(-1px); }
.sr-status-update__shortcut:active { transform: translateY(0); }
.sr-status-update__shortcut:disabled,
.sr-status-update__shortcut.is-blocked {
  background: var(--navy-600);
  border-color: var(--navy-500);
  color: var(--text-400);
  cursor: not-allowed;
  opacity: 0.7;
}

/* Production lineup section (Batch/Lot, sub-status, remarks) */
.sr-production {
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid rgba(168, 124, 24, 0.28);
  border-radius: 8px;
  background: rgba(212, 175, 55, 0.04);
}
.sr-production h4 { margin-top: 0; }
.sr-production .ledger-hint {
  font-size: 11px;
  color: var(--text-400);
  margin-top: 4px;
}

/* Billing Accounts list — legacy DP Proof column tokens. v2.12.68 removed
   the column from the list; these stay so .bill-dp-thumb / .bill-dp-block__img
   inside openBillView modals continue to render. */
.bill-dp-thumb-btn {
  display: inline-block;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.bill-dp-thumb {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--navy-500);
  display: block;
}
.bill-dp-amt {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--gold-500);
  margin-top: 2px;
}
.bill-dp-acked {
  font-size: 9.5px;
  font-weight: 600;
  color: #2ec882;
}
.bill-dp-pending {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--gold-600);
}
/* v2.12.69 — Status column stack: badge above, tiny DP sublabel below.
   Replaces the inline .bill-row-dp-flag pill (v2.12.68) which wrapped
   awkwardly under a narrow column and looked like a layout accident.
   This stack is intentional, predictable, and never overlaps. */
.bill-row-status-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  line-height: 1;
}
.bill-row-dp-sub {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--gold-600);
  text-transform: uppercase;
  white-space: nowrap;
}
/* v2.12.68 — Keep the row-action kebab clear of the viewport's right
   edge. Without this, the ⋯ button sat flush against the page padding.
   Padding-right on the actions cell + a small left auto-margin on
   .row-actions guarantee a comfortable inset. */
table.data td:last-child {
  padding-right: 16px;
}
table.data .row-actions {
  margin-left: auto;
  justify-content: flex-end;
}

/* Bill view modal — DP block image hover state */
.bill-dp-block__img { transition: transform 0.18s ease; }
.bill-dp-block__img:hover { transform: scale(1.01); }

/* ============================================================
   v2.12.65 — Phase 2 of 14-step workflow (full payment + delivery)
   ============================================================ */

/* Full Payment upload card — visually distinct from DP (green tint
   so partners can see "money side already partially settled"). */
.sr-fullpay-upload .sr-dp-amount {
  background: rgba(46, 200, 130, 0.07);
  border-color: rgba(46, 200, 130, 0.28);
}
.sr-fullpay-upload .sr-dp-amount__lbl { color: #2ec882; }

/* Delivery actions (partner @ Done Dispatch + admin @ Delivery Disputed).
   Two-button row with a discreet hint underneath. */
.sr-delivery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(46, 200, 130, 0.22);
  background: rgba(46, 200, 130, 0.05);
  border-radius: 8px;
}
.sr-delivery-btn {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.14s ease, opacity 0.14s ease;
}
.sr-delivery-btn--finish {
  background: #2ec882;
  border-color: #2ec882;
  color: #fff;
}
.sr-delivery-btn--finish:hover { background: #29b674; transform: translateY(-1px); }
.sr-delivery-btn--report {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.6);
  color: var(--gold-600);
}
.sr-delivery-btn--report:hover { background: rgba(245, 158, 11, 0.3); transform: translateY(-1px); }
.sr-delivery-btn--resolve {
  background: var(--maroon-600);
  border-color: var(--maroon-600);
  color: #fff;
}
.sr-delivery-btn--resolve:hover { background: #5a0b0b; transform: translateY(-1px); }
.sr-delivery-hint {
  flex-basis: 100%;
  font-size: 10.5px;
  color: var(--text-400);
}
.sr-delivery-report-card {
  flex-basis: 100%;
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.32);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-200);
}
body.theme-light .sr-delivery-report-card { color: var(--text-900); }

/* ======================================================================
   v2.13.0 — Production Floor Workflow
   Styles for MO assignment, sub-status pills, and the Production Staff
   "My Work" mobile-first card stack.
   ====================================================================== */

.mo-assignee-avatar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.mo-assignee-avatar__chip {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gold-600, #b8860b);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 10.5px;
  font-weight: 700;
  flex-shrink: 0;
}
.mo-assignee-avatar__name {
  font-size: 12.5px;
  color: var(--text-200);
}
.mo-assignee-avatar--unassigned .mo-assignee-avatar__chip {
  background: transparent;
  border: 1px dashed var(--navy-400);
  color: var(--text-400);
}

.mo-substatus-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  /* Keep on ONE line so every table row stays the same (thin) height —
     long task names like "Cream / Lotion Filling" must not wrap. */
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  background: rgba(96, 165, 250, 0.14);
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.3);
}
.mo-substatus-pill[data-status="Queued"]   { background: rgba(148, 163, 184, .14); color: #94a3b8; border-color: rgba(148, 163, 184, .3); }
.mo-substatus-pill[data-status="Mixing"]   { background: rgba(245, 158, 11, .14); color: var(--warning); border-color: rgba(245, 158, 11, .3); }
.mo-substatus-pill[data-status="Filling"]  { background: rgba(96, 165, 250, .14); color: #60a5fa; border-color: rgba(96, 165, 250, .3); }
.mo-substatus-pill[data-status="Labeling"] { background: rgba(167, 139, 250, .14); color: #a78bfa; border-color: rgba(167, 139, 250, .3); }
.mo-substatus-pill[data-status="QC"]       { background: rgba(244, 114, 182, .14); color: #f472b6; border-color: rgba(244, 114, 182, .3); }
.mo-substatus-pill[data-status="Packed"]   { background: rgba(52, 211, 153, .14); color: #34d399; border-color: rgba(52, 211, 153, .3); }
.mo-substatus-pill[data-status="Ready"]    { background: rgba(34, 197, 94, .16); color: #22c55e; border-color: rgba(34, 197, 94, .35); }

/* My Work — Production Staff card stack. Mobile-first; one column at narrow
   widths, two at >=768px. Touch targets ≥44px per F3 spec. */
.my-work-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 4px 0;
}
@media (min-width: 768px) {
  .my-work-list { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1200px) {
  .my-work-list { grid-template-columns: 1fr 1fr 1fr; }
}
.my-work-card {
  border: 1px solid var(--navy-600);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: var(--surface, var(--navy-800));
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.my-work-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.my-work-card__code {
  font-weight: 700;
  font-size: 15px;
  color: var(--gold, #d4a017);
}
.my-work-card__product {
  font-size: 14px;
  color: var(--text-100);
  line-height: 1.35;
}
.my-work-card__meta {
  font-size: 12px;
  color: var(--text-400);
}
.my-work-card__divider {
  height: 1px;
  background: var(--navy-700);
  margin: 4px 0;
}
.my-work-card__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
}
.my-work-card__row dt { color: var(--text-400); }
.my-work-card__row dd { color: var(--text-100); margin: 0; }
.my-work-card__remarks {
  font-size: 12.5px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border-left: 2px solid var(--navy-500);
  color: var(--text-200);
  border-radius: 4px;
  white-space: pre-wrap;
}
.my-work-card__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.my-work-card__advance {
  flex: 1;
  min-height: 44px;
  font-weight: 600;
}
.my-work-card__msg {
  min-height: 44px;
  min-width: 44px;
}
.my-work-empty {
  text-align: center;
  padding: 36px 20px;
  color: var(--text-400);
}
.my-work-empty__icon { font-size: 32px; margin-bottom: 8px; opacity: 0.6; }

body.theme-light .my-work-card { background: #fff; }
body.theme-light .my-work-card__product,
body.theme-light .my-work-card__row dd { color: var(--text-900); }
body.theme-light .my-work-card__remarks { background: rgba(0, 0, 0, 0.03); }

/* ======================================================================
   v2.13.1 — PM Lineup workflow
   ====================================================================== */

/* The stacked status cell on the MO list: lineup badge above the sub-status
   pill so the PM sees at a glance which orders still need their attention. */
.mo-status-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
}
.lineup-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.lineup-badge--pending {
  background: rgba(245, 158, 11, 0.16);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.35);
}
.lineup-badge--ready {
  background: rgba(34, 197, 94, 0.16);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

/* The 📋 Lineup row-action button — emphasised so PMs notice it. */
.row-actions button.lineup-action {
  padding: 4px 9px;
  font-size: 11.5px;
  font-weight: 600;
  background: rgba(212, 160, 23, 0.14);
  color: var(--gold, #d4a017);
  border: 1px solid rgba(212, 160, 23, 0.32);
  border-radius: 6px;
  white-space: nowrap;
}
.row-actions button.lineup-action:hover {
  background: rgba(212, 160, 23, 0.24);
}

/* The PM Lineup panel inside the MO view modal. Gold left accent so the PM
   sees their workflow zone at a glance; collapses once the order is lined up. */
.mo-lineup-panel {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--surface, var(--navy-800));
  border: 1px solid var(--navy-600);
  border-left: 3px solid var(--gold, #d4a017);
  border-radius: var(--radius-md);
}
.mo-lineup-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.mo-lineup-panel__title h4 {
  margin: 2px 0 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-100);
}
.mo-lineup-panel__eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold, #d4a017);
}
.mo-lineup-panel__chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.mo-lineup-step {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--text-300);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--navy-600);
}
.mo-lineup-tick {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
}
.mo-lineup-tick--done {
  background: rgba(34, 197, 94, 0.22);
  color: #22c55e;
}
.mo-lineup-tick--pending {
  background: rgba(245, 158, 11, 0.18);
  color: var(--warning);
}
.mo-lineup-panel__body { margin-top: 12px; }
.mo-lineup-panel__hint {
  margin: 0 0 10px;
  font-size: 12.5px;
  color: var(--text-300);
  line-height: 1.45;
}
.mo-lineup-form { gap: 10px 12px; }
.mo-lineup-panel__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}
/* The lineup save now lives in the modal footer ("Save") to keep one clear
   action point — hide the panel's inline save button (it stays wired so the
   footer Save can trigger it; the "last revised" text remains visible). */
.mo-lineup-panel__actions [data-mo-lineup-save] { display: none; }
.mo-actions-caret { font-size: 11px; opacity: 0.8; margin-left: 2px; }

/* Focus pulse when row-action "Lineup" auto-opens the panel. */
.mo-lineup-panel--focus {
  animation: mo-lineup-pulse 1.4s ease-out 1;
  box-shadow: 0 0 0 2px rgba(212, 160, 23, 0.35);
}
@keyframes mo-lineup-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(212, 160, 23, 0.6); }
  60%  { box-shadow: 0 0 0 10px rgba(212, 160, 23, 0); }
  100% { box-shadow: 0 0 0 2px rgba(212, 160, 23, 0.35); }
}
@media (prefers-reduced-motion: reduce) {
  .mo-lineup-panel--focus { animation: none; }
}

@media (max-width: 480px) {
  .mo-lineup-form { grid-template-columns: 1fr; }
  .mo-lineup-panel__chips { width: 100%; justify-content: flex-start; }
}

body.theme-light .mo-lineup-panel { background: #fff; }
body.theme-light .mo-lineup-panel__title h4 { color: var(--text-900); }
body.theme-light .mo-lineup-step { background: rgba(0,0,0,0.03); color: var(--text-700); }
body.theme-light .row-actions button.lineup-action { background: rgba(212, 160, 23, 0.10); }

/* ======================================================================
   v2.13.3 — Production Status page (redesigned card stack)
   ====================================================================== */

/* Filter chips → underline tabs. Less visual weight than the v2.13.2
   filled pills; the active tab uses a gold underline that matches the
   rest of the navy/gold theme. */
.ps-filters {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 0 4px;
  margin: 4px 0 16px;
  border-bottom: 1px solid var(--navy-600);
  flex-wrap: wrap;
}
.ps-filter {
  background: transparent;
  border: none;
  padding: 8px 4px;
  margin-right: 22px;
  color: var(--text-300);
  border-bottom: 2px solid transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ps-filter:hover { color: var(--text-100); }
.ps-filter.is-active {
  color: var(--text-100);
  border-bottom-color: var(--gold, #d4a017);
}
.ps-filter__count {
  color: var(--text-400);
  font-size: 11px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}
.ps-filter.is-active .ps-filter__count { color: var(--text-100); background: rgba(212, 160, 23, 0.18); }
.ps-filter--alert {
  color: var(--warning);
  cursor: default;
}
.ps-filter--alert .ps-filter__count { background: rgba(245, 158, 11, 0.22); color: var(--warning); }
/* Secondary "Staff" dropdown filter, pushed to the right of the task-type tabs. */
.ps-staff-filter { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: 12px; color: var(--text-400); white-space: nowrap; }
.ps-staff-filter > span { font-weight: 600; }
.ps-staff-filter select { font-size: 12px; padding: 4px 9px; border-radius: 6px; max-width: 160px; }

/* Card grid — auto-fill so it adapts to viewport instead of fixed breakpoints. */
.ps-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
/* Empty state must span the whole grid row — otherwise it lands in the first
   ~320px column and the "No production orders" text hugs the left of the page. */
.ps-list > .empty { grid-column: 1 / -1; }

/* ── Card shell ─────────────────────────────────────────────────────── */
.ps-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 11px 13px 9px 17px;
  background: var(--surface, var(--navy-800));
  border: 1px solid var(--navy-600);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
  /* Brand: every active card uses the maroon brand color for its rail + chip. */
  --stage-color: var(--maroon-600);
}
.ps-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .35);
  border-color: var(--navy-500);
}

/* Left rail + stage chip are maroon for every active stage (set on .ps-card);
   only cancelled cards drop to a muted grey so they read as terminal. */
.ps-card--stage-cancelled,
.ps-card--cancelled                      { --stage-color: var(--text-400); }
.ps-card--cancelled .ps-card__product,
.ps-card--cancelled .ps-card__mo-code,
.ps-card--cancelled .ps-card__sr-code {
  text-decoration: line-through;
  color: var(--text-400);
}

.ps-card__rail {
  position: absolute; top: 0; left: 0; bottom: 0;
  width: 4px;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  background: var(--stage-color);
}

/* ── Header ─────────────────────────────────────────────────────────── */
.ps-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ps-card__head-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.ps-card__stage-chip {
  display: inline-flex; align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--stage-color) 18%, transparent);
  color: var(--stage-color);
  white-space: nowrap;
}
.ps-card__stage-chip--ghost {
  background: transparent;
  border: 1px dashed var(--navy-500);
  color: var(--text-400);
}
.ps-card__codes {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  min-width: 0;
}
.ps-card__mo-code {
  color: var(--text-100);
  font-weight: 600;
}
.ps-card__sr-code {
  color: var(--text-300);
}
.ps-card__code-sep {
  color: var(--text-400);
}
.ps-card__qty-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--maroon-tint);
  color: var(--maroon-600);
  font-weight: 800;
  font-size: 12.5px;
}
.ps-card__qty-unit {
  color: var(--maroon-500);
  font-weight: 600;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Product line ──────────────────────────────────────────────────── */
.ps-card__product-block {
  display: flex; flex-direction: column; gap: 2px;
}
.ps-card__product {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-100);
  line-height: 1.3;
}
.ps-card__product.is-missing {
  color: var(--text-400);
  font-style: italic;
  font-weight: 500;
}
.ps-card__sku {
  font-size: 11px;
  color: var(--text-300);
  font-family: ui-monospace, monospace;
  letter-spacing: 0.02em;
}

/* ── Meta row (customer · assignee · seq · sub-status) ─────────────── */
.ps-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  font-size: 12.5px;
  color: var(--text-200);
}
.ps-card__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.ps-card__meta-item--customer::before {
  content: "👤";
  font-size: 11px;
  opacity: 0.75;
}
.ps-card__meta-item--seq,
.ps-card__meta-item--sub {
  color: var(--text-300);
  font-size: 11.5px;
}
.ps-card__assignee {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-100);
  font-weight: 600;
}
/* Current-task pill — makes the production task read clearly vs the old inline text. */
.ps-card__task-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--maroon-tint);
  color: var(--maroon-600);
}
/* Quieter secondary line: customer · run sequence. */
.ps-card__submeta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: -6px;
  font-size: 11.5px;
  color: var(--text-400);
}
.ps-card__submeta-item { display: inline-flex; align-items: center; gap: 5px; }
.ps-card__assignee--empty {
  color: var(--text-400);
  font-style: italic;
}
.ps-card__avatar {
  width: 21px; height: 21px;
  border-radius: 999px;
  background: var(--maroon-600);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.02em;
}
.ps-card__avatar--empty {
  background: transparent;
  border: 1.5px dashed var(--navy-500);
  color: var(--text-400);
  font-weight: 400;
}

/* ── Lineup pending banner ────────────────────────────────────────── */
.ps-card__lineup-warn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-100);
  background: rgba(192, 145, 47, 0.10);
  border: 1px solid rgba(192, 145, 47, 0.30);
}
.ps-icon--warn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px;
  border-radius: 999px;
  background: var(--warning);
  color: #1a1a1a;
  font-size: 11px; font-weight: 700;
}
.ps-link {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--gold, #d4a017);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  margin-left: auto;
}
.ps-link:hover { text-decoration: underline; text-underline-offset: 2px; }
.ps-link--muted {
  color: var(--text-300);
  font-weight: 500;
  font-size: 12px;
}
.ps-link--muted:hover { color: var(--gold, #d4a017); }

/* ── Collapsible editor (Batch/Lot + Remarks) ─────────────────────── */
.ps-card__editor {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--navy-600);
  border-radius: 8px;
  overflow: hidden;
}
.ps-card__editor-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-200);
  font: inherit;
  text-align: left;
}
.ps-card__editor-toggle:hover { background: rgba(255, 255, 255, 0.04); }
.ps-card__editor-icon {
  width: 18px; height: 18px;
  border-radius: 999px;
  background: var(--navy-800);
  border: 1px solid var(--navy-500);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px;
  color: var(--text-300);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
.ps-card__editor[data-collapsed="false"] .ps-card__editor-icon {
  transform: rotate(45deg);
}
.ps-card__editor-chev {
  margin-left: auto;
  color: var(--text-400);
  font-size: 10px;
  transition: transform 0.15s ease;
}
.ps-card__editor[data-collapsed="false"] .ps-card__editor-chev {
  transform: rotate(180deg);
}
.ps-card__editor-summary {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  min-width: 0;
  flex: 1;
}
.ps-card__editor-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-200);
  font-weight: 500;
}
.ps-card__editor-tag--note {
  font-style: italic;
  color: var(--text-300);
  background: transparent;
  padding-left: 0;
}
.ps-card__editor-hint {
  color: var(--text-400);
  font-size: 12px;
}
.ps-card__editor-fields {
  display: flex; flex-direction: column; gap: 12px;
  padding: 4px 12px 14px;
}

/* Floating-label inputs */
.ps-float {
  position: relative;
  display: block;
}
.ps-float input,
.ps-float textarea {
  width: 100%;
  padding: 18px 12px 8px;
  border: 1px solid var(--navy-500);
  border-radius: 8px;
  background: var(--navy-800);
  color: var(--text-100);
  font: inherit;
  resize: vertical;
}
.ps-float input:focus,
.ps-float textarea:focus {
  outline: none;
  border-color: var(--gold, #d4a017);
  box-shadow: 0 0 0 2px rgba(212, 160, 23, 0.25);
}
.ps-float input:disabled,
.ps-float textarea:disabled {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-400);
  cursor: not-allowed;
}
.ps-float__label {
  position: absolute;
  left: 12px;
  top: 14px;
  font-size: 13px;
  color: var(--text-300);
  pointer-events: none;
  transition: top 0.15s ease, font-size 0.15s ease, color 0.15s ease, letter-spacing 0.15s ease;
}
.ps-float input:focus + .ps-float__label,
.ps-float input:not(:placeholder-shown) + .ps-float__label,
.ps-float textarea:focus + .ps-float__label,
.ps-float textarea:not(:placeholder-shown) + .ps-float__label {
  top: 5px;
  font-size: 10px;
  color: var(--text-400);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

/* ── Action buttons ────────────────────────────────────────────────── */
.ps-card__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ps-card__actions-secondary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ps-card__no-actions {
  font-size: 12px;
  color: var(--text-400);
  font-style: italic;
  padding: 8px 4px;
}
.ps-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 13px;
  border-radius: 8px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
}
.ps-btn--full {
  width: 100%;
  justify-content: space-between;
}
/* Brand: the primary action is always maroon, whatever the stage variant. */
.ps-btn--primary,
.ps-btn--primary-gold,
.ps-btn--primary-navy,
.ps-btn--primary-green { background: var(--maroon-600); color: #fff; border-color: transparent; }
.ps-btn--primary:hover,
.ps-btn--primary-gold:hover,
.ps-btn--primary-navy:hover,
.ps-btn--primary-green:hover { background: var(--maroon-700); }
.ps-btn__arrow {
  font-size: 14px;
  transition: transform 0.15s ease;
}
.ps-btn--primary:hover .ps-btn__arrow { transform: translateX(2px); }

.ps-btn--ghost {
  background: transparent;
  border: 1px solid var(--navy-500);
  color: var(--text-200);
}
.ps-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-100);
  border-color: var(--navy-400, var(--navy-500));
}
.ps-btn--danger {
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--maroon-600) 30%, transparent);
  color: var(--maroon-600);
}
.ps-btn--danger:hover {
  background: var(--maroon-tint);
  border-color: var(--maroon-600);
}

/* ── Footer ────────────────────────────────────────────────────────── */
.ps-card__foot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-top: 2px;
}

/* ── Saved flash chip ──────────────────────────────────────────────── */
.ps-saved-flash {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--maroon-600);
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
}
.ps-saved-flash.is-on { animation: psSavedFlash 1.4s ease forwards; }
@keyframes psSavedFlash {
  0%   { opacity: 0; transform: translateY(4px); }
  15%  { opacity: 1; transform: translateY(0); }
  75%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(-2px); }
}

/* ── Detail modal (unchanged from v2.13.2) ─────────────────────────── */
.ps-detail { display: flex; flex-direction: column; gap: 18px; }
.ps-detail__section {
  padding: 12px 14px;
  border: 1px solid var(--navy-600);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
}
.ps-detail__section h4 {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-400);
  font-weight: 700;
}
/* Stacked label + field rows inside the ticket detail (Batch/Lot #, Remarks,
   and the task add-form). Without this they collapsed onto one cramped line. */
.ps-inline { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.ps-inline:last-child { margin-bottom: 0; }
.ps-inline > span { font-size: 12px; font-weight: 600; color: var(--text-400); }
.ps-inline input,
.ps-inline select,
.ps-inline textarea { width: 100%; }
.ps-inline--wide { width: 100%; }

/* SR ticket read-only Production block (v2.13.2 — kept) */
.sr-production--ro .ledger-readout { display: flex; flex-direction: column; gap: 4px; padding: 6px 0; }
.sr-production--ro .ledger-readout__row { display: flex; gap: 12px; font-size: 12.5px; }
.sr-production--ro .ledger-readout__row .lbl { color: var(--text-400); min-width: 140px; }
.sr-production--ro .ledger-readout__row .val { color: var(--text-100); flex: 1; }
.sr-production--ro .ledger-readout__row--block { flex-direction: column; gap: 4px; }
.sr-production--ro .ledger-readout__row--block .lbl { min-width: 0; }
.sr-production--ro .ledger-hint a { color: var(--gold, #d4a017); }

/* ── Mobile ────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .ps-card { padding: 12px 14px 10px 18px; }
  .ps-card__head-main { gap: 6px; }
  .ps-card__qty-chip { padding: 3px 8px; font-size: 12px; }
  .ps-card__product { font-size: 14px; }
  .ps-card__actions-secondary { grid-template-columns: 1fr; }
  .ps-filter { margin-right: 14px; }
}

body.theme-light .ps-card { background: #fff; }
body.theme-light .ps-card__product,
body.theme-light .ps-card__mo-code { color: var(--text-900); }
body.theme-light .ps-float input,
body.theme-light .ps-float textarea { color: var(--text-900); background: #fff; }

/* ======================================================================
   v2.14.0 — Quality Control + Logistics + Discrepancy form additions
   ====================================================================== */

/* Quality Control stage chip — used both on the ps-card stage-chip color
   variant and in the SR pipeline badges throughout the app. */
.ps-card--stage-qc-inspection            { --stage-color: #f472b6; }
.ps-card--stage-delivered                { --stage-color: #34d399; }
.ps-card--stage-draft                    { --stage-color: var(--text-400); }
.ps-card--stage-capacity-verification    { --stage-color: #38bdf8; }

/* Status pipeline badges (the role-aware status text rendered by
   statusDisplayLabel) used outside the card view for the new statuses.
   Scoped to .badge so the MO sub-status pill (.mo-substatus-pill) cannot
   accidentally inherit if a future subStatus literal collides with one
   of these status keys. */
.badge.status-qc-inspection,
.badge[data-status="QC Inspection"] {
  background: rgba(244, 114, 182, 0.14);
  color: #f472b6;
  border: 1px solid rgba(244, 114, 182, 0.35);
}
.badge.status-delivered,
.badge[data-status="Delivered"] {
  background: rgba(52, 211, 153, 0.14);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.32);
}
.badge.status-draft,
.badge[data-status="Draft"] {
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-300);
  border: 1px solid rgba(148, 163, 184, 0.30);
}
.badge.status-capacity-verification,
.badge[data-status="Capacity Verification"] {
  background: rgba(56, 189, 248, 0.14);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.32);
}

/* Discrepancy form modal — photo preview thumbnails styled to match the
   dark navy theme tokens used across requests.js attachment grids. */
.dsc-photo-preview {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.dsc-photo-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--navy-500);
  background: rgba(255, 255, 255, 0.04);
}
.dsc-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* QC + Logistics view containers piggy-back on the .ps-list grid + .ps-card
   layout; no separate page-level styling needed. */

/* Capacity Verification shortfall table inside the override modal — match
   the data table's visual weight. */
.sr-status-update__shortcut + .sr-status-update__shortcut {
  margin-left: 6px;
}

body.theme-light .ps-card--cancelled .ps-card__product,
body.theme-light .ps-card--cancelled .ps-card__mo-code,
body.theme-light .ps-card--cancelled .ps-card__sr-code { color: #888; }


/* ============================================================
   Settings launcher — hub grid → single panel (v2.15.38)
   Clean, grouped settings overview: category headings, groups
   (circular icon + title), and on-brand links that open one
   panel at a time. Replaces the long stacked-section scroll.
   ============================================================ */
.settings-hub { display: flex; flex-direction: column; gap: 34px; padding: 4px 2px 8px; }
.settings-hub-cat-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-100);
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}
.settings-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 26px 32px;
}
.settings-hub-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.settings-hub-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--navy-800);
  color: var(--text-400);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.settings-hub-icon svg { width: 18px; height: 18px; fill: currentColor; }
.settings-hub-group-title { font-size: 14.5px; font-weight: 600; color: var(--text-100); }
.settings-hub-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 44px;
}
.settings-hub-link {
  font-size: 13px;
  color: var(--maroon-600);
  cursor: pointer;
  width: fit-content;
  transition: color 0.12s;
}
.settings-hub-link:hover { color: var(--maroon-700); text-decoration: underline; }

/* Back bar shown when a single settings panel is open */
.settings-back { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.settings-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: var(--maroon-600);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
}
.settings-back-btn:hover { color: var(--maroon-700); }
.settings-back-title { font-size: 15px; font-weight: 700; color: var(--text-100); }

@media (max-width: 640px) {
  .settings-hub-grid { grid-template-columns: 1fr; gap: 22px; }
}


/* ============================================================
   User-chip profile dropdown (v2.15.43) — clean rounded card
   with icon+label rows, a red Sign out, opened from the topbar
   profile chip. Replaces the generic context menu.
   ============================================================ */
.user-menu {
  position: fixed;
  z-index: 1200;
  min-width: 234px;
  background: var(--navy-700);
  border: 1px solid var(--navy-500);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  animation: user-menu-in 0.13s ease;
}
@keyframes user-menu-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}
.user-menu__item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 11px;
  background: none;
  border: none;
  border-radius: 9px;
  color: var(--text-200);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s, color 0.1s;
}
.user-menu__item > span:first-of-type { flex: 1; }
.user-menu__item svg { color: var(--text-400); flex-shrink: 0; transition: color 0.1s; }
.user-menu__item:hover { background: var(--navy-600); color: var(--text-100); }
.user-menu__item:hover svg { color: var(--text-200); }
.user-menu__hint { font-size: 11px; font-weight: 600; color: var(--text-400); }
.user-menu__sep { height: 1px; background: var(--navy-500); margin: 5px 9px; opacity: 0.7; }
.user-menu__item--danger { color: var(--danger); }
.user-menu__item--danger svg { color: var(--danger); }
.user-menu__item--danger:hover { background: rgba(239, 68, 68, 0.10); color: var(--danger); }
.user-menu__item--danger:hover svg { color: var(--danger); }

/* Open-state affordance on the chip + caret flip */
.user-chip--open { background: var(--navy-600); border-color: var(--navy-500); }
.user-chip-caret { transition: transform 0.15s ease; }
.user-chip--open .user-chip-caret { transform: rotate(180deg); }

/* ============================================================
   MAROON RAIL — premium brand sidebar (v2.16.9)
   A deep-maroon nav "island" beside the light content area. Uses
   LITERAL hex (not --navy-*/--maroon-* tokens) on purpose: the theme
   remaps those per light/dark, which would flip the rail's colour.
   Literal hex keeps it maroon in BOTH app themes. Appended last so it
   wins over the base sidebar and collapsed-state rules by source
   order. Scoped entirely to the sidebar — content area is untouched.
   ============================================================ */
/* Theme-aware rail (v2.16.195): NIGHT = Option A (cream + maroon),
   LIGHT = Option C (dark maroon + gold pill). !important beats the token remaps. */
body.theme-light .sidebar {
  background: #4a0f18 !important;                          /* Option C — flat richer maroon */
  border-right: 1px solid rgba(224, 164, 55, 0.20);      /* gold hairline */
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.05);  /* light-catching edge */
}
body:not(.theme-light) .sidebar {
  background: #25252A !important;                          /* v2.16.353 — soft black, was warm cream */
  border-right: 1px solid #36363C;
  box-shadow: none;
}

/* Brand header — dissolves into the maroon rail, gold hairline below */
.brand {
  background: transparent;
  border-bottom: 0;
  position: relative;
}
.brand::after {                       /* fading gold hairline replaces the hard rule */
  content: "";
  position: absolute;
  left: 20px; right: 20px; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(214, 172, 78, 0.22) 16%, rgba(214, 172, 78, 0.22) 84%, transparent);
}
.brand-mark {                         /* white tile holding the FB monogram — reads on the dark rail */
  background: #FFFFFF;
  border-radius: var(--radius-md);
  overflow: hidden;
  padding: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.brand-mark img { border-radius: 4px; object-fit: contain; }
.brand-name { color: #F2F4F9; }
.brand-sub  { color: var(--gold-400); }       /* gold-400 — glows on navy */

/* Section labels — cool slate, recede into the rail */
.nav-label   { color: #5E6E8C; letter-spacing: 0.12em; }
.nav-section { margin-bottom: 22px; } /* locked spacing rhythm */

/* Nav links — quiet warm-white, softer pill (grafted 9px radius) */
.nav-link {
  color: #C9D0DD;
  border-radius: 9px;
  margin-bottom: 3px;
}
.nav-icon { opacity: 0.75; }          /* quiet at rest, but never invisible */

.nav-link:hover {                     /* pure tactile lift, no colour shift */
  background: rgba(255, 255, 255, 0.06);
  color: #FFFFFF;
}
.nav-link:hover .nav-icon { opacity: 0.95; }

/* Active — maroon glow fill (the brand action colour) + a lit gold bar
   (wayfinding). Gold is used ONCE here so it stays precious; the icon
   rides warm-white rather than adding a third gold cue. */
.nav-link.active {
  background: rgba(124, 29, 42, 0.32);
  color: var(--gold-400);                      /* gold-400 — active label + icon read gold */
}
.nav-link.active .nav-icon { opacity: 1; }
.nav-link.active::before {
  background: var(--gold-400);                 /* gold-400 */
  box-shadow: 0 0 8px rgba(214, 172, 78, 0.5);
}

/* "More" toggle hovers gold — maroon is reserved for the active state */
.nav-more-toggle:hover { color: var(--gold-400); }

/* Collapse button — re-skinned to belong to the dark rail */
.sidebar-collapse-btn {
  background: #0F1A2E;
  border: 1px solid rgba(214, 172, 78, 0.30);
  color: #E8EBF2;
}
.sidebar-collapse-btn:hover {
  background: var(--gold-500);
  color: #0B1426;
  border-color: var(--gold-500);
}

/* Scrollbar — dark, disappears until needed */
.nav::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb { background: #2A3B57; }

/* ---------- Login: "or" divider + Continue with Google ---------- */
.login-or {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-500);
  font-size: 12px;
  margin: 16px 0 12px;
}
.login-or::before,
.login-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--navy-500);
}
.login-or span { padding: 0 12px; }
.login-google {
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-google svg { flex: 0 0 auto; margin-right: 10px; }

/* ===== Split-screen login (v2.16.70) — maroon brand panel + clean form ===== */
.login-split {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  max-width: 860px;
  min-height: 500px;
  /* Cap the card so the maroon panel never stretches to a very long form and
     leaves a dead void beside it; the form pane scrolls inside instead. */
  max-height: min(640px, calc(100vh - 48px));
  flex-shrink: 0;
  margin: 0 auto;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 64px -20px rgba(38, 24, 28, 0.45), 0 6px 18px -6px rgba(38, 24, 28, 0.20);
  animation: loginIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.login-hero {
  flex: 0 0 50%;
  position: relative;
  overflow: hidden;
  background: var(--maroon-700, var(--maroon-600));
  color: #f7f2ea;
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.login-hero-mark {
  position: absolute;
  right: -30px;
  bottom: -78px;
  font-size: 200px;
  font-weight: 800;
  line-height: 0.8;
  letter-spacing: -0.04em;
  color: rgba(0, 0, 0, 0.12);
  pointer-events: none;
  z-index: 0;
}
.login-hero-top { position: relative; display: flex; align-items: center; gap: 13px; }
.login-hero-logo {
  width: 46px; height: 46px;
  background: #ffffff;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
}
.login-hero-logo img { max-width: 82%; max-height: 82%; object-fit: contain; }
.login-hero-fb { text-align: center; }
.login-hero-fb .bar { display: block; width: 32px; height: 8px; background: var(--gold-500, #e0a437); border-radius: 3px; margin: 0 auto 3px; }
.login-hero-fb .fb { font-size: 17px; font-weight: 800; color: var(--maroon-700, var(--maroon-600)); line-height: 1; }
/* Display serif on the brand name + headline (matching the profile deck); the
   small tracked caps below each stay in the sans, where they're cleaner. */
.login-hero-co {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 700; letter-spacing: 0.04em;
}
.login-hero-sub { font-size: 9.5px; letter-spacing: 0.2em; color: #e7c98f; margin-top: 2px; }
.login-hero-tag { position: relative; margin-top: auto; z-index: 1; }
.login-hero-rule { width: 48px; height: 3px; background: var(--gold-500, #e0a437); border-radius: 2px; margin-bottom: 20px; }
.login-hero-head {
  font-family: var(--font-display);
  font-size: 42px; font-weight: 800; line-height: 1.04; letter-spacing: -0.01em;
}
.login-hero-icons { font-size: 17px; font-weight: 600; color: var(--gold-500, #e0a437); letter-spacing: 0.08em; margin-top: 10px; }
.login-hero-foot { position: relative; z-index: 1; font-size: 11px; color: rgba(247, 242, 234, 0.70); margin-top: 28px; }
.login-form-pane {
  flex: 1;
  min-width: 0;
  background: #fff;
  padding: 38px 42px;
  display: flex;
  flex-direction: column;
  /* `safe` matters: plain `center` pushes overflow past BOTH edges, and the top
     half is then unreachable by scrolling. Safe centring falls back to the
     start once the content is taller than the pane. */
  justify-content: safe center;
  overflow-y: auto;
}

/* Two-column fields on the register / first-run forms only (they're the tall
   ones — `#confirmPassword` exists nowhere else). Pairs up as
   Full Name | Company, Email | Username, Password | Confirm. */
.login-form:has(#confirmPassword) {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}
.login-form:has(#confirmPassword) > .field:has(.role-picker),
.login-form:has(#confirmPassword) > .login-error,
.login-form:has(#confirmPassword) > .login-submit {
  grid-column: 1 / -1;
}
/* Staff (and first-run) have no Company field. Give Full Name the whole row so
   the rest still pair up as Email|Username and Password|Confirm, instead of
   leaving Confirm Password stranded alone on the last row. */
.login-form:has(#confirmPassword):not(:has(#businessName)) > .field:has(#fullName) {
  grid-column: 1 / -1;
}
.login-form-pane .login-title,
.login-form-pane .login-subtitle { text-align: left; }
.login-foot-credit { margin-top: 14px; text-align: center; font-size: 11px; color: var(--text-500); line-height: 1.7; }
@media (max-width: 760px) {
  /* Stacked layout has no side panel to leave a void, so drop the cap and let
     the page scroll normally instead of nesting a scroll area on a phone. */
  .login-split { flex-direction: column; max-width: 460px; min-height: 0; max-height: none; }
  .login-hero {
    flex: none;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding: 22px 26px;
  }
  .login-hero-tag, .login-hero-foot, .login-hero-mark { display: none; }
  .login-form-pane { padding: 30px 26px; }
  .login-form:has(#confirmPassword) { grid-template-columns: 1fr; }
}



/* ============================================================
   v2.17 — Production Manager action-first dashboard
   Action queue cards ("Needs you now"), floor stage strip,
   compact dispatch row. Tokens flip with light/dark themes.
   ============================================================ */
.pm-eyebrow {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--gold-500);
  margin: 2px 0 8px;
}
.pm-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.pm-act {
  background: var(--navy-700);
  border: 1px solid var(--navy-500);
  border-left: 3px solid var(--warning);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
}
.pm-act-top { display: flex; align-items: baseline; gap: 8px; }
.pm-act-num { font-size: 24px; font-weight: 700; line-height: 1; }
.pm-act-noun { font-size: 13px; font-weight: 600; color: var(--text-100); }
.pm-act-sub {
  font-size: 12px;
  color: var(--text-500);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pm-act-cta { font-size: 12px; font-weight: 600; color: var(--gold-500); margin-top: 8px; }
.pm-stages { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pm-stage {
  background: var(--navy-800);
  border-radius: 8px;
  padding: 10px 6px;
  text-align: center;
  cursor: pointer;
}
.pm-stage-n { font-size: 20px; font-weight: 700; color: var(--text-100); }
.pm-stage.is-zero .pm-stage-n { color: var(--text-500); }
.pm-stage-lbl { font-size: 11.5px; color: var(--text-400); margin-top: 2px; }
.pm-dispatch { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 14px 16px; }
.pm-d-stat { font-size: 12.5px; color: var(--text-300); }
.pm-d-stat b { font-weight: 700; color: var(--text-100); }
@media (max-width: 600px) {
  .pm-stages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pm-dispatch { gap: 10px; }
}

/* ============================================================
   v2.17 — Admin command-center dashboard
   Grouped action lanes (Money / Approvals / Floor) + business
   pulse strip. Shares .pm-eyebrow with the PM dashboard.
   ============================================================ */
.adm-lanes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.adm-lane { padding: 12px 14px; }
.adm-lane-title {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 4px;
}
.adm-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-top: 1px solid var(--navy-600);
  font-size: 12.5px;
  color: var(--text-300);
  cursor: pointer;
}
.adm-row:hover { color: var(--text-100); }
.adm-row b { font-weight: 700; }
.adm-row-arrow { color: var(--gold-500); font-weight: 600; }
.adm-row--empty { color: var(--text-500); cursor: default; }
.adm-row--empty:hover { color: var(--text-500); }
.adm-pulse {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
/* Real card surface (white in light theme, panel in dark) — navy-800 blended
   into the page background in the light theme, making the strip look like
   floating text. */
.adm-pulse-card {
  background: var(--navy-700);
  border: 1px solid var(--navy-500);
  border-radius: 10px;
  padding: 12px 14px;
}
.adm-pulse-lbl { font-size: 11.5px; color: var(--text-400); }
.adm-pulse-n { font-size: 19px; font-weight: 700; color: var(--text-100); margin-top: 2px; }

/* v2.17 — Partner dashboard: 5-stage order tracker (shares .pm-stage tiles) */
.pm-stages.pt-stages { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 600px) {
  .pm-stages.pt-stages { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ============================================================
   v2.17 — Discrepancy claim + resolution panels (SR ticket)
   ============================================================ */
.sr-disc-eyebrow {
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  font-weight: 700; color: var(--text-400); margin: 2px 0 6px;
}
.dsc-claim {
  background: var(--navy-800); border: 1px solid var(--navy-500);
  border-radius: 8px; padding: 10px 12px; margin-bottom: 8px;
}
.dsc-claim-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dsc-claim-type { font-weight: 600; color: var(--text-100); font-size: 13px; }
.dsc-claim-qty { font-size: 12px; color: var(--text-400); }
.dsc-claim-badge { font-size: 10.5px; font-weight: 700; padding: 1px 8px; border-radius: 99px; }
.dsc-claim-badge.is-open { background: rgba(224,164,55,0.16); color: var(--gold-600, #c98a2a); }
.dsc-claim-badge.is-resolved { background: rgba(46,200,130,0.14); color: var(--success); }
.dsc-claim-desc { font-size: 12.5px; color: var(--text-300); margin-top: 6px; white-space: pre-wrap; }
.dsc-claim-photos { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.dsc-claim-thumb {
  width: 56px; height: 56px; border-radius: 6px; overflow: hidden;
  border: 1px solid var(--navy-500); display: block;
}
.dsc-claim-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dsc-claim-meta { font-size: 11px; color: var(--text-500); margin-top: 6px; }
.dsc-claim-resolution {
  font-size: 12.5px; color: var(--text-200); margin-top: 8px;
  padding-top: 8px; border-top: 1px solid var(--navy-600);
}
.sr-disc-evidence {
  background: var(--navy-800); border: 1px solid var(--navy-500);
  border-radius: 8px; padding: 10px 12px; margin-bottom: 8px;
}
.sr-disc-evidence-rows { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-300); }

/* ============================================================
   v2.17 — Production ticket detail redesign (Order Line-up)
   Maroon summary hero + workflow stepper + card sections.
   Reuses #psTasksSection (styled here as a card) so the
   existing task handlers keep working unchanged.
   ============================================================ */
.pt-detail { display: flex; flex-direction: column; }
.pt-hero {
  background: linear-gradient(180deg, var(--maroon-600) 0%, #59101a 100%);
  color: #f7f2ea; border-radius: 10px; padding: 14px 16px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
}
.pt-hero-product { font-size: 15px; font-weight: 600; }
.pt-hero-codes { font-size: 12px; color: #e7c98f; margin-top: 3px; font-family: var(--font-mono); }
.pt-hero-qty { font-size: 20px; font-weight: 700; white-space: nowrap; }
.pt-hero-qty span { font-size: 11px; color: #e7c98f; font-weight: 500; margin-left: 3px; }
.pt-hero-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; }
.pt-chip { background: var(--navy-700); border: 1px solid var(--navy-500); color: var(--text-200); font-size: 11.5px; padding: 3px 10px; border-radius: 99px; }
.pt-chip--muted { color: var(--text-400); }

.pt-workflow-label { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-400); font-weight: 700; margin: 14px 0 8px; }
.pt-stepper { display: flex; align-items: flex-start; margin-bottom: 4px; }
.pt-step { flex: 0 0 auto; width: 72px; text-align: center; }
.pt-step-dot {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  margin: 0 auto; font-size: 12px; font-weight: 700;
  background: var(--navy-700); border: 1.5px solid var(--navy-500); color: var(--text-400);
}
.pt-step-lbl { display: block; font-size: 11px; margin-top: 5px; color: var(--text-400); }
.pt-step.is-active .pt-step-dot { background: var(--maroon-600); border-color: var(--maroon-600); color: #fff; }
.pt-step.is-active .pt-step-lbl { color: var(--text-100); font-weight: 600; }
.pt-step.is-done .pt-step-dot { background: var(--gold-500); border-color: var(--gold-500); color: #4a0e15; }
.pt-step.is-done .pt-step-lbl { color: var(--text-200); }
.pt-step-line { flex: 1; height: 2px; background: var(--navy-500); margin-top: 13px; min-width: 12px; }

.pt-card, .pt-detail #psTasksSection {
  background: var(--navy-700); border: 1px solid var(--navy-500);
  border-radius: 10px; padding: 14px 16px; margin: 12px 0 0;
}
.pt-card-title, .pt-detail #psTasksSection h4 {
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-400); font-weight: 700; margin: 0 0 10px;
}
.pt-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pt-field { display: flex; flex-direction: column; gap: 4px; }
.pt-field--wide { grid-column: 1 / -1; }
.pt-field > span { font-size: 11.5px; color: var(--text-400); }
.pt-field input, .pt-field textarea {
  width: 100%; padding: 8px 10px; font-size: 13px;
  background: var(--navy-800); border: 1px solid var(--navy-500); border-radius: 6px; color: var(--text-100);
}
.pt-field textarea { resize: vertical; }
.pt-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; padding: 6px 0; border-top: 1px solid var(--navy-600); }
.pt-row:first-of-type { border-top: none; }
.pt-row span { color: var(--text-400); }
.pt-card--advance .pt-advance-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 600px) {
  .pt-fields { grid-template-columns: 1fr; }
  .pt-step { width: 60px; }
}

/* v2.17 — ticket sub-status chip + staff read-only card details */
.pt-chip--stage { background: rgba(224,164,55,0.16); color: var(--gold-600, #c98a2a); border-color: rgba(224,164,55,0.35); }
.ps-card__readonly-details { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 2px; }

/* =========================================================================
   v2.17 — Formulation Requests (new-product requests)
   ========================================================================= */
/* "New product" badge in the Stock Requests item column */
.badge-new-product {
  display: inline-block; vertical-align: middle;
  font-size: 10px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
  color: #fff; background: linear-gradient(135deg, #4b0a12, #7a1420);
  padding: 1px 7px; border-radius: 999px; margin-left: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,.15);
}
/* Pending-count pill on the admin "Formulation Request" header button */
.frq-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: 7px;
  font-size: 11px; font-weight: 800; line-height: 1;
  color: #fff; background: var(--gold-600, #c98a2a); border-radius: 999px;
}
/* Partner "Request New Product" — lives at the bottom-left of the New Stock
   Request ticket footer (for products not in the catalog yet). */
.btn.frq-ticket-btn {
  margin-right: auto;                 /* push to the far left of the footer */
  display: inline-flex; align-items: center; gap: 6px;
  color: #7a1420; font-weight: 600;
  border: 1px solid rgba(122,20,32,.30);
}
.btn.frq-ticket-btn:hover { background: rgba(122,20,32,.07); color: #4b0a12; border-color: rgba(122,20,32,.5); }
.btn.frq-ticket-btn svg { flex: none; }
@media (max-width: 560px) { .btn.frq-ticket-btn { margin-right: 0; width: 100%; justify-content: center; } }

/* Partner brief form — section headers + file inputs */
.frq-section-label {
  font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--gold-600, #c98a2a); margin: 16px 0 8px; padding-bottom: 5px;
  border-bottom: 1px solid var(--border, #e4e0d6);
}
.frq-section-label:first-child { margin-top: 4px; }
.frq-file {
  width: 100%; font-size: 13px; color: var(--text, #3a3a3a);
  padding: 7px 8px; border: 1px dashed var(--border, #cfc8ba); border-radius: 8px;
  background: var(--surface-2, #faf7f0); cursor: pointer;
}
.frq-file::file-selector-button {
  margin-right: 10px; padding: 6px 12px; border: none; border-radius: 6px; cursor: pointer;
  font-size: 12px; font-weight: 700; color: #fff; background: linear-gradient(135deg, #4b0a12, #7a1420);
}
/* Compact field sizing for the partner "Request New Product" form only, so the
   boxes don't overpower the modal. Scoped to .frq-form to leave other forms as-is. */
.frq-form .form-grid { gap: 10px; }
.frq-form .field { gap: 4px; }
.frq-form .field label { font-size: 11.5px; }
.frq-form .field input,
.frq-form .field select,
.frq-form .field textarea,
.frq-form .frq-file,
.frq-form .frq-asset-link { padding: 6px 10px; font-size: 13px; }
.frq-form .field textarea { min-height: 58px; }
.frq-form .field .hint { font-size: 10.5px; }
.frq-form .frq-section-label { margin: 12px 0 6px; }
.frq-form .frq-section-label:first-child { margin-top: 2px; }
.frq-form .frq-asset { gap: 5px; }
.frq-form .frq-file::file-selector-button { padding: 5px 10px; font-size: 11.5px; }
.frq-form > p:first-child { margin-bottom: 6px; }

/* File OR link asset row */
.frq-asset { gap: 6px; }
.frq-asset-link {
  width: 100%; font-size: 13px; color: var(--text, #3a3a3a);
  padding: 8px 10px; border: 1px solid var(--border, #e4e0d6); border-radius: 8px;
  background: var(--surface, #fff);
}
.frq-asset-link::placeholder { color: var(--text-muted, #a89f8e); }

/* Admin inbox list */
.frq-list { display: flex; flex-direction: column; gap: 12px; }
.frq-item {
  border: 1px solid var(--border, #e4e0d6); border-radius: 12px; padding: 14px 16px;
  background: var(--surface, #fff);
}
.frq-item-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.frq-item-name { font-size: 15px; font-weight: 700; color: var(--text, #2a2a2a); }
.frq-item-meta { font-size: 12px; color: var(--text-muted, #8a857a); margin-top: 2px; }
.frq-item-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
/* Spec grid (weight, form, color, scent, SRP, cost) */
.frq-specs {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 14px;
  margin-top: 10px; padding: 10px 12px; background: var(--surface-2, #faf7f0); border-radius: 8px;
}
.frq-spec { display: flex; flex-direction: column; gap: 1px; }
.frq-spec-k { font-size: 10px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--text-muted, #8a857a); }
.frq-spec-v { font-size: 13px; color: var(--text, #2a2a2a); }
/* Free-text blocks */
.frq-block { margin-top: 10px; }
.frq-block-k { font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--text-muted, #8a857a); margin-bottom: 2px; }
.frq-block-v { font-size: 13px; color: var(--text, #3a3a3a); white-space: pre-wrap; }
.frq-link { font-size: 13px; color: #7a1420; word-break: break-all; }
/* Attached files / images */
.frq-files { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.frq-thumb {
  display: flex; flex-direction: column; align-items: center; gap: 4px; width: 92px;
  text-decoration: none; color: var(--text-muted, #8a857a); font-size: 11px;
}
.frq-thumb img {
  width: 92px; height: 92px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--border, #e4e0d6);
}
.frq-file-chip {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  padding: 8px 12px; border: 1px solid var(--border, #e4e0d6); border-radius: 8px;
  background: var(--surface-2, #faf7f0); color: var(--text, #3a3a3a); font-size: 12px; text-decoration: none;
}
.frq-file-chip:hover { border-color: rgba(122,20,32,.5); color: #4b0a12; }

/* ---- Review Console: triage bar ---- */
.frq-triage {
  position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; padding-bottom: 12px; margin-bottom: 12px;
  border-bottom: 1px solid var(--border, #e4e0d6); background: var(--surface, #fff);
}
.frq-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.frq-tab {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px;
  border: 1px solid transparent; background: transparent; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--text-muted, #8a857a);
}
.frq-tab:hover { background: var(--surface-2, #faf7f0); }
.frq-tab.active { background: rgba(122,20,32,.08); color: #4b0a12; border-color: rgba(122,20,32,.25); }
.frq-tab-n {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px;
  padding: 0 5px; font-size: 11px; font-weight: 800; border-radius: 999px;
  background: var(--border, #e4e0d6); color: var(--text, #3a3a3a);
}
.frq-tab.active .frq-tab-n { background: #7a1420; color: #fff; }
.frq-search {
  flex: 1 1 200px; min-width: 160px; max-width: 320px; font-size: 13px;
  padding: 8px 12px; border: 1px solid var(--border, #e4e0d6); border-radius: 8px; background: var(--surface, #fff);
}

/* ---- FR status badges ---- */
.frq-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.frq-b-submitted { background: #fef3c7; color: #92600a; }
.frq-b-review    { background: #dbeafe; color: #1e4f8a; }
.frq-b-info      { background: #f3e8ff; color: #6b21a8; }
.frq-b-approved  { background: #dcfce7; color: #166534; }
.frq-b-rejected  { background: #fde2e2; color: #9b1c1c; }
.frq-item-head-l { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.frq-wait { font-size: 11px; font-weight: 700; color: var(--text-muted, #8a857a); padding: 1px 8px; border-radius: 999px; background: var(--surface-2, #f3efe6); }
.frq-wait--old { color: #9b1c1c; background: #fde2e2; }
.frq-assignee { color: #1e4f8a; font-weight: 600; }

/* ---- Inline action panel ---- */
.frq-inline {
  margin-top: 12px; padding: 14px; border: 1px solid rgba(122,20,32,.22); border-radius: 10px;
  background: var(--surface-2, #faf7f0);
}
.frq-inline-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #4b0a12; margin-bottom: 10px; }
.frq-il-hint { font-size: 11px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text-muted, #8a857a); }
.frq-inline-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 14px; }
.frq-il-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.frq-il-field > span { font-weight: 700; color: var(--text-muted, #8a857a); text-transform: uppercase; font-size: 10px; letter-spacing: .03em; }
.frq-il-field input, .frq-il-select, .frq-il-textarea {
  width: 100%; font-size: 13px; padding: 8px 10px; border: 1px solid var(--border, #d9d3c6); border-radius: 7px; background: var(--surface, #fff); color: var(--text, #2a2a2a);
}
.frq-il-textarea { min-height: 74px; resize: vertical; margin-top: 4px; }
.frq-inline-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.frq-dup { font-size: 12px; color: #9b1c1c; background: #fde2e2; border: 1px solid #f7b9b9; border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; }
.frq-margin { font-size: 13px; font-weight: 700; }
.frq-margin--ok { color: #166534; }
.frq-margin--mid { color: #92600a; }
.frq-margin--low { color: #9b1c1c; }
.frq-margin--none { color: var(--text-muted, #8a857a); font-weight: 500; }
.frq-notes-log { display: flex; flex-direction: column; gap: 7px; margin-bottom: 10px; max-height: 160px; overflow-y: auto; }
.frq-note { font-size: 12.5px; color: var(--text, #3a3a3a); background: var(--surface, #fff); border: 1px solid var(--border, #e4e0d6); border-radius: 7px; padding: 7px 9px; white-space: pre-wrap; }
.frq-note-meta { display: block; font-size: 10.5px; color: var(--text-muted, #a89f8e); margin-bottom: 3px; }
.btn.btn-print { color: #4b0a12; }
.btn.btn-print:hover { background: rgba(122,20,32,.07); }

/* =========================================================================
   v2.17 — Stock Requests ticket-style rows (status rail + avatar + chips)
   ========================================================================= */
.tk-cell { position: relative; }
.tk-main { min-width: 0; }
.tk-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tk-name { font-size: 13px; font-weight: 600; color: var(--text-100); }
.tk-sub { font-size: 11.5px; color: var(--text-500); margin-top: 1px; }
.tk-status { display: flex; align-items: center; gap: 7px; flex-wrap: nowrap; white-space: nowrap; }
.tk-status > * { flex: none; }
.tk-extras { margin-top: 3px; display: flex; flex-wrap: wrap; gap: 3px; }
.tk-when { font-size: 10.5px; color: var(--text-500); }
.tk-wait {
  font-size: 10.5px; font-weight: 700; color: var(--text-500);
  background: rgba(0,0,0,.05); padding: 1px 7px; border-radius: 999px;
}
.tk-wait--old { color: #9b1c1c; background: rgba(179,38,30,.1); }
/* Compact ticket rows — trim the vertical padding on every cell in the list. */
#reqViewArea table td { padding-top: 6px; padding-bottom: 6px; }

/* ============ My Statement — partner invoice cards (v2.16.177) ============ */
.soa-grid {
  /* min(330px, 100%) — cards shrink instead of forcing sideways scroll on phones */
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr));
  gap: 12px; align-items: start;
}
.soa-card {
  /* Same chrome tokens as .card — themed for light AND night. */
  background: var(--navy-700); border: 1px solid var(--navy-500);
  border-left: 3px solid var(--gold-500); border-radius: 12px;
  padding: 14px 16px 12px; cursor: pointer;
  transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}
.soa-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,.12); transform: translateY(-1px); }
.soa-card--overdue { border-left-color: var(--danger); }
.soa-card--paid { border-left-color: var(--success); opacity: .85; }
.soa-card--cancelled { border-left-color: var(--text-500); opacity: .65; }
.soa-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.soa-head .text-mono { font-size: 13px; letter-spacing: .3px; }
.soa-balance { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.soa-bal-lbl {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .6px; color: var(--text-500);
}
.soa-bal-n { font-size: 24px; font-weight: 800; color: var(--text-100); font-variant-numeric: tabular-nums; }
.soa-meta { font-size: 11.5px; color: var(--text-400); line-height: 1.5; margin-bottom: 10px; }
.soa-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.soa-actions .btn-primary { margin-left: auto; }

/* ============ Partner catalog — product cards grid (v2.16.177) ============ */
.cat-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.cat-toolbar input[type="search"] {
  width: 280px; max-width: 100%; padding: 8px 12px; font-size: 13px;
  background: var(--navy-800); border: 1px solid var(--navy-500);
  border-radius: 8px; color: var(--text-100);
}
.cat-toolbar input[type="search"]:focus { outline: none; border-color: var(--gold-500); }
.cat-count { font-size: 12px; color: var(--text-500); white-space: nowrap; }
.cat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px; align-items: stretch;
}
.cat-card {
  /* Same chrome tokens as .card — themed for light AND night. */
  background: var(--navy-700); border: 1px solid var(--navy-500);
  border-radius: 12px; overflow: hidden; display: flex; flex-direction: column;
  transition: box-shadow .15s ease, transform .15s ease;
}
.cat-card:hover { box-shadow: 0 8px 22px rgba(0,0,0,.14); transform: translateY(-2px); }
.cat-photo { position: relative; aspect-ratio: 4 / 3; background: var(--navy-800); }
.cat-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cat-photo-ph { display: grid; place-items: center; height: 100%; color: var(--text-500); }
.cat-fav {
  position: absolute; top: 8px; right: 8px; width: 30px; height: 30px;
  border-radius: 999px; border: none; cursor: pointer;
  background: rgba(0,0,0,.38); color: #fff;
  display: grid; place-items: center; transition: background .15s ease;
}
.cat-fav:hover { background: rgba(0,0,0,.55); }
.cat-flag {
  position: absolute; bottom: 8px; left: 8px;
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px;
  padding: 3px 8px; border-radius: 999px; color: #fff;
}
.cat-flag--low { background: #B45309; }
.cat-flag--out { background: var(--danger, #B3261E); }
.cat-body { padding: 10px 12px 12px; display: flex; flex-direction: column; flex: 1; }
.cat-name {
  font-weight: 700; font-size: 13.5px; color: var(--text-100); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cat-cat { font-size: 11px; color: var(--text-500); margin-top: 1px; }
.cat-rating { margin-top: 4px; cursor: pointer; min-height: 16px; }
.cat-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; }
/* Night (default :root) — dark maroon is invisible on dark cards, use gold. */
.cat-price { font-size: 16px; font-weight: 800; color: var(--gold-500); font-variant-numeric: tabular-nums; }
body.theme-light .cat-price { color: var(--maroon-600); }
.cat-stock { font-size: 11px; color: var(--text-500); }

/* Billing Accounts — compact ticket rows (v2.16.178) */
#billTable table td { padding-top: 6px; padding-bottom: 6px; }

/* Production Orders — compact ticket rows (v2.16.178) */
#moTable table td { padding-top: 6px; padding-bottom: 6px; }

/* ============ Stock Movement — compact ledger rows (v2.16.178) ============ */
/* table.data.sm-table beats the global `table.data td` padding rule. */
table.data.sm-table td { padding-top: 6px; padding-bottom: 6px; }
.sm-dir {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px; border-radius: 999px;
  font-weight: 800; font-size: 13px; line-height: 1;
}
/* Night (default :root) — brighter chips so the arrows stay readable on dark. */
.sm-dir--in  { background: rgba(91, 190, 130, .16); color: #5BBE82; }
.sm-dir--out { background: rgba(224, 101, 92, .16); color: #E0655C; }
.sm-dir--adj { background: rgba(224, 166, 63, .16); color: #E0A63F; }
body.theme-light .sm-dir--in  { background: rgba(46, 139, 79, .14);  color: #2e8b4f; }
body.theme-light .sm-dir--out { background: rgba(179, 38, 30, .12);  color: #b3261e; }
body.theme-light .sm-dir--adj { background: rgba(193, 130, 12, .14); color: #c1820c; }
.sm-item { font-size: 13px; }
.sm-reason {
  max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ============ Dashboard live clock (v2.16.180) ============ */
.dash-clock {
  font-variant-numeric: tabular-nums;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.dash-clock-time {
  font-weight: 700; color: var(--gold-400); /* night default — brightest gold */
  background: rgba(212, 175, 55, .14);
  padding: 1px 8px; border-radius: 999px; letter-spacing: .3px;
}
body.theme-light .dash-clock-time { color: var(--gold-600, var(--gold-600)); background: rgba(212, 175, 55, .18); }

/* ============ Dashboard command center (v2.16.182) ============ */
.dsh-kpis {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px;
}
.dsh-tile {
  background: var(--navy-700); border: 1px solid var(--navy-500);
  border-radius: 12px; padding: 14px 15px;
}
.dsh-tile-ic {
  width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center; margin-bottom: 10px;
}
.dsh-tile-n { font-size: 27px; font-weight: 800; line-height: 1; color: var(--text-100); font-variant-numeric: tabular-nums; }
.dsh-tile-of { font-size: 15px; font-weight: 600; color: var(--text-500); }
.dsh-tile-lbl { font-size: 12.5px; color: var(--text-400); margin-top: 5px; }
.dsh-tile-sub { font-size: 11.5px; font-weight: 600; margin-top: 6px; }
.dsh-sub-muted { color: var(--text-500); font-weight: 500; }

.dsh-pipe { padding: 14px 18px; margin-bottom: 12px; }
.dsh-panel-lbl {
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-500);
}
.dsh-pipe-row { display: flex; align-items: flex-start; gap: 4px; margin-top: 12px; }
.dsh-pipe-stage { flex: 1; text-align: center; min-width: 0; }
.dsh-pipe-n { font-size: 22px; font-weight: 800; color: var(--text-100); line-height: 1; font-variant-numeric: tabular-nums; }
.dsh-pipe-lbl { font-size: 11px; color: var(--text-500); margin-top: 3px; }
.dsh-pipe-bar { height: 4px; border-radius: 999px; margin: 9px 6px 0; }

.dsh-lower { display: grid; grid-template-columns: 1.5fr 1fr; gap: 12px; margin-bottom: 12px; }
.dsh-panel { padding: 14px 18px; }
.dsh-panel-hd { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.dsh-week-total { font-size: 15px; font-weight: 800; color: var(--gold-500); font-variant-numeric: tabular-nums; }
.dsh-panel .chart-wrap { height: 150px; margin-top: 8px; }
.dsh-empty { font-size: 12.5px; color: var(--text-500); padding: 22px 4px; text-align: center; }
.dsh-prow {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 0; border-top: 1px solid var(--navy-600); font-size: 12.5px;
}
.dsh-prow:first-of-type { border-top: 0; }
.dsh-prow-nm { color: var(--text-200); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dsh-prow b { color: var(--text-100); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dsh-prow--more { color: var(--text-500); }
.dsh-prow--more span { font-size: 11.5px; }

/* Illustrated empty state, panel scale — same gold line-art as the full-page
   .empty-state, shrunk so it sits inside a short dashboard card. */
.dsh-empty--art { display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 16px 4px 18px; }
.dsh-empty-art { width: 68px; height: 68px; opacity: .8; }
.dsh-empty-art svg { width: 100%; height: 100%; display: block; }

@media (max-width: 720px) {
  .dsh-kpis { grid-template-columns: repeat(2, 1fr); }
  .dsh-lower { grid-template-columns: 1fr; }
  .dsh-empty-art { width: 58px; height: 58px; }
}

/* ============ Partner New Order — card-style line items (v2.16.186) ============ */
.po-items { display: flex; flex-direction: column; gap: 10px; }
.po-item-card {
  display: flex; align-items: flex-end; gap: 12px;
  background: var(--navy-800); border: 1px solid var(--navy-500);
  border-radius: 10px; padding: 12px 14px;
}
.po-item-main { flex: 1; min-width: 0; }
.po-item-qty { width: 90px; flex: none; }
.po-item-lbl {
  display: block; font-size: 11px; font-weight: 600; color: var(--text-500);
  margin-bottom: 4px; text-transform: uppercase; letter-spacing: .04em;
}
.po-item-card .form-select, .po-item-card .form-input { width: 100%; }
.po-item-rm {
  flex: none; width: 34px; height: 34px; padding: 0; font-size: 18px; line-height: 1;
  color: var(--danger); margin-bottom: 1px;
}
.po-item-rm-spacer { width: 34px; flex: none; }
.po-items > [data-action="add-row"] { align-self: flex-start; margin-top: 2px; }

/* ============ Mobile: wide data tables scroll instead of squishing (v2.16.189) ============ */
@media (max-width: 600px) {
  .table-scroll table.data { min-width: 600px; }
}

/* ============ Mobile nav drawer scrim (v2.16.189) ============ */
.sidebar-scrim { display: none; }
@media (max-width: 600px) {
  .sidebar-scrim.is-visible {
    display: block; position: fixed; inset: 0;
    background: rgba(0, 0, 0, .45); z-index: 49;
    animation: scrimFadeIn .2s ease;
  }
}
@keyframes scrimFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ============ Settings — data snapshot stat grid (v2.16.189) ============ */
.snapshot-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px;
}
.snapshot-cell {
  background: var(--navy-700); border: 1px solid var(--navy-500);
  border-radius: 8px; padding: 8px 10px;
}
.snapshot-n { font-size: 18px; font-weight: 800; color: var(--text-100); font-variant-numeric: tabular-nums; line-height: 1; }
.snapshot-lbl { font-size: 11px; color: var(--text-500); margin-top: 3px; }

/* ============ Dashboard — Who's online widget (v2.16.192) ============ */
.dsh-online-count {
  font-size: 13px; font-weight: 800; color: var(--success);
  background: rgba(46, 139, 79, .14); padding: 1px 11px; border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.dsh-online-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 6px; margin-top: 10px;
}
.dsh-online-item { display: flex; align-items: center; gap: 10px; padding: 6px 6px; border-radius: 10px; }
.dsh-online-item:hover { background: rgba(0,0,0,.04); }
.dsh-online-av {
  position: relative; width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: var(--navy-600); color: var(--text-100);
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.dsh-online-av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.dsh-online-dot {
  position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--success);
  box-shadow: 0 0 0 2px var(--navy-700), 0 0 6px var(--success);
}
.dsh-online-meta { min-width: 0; }
.dsh-online-name {
  font-size: 13px; font-weight: 600; color: var(--text-100);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dsh-online-you { font-size: 11px; color: var(--text-500); font-weight: 500; }
.dsh-online-role { font-size: 11.5px; color: var(--text-500); }

/* ====== Dashboard — Company Profile: embedded auto-sliding hero + viewer ====== */
.dsh-cp-hero {
  position: relative; width: 100%; max-width: 640px; margin: 0 0 16px;
  border-radius: var(--radius-lg); overflow: hidden; isolation: isolate; cursor: pointer;
  background: #0e0a12;
  border: 1px solid rgba(192, 145, 47, .34);            /* gold hairline frame */
  box-shadow: 0 10px 30px rgba(40, 16, 22, .18), 0 2px 6px rgba(40, 16, 22, .10);
  transition: box-shadow .2s ease, border-color .2s ease;
}
.dsh-cp-hero:hover {
  border-color: rgba(192, 145, 47, .55);
  box-shadow: 0 14px 38px rgba(40, 16, 22, .24), 0 3px 8px rgba(40, 16, 22, .12);
}
/* On the Home page the deck fills its grid cell (left column of .home-top). */
.dsh-cp-hero--page { max-width: none; margin: 0; }
.dsh-cp-stage { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; }
/* Auto-advance progress — a thin gold line that fills over one interval. */
.dsh-cp-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(0, 0, 0, .28); z-index: 2; }
.dsh-cp-prog-fill { height: 100%; width: 100%; background: var(--gold-400); transform-origin: left center; transform: scaleX(0); }
@keyframes cpProgFill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
/* Caption strip — labels the deck and shows the position (e.g. 03 / 12). */
.dsh-cp-cap {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 14px; background: var(--navy-700); border-top: 1px solid rgba(192, 145, 47, .22);
}
.dsh-cp-cap-lbl { font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-400); }
.dsh-cp-cap-count { font-size: 12px; font-weight: 700; color: var(--gold-500); font-variant-numeric: tabular-nums; letter-spacing: .06em; }
/* Slides are stacked and fade THROUGH the backdrop rather than cross-fading into
   each other: a true crossfade blends two dense, text-heavy slides at ~50/50 and
   reads as a double exposure. The outgoing slide fades out first (no delay); the
   incoming one waits that long before fading in, so the two are never both
   partly visible. */
.dsh-cp-track { position: absolute; inset: 0; }
.dsh-cp-slide {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; z-index: 0; transition: opacity .34s ease;
}
.dsh-cp-slide.is-active { opacity: 1; z-index: 1; transition: opacity .34s ease .34s; }
/* contain, not cover: the slides are exactly 16:9 and must never lose an edge —
   a sub-pixel mismatch between the box and the image was shaving the leftmost
   characters off titles. The letterbox is invisible against the dark backdrop. */
.dsh-cp-slide img { width: 100%; height: 100%; object-fit: contain; display: block; user-select: none; -webkit-user-drag: none; }
.dsh-cp-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .42); color: #fff; font-size: 26px; line-height: 1;
  opacity: 0; transition: opacity .18s ease, background .18s ease;
}
.dsh-cp-hero:hover .dsh-cp-arrow { opacity: 1; }
.dsh-cp-arrow:hover { background: rgba(0, 0, 0, .64); }
.dsh-cp-prev { left: 12px; }
.dsh-cp-next { right: 12px; }
.dsh-cp-expand {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .42); color: #fff; font-size: 17px; line-height: 1;
  opacity: 0; transition: opacity .18s ease, background .18s ease;
}
.dsh-cp-hero:hover .dsh-cp-expand { opacity: 1; }
.dsh-cp-expand:hover { background: rgba(0, 0, 0, .64); }
@media (max-width: 720px) {
  .dsh-cp-hero { border-radius: var(--radius-md); margin-bottom: 12px; }
  .dsh-cp-arrow { width: 34px; height: 34px; font-size: 22px; opacity: 1; }
  .dsh-cp-expand { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .dsh-cp-slide { transition: none; }
  .dsh-cp-prog-fill { animation: none !important; transform: scaleX(1); }
}

/* Full-screen viewer (lightbox) */
.cp-lightbox { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; }
.cp-lb-backdrop { position: absolute; inset: 0; background: rgba(8, 5, 6, .88); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.cp-lb-stage { position: relative; z-index: 1; max-width: 92vw; max-height: 88vh; display: flex; align-items: center; justify-content: center; }
.cp-lb-img {
  max-width: 92vw; max-height: 88vh; width: auto; height: auto; object-fit: contain;
  border-radius: 6px; box-shadow: 0 24px 60px rgba(0, 0, 0, .55); background: #fff;
}
.cp-lb-close, .cp-lb-arrow {
  position: absolute; z-index: 2; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; line-height: 1;
  transition: background .15s ease;
}
.cp-lb-close:hover, .cp-lb-arrow:hover { background: rgba(255, 255, 255, .24); }
.cp-lb-close { top: 18px; right: 22px; width: 40px; height: 40px; font-size: 24px; }
.cp-lb-arrow { top: 50%; transform: translateY(-50%); width: 48px; height: 48px; font-size: 30px; }
.cp-lb-prev { left: 18px; }
.cp-lb-next { right: 18px; }
.cp-lb-count {
  position: absolute; z-index: 2; bottom: 18px; left: 50%; transform: translateX(-50%);
  color: rgba(255, 255, 255, .9); font-size: 13px; font-weight: 600; letter-spacing: .04em;
  background: rgba(0, 0, 0, .4); padding: 4px 12px; border-radius: 999px; font-variant-numeric: tabular-nums;
}
@media (max-width: 640px) {
  .cp-lb-arrow { width: 40px; height: 40px; font-size: 24px; }
  .cp-lb-prev { left: 6px; } .cp-lb-next { right: 6px; }
  .cp-lb-close { top: 10px; right: 12px; }
}

/* ============ Theme-aware sidebar (v2.16.193) ============
   NIGHT (no .theme-light) → Option C: dark maroon rail, gold two-tone icons,
   flat solid gold active pill. LIGHT (.theme-light) → Option A: cream rail,
   maroon icons/text, maroon-filled active pill. High specificity + appended
   last so these win over the earlier single-theme sidebar rules. */

/* ---- NIGHT · Option A (cream) ---- */
body.theme-light .sidebar .brand-name { color: #f7f2ea; }
body.theme-light .sidebar .brand-sub { color: var(--gold-400, #e6b455); }
body.theme-light .sidebar .nav-label { color: var(--gold-500, var(--gold-500)); letter-spacing: .12em; }
body.theme-light .sidebar .nav-link { color: rgba(247, 242, 234, 0.74); }
body.theme-light .sidebar .nav-link .nav-icon { color: var(--gold-500, var(--gold-500)); fill: var(--gold-500, var(--gold-500)); opacity: 1; }
body.theme-light .sidebar .nav-link:hover { background: rgba(255, 255, 255, 0.07); color: #ffffff; }
body.theme-light .sidebar .nav-link:hover .nav-icon { color: var(--gold-400, #e6b455); fill: var(--gold-400, #e6b455); }
body.theme-light .sidebar .nav-link.active {
  background: var(--gold-400, #e6b455);
  color: #4a0f18; font-weight: 700;
  box-shadow: 0 4px 12px -4px rgba(224, 164, 55, 0.5);
}
body.theme-light .sidebar .nav-link.active::before { display: none; }
body.theme-light .sidebar .nav-link.active .nav-icon { color: #4a0f18; fill: #4a0f18; opacity: 1; }
body.theme-light .sidebar .nav-link.active .note-badge { background: #4a0f18; color: var(--gold-400, #e6b455); }

/* ---- LIGHT · Option C (maroon + gold pill) ---- */
body:not(.theme-light) .sidebar .brand-name { color: #3A2A2E; }
body:not(.theme-light) .sidebar .brand-sub { color: #B08A2E; }
body:not(.theme-light) .sidebar .brand::after { background: linear-gradient(90deg, transparent, rgba(124, 29, 42, 0.16) 16%, rgba(124, 29, 42, 0.16) 84%, transparent); }
body:not(.theme-light) .sidebar .nav-label { color: #B08A2E; letter-spacing: .1em; }
body:not(.theme-light) .sidebar .nav-link { color: #5A4A4E; }
body:not(.theme-light) .sidebar .nav-link .nav-icon { color: var(--maroon-600); fill: var(--maroon-600); opacity: 1; }
body:not(.theme-light) .sidebar .nav-link:hover { background: rgba(124, 29, 42, 0.07); color: #3A2A2E; }
body:not(.theme-light) .sidebar .nav-link:hover .nav-icon { color: var(--maroon-600); fill: var(--maroon-600); }
body:not(.theme-light) .sidebar .nav-link.active {
  background: var(--navy-700);              /* match the dashboard card/tile maroon */
  color: #ffffff; font-weight: 600;
  box-shadow: 0 2px 10px -4px rgba(0, 0, 0, 0.45);
}
body:not(.theme-light) .sidebar .nav-link.active::before { display: none; }
body:not(.theme-light) .sidebar .nav-link.active .nav-icon { color: #ffffff; fill: #ffffff; opacity: 1; }
body:not(.theme-light) .sidebar .nav-link.active .note-badge { background: #ffffff; color: var(--maroon-600); }
body:not(.theme-light) .sidebar .nav-more-toggle:hover { color: var(--maroon-600); }
body:not(.theme-light) .sidebar .sidebar-footer { border-top: 1px solid #E7DAC7; }
body:not(.theme-light) .sidebar .sidebar-version { color: #9A8A80; }
body:not(.theme-light) .sidebar::-webkit-scrollbar-thumb,
body.theme-light .nav::-webkit-scrollbar-thumb { background: #E0D2BE; }

/* ============ Login form pane — theme-independent (v2.16.204) ============
   The right pane is ALWAYS white in both light + night themes, so its text and
   inputs must be pinned dark-on-white — otherwise night-mode tokens (near-white
   text, dark input fills) render invisible/low-contrast on the white pane. */
.login-form-pane .login-title { color: #241519; }
.login-form-pane .login-subtitle { color: #6E6164; }
.login-form-pane .field label { color: #4E4346; }
.login-form-pane .field label .required { color: #B3261E; }
.login-form-pane .login-remember { color: #5A4E52; }
.login-form-pane .login-switch { color: #6E6164; }
.login-form-pane .login-foot-credit { color: #9A8F92; }
.login-form-pane .field input,
.login-form-pane .password-wrap input {
  background: #FBF8F5;
  border: 1px solid #D9CEC4;
  color: #221A1C;
}
.login-form-pane .field input::placeholder { color: #9A8F92; opacity: 1; }
.login-form-pane .field input:focus,
.login-form-pane .password-wrap input:focus {
  background: #ffffff;
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(192, 145, 47, 0.18);
  outline: none;
}
.login-form-pane .password-toggle { color: #8A7F82; }
.login-form-pane .password-toggle:hover { color: #4E4346; }

/* ============ Login — rotating gradient background (v2.16.205) ============ */
.login-bg-fx { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.login-bg-layer {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity 2.4s ease; will-change: opacity;
}
/* When the rotator is mounted, the shell is transparent so it shows through, and
   the static photo/wash layers step aside. */
/* Pin the login backdrop to a fixed warm neutral in BOTH themes: the login page
   must look identical in light and night mode. The body canvas is normally
   theme-driven (cream in light, dark maroon in night), which would leave the 40%
   photo sitting over a dark canvas at night — muddy and inconsistent. Forcing the
   light canvas here keeps the rotating photo reading exactly like the screenshot
   regardless of the app theme. The class is only present on the login screen
   (removed by unmountLoginBg the moment the app shell opens), so the app itself
   is untouched. */
body.login-bg-dynamic { background: #F4EDE4 !important; }
body.login-bg-dynamic .login-shell { background-color: transparent; }
body.login-bg-dynamic .login-shell::after,
body.login-bg-dynamic .login-shell::before { display: none; }
@media (prefers-reduced-motion: reduce) { .login-bg-layer { transition: none; } }

/* Login rotating background — PHOTO mode (owner-supplied login-bg-N.jpg) */
/* Photos render at 40% opacity so they read as a subtle backdrop over the theme
   color (maroon/cream) rather than a full-strength image. Opacity lives on the
   CONTAINER, not the layers — the layers toggle their own opacity 0↔1 to
   crossfade, so dimming them directly would break the transition. */
.login-bg-fx.is-photo { opacity: 0.4; }
.login-bg-fx.is-photo .login-bg-layer {
  background-size: cover;
  background-position: center;
  filter: brightness(0.9) saturate(0.96);
}
.login-bg-fx.is-photo::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(12,7,9,.40) 0%, rgba(12,7,9,.12) 26%, rgba(12,7,9,.14) 74%, rgba(12,7,9,.52) 100%),
    linear-gradient(90deg, rgba(12,7,9,.26) 0%, rgba(12,7,9,0) 46%);
}

/* ============ Home page — quick links, announcements, events, team ============ */
/* Top row: the profile deck on the left, Announcements + Events in a side rail —
   so the deck no longer swallows the whole viewport and the first screen shows
   real content beside it. Collapses to one column on narrow screens. */
/* No local width cap — .view already caps the page at 1600px, so an extra 1180px
   cap here just left a few hundred pixels of dead space on wide screens. */
.home-top {
  /* Deck column is capped rather than proportional — a fr-based column kept
     growing with the screen and the 16:9 deck got tall with it. It now settles
     at a comfortable size and the rail absorbs the leftover width.
     The cards are direct children with explicit row placement (below) rather than
     two nested flex columns: nested columns only let the OUTER bottoms line up,
     leaving the seams between cards at different heights across the two sides. */
  display: grid;
  grid-template-columns: minmax(0, 720px) minmax(300px, 1fr);
  gap: 12px; align-items: stretch; margin-bottom: 14px;
}
.home-top > * { min-width: 0; margin: 0; }
/* Row 1-2: deck beside Announcements + Events. Row 3: Who's Online beside
   Getting Started — one shared row line, so every edge aligns. */
.home-cell--deck   { grid-column: 1; grid-row: 1 / span 2; }
.home-cell--ann    { grid-column: 2; grid-row: 1; }
.home-cell--ev     { grid-column: 2; grid-row: 2; }
.home-cell--online { grid-column: 1; grid-row: 3; }
.home-cell--help   { grid-column: 2; grid-row: 3; }

/* The deck shares rows 1-2 with the Announcements + Events rail. At narrower
   widths the 16:9 deck shrinks with its column while the rail keeps its content
   height, so the deck cell was left with up to 151px of dead space under the
   frame. Let the framed hero fill the cell instead: the slides are
   `object-fit: contain` (see .dsh-cp-slide img), so the extra height becomes
   letterbox against the frame's own near-black backdrop -- no slide is cropped,
   which is the constraint that rule was written to protect. */
.home-cell--deck { display: flex; }
.home-cell--deck > .dsh-cp-hero { flex: 1 1 auto; display: flex; flex-direction: column; }
.home-cell--deck .dsh-cp-stage { flex: 1 1 auto; min-height: 0; }
.home-ann-list { overflow-y: auto; max-height: 240px; }
.home-ev-list { overflow-y: auto; max-height: 216px; }
@media (max-width: 1020px) {
  /* Single column — drop the explicit placement so the cards stack in DOM order
     (deck, announcements, events, who's online, help). */
  .home-top { grid-template-columns: 1fr; }
  .home-cell--deck, .home-cell--ann, .home-cell--ev,
  .home-cell--online, .home-cell--help { grid-column: 1; grid-row: auto; }
}

/* Four cards across at full width, so the row fills evenly instead of leaving an
   orphan card on a second row. Cards stretch to equal height (grid default). */
.home-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.home-grid .dsh-panel { margin: 0; }

/* Cards in a grid row all stretch to the tallest one. Without this they keep
   their content jammed against the top and show a block of dead space below --
   measured at 188px of void in a 282px card -- which is what makes an otherwise
   perfectly aligned row read as ragged. Make each panel a column so the body
   region absorbs the extra height instead, and a trailing action (the Facebook
   link) settles on the bottom edge rather than floating mid-card. */
.home-grid > .dsh-panel,
.home-top > .dsh-panel { display: flex; flex-direction: column; }

/* The header keeps its natural height; whatever follows it takes the slack. */
.home-grid > .dsh-panel > .dsh-panel-hd + *,
.home-grid > .dsh-panel > .dsh-panel-lbl + *,
.home-top > .dsh-panel > .dsh-panel-hd + *,
.home-top > .dsh-panel > .dsh-panel-lbl + * { flex: 1 1 auto; min-height: 0; }

/* An empty state that has been handed room should sit in the middle of it. */
.home-grid > .dsh-panel .dsh-empty,
.home-top > .dsh-panel .dsh-empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
}

/* Shared composer shell for the Announcements + Events inputs. The fields sit
   flush inside one bordered card with an action footer, so the two forms read as
   deliberate compose boxes instead of loose browser-default inputs. */
.home-composer {
  margin-bottom: 12px; border: 1px solid var(--navy-500);
  border-radius: var(--radius-md); background: var(--navy-700); overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.home-composer:focus-within { border-color: var(--maroon-500); box-shadow: 0 0 0 3px var(--maroon-tint); }
.home-composer textarea,
.home-composer input {
  display: block; width: 100%; border: 0; background: transparent;
  padding: 10px 12px; font-size: 13.5px; color: var(--text-100);
}
.home-composer textarea { min-height: 56px; resize: vertical; line-height: 1.5; }
.home-composer textarea:focus, .home-composer input:focus { outline: none; }
.home-composer ::placeholder { color: var(--text-500); }
.home-composer-row { display: flex; align-items: stretch; }
/* Size the date field by flex-basis, not width: the generic `.home-composer input`
   rule above sets width:100% and border:0, and matching those properties here is
   a cascade fight. flex-basis decides the track in a flex row regardless, and the
   extra .home-composer prefix keeps the divider ahead of that border reset. */
.home-composer .home-composer-row input[type="date"] {
  flex: 0 0 152px; border-right: 1px solid var(--navy-600);
  color: var(--text-200); font-variant-numeric: tabular-nums;
}
.home-composer .home-composer-row input[type="text"] { flex: 1 1 auto; min-width: 0; }
.home-composer-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 8px 7px 12px; border-top: 1px solid var(--navy-600);
  background: var(--navy-800);
}
.home-composer-hint { font-size: 11px; color: var(--text-500); }
.home-composer-foot .btn { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 520px) {
  .home-composer-row { flex-direction: column; }
  .home-composer .home-composer-row input[type="date"] { flex: 0 0 auto; border-right: 0; border-bottom: 1px solid var(--navy-600); }
  .home-composer-hint { display: none; }
}
.home-ann { padding: 9px 0; border-top: 1px solid var(--navy-600); }
.home-ann:first-of-type { border-top: 0; }
.home-ann-txt { font-size: 13.5px; color: var(--text-100); white-space: pre-wrap; word-break: break-word; }
.home-ann-meta { font-size: 11.5px; color: var(--text-500); margin-top: 3px; }
.home-x {
  border: 0; background: none; color: var(--text-500); font-size: 15px; line-height: 1;
  cursor: pointer; padding: 0 4px; border-radius: 4px;
}
.home-x:hover { color: var(--danger); background: rgba(224, 82, 82, .12); }

/* Events */
.home-ev { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--navy-600); }
.home-ev:first-of-type { border-top: 0; }
.home-ev-badge {
  flex: none; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  background: var(--maroon-tint); color: var(--maroon-500); font-variant-numeric: tabular-nums;
}
.home-ev-badge--today { background: var(--gold-500); color: #241203; }
.home-ev-meta { min-width: 0; flex: 1; }
.home-ev-title { font-size: 13.5px; font-weight: 600; color: var(--text-100); }
.home-ev-date { font-size: 11.5px; color: var(--text-500); }

/* Employee of the month */
.home-eotm { display: flex; align-items: center; gap: 13px; padding: 6px 0 2px; }
.home-eotm-av {
  position: relative; width: 46px; height: 46px; border-radius: 50%; flex: none;
  background: var(--maroon-600); color: #fff; display: grid; place-items: center;
  font-size: 15px; font-weight: 700; border: 2px solid var(--gold-500);
}
.home-eotm-star {
  position: absolute; right: -5px; bottom: -5px; width: 19px; height: 19px; border-radius: 50%;
  background: var(--gold-500); color: #241203; font-size: 11px; display: grid; place-items: center;
}
.home-eotm-name { font-size: 15px; font-weight: 700; color: var(--text-100); }
.home-eotm-sub { font-size: 12px; color: var(--text-400); }

/* Team directory */
.home-team { max-height: 260px; overflow-y: auto; }
.home-team-row { display: flex; align-items: center; gap: 9px; padding: 6px 2px; border-top: 1px solid var(--navy-600); }
.home-team-row:first-child { border-top: 0; }
.home-team-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--navy-500); flex: none; }
.home-team-dot.is-on { background: var(--success); box-shadow: 0 0 5px var(--success); }
.home-team-name { font-size: 13px; font-weight: 600; color: var(--text-100); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-team-role { font-size: 11.5px; color: var(--text-500); flex: none; }

/* Getting started + company info */
.home-steps { margin: 4px 0 12px; padding-left: 20px; font-size: 13px; color: var(--text-300); }
.home-steps li { margin-bottom: 6px; }
.home-help-btns { display: flex; gap: 8px; flex-wrap: wrap; }
/* Label above value, both left-aligned. The old right-aligned value column pushed
   long entries (company name, address) hard against the card edge. */
.home-info-row {
  display: flex; flex-direction: column; gap: 2px; padding: 7px 0;
  border-top: 1px solid var(--navy-600);
}
.home-info-row:first-of-type { border-top: 0; padding-top: 2px; }
.home-info-row span {
  font-size: 10.5px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-500);
}
.home-info-row b { font-size: 13px; color: var(--text-100); overflow-wrap: anywhere; }

/* Facebook page link — brand blue so it reads as the official social button. */
.home-fb {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 12px;
  padding: 9px 15px; border-radius: var(--radius-md);
  background: #1877F2; color: #fff; font-size: 13px; font-weight: 600;
  text-decoration: none; transition: background .15s ease, transform .15s ease;
}
.home-fb:hover { background: #0F5FCC; transform: translateY(-1px); }
.home-fb:focus-visible { outline: 2px solid #1877F2; outline-offset: 2px; }

/* ===== Night mode: restore the page → card elevation gap ==================
   The page was painted with --navy-800 (#251519) while cards sit on --navy-700
   (#321E25) — barely one step apart, so every panel dissolved into the
   background. --navy-900 is the token actually labelled "page background", so
   use it: page #191013 → topbar #251519 → card #321E25 now reads as three clear
   levels. Scoped to night only; the cream light theme is untouched. */
body:not(.theme-light) { background: var(--navy-900); }
/* Give the panels a touch of depth so their edges are unmistakable. */
body:not(.theme-light) .card,
body:not(.theme-light) .kpi,
body:not(.theme-light) .sm-stat,
body:not(.theme-light) .sm-bar,
body:not(.theme-light) .home-composer { box-shadow: 0 1px 3px rgba(0, 0, 0, .32); }

/* Home — quote of the day. One line, changes daily (day-of-year), mostly the
   company's own Code of Honor / Creed so it lands with the team. */
.home-quote {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 18px; margin-bottom: 14px;
  background: var(--navy-700); border: 1px solid var(--navy-600);
  border-left: 3px solid var(--gold-500); border-radius: var(--radius-md);
}
.home-quote-mark {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 34px; line-height: .8; color: var(--gold-500); opacity: .75; flex: none;
}
/* Only the words fade when the line changes — the frame and the quote mark hold
   still, so the strip doesn't blink. Duration must match QUOTE_FADE in home.js. */
.home-quote-body { transition: opacity .3s ease; }
.home-quote.is-out .home-quote-body { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .home-quote-body { transition: none; } }
.home-quote-text {
  margin: 0; font-size: 14.5px; font-style: italic; line-height: 1.5;
  color: var(--text-100);
}
.home-quote-by {
  margin: 3px 0 0; font-size: 11px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--gold-500);
}
@media (max-width: 560px) {
  .home-quote { padding: 11px 14px; }
  .home-quote-text { font-size: 13.5px; }
}

/* ============ Login — reliability extras (v2.16.252) ============ */
/* Caps Lock warning under the password field */
.login-caps {
  margin-top: 6px; font-size: 12px; font-weight: 600; color: #8a6d1a;
  background: rgba(212, 175, 55, .14); border: 1px solid rgba(212, 175, 55, .38);
  border-radius: 7px; padding: 5px 10px;
}
/* Offline reassurance pill */
.login-offline {
  margin: 0 0 12px; font-size: 12.5px; font-weight: 600; color: #6E5A1E;
  background: rgba(212, 175, 55, .13); border: 1px solid rgba(212, 175, 55, .34);
  border-radius: 8px; padding: 8px 12px;
}
/* Lockout errors read as a state, not a mistake */
.login-error--lock {
  background: rgba(212, 175, 55, .13) !important;
  border-color: rgba(154, 123, 30, .5) !important;
  color: #7a611c !important;
}


/* ============================================================
   Touch / phone corrections
   Appended last on purpose: these override component rules that
   were written for a mouse, and only where a phone is involved.
   ============================================================ */

/* iOS Safari ZOOMS the whole page when you focus a field whose font is under
   16px, and it does not zoom back out on blur -- so one tap on a search box
   leaves the rest of the screen wider than the phone. The base rule sets every
   input to 14px and .table-search input to 12.5px, so every field in the app
   trips it. 16px is the documented threshold, not a preference.
   Checkboxes and radios are excluded: they have no text and no zoom behaviour,
   and sizing them here would change their box. */
@media (max-width: 640px) {
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea,
  .table-search input {
    font-size: 16px;
  }
}

/* The bottom nav adds the iPhone home-indicator inset to its own padding, so on
   a notched phone it is taller than the flat 64px the content reserved for it,
   and the last row of every list sat underneath. Reserve the same inset. */
@media (max-width: 600px) {
  .main { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }

  /* The bar and the drawer share z-index 50, and the bar comes later in the DOM
     -- so it paints ON TOP of the open drawer and swallows whatever nav item
     lands last. Reserve the bar's height at the end of the drawer's scroller. */
  .sidebar.open .nav { padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }
}

/* A finger is about 44px. These are the controls a phone user actually has to
   hit -- on a list row the kebab is the ONLY control -- and they were drawn at
   18-32px for a mouse pointer. Scoped to coarse pointers so nothing changes for
   a mouse, and expressed as a minimum so the visual size is free to stay small
   (padding grows the hit area, not the icon). */
@media (pointer: coarse) {
  /* Standalone controls can simply grow -- nothing is laid out against them. */
  .modal-close,
  .side-panel-close,
  .btn-sm,
  .icon-btn {
    min-width: 44px;
    min-height: 44px;
  }

  /* A row kebab cannot grow: it sits in a table cell, so a 44px button plus the
     cell's 10px padding makes the row 64px and breaks the uniform row height
     these lists are tuned for. Expand the HIT AREA instead -- the button keeps
     its size and its place, while the touchable region reaches 44px around it. */
  .row-actions button,
  .row-actions-trigger { position: relative; }
  .row-actions button::after,
  .row-actions-trigger::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 44px;
    height: 44px;
    transform: translate(-50%, -50%);
  }

  /* "Keep me signed in" is the one control on the login screen that decides
     whether a phone user has to sign in again every time they put the handset
     down. The label wraps the checkbox so the whole row is tappable -- but a
     12.5px line is only about 18px tall, which is a hard target to hit. */
  .login-remember { min-height: 44px; }
}

/* ============================================================
   Public install helper (#/install)
   Renders outside the app shell and outside the login screen, so it
   cannot lean on either. Everything here is self-contained.
   ============================================================ */
.install-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom, 0px));
  background: var(--navy-800);
}
.install-card {
  width: 100%;
  max-width: 460px;
  background: var(--navy-700);
  border: 1px solid var(--navy-500);
  border-radius: var(--radius-lg);
  padding: 28px 24px 22px;
  text-align: center;
}
.install-logo { margin: 0 auto 14px; border-radius: 16px; }
.install-title { font-size: 21px; font-weight: 800; margin: 0; letter-spacing: -.01em; }
.install-sub {
  margin: 2px 0 22px; font-size: 12px; font-weight: 600; letter-spacing: .07em;
  text-transform: uppercase; color: var(--gold-500);
}
.install-step-block { text-align: left; }
.install-step-block h2 { font-size: 17px; margin: 0 0 6px; text-wrap: balance; }
.install-lead { margin: 0 0 16px; font-size: 14px; color: var(--text-300); }

/* The one branch that decides whether any of this works: a link opened from
   inside Messenger or Viber cannot install anywhere. Mark it as a blocker. */
.install-step-block--in-app {
  border-left: 3px solid var(--warning);
  padding-left: 14px;
  margin-left: -2px;
}

.install-steps { margin: 0 0 16px; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; }
.install-steps li { font-size: 14.5px; line-height: 1.5; }
.install-go { margin-bottom: 14px; }
.install-note { margin: 0; font-size: 12.5px; color: var(--text-500); line-height: 1.5; }

.install-done { text-align: left; }
.install-done h2 { font-size: 17px; margin: 0 0 6px; }
.install-done p { margin: 0 0 16px; font-size: 14px; color: var(--text-300); }

.install-link { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--navy-500); text-align: left; }
.install-link label {
  display: block; margin-bottom: 6px; font-size: 11px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--text-500);
}
.install-link-row { display: flex; gap: 8px; }
.install-link-row input {
  flex: 1; min-width: 0; padding: 9px 11px; border-radius: 7px;
  border: 1px solid var(--navy-500); background: var(--navy-800); color: var(--text-200);
}
.install-link-row .btn { flex: none; }

.install-detected { margin: 18px 0 0; font-size: 12px; color: var(--text-500); line-height: 1.55; }
.install-all-link {
  background: none; border: 0; padding: 0; font: inherit; color: var(--gold-500);
  text-decoration: underline; cursor: pointer;
}
.install-all { margin-top: 16px; text-align: left; display: flex; flex-direction: column; gap: 16px; }
.install-all-block h3 {
  font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--gold-500); margin: 0 0 8px;
}
.install-all-block ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 7px; }
.install-all-block li { font-size: 13.5px; line-height: 1.5; color: var(--text-300); }

body.theme-light .install-page { background: var(--navy-900); }

/* ============================================================
   UI refresh — v2.16.315
   One section on purpose: every rule below is new or a deliberate override,
   so the whole refresh can be reviewed (or rolled back) in one place.
   ============================================================ */

/* ---------- Design tokens: one scale for type, radius and spacing ----------
   The stylesheet grew 32 font sizes and 15 corner radii. New work uses these;
   older rules move over as they are touched. */
:root {
  --fs-xs: 11px;  --fs-sm: 12px;  --fs-base: 13px;  --fs-md: 14px;
  --fs-lg: 16px;  --fs-xl: 20px;  --fs-2xl: 24px;
  --r-sm: 6px;    --r-md: 10px;   --r-lg: 14px;     --r-pill: 999px;
  --sp-1: 4px;    --sp-2: 8px;    --sp-3: 12px;     --sp-4: 16px;  --sp-5: 20px;  --sp-6: 24px;
}
/* Semantic names over the historical palette. The "navy-*" tokens are really
   the wine/maroon surfaces (the theme used to be navy + gold). Declared on
   body — not :root — so they resolve against body.theme-light's overrides. */
body {
  --bg: var(--navy-900);
  --surface: var(--navy-800);
  --surface-raised: var(--navy-700);
  --line: var(--navy-600);
  --border: var(--navy-500);
  --brand: var(--maroon-600);
  --brand-strong: var(--maroon-700);
  --accent: var(--gold-500);
  --text: var(--text-100);
  --text-muted: var(--text-400);
}

/* Grid children may shrink below their content width (CSS grid defaults to
   min-width:auto, which let a card list push the Reports page 1px wide). */
.grid > * { min-width: 0; }

/* ---------- Table cells: value wrapper is invisible on desktop ---------- */
table.data td > .cell-v { display: contents; }
table.data td.nowrap { white-space: nowrap; }
table.data td .row-sub { font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; }

/* ---------- Readable text ----------
   Status pills, channel tags and KPI labels sat at 10.5–11px, hard to read on
   a phone or under warehouse lighting. */
.badge { font-size: var(--fs-sm); padding: 3px 10px; }
.channel-pill { font-size: var(--fs-sm); padding: 2px 9px; }
body.theme-light .channel-lazada { background: rgba(63, 81, 199, 0.10); color: #3F51C7; }
body.theme-light .channel-tiktok { background: rgba(0, 0, 0, 0.06); color: #1F1F1F; }
.kpi-label { font-size: var(--fs-xs); }

/* ---------- Stage filters: one scrollable row, never two lines ---------- */
.stage-filters {
  flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
  scroll-snap-type: x proximity; padding-bottom: 2px;
}
.stage-filters::-webkit-scrollbar { display: none; }
.stage-filter { scroll-snap-align: start; }

/* ---------- Top bar page title (phones only) ---------- */
.topbar-title { display: none; }

/* ---------- Clickable dashboard tiles + quiet zeros ---------- */
.dsh-tile--link { cursor: pointer; text-align: left; font: inherit; color: inherit; width: 100%; transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition); }
.dsh-tile--link:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); border-color: var(--accent); }
.dsh-tile--link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dsh-tile.is-zero .dsh-tile-n { color: var(--text-muted); }
.dsh-pipe-stage[data-nav] { cursor: pointer; border-radius: var(--r-sm); transition: background var(--transition); }
.dsh-pipe-stage[data-nav]:hover { background: var(--line); }
.dsh-pipe-stage.is-zero .dsh-pipe-n { color: var(--text-muted); }
.dsh-trend { font-size: var(--fs-xs); font-weight: 600; margin-left: var(--sp-2); }
.dsh-trend.up { color: var(--success); }
.dsh-trend.down { color: var(--danger); }

/* ---------- Home: "For you today" ---------- */
.home-todo { margin: 0 0 var(--sp-4); padding: var(--sp-4) var(--sp-5); }
.home-todo-hd { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.home-todo-hd h3 { margin: 0; font-size: var(--fs-lg); font-weight: 700; color: var(--text); }
.home-todo-hd span { font-size: var(--fs-sm); color: var(--text-muted); }
.home-todo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--sp-2); }
.home-todo-item {
  display: flex; align-items: center; gap: var(--sp-3); width: 100%; text-align: left;
  padding: var(--sp-3); border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); color: var(--text); font: inherit; cursor: pointer;
  transition: border-color var(--transition), transform var(--transition);
}
.home-todo-item:hover { border-color: var(--accent); transform: translateY(-1px); }
.home-todo-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.home-todo-n {
  flex: 0 0 auto; min-width: 36px; height: 36px; padding: 0 8px; border-radius: var(--r-sm);
  display: grid; place-items: center; font-size: var(--fs-lg); font-weight: 800;
  background: var(--maroon-tint); color: var(--brand); font-variant-numeric: tabular-nums;
}
.home-todo-item.is-urgent .home-todo-n { background: var(--danger-bg); color: var(--danger); }
/* Night mode: maroon on wine was unreadable — use the gold accent instead. */
body:not(.theme-light) .home-todo-n { background: rgba(214, 172, 78, 0.14); color: var(--gold-300); }
body:not(.theme-light) .home-todo-item.is-urgent .home-todo-n { background: var(--danger-bg); color: #FCA5A5; }
.home-todo-txt { min-width: 0; }
.home-todo-txt b { display: block; font-size: var(--fs-md); font-weight: 600; }
.home-todo-txt small { display: block; font-size: var(--fs-sm); color: var(--text-muted); }
.home-todo-done { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-md); color: var(--success); font-weight: 600; }

/* ============================================================
   Phones (≤ 640px)
   ============================================================ */
@media (max-width: 640px) {
  /* ---------- Tables become cards ----------
     Wide tables (Sales was 817px in a 341px column) hid Total, Status, Payment
     and the actions off-screen. Each row is now a card: the first column is
     the title, every other cell is "LABEL ........ value", actions last. */
  .table-scroll { overflow-x: visible; }
  /* min-width:0 overrides the older v2.16.189 rule that forced 600px so the
     table would scroll sideways — exactly what cards replace. */
  .table-scroll table.data.data-cards,
  table.data.data-cards,
  table.data.data-cards tbody { display: block; width: 100%; min-width: 0; }
  table.data.data-cards thead { display: none; }
  table.data.data-cards tbody tr {
    display: grid; grid-template-columns: 1fr; position: relative;
    margin: 0 0 var(--sp-3); padding: var(--sp-3) var(--sp-4);
    background: var(--surface-raised); border: 1px solid var(--border);
    border-radius: var(--r-md); box-shadow: var(--shadow-sm);
  }
  table.data.data-cards tbody tr.row-selected { border-color: var(--accent); }
  table.data.data-cards tbody td {
    display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
    min-width: 0; padding: 7px 0; border-bottom: 1px dashed var(--line);
    text-align: right; white-space: normal; overflow: visible; font-size: var(--fs-md);
  }
  table.data.data-cards tbody td::before {
    content: attr(data-label); flex: 0 0 auto; max-width: 45%; text-align: left;
    font-size: var(--fs-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
    color: var(--text-muted);
  }
  table.data.data-cards tbody td:not([data-label])::before { content: none; }
  table.data.data-cards tbody td > .cell-v { display: block; min-width: 0; overflow-wrap: anywhere; }
  table.data.data-cards tbody td .row-sub { text-align: right; }

  /* Title row */
  table.data.data-cards tbody td.cell-primary {
    order: -1; display: block; text-align: left; font-size: var(--fs-lg); font-weight: 700;
    padding: 0 0 var(--sp-2); border-bottom: 1px solid var(--line);
  }
  table.data.data-cards.has-bulk tbody td.cell-primary { padding-right: 34px; }
  /* The title speaks for itself (SO-0005, a product name); its column label
     only crowded rich title cells such as the request rows. */
  table.data.data-cards tbody td.cell-primary::before { content: none; }
  table.data.data-cards tbody td.cell-primary .row-sub { text-align: left; }

  /* Selection checkbox: top-right corner of the card */
  table.data.data-cards tbody td.cell-check {
    position: absolute; top: var(--sp-3); right: var(--sp-3);
    display: block; padding: 0; border: 0;
  }
  table.data.data-cards tbody td.cell-check input { width: 20px; height: 20px; }

  /* Actions: footer of the card */
  table.data.data-cards tbody td.cell-actions {
    order: 99; justify-content: flex-end; border-bottom: 0; padding: var(--sp-2) 0 0;
  }
  table.data.data-cards tbody td.cell-actions .row-actions-trigger,
  table.data.data-cards tbody td.cell-actions .row-actions button { min-width: 40px; min-height: 40px; }
  table.data.data-cards tbody td:nth-last-child(2):not(.cell-actions),
  table.data.data-cards tbody td:last-child { border-bottom: 0; }
  table.data.data-cards tbody td:empty { display: none; }
  table.data.data-cards tbody tr:hover { background: var(--surface-raised); }
  .table-wrap { background: transparent; border: 0; box-shadow: none; }
  .table-wrap .table-toolbar { padding: 0 0 var(--sp-3); border-bottom: 0; }

  /* ---------- Compact KPI cards: 2 × 2 instead of a full-screen stack ---------- */
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
  .kpi { padding: var(--sp-3); }
  .kpi-value { font-size: var(--fs-xl); }
  .kpi-meta { font-size: var(--fs-xs); }

  /* ---------- Top bar: fewer icons, show where you are ----------
     Cloud status and the theme switch move into the account menu. */
  .topbar #syncBtn,
  .topbar #themeSwitch { display: none; }
  .topbar-title {
    display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: var(--fs-lg); font-weight: 700; color: var(--text);
  }
  .topbar-left { gap: var(--sp-2); min-width: 0; flex: 1 1 auto; }
  .page-header-text p { font-size: var(--fs-sm); }

  /* ---------- Forms: thumb-sized footer buttons ---------- */
  .modal-footer > .btn { flex: 1 1 0; }

  /* ---------- Home to-do: one column ---------- */
  .home-todo { padding: var(--sp-3) var(--sp-4); }
  .home-todo-list { grid-template-columns: 1fr; }
}

/* ============================================================
   Dashboard redesign — v2.16.316
   ============================================================ */
/* Hero tiles: a coloured top edge per tile, roomier number. Counts stay counts
   (the owner asked for invoice COUNTS, not peso totals, on the money tile). */
.dsh-kpis { gap: var(--sp-3); margin-bottom: var(--sp-4); }
.dsh-tile { position: relative; overflow: hidden; padding: var(--sp-4) var(--sp-4) var(--sp-3); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.dsh-tile::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--tile-tone, var(--accent)); }
.dsh-kpis > .dsh-tile:nth-child(1) { --tile-tone: var(--maroon-600); }
.dsh-kpis > .dsh-tile:nth-child(2) { --tile-tone: var(--success); }
.dsh-kpis > .dsh-tile:nth-child(3) { --tile-tone: var(--gold-500); }
.dsh-kpis > .dsh-tile:nth-child(4) { --tile-tone: var(--danger); }
.dsh-tile-n { font-size: 30px; }
.dsh-tile-lbl { font-size: var(--fs-base); font-weight: 600; color: var(--text-300); }
.dsh-tile-sub { font-size: var(--fs-sm); }
.dsh-tile.is-zero::before { opacity: .35; }

/* Pipeline: connected steps; each bar shows the stage's share of the busiest. */
.dsh-pipe { padding: var(--sp-4) var(--sp-5); margin-bottom: var(--sp-4); border-radius: var(--r-lg); }
.dsh-pipe-row { gap: 0; margin-top: var(--sp-3); }
.dsh-pipe-stage { padding: var(--sp-2) var(--sp-2) var(--sp-3); }
.dsh-pipe-step { position: relative; height: 14px; margin-bottom: var(--sp-2); }
.dsh-pipe-step::before {          /* connector to the next stage */
  content: ''; position: absolute; top: 6px; left: 50%; width: 100%; height: 2px;
  background: var(--line);
}
.dsh-pipe-stage:last-child .dsh-pipe-step::before { display: none; }
.dsh-pipe-dot {
  position: relative; z-index: 1; display: block; width: 14px; height: 14px; margin: 0 auto;
  border-radius: 50%; background: var(--surface-raised); border: 3px solid var(--stage);
}
.dsh-pipe-stage.is-zero .dsh-pipe-dot { border-color: var(--border); }
.dsh-pipe-n { font-size: 24px; }
.dsh-pipe-lbl { font-size: var(--fs-sm); font-weight: 600; margin-top: 4px; }
.dsh-pipe-track { height: 6px; margin: var(--sp-2) var(--sp-2) 0; border-radius: var(--r-pill); background: var(--line); overflow: hidden; }
.dsh-pipe-fill { height: 100%; border-radius: inherit; background: var(--stage); transition: width .4s ease; }

/* Panels */
.dsh-panel { padding: var(--sp-4) var(--sp-5); border-radius: var(--r-lg); }
.dsh-panel-hd { align-items: center; margin-bottom: var(--sp-2); }
.dsh-panel-meta { font-size: var(--fs-xs); color: var(--text-muted); }
.dsh-link { background: none; border: 0; padding: 0; font: inherit; font-size: var(--fs-sm); font-weight: 600; color: var(--accent); cursor: pointer; }
.dsh-link:hover { text-decoration: underline; }

/* Revenue */
.dsh-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-md); background: var(--line); }
.dsh-seg-btn { padding: 4px 10px; border: 0; border-radius: 7px; background: transparent; font: inherit; font-size: var(--fs-sm); font-weight: 700; color: var(--text-muted); cursor: pointer; }
.dsh-seg-btn:hover { color: var(--text); }
.dsh-seg-btn.is-active { background: var(--surface-raised); color: var(--text); box-shadow: var(--shadow-sm); }
.dsh-rev-total { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--sp-2); font-size: var(--fs-2xl); font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.dsh-rev-total .dsh-trend { margin-left: 0; }
.dsh-rev-split { margin-top: 2px; font-size: var(--fs-sm); color: var(--text-muted); }
.dsh-rev-legend { display: flex; gap: var(--sp-4); margin-top: var(--sp-3); font-size: var(--fs-sm); color: var(--text-muted); }
.dsh-rev-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.dsh-panel .chart-wrap.dsh-rev-chart { height: 230px; margin-top: var(--sp-2); }

/* Watch panels: partners · low stock · recent orders */
.dsh-watch { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-4); }
.dsh-lower { gap: var(--sp-3); margin-bottom: var(--sp-3); grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.dsh-bar-row { padding: 7px 0; }
.dsh-bar-row + .dsh-bar-row { border-top: 1px solid var(--line); }
.dsh-bar-row-hd { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-3); font-size: var(--fs-base); }
.dsh-bar-row-hd span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-200); }
.dsh-bar-row-hd b { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--text); }
.dsh-bar-row-hd small { font-weight: 500; color: var(--text-muted); }
.dsh-bar { height: 6px; margin-top: 6px; border-radius: var(--r-pill); background: var(--line); overflow: hidden; }
.dsh-bar > div { height: 100%; border-radius: inherit; background: var(--maroon-600); }
.dsh-bar-row--warn .dsh-bar > div { background: var(--warning); }
.dsh-order {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: 8px var(--sp-2); margin: 0 calc(var(--sp-2) * -1); border-radius: var(--r-sm); cursor: pointer;
}
.dsh-order + .dsh-order { border-top: 1px solid var(--line); }
.dsh-order:hover { background: var(--line); }
.dsh-order:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.dsh-order-main { min-width: 0; display: flex; flex-direction: column; }
.dsh-order-main b { font-size: var(--fs-base); color: var(--text); }
.dsh-order-main span { font-size: var(--fs-sm); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dsh-order-side { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.dsh-order-side small { font-size: var(--fs-xs); color: var(--text-muted); }

/* Revenue series colours (chart + legend share them). */
body { --rev-direct: var(--maroon-600); --rev-partner: var(--gold-400); }
body:not(.theme-light) { --rev-direct: #B5434F; }   /* maroon-600 sinks into the night surfaces */

/* Night mode: gold bars read better than maroon on the wine surfaces. */
body:not(.theme-light) .dsh-bar > div { background: var(--gold-400); }

@media (max-width: 1100px) {
  .dsh-watch { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .dsh-lower, .dsh-watch { grid-template-columns: minmax(0, 1fr); }  /* plain 1fr let the revenue card outgrow the column */
  .dsh-panel .chart-wrap.dsh-rev-chart { height: 200px; }
}
@media (max-width: 640px) {
  .dsh-tile-n { font-size: 26px; }
  .dsh-pipe { padding: var(--sp-3); }
  .dsh-pipe-stage { padding: var(--sp-1) 2px var(--sp-2); }
  .dsh-pipe-n { font-size: 20px; }
  .dsh-pipe-lbl { font-size: var(--fs-xs); }
  .dsh-pipe-track { margin: var(--sp-2) 4px 0; }
  .dsh-panel { padding: var(--sp-3) var(--sp-4); }
  .dsh-rev-total { font-size: var(--fs-xl); }
}

/* ============================================================
   Dashboard — calm layout v2.16.317
   4 cards instead of 9, one accent colour, no icons, more air.
   (Prefixed with .dash-view: `.dash-view .card { padding: 14px }` would
   otherwise win on specificity.)
   ============================================================ */
.dash-view .page-header { margin-bottom: var(--sp-5); }

/* Stats strip: four numbers in one card, thin dividers */
.dash-view .dsh-stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0; margin-bottom: var(--sp-4); border-radius: var(--r-lg); overflow: hidden;
}
.dsh-stat {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: var(--sp-5) var(--sp-5) var(--sp-4); background: transparent;
  border: 0; border-left: 1px solid var(--line); font: inherit; color: inherit;
  text-align: left; cursor: pointer; transition: background var(--transition);
}
.dsh-stat:first-child { border-left: 0; }
.dsh-stat:hover { background: var(--surface); }
.dsh-stat:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.dsh-stat-n { font-size: 32px; font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.dsh-stat-n.is-zero { color: var(--text-muted); }
.dsh-stat-of { margin-left: 2px; font-size: 18px; font-weight: 600; color: var(--text-muted); }
.dsh-stat-lbl { margin-top: var(--sp-1); font-size: var(--fs-md); font-weight: 600; color: var(--text-300); }
.dsh-stat-sub { font-size: var(--fs-sm); color: var(--text-muted); }
.dsh-stat-sub.is-warn { color: var(--gold-600); font-weight: 600; }
.dsh-stat-sub.is-bad { color: var(--danger); font-weight: 600; }

/* Revenue + pipeline */
.dsh-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--sp-4); margin-bottom: var(--sp-4); }
.dash-view .dsh-card { padding: var(--sp-5); border-radius: var(--r-lg); }
.dsh-card-hd { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.dsh-card-hd h3 { margin: 0; font-size: var(--fs-md); font-weight: 700; color: var(--text); }
.dsh-card-meta { font-size: var(--fs-sm); color: var(--text-muted); }
.dsh-rev-split { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); margin-top: var(--sp-1); font-size: var(--fs-sm); color: var(--text-muted); }
.dsh-rev-split i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.dash-view .dsh-card .chart-wrap.dsh-rev-chart { height: 240px; margin-top: var(--sp-4); }

.dsh-flow-row {
  display: grid; grid-template-columns: 84px minmax(0, 1fr) 36px; align-items: center; gap: var(--sp-3);
  padding: 11px var(--sp-2); margin: 0 calc(var(--sp-2) * -1); border-radius: var(--r-sm); cursor: pointer;
}
.dsh-flow-row + .dsh-flow-row { border-top: 1px solid var(--line); }
.dsh-flow-row:hover { background: var(--surface); }
.dsh-flow-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.dsh-flow-lbl { font-size: var(--fs-base); color: var(--text-200); }
.dsh-flow-n { text-align: right; font-size: var(--fs-md); color: var(--text); font-variant-numeric: tabular-nums; }
.dsh-flow-row.is-zero .dsh-flow-lbl,
.dsh-flow-row.is-zero .dsh-flow-n { color: var(--text-muted); }

/* One meter style everywhere, one colour */
.dsh-meter { display: block; height: 6px; border-radius: var(--r-pill); background: var(--line); overflow: hidden; }
.dsh-meter > i { display: block; height: 100%; border-radius: inherit; background: var(--rev-direct); }

/* Tabbed lists */
.dash-view .dsh-lists { padding: 0; }
.dsh-tabs { display: flex; gap: var(--sp-1); padding: var(--sp-2) var(--sp-3) 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.dsh-tabs::-webkit-scrollbar { display: none; }
.dsh-tab { position: relative; padding: var(--sp-3); background: none; border: 0; font: inherit; font-size: var(--fs-base); font-weight: 600; color: var(--text-muted); cursor: pointer; white-space: nowrap; }
.dsh-tab:hover { color: var(--text); }
.dsh-tab.is-active { color: var(--text); }
.dsh-tab.is-active::after { content: ''; position: absolute; left: var(--sp-3); right: var(--sp-3); bottom: -1px; height: 2px; border-radius: 2px; background: var(--brand); }
.dsh-tab-n { margin-left: 6px; padding: 1px 7px; border-radius: var(--r-pill); background: var(--line); font-size: var(--fs-xs); color: var(--text-300); }
.dsh-tabpanel { padding: var(--sp-1) var(--sp-5) var(--sp-3); }
.dsh-li { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding: 12px var(--sp-2); margin: 0 calc(var(--sp-2) * -1); border-radius: var(--r-sm); }
.dsh-li + .dsh-li { border-top: 1px solid var(--line); }
.dsh-li[data-nav] { cursor: pointer; }
.dsh-li[data-nav]:hover { background: var(--surface); }
.dsh-li[data-nav]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.dsh-li-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dsh-li-main b { font-size: var(--fs-base); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dsh-li-main small { font-size: var(--fs-sm); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dsh-li-main .dsh-meter { max-width: 280px; margin-top: 5px; }
.dsh-li-side { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; }
.dsh-li-side b { font-size: var(--fs-md); color: var(--text); font-variant-numeric: tabular-nums; }
.dsh-li-side small { font-size: var(--fs-xs); color: var(--text-muted); }
.dsh-li-side b.text-danger { color: var(--danger); }   /* low-stock quantity */
.dsh-li-empty { padding: var(--sp-6) 0; text-align: center; font-size: var(--fs-base); color: var(--text-muted); }
.dsh-li-more { padding-top: var(--sp-2); font-size: var(--fs-sm); color: var(--text-muted); }

/* Night mode */
body:not(.theme-light) .dsh-stat-sub.is-warn { color: var(--gold-300); }
body:not(.theme-light) .dsh-meter > i { background: var(--gold-400); }

@media (max-width: 1000px) {
  .dsh-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .dash-view .dsh-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dsh-stat { padding: var(--sp-4); }
  .dsh-stat:nth-child(3) { border-left: 0; }
  .dsh-stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .dsh-stat-n { font-size: 26px; }
  .dash-view .dsh-card { padding: var(--sp-4); }
  .dsh-tabpanel { padding: var(--sp-1) var(--sp-4) var(--sp-3); }
  .dash-view .dsh-card .chart-wrap.dsh-rev-chart { height: 200px; }
}

/* ============================================================
   Home — calm layout v2.16.318
   6 cards instead of 10; same features. Quote in the header, composers open
   on demand, one Team card, deck in the side column.
   ============================================================ */
.home-hd .dash-clock { margin-top: 2px; }
.home-hd-quote {
  margin: var(--sp-2) 0 0; max-width: 760px;
  font-size: var(--fs-base); font-style: italic; color: var(--text-muted);
  transition: opacity .3s ease;              /* the rotator fades via .is-out */
}
.home-hd-quote.is-out { opacity: 0; }
.home-hd-quote-by { margin-left: 4px; font-style: normal; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gold-600); }
.home-hd-quote-by::before { content: '— '; }

/* For you today: lighter items, same content */
.home-todo { border-radius: var(--r-lg); }
.home-todo-item { background: transparent; border-color: var(--line); }
.home-todo-item:hover { background: var(--surface); }

.home-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--sp-4); align-items: start; }
.home-col { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }
.home-card { margin: 0; padding: var(--sp-5); border-radius: var(--r-lg); }
.home-card-hd { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.home-card-hd h3 { display: flex; align-items: center; gap: var(--sp-2); margin: 0; font-size: var(--fs-md); font-weight: 700; color: var(--text); }
.home-card-hd .btn { display: inline-flex; align-items: center; gap: 4px; }
.home-count { padding: 1px 7px; border-radius: var(--r-pill); background: var(--line); font-size: var(--fs-xs); font-weight: 600; color: var(--text-300); }
.home-card-meta { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-muted); }
.home-card .home-composer { margin-bottom: var(--sp-3); }
.home-card .home-ann-list { max-height: none; }
.home-empty { padding: var(--sp-5) 0; text-align: center; font-size: var(--fs-base); color: var(--text-muted); }
.home-card .home-ann { padding: 12px 0; }
.home-card .home-ann-txt { font-size: var(--fs-md); line-height: 1.5; }
.home-deck .dsh-cp-hero { margin: 0; }

.home-eotm-line {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3); margin-bottom: var(--sp-2); border-radius: var(--r-md); background: var(--surface);
}
.home-eotm-line b { display: block; font-size: var(--fs-base); color: var(--text); }
.home-eotm-line small { display: block; font-size: var(--fs-sm); color: var(--text-muted); }
.home-team-more { padding-top: var(--sp-2); font-size: var(--fs-sm); color: var(--text-muted); }

.home-links { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--line); }
.home-link {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border: 1px solid var(--border); border-radius: var(--r-pill); background: transparent;
  font: inherit; font-size: var(--fs-sm); font-weight: 600; color: var(--text-200); text-decoration: none; cursor: pointer;
}
.home-link:hover { border-color: var(--accent); color: var(--text); }
/* Night mode: the event day badges were maroon on wine. */
body:not(.theme-light) .home-ev-badge { background: rgba(214, 172, 78, 0.14); color: var(--gold-300); }

@media (max-width: 1000px) {
  .home-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .home-card { padding: var(--sp-4); }
  .home-hd-quote { font-size: var(--fs-sm); }
}

/* ============================================================
   Sidebar — calm layout v2.16.319
   Same links, same order, same groups. Only the look is quieter:
   - icons take the text colour instead of all-gold;
   - the selected page is a soft row (gold icon on the maroon rail,
     maroon on the cream rail) instead of a glowing gold pill;
   - smaller, muted section labels with faint chevrons;
   - slightly tighter rows and even spacing, no extra divider lines.
   Both rails are covered: maroon (body.theme-light) and cream (night).
   Layout rules skip body.sidebar-collapsed so the 60px icon rail keeps
   its own centred padding.
   ============================================================ */

/* ---- Shared layout ---- */
.sidebar .brand { padding: 18px 18px 16px; gap: 11px; }
.sidebar .brand::after { left: 18px; right: 18px; }
.sidebar .brand-mark { width: 36px; height: 36px; border-radius: 9px; padding: 4px; box-shadow: none; }
.sidebar .brand-name { font-size: 14px; font-weight: 600; letter-spacing: -0.005em; }
.sidebar .brand-sub { font-size: 10px; letter-spacing: 0.12em; margin-top: 2px; }

.sidebar .nav { padding: 14px 12px 16px; }
.sidebar .nav-section { margin-bottom: 18px; }
.sidebar .nav-section.is-collapsed { margin-bottom: 8px; }
.sidebar .nav-section--solo { margin-bottom: 18px; padding-bottom: 0; border-bottom: 0; }

body.theme-light .sidebar .nav-label,
body:not(.theme-light) .sidebar .nav-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 0 10px 6px;
}
.sidebar .nav-group-chevron,
.sidebar .nav-more-chevron { opacity: 0.4; transition: transform 0.2s ease, opacity 0.15s ease; }
.sidebar .nav-group-toggle:hover .nav-group-chevron,
.sidebar .nav-more-toggle:hover .nav-more-chevron { opacity: 0.85; }

body:not(.sidebar-collapsed) .sidebar .nav-link {
  gap: 11px;
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 1px;
  font-size: 13.5px;
  font-weight: 500;
}
.sidebar .nav-link .nav-icon { width: 18px; height: 18px; }
.sidebar .nav-link.active::before { display: none; }

/* ---- Maroon rail (light theme) ---- */
body.theme-light .sidebar .brand::after { background: rgba(255, 255, 255, 0.08); }
body.theme-light .sidebar .brand-sub { color: rgba(230, 180, 85, 0.85); }
body.theme-light .sidebar .nav-label { color: rgba(247, 242, 234, 0.48); }
body.theme-light .sidebar .nav-group-toggle:hover,
body.theme-light .sidebar .nav-more-toggle:hover { color: rgba(247, 242, 234, 0.85); }
body.theme-light .sidebar .nav-link { color: rgba(247, 242, 234, 0.76); }
body.theme-light .sidebar .nav-link .nav-icon { color: currentColor; fill: currentColor; opacity: 0.78; }
body.theme-light .sidebar .nav-link:hover { background: rgba(255, 255, 255, 0.06); color: #ffffff; }
body.theme-light .sidebar .nav-link:hover .nav-icon { color: currentColor; fill: currentColor; opacity: 1; }
body.theme-light .sidebar .nav-link.active {
  background: rgba(255, 255, 255, 0.10);
  color: #ffffff;
  font-weight: 600;
  box-shadow: none;
}
body.theme-light .sidebar .nav-link.active .nav-icon { color: #e6b455; fill: #e6b455; opacity: 1; }
body.theme-light .sidebar .nav-link.active .note-badge { background: #e6b455; color: #4a0f18; }
body.theme-light .sidebar .nav-link:focus-visible,
body.theme-light .sidebar .nav-label:focus-visible { outline: 2px solid rgba(230, 180, 85, 0.7); outline-offset: -2px; }

/* ---- Cream rail (night theme) ---- */
body:not(.theme-light) .sidebar .brand::after { background: rgba(124, 29, 42, 0.10); }
body:not(.theme-light) .sidebar .nav-label { color: #8C7B74; }
body:not(.theme-light) .sidebar .nav-group-toggle:hover,
body:not(.theme-light) .sidebar .nav-more-toggle:hover { color: #5A4A4E; }
body:not(.theme-light) .sidebar .nav-link { color: #5A4A4E; }
body:not(.theme-light) .sidebar .nav-link .nav-icon { color: currentColor; fill: currentColor; opacity: 0.75; }
body:not(.theme-light) .sidebar .nav-link:hover { background: rgba(124, 29, 42, 0.06); color: #3A2A2E; }
body:not(.theme-light) .sidebar .nav-link:hover .nav-icon { color: currentColor; fill: currentColor; opacity: 1; }
body:not(.theme-light) .sidebar .nav-link.active {
  background: rgba(124, 29, 42, 0.09);
  color: #7C1D2A;
  font-weight: 600;
  box-shadow: none;
}
body:not(.theme-light) .sidebar .nav-link.active .nav-icon { color: #7C1D2A; fill: #7C1D2A; opacity: 1; }
body:not(.theme-light) .sidebar .nav-link.active .note-badge { background: #7C1D2A; color: #ffffff; }
body:not(.theme-light) .sidebar .nav-link:focus-visible,
body:not(.theme-light) .sidebar .nav-label:focus-visible { outline: 2px solid rgba(124, 29, 42, 0.45); outline-offset: -2px; }

/* ============================================================
   Stock Requests — calm layout v2.16.319
   List: quiet tabs (label + count, empty stages hidden), plain two-line
   rows without the colour stripe / initials circle, one "when" line under
   the status, the same "⋯" menu on every row.
   Details window: flatter cards — no tinted gradients, accent edges,
   perforation dots or chip boxes. Nothing moved or removed.
   Scoped to #reqPills / #reqViewArea / .modal--sr-edit so Billing and
   Production (which share the stage-filter + tk-* classes) are untouched.
   ============================================================ */

/* ---- Filter tabs ---- */
.req-tabs { gap: 4px; margin: 0 0 14px; }
.req-tabs .stage-filter {
  align-items: center; gap: 7px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  box-shadow: none;
}
.req-tabs .stage-filter:hover { border-color: var(--line); background: transparent; }
.req-tabs .stage-filter-lbl { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.req-tabs .stage-filter-num {
  font-size: 11px; font-weight: 600; line-height: 1.35;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.05);
  padding: 1px 7px; border-radius: var(--r-pill);
}
.req-tabs .stage-filter.is-active {
  background: var(--surface-raised);
  border-color: var(--border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.req-tabs .stage-filter.is-active .stage-filter-lbl { color: var(--text); font-weight: 600; }
.req-tabs .stage-filter.is-active .stage-filter-num { background: var(--brand); color: #fff; }
body:not(.theme-light) .req-tabs .stage-filter-num { background: rgba(255, 255, 255, 0.08); }
body:not(.theme-light) .req-tabs .stage-filter.is-active .stage-filter-num { background: var(--accent); color: #2a0a10; }

/* ---- List rows ---- */
#reqViewArea table td, #billTable table td, #moTable table td { padding-top: 10px; padding-bottom: 10px; }
.tk-main { min-width: 0; }
.tk-title { gap: 6px; }
.tk-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.tk-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.tk-status { display: flex; }
.tk-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tk-when { font-size: 11.5px; color: var(--text-muted); }
.tk-when--old { color: #B45309; font-weight: 600; }
body:not(.theme-light) .tk-when--old { color: #E8B04B; }

/* ---- Request details window ---- */
.modal--sr-edit .sr-pipeline {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  padding-left: 2px;
  padding-right: 2px;
}
.modal--sr-edit .sr-pipeline__title { color: var(--text-muted); }
.modal--sr-edit .sr-pipeline--phased .srp-stepcount { background: transparent; padding: 0; color: var(--text-muted); font-weight: 500; }

.modal--sr-edit .sr-status-update--left {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.modal--sr-edit .sr-status-update__label { color: var(--text-muted); letter-spacing: 0.08em; }

.modal--sr-edit .ledger-summary-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: none;
}
.modal--sr-edit .ledger-pane--summary .ledger-summary-card:hover { box-shadow: none; }
.modal--sr-edit .ledger-summary-card::after { display: none; }
.modal--sr-edit .ledger-ctx-edge { display: none; }
.modal--sr-edit .ledger-summary-context { border-bottom: 1px solid var(--line); }
.modal--sr-edit .ledger-calc-chip,
.modal--sr-edit .ledger-calc-chip--total { background: transparent; border-color: transparent; padding: 0; }
/* Night mode: these were maroon / dark-grey text on the dark window. */
body:not(.theme-light) .modal--sr-edit .ledger-ctx-val { color: var(--text); }
body:not(.theme-light) .modal--sr-edit .ledger-summary-total-label,
body:not(.theme-light) .modal--sr-edit .ledger-calc-chip--total,
body:not(.theme-light) .modal--sr-edit .srp-plabel.is-active,
body:not(.theme-light) .modal--sr-edit .srp-detail__summary { color: #E6B455; }

/* Phones: a request card is two lines + one footer line — item and details
   on top, then the status (no "STATUS" label) with the ⋯ menu beside it,
   instead of a labelled status row and a separate row just for the menu. */
@media (max-width: 640px) {
  #reqViewArea table.data.data-cards tbody tr {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-4);
  }
  #reqViewArea table.data.data-cards tbody td.cell-primary {
    grid-column: 1 / -1; grid-row: 1;
    border-bottom: 0; padding-bottom: var(--sp-2);
    font-size: inherit; font-weight: inherit;
  }
  #reqViewArea table.data.data-cards tbody td[data-label="Status"] {
    grid-column: 1; grid-row: 2;
    display: block; text-align: left; padding: 0; border-bottom: 0;
  }
  #reqViewArea table.data.data-cards tbody td[data-label="Status"]::before { content: none; }
  #reqViewArea table.data.data-cards tbody td.cell-actions {
    grid-column: 2; grid-row: 2; align-self: center; padding: 0;
  }
}

/* ---- Dispatch & Delivery / Order Line-up tabs: same calm tabs as the lists ---- */
.ps-filters { gap: 4px; padding: 0; margin: 0 0 14px; border-bottom: 0; }
.ps-filter {
  padding: 6px 12px; margin-right: 0;
  border: 1px solid transparent; border-bottom: 1px solid transparent; border-radius: var(--r-pill);
  font-weight: 500; color: var(--text-muted);
}
.ps-filter:hover { border-color: var(--line); color: var(--text-muted); }
.ps-filter.is-active {
  background: var(--surface-raised); border-color: var(--border);
  color: var(--text); font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.ps-filter__count {
  font-size: 11px; font-weight: 600; line-height: 1.35;
  color: var(--text-muted); background: rgba(0, 0, 0, 0.05);
  padding: 1px 7px; border-radius: var(--r-pill);
}
.ps-filter.is-active .ps-filter__count { background: var(--brand); color: #fff; }
body:not(.theme-light) .ps-filter__count { background: rgba(255, 255, 255, 0.08); }
body:not(.theme-light) .ps-filter.is-active .ps-filter__count { background: var(--accent); color: #2a0a10; }

/* ============================================================
   Night mode contrast — v2.16.321
   A scripted contrast audit of every page found maroon-as-text
   (--maroon-600 on the dark surfaces) in these spots. In night mode
   that text turns a readable rose; light mode is unchanged.
   ============================================================ */
body:not(.theme-light) {
  --maroon-text: #E08E99;   /* maroon used as TEXT on dark surfaces */
}
body:not(.theme-light) .settings-hub-link,
body:not(.theme-light) .settings-hub-link:hover,
body:not(.theme-light) .settings-back-btn,
body:not(.theme-light) .settings-back-btn:hover,
body:not(.theme-light) .ps-card__qty-chip,
body:not(.theme-light) .ps-card__qty-unit,
body:not(.theme-light) .ps-card__task-badge,
body:not(.theme-light) .ps-btn--danger,
body:not(.theme-light) .ps-saved-flash,
body:not(.theme-light) .sr-step.is-current .sr-step__label,
body:not(.theme-light) .sr-step.is-done .sr-step__label,
body:not(.theme-light) .modal--sr-edit .sr-step.is-current .sr-step__label,
body:not(.theme-light) .modal--sr-edit .sr-step.is-done .sr-step__label,
body:not(.theme-light) .sr-pipeline__title,
body:not(.theme-light) .sr-sidebadge,
body:not(.theme-light) .sr-dp-trigger,
body:not(.theme-light) .sr-dp-trigger strong,
body:not(.theme-light) .sr-dp-choice__btn strong,
body:not(.theme-light) .modal--sr-edit .sr-edit-history__count,
body:not(.theme-light) .modal--sr-edit .sr-edit-history__role,
body:not(.theme-light) .ledger-total-label,
body:not(.theme-light) .ledger-invoice-status.is-cancelled,
body:not(.theme-light) .ledger-meta-chip.is-cancelled,
body:not(.theme-light) .ledger-invoice-glyph,
body:not(.theme-light) .ledger-dp-pct-input { color: var(--maroon-text); }
body:not(.theme-light) .ps-btn--danger { border-color: rgba(224, 142, 153, 0.4); }
body:not(.theme-light) .rp-cat.is-active { color: var(--text); border-bottom-color: var(--accent); }
body:not(.theme-light) .rp-cat.is-active .rp-cat-n { background: var(--accent); color: #2a0a10; }
body:not(.theme-light) .sr-paymethod-badge { color: var(--text); background: rgba(255, 255, 255, 0.08); }
/* Order Line-up / Dispatch cards: the default stage colour is maroon, which
   tints the stage chip text and rail; on the dark cards use the rose instead. */
body:not(.theme-light) .ps-card { --stage-color: var(--maroon-text); }

/* ---- Reports: same calm tabs as the lists (categories), quiet pills (reports) ---- */
.rp-cats { gap: 4px; border-bottom: 0; margin-bottom: 10px; }
.rp-cat {
  padding: 6px 12px; margin-bottom: 0;
  border: 1px solid transparent; border-bottom: 1px solid transparent; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 500; color: var(--text-muted);
}
.rp-cat:hover { border-color: var(--line); color: var(--text-muted); }
.rp-cat.is-active {
  background: var(--surface-raised); border-color: var(--border);
  color: var(--text); font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.rp-cat-n { font-size: 11px; font-weight: 600; line-height: 1.35; padding: 1px 7px; background: rgba(0, 0, 0, 0.05); color: var(--text-muted); }
.rp-cat.is-active .rp-cat-n { background: var(--brand); color: #fff; }
body:not(.theme-light) .rp-cat-n { background: rgba(255, 255, 255, 0.08); }
body:not(.theme-light) .rp-cat.is-active { color: var(--text); border-bottom-color: var(--border); }
body:not(.theme-light) .rp-cat.is-active .rp-cat-n { background: var(--accent); color: #2a0a10; }
.rp-list { gap: 4px; margin-bottom: 18px; }
.report-nav-btn { background: transparent; border-color: var(--line); border-radius: var(--r-pill); color: var(--text-muted); }
.report-nav-btn:hover { border-color: var(--border); color: var(--text); }
.report-nav-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
body:not(.theme-light) .report-nav-btn.active { background: var(--accent); border-color: var(--accent); color: #2a0a10; }

/* ---- Partner phone bar: "New Request" is the one raised, primary slot ---- */
.partner-bottom-tabs a.is-primary { color: var(--gold-500); font-weight: 600; }
.partner-bottom-tabs a.is-primary svg {
  width: 30px; height: 30px; padding: 6px; margin-top: -2px;
  border-radius: 50%; background: var(--gold-500); color: #2a0a10;
  box-shadow: 0 4px 10px -4px rgba(0, 0, 0, 0.4);
}
.partner-bottom-tabs a span { white-space: nowrap; }

/* ============================================================
   Partner pages — calm pass v2.16.322
   Catalog cards keep their photo-first layout; the invoice cards read like
   a receipt: code + status, the balance, the due line, then the actions.
   ============================================================ */
.cat-grid { gap: 12px; }
.cat-card { border-radius: var(--r-md); }
.cat-card:hover { transform: none; box-shadow: var(--shadow-sm); border-color: var(--border); }
.cat-cat { min-height: 0; }
.cat-foot { align-items: center; }
.cat-price { font-size: 15px; font-weight: 700; }

.soa-grid { gap: 10px; }
.soa-card { border-left: 1px solid var(--navy-500); border-radius: var(--r-md); padding: 14px 16px; }
.soa-card:hover { transform: none; box-shadow: var(--shadow-sm); border-color: var(--border); }
.soa-card--overdue { border-color: rgba(179, 38, 30, 0.45); }
.soa-card--paid { opacity: 1; }
.soa-card--paid .soa-bal-n { font-weight: 600; }
.soa-card--cancelled { opacity: .6; }
.soa-head { justify-content: space-between; margin-bottom: 10px; }
.soa-head .text-mono { font-size: 13px; }
.soa-balance { display: block; margin-bottom: 6px; }
.soa-bal-lbl { display: block; font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text-muted); margin-bottom: 2px; }
.soa-bal-n { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.soa-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.soa-meta > div + div { margin-top: 2px; }
.soa-actions { gap: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.soa-actions .btn-primary { margin-left: auto; }

/* ============================================================
   Request details window — calm pass v2.16.322
   Same panes, same fields. The small uppercase tracking labels become
   plain sentence-case labels, decorative glyphs/markers go, the two
   columns sit closer, and the total reads as one line of arithmetic.
   ============================================================ */
.modal--sr-edit .ledger-eyebrow,
.modal--sr-edit .ledger-pane-title,
.modal--sr-edit .ledger-ctx-key,
.modal--sr-edit .ledger-summary-total-label,
.modal--sr-edit .ledger-summary-paymethod-label,
.modal--sr-edit .sr-status-update__label,
.modal--sr-edit .sr-leadtime__lbl,
.modal--sr-edit .field > label,
.modal--sr-edit .picker-lbl,
.modal--sr-edit .sr-pipeline__title {
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}
.modal--sr-edit .ledger-pane-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.modal--sr-edit .ledger-head .ledger-eyebrow { margin-bottom: 2px; }
.modal--sr-edit .ledger-ctx-glyph,
.modal--sr-edit .ledger-marker { display: none; }
.modal--sr-edit .ledger-ctx-key { gap: 0; min-width: 96px; }
.modal--sr-edit .ledger-ctx-val { font-size: 13px; font-weight: 600; }
.modal--sr-edit .ledger-summary-total-label { display: block; margin-bottom: 2px; }
.modal--sr-edit .ledger-summary-total-amount { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
.modal--sr-edit .ledger-calc-chip-label { display: none; }
.modal--sr-edit .ledger-calc-chip,
.modal--sr-edit .ledger-calc-chip--total { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.modal--sr-edit .ledger-calc-chip--total { color: var(--text); font-weight: 600; }
.modal--sr-edit .ledger-calc-op { color: var(--text-muted); }
.modal--sr-edit .ledger-split { grid-template-columns: minmax(0, 1fr) 340px; column-gap: 32px; }
.modal--sr-edit .ledger-summary-card { gap: 14px; }
.modal--sr-edit .ledger-summary-context { gap: 6px; padding-bottom: 12px; }
.modal--sr-edit .ledger-summary-context--illustrated .ledger-ctx-row { padding: 2px 0; grid-template-columns: 96px 1fr; }
.modal--sr-edit .ledger-summary-context--illustrated .ledger-ctx-row:hover { background: transparent; }
.modal--sr-edit .srp-pill { font-size: 13px; font-weight: 600; padding: 5px 11px; }
/* Phones: one column again (the rule above is for wide windows only). */
@media (max-width: 720px) {
  .modal--sr-edit .ledger-split { grid-template-columns: minmax(0, 1fr); column-gap: 0; }
  .modal--sr-edit .ledger-pane--summary { position: static; }
}

/* ============================================================
   Dispatch & Delivery / Order Line-up cards — calm pass v2.16.322
   Same cards and buttons; the colour rail, uppercase stage chip, tinted
   qty chip and arrow buttons become plain text and one clear button.
   ============================================================ */
.ps-list { gap: 10px; }
.ps-card { padding: 14px 16px; gap: 10px; box-shadow: none; border-color: var(--line); border-radius: var(--r-md); }
.ps-card:hover { box-shadow: var(--shadow-sm); border-color: var(--border); transform: none; }
.ps-card__rail { display: none; }
.ps-card__stage-chip {
  padding: 2px 9px; font-size: 11.5px; font-weight: 600; letter-spacing: 0; text-transform: none;
  background: var(--surface-raised); border: 1px solid var(--line); color: var(--text);
}
.ps-card__stage-chip--ghost { background: transparent; }
.ps-card__qty-chip { padding: 0; background: transparent; color: var(--text-muted); font-weight: 600; font-size: 12.5px; }
.ps-card__qty-unit { color: var(--text-muted); font-weight: 500; }
.ps-card__product { font-size: 14px; }
.ps-card__sku { color: var(--text-muted); }
.ps-btn { min-height: 34px; border-radius: 8px; font-weight: 600; }
.ps-btn--full { justify-content: center; }
.ps-btn__arrow { display: none; }
.ps-btn--ghost { border-color: var(--line); color: var(--text-muted); }
.ps-btn--ghost:hover { border-color: var(--border); color: var(--text); }
body:not(.theme-light) .ps-card__stage-chip { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.1); }

/* ============================================================
   Popups — one style v2.16.322
   The request window ("ledger") used uppercase tracked chips and eyebrows
   that no other popup has. They now match the plain modals: sentence-case
   labels, the standard status badge look, same header spacing.
   ============================================================ */
.ledger-meta-chip {
  padding: 3px 10px; font-size: 11.5px; font-weight: 600; letter-spacing: 0; text-transform: none;
  background: var(--surface-raised); border: 1px solid var(--line); color: var(--text);
}
.ledger-meta-chip.is-pending, .ledger-meta-chip.is-submitted, .ledger-meta-chip.is-in-review, .ledger-meta-chip.is-draft { color: var(--text); }
.modal--sr-edit .ledger-head.ledger-head--compact { padding-top: 6px; }
.modal--sr-edit .ledger-head--compact .ledger-id { font-size: 22px; font-weight: 600; }
.mo-lineup-panel__eyebrow,
.modal .card-title,
.modal .ledger-eyebrow { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.modal .stat-row .lbl { font-size: 12.5px; color: var(--text-muted); }
.modal-footer { gap: 8px; }

/* ============================================================
   Phone banners — v2.16.322
   The sync and update bars took three or four lines on a phone. One line
   each now, cut with "…"; tap the text to read all of it.
   ============================================================ */
@media (max-width: 640px) {
  .sync-banner, .app-banner { padding: 6px 12px; gap: 8px; font-size: 12.5px; cursor: pointer; }
  .sync-banner > span, .app-banner > span { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sync-banner.is-expanded > span, .app-banner.is-expanded > span { white-space: normal; }
  .sync-banner__btn, .app-banner__btn { padding: 3px 10px; font-size: 12px; }
  .sync-banner svg, .app-banner svg { width: 14px; height: 14px; }
}

/* Request window: "updated on another device" notice (v2.16.323) */
.sr-conflict {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 0 14px; padding: 10px 14px; border-radius: var(--r-md);
  background: rgba(224, 164, 55, 0.14); border: 1px solid rgba(224, 164, 55, 0.5);
  font-size: 13px; color: var(--text);
}

/* ============================================================
   Text size — Large (v2.16.324)
   body.text-lg scales the shared type tokens and the base font so every
   page grows together; nothing is positioned in px type, so layouts hold.
   ============================================================ */
body.text-lg {
  font-size: 16px;
  --fs-xs: 12.5px; --fs-sm: 13.5px; --fs-base: 15px; --fs-md: 16px;
  --fs-lg: 18px;   --fs-xl: 22px;   --fs-2xl: 27px;
}
body.text-lg table.data td, body.text-lg table.data th { font-size: var(--fs-base); }
body.text-lg .tk-name { font-size: 15.5px; }
body.text-lg .tk-sub, body.text-lg .tk-when { font-size: 13.5px; }
body.text-lg .nav-link { font-size: 15px; }
body.text-lg .badge { font-size: 12.5px; }
body.text-lg .btn { font-size: 14.5px; }
body.text-lg .field input, body.text-lg .field select, body.text-lg .field textarea { font-size: 15px; }
body.text-lg .page-header h2 { font-size: 24px; }
body.text-lg .page-header p { font-size: 14.5px; }

/* Request window: next steps as buttons (v2.16.324) */
.sr-status-update__row--buttons { flex-wrap: wrap; gap: 8px; }
.sr-next-btn {
  padding: 8px 14px; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  background: transparent; border: 1px solid var(--border); color: var(--text);
}
.sr-next-btn:hover { background: var(--surface-raised); }
.sr-next-btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.sr-next-btn--primary:hover { background: var(--brand-strong); }

/* ============================================================
   Barcode scanner window (v2.16.324)
   ============================================================ */
.scan-wrap { display: grid; gap: 12px; }
.scan-video-box { position: relative; aspect-ratio: 4 / 3; background: #000; border-radius: var(--r-md); overflow: hidden; }
.scan-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-reticle {
  position: absolute; left: 12%; right: 12%; top: 30%; bottom: 30%;
  border: 2px solid rgba(255, 255, 255, 0.85); border-radius: 10px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.25);
}
.scan-hint { margin: 0; }
.scan-manual { display: flex; gap: 8px; }
.scan-manual input { flex: 1; min-width: 0; padding: 9px 12px; font: inherit; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.scan-status { margin: 0; min-height: 1em; }

/* ============================================================
   Clickable things look clickable — v2.16.327
   Inactive options in every segmented control and tab strip used to be
   plain text next to a filled active one, so they read as labels. Each
   inactive option now has its own border and surface, full text colour,
   a pointer and a hover state; the active one keeps the brand fill.
   ============================================================ */
/* Staff Monitoring strip + segments */
.sm-tabs, .sm-seg { background: transparent; border: 0; padding: 0; gap: 6px; }
.sm-tab, .sm-seg-btn {
  cursor: pointer; border: 1px solid var(--border); background: var(--surface-raised);
  color: var(--text); font-weight: 600;
}
.sm-tab:hover, .sm-seg-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--surface-raised); }
.sm-tab.is-active, .sm-seg-btn.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Table / Pipeline style switches */
.view-mode-toggle { border: 0; gap: 6px; overflow: visible; border-radius: 0; }
.view-mode-toggle button {
  border: 1px solid var(--border) !important; border-radius: 8px; background: var(--surface-raised);
  color: var(--text); font-weight: 600; padding: 6px 12px;
}
.view-mode-toggle button:hover:not(.active) { border-color: var(--brand) !important; color: var(--brand); background: var(--surface-raised); }
.view-mode-toggle button.active, .view-mode-toggle button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand) !important; color: #fff; }

/* Underline tab strips (Sales Orders | Customers, Help) */
.tabs { gap: 6px; border-bottom: 0; }
.tab, .help-tab {
  cursor: pointer; padding: 7px 14px; border-radius: var(--r-pill);
  border: 1px solid var(--border); background: var(--surface-raised);
  color: var(--text); font-weight: 600; margin-bottom: 0;
}
.tab:hover, .help-tab:hover { border-color: var(--brand); color: var(--brand); }
.tab.active, .help-tab.is-active, .help-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Calm list tabs (Stock Requests, Billing, Production, Sales, Reports, Dispatch):
   inactive ones get a faint border so they read as buttons, not words. */
.req-tabs .stage-filter, .ps-filter, .rp-cat { border-color: var(--line); cursor: pointer; }
.req-tabs .stage-filter .stage-filter-lbl, .ps-filter, .rp-cat { color: var(--text); }
.req-tabs .stage-filter:hover, .ps-filter:hover, .rp-cat:hover { border-color: var(--brand); }
.req-tabs .stage-filter:hover .stage-filter-lbl, .ps-filter:hover, .rp-cat:hover { color: var(--brand); }
.req-tabs .stage-filter.is-active, .ps-filter.is-active, .rp-cat.is-active { border-color: var(--brand); }
body:not(.theme-light) .req-tabs .stage-filter:hover .stage-filter-lbl,
body:not(.theme-light) .ps-filter:hover, body:not(.theme-light) .rp-cat:hover,
body:not(.theme-light) .sm-tab:hover, body:not(.theme-light) .sm-seg-btn:hover,
body:not(.theme-light) .view-mode-toggle button:hover:not(.active),
body:not(.theme-light) .tab:hover, body:not(.theme-light) .help-tab:hover { color: var(--accent); border-color: var(--accent); }
body:not(.theme-light) .req-tabs .stage-filter.is-active, body:not(.theme-light) .ps-filter.is-active, body:not(.theme-light) .rp-cat.is-active { border-color: var(--accent); }
body:not(.theme-light) .sm-tab.is-active, body:not(.theme-light) .sm-seg-btn.is-active,
body:not(.theme-light) .view-mode-toggle button.active, body:not(.theme-light) .tab.active, body:not(.theme-light) .help-tab.is-active { background: var(--accent); border-color: var(--accent); color: #2a0a10; }

/* ============================================================
   Clickable things look clickable, part 2 — v2.16.328
   The rest of the text-looking controls: ghost buttons, dashboard list
   tabs and period segments, "All →" style links, and the small
   show/hide toggles. Each gets a border or an underline and a hover.
   ============================================================ */
/* Ghost buttons (View, Print, Cancel, Clear, "+ New"…) */
.btn-ghost { border: 1px solid var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); background: var(--surface-raised); }
body:not(.theme-light) .btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost.modal-foot-delete, .btn-ghost[style*="--danger"] { border-color: transparent; }

/* Dashboard list tabs (Recent | Top | Low stock | Partners) */
.dsh-tabs { border-bottom: 0; gap: 6px; padding-bottom: var(--sp-2); }
.dsh-tab { padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--r-pill); color: var(--text); cursor: pointer; }
.dsh-tab:hover { border-color: var(--brand); color: var(--brand); }
.dsh-tab.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.dsh-tab.is-active::after { display: none; }
.dsh-tab.is-active .dsh-tab-n { background: rgba(255, 255, 255, 0.22); color: #fff; }
body:not(.theme-light) .dsh-tab:hover { border-color: var(--accent); color: var(--accent); }
body:not(.theme-light) .dsh-tab.is-active { background: var(--accent); border-color: var(--accent); color: #2a0a10; }
body:not(.theme-light) .dsh-tab.is-active .dsh-tab-n { background: rgba(0, 0, 0, 0.15); color: #2a0a10; }

/* Dashboard period segments (7d | 30d | …) */
.dsh-seg { background: transparent; padding: 0; gap: 4px; }
.dsh-seg-btn { border: 1px solid var(--line); color: var(--text); cursor: pointer; }
.dsh-seg-btn:hover { border-color: var(--brand); color: var(--brand); }
.dsh-seg-btn.is-active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: none; }
body:not(.theme-light) .dsh-seg-btn:hover { border-color: var(--accent); color: var(--accent); }
body:not(.theme-light) .dsh-seg-btn.is-active { background: var(--accent); border-color: var(--accent); color: #2a0a10; }

/* "All requests →" style links on cards: always underlined, so they read as links */
.dsh-link, .home-link { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
.dsh-link:hover, .home-link:hover { text-decoration-color: currentColor; }
.home-link { text-decoration: none; }             /* home-link is already a bordered chip */

/* Small show/hide toggles ("Show detailed steps", "Advanced", "Show all N steps") */
.srp-detail__summary, .ledger-advanced > summary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border: 1px solid var(--line); border-radius: var(--r-pill);
  color: var(--text); font-weight: 500; cursor: pointer; user-select: none;
}
.srp-detail__summary:hover, .ledger-advanced > summary:hover { border-color: var(--brand); color: var(--brand); }
body:not(.theme-light) .srp-detail__summary, body:not(.theme-light) .modal--sr-edit .srp-detail__summary { color: var(--text); }
body:not(.theme-light) .srp-detail__summary:hover, body:not(.theme-light) .ledger-advanced > summary:hover { border-color: var(--accent); color: var(--accent); }

/* Dropdown filter pills (Partner Orders, Resticker, Stock Movement) and quick chips */
.filter-pill, .chip { cursor: pointer; border: 1px solid var(--border); }
.filter-pill:hover, .chip:hover { border-color: var(--brand); }
body:not(.theme-light) .filter-pill:hover, body:not(.theme-light) .chip:hover { border-color: var(--accent); }

/* Sidebar: pages a person hid from their own menu (v2.16.330) */
.nav-link.nav-user-hidden { display: none !important; }
.nav-order-item.is-hidden .nav-order-label { color: var(--text-muted); }
.nav-order-hidden-tag { font-size: 11px; font-weight: 500; color: var(--text-muted); margin-left: 4px; }
.nav-order-controls { display: inline-flex; align-items: center; gap: 4px; }

/* Settings → Appearance preferences (v2.16.331) */
.prefs-grid { display: grid; gap: 10px; }
.prefs-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.prefs-lbl { min-width: 130px; font-size: 13px; color: var(--text-muted); }

/* ============================================================
   Home — task board v2.16.332
   One question: what needs me today? Count tiles, then the rows behind
   them with their one action, then everything else folded into one card.
   ============================================================ */
.hb-waiting { font-size: var(--fs-sm); color: var(--text-muted); align-self: center; }
.hb-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-3); }
.hb-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  padding: 14px 16px; border-radius: var(--r-md); cursor: pointer; font: inherit;
  background: var(--surface-raised); border: 1px solid var(--border); color: var(--text);
  transition: border-color var(--transition), transform var(--transition);
}
.hb-tile:hover { border-color: var(--brand); transform: translateY(-1px); }
.hb-tile-n { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.hb-tile-lbl { font-size: var(--fs-sm); color: var(--text-muted); }
.hb-tile.is-urgent .hb-tile-n { color: var(--danger); }
.hb-list { padding: 0; overflow: hidden; margin-bottom: var(--sp-3); }
.hb-list-hd { padding: 14px 18px 8px; }
.hb-list-hd h3 { margin: 0; font-size: var(--fs-md); font-weight: 600; }
.hb-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); width: 100%;
  padding: 11px 18px; border: 0; border-top: 1px solid var(--line); background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.hb-row:hover { background: var(--surface-raised); }
.hb-row-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hb-row-main b { font-size: var(--fs-base); font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-row-main small { font-size: var(--fs-sm); color: var(--text-muted); }
.hb-row.is-urgent .hb-row-main small { color: var(--danger); }
.hb-row-act { flex: none; padding: 5px 12px; border-radius: var(--r-pill); border: 1px solid var(--border); font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.hb-row:hover .hb-row-act { background: var(--brand); border-color: var(--brand); color: #fff; }
.hb-more { display: block; width: 100%; padding: 8px 18px; border: 0; border-top: 1px solid var(--line); background: transparent; font: inherit; font-size: var(--fs-sm); color: var(--text-muted); text-align: left; cursor: pointer; }
.hb-more:hover { color: var(--brand); }
.hb-done { display: flex; align-items: center; gap: 8px; padding: 18px; color: var(--success); font-size: var(--fs-base); }
.hb-side { padding: 0 18px; }
.hb-sec { border-top: 1px solid var(--line); }
.hb-sec:first-child { border-top: 0; }
.hb-sec > summary { list-style: none; display: grid; grid-template-columns: 150px minmax(0, 1fr) 16px; align-items: center; gap: var(--sp-3); padding: 12px 0; cursor: pointer; }
.hb-sec > summary::-webkit-details-marker { display: none; }
.hb-sec-lbl { font-size: var(--fs-base); font-weight: 600; color: var(--text); display: inline-flex; align-items: center; gap: 6px; }
.hb-sec-val { font-size: var(--fs-sm); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-flex; align-items: center; gap: 6px; }
.hb-sec-chev { width: 8px; height: 8px; border-right: 1.5px solid var(--text-muted); border-bottom: 1.5px solid var(--text-muted); transform: rotate(45deg); justify-self: end; transition: transform .15s ease; }
.hb-sec[open] > summary .hb-sec-chev { transform: rotate(-135deg); }
.hb-sec-body { padding: 0 0 14px; }
.hb-sec--links { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; gap: var(--sp-3); padding: 12px 0; }
.hb-sec--links .home-links { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
@media (max-width: 760px) {
  .hb-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
  .hb-tile { padding: 12px 14px; }
  .hb-sec > summary, .hb-sec--links { grid-template-columns: minmax(0, 1fr) 16px; }
  .hb-sec--links { grid-template-columns: minmax(0, 1fr); }
  .hb-sec-val { grid-column: 1; }
  .hb-sec > summary .hb-sec-chev { grid-column: 2; grid-row: 1; }
  .hb-row { padding: 10px 14px; }
  .hb-list-hd { padding: 12px 14px 6px; }
  .hb-side { padding: 0 14px; }
}

/* Home task board: list + company profile deck side by side (v2.16.333) */
.hb-main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--sp-3); align-items: start; margin-bottom: var(--sp-3); }
.hb-main .hb-list { margin-bottom: 0; }
.hb-deck { margin: 0; }
@media (max-width: 1000px) { .hb-main { grid-template-columns: minmax(0, 1fr); } }

/* Home: the company profile deck fills its column (v2.16.334) — as tall as the
   "Do today" list beside it, wider column, slides letterboxed by object-fit. */
.hb-main { grid-template-columns: minmax(0, 1fr) minmax(380px, 44%); align-items: stretch; }
.hb-deck { display: flex; min-height: 0; }
.hb-deck .dsh-cp-hero { flex: 1 1 auto; max-width: none; display: flex; flex-direction: column; }
.hb-deck .dsh-cp-stage { flex: 1 1 auto; min-height: 0; aspect-ratio: auto; }
.hb-deck .dsh-cp-cap { flex: none; }
@media (max-width: 1000px) {
  .hb-main { grid-template-columns: minmax(0, 1fr); }
  .hb-deck .dsh-cp-stage { aspect-ratio: 16 / 9; }
}

/* ============================================================
   Invoice window — calm pass v2.16.336 (.bv = bill view)
   Shared by Billing Accounts and the partner's Statement of Account.
   Code + status on top, three money tiles with a paid bar, dates on one
   line, one card per payment step with a small proof thumbnail, and
   Items / Payment history folded into sections.
   ============================================================ */
.bv { display: flex; flex-direction: column; gap: 14px; }
.bv-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.bv-code { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.bv-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.bv-sub .text-mono { color: var(--text); white-space: nowrap; }

.bv-money { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.bv-tile {
  display: flex; flex-direction: column; gap: 4px; padding: 12px 14px;
  background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--r-md);
}
.bv-tile small { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.bv-tile b { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; color: var(--text); }
.bv-tile--bal { border-color: var(--border); }
.bv-ok { color: var(--success) !important; }
.bv-due { color: var(--gold-500) !important; }
body:not(.theme-light) .bv-due { color: var(--accent) !important; }
.bv-strong { font-weight: 600; }
.bv-muted { color: var(--text-muted); font-weight: 500; }
.bv-late { color: var(--danger); font-weight: 600; }
.bv-soon { color: var(--warning); font-weight: 600; }

.bv-bar { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: -6px; }
.bv-bar i { display: block; height: 100%; background: var(--success); border-radius: inherit; transition: width .25s ease; }
.bv-dates { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 12.5px; color: var(--text-muted); margin-top: -6px; }
.bv-dates > span { white-space: nowrap; }

.bv-next {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; border-radius: var(--r-md);
  background: var(--warning-bg); border: 1px solid rgba(245, 158, 11, 0.25); font-size: 13px; color: var(--text);
}
.bv-next b { font-size: 15px; font-variant-numeric: tabular-nums; }

.bv-step { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-raised); overflow: hidden; }
.bv-step.is-acked { border-color: rgba(16, 185, 129, 0.35); }
.bv-step-hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.bv-step-hd h4 { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--text); }
.bv-step-body { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 14px; padding: 14px; align-items: start; }
.bv-step-act { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px 12px; padding: 10px 14px; border-top: 1px solid var(--line); }
.bv-hint { font-size: 12.5px; color: var(--text-muted); }

.bv-proof {
  display: flex; flex-direction: column; gap: 6px; padding: 0; margin: 0; width: 132px;
  background: transparent; border: 0; cursor: zoom-in; color: var(--text-muted); font: inherit; font-size: 12px; text-align: center;
}
.bv-proof img { width: 132px; height: 96px; object-fit: cover; object-position: top; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-raised); display: block; }
.bv-proof:hover img { border-color: var(--brand); }
.bv-proof:hover span { color: var(--brand); text-decoration: underline; }
.bv-noproof { width: 132px; height: 96px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 8px; font-size: 12px; color: var(--text-muted); border: 1px dashed var(--border); border-radius: 8px; }

.bv-kv { margin: 0; display: flex; flex-direction: column; gap: 0; }
.bv-kv-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.bv-kv-row:last-child { border-bottom: 0; }
.bv-kv-row dt { color: var(--text-muted); font-weight: 500; }
.bv-kv-row dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; color: var(--text); }

.bv-sec { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-raised); }
.bv-sec > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; font-size: 13.5px; font-weight: 600; color: var(--text); border-radius: var(--r-md);
}
.bv-sec > summary::-webkit-details-marker { display: none; }
.bv-sec > summary::before { content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--text-muted); border-bottom: 1.5px solid var(--text-muted); transform: rotate(-45deg); transition: transform .15s ease; margin-right: 2px; }
.bv-sec[open] > summary::before { transform: rotate(45deg); }
.bv-sec > summary:hover { background: var(--surface); }
.bv-sec[open] > summary { border-bottom: 1px solid var(--line); border-radius: var(--r-md) var(--r-md) 0 0; }
.bv-n { font-size: 11.5px; font-weight: 600; color: var(--text-muted); background: var(--surface-raised); border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; }
.bv-sum-amt { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-muted); font-size: 13px; }
.bv-table { margin: 0; border-radius: 0 0 var(--r-md) var(--r-md); overflow: hidden; }
.bv-table th, .bv-table td { font-size: 13px; }
.bv-hist { padding: 4px 14px; }
.bv-hist-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.bv-hist-row:last-child { border-bottom: 0; }
.bv-hist-main small { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }

@media (max-width: 640px) {
  .bv-money { grid-template-columns: 1fr; gap: 8px; }
  .bv-tile { flex-direction: row; align-items: center; justify-content: space-between; padding: 10px 12px; }
  .bv-tile b { font-size: 16px; }
  .bv-step-body { grid-template-columns: 1fr; }
  .bv-proof, .bv-proof img, .bv-noproof { width: 100%; }
  .bv-proof img { height: 140px; }
  .bv-step-act { justify-content: stretch; }
  .bv-step-act .btn { flex: 1 1 auto; justify-content: center; }
}

/* ============================================================
   Stock Request window — calm pass 2 (v2.16.337)
   Same fields and buttons. The status box, the right rail and the
   invoice card lose their tints, dashed rules, uppercase tracking and
   glyphs; they read like the rest of the plain windows now.
   ============================================================ */
/* Status box: a plain card, label in sentence case, next steps as buttons. */
.modal--sr-edit .sr-status-update--left {
  gap: 10px; padding: 12px 14px; margin-bottom: 16px;
  background: var(--surface-raised); border: 1px solid var(--line); border-left-width: 1px; border-radius: var(--r-md);
}
.modal--sr-edit .sr-status-update__label { font-size: 12.5px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text); }
.sr-next-btn--quiet { border-color: transparent; color: var(--text-muted); background: transparent; }
.sr-next-btn--quiet:hover { color: var(--danger); background: rgba(239, 68, 68, 0.08); border-color: transparent; }
.sr-next-hint { margin: 0; font-size: 12.5px; color: var(--text-muted); }
.sr-next-hint b { color: var(--text); font-weight: 600; }
.modal--sr-edit .sr-status-update__shortcut {
  margin: 0; padding: 9px 14px; border-radius: 8px; font-size: 13px; font-weight: 600;
  background: var(--brand); color: #fff; border: 1px solid var(--brand); box-shadow: none; transform: none;
}
.modal--sr-edit .sr-status-update__shortcut:hover { background: var(--brand-strong); transform: none; }
body:not(.theme-light) .modal--sr-edit .sr-status-update__shortcut { background: var(--accent); border-color: var(--accent); color: #2a0a10; }

/* Right rail: one plain card, sections split by light solid rules. */
.modal--sr-edit .ledger-summary-card { gap: 0; padding: 4px 18px; background: var(--surface-raised); border-color: var(--line); animation: none; }
.modal--sr-edit .ledger-summary-context,
.modal--sr-edit .ledger-summary-total,
.modal--sr-edit .ledger-summary-paymethod,
.modal--sr-edit .ledger-summary-schedule,
.modal--sr-edit .ledger-summary-invoice { padding: 14px 0; margin: 0; border: 0; border-bottom: 1px solid var(--line); }
.modal--sr-edit .ledger-summary-card > :last-child { border-bottom: 0; }
.modal--sr-edit .ledger-summary-context { gap: 6px; }
.modal--sr-edit .ledger-summary-total { display: grid; gap: 4px; }
.modal--sr-edit .ledger-summary-total-amount { font-size: 24px; }
.modal--sr-edit .ledger-summary-total-amount .ledger-total-sym { font-size: 14px; color: var(--text-muted); }
.modal--sr-edit .ledger-summary-paymethod-label,
.modal--sr-edit .ledger-summary-invoice .ledger-eyebrow--sm,
.modal--sr-edit .ledger-summary-schedule .ledger-eyebrow--sm,
.modal--sr-edit .sr-leadtime__lbl { font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text-muted); margin: 0 0 8px; }
.modal--sr-edit .sr-leadtime { gap: 6px; }
.modal--sr-edit .sr-leadtime__input {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; color: var(--text); padding: 8px 10px; font-size: 13.5px;
}
.modal--sr-edit .sr-leadtime__input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(124, 28, 38, 0.12); }
.modal--sr-edit .sr-leadtime__val { color: var(--text); padding: 2px 0; }
.modal--sr-edit .sr-paymethod-badge { font-weight: 600; font-size: 12.5px; padding: 4px 10px; }
.modal--sr-edit .sr-vip-terms__txt { font-size: 13px; color: var(--text-muted); }

/* Invoice card inside the rail: no stripe / glyph / gradient; plain rows. */
.modal--sr-edit .ledger-invoice-paper,
body:not(.theme-light) .modal--sr-edit .ledger-invoice-paper {
  padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: none; transform: none;
}
.modal--sr-edit .ledger-invoice-paper:hover { box-shadow: none; }
.modal--sr-edit .ledger-invoice-paper-stripe,
.modal--sr-edit .ledger-invoice-glyph,
.modal--sr-edit .ledger-invoice-status-dot { display: none; }
.modal--sr-edit .ledger-invoice-paper-head { margin-bottom: 8px; }
.modal--sr-edit .ledger-invoice-paper .ledger-invoice-id { font-size: 14px; letter-spacing: 0; color: var(--text); }
.modal--sr-edit .ledger-invoice-paper .ledger-invoice-status {
  padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: 0; text-transform: none;
}
.modal--sr-edit .ledger-invoice-paper-meta {
  grid-template-columns: 1fr; gap: 0; padding: 0; margin: 0; border: 0;
}
.modal--sr-edit .ledger-invoice-paper-meta > div {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 6px 0; border-top: 1px solid var(--line);
}
.modal--sr-edit .ledger-invoice-paper-meta dt { font-size: 12.5px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--text-muted); }
.modal--sr-edit .ledger-invoice-paper-meta dd { font-size: 13.5px; font-weight: 600; color: var(--text); text-align: right; }
.modal--sr-edit .ledger-invoice-paper-meta .ledger-invoice-sym { color: var(--text-muted); font-weight: 500; margin-right: 1px; }
.modal--sr-edit .ledger-invoice-dp-setup { margin-top: 0; }
.modal--sr-edit .ledger-dp-setup-foot { border-top: 0 !important; padding-top: 2px !important; justify-content: flex-end; }
.modal--sr-edit .ledger-invoice-dp-ack { font-size: 11.5px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.modal--sr-edit .ledger-invoice-paper-actions { gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.modal--sr-edit .ledger-invoice-paper-actions .ledger-invoice-btn {
  padding: 6px 10px; font-size: 12.5px; font-weight: 600; letter-spacing: 0; text-transform: none; border-radius: 8px;
  background: transparent; border: 1px solid var(--border); color: var(--text); box-shadow: none;
}
.modal--sr-edit .ledger-invoice-paper-actions .ledger-invoice-btn:hover { background: var(--surface-raised); border-color: var(--brand); color: var(--brand); transform: none; }
.modal--sr-edit .ledger-invoice-paper-actions .ledger-invoice-btn--send,
.modal--sr-edit .ledger-invoice-paper-actions .ledger-invoice-btn--view-full { background: var(--brand); border-color: var(--brand); color: #fff; margin-left: auto; }
.modal--sr-edit .ledger-invoice-paper-actions .ledger-invoice-btn--send:hover,
.modal--sr-edit .ledger-invoice-paper-actions .ledger-invoice-btn--view-full:hover { background: var(--brand-strong); color: #fff; }
body:not(.theme-light) .modal--sr-edit .ledger-invoice-paper-actions .ledger-invoice-btn--send,
body:not(.theme-light) .modal--sr-edit .ledger-invoice-paper-actions .ledger-invoice-btn--view-full { background: var(--accent); border-color: var(--accent); color: #2a0a10; }
.modal--sr-edit .ledger-summary-invoice-empty { padding: 12px 14px; border: 1px dashed var(--border); border-radius: var(--r-md); }
.modal--sr-edit .ledger-invoice-btn--generate { padding: 7px 12px; font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; border-radius: 8px; box-shadow: none; }

/* Left pane: the "Order" title and the folded sections breathe a little more. */
.modal--sr-edit .ledger-pane-title { margin-top: 2px; }
.modal--sr-edit .ledger-advanced--inline { margin-top: 10px; }
/* v2.16.337 follow-ups: the quiet Cancel button still looks pressable, and the
   "DP paid" row keeps its label on one line with the ack chip under the amount. */
.sr-next-btn--quiet { border-color: var(--line); }
.modal--sr-edit .ledger-invoice-paper-meta dt { white-space: nowrap; }
.modal--sr-edit .ledger-invoice-paper-meta dd { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: baseline; gap: 2px 4px; min-width: 0; }
/* The ack chip sits on its own line under the amount, sized to its text and
   right-aligned (a 100%-wide chip crowded the label beside it). */
.modal--sr-edit .ledger-invoice-paper-meta--dp dd::before { content: ""; flex-basis: 100%; height: 0; order: 1; }
.modal--sr-edit .ledger-invoice-paper-meta dd .ledger-invoice-dp-ack { order: 2; flex: 0 1 auto; max-width: 100%; white-space: normal; text-align: right; margin-left: auto; }
/* Action row: the three small buttons share one line; Send to Partner gets
   a full line of its own instead of wrapping to the right. */
.modal--sr-edit .ledger-invoice-paper-actions .ledger-invoice-btn--send { flex: 1 0 100%; justify-content: center; margin-left: 0; margin-top: 2px; }
/* Partner payment steps: sentence-case labels, a heading above the steps. */
.modal--sr-edit .sr-dp-amount__lbl { font-size: 12.5px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--text-muted); }
.modal--sr-edit .sr-pay-eyebrow { margin-top: 6px; }
.modal--sr-edit .sr-dp-upload { margin-top: 4px; }
/* The floating Back / Close buttons were 85% see-through, so scrolled text
   showed through them. Solid surface now, same maroon hover. */
.modal--sr-edit .modal-nav-back,
.modal--sr-edit .modal-nav-close { background: var(--surface-raised); border-color: var(--line); -webkit-backdrop-filter: none; backdrop-filter: none; }
body:not(.theme-light) .modal--sr-edit .modal-nav-back,
body:not(.theme-light) .modal--sr-edit .modal-nav-close { background: var(--surface-raised); border-color: var(--border); color: var(--text); }

/* ============================================================
   Production Order / Sales Order / Client windows — calm pass (v2.16.339)
   They reuse the invoice window's blocks (.bv-*). Extras below.
   ============================================================ */
.bv-top-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.bv-next-lbl { font-size: 12px; }
.bv-sub a { color: var(--text); text-decoration: none; border-bottom: 1px dotted var(--border); }
.bv-sub a:hover { color: var(--brand); border-color: var(--brand); }
.bv-kv--card { padding: 4px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-raised); }
.bv-kv-row dd a { color: var(--brand); }
.bv-step-body--one { grid-template-columns: minmax(0, 1fr); padding: 4px 14px; }
.bv-money--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bv-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bv-actions .btn { text-decoration: none; }
.bv-short-chip { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--danger); background: rgba(239, 68, 68, 0.1); border-radius: 999px; padding: 2px 8px; }
.bv-table tr.is-short td { background: rgba(239, 68, 68, 0.05); }
.bv-hist-row--btn { width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line); font: inherit; color: inherit; text-align: left; cursor: pointer; padding: 10px 0; border-radius: 0; }
.bv-hist-row--btn:last-child { border-bottom: 0; }
.bv-hist-row--btn:hover .bv-hist-main b { color: var(--brand); }
.cf-order-row { cursor: pointer; }
.cf-order-row:hover td { background: var(--surface); }
/* Lineup card inside the Production Order window: plain, no gold rail or eyebrow. */
.modal .mo-lineup-panel { margin-top: 0; padding: 0; background: var(--surface-raised); border: 1px solid var(--line); border-left-width: 1px; border-radius: var(--r-md); overflow: hidden; }
.modal .mo-lineup-panel__header { padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface); align-items: center; }
.modal .mo-lineup-panel.is-collapsed .mo-lineup-panel__header { border-bottom: 0; }
.modal .mo-lineup-panel__eyebrow { display: none; }
.modal .mo-lineup-panel__title h4 { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--text); }
.modal .mo-lineup-step { font-size: 11.5px; color: var(--text-muted); background: transparent; border-color: var(--line); }
.modal .mo-lineup-panel__body { margin: 0; padding: 12px 14px 14px; }
.modal .mo-lineup-panel__hint { color: var(--text-muted); }
.modal .mo-lineup-panel__actions { margin-top: 8px; }
@media (max-width: 640px) {
  .bv-money--4 { grid-template-columns: 1fr 1fr; }
  .bv-money--4 .bv-tile { flex-direction: column; align-items: flex-start; }
  .bv-top-side { align-items: flex-start; text-align: left; }
  .bv-top { flex-direction: column; }
}
/* Phones: a window footer with four or five buttons wraps into two columns
   instead of clipping; the client's order table drops the Date column. */
@media (max-width: 640px) {
  .modal-footer:not(.ledger-footer) { flex-wrap: wrap; }
  .modal-footer:not(.ledger-footer) .btn { flex: 1 1 calc(50% - 4px); justify-content: center; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cf-table th:nth-child(5), .cf-table td:nth-child(5) { display: none; }
}

/* Production Order window — simpler (v2.16.340): product as the headline, a
   one-line note, a lineup card with four fields and the rest folded. */
.bv-note { margin: -6px 0 0; font-size: 13px; color: var(--text-muted); }
.modal .mo-lineup-panel__title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.modal .mo-lineup-panel__who { font-size: 12px; }
.modal .mo-lineup-form { gap: 10px 12px; }
.modal .mo-lineup-more { margin-top: 10px; }
.modal .mo-lineup-more > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--text); padding: 4px 0;
}
.modal .mo-lineup-more > summary::-webkit-details-marker { display: none; }
.modal .mo-lineup-more > summary::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid var(--text-muted); border-bottom: 1.5px solid var(--text-muted); transform: rotate(-45deg); transition: transform .15s ease; }
.modal .mo-lineup-more[open] > summary::before { transform: rotate(45deg); }
.modal .mo-lineup-more > summary:hover { color: var(--brand); }
.modal .mo-lineup-more > .form-grid { margin-top: 8px; }

/* ============================================================
   Order Line-up cards — simple pass (v2.16.341)
   One card = product, codes + qty, stage chip, one meta line, remarks,
   then the single next-step button and a ⋯ menu. Tap the card for the
   ticket.
   ============================================================ */
.lu-card { cursor: pointer; gap: 8px; }
.lu-card:focus-within { border-color: var(--border); }
.lu-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.lu-head-main { min-width: 0; }
.lu-product { font-size: 14.5px; font-weight: 600; color: var(--text); line-height: 1.3; }
.lu-product .is-missing { color: var(--danger); }
.lu-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.lu-sub b { color: var(--text); font-weight: 600; }
.lu-head .ps-card__stage-chip { flex: 0 0 auto; white-space: nowrap; }
.lu-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 12.5px; color: var(--text-muted); }
.lu-who { color: var(--text); font-weight: 600; }
.lu-who--none { color: var(--text-muted); font-weight: 500; font-style: italic; }
.lu-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--border); display: inline-block; }
.lu-meta .mo-substatus-pill { font-size: 11.5px; padding: 1px 8px; }
.lu-remarks { font-size: 12.5px; color: var(--text-muted); font-style: italic; }
.lu-actions { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.lu-primary { flex: 1 1 auto; justify-content: center; }
.lu-wait { flex: 1 1 auto; font-size: 12.5px; color: var(--text-muted); padding: 7px 0; }
.lu-menu {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-raised);
  color: var(--text-muted); font-size: 18px; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0 0 6px;
}
.lu-menu:hover { border-color: var(--brand); color: var(--brand); }
.lu-card--unlined { border-style: dashed; }
.ps-card--cancelled .lu-product { text-decoration: line-through; color: var(--text-muted); }
/* Ticket window bits that stayed from the old layout */
.pt-detail .ps-detail__section { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-raised); padding: 12px 14px; }
.pt-detail .ps-detail__section h4 { margin: 0 0 8px; font-size: 13.5px; font-weight: 600; color: var(--text); text-transform: none; letter-spacing: 0; }
.pt-detail .pt-fields { display: grid; grid-template-columns: 1fr 2fr; gap: 10px 12px; }
.pt-detail .pt-field > span { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.pt-detail .bv-sec .bv-hist { padding: 8px 14px 12px; }
@media (max-width: 640px) {
  .pt-detail .pt-fields { grid-template-columns: 1fr; }
}
.pt-detail #psTasksSection { background: var(--surface-raised); border-color: var(--line); }
.pt-detail #psTasksSection h4 { text-transform: none; letter-spacing: 0; font-size: 13.5px; font-weight: 600; color: var(--text); }

/* Order Line-up cards — less text (v2.16.342): product + code, big qty,
   avatar + name + stage pills, one short status line. */
.lu-card { gap: 10px; padding: 14px 16px 12px; }
.lu-product { font-size: 15px; }
.lu-sub { font-size: 12px; }
.lu-qty { flex: 0 0 auto; display: flex; align-items: baseline; gap: 3px; color: var(--text); }
.lu-qty b { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.lu-qty small { font-size: 11.5px; color: var(--text-muted); font-weight: 500; }
.lu-meta { gap: 6px 8px; }
.lu-avatar {
  width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center;
  font-size: 11px; font-weight: 700; color: var(--brand); background: rgba(124, 28, 38, 0.1); flex: 0 0 auto;
}
.lu-avatar--none { background: transparent; border: 1px dashed var(--border); }
body:not(.theme-light) .lu-avatar { color: var(--accent); background: rgba(230, 180, 85, 0.14); }
.lu-who { font-size: 13px; }
.lu-stage { margin-left: auto; }
.lu-actions { margin-top: 0; padding-top: 10px; border-top: 1px solid var(--line); }
.lu-wait { font-size: 12.5px; padding: 6px 0; }
.lu-primary { min-height: 36px; }
@media (max-width: 640px) {
  .lu-stage { margin-left: 0; }
}

/* Line-up ticket — less text (v2.16.343): batch + remarks on one row, tasks
   as a plain list with a one-row "Log" form. */
.pt-detail .pt-fields--row { grid-template-columns: 160px minmax(0, 1fr); }
.pt-detail .pt-field input { width: 100%; }
.lt-bar { margin: 10px 14px 0; }
.lt-list { padding: 6px 14px 0; }
.lt-row { display: grid; grid-template-columns: auto minmax(0, 1fr) 72px auto auto; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.lt-row:last-child { border-bottom: 0; }
.lt-row .mo-substatus-pill { font-size: 11.5px; }
.lt-desc { min-width: 0; color: var(--text); }
input.lt-desc, input.lt-qty { padding: 5px 8px; border: 1px solid transparent; border-radius: 6px; background: transparent; font: inherit; font-size: 13px; color: var(--text); }
input.lt-desc:hover, input.lt-qty:hover { border-color: var(--line); }
input.lt-desc:focus, input.lt-qty:focus { outline: none; border-color: var(--brand); background: var(--surface); }
.lt-qty { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.lt-meta { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.lt-del { width: 26px; height: 26px; border: 0; background: transparent; color: var(--text-muted); border-radius: 6px; cursor: pointer; font-size: 12px; }
.lt-del:hover { color: var(--danger); background: rgba(239, 68, 68, 0.08); }
.lt-empty { padding: 10px 0 8px; font-size: 13px; color: var(--text-muted); }
.lt-add { display: grid; grid-template-columns: 150px minmax(0, 1fr) 80px auto; gap: 8px; padding: 10px 14px 14px; border-top: 1px solid var(--line); align-items: center; }
.lt-add select, .lt-add input { width: 100%; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; }
.lt-add select:focus, .lt-add input:focus { outline: none; border-color: var(--brand); }
@media (max-width: 640px) {
  .pt-detail .pt-fields--row { grid-template-columns: 1fr; }
  .lt-row { grid-template-columns: auto minmax(0, 1fr) 64px auto; }
  .lt-row .lt-meta { grid-column: 1 / -1; padding-left: 2px; }
  .lt-add { grid-template-columns: 1fr 1fr; }
  .lt-add input[data-pt-desc] { grid-column: 1 / -1; }
}
/* Phone: the ✕ stays on the first line of a task row; who/when sits under it. */
@media (max-width: 640px) {
  .lt-row .lt-del { grid-row: 1; grid-column: 4; }
  .lt-row .lt-meta { grid-row: 2; }
}

/* Stock Request window — less text (v2.16.344): no eyebrow, no pipeline
   title or repeated status pill; phase bar + "phase 3 of 6" + "All steps". */
.modal--sr-edit .sr-pipeline__head--bare { justify-content: flex-end; margin-bottom: 6px; }
.modal--sr-edit .srp-stepcount { font-size: 12px; color: var(--text-muted); }
.modal--sr-edit .sr-pipeline { padding-top: 6px; }
.modal--sr-edit .srp-detail { margin-top: 8px; }
.modal--sr-edit .srp-detail__summary { font-size: 12.5px; padding: 4px 10px; }
.modal--sr-edit .ledger-head--compact { padding-bottom: 6px; }
.modal--sr-edit .sr-status-update--left { gap: 8px; }
.modal--sr-edit .sr-next-hint { font-size: 12.5px; }

/* ============================================================
   Staff Monitoring — calm pass (v2.16.345)
   One header, the two views as tabs beside the period controls, four
   sentence-case tiles, one line for the task split, tables with a › on
   each clickable row.
   ============================================================ */
.sm-page .sm-topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.sm-page .sm-tabs { margin: 0; }
.sm-page .sm-topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.sm-page .sm-rangebtn { display: inline-flex; align-items: center; gap: 8px; }
.sm-page .sm-rangebtn-dates { color: var(--text-muted); font-weight: 500; }
.sm-page .sm-target { margin-left: 0; }
.sm-page .sm-target span { color: var(--text-muted); }
.sm-page .sm-target input { background: var(--surface-raised); color: var(--text); border-color: var(--border); }
.sm-page .sm-period { min-width: 0; font-weight: 600; color: var(--text); }
.sm-page .sm-navbtn { background: var(--surface-raised); border-color: var(--border); color: var(--text); }
.sm-page .sm-navbtn:hover { border-color: var(--brand); color: var(--brand); background: var(--surface-raised); }
.sm-page .sm-today { color: var(--text-muted); }
.sm-page .sm-today:hover { color: var(--brand); border-color: var(--border); background: var(--surface-raised); }
.sm-page .sm-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.sm-page .sm-stat { background: var(--surface-raised); border-color: var(--line); border-radius: var(--r-md); padding: 12px 14px; gap: 4px; }
.sm-page .sm-stat-lbl { font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--text-muted); }
.sm-page .sm-stat-val { font-size: 20px; font-weight: 700; color: var(--text); }
.sm-page .sm-stat--name .sm-stat-val { font-size: 15px; font-weight: 600; }
.sm-page .sm-types { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12.5px; color: var(--text-muted); margin: 0 2px 12px; }
.sm-page .sm-types b { color: var(--text); font-weight: 600; }
.sm-page .sm-card { padding: 14px 16px; margin-top: 10px; border-color: var(--line); box-shadow: none; }
.sm-page .sm-card--table { padding: 4px 16px 6px; }
.sm-page .sm-card-title { font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 8px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sm-page .sm-card--table .sm-card-title { padding-top: 10px; }
.sm-page .sm-card-sub { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.sm-page .sm-chart { position: relative; }
.sm-page .sm-alert { margin-top: 10px; padding: 10px 14px; border-radius: var(--r-md); border: 1px solid var(--line); border-left: 3px solid var(--danger); box-shadow: none; }
.sm-page .sm-alert--warn { border-left-color: var(--warning); }
.sm-page .sm-alert--warn .sm-alert-hd { color: var(--text); }
.sm-page .sm-alert-hd { font-size: 13px; font-weight: 600; }
.sm-page .sm-table th { font-size: 11.5px; letter-spacing: 0; text-transform: none; font-weight: 600; color: var(--text-muted); }
.sm-page .sm-table th:not(:first-child), .sm-page .sm-table td:not(:first-child) { width: auto; }
.sm-page .sm-table .sm-chev-col { width: 28px; }
.sm-page .sm-chev { width: 28px; text-align: right; color: var(--text-muted); font-size: 16px; }
.sm-page .sm-row { cursor: pointer; }
.sm-page .sm-row:hover .sm-chev { color: var(--brand); }
.sm-page .sm-row:hover td { background: var(--surface); }
.sm-page .sm-empty { padding: 16px 0; }
@media (max-width: 720px) {
  .sm-page .sm-stats { grid-template-columns: 1fr 1fr; }
  .sm-page .sm-topbar-right { margin-left: 0; width: 100%; }
  .sm-page .sm-rangebtn-dates { display: none; }
}
/* Night mode: the staff tables inherited a dark text colour on the dark card. */
.sm-page .sm-table td { color: var(--text); }
.sm-page .sm-table thead th { background: var(--surface); }

/* ============================================================
   User Management — calm pass (v2.16.346)
   Sentence-case role badges and group titles, calm filter tabs, shorter
   form copy with a one-line role hint.
   ============================================================ */
.role-badge { font-size: 11.5px; text-transform: none; letter-spacing: 0; padding: 2px 8px; border-radius: 999px; font-weight: 600; }
.um-group-lbl { font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text); }
body.theme-light .um-group-lbl { color: var(--text); }
.um-group-n { font-weight: 600; font-size: 11.5px; background: var(--surface-raised); border: 1px solid var(--line); color: var(--text-muted); }
.um-gcard { border-color: var(--line); box-shadow: none; }
.um-check label { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; font-size: 13px; line-height: 1.4; }
.um-check input { margin-top: 3px; }
.um-activity-title { font-size: 12.5px; font-weight: 600; color: var(--text-muted); text-transform: none; letter-spacing: 0; }
/* Phones: a person's row fits the screen — name + email, the role under it,
   and the ⋯ menu on the right; the sign-in column is dropped. */
@media (max-width: 640px) {
  .um-gtable { min-width: 0 !important; }
  .um-gtable td.um-col-login { display: none; }
  .um-gtable tr { height: auto; }
  .um-gtable td:first-child { width: auto; min-width: 0; }
  .um-gtable td:first-child .row-link, .um-gtable td:first-child .row-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
  .um-gtable td.um-col-role { width: 1%; white-space: nowrap; padding-left: 4px; padding-right: 4px; }
  .um-gtable td.um-col-act { width: 40px; padding-left: 0; }
  .um-gtable td.um-col-role .role-badge { font-size: 11px; padding: 1px 7px; }
  .um-gtable td.um-col-role .text-xs { display: none; }
  #usersTable.table-scroll table { min-width: 0; }
}
@media (max-width: 640px) { #usersTable.table-scroll { overflow-x: hidden; } }

/* Dispatch & Delivery uses the Order Line-up card; it has no ticket to open. */
.lu-card--static { cursor: default; }

/* System-wide: KPI labels and table headers in sentence case (v2.16.347),
   matching the calm pages. */
.kpi-label { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 500; color: var(--text-muted); }
table.data thead th { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; }
.ov-card-lbl, .pm-eyebrow { text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 600; }
.trash-top { display: flex; justify-content: flex-end; margin-top: 4px; }
.trash-list { padding: 0; }

/* Home: with nothing (or little) in "Do today" the slideshow was squeezed to
   the height of one row. It now keeps a real height, and the "All caught up"
   card grows to match with its message centred. (v2.16.350) */
.hb-deck .dsh-cp-stage { min-height: 280px; }
.hb-main .hb-list { display: flex; flex-direction: column; }
.hb-main .hb-list .hb-done { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; gap: 8px; }
@media (max-width: 1000px) {
  .hb-deck .dsh-cp-stage { min-height: 0; }
}

/* ============================================================
   Reports — Overview and directory (v2.16.352)
   ============================================================ */
.rp-crumb { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); cursor: pointer; }
.rp-crumb:hover { text-decoration: underline; }
body:not(.theme-light) .rp-crumb { color: var(--accent); }
.rp-desc--solo { margin: 0 0 14px; font-size: 13px; color: var(--text-muted); }
.rp-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 4px 0 22px; }
.rp-tile {
  display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 14px 16px; cursor: pointer; font: inherit;
  background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--text);
}
.rp-tile:hover { border-color: var(--brand); }
.rp-tile small { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.rp-tile b { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.rp-tile span { font-size: 12px; color: var(--text-muted); }
.rp-dir-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.rp-dir-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.rp-search { max-width: 280px; }
.rp-dir { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; align-items: start; }
.rp-dir-group { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--r-md); padding: 6px 0; }
.rp-dir-group h4 { margin: 0; padding: 8px 14px 6px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.rp-dir-item {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; cursor: pointer; font: inherit;
  padding: 9px 14px; background: transparent; border: 0; border-top: 1px solid var(--line); color: var(--text);
}
.rp-dir-item:hover { background: var(--surface); }
.rp-dir-item b { display: block; font-size: 13.5px; font-weight: 600; }
.rp-dir-item small { display: block; font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.rp-dir-item i { font-style: normal; color: var(--text-muted); font-size: 16px; }
.rp-dir-item:hover i, .rp-dir-item:hover b { color: var(--brand); }
body:not(.theme-light) .rp-dir-item:hover i, body:not(.theme-light) .rp-dir-item:hover b { color: var(--accent); }
@media (max-width: 1000px) { .rp-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .rp-dir { grid-template-columns: 1fr; } .rp-search { max-width: none; width: 100%; } }

/* ============================================================
   Night mode — soft black (v2.16.353)
   The night surfaces moved from maroon-charcoal to a neutral soft black
   (tokens at the top of this file). The sidebar joins them: it was a cream
   panel beside a dark page.
   ============================================================ */
body:not(.theme-light) .sidebar { background: #25252A !important; border-right: 1px solid #36363C; box-shadow: none; }
body:not(.theme-light) .sidebar .brand-name { color: #F2EEEF; }
body:not(.theme-light) .sidebar .brand-sub { color: #D6AC4E; }
body:not(.theme-light) .sidebar .brand::after { background: rgba(255, 255, 255, 0.08); }
body:not(.theme-light) .sidebar .nav-label { color: #8E8A8F; }
body:not(.theme-light) .sidebar .nav-link { color: #C9C4C8; }
body:not(.theme-light) .sidebar .nav-link .nav-icon { color: currentColor; fill: currentColor; opacity: 0.75; }
body:not(.theme-light) .sidebar .nav-link:hover { background: rgba(255, 255, 255, 0.06); color: #FFFFFF; }
body:not(.theme-light) .sidebar .nav-link:hover .nav-icon { color: currentColor; fill: currentColor; opacity: 1; }
body:not(.theme-light) .sidebar .nav-link.active { background: rgba(214, 172, 78, 0.14); color: #F0D08A; border-color: rgba(214, 172, 78, 0.35); }
body:not(.theme-light) .sidebar .nav-link.active .nav-icon { color: #E6B455; fill: #E6B455; opacity: 1; }
body:not(.theme-light) .sidebar .nav-link.active .note-badge { background: #E6B455; color: #1A1A1D; }
body:not(.theme-light) .sidebar .nav-more-toggle:hover { color: #FFFFFF; }
body:not(.theme-light) .sidebar .sidebar-footer { border-top: 1px solid #36363C; }
body:not(.theme-light) .sidebar .sidebar-version { color: #7E7A80; }
body:not(.theme-light) .sidebar .nav-label:focus-visible { outline-color: rgba(214, 172, 78, 0.5); }

/* ============================================================
   Account, search and bell in the sidebar (v2.16.355)
   Desktop: search + bell beside the brand, the account chip pinned at the
   bottom of the sidebar. The top bar keeps only the Back arrow and goes
   borderless. Phones keep everything in the top bar.
   ============================================================ */
.sidebar-tools { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; padding: 0 12px 10px; }
.sidebar-tools:empty, .sidebar-account:empty { display: none; }
.sidebar-tools .icon-btn { height: 34px; width: 34px; border-radius: 8px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.8); }
.sidebar-tools .icon-btn svg { width: 17px; height: 17px; fill: currentColor; }
.sidebar-tools .icon-btn:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
/* The search button becomes a wide "Search" field; the bell stays a square. */
.sidebar-tools #globalSearchBtn { flex: 1 1 auto; width: auto; justify-content: flex-start; gap: 8px; padding: 0 10px; display: flex; align-items: center; font: inherit; font-size: 13px; }
.sidebar-tools #globalSearchBtn::after { content: "Search"; color: rgba(255, 255, 255, 0.6); }
.sidebar-account { flex: 0 0 auto; padding: 10px 12px 12px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.sidebar-account .user-chip { width: 100%; padding: 6px 8px 6px 6px; background: rgba(255, 255, 255, 0.06); border-color: transparent; }
.sidebar-account .user-chip:hover, .sidebar-account .user-chip.user-chip--open { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.14); }
.sidebar-account .user-meta { min-width: 0; flex: 1 1 auto; }
.sidebar-account .user-name { color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-account .user-role { color: rgba(255, 255, 255, 0.7); }
.sidebar-account .user-chip-caret { margin-left: auto; color: rgba(255, 255, 255, 0.7); transform: rotate(180deg); }
.sidebar-account .user-chip--open .user-chip-caret { transform: rotate(0deg); }
body.controls-in-sidebar .topbar { background: transparent; border-bottom-color: transparent; height: 48px; }
body.controls-in-sidebar .topbar:not(:has(#smartBackBtn:not([hidden]))) { height: 12px; }

/* Stock Request: the partner's own entries are read-only for staff (v2.16.356). */
.sr-lock-note { display: flex; align-items: center; gap: 6px; margin: -4px 0 10px; font-size: 12.5px; color: var(--text-muted); }
.is-partner-locked #srItemId, .is-partner-locked #srWv, .is-partner-locked #srQty, .is-partner-locked #srNotes { color: var(--text-muted); cursor: not-allowed; opacity: 1; }
.is-partner-locked #srItemId { -webkit-text-fill-color: var(--text-muted); }

/* ============================================================
   Messages — inbox page and conversation window (v2.16.357)
   ============================================================ */
.mx-wrap { overflow: hidden; }
.mx-list { display: flex; flex-direction: column; }
.mx-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; background: transparent; border: 0; border-top: 1px solid var(--line); text-align: left; font: inherit; color: var(--text); cursor: pointer; }
.mx-row:first-child { border-top: 0; }
.mx-row:hover { background: var(--surface); }
.mx-avatar { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: var(--brand); background: rgba(124, 28, 38, 0.1); }
body:not(.theme-light) .mx-avatar { color: var(--accent); background: rgba(230, 180, 85, 0.14); }
.mx-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mx-name { font-size: 14px; font-weight: 600; }
.mx-preview { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mx-row.is-unread .mx-preview { color: var(--text); font-weight: 600; }
.mx-side { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.mx-side small { font-size: 11.5px; color: var(--text-muted); }
.mx-unread { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 11.5px; font-weight: 700; display: grid; place-items: center; }
body:not(.theme-light) .mx-unread { background: var(--accent); color: #2a0a10; }
.mx-empty { padding: 24px; text-align: center; color: var(--text-muted); font-size: 13px; }
#navMsgBadge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; background: #E6B455; color: #2a0a10; }
#navMsgBadge[hidden] { display: none; }

.msg-wrap { display: flex; flex-direction: column; gap: 10px; }
.msg-wrap .msg-thread { display: flex; flex-direction: column; gap: 6px; height: min(52vh, 460px); overflow-y: auto; padding: 4px 2px; background: transparent; border: 0; }
.msg-day { align-self: center; font-size: 11.5px; color: var(--text-muted); margin: 8px 0 2px; }
.msg-empty { margin: auto; color: var(--text-muted); font-size: 13px; }
.msg-sys { align-self: center; max-width: 86%; text-align: center; font-size: 12px; color: var(--text-muted); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.msg-sys small { display: block; font-size: 10.5px; opacity: 0.8; margin-top: 2px; }
.msg-row { display: flex; align-items: flex-end; gap: 6px; max-width: 82%; }
.msg-row.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg-row.other { align-self: flex-start; }
.msg-wrap .msg-bubble { position: relative; max-width: none; padding: 8px 12px 6px; border-radius: 14px; font-size: 13.5px; line-height: 1.4; box-shadow: none; }
.msg-wrap .msg-bubble.mine { background: var(--brand); color: #fff; border: 0; border-bottom-right-radius: 4px; }
body:not(.theme-light) .msg-wrap .msg-bubble.mine { background: #5b4a22; color: #fff; }
.msg-wrap .msg-bubble.other { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg-wrap .msg-meta { font-size: 11px; font-weight: 600; opacity: 0.75; margin-bottom: 2px; }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-foot { display: flex; align-items: center; justify-content: flex-end; gap: 5px; font-size: 10.5px; opacity: 0.75; margin-top: 2px; }
.msg-tick { letter-spacing: -2px; font-weight: 700; }
.msg-tick.is-seen { color: #7FD4FF; opacity: 1; }
.msg-liked { position: absolute; bottom: -9px; right: 8px; font-size: 11px; padding: 0 5px; border-radius: 999px; background: var(--surface-raised); border: 1px solid var(--line); color: var(--text); line-height: 16px; }
.msg-row.mine .msg-liked { right: auto; left: 8px; }
.msg-like { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; border: 1px solid transparent; background: transparent; cursor: pointer; font-size: 13px; opacity: 0; filter: grayscale(1); transition: opacity .12s ease; }
.msg-row:hover .msg-like, .msg-like:focus-visible, .msg-like.is-on { opacity: 1; }
.msg-like.is-on { filter: none; }
.msg-like:hover { background: var(--surface); border-color: var(--line); }
.msg-wrap .msg-composer { display: flex; gap: 8px; align-items: flex-end; }
.msg-wrap .msg-composer textarea { flex: 1 1 auto; resize: none; min-height: 40px; max-height: 120px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; }
.msg-wrap .msg-composer textarea:focus { outline: none; border-color: var(--brand); }
@media (hover: none) { .msg-like { opacity: 0.6; } }

/* Payment accounts — partner-facing list and the Settings editor (v2.16.357) */
.pay-accts { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-raised); padding: 10px 12px; margin: 0 0 10px; }
.pay-accts-title { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.pay-acct { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 2px 10px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; }
.pay-acct:first-of-type { border-top: 0; }
.pay-acct b { font-weight: 600; }
.pay-acct-num { font-weight: 600; }
.pay-acct small { grid-column: 1 / -1; grid-row: 2; color: var(--text-muted); font-size: 12px; }
.pay-acct-copy { font: inherit; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--border); background: transparent; color: var(--text); cursor: pointer; }
.pay-acct-copy:hover { border-color: var(--brand); color: var(--brand); }
.pa-editor { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); }
.pa-row { display: grid; grid-template-columns: 1.1fr 1.1fr 1.1fr auto; gap: 8px; margin-bottom: 8px; }
.pa-row input { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; }
@media (max-width: 640px) { .pa-row { grid-template-columns: 1fr; } }
.sr-next-hint--pay { margin-top: 2px; }
.sr-link-btn { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--brand); cursor: pointer; text-decoration: underline; }
body:not(.theme-light) .sr-link-btn { color: var(--accent); }

/* Partner dashboard — simple (v2.16.357) */
.pd .hb-list { margin-bottom: var(--sp-3); }
.pd .hb-list-hd { display: flex; align-items: center; justify-content: space-between; }
.pd-all { background: none; border: 0; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--brand); cursor: pointer; padding: 0 16px 0 0; }
body:not(.theme-light) .pd-all { color: var(--accent); }
.pd .hb-row .badge { flex: 0 0 auto; }
.login-terms { align-items: flex-start; }
.login-terms a { color: inherit; font-weight: 600; text-decoration: underline; }
.terms-text p { margin: 0 0 10px; font-size: 13.5px; line-height: 1.5; }

/* ---- v2.16.358: bell dot, partner menu, help ---- */
/* A plain red circle on the bell, shown only while something is unread. */
.badge-dot {
  top: 5px; right: 5px; width: 10px; height: 10px;
  background: #E5484D; border: 2px solid var(--surface, #fff); box-sizing: border-box;
}
.sidebar .badge-dot { border-color: #4a0f18; }
body:not(.theme-light) .sidebar .badge-dot { border-color: #25252A; }
.badge-dot[hidden] { display: none; }

/* Partners have five pages: one flat list, no groups to open or close. */
body.role-partner .sidebar .nav-label { display: none; }
body.role-partner .sidebar .nav-group-items,
body.role-partner .sidebar .nav-more-items { max-height: none !important; overflow: visible; }
body.role-partner .sidebar .nav-section { margin: 0; padding: 0; border: 0; }
body.role-partner .sidebar .nav-link { padding-top: 11px; padding-bottom: 11px; font-size: 14px; }

/* Help */
.help-search {
  width: 100%; box-sizing: border-box; margin: 0 0 14px; padding: 10px 12px;
  border: 1px solid var(--line, var(--border)); border-radius: var(--r-md, 10px);
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px;
}
.help-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.help-steps li {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px;
  border: 1px solid var(--line, var(--border)); border-radius: var(--r-md, 10px); background: var(--surface);
}
.help-step-n {
  flex: 0 0 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-size: 13px; font-weight: 700;
}
body:not(.theme-light) .help-step-n { background: var(--accent); color: #1A1A1D; }
.help-steps b { display: block; font-size: 14px; color: var(--text); }
.help-steps li span:not(.help-step-n) { font-size: 13px; color: var(--text-muted); }

/* ---- v2.16.362: calmer sidebar ---- */
/* Group names are plain captions now: nothing to click, nothing to fold. */
.sidebar .nav-label--plain {
  display: block; cursor: default; pointer-events: none;
  padding: 0 14px; margin: 0 0 4px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  opacity: .55;
}
.sidebar .nav-section[data-section="orders"],
.sidebar .nav-section[data-section="stock"],
.sidebar .nav-section--more { margin-top: 18px; padding-top: 0; border-top: 0; }
.sidebar .nav-section[data-section="orders"] .nav-group-items,
.sidebar .nav-section[data-section="stock"] .nav-group-items { max-height: none; overflow: visible; }
/* Softer icons so the page name is what the eye lands on. */
.sidebar .nav-link .nav-icon { opacity: .6; }
.sidebar .nav-link:hover .nav-icon,
.sidebar .nav-link.active .nav-icon { opacity: 1; }
/* The count sits inside the row, at its right edge, instead of floating on the corner. */
body:not(.sidebar-collapsed) .sidebar .nav-link .note-badge {
  position: static; margin-left: auto; flex: 0 0 auto;
  min-width: 20px; height: 20px; border-radius: 10px; padding: 0 6px; font-size: 11px;
}
body:not(.sidebar-collapsed) .sidebar .nav-link .note-badge[hidden] { display: none; }
body.sidebar-collapsed .sidebar .nav-label--plain { display: none; }

/* ---- v2.16.363: sidebar folds to icons ---- */
.sidebar { overflow: visible; }
.sidebar-collapse-btn {
  top: 26px; right: -12px; width: 24px; height: 24px;
  background: var(--surface, #fff); border: 1px solid var(--line, var(--border)); color: var(--text-muted);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
}
.sidebar-collapse-btn:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
body:not(.theme-light) .sidebar-collapse-btn:hover { background: var(--accent); border-color: var(--accent); color: #1A1A1D; }
@media (max-width: 760px) { .sidebar-collapse-btn { display: none; } }
@media (min-width: 761px) {
  body.sidebar-collapsed .sidebar .nav { padding-left: 8px; padding-right: 8px; overflow-x: hidden; }
  body.sidebar-collapsed .sidebar .nav-link { border-radius: 10px; padding: 11px 0; margin: 1px 0; }
  body.sidebar-collapsed .sidebar .nav-link .nav-icon { opacity: .8; margin: 0; }
  /* A count becomes a small dot on the icon's corner. */
  body.sidebar-collapsed .sidebar .nav-link .note-badge {
    position: absolute; top: 5px; right: 7px; min-width: 9px; width: 9px; height: 9px; padding: 0;
    font-size: 0; border-radius: 50%; background: #E5484D;
  }
  body.sidebar-collapsed .sidebar .nav-link .note-badge[hidden] { display: none; }
  /* Groups become a thin rule; "More" becomes a three-dot button. */
  body.sidebar-collapsed .sidebar .nav-section[data-section="orders"],
  body.sidebar-collapsed .sidebar .nav-section[data-section="stock"],
  body.sidebar-collapsed .sidebar .nav-section--more {
    margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, .12);
  }
  body.sidebar-collapsed .sidebar .nav-more-toggle {
    display: flex; justify-content: center; align-items: center; width: 100%;
    padding: 8px 0; font-size: 0; opacity: .8;
  }
  body.sidebar-collapsed .sidebar .nav-more-toggle > * { display: none; }
  body.sidebar-collapsed .sidebar .nav-more-toggle::before { content: "•••"; font-size: 13px; letter-spacing: 2px; color: rgba(255, 255, 255, .8); }
  body.sidebar-collapsed .sidebar-tools, body.sidebar-collapsed .sidebar-account { display: none; }
  /* The tooltip must escape the scrolling list. */
  body.sidebar-collapsed .sidebar .nav-link::after { position: fixed; left: 68px; top: auto; transform: none; margin-top: -4px; }
}

/* ---- v2.16.364: icon rail for partner accounts too ---- */
@media (min-width: 761px) {
  body.role-partner.sidebar-collapsed .sidebar .nav-link { font-size: 0; padding: 11px 0; }
  /* A partner's list is always open, so there is no "More" button to show. */
  body.role-partner.sidebar-collapsed .sidebar .nav-more-toggle { display: none; }
  body.role-partner.sidebar-collapsed .sidebar .nav-section,
  body.role-partner.sidebar-collapsed .sidebar .nav-section--more { margin-top: 0; padding-top: 0; border-top: 0; }
}

/* ---- v2.16.365: Dashboard lives inside Home for admins ---- */
body.home-merged .sidebar .nav-link[data-route="dashboard"] { display: none; }
.home-cap {
  margin: 22px 2px 10px; font-size: 11px; font-weight: 600; letter-spacing: .09em;
  text-transform: uppercase; color: var(--text-muted);
}
[data-home-stats] { margin-bottom: 14px; }
[data-home-stats] .dsh-stats { margin: 0; }
.home-overview .dash-view { padding: 0; margin: 0; }
.home-overview .dash-view > :first-child { margin-top: 0; }
.home-overview .dash-view > :last-child { margin-bottom: 0; }
.home-stats.dash-view { padding: 0; margin: 0 0 14px; max-width: none; }

/* ---- v2.16.367: the fold arrow sits inside the sidebar ---- */
.sidebar .sidebar-collapse-btn {
  top: 20px; right: 12px; width: 28px; height: 28px; border-radius: 8px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1);
  color: rgba(255, 255, 255, .75); box-shadow: none;
}
.sidebar .sidebar-collapse-btn svg { width: 16px; height: 16px; }
.sidebar .sidebar-collapse-btn:hover,
body:not(.theme-light) .sidebar .sidebar-collapse-btn:hover {
  background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .2); color: #fff;
}
/* Keep the company name clear of the button. */
body:not(.sidebar-collapsed) .sidebar .brand { padding-right: 48px; }
@media (min-width: 761px) {
  /* Folded: the arrow goes under the logo, centred in the rail. */
  body.sidebar-collapsed .sidebar .sidebar-collapse-btn { top: 64px; right: 16px; }
  body.sidebar-collapsed .sidebar .nav { margin-top: 38px; }
}
