/* =============================================
   Tikvah — Light Operator
   Near-white canvas, electric indigo, Geist + JetBrains Mono.
   Technical light aesthetic (Linear light / Vercel / Stripe).
   Class names preserved for back-compat across all admin templates.
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Geist:wght@300;400;450;500;600;700&display=swap');

:root {
  color-scheme: light;

  /* Surface — layered neutral light */
  --bg: #FAFAFA;              /* app canvas — subtle cool off-white */
  --bg-elevated: #F4F4F5;     /* hover / recessed rows */
  --card: #FFFFFF;            /* cards + inputs */
  --card-elev: #FFFFFF;       /* popovers / modals */

  /* Ink — near-black on near-white */
  --text: #0A0A0A;
  --text-secondary: #404040;
  --text-muted: #5E5E5E;   /* 5.77:1 on #F7F7F8 sidebar, 6.89:1 on #FAFAFA body — passes WCAG AA */
  --text-faint: #A3A3A3;   /* Decorative only: placeholders, disabled states */

  /* Borders — black-alpha, precise hairlines */
  --border-hairline: rgba(10, 10, 10, 0.06);
  --border: rgba(10, 10, 10, 0.10);
  --border-strong: rgba(10, 10, 10, 0.18);

  /* Brand — electric indigo (kept from dark, deeper hue for light-bg contrast) */
  --primary: #6366F1;
  --primary-dark: #4F46E5;
  --primary-light: rgba(99, 102, 241, 0.12);
  --primary-tint: rgba(99, 102, 241, 0.06);

  /* Accent = brand */
  --accent: #6366F1;
  --accent-light: rgba(99, 102, 241, 0.10);

  /* Table zebra striping — light purple even rows (Naomi 2026-06-07) */
  --row-stripe: rgba(124, 58, 237, 0.05);

  /* Semantic — deeper saturation for light-bg readability, soft tint bgs */
  --red: #DC2626;
  --red-light: rgba(220, 38, 38, 0.08);
  --amber: #D97706;
  --amber-light: rgba(217, 119, 6, 0.10);
  --emerald: #059669;
  --emerald-light: rgba(5, 150, 105, 0.10);
  --emerald-deep: #065F46;
  --blue: #2563EB;
  --blue-light: rgba(37, 99, 235, 0.08);
  --purple: #7C3AED;

  /* Legacy aliases */
  --cyan: var(--primary);
  --dark: #0A0A0A;

  /* Shadow — soft lift for light */
  --shadow: 0 1px 2px rgba(10, 10, 10, 0.04);
  --shadow-md: 0 2px 8px rgba(10, 10, 10, 0.06), 0 1px 2px rgba(10, 10, 10, 0.04);
  --shadow-lg: 0 12px 32px rgba(10, 10, 10, 0.10), 0 4px 10px rgba(10, 10, 10, 0.04);

  /* Radius — tight, technical */
  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 8px;

  /* Fonts — no serif. Geist everywhere + JetBrains Mono for data */
  --font-sans: 'Geist', 'Geist Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Geist', 'Geist Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Sidebar — slightly recessed neutral */
  --surface-ink: #F7F7F8;
  --surface-ink-elev: #F1F1F3;
  --ink-on-ink: var(--text);
  --ink-on-ink-muted: var(--text-muted);
  --ink-on-ink-faint: var(--text-faint);
  --ink-on-ink-hairline: var(--border-hairline);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 0.95, 0.32, 1);
  --dur-fast: 120ms;
  --dur: 180ms;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* The [hidden] attribute must ALWAYS hide. The UA's [hidden]{display:none}
   loses to any author display rule (.btn{display:inline-flex},
   .badge{display:inline-block}, …), so `el.hidden = true` silently did
   nothing on styled elements — Naomi's "4 go/no-go buttons at once"
   (50ec5703) was exactly this, and .row-menu / .client-picker-menu /
   onboarding chips each spot-fixed the same trap before. Pin it globally;
   JS that reveals via `el.hidden = false` removes the attribute, so this
   rule can never hide something on purpose-shown. */
[hidden] { display: none !important; }

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  font-weight: 400;
  letter-spacing: -0.005em;
  /* Soft indigo radial anchors — barely-visible, adds depth */
  background-image:
    radial-gradient(1100px 600px at 88% -8%, rgba(99, 102, 241, 0.05), transparent 60%),
    radial-gradient(900px 500px at -8% 108%, rgba(99, 102, 241, 0.035), transparent 60%);
  background-attachment: fixed;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.4;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0, 0 0 0 0 0, 0 0 0 0 0, 0 0 0 0.035 0'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.022em;
  line-height: 1.12;
}

h1 { font-size: 2.25em; font-weight: 600; letter-spacing: -0.028em; }
h2 { font-size: 1.6em;  font-weight: 600; letter-spacing: -0.024em; }
h3 { font-size: 1.2em;  font-weight: 600; letter-spacing: -0.018em; }
h4 { font-size: 1.0em;  font-weight: 600; letter-spacing: -0.012em; }

strong { font-weight: 600; color: var(--text); }

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s;
}
a:hover { color: var(--primary-dark); }

code, pre, .mono { font-family: var(--font-mono); }

.num, .tabular { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* =============================================
   TOP NAV — frosted dark glass
   ============================================= */
.topbar {
  background: var(--topbar-bg, rgba(250, 250, 250, 0.78));
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  color: var(--text);
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border-hairline);
}
html[data-theme="dark"] .topbar { background: rgba(15, 15, 18, 0.78); }

.topbar-logo {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.02em;
  margin-right: 28px;
  color: var(--text);
  white-space: nowrap;
}
.topbar-logo span {
  color: var(--primary);
  font-weight: 600;
  margin-left: 2px;
}

.topbar-nav {
  display: flex;
  gap: 2px;
  list-style: none;
  align-items: center;
}
.topbar-nav a {
  color: var(--text-muted);
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  display: block;
  border-radius: 5px;
  position: relative;
  transition: color var(--dur-fast), background var(--dur-fast);
}
.topbar-nav a:hover {
  color: var(--text);
  background: var(--bg-elevated);
}
.topbar-nav a.active {
  color: var(--text);
  background: var(--bg-elevated);
}
.topbar-nav a.active::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 1px;
  background: var(--accent);
}

.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--card);
  min-width: 200px;
  list-style: none;
  padding: 4px;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 110;
}
.nav-dropdown:hover > .nav-dropdown-menu,
.nav-dropdown:focus-within > .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
  padding: 8px 12px;
  white-space: nowrap;
  border-radius: 4px;
}
.nav-dropdown-menu a.active::after { display: none; }
.nav-dropdown-menu a.active { background: var(--bg-elevated); }

.topbar-user {
  margin-left: auto;
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-user form button,
.topbar-user > button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-family: inherit;
  transition: color var(--dur-fast);
}
.topbar-user form button:hover,
.topbar-user > button:hover { color: var(--text); }

/* =============================================
   PAGE LAYOUT
   ============================================= */
.page {
  /* Full content width (Naomi 2026-06-05): the old 1240px cap left a wide empty
     margin on big monitors and forced wide data tables (Networking, Contacts)
     to scroll inside their card — a boxed "frame" that cut off the row actions.
     The page is already offset by the sidebar (margin-left below); let it fill
     the rest of the viewport so wide tables fit. */
  max-width: none;
  margin: 0 auto;
  padding: 32px 28px 80px;
}

.page-header { margin-bottom: 28px; }

/* Row action overflow menu (Rami 2026-06-05) — one status-aware primary action
   inline + a ⋯ button holding the rest, so dense tables (estimates / leads /
   networking / contacts) stay clean and never overflow / cut off their actions. */
.row-actions { position: relative; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.row-menu-btn { font-weight: 700; line-height: 1; padding-left: 9px; padding-right: 9px; }
.row-menu {
  /* position:fixed (was absolute) so the menu escapes any clipping ancestor —
     the section card-bodies use overflow-x:auto for horizontal scroll on wide
     tables, and that was clipping the dropdown vertically. Top/right are set
     inline by the toggler from the button's viewport rect. (Yael 2026-07-09) */
  position: fixed; z-index: 40;
  min-width: 170px; padding: 4px; text-align: left;
  background: #fff; border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.row-menu[hidden] { display: none; }
.row-menu-item {
  display: block; width: 100%; text-align: left; padding: 7px 10px;
  background: none; border: 0; border-radius: 6px; cursor: pointer;
  font-size: 0.875rem; color: var(--text, #1e293b);
}
.row-menu-item:hover { background: var(--bg-elev, #f1f5f9); }
.row-menu-danger { color: #dc2626; }
.row-menu-danger:hover { background: #fef2f2; }

.page-title {
  font-family: var(--font-display);
  font-size: 1.85em;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.028em;
  line-height: 1.1;
}
.page-title em { font-style: normal; color: var(--primary); }
.page-subtitle {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 6px;
  letter-spacing: -0.005em;
  font-weight: 450;
}

/* =============================================
   CARDS
   ============================================= */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.2s;
}
.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.card-body { padding: 18px; }

/* =============================================
   KPI CARDS
   ============================================= */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}
.kpi-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: 2em;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.kpi-label {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}
.kpi-trend {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  margin-top: 6px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.kpi-trend.up { color: var(--emerald); }
.kpi-trend.down { color: var(--red); }

/* =============================================
   ALERTS
   ============================================= */
.alert {
  padding: 11px 14px 11px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.45;
}
.alert-red   { background: var(--red-light);     border-color: rgba(220, 38, 38, 0.22); color: #991B1B; border-left: 3px solid var(--red); }
.alert-amber { background: var(--amber-light);   border-color: rgba(217, 119, 6, 0.22); color: #92400E; border-left: 3px solid var(--amber); }
.alert-blue  { background: var(--blue-light);    border-color: rgba(37, 99, 235, 0.22); color: #1E40AF; border-left: 3px solid var(--blue); }
.alert-green { background: var(--emerald-light); border-color: rgba(5, 150, 105, 0.22); color: #065F46; border-left: 3px solid var(--emerald); }

/* MFA rollout banner — yellow-amber, sits above every admin page until
   the user enrolls. Dismissible per-session via the × button. */
.mfa-setup-banner {
  background: var(--amber-light);
  border: 1px solid rgba(217, 119, 6, 0.22);
  border-left: 3px solid var(--amber);
  color: #92400E;
  padding: 10px 14px;
  border-radius: var(--radius);
  margin: 12px 0;
  font-size: 0.9rem;
}
.mfa-setup-banner strong { font-weight: 600; }
.mfa-setup-banner__cta { margin-left: 8px; }
.mfa-setup-banner__close {
  background: none;
  border: none;
  cursor: pointer;
  float: right;
  font-size: 18px;
  line-height: 1;
}
.mfa-announce-title { margin: 0; }

/* TOTP-challenge divider between passkey button and code form. */
.mfa-divider {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85em;
  margin: 14px 0;
}

/* =============================================
   TABLES
   ============================================= */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85rem;
  background: var(--card);
  font-variant-numeric: tabular-nums;
}
.data-table th {
  background: var(--bg-elevated);
  padding: 10px 14px;
  text-align: left;
  font-family: var(--font-sans);
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-hairline);
  vertical-align: middle;
  color: var(--text);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:nth-child(even) td { background: var(--row-stripe); }
.data-table tr:hover td { background: var(--bg-elevated); }
.data-table tr { cursor: pointer; transition: background 0.1s; }

/* =============================================
   BADGES
   ============================================= */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  font-family: var(--font-sans);
}
.badge-green       { background: var(--emerald-light); color: #065F46; border-color: rgba(5, 150, 105, 0.22); }
.badge-amber       { background: var(--amber-light);   color: #92400E; border-color: rgba(217, 119, 6, 0.22); }
.badge-red         { background: var(--red-light);     color: #991B1B; border-color: rgba(220, 38, 38, 0.22); }
.badge-blue        { background: var(--blue-light);    color: #1E40AF; border-color: rgba(37, 99, 235, 0.22); }
.badge-purple      { background: rgba(124, 58, 237, 0.08); color: #5B21B6; border-color: rgba(124, 58, 237, 0.22); }
.badge-gray        { background: var(--bg-elevated);        color: var(--text-secondary); border-color: var(--border); }
.badge-yellow      { background: rgba(250, 204, 21, 0.16);  color: #854D0E; border-color: rgba(202, 138, 4, 0.30); }
.badge-orange      { background: rgba(251, 146, 60, 0.16);  color: #9A3412; border-color: rgba(234, 88, 12, 0.30); }
/* dark-green = "accepted / paid" — distinct from badge-green ("sent / done"),
   matching Chilik's light-green vs dark-green colour scheme. */
.badge-darkgreen   { background: rgba(5, 150, 105, 0.20);   color: #064E3B; border-color: rgba(5, 150, 105, 0.40); }
.badge-dark-green  { background: var(--primary);            color: #FFFFFF; border-color: var(--primary-dark); }
.badge-light-blue  { background: var(--primary-tint);       color: var(--primary-dark); border-color: var(--primary-light); }
.badge-cyan        { background: var(--primary-light);      color: var(--primary-dark); border-color: rgba(99, 102, 241, 0.28); }

/* =============================================
   PROGRESS BAR
   ============================================= */
.progress-bar {
  background: var(--border-hairline);
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
}
.progress-bar .fill {
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
  transition: width 0.5s ease;
}

.progress-row { margin-bottom: 14px; }
.progress-row .label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  font-weight: 500;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* =============================================
   TIME CLOCK CARD (My Day)
   ============================================= */
.time-clock-card {
  margin: 10px 0 14px 0;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.time-clock-state {
  display: flex;
  align-items: center;
  gap: 14px;
}
.time-clock-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  display: inline-block;
}
.time-clock-hours-line { color: var(--text-muted); }

/* =============================================
   CUSTOMER MULTI-SELECT PICKER (topbar)
   ============================================= */
.client-picker { position: relative; }
.client-picker-btn {
  max-width: 280px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  /* Naomi's key menu — make it read as THE customer control, not a plain field. */
  border: 1.5px solid var(--primary);
  background: var(--bg-elevated);
  color: var(--text);
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
}
.client-picker-btn:hover { background: var(--card); }
.client-picker-icon { color: var(--primary); flex: none; }
.client-picker-prefix {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
  flex: none;
}
#client-picker-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  flex: 1 1 auto;
}
.client-picker-caret { color: var(--primary); flex: none; }
/* When a single customer is in scope, the name is a one-click link back to
   their page — hint it on hover. The caret keeps opening the switcher. */
.client-picker.cp-home .client-picker-btn:hover #client-picker-label { text-decoration: underline; }
.client-picker.cp-home #client-picker-label { cursor: pointer; }
/* Single-visible-client users have nothing to switch to — drop the caret. */
.client-picker.cp-locked .client-picker-caret { display: none; }
.client-picker-foot .client-picker-manage {
  font-size: 0.8rem;
  color: var(--primary);
  text-decoration: none;
  align-self: center;
}
.client-picker-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 260px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 300;
  padding: 6px;
}
.client-picker-menu[hidden] { display: none; }
.client-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.client-picker-row:hover { background: var(--bg-elevated); }
.client-picker-sep { height: 1px; background: var(--border); margin: 4px 0; }
.client-picker-list { display: flex; flex-direction: column; }
.client-picker-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 4px 2px;
  position: sticky;
  bottom: 0;
  background: var(--card);
}

/* =============================================
   TABS
   ============================================= */
.view-segment {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-muted, #f5f5f7);
  border: 1px solid var(--border);
  border-radius: 999px;
  margin: 0 0 14px 0;
}
.view-segment button {
  background: transparent;
  border: 0;
  font-family: inherit;
  padding: 7px 18px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  cursor: pointer;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
  letter-spacing: -0.005em;
}
.view-segment button:hover { color: var(--text); }
.view-segment button[aria-pressed="true"] {
  background: var(--surface, #ffffff);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.view-quick-links {
  display: flex;
  gap: 8px;
  margin: 14px 0 18px 0;
  flex-wrap: wrap;
}
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
  overflow-x: auto;
}
.tab {
  /* Button reset — .tab is now a <button role="tab">. */
  background: transparent;
  border: 0;
  border-bottom: 1px solid transparent;
  font-family: inherit;
  padding: 10px 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: -1px;
  white-space: nowrap;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  letter-spacing: -0.005em;
}
.tab:hover { color: var(--text); }
.tab.active,
.tab[aria-selected="true"] {
  color: var(--text);
  border-bottom-color: var(--primary);
  font-weight: 600;
}
.tab:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  border-radius: var(--radius-sm);
}

/* =============================================
   ACCESSIBILITY — skip link + focus-visible baseline
   ============================================= */
.skip-to-content {
  position: absolute;
  left: 8px;
  top: -40px;
  background: var(--primary);
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 9999;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-to-content:focus {
  top: 8px;
  outline: 2px solid var(--text);
  outline-offset: 2px;
}
/* Visually hide text but keep it available to screen readers — for
   "(required)" label supplements, icon-only button fallback text, etc. */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
/* Interactive surfaces that are not native buttons/links need an explicit
   focus-visible style for keyboard users. */
.sidebar-item:focus-visible,
.queue-row:focus-visible,
.kpi-card:focus-visible,
.ar-cell:focus-visible,
.stage-step:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
#main-content:focus { outline: none; }

/* =============================================
   FORMS
   ============================================= */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-weight: 500;
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-bottom: 5px;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--card);
  transition: border-color 0.15s, box-shadow 0.15s;
  letter-spacing: -0.005em;
}
.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-faint); }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}
.form-textarea { resize: vertical; min-height: 80px; }
/* Inline email/phone format validation (Rami 2026-06-08). */
.form-input.is-invalid, input.is-invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-light);
}
.field-error {
  display: block;
  margin-top: 4px;
  color: var(--red);
  font-size: 0.78rem;
}
/* Two-tier phone check — amber "suspect" hint, non-blocking (Rami 2026-06-10). */
.form-input.is-suspect, input.is-suspect {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-light);
}
.field-error.field-warn { color: var(--amber); }
/* Compact numeric input for breakdown BOM rows (avoids inline style). */
.bd-num-input { padding: 4px; width: 80px; }
/* Category-group caret in the materials table. */
.bd-cat-caret { font-size: 1.15em; margin-right: 4px; }
/* Per-client settings card (class-only — detail.html is at its inline-style cap). */
.cs-card { margin-top: 20px; }
.cs-grid { gap: 16px; max-width: 520px; }
.cs-actions { display: flex; gap: 8px; margin-top: 8px; }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  font-family: var(--font-sans);
  letter-spacing: -0.005em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.12s, border-color 0.12s, color 0.12s, transform 0.05s;
  white-space: nowrap;
  line-height: 1.2;
}
.btn:active { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* Loading state: keep the color so the user can see what they clicked,
   show an inline spinner, and use cursor:progress so it's obviously
   "working", not "broken". Wins over the .btn:disabled grey treatment
   even when the button has `disabled` set (which we still set to block
   double-submits). */
.btn.is-loading,
.btn.is-loading:disabled { opacity: 1; cursor: progress; }
.btn.is-loading::before {
  content: "";
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  margin-right: 0.5em;
  vertical-align: -0.12em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

.btn-primary {
  background: var(--primary-dark);   /* #4F46E5 — 6.55:1 on white, passes WCAG AA */
  color: #FFFFFF;
  border-color: var(--primary-dark);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 2px 6px rgba(99, 102, 241, 0.28);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.14) inset, 0 4px 12px rgba(99, 102, 241, 0.36); }

.btn-secondary {
  background: var(--card);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--card-elev); border-color: var(--border-strong); }

/* Navigation buttons — take you to another page (back to a list, open a
   different screen), as opposed to act-here buttons. Indigo tint sets them
   apart from secondary actions (Rami 2026-06-10). */
.btn-nav {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: rgba(99, 102, 241, 0.28);
}
.btn-nav:hover { background: rgba(99, 102, 241, 0.18); border-color: var(--primary); color: var(--primary-dark); }

.btn-danger {
  background: var(--red);
  color: #FFFFFF;
  border-color: var(--red);
}
.btn-danger:hover { background: #B91C1C; border-color: #B91C1C; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--bg-elevated); color: var(--text); }

.btn-sm { padding: 5px 10px; font-size: 0.76rem; border-radius: var(--radius-sm); }
.btn-xs { padding: 3px 8px; font-size: 0.72rem; border-radius: var(--radius-sm); }

/* =============================================
   GRID LAYOUTS
   ============================================= */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

/* =============================================
   STAT BOX
   ============================================= */
.stat-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.stat-box .value {
  font-family: var(--font-mono);
  font-size: 1.55em;
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.stat-box .label {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

/* =============================================
   BREADCRUMB
   ============================================= */
.breadcrumb {
  padding: 10px 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  font-family: var(--font-sans);
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb strong { color: var(--text); font-weight: 500; }

/* =============================================
   SCORE BADGES (Well Visit)
   ============================================= */
.score-4 { background: var(--emerald-light); color: #065F46; }
.score-3 { background: var(--amber-light);   color: #92400E; }
.score-2 { background: rgba(234, 88, 12, 0.10); color: #9A3412; }
.score-1 { background: var(--red-light);     color: #991B1B; }
.score-0 { background: var(--bg-elevated); color: var(--text-muted); }

/* =============================================
   AGING BAR (Collections)
   ============================================= */
.aging-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-radius: var(--radius);
  overflow: hidden;
  text-align: center;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}
.aging-bar > div {
  padding: 14px 12px;
  color: var(--text);
  font-family: var(--font-sans);
  border-right: 1px solid var(--border-hairline);
}
.aging-bar > div:last-child { border-right: none; }

/* =============================================
   GLOBAL SEARCH
   ============================================= */
.topbar-search {
  position: relative;
  flex: 0 1 360px;
  margin: 0 20px;
}
.topbar-search input {
  width: 100%;
  padding: 7px 40px 7px 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-family: var(--font-sans);
  background: var(--card);
  color: var(--text);
  outline: none;
  letter-spacing: -0.005em;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast), background var(--dur-fast);
}
.topbar-search::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><path d='m21 21-4.35-4.35'/></svg>") no-repeat center / contain;
  pointer-events: none;
}
.topbar-search input::placeholder { color: var(--text-faint); }
.topbar-search input:focus {
  background: var(--card);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
}

.search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 420px;
  overflow-y: auto;
  z-index: 300;
}
.search-group { padding: 4px 0; border-bottom: 1px solid var(--border-hairline); }
.search-group:last-child { border-bottom: none; }
.search-group-label {
  padding: 8px 14px 4px;
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-family: var(--font-sans);
}
.search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
  transition: background 0.1s;
}
.search-item:hover { background: var(--primary-tint); color: var(--text); }
.search-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
  flex-shrink: 0;
  font-family: var(--font-mono);
}
.search-empty {
  padding: 22px 18px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* =============================================
   HAMBURGER MENU
   ============================================= */
.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.3em;
  cursor: pointer;
  padding: 6px;
}

/* =============================================
   MODAL — shared pattern
   ============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.36);
  backdrop-filter: blur(2px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  width: 440px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.2s cubic-bezier(.2,.8,.2,1);
}
.modal-box h3 {
  font-family: var(--font-display);
  font-size: 1.2em;
  font-weight: 600;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
  color: var(--text);
}
/* Optional header/body/footer sections inside .modal-box (mq/po/rfq modals). */
.modal-box .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.modal-box .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
  .page { padding: 24px 18px 60px; }
  .page-title { font-size: 2em; }
}

@media (max-width: 768px) {
  .hamburger { display: block; }
  .topbar-search { display: none; }
  .topbar-nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    background: var(--card);
    padding: 8px 6px;
    z-index: 99;
    border-bottom: 1px solid var(--border);
    align-items: stretch;
    gap: 2px;
  }
  .topbar-nav.open { display: flex; }
  .topbar-nav a { padding: 10px 14px; border-radius: 5px; }
  .topbar-nav a.active::after { display: none; }
  .nav-dropdown-menu {
    display: block;
    position: static;
    background: transparent;
    box-shadow: none;
    border: none;
    min-width: 0;
    padding: 0 0 0 14px;
  }
  .data-table { display: block; overflow-x: auto; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .card-body { padding: 14px; }
  .btn { padding: 7px 12px; }
  .aging-bar { grid-template-columns: repeat(2, 1fr); }
}

/* =============================================
   EMPTY STATE
   ============================================= */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
  font-family: var(--font-sans);
}
.empty-state h3 {
  font-family: var(--font-display);
  font-size: 1.4em;
  margin-bottom: 8px;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.02em;
}
/* Compact empty-state for inside <td colspan=N>…</td> or tight cards. */
.empty-state-row {
  text-align: center;
  padding: 28px 16px;
  color: var(--text-muted);
  font-size: 0.9em;
}
.empty-state-row strong {
  display: block;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 4px;
}
/* Icon slot (SVG) rendered above the heading. */
.empty-state .empty-state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  color: var(--text-muted);
  opacity: 0.6;
}
.empty-state .empty-state-icon svg {
  width: 48px;
  height: 48px;
}
.empty-state p {
  max-width: 440px;
  margin: 0 auto 14px;
  line-height: 1.5;
}

/* =============================================
   LOADING
   ============================================= */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border-strong);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Loading overlay. Apply `.is-loading` to any block-level container to
   show a spinner centred over its content. Content stays rendered (no
   layout shift) but visually dimmed. */
.is-loading { position: relative; }
.is-loading > * { opacity: 0.55; pointer-events: none; transition: opacity 0.15s ease; }
.is-loading::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 22px; height: 22px;
  margin: -11px 0 0 -11px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* =============================================
   SAVE FLASH — blur-to-save visual confirmation
   ============================================= */
/* Usage: JS adds `.save-flash-ok` or `.save-flash-err` on a field (or
   its wrapper) for ~1.2s after a successful or failed save. CSS-only
   animation; auto-removes when the class is removed by JS. */
.save-flash-ok { animation: saveFlashOk 1.2s ease-out; }
.save-flash-err { animation: saveFlashErr 1.2s ease-out; }
@keyframes saveFlashOk {
  0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.0); }
  25%  { box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.35); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.0); }
}
@keyframes saveFlashErr {
  0%   { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.0); }
  25%  { box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.4); }
  100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.0); }
}
/* Tiny "Saved ✓" / "Error" pill that JS can append next to a field. */
.save-flash-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.76rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 500;
  animation: saveFlashPill 1.6s ease-out forwards;
}
.save-flash-pill.ok { background: rgba(16, 185, 129, 0.14); color: var(--emerald); }
.save-flash-pill.err { background: rgba(220, 38, 38, 0.14); color: var(--red); }
@keyframes saveFlashPill {
  0%   { opacity: 0; transform: translateY(-2px); }
  10%  { opacity: 1; transform: translateY(0); }
  70%  { opacity: 1; }
  100% { opacity: 0; }
}

/* =============================================
   UTILITIES
   ============================================= */
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-faint { color: var(--text-faint); }
.text-primary { color: var(--primary); }
.text-red { color: var(--red); }
.text-amber { color: var(--amber); }
.text-emerald { color: var(--emerald); }
.serif { font-family: var(--font-display); font-weight: 400; }
.italic { font-style: italic; }
.uppercase-label {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  color: var(--text-muted);
}
.divider {
  height: 1px;
  background: var(--border-hairline);
  margin: 16px 0;
}

/* Selection */
::selection { background: var(--accent-light); color: var(--text); }

/* =============================================
   ICON — 16px monochrome strokes. Sidebar, buttons, etc.
   ============================================= */
.icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
}
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 20px; height: 20px; }

/* =============================================
   KBD — keyboard shortcut pill
   ============================================= */
.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 6px;
  min-width: 20px;
  height: 20px;
  border-radius: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
}
.kbd-dark { /* alias */
  background: var(--card);
  border-color: var(--border);
  color: var(--text-secondary);
}

/* =============================================
   SIDEBAR — warm-graphite rail, SVG icons, accent active bar
   ============================================= */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: 224px;
  background: var(--surface-ink); color: var(--ink-on-ink-muted);
  overflow-y: auto; overflow-x: hidden; z-index: 110;
  display: flex; flex-direction: column;
  transition: width var(--dur) var(--ease-out);
  font-family: var(--font-sans);
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.08) transparent;
  border-right: 1px solid var(--ink-on-ink-hairline);
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
.sidebar.collapsed { width: 60px; }
.sidebar.collapsed .sidebar-label,
.sidebar.collapsed .sidebar-group-title { opacity: 0; pointer-events: none; }
.sidebar.collapsed .sidebar-logo-word { display: none; }
.sidebar.collapsed .sidebar-logo { padding: 16px 0; justify-content: center; }

.sidebar-logo {
  display: flex; align-items: center; gap: 8px;
  padding: 18px 20px 16px;
  color: var(--ink-on-ink);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  text-decoration: none;
}
.sidebar-logo:hover { color: var(--ink-on-ink); }
.sidebar-logo-word { font-weight: 600; }
.sidebar-logo-mark {
  width: 6px; height: 6px;
  border-radius: 2px;
  background: var(--primary);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.45);
  display: inline-block;
  flex-shrink: 0;
  font-size: 0; /* hide ◦ text content, keep pure geometry */
  color: transparent;
}

.sidebar-group { padding: 2px 8px 6px; }
.sidebar-group + .sidebar-group { padding-top: 6px; }
/* Collapsible nav groups (Naomi 2026-06-04): the title is a toggle button;
   items hide when collapsed. My Day/Dashboard (.sidebar-top) stay open. */
.sidebar-group-toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; background: none; border: none; cursor: pointer;
  padding: 0; font: inherit; color: inherit; text-align: left;
}
.sidebar-group-toggle .sidebar-group-title { padding-right: 4px; }
.sidebar-group-caret { font-size: 0.6rem; color: var(--ink-on-ink-muted); padding-right: 12px; transition: transform var(--dur-fast); }
.sidebar-collapsible[data-collapsed="false"] .sidebar-group-caret { transform: rotate(180deg); }
.sidebar-collapsible[data-collapsed="true"] .sidebar-group-items { display: none; }
.sidebar.collapsed .sidebar-group-caret { opacity: 0; }
.sidebar-group-title {
  font-size: 0.64rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-on-ink-muted);
  padding: 10px 10px 6px;
  transition: opacity var(--dur-fast);
  font-family: var(--font-sans);
}

.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  font-size: 0.825rem;
  color: var(--ink-on-ink-muted);
  text-decoration: none;
  border-radius: 5px;
  cursor: pointer;
  position: relative;
  letter-spacing: -0.003em;
  font-weight: 450;
  transition: color var(--dur-fast), background var(--dur-fast);
}
.sidebar-item:hover {
  background: var(--bg-elevated);
  color: var(--ink-on-ink);
}
.sidebar-item.active {
  background: rgba(99, 102, 241, 0.08);
  color: var(--primary-dark);
  font-weight: 500;
}
.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 6px; bottom: 6px;
  width: 2px;
  border-radius: 2px;
  background: var(--accent);
}
.sidebar-item .icon { color: currentColor; opacity: 0.85; }
.sidebar-item.active .icon { opacity: 1; color: var(--accent); }
.sidebar-label { white-space: nowrap; transition: opacity var(--dur-fast); }

.sidebar-divider {
  height: 1px; background: var(--ink-on-ink-hairline);
  margin: 8px 12px;
}
.sidebar-bottom {
  padding: 6px 8px 12px;
  border-top: 1px solid var(--ink-on-ink-hairline);
}
.sidebar-bottom .sidebar-item { width: 100%; border: none; background: transparent; text-align: left; font-family: inherit; }

/* Topbar slides to match sidebar rail. Uses margin-left because .topbar is
   position:sticky, which ignores `left`. */
.topbar { margin-left: 224px !important; }
.sidebar.collapsed ~ .topbar { margin-left: 60px !important; }
.page { margin-left: 224px !important; }
.sidebar.collapsed ~ .topbar ~ .page,
.sidebar.collapsed ~ .page { margin-left: 60px !important; }

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 260px;
    z-index: 200;
    box-shadow: 12px 0 40px rgba(0,0,0,0.35);
    transition: transform var(--dur) var(--ease-out);
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .topbar { margin-left: 0 !important; }
  .page { margin-left: 0 !important; }
  .sidebar-collapse-btn { display: none; }
}

/* =============================================
   COMMAND PALETTE (⌘K)
   ============================================= */
.cmd-overlay {
  position: fixed; inset: 0;
  background: rgba(10, 10, 10, 0.36);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 300;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 13vh;
  animation: fadeIn var(--dur) var(--ease-out);
}
.cmd-overlay.open { display: flex; }

.cmd-dialog {
  width: 560px;
  max-width: calc(100vw - 32px);
  max-height: 60vh;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 48px rgba(10, 10, 10, 0.18), 0 4px 12px rgba(10, 10, 10, 0.06), 0 0 0 1px var(--border) inset;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 220ms var(--ease-out);
}

.cmd-search {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-hairline);
}
.cmd-search .icon { color: var(--text-muted); width: 18px; height: 18px; }
.cmd-search input {
  flex: 1;
  border: none; outline: none;
  font-size: 1rem;
  font-family: var(--font-sans);
  color: var(--text);
  background: transparent;
  letter-spacing: -0.005em;
}
.cmd-search input::placeholder { color: var(--text-faint); }

.cmd-results {
  padding: 6px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.cmd-group-label {
  padding: 10px 12px 4px;
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
}
.cmd-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  font-size: 0.88rem;
  color: var(--text);
  border-radius: var(--radius-sm);
  cursor: pointer;
  letter-spacing: -0.005em;
  transition: background var(--dur-fast);
}
.cmd-item-icon {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 4px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  flex-shrink: 0;
}
.cmd-item-label { flex: 1; }
.cmd-item-kbd { margin-left: auto; opacity: 0; transition: opacity var(--dur-fast); }
.cmd-item.selected,
.cmd-item:hover {
  background: var(--primary-tint);
  color: var(--text);
}
.cmd-item.selected .cmd-item-icon,
.cmd-item:hover .cmd-item-icon {
  background: var(--primary-light);
  color: var(--primary);
}
.cmd-item.selected .cmd-item-kbd,
.cmd-item:hover .cmd-item-kbd { opacity: 1; }

.cmd-footer {
  display: flex; align-items: center; gap: 14px;
  padding: 8px 14px;
  border-top: 1px solid var(--border-hairline);
  background: var(--bg-elevated);
  font-size: 0.72rem;
  color: var(--text-muted);
}
.cmd-footer > span { display: inline-flex; align-items: center; gap: 6px; }

.cmd-empty {
  padding: 32px 18px;
  text-align: center;
  color: var(--text-faint);
  font-size: 0.84rem;
  letter-spacing: -0.005em;
}

/* =============================================
   SOP PANEL (floating quick access)
   ============================================= */
.fab {
  position: fixed;
  bottom: 22px; right: 22px;
  z-index: 100;
  width: 42px; height: 42px;
  border-radius: 999px;
  background: var(--primary);
  color: #FFFFFF;
  border: 1px solid var(--primary-dark);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35), 0 1px 0 rgba(255, 255, 255, 0.12) inset;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--dur-fast), box-shadow var(--dur-fast);
}
.fab:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.fab .icon { color: currentColor; width: 18px; height: 18px; }

.sop-panel {
  display: none;
  position: fixed;
  bottom: 78px; right: 22px;
  width: 320px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  padding: 12px 14px;
  animation: slideUp 180ms var(--ease-out);
}
.sop-panel header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-hairline);
}
.sop-panel header strong {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}
.sop-panel header button {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 4px;
  display: inline-flex;
  transition: color var(--dur-fast), background var(--dur-fast);
}
.sop-panel header button:hover { color: var(--text); background: var(--bg-elevated); }
.sop-panel a {
  display: block;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border-hairline);
  color: var(--text);
  font-size: 0.85rem;
  text-decoration: none;
  letter-spacing: -0.005em;
  transition: color var(--dur-fast);
}
.sop-panel a:last-child { border-bottom: none; }
.sop-panel a:hover { color: var(--primary); }

/* =============================================
   USER CHIP — topbar right edge
   ============================================= */
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
}

/* Role badge — shown next to the user name so operators know their
   current tier at a glance. One variant per role. */
.chip-role {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.70rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.4;
  border: 1px solid transparent;
}
.chip-role-owner              { background: var(--accent-light);  color: var(--accent);  border-color: rgba(99, 102, 241, 0.25); }
.chip-role-operations_manager { background: var(--blue-light);    color: #1E40AF;        border-color: rgba(37, 99, 235, 0.22); }
.chip-role-admin              { background: var(--emerald-light); color: var(--emerald); border-color: rgba(5, 150, 105, 0.22); }
.chip-role-bookkeeper         { background: var(--amber-light);   color: #92400E;        border-color: rgba(217, 119, 6, 0.22); }

/* =============================================
   ANAT TOASTS — page-level notifications
   ============================================= */
.anat-toast-stack {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}
.anat-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  min-width: 260px;
  max-width: 440px;
  background: var(--card, #FFFFFF);
  color: var(--text, #0A0A0A);
  border: 1px solid var(--border);
  border-left: 3px solid var(--text-muted);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  font-size: 0.88rem;
  line-height: 1.45;
  animation: anat-toast-in 180ms ease-out;
}
.anat-toast-leaving { opacity: 0; transform: translateX(8px); transition: opacity 180ms ease, transform 180ms ease; }
.anat-toast-success { border-left-color: var(--emerald); }
.anat-toast-error   { border-left-color: var(--red); }
.anat-toast-info    { border-left-color: var(--blue); }
.anat-toast-msg     { flex: 1; }
.anat-toast-close {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 2px;
  font-size: 1.1rem;
  line-height: 1;
}
.anat-toast-close:hover { color: var(--text); }
@keyframes anat-toast-in {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* =============================================
   SIDEBAR — per-client "needs client" state
   ============================================= */
.sidebar-item--needs-client {
  opacity: 0.55;
}
.sidebar-item--needs-client::after {
  content: "";
}

/* =============================================
   EMPTY STATES — inline placeholder for empty lists
   ============================================= */
.empty-state {
  padding: 18px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

/* =============================================
   REQUIRED-FIELD MARKER — rendered automatically
   ============================================= */
.form-group:has(> input[required]) > .form-label::after,
.form-group:has(> textarea[required]) > .form-label::after,
.form-group:has(> select[required]) > .form-label::after {
  content: " *";
  color: var(--red);
  font-weight: 600;
}

/* =============================================
   LINK-STYLE BUTTON — inline text-only actions
   used in the topbar user chip for Logout.
   ============================================= */
.btn-link, .link-btn {
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.btn-link:hover, .link-btn:hover { color: var(--text); }

/* =============================================
   My Day welcome strip — time-of-day greeting
   ============================================= */
.myday-welcome {
  margin-bottom: 10px;
  padding: 6px 2px;
}
.myday-welcome-greeting {
  font-family: var(--font-display, inherit);
  font-size: 1.18rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.myday-welcome-greeting strong {
  color: var(--accent);
  font-weight: 600;
}
.myday-welcome-tagline {
  margin-top: 2px;
  font-size: 0.86rem;
  color: var(--text-muted);
  font-style: italic;
}

/* =============================================
   "What we handled" ribbon — top of My Day
   ============================================= */
.handled-today {
  margin-bottom: 16px;
  padding: 16px 18px 14px;
  background: linear-gradient(180deg, var(--accent-light) 0%, transparent 100%);
  border: 1px solid rgba(99, 102, 241, 0.18);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.handled-today-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.handled-today-title {
  font-family: var(--font-display, inherit);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
  color: var(--text);
  letter-spacing: -0.005em;
}
.handled-today-subtitle {
  margin: 2px 0 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.handled-today-collapse {
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-shrink: 0;
  padding-top: 2px;
}
.handled-today.is-collapsed .handled-today-body { display: none; }
.handled-today.is-collapsed { padding-bottom: 14px; }

.handled-today-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.handled-today-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 10px;
  background: var(--card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hairline);
  animation: handled-today-in 220ms ease-out both;
}
.handled-today-icon {
  font-size: 1.1rem;
  line-height: 1.3;
  flex-shrink: 0;
  width: 22px;
  text-align: center;
}
.handled-today-text { flex: 1; min-width: 0; }
.handled-today-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}
.handled-today-detail {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.4;
}
.handled-today-link {
  flex-shrink: 0;
  font-size: 0.8rem;
  color: var(--primary-dark);   /* #4F46E5 — 5.16:1 on white, passes WCAG AA */
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid rgba(99, 102, 241, 0.3);
  text-decoration: none;
  font-weight: 500;
  align-self: center;
  transition: background 120ms ease;
}
.handled-today-link:hover { background: var(--card-elev); }
.handled-today-row--skel {
  height: 42px;
  background: linear-gradient(90deg, var(--border-hairline) 0%, var(--border) 50%, var(--border-hairline) 100%);
  background-size: 200% 100%;
  animation: handled-today-skel 1.4s ease-in-out infinite;
  border: none;
}
@keyframes handled-today-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes handled-today-skel {
  0% { background-position: 0% 0%; }
  100% { background-position: -200% 0%; }
}

/* ============================================================
   VISUAL REDESIGN — macro-backed primitives
   ============================================================ */

/* ---- kpi_card macro (label-above variant) ------------------ */
.kpi-card .kpi-label { margin-top: 0; margin-bottom: var(--sp-2, 8px); }
.kpi-card .kpi-value { display: block; font-size: var(--text-xl, 1.85rem); letter-spacing: -0.025em; }
/* #33 — expected cash-in cards */
.cashin-card { margin-bottom: 16px; }
.cashin-months { display: flex; gap: 12px; flex-wrap: wrap; }
.cashin-months .kpi-card { min-width: 120px; }
.cashin-months .kpi-value { font-size: 1.1rem; }
.cashin-note { margin-top: 8px; }
.kpi-card .kpi-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-2, 8px); margin-top: var(--sp-3, 12px);
  color: var(--text-muted); font-size: var(--text-sm, 0.82rem);
}
.kpi-card .kpi-delta {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-weight: var(--fw-semi, 600);
}
.kpi-delta-up   { color: var(--emerald); }
.kpi-delta-down { color: var(--red); }
.kpi-delta-flat { color: var(--text-muted); }
.kpi-spark { color: var(--accent); opacity: 0.85; }

.kpi-card--warm {
  background: linear-gradient(180deg, var(--warm-sand, rgba(234,223,200,0.3)) 0%, var(--card) 100%);
  border-color: rgba(184, 155, 94, 0.22);
}
.kpi-card--ink {
  background: var(--surface-ink, var(--card));
  color: var(--ink-on-ink, var(--text));
}
.kpi-card--ink .kpi-label { color: var(--ink-on-ink-muted, var(--text-muted)); }
.kpi-card--ink .kpi-value { color: var(--ink-on-ink, var(--text)); }

a.kpi-card { text-decoration: none; color: inherit; display: block; }
a.kpi-card:hover { border-color: var(--accent); }

/* ---- page_header macro ------------------------------------ */
.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--sp-5, 24px); flex-wrap: wrap;
  margin-bottom: var(--sp-5, 24px);
}
.page-header-text { min-width: 0; }
.page-header-actions { display: flex; gap: var(--sp-2, 8px); flex-shrink: 0; }

/* ---- empty_state macro variants (keeps existing .empty-state) */
.empty-state-block {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: var(--sp-3, 12px); padding: var(--sp-6, 32px) var(--sp-5, 24px);
  background: var(--surface-warm, var(--bg));
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.empty-state-art { width: 120px; height: auto; opacity: 0.9; margin-bottom: var(--sp-2, 8px); }
.empty-state-title { font-size: var(--text-md, 1.05rem); font-weight: var(--fw-semi, 600); color: var(--text); }
.empty-state-body  { font-size: var(--text-sm, 0.82rem); color: var(--text-muted); max-width: 48ch; line-height: var(--lh-normal, 1.45); }
.empty-state-cta   { margin-top: var(--sp-2, 8px); }

/* ---- status_chip macro ----------------------------------- */
.status-chip {
  display: inline-flex; align-items: center;
  padding: 2px 10px; border-radius: 999px;
  font-size: var(--text-xs, 0.72rem); font-weight: var(--fw-semi, 600);
  line-height: 1.5; letter-spacing: 0.02em;
  border: 1px solid transparent;
}
.status-chip--neutral { background: var(--bg-elevated); color: var(--text-secondary); border-color: var(--border); }
.status-chip--success { background: var(--emerald-light); color: #065F46; border-color: rgba(5,150,105,0.22); }
.status-chip--warning { background: var(--amber-light); color: #92400E; border-color: rgba(217,119,6,0.22); }
.status-chip--danger  { background: var(--red-light); color: #991B1B; border-color: rgba(220,38,38,0.22); }
.status-chip--info    { background: var(--blue-light); color: #1E40AF; border-color: rgba(37,99,235,0.22); }
.status-chip--accent  { background: var(--accent-light); color: var(--accent); border-color: rgba(99,102,241,0.25); }

html[data-theme="dark"] .status-chip--success { color: #6EE7B7; }
html[data-theme="dark"] .status-chip--warning { color: #FCD34D; }
html[data-theme="dark"] .status-chip--danger  { color: #FCA5A5; }
html[data-theme="dark"] .status-chip--info    { color: #93C5FD; }

/* Ownership panel — Phase 1 of post-call build (2026-05-02). Displays the
   client's assigned admin on the client detail page, with optional inline
   reassign controls visible only to management roles. */
.ownership-panel {
  padding: 10px 14px;
  margin: 10px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ownership-panel-label { font-size: 13px; }
.ownership-panel-current { font-size: 14px; }
.ownership-panel-edit { display: none; gap: 6px; align-items: center; }
.ownership-panel-select { font-size: 13px; padding: 4px 8px; }
.users-manages-badge { margin-right: 4px; }
.users-manages-empty { font-size: 0.85em; }

/* ---- skeleton_row + skeleton_card macros ------------------ */
.skeleton-row {
  display: flex; align-items: center; gap: var(--sp-3, 12px);
  padding: var(--sp-2, 8px) var(--sp-3, 12px);
  min-height: var(--skel-h, 40px);
}
.skeleton-cell, .skeleton-line {
  display: block; height: 12px; width: 100%;
  border-radius: var(--radius-sm, 4px);
  background: linear-gradient(90deg,
    rgba(10,10,10,0.04) 0%,
    rgba(10,10,10,0.08) 50%,
    rgba(10,10,10,0.04) 100%);
  background-size: 200% 100%;
  animation: skel-shimmer 1.4s ease-in-out infinite;
}
.skeleton-card { padding: var(--sp-4, 16px); display: flex; flex-direction: column; gap: var(--sp-2, 8px); }
.skeleton-card .skeleton-line:nth-child(2) { width: 70%; }
.skeleton-card .skeleton-line:nth-child(3) { width: 45%; }
html[data-theme="dark"] .skeleton-cell,
html[data-theme="dark"] .skeleton-line {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 0%,
    rgba(255,255,255,0.09) 50%,
    rgba(255,255,255,0.04) 100%);
  background-size: 200% 100%;
}
@keyframes skel-shimmer {
  0%   { background-position: 0% 0%; }
  100% { background-position: -200% 0%; }
}

/* ---- count_badge macro ------------------------------------ */
.count-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 6px; margin-left: 6px;
  border-radius: 999px;
  background: rgba(10,10,10,0.08); color: var(--text-secondary);
  font-size: var(--text-xs, 0.72rem); font-weight: var(--fw-semi, 600);
  font-variant-numeric: tabular-nums;
}
.count-badge--danger { background: var(--red); color: #fff; }
.count-badge--accent { background: var(--accent); color: #fff; }
html[data-theme="dark"] .count-badge { background: rgba(255,255,255,0.10); }

/* ============================================================
   LOGIN — split-hero redesign (visual redesign week 1)
   ============================================================ */
.login-body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: var(--lh-normal, 1.45);
}
.login-grid {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}

/* Hero side — warm gradient, tagline, restraint */
.login-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--sp-7, 48px);
  background:
    radial-gradient(circle at 15% 10%, var(--warm-sand, #EADFC8) 0%, transparent 55%),
    radial-gradient(circle at 90% 90%, var(--accent-light) 0%, transparent 60%),
    var(--surface-warm, var(--bg));
  overflow: hidden;
}
.login-hero::before {
  /* Subtle grid of dots, very low contrast, just texture */
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(10,10,10,0.05) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom right, transparent, black 30%, transparent);
  pointer-events: none;
}
.login-hero-mark {
  font-family: var(--font-display);
  font-weight: var(--fw-regular, 400);
  font-size: var(--text-lg, 1.35rem);
  color: var(--text);
  letter-spacing: -0.015em;
  margin-bottom: var(--sp-7, 48px);
  position: relative;
}
.login-hero-mark span {
  color: var(--accent);
  font-style: italic;
  font-size: 0.85em;
  margin-left: 2px;
}
.login-hero-headline {
  position: relative;
  font-family: var(--font-display);
  font-weight: var(--fw-regular, 400);
  font-size: var(--text-2xl, 2.6rem);
  line-height: var(--lh-tight, 1.15);
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 var(--sp-4, 16px);
  max-width: 16ch;
}
.login-hero-headline em {
  font-style: italic;
  color: var(--accent);
}
.login-hero-sub {
  position: relative;
  font-size: var(--text-md, 1.05rem);
  line-height: var(--lh-normal, 1.45);
  color: var(--text-secondary);
  max-width: 34ch;
  margin: 0;
}

/* Form side */
.login-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6, 32px);
  background: var(--bg);
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 8px);
  padding: var(--sp-6, 32px);
  box-shadow: var(--shadow);
}
.login-card-title {
  font-family: var(--font-display);
  font-weight: var(--fw-regular, 400);
  font-size: var(--text-lg, 1.35rem);
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 4px;
}
.login-card-sub {
  font-size: var(--text-sm, 0.82rem);
  color: var(--text-muted);
  margin: 0 0 var(--sp-5, 24px);
}
.login-form { display: flex; flex-direction: column; gap: var(--sp-4, 16px); }
.login-form .form-group { margin-bottom: 0; }
.login-submit {
  width: 100%;
  justify-content: center;
  margin-top: var(--sp-2, 8px);
}
.login-error {
  background: var(--red-light);
  color: #6E2011;
  border: 1px solid rgba(220, 38, 38, 0.25);
  border-left: 3px solid var(--red);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm, 0.82rem);
  margin: 0 0 var(--sp-4, 16px);
  text-align: center;
}
.login-footnote {
  margin: var(--sp-5, 24px) 0 0;
  text-align: center;
  font-size: var(--text-xs, 0.72rem);
  color: var(--text-muted);
}
.login-footnote a {
  color: var(--primary-dark);   /* 5.16:1 on white, passes WCAG AA */
  text-decoration: underline;
  text-underline-offset: 2px;
}

html[data-theme="dark"] .login-error {
  color: #FCA5A5;
  border-left-color: var(--red);
  border-color: rgba(248, 113, 113, 0.25);
}

/* Stack on narrow viewports */
@media (max-width: 768px) {
  .login-grid { grid-template-columns: 1fr; }
  .login-hero {
    padding: var(--sp-5, 24px);
    min-height: 35vh;
  }
  .login-hero-mark { margin-bottom: var(--sp-5, 24px); }
  .login-hero-headline { font-size: var(--text-xl, 1.85rem); }
  .login-hero-sub { font-size: var(--text-base, 0.92rem); }
  .login-form-wrap { padding: var(--sp-5, 24px); }
}

/* ============================================================
   VOICE CALLS — transcript polish (visual redesign week 3)
   ============================================================ */
.transcript-line {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: var(--sp-3, 12px);
  padding: var(--sp-2, 8px) var(--sp-3, 12px);
  border-left: 3px solid transparent;
  margin: 0 0 var(--sp-1, 4px);
  border-radius: var(--radius-sm, 4px);
  font-family: var(--font-sans);
  font-size: var(--text-sm, 0.82rem);
  line-height: var(--lh-normal, 1.45);
}
.transcript-line--bot {
  background: var(--accent-light);
  border-left-color: var(--accent);
  color: var(--text);
}
.transcript-line--caller {
  background: var(--surface-warm, rgba(10,10,10,0.02));
  border-left-color: var(--text-muted);
  color: var(--text-secondary);
}
.transcript-speaker {
  font-family: var(--font-mono);
  font-size: var(--text-xs, 0.72rem);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: var(--fw-semi, 600);
  align-self: start;
  padding-top: 2px;
}
.transcript-line--bot .transcript-speaker { color: var(--accent); }
.transcript-text { white-space: pre-wrap; word-break: break-word; }

/* ============================================================
   CLIENT DETAIL — sticky header (visual redesign week 3)
   ============================================================ */
.client-sticky-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: var(--sp-3, 12px) 0 var(--sp-2, 8px);
  margin-bottom: var(--sp-4, 16px);
  transition: box-shadow var(--dur, 180ms) var(--ease-out);
}
.client-sticky-header.is-scrolled {
  box-shadow: var(--shadow);
}
.client-sticky-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4, 16px);
  flex-wrap: wrap;
}
.client-sticky-title {
  font-family: var(--font-display);
  font-size: var(--text-xl, 1.85rem);
  font-weight: var(--fw-regular, 400);
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin: 0;
  color: var(--text);
}
.client-sticky-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-3, 12px);
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: var(--text-sm, 0.82rem);
  margin-top: 4px;
}
.client-sticky-meta a { color: var(--text-muted); text-decoration: none; }
.client-sticky-meta a:hover { color: var(--accent); }
.client-sticky-actions {
  display: flex;
  gap: var(--sp-2, 8px);
  align-items: center;
  flex-shrink: 0;
}

/* ============================================================
   COLLECTIONS — aging bar polish + KPI tone
   ============================================================ */
.aging-cell .aging-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   Theme toggle — sun / moon swap via data-theme attribute.
   ============================================================ */
.theme-toggle { padding: 6px 10px; }
.theme-toggle-icon-dark  { display: none; }
.theme-toggle-icon-light { display: inline-block; }
html[data-theme="dark"] .theme-toggle-icon-light { display: none; }
html[data-theme="dark"] .theme-toggle-icon-dark  { display: inline-block; }

/* ============================================================
   My Day card row-reveal (staggered entry).
   Every client card gets a subtle slide+fade as the page settles.
   Stagger via --card-delay variable set in my_day.html when cards
   are rendered (defaults to 0 when unset so nothing jumps).
   ============================================================ */
.client-card {
  animation: myday-card-in var(--dur-slow, 280ms) var(--ease-spring, cubic-bezier(0.34,1.56,0.64,1)) both;
  animation-delay: var(--card-delay, 0ms);
}
@keyframes myday-card-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .client-card { animation: none; }
}

/* ============================================================
   View Transitions (Chrome 111+, Safari 18+, Firefox TBD).
   Progressive enhancement — no-op on unsupported browsers.
   ============================================================ */
@supports (view-transition-name: none) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: var(--dur, 180ms);
    animation-timing-function: var(--ease-out);
  }
}

/* ============================================================
   UTILITY CLASSES — inline-style eradication (2026-04-25)
   These narrowly-scoped classes eat the top N repeated inline
   style declarations in my_day.html + clients/detail.html.
   Kept under /utility/ prefix so it's obvious these are
   intentional-convenience, not part of the component layer.
   ============================================================ */

/* Type scale — maps inline font-size declarations to tokens */
.u-text-xs      { font-size: var(--text-xs, 0.72rem); }
.u-text-sm      { font-size: var(--text-sm, 0.82rem); }
.u-text-base    { font-size: var(--text-base, 0.92rem); }
.u-text-md      { font-size: var(--text-md, 1.05rem); }
/* Covers the 0.78rem / 0.8rem / 0.85rem bucket */
.u-text-xxs     { font-size: 0.78rem; }
.u-text-85      { font-size: 0.85rem; }
.u-text-88      { font-size: 0.88rem; }
.u-text-em-85   { font-size: 0.85em; }
.u-text-em-82   { font-size: 0.82em; }

/* Inline checkbox-with-label rows (e.g. priority Balanced toggle).
   Replaces the inline style="display:flex; align-items:center;
   gap:6px; margin:4px 0;" pattern that was popping up. */
.u-inline-check { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0; }

/* Weight */
.u-fw-norm      { font-weight: var(--fw-regular, 400); }
.u-fw-medium    { font-weight: var(--fw-medium, 500); }
.u-fw-semi      { font-weight: var(--fw-semi, 600); }
.u-fw-bold      { font-weight: var(--fw-bold, 700); }

/* Common padding shapes */
.u-p-0          { padding: 0; }
.u-p-2          { padding: 8px; }
.u-p-3          { padding: 12px; }
.u-p-4          { padding: 16px; }
.u-p-5          { padding: 24px; }
.u-p-30         { padding: 30px; }                 /* clients/detail hero cards */
.u-p-y-1        { padding-top: 4px; padding-bottom: 4px; }
.u-p-y-2        { padding-top: 8px; padding-bottom: 8px; }
.u-p-xy-6-4     { padding: 6px 4px; }              /* my_day phase-chip pattern */
.u-p-xy-6-12    { padding: 6px 12px; }
.u-p-xy-10-12   { padding: 10px 12px; }
.u-p-xy-4-8     { padding: 4px 8px; }
.u-p-xy-2-4     { padding: 2px 4px; }
.u-p-xy-3-6     { padding: 3px 6px; }
.u-p-xy-1-8     { padding: 1px 8px; }
.u-p-xy-1-6     { padding: 1px 6px; }

/* Common margin shapes */
.u-m-0          { margin: 0; }
.u-m-t-1        { margin-top: 4px; }
.u-m-t-2        { margin-top: 8px; }
.u-m-t-4        { margin-top: 16px; }
.u-m-y-6        { margin: 6px 0; }
.u-m-y-16-8     { margin: 16px 0 8px; }

/* Thin in-form section divider — replaces inline-style on <hr>. */
.u-divider      { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.u-m-t-4-0-0    { margin: 4px 0 0; }

/* Definition-list row for read-only summary modals (e.g. Contact Card).
   Label column + value column, with a row separator. */
.dl-row         { display: grid; grid-template-columns: 140px 1fr; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.dl-row-label   { font-weight: 600; color: var(--text-muted); }
.dl-row-title   { font-size: 1.1em; font-weight: 600; margin-bottom: 12px; }

/* AnatCombobox — searchable type-to-filter overlay on a native <select>.
   See static/js/anat-combobox.js. Opt in with `data-searchable`. The native
   select stays in the DOM (hidden) as the form/value source of truth. */
.anat-combo { position: relative; display: inline-block; }
/* The native <select> stays as the form/value source of truth, overlaid exactly
   under the input (transparent, click-through) so constraint-validation bubbles
   for `required` selects still point at the right place. */
.anat-combo-native { position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; pointer-events: none; }
.anat-combo-input { cursor: text; position: relative; z-index: 1; }
.anat-combo-list {
  position: absolute; z-index: 1200; left: 0; right: 0; top: 100%;
  margin-top: 2px; max-height: 260px; overflow-y: auto;
  background: var(--surface, #fff); border: 1px solid var(--border, #d6d9e0);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.anat-combo-opt { padding: 7px 10px; cursor: pointer; font-size: 0.9rem; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.anat-combo-opt:hover, .anat-combo-opt.is-active { background: var(--accent-soft, #eef1ff); }
.anat-combo-opt[aria-selected="true"] { font-weight: 600; }
.anat-combo-empty { padding: 8px 10px; color: var(--text-muted, #888); font-size: 0.85rem; }

/* AnatTable — Excel-style per-column sort + filter popover. See
   static/js/anat-table.js. Used on every data-table the admin can
   sort/filter (contacts, networking, employees, vehicles, expirations,
   expenses). */
.anat-table-header-btn {
  appearance: none;
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: 100%;
}
.anat-table-header-btn:hover .anat-table-header-arrow { opacity: 1; }
.anat-table-header-arrow {
  opacity: 0.5;
  font-size: 0.85em;
  transition: opacity 120ms;
}
.anat-sort-icon { font-size: 0.85em; color: var(--primary); }
.anat-filter-icon { font-size: 1em; color: var(--primary); }
.anat-table-popover {
  position: absolute;
  z-index: 1000;
  min-width: 240px;
  max-width: 320px;
  /* --surface was never defined in the token set, so this popover used to
     render transparent — the table rows behind showed through. Use the
     token whose comment explicitly names "popovers / modals" (#card-elev).
     Reported by Rami 2026-05-26 — see screenshot, Networking Contacts
     filter dropdown overlaying contact rows. */
  background: var(--card-elev, #fff);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow-lg, 0 8px 24px rgba(0,0,0,0.12));
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.anat-table-popover-sort { display: flex; gap: 4px; }
.anat-table-popover-sort .btn { flex: 1; }
.anat-table-popover-search { width: 100%; }
.anat-table-popover-actions {
  display: flex;
  justify-content: space-between;
  gap: 4px;
}
.anat-table-popover-list {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px;
}
.anat-table-popover-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px;
  cursor: pointer;
  border-radius: 3px;
}
.anat-table-popover-row:hover { background: var(--surface-muted, #f5f5f7); }
.anat-table-popover-row input[type="checkbox"] { margin: 0; }
.anat-table-popover-footer {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 4px;
}

/* HVAC photo modal — Phase 7c.UI */
.hvac-confidence-row {
  margin-bottom: 12px;
  padding: 8px 10px;
  background: var(--bg-elevated);
  border-radius: 6px;
}
.hvac-quality-note { color: var(--text-muted); margin-left: 12px; }
.hvac-unit-key { width: 120px; }
.hvac-section-h { margin: 14px 0 8px; }
.hvac-section-h.hvac-section-h-first { margin: 8px 0 8px; }
.hvac-unit-table { margin-bottom: 8px; }
.hvac-draft-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 10px;
}
.hvac-draft-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.hvac-draft-subj { margin-bottom: 4px; }
.hvac-draft-body {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 0.85rem;
  margin: 0;
}

/* Breakdown vendor-picker — Phase 8.UI */
.vendor-picker-select { font-size: 0.85rem; padding: 4px 8px; }

/* Meeting tasks modal — Phase 2e.UI */
.meeting-task-row {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 8px;
}
.meeting-task-snippet {
  color: var(--text-muted);
  margin: 4px 0;
  font-style: italic;
}
.meeting-task-meta { color: var(--text-muted); margin-bottom: 6px; }
.meeting-task-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* Internal time tracking — Phase 12 */
.me-time-week-picker { width: 160px; }
.me-time-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 12px;
}

/* Gift occasions modal — Phase 9b.2 */
.gift-empty-state { padding: 20px; }
.gift-occasions-add-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.gift-occasions-save-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}
.gift-occasion-item {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-hairline);
}
.gift-occasion-key {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.78em;
}
.gift-flex-grow { flex: 1; }

/* HR settings page — Phase 13a */
.hr-empty-state { padding: 20px; }
.hr-help-line {
  margin: 8px 16px 16px 16px;
  color: var(--text-muted);
}
.hr-filter-input {
  width: auto;
  padding: 6px 10px;
  font-size: 0.85em;
}
.hr-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}
.hr-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.hr-locale-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.hr-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.hr-json-textarea {
  font-family: var(--font-mono);
  font-size: 0.82em;
  height: 240px;
}

/* Timesheet grid — Phase 13a, PR-2 */
.ts-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ts-status-label { color: var(--text-muted); margin-right: 6px; }
.ts-status-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}
.ts-week-total { color: var(--text-muted); }
.ts-status-badge {
  display: inline-block;
  margin-left: 10px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.72em;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.ts-badge-draft { background: var(--bg-elevated); color: var(--text-muted); }
.ts-badge-submitted { background: var(--amber-light); color: var(--amber); }
.ts-badge-approved { background: var(--emerald-light); color: var(--emerald-deep); }
.ts-badge-rejected { background: var(--red-light); color: var(--red); }
/* Semantic alias for "attention but not failure" states (e.g. MS scope reconnect). */
.ts-badge-warning { background: var(--amber-light); color: var(--amber); }
.ts-locked-note {
  margin-top: 8px;
  padding: 6px 10px;
  background: var(--bg-elevated);
  border-radius: 6px;
}
.ts-grid th, .ts-grid td { text-align: center; }
.ts-grid-cat { width: 110px; text-align: left !important; }
.ts-grid-day { width: 70px; }
.ts-grid-total { width: 70px; }
.ts-cell {
  width: 56px;
  padding: 4px 6px;
  text-align: center;
  font-size: 0.88em;
}
.ts-row-total { color: var(--text-muted); }
.ts-help-line {
  padding: 12px 16px;
  color: var(--text-muted);
}

/* Phase 13b — HR-as-a-service opt-in card on clients/detail Employees tab. */
.hr-service-card { margin-bottom: 16px; }

/* State picker — spacing for the "Other / non-US" reveal input. */
[data-state-other] { margin-top: 6px; }
/* Collections record card (Excel-parity fields). */
.cr-card { margin-bottom: 24px; }
.cr-checks { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 10px; }
.cr-checks label { display: inline-flex; gap: 6px; align-items: center; }

/* Client Details Phase 2 — business-records sub-tables (Natalia 2026-06-02).
   Compact add/remove-rows editors inside the Edit Client modal. */
.br-section-head { color: var(--text-muted); margin: 4px 0 6px; font-weight: 600; }
.br-table { margin: 0 0 6px; }
.br-table th { padding: 4px 6px; }
.br-table td { padding: 3px 4px; }
.br-table .br-cell { padding: 4px 6px; font-size: 0.85em; }
.br-add { margin-top: 2px; }

/* Backdrop-click on a dirty form refuses to close — pulse the box so the
   refusal reads as deliberate, not broken (form-drafts / dialog.js). */
.modal-box.dialog-attention { animation: anat-dialog-pulse 0.25s ease-out; }
@keyframes anat-dialog-pulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.015); }
  100% { transform: scale(1); }
}

/* My Day alerts panel — open management alerts, most urgent first. */
.alerts-panel { border-left: 3px solid var(--red, #DC2626); }
.alert-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--border-hairline, #eee); }
.alert-row:last-child { border-bottom: 0; }
.alert-row:hover { background: var(--bg-subtle, #fafafa); }
.alert-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; background: var(--text-muted); }
.alert-row--urgent .alert-dot, .alert-row--high .alert-dot { background: var(--red, #DC2626); }
.alert-row--medium .alert-dot { background: var(--amber, #D97706); }
.alert-text { flex: 1 1 auto; min-width: 0; }
.alert-client { font-weight: 600; }
.alert-client::after { content: " ·"; color: var(--text-muted); }
.alert-meta { color: var(--text-muted); font-size: 0.85em; white-space: nowrap; }

/* My Day "Nothing for today" expansion — last 7 days of completed items. */
.myday-done-row { padding: 3px 0; color: var(--text-muted); }
.myday-done-check { color: var(--green, #16A34A); font-weight: 600; }

/* Go/no-go decided chips on My Day rows. */
.chip.gonogo-go { background: var(--green-light, #DCFCE7); color: var(--green, #16A34A); font-weight: 600; }
.chip.gonogo-nogo { background: var(--red-light, #FEE2E2); color: var(--red, #DC2626); font-weight: 600; }
/* Inline go/no-go decision in the estimates Approval column (Rami 2026-06-13) */
.gng-inline { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }

/* Draft auto-save indicator on [data-draft] forms. */
.draft-status { min-height: 16px; margin-top: 8px; font-size: 0.82em; color: var(--text-muted); text-align: right; transition: color 0.2s; }
.draft-status.is-saved { color: var(--green, #16A34A); }

/* ── Payment plans v2 — project billing ledger + bill-period modal ── */
.pp2-ledger          { padding: 10px 16px; border-bottom: 1px solid var(--border); }
.pp2-ledger-item     { margin-right: 16px; }
.pp2-bill-intro      { margin-bottom: 10px; }
.pp2-bill-note       { margin-top: 10px; }
.pp2-bill-actions    { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.pp2-bill-row        { display: flex; gap: 10px; align-items: center; }
.pp2-bill-row .form-label { flex: 1; }
.pp2-bill-pct        { width: 110px; }
/* Time-on-site summary chip (Rami 2026-06-13) — tokens so dark mode propagates */
.tos-chip { display:inline-block; padding:4px 10px; border-radius:999px; background:var(--accent-light); color:var(--accent); font-size:0.85rem; }
/* Collections Execute modal — deposit-template info note (token-based for dark mode) */
.deposit-note { margin-bottom: 14px; padding: 10px 12px; border: 1px solid var(--primary); background: var(--accent-light); color: var(--primary-dark); border-radius: 8px; font-size: 13px; line-height: 1.45; }

/* Lead communication log (Naomi 2026-06-17) — timeline in the lead modal. */
.lead-activity-section { margin-top: 22px; border-top: 1px solid var(--border-hairline); padding-top: 16px; }
.lead-activity-row { border-bottom: 1px solid var(--border-hairline); padding: 8px 0; }
.lead-activity-meta { font-size: 0.82rem; color: var(--text-muted); }
.lead-activity-subj { font-weight: 600; }
.lead-activity-body { white-space: pre-wrap; color: var(--text-secondary); }
.lead-activity-empty { font-size: 0.82rem; color: var(--text-muted); }

/* Customer proposal responses badge (improvement #13) — sits beside the
   proposal-views badge on the breakdown page. */
.bd-resp-declined { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.bd-resp-comment  { background: #fef9c3; color: #854d0e; border-color: #fde047; }

/* Subcontractor rows in the Breakdown labor table (improvement #6). */
.bd-sub-input { padding: 4px; }
.bd-sub-amount { width: 110px; display: inline-block; }
.bd-sub-quote-cell { text-align: right; }
.bd-sub-quote-label { margin-right: 6px; }


/* ===== Notifications bell (#57) ===== */
.nfbell-wrap { position: relative; }
.nfbell-badge { position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--red); color: #fff; font-size: 0.65rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.nfbell-dropdown { right: 0; left: auto; min-width: 340px; max-width: 420px; }
.nfbell-viewall { border-top: 1px solid var(--line); font-weight: 600; }

/* ===== Topbar bookmarks menu (Emilio 2026-07-15) ===== */
.bmk-row { display: flex; align-items: center; }
.bmk-row .search-item { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bmk-remove { flex: 0 0 auto; border: none; background: none; color: var(--text-muted); font-size: 1rem; line-height: 1; padding: 6px 10px; cursor: pointer; border-radius: 6px; }
.bmk-remove:hover { color: var(--red); background: var(--surface-muted-bg, rgba(0,0,0,0.05)); }
.bmk-add { width: 100%; text-align: left; border: none; background: none; cursor: pointer; font: inherit; }
.bmk-add:hover { background: var(--surface-muted-bg, rgba(0,0,0,0.05)); }

/* ===== Field Service tab (client console, Nati 2026-07-08) ===== */
.fs-note { color: var(--text-muted); font-size: .85rem; margin: 0 0 10px; }
.fs-flexrow { display: flex; gap: 8px; flex-wrap: wrap; }
.fs-link-input { flex: 1; min-width: 260px; }
.fs-bform { border-bottom: 1px solid var(--border); }
.fs-input-wide { flex: 2; min-width: 180px; }
.fs-input-narrow { flex: 1; min-width: 120px; }
.fs-dl { display: flex; gap: 8px; font-size: .9rem; margin-bottom: 4px; }
.fs-dl-k { width: 140px; color: var(--text-muted); }
.fs-good { color: var(--emerald); font-weight: 700; }
.fs-bad { color: var(--red); font-weight: 700; }
.fs-hist-block { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 10px; }
.fs-hist-head { font-weight: 700; }
.fs-hist-findings { margin: 4px 0; }
.fs-hist-detail { font-size: .85rem; color: var(--text-muted); margin-bottom: 4px; }
.fs-hist-notes { font-size: .85rem; margin-top: 4px; }
.mc-h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin: 14px 0 6px; display: flex; align-items: center; gap: 8px; }
.fs-hist-prev { color: var(--text-muted); font-size: .8em; }
.fs-photo-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.fs-ph { position: relative; width: 72px; height: 72px; }
.fs-ph img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.fs-ph-del { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--border); background: var(--card); color: var(--red); font-size: .7rem; line-height: 1; cursor: pointer; padding: 0; }
