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

:root {
  /* The palette around slate (Steve, 2026-11-12; docs/marketing/launch-kit/brand.md): slate the one dark blue, for the
     frame and the actions (header, buttons, toggles); the brighter blue for headings inside a panel (table headers,
     Home's workflow tops) and text you click; slate dark only for hover. Was navy #002d56 with a slate header */
  --blue: #1d4354;
  --blue-dark: #142f3b;
  --blue-light: #e4ecef;
  --link: #1d5f8a;
  --red: #c30e2e;
  --burgundy: #7a2333;   /* a deep burgundy, the red accent's darker sibling: Home's company line (Steve, 2026-10-24) */
  --green: #1a7a3e;
  --border: #d1d5db;
  --bg: #e2e8ef;   /* blue-gray, a navy tint (Steve, 2026-11-12; was #e9ecef) */
  --bg-admin: #f8f9fa;
  --surface: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --label: #374151;   /* labels and subheadings: darker than --muted, so they stand out from what's empty */
  --empty: #9ca3af;   /* an empty value: Not set, None */
  --radius: 6px;
}

body {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

/* ── Header ── */
header {
  background: var(--blue);
  color: white;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  border-bottom: 3px solid var(--blue);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 56px;   /* was 52px; 2px more at top and bottom (Steve, 2026-10-16) */
}
.logo { height: 38px; width: auto; margin-right: 8px; }   /* was 34px; bigger with the taller menu bar (Steve, 2026-10-16) */
/* Shown instead of .logo when the tenant has no logo uploaded. */
.header-name { font-family: 'Rokkitt', serif; font-size: 20px; font-weight: 700; white-space: nowrap; margin-right: 8px; }
/* Signed in, the logo (or name) opens Home. */
header.signed-in .logo, header.signed-in .header-name { cursor: pointer; }
h1 { font-family: 'Rokkitt', serif; font-size: 18px; font-weight: 700; white-space: nowrap; margin-right: 16px; }

#app-nav { display: flex; gap: 4px; flex-shrink: 0; }
.tab-btn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.82);   /* was 0.75; a little brighter with the icons (Steve, 2026-10-16) */
  padding: 6px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  /* IBM Plex Sans, a heading font of the Innovation Mechanics brand (Steve, 2026-10-16, after
     trying Open Sans 600, Inter 500, Plex 600 and 14px). Set here because buttons don't inherit the
     page's font: the menu was the browser's default, Arial */
  font-family: 'IBM Plex Sans', 'Open Sans', -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 500;   /* the only weight loaded */
  transition: background 0.15s, color 0.15s;
}
.tab-btn:hover { background: rgba(255,255,255,0.15); color: white; }
.tab-btn.active { background: var(--red); color: white; }
.tab-btn { white-space: nowrap; }
.tab-btn { display: inline-flex; align-items: center; gap: 6px; }
.nav-icon { flex-shrink: 0; color: white; }   /* full white, so the icons pop (Steve, 2026-10-16) */

/* A tab's pages (Purchasing: Invoices, Line Items, Suppliers), under the header and sticky with
   it. Scrolls sideways rather than wrapping if a window is ever too narrow for it. */
.subnav {
  display: flex;
  gap: 4px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 59px;
  z-index: 99;
  overflow-x: auto;
  white-space: nowrap;
}
.subnav-btn {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--blue);
  padding: 10px 14px 7px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.subnav-btn:hover { background: var(--blue-light); }
.subnav-btn.active { border-bottom-color: var(--red); font-weight: 600; }

.header-inner .user-menu {
  margin-left: auto;
  position: relative;
  flex-shrink: 0;
  font-size: 13px;
}
/* The person signed in: a circle with their first initial (a person icon with no name) */
.user-avatar {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border-radius: 50%; border: none; padding: 0; background: #d5e2e7; color: var(--blue);
  font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
}
.user-avatar:hover { background: white; }
/* Its panel: drawn like the bell's list */
.user-panel {
  position: absolute; top: calc(100% + 8px); right: 0; width: 260px; background: var(--surface); color: var(--text);
  border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,0.25); padding: 6px; z-index: 150;
}
.user-panel-who { display: flex; gap: 10px; align-items: center; padding: 10px 10px 12px; }
.user-avatar-big, .user-avatar-big:hover { width: 38px; height: 38px; font-size: 17px; flex-shrink: 0; cursor: default;
  background: #cfe0f0; }
.user-panel-text { min-width: 0; }
.user-panel-name { font-weight: 600; }
.user-panel-email { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-panel-role { color: var(--muted); font-size: 12px; }
.user-panel-links { border-top: 1px solid var(--border); padding: 4px 0; }
.user-panel-links button {
  display: block; width: 100%; text-align: left; background: transparent; border: none; padding: 8px 10px;
  font-family: inherit; font-size: 13px; color: var(--text); cursor: pointer; border-radius: var(--radius);
}
.user-panel-links button:hover { background: var(--blue-light); }

/* Environment badge (DEV / STAGE) before the user menu; none in PROD. Bright fills unlike
   anything else in the header, so a test site is never mistaken for the live one. */
.env-badge {
  margin-left: auto;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  cursor: default;
}
.env-badge:not(.hidden) + .user-menu { margin-left: 12px; }
.env-badge.env-dev { background: #facc15; color: #1f2937; }
.env-badge.env-stage { background: #a855f7; color: white; }

/* Alerts: the bell between the menu and the DEV/STAGE badge, its count (red when invoices are
   waiting, amber otherwise) and the list it opens. It takes the free space the badge and the
   user menu used to share, so those sit right after it. */
.alerts { position: relative; margin-left: auto; flex-shrink: 0; }
.header-inner .alerts ~ .env-badge,
.header-inner .alerts ~ .user-menu { margin-left: 12px; }
.alerts-btn {
  position: relative; background: transparent; border: none; color: rgba(255,255,255,0.85);
  padding: 6px 8px; border-radius: var(--radius); cursor: pointer; display: flex; align-items: center;
}
.alerts-btn:hover { background: rgba(255,255,255,0.15); color: white; }
.alerts-count {
  position: absolute; top: 0; right: -2px; min-width: 17px; padding: 1px 5px; border-radius: 9px;
  background: #d99a0b; color: #1f2937; font-size: 11px; font-weight: 700; line-height: 15px; text-align: center;
}
.alerts-count.alerts-count-important { background: var(--red); color: white; }
.alerts-count.alerts-count-info { background: var(--link); color: white; }
.alerts-panel {
  position: absolute; top: calc(100% + 8px); right: 0; width: 320px; background: var(--surface); color: var(--text);
  border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,0.25); padding: 6px; z-index: 150;
}
.alert-item {
  display: block; width: 100%; text-align: left; background: transparent; border: none; border-left: 3px solid #d99a0b;
  padding: 9px 12px; margin: 2px 0; font-size: 13px; cursor: pointer; border-radius: 0 var(--radius) var(--radius) 0;
}
.alert-item:hover { background: var(--blue-light); }
.alert-item.alert-important { border-left-color: var(--red); font-weight: 600; }
.alert-item.alert-info { border-left-color: var(--link); }
.alerts-empty { padding: 10px 12px; color: var(--muted); font-size: 13px; }
/* A Needs you line with its ✕ (alert-choices.md, Release 2), and the note left in its place */
.alert-line { display: flex; align-items: flex-start; }
.alert-line .alert-item { flex: 1; min-width: 0; }
.alert-line-notice { padding: 9px 12px; margin: 2px 0; font-size: 13px; color: var(--muted); border-left: 3px solid var(--border, #d1d5db); }
.alert-line-notice .link-btn { margin-left: 8px; padding: 0; font-size: 13px; }
.alerts-footer { border-top: 1px solid var(--border, #e5e7eb); margin-top: 6px; padding: 8px 12px 4px; }
.alerts-footer .link-btn { padding: 0; font-size: 12.5px; }
.alerts-dismissed-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border, #e5e7eb); }
/* The list's two sections (alerts-v2.md, Part A): "Needs you" (counted live) and "Recent" (stored
   events, unread ones bold with a dot, each with an × to dismiss). */
.alerts-panel { max-height: 70vh; overflow-y: auto; }
.alerts-section {
  display: flex; align-items: center; justify-content: space-between; padding: 8px 12px 2px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted);
}
.alerts-dismiss-all {
  background: none; border: none; padding: 0; font-size: 12px; font-weight: 400; letter-spacing: 0; text-transform: none;
  color: var(--link); cursor: pointer;
}
.alerts-dismiss-all:hover { text-decoration: underline; }
.alert-event {
  display: flex; flex-wrap: wrap; align-items: flex-start; border-left: 3px solid #d99a0b; margin: 2px 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.alert-event:hover { background: var(--blue-light); }
.alert-event.alert-important { border-left-color: var(--red); }
.alert-event.alert-info { border-left-color: var(--link); }
.alert-event-open {
  flex: 1; min-width: 0; text-align: left; background: transparent; border: none; padding: 9px 4px 9px 12px;
  font-size: 13px; cursor: pointer; color: var(--text);
}
.alert-unread .alert-event-text { font-weight: 600; }
.alert-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--blue);
  margin-right: 6px; vertical-align: 1px;
}
.alert-event-when { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.alert-event-dismiss {
  background: transparent; border: none; color: var(--muted); font-size: 17px; line-height: 1; padding: 8px 10px;
  cursor: pointer; border-radius: var(--radius);
}
.alert-event-dismiss:hover { color: var(--text); background: rgba(0,0,0,0.06); }
.alert-event-detail {
  flex-basis: 100%; padding: 0 12px 10px; font-size: 12px; color: var(--muted); white-space: pre-line;
}

/* ── Main ── */
main { padding: 20px 24px; }
.tab { display: none; }
.tab.active { display: block; }

/* ── Toolbar ── */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
/* One row: the filters on the left and Export All on the right, as Invoices' filters sit
   with Upload Invoice, and the same 14px above the bulk bar. Export All isn't in the bulk
   bar below, so it isn't confused with the bulk bar's Export (selected jobs only); the
   last-updated text is at the bulk bar's left end. (The summary cards that sat above it
   moved to the Home page's snapshot, 2026-10-16.) */
.jobs-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
#jobs-bulk-bar .last-updated { margin-right: auto; }
.jobs-header .toolbar { margin-bottom: 0; }
.last-updated { font-size: 12px; color: var(--muted); white-space: nowrap; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
/* The Jobs page's choice filters (dropdowns) look like the typed ones beside them. A dropdown anywhere
   else gets the same look with class="tm-select" (the dropdown standard, docs/design/architecture.md). */
.filters input:not([type="checkbox"]), .filters select, select.tm-select {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 10px;
  font-size: 13px;
  background: var(--surface);
  min-width: 130px;
}
/* Filter boxes drawn the same in Chrome and Safari, which draw them differently by themselves (Steve,
   2026-10-15): one light hint color; dropdowns with our own down arrow and room to its right
   (Chrome's sat against the edge, Safari's was an up-down pair); date boxes with a calendar icon in
   both (Safari had none; Chrome's own picker button stays, invisible, over ours) and an empty date
   as light as a hint (Chrome drew mm/dd/yyyy like a value). The date boxes are `required` only so
   an empty one matches :invalid. Safari still shows today's date as an empty date's hint. */
.filters input::placeholder { color: var(--empty); opacity: 1; }
.filters select, select.tm-select {
  min-width: 0; padding: 5px 28px 5px 10px; color: var(--text); font-family: inherit;
  -webkit-appearance: none; appearance: none;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
}
.filters input[type="date"] {
  position: relative; padding-right: 32px; font-family: inherit; color: var(--text);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E") no-repeat right 9px center;
}
.filters input[type="date"]::-webkit-calendar-picker-indicator {
  position: absolute; top: 0; right: 0; bottom: 0; width: 32px; height: auto; margin: 0; padding: 0; opacity: 0; cursor: pointer;
}
.filters input[type="date"]:invalid::-webkit-datetime-edit { color: var(--empty); }
.filters button, .export-btn {
  padding: 6px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 13px;
  background: var(--surface);
}
.export-btn {
  background: var(--green);
  color: white;
  border-color: var(--green);
  font-weight: 600;
  white-space: nowrap;
}
.export-btn:hover { opacity: 0.9; }
.toolbar-actions { display: flex; gap: 8px; }
/* Line Items' View Invoice PDF: styled like Export to Excel (it carries .export-btn) when
   active. Disabled, it's greyed out; its tooltip says why (several invoices listed, or no
   stored PDF). */
.toolbar-pdf-btn:disabled { background: var(--surface); border-color: var(--border); color: var(--muted); font-weight: 400; cursor: default; opacity: 1; }
/* Jobs-tab per-row Export only (icon, no text) -- the toolbar's "Export
   All"/"Export to Excel" buttons keep their text and don't carry this
   class. Fixed width for the same reason as .comments-btn-icon: a
   consistent size next to the other icon buttons on the row. Outlined
   rather than the toolbar buttons' solid fill, matching the outlined
   look of the other row-level icon buttons (Comments, Delete) next to it
   -- no documented reason for the toolbar's solid green, just left as-is
   since it wasn't part of this change. */
.export-btn-icon { width: 44px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface); color: var(--green); border-color: var(--green); }
.export-btn-icon:hover { background: #d1fae5; opacity: 1; }

.filters button.filter-active {
  background: var(--blue-light);
  border-color: var(--blue);
  color: var(--blue);
  font-weight: 600;
}
.filters button.filter-active:hover { opacity: 0.9; }
/* Filter buttons are pills like the stage chips: both filter the rows */
.filters button[id$="-filter-btn"] { border-radius: 14px; padding: 3px 14px; align-self: center; border-width: 2px; }
.filters button[id$="-filter-btn"]:hover, .stage-chip:hover { border-color: var(--blue-dark); }
.filters button.filter-active:hover, .stage-chip.active:hover { border-color: var(--blue); }

/* ── Tables ── */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  font-size: 13px;
}
thead th {
  background: var(--link);
  color: white;
  text-align: left;
  padding: 9px 12px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
thead th:hover { background: var(--blue); }
thead th.th-center { text-align: center; }
thead th.th-right { text-align: right; } /* over right-aligned td.num currency values */
.sort-icon { font-size: 10px; opacity: 0.7; }
tbody tr { border-bottom: 1px solid var(--border); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--blue-light); }
td { padding: 8px 12px; vertical-align: top; }
/* Jobs and Invoices rows are one line of text beside a row of icon buttons: center the text
   on them. Line Items stays top-aligned: its cells can have a second line ("4 sticks"). */
#jobs-table td, #inv-table td { vertical-align: middle; }
/* Jobs: numbers stay on one line, the Estimate's (i) beside its amount; words like Job Type wrap instead */
#jobs-table td.num { white-space: nowrap; }
/* Jobs and Invoices: 1px less space above and below the action buttons, so rows are 2px shorter. */
#jobs-table td.actions-cell, #inv-table td.actions-cell { padding-top: 7px; padding-bottom: 7px; }

/* ── Row selection + bulk-action bar (Jobs/Line Items/Invoices) ── */
th.select-col, td.select-col { width: 1%; text-align: center; padding-right: 4px; }
thead th.select-col { cursor: default; }
thead th.select-col:hover { background: var(--link); }
.select-col input[type="checkbox"] { cursor: pointer; width: 15px; height: 15px; vertical-align: middle; }
.select-col input[type="checkbox"]:disabled { cursor: default; }
tbody tr.selected, tbody tr.selected:hover { background: #d6e4f0; }
.bulk-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
}
.bulk-count { color: #374151; margin-right: 4px; }
.bulk-clear {
  background: none;
  border: none;
  color: var(--blue);
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
  padding: 0 4px;
}
.bulk-btn {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.bulk-btn:hover:not(:disabled) { background: var(--blue-light); }
.bulk-btn:disabled { color: var(--muted); cursor: default; opacity: 0.55; }
.bulk-btn.bulk-danger:not(:disabled) { color: var(--red); border-color: var(--red); }
.bulk-btn.bulk-danger:hover:not(:disabled) { background: #fde8ec; }

/* ── Pager (below the Jobs/Line Items/Invoices tables) ── */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}
/* Darker than --muted: the summary sits on the gray page background, not a
   white card, where --muted text was hard to read. */
.pager-summary { color: #374151; }
.pager-controls { display: flex; align-items: center; gap: 4px; }
.pager-btn {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.pager-btn:hover:not(:disabled) { background: var(--blue-light); }
.pager-btn:disabled { color: var(--muted); cursor: default; opacity: 0.6; }
.pager-btn.current { background: var(--blue); border-color: var(--blue); color: white; font-weight: 600; cursor: default; }
.pager-gap { padding: 0 4px; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.invoice-count-cell { text-align: center; }
td.job-link {
  color: var(--link);
  cursor: pointer;
  font-weight: 500;
}
td.job-link:hover { text-decoration: underline; }

/* ── Form labels: the standard (Steve, 2026-10-17) ──
   A field you can change has its name above (or beside) the box in the dark text color, semibold,
   13px, sentence case, in every form: Settings cards, edit cards, dialogs, Job Detail, New customer.
   Hints under a box stay small and gray. Read-only details keep their navy bold capitals
   (.detail-card), so "information" and "something to change" look different. A checkbox's or
   radio button's words are a choice, not a field name: they stay plain. */
.modal label:has(> input[type="checkbox"]), .modal label:has(> input[type="radio"]),
.admin-section label:has(> input[type="checkbox"]), .admin-section label:has(> input[type="radio"]),
.card-table label:has(> input[type="checkbox"]), .card-table label:has(> input[type="radio"]),
.home-message-form label:has(> input[type="checkbox"]) { font-weight: 400; color: var(--text); }

/* ── Cards (a number with its label: Job Detail, the Home page's snapshot) ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  min-width: 160px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.card-label { font-size: 11px; color: var(--label); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.card-value { font-size: 22px; font-weight: 700; color: var(--blue); margin-top: 2px; }

/* ── Job detail ── */
#job-detail { background: var(--surface); border-radius: var(--radius); padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.back-btn {
  background: none;
  border: none;
  color: var(--blue);
  cursor: pointer;
  font-size: 13px;
  padding: 0;
  margin-bottom: 12px;
  font-weight: 500;
}
.back-btn:hover { text-decoration: underline; }
.back-sep { color: var(--muted); margin: 0 8px; font-size: 13px; }
.job-detail-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
#job-detail h2 { font-family: 'Rokkitt', serif; font-size: 20px; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 20px; }
.detail-section h3 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.supplier-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; }
.reassignment-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; color: var(--muted); }

/* ── Reassign Job ── */
.reassign-btn {
  width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: var(--radius);
  border: 1px solid var(--blue);
  background: var(--surface);
  color: var(--blue);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.reassign-btn:hover { background: var(--blue-light); }
/* View PDF: same outlined icon button as Reassign. Disabled (greyed, tooltip says why)
   for invoices imported before PDFs were kept, so the Actions column stays aligned. */
.pdf-btn {
  width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: var(--radius);
  border: 1px solid var(--blue);
  background: var(--surface);
  color: var(--blue);
  cursor: pointer;
}
.pdf-btn:hover:not(:disabled) { background: var(--blue-light); }
.pdf-btn:disabled { border-color: var(--border); color: var(--border); cursor: default; }
/* Left border on the whole Actions column (header + cells) so the
   action buttons read as a distinct control column, not more data.
   width: 1% is a shrink-to-fit hint for the table's auto layout --
   this column takes only what its buttons need, and any extra window
   width goes to the other (unconstrained) data columns instead. */
th.actions-col, td.actions-cell { border-left: 1px solid var(--border); width: 1%; }
th.actions-col { text-align: center; }
td.actions-cell { white-space: nowrap; }
/* vertical-align: middle -- without it, the icon buttons (Export/Comments,
   both display: inline-flex) establish a different inline baseline than
   the plain-text buttons (Reassign, Delete) next to them, so the default
   baseline alignment visibly offsets them top/bottom within the row. */
td.actions-cell button { margin-right: 6px; vertical-align: middle; }
td.actions-cell button:last-child { margin-right: 0; }
/* Per-row action buttons are 1px smaller on every side than the same buttons elsewhere
   (Job Detail, toolbars), so rows are 2px shorter: 1px less vertical padding, 2px less
   fixed width. The buttons set the row's height, so the row shrinks with them.
   Side padding is small because the widths are fixed and the icon is centered: the 14px
   from .export-btn/.comments-btn/.delete-invoice-btn (sized for text buttons) left less
   room than the icon, which squeezed it narrower and drew its lines thinner than the
   other icons'. flex-shrink: 0 keeps every icon at its own size. */
td.actions-cell button { padding: 5px 4px; }
td.actions-cell button svg { flex-shrink: 0; }
/* Table row buttons, the site standard (Steve, 2026-10-25; docs/design/architecture.md "Table row
   buttons"): every table's row buttons sit in its last column, headed "Actions" (th.actions-col);
   each is an outlined button 28px tall, an icon 42px wide (Comments 50px, for its count), or a few
   words where no icon says it ("Looks right", "Bill This"; .row-text-btn); blue to do or change
   something, red to remove, gray to cancel, amber for comments. */
td.actions-cell button { height: 28px; box-sizing: border-box; display: inline-flex; align-items: center;
  justify-content: center; }
td.actions-cell .reassign-btn, td.actions-cell .pdf-btn, td.actions-cell .export-btn-icon,
td.actions-cell .delete-invoice-btn, td.actions-cell .save-btn, td.actions-cell .remove-btn,
td.actions-cell .edit-btn, td.actions-cell .cancel-btn, td.actions-cell .row-icon-btn { width: 42px; }
td.actions-cell .comments-btn-icon { width: 50px; }
td.actions-cell .row-text-btn, td.actions-cell .review-btn { width: auto; padding: 0 10px; font-size: 13px;
  font-weight: 600; border: 1px solid var(--blue); border-radius: var(--radius); color: var(--blue);
  background: var(--surface); cursor: pointer; margin-left: 0; }
td.actions-cell .row-text-btn:hover:not(:disabled), td.actions-cell .review-btn:hover:not(:disabled) { background: var(--blue-light); }
td.actions-cell .row-text-btn.danger { border-color: #c30e2e; color: #c30e2e; }
td.actions-cell .row-text-btn.danger:hover:not(:disabled) { background: #fdecec; }
td.actions-cell .row-text-btn:disabled, td.actions-cell .review-btn:disabled, td.actions-cell .row-icon-btn:disabled {
  border-color: var(--border); color: var(--muted); background: var(--bg); cursor: not-allowed; opacity: 1; }
/* .row-icon-btn: any other icon (move up or down, deactivate, reactivate), blue; .danger red */
.row-icon-btn { display: inline-flex; align-items: center; justify-content: center; padding: 6px;
  border-radius: var(--radius); cursor: pointer; background: var(--surface); border: 1px solid var(--blue); color: var(--blue); }
.row-icon-btn:hover:not(:disabled) { background: var(--blue-light); }
.row-icon-btn.danger { border-color: #c30e2e; color: #c30e2e; }
.row-icon-btn.danger:hover:not(:disabled) { background: #fdecec; }
.job-detail-actions { display: flex; gap: 8px; }

/* ── Comments ── */
/* Dark yellow/gold, same everywhere the button appears (Jobs tab, Job Detail
   panel, Invoices tab) -- distinct from the blue Reassign button next to it
   and, being yellow rather than orange/amber, doesn't read as a second red
   next to the Delete button. */
.comments-btn {
  padding: 6px 14px;
  border-radius: var(--radius);
  border: 1px solid #a26b07;
  background: var(--surface);
  color: #a26b07;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.comments-btn:hover { background: #fef9c3; }
/* Jobs/Invoices rows only (icon + optional single-digit count, no
   "Comments" text) -- fixed width so the button doesn't visibly shrink
   when a job/invoice has zero comments vs. 1-9. Job Detail's text-label
   "Comments" button is unaffected since it doesn't carry this class. */
.comments-btn-icon { width: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
/* Count next to the icon -- .comments-btn sets font-weight: 600 for the
   button's own (now icon-only) label, but the number reads better lighter. */
.comments-count { font-weight: 400; }

/* ── Delete Invoice ── */
.delete-invoice-btn {
  padding: 6px 14px;
  border-radius: var(--radius);
  border: 1px solid #c30e2e;
  background: var(--surface);
  color: #c30e2e;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  /* Icon only (inline SVG, DELETE_ICON_SVG in app.js), no text -- only
     used in this one spot (Invoices-tab row, admin-only), so a fixed
     width/flex-centering lives directly on the base class rather than a
     separate -icon modifier like .export-btn-icon. */
  width: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.delete-invoice-btn:hover { background: #fdecec; }
.comments-modal { width: 480px; }
.comments-list {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 4px;
}
.comment-row { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.comment-row:last-child { border-bottom: none; }
.comment-date { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.comment-text { font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.comments-list .modal-hint { padding: 10px; }
.modal textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 10px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
}

/* ── Landing / login page ── */
.landing-page {
  min-height: calc(100vh - 59px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background:
    linear-gradient(180deg, rgba(10, 20, 30, 0.6), rgba(29, 67, 84, 0.8)),
    url('/img/background.jpg') center / cover no-repeat,
    var(--blue);
}
.landing-content {
  text-align: center;
  color: white;
  max-width: 420px;
  width: 100%;
}
.landing-content h1 { margin-bottom: 28px; }
/* The Trade Mechanics logo (the designer's final artwork, 2026-11-05) in place of the name in text */
.landing-logo img {
  display: block;
  width: 340px;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
}
/* One line when the window is wide enough (wider than the 420px column, centered on it); otherwise
   it wraps in even, centered lines. */
.landing-tagline {
  width: max-content;
  max-width: calc(100vw - 40px);
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  text-wrap: balance;
  font-size: 15px;
  color: rgba(255,255,255,0.9);
  margin-bottom: 60px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.landing-tenant {
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  margin-bottom: 28px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
/* No tenant yet: the tagline keeps the space above the sign-in card. */
.landing-tagline:has(+ .landing-tenant.hidden) { margin-bottom: 28px; }
.landing-signin-card {
  background: rgba(255,255,255,0.97);
  color: var(--text);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.4);
}
.landing-signin-card h3 { font-family: 'Rokkitt', serif; font-size: 17px; margin-bottom: 8px; }
.landing-signin-card p { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
#google-signin-button { display: flex; justify-content: center; }
/* Sign in with Microsoft: Microsoft's four squares, styled to match Google's button above it (Steve, 2026-11-12: its
   own guidelines' darker #8c8c8c border and Segoe font looked mismatched): Google's light border, text color and size,
   the card's full width and 40px high (app.js renders Google's at the card's width) */
.ms-signin { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; max-width: 400px; box-sizing: border-box; height: 40px; margin: 12px auto 0; padding: 0 12px; border: 1px solid #dadce0; border-radius: 4px; background: #ffffff; color: #3c4043; font-family: 'Google Sans', Roboto, Arial, sans-serif; font-size: 14px; font-weight: 500; cursor: pointer; }
.ms-signin:hover { background: #f8faff; border-color: #d2e3fc; }
.ms-signin.hidden { display: none; }
/* A password beside Google (password-sign-in.js), and the page that sets one */
.pw-form { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.pw-form.hidden { display: none; }
.landing-signin-card .pw-form p { margin-bottom: 0; }
.landing-signin-card #pw-step { margin-bottom: 12px; }
.pw-form h3 { text-align: center; margin-bottom: 0; }
.pw-field { display: flex; flex-direction: column; gap: 4px; }
.pw-field label { font-size: 13px; font-weight: 600; color: var(--label); }
.pw-field input { height: 36px; box-sizing: border-box; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius); font: inherit; }
.pw-field input.pw-code { height: 40px; font-size: 18px; letter-spacing: 0.2em; text-align: center; }
.pw-primary { display: flex; align-items: center; justify-content: center; height: 40px; border: 0; border-radius: var(--radius); background: var(--blue); color: white; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.pw-primary:disabled { opacity: 0.6; cursor: default; }
.pw-primary.hidden { display: none; }
.pw-link { border: 0; background: none; padding: 0; color: var(--link); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
.pw-row { display: flex; justify-content: space-between; }
.landing-signin-card .pw-hint, .pw-hint { font-size: 12px; color: var(--muted); }
.landing-signin-card .pw-notice { padding: 10px 12px; background: var(--blue-light); border-radius: var(--radius); font-size: 13px; color: var(--text); }
.pw-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.pw-or span { flex: 1; height: 1px; background: var(--border); }
.set-password-page { min-height: 100vh; box-sizing: border-box; }
.user-password { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.user-password p { margin: 0; }
.landing-legal { margin-top: 16px; font-size: 12px; }
.landing-legal a { color: rgba(255,255,255,0.85); }

/* ── Privacy policy (public, no login) ── */
.legal-page { max-width: 760px; margin: 0 auto; background: var(--surface); border-radius: var(--radius); padding: 28px 32px; line-height: 1.6; font-size: 14px; }
.legal-page h1 { font-family: 'Rokkitt', serif; font-size: 28px; margin-bottom: 4px; }
.legal-page h2 { font-family: 'Rokkitt', serif; font-size: 19px; margin: 22px 0 6px; }
.legal-page p, .legal-page li { margin-bottom: 8px; }
.legal-page ul { padding-left: 20px; }
.legal-updated { color: var(--muted); font-size: 12px; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  width: 380px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.modal h3 { font-family: 'Rokkitt', serif; font-size: 17px; margin-bottom: 10px; padding-right: 28px; }
.modal p { font-size: 13px; margin-bottom: 6px; }
.modal-hint { color: #4b5563; }
/* New Estimate: room between the Start from dropdown and the hint under it */
#est-new-hint { margin-top: 14px; }
.modal-subtitle { margin: -2px 0 10px; display: flex; gap: 6px; flex-wrap: wrap; }
/* A tag on what the dialog shows (a job type's category): a chip, so it isn't mistaken for a label */
.tag-chip { display: inline-block; font-size: 12px; line-height: 18px; padding: 1px 9px; border-radius: 10px;
  background: var(--blue-light); color: var(--blue); }
.tag-chip.tag-off { background: #f3f4f6; color: var(--muted); }
/* A dropdown sizes itself to its longest choice: never past the form's edge (a long job name on Schedule Work did) */
.modal select { max-width: 100%; }
.modal label { display: block; font-size: 13px; color: var(--text); font-weight: 600; margin: 12px 0 4px; }
/* Boxes that look like a person's or company's name are type="search": Safari ignores
   autocomplete="off" for its contacts AutoFill but skips search fields (see index.html's
   Reassign modal). Drawn like the text boxes, not as rounded pills, and without the browser's
   clear (x) button, which a text box doesn't have. */
input[type="search"] { -webkit-appearance: none; appearance: none; }
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
.modal input[type="text"],
.modal input[type="search"] {
  -webkit-appearance: none; /* Safari otherwise draws search fields as rounded pills and ignores padding */
  appearance: none;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 10px;
  font-size: 13px;
}
.modal-error {
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: var(--radius);
  padding: 6px 10px;
  font-size: 12px;
  margin-top: 10px;
}
/* Every form problem listed at once (showFormErrors in app.js): the list above the form's error
   line and buttons, and each box with a problem outlined in the same red */
.form-errors {
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: var(--radius);
  padding: 6px 10px;
  font-size: 12px;
  margin-top: 10px;
}
.form-errors-head { font-weight: 600; margin-bottom: 2px; }
.form-errors ul { margin: 0; padding-left: 18px; }
.form-errors ul:only-child { list-style: none; padding-left: 0; }
.field-problem,
.modal input.field-problem,
.modal select.field-problem,
.modal textarea.field-problem {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 1px #dc2626;
}
.field-problem:focus,
.field-problem:focus-visible { outline: 2px solid #dc2626 !important; outline-offset: 0; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}
.modal-actions button {
  padding: 6px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 13px;
}
.modal-actions button.primary {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
  font-weight: 600;
}
.modal-actions button.primary:hover { opacity: 0.9; }

/* ── Admin ── */
/* display intentionally left to the shared `.tab`/`.tab.active` rule (plain
   block) -- an unconditional `display: flex` here previously beat that rule
   on specificity (#tab-admin > .tab), so the Admin section rendered (and
   took up page height) on every tab, not just when active. The actual flex
   row lives on the child .admin-layout instead, which needs no such override
   since it's only ever present in the DOM while its #tab-admin.active
   ancestor is displayed. */
#tab-admin {
  margin: -20px -24px;
  min-height: calc(100vh - 59px);
}
.admin-layout { display: flex; width: 100%; }

/* Sticky under the header so category switching never requires scrolling
   back up, even when a category's content (e.g. Users) runs long. */
.admin-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--blue);
  padding: 16px 0;
  position: sticky;
  top: 59px;
  align-self: flex-start;
  height: calc(100vh - 59px);
  overflow-y: auto;
}
.admin-nav-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  color: rgba(255,255,255,0.75);
  padding: 12px 21px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.admin-nav-btn:hover { background: rgba(255,255,255,0.1); color: white; }
.admin-nav-btn.active {
  background: rgba(255,255,255,0.12);
  border-left-color: var(--red);
  color: white;
  font-weight: 600;
}

.admin-content {
  flex: 1;
  min-width: 0;   /* a wide table scrolls in its own box (Users), not the whole page */
  padding: 40px 24px;
  background: var(--bg-admin);
}
/* Pages of cards outside Settings (Suppliers, Buying Units, Items to Review): the Settings
   content area's look, without its sidebar. */
.card-page.active {
  margin: -20px -24px;
  padding: 16px 24px 40px;
  min-height: calc(100vh - 59px - 40px);
  background: var(--bg-admin);
}
.review-page-subhead { margin-top: 16px; margin-bottom: 4px; }
.admin-category { display: none; }
.admin-category.active { display: block; }

.admin-section {
  max-width: 540px;
  margin: 24px auto;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
/* Table-backed cards (Suppliers, Trusted Forwarders, Users) shrink-wrap to
   their table's natural (no-wrap) content width instead of a fixed cap --
   a plain 540px card wraps/cramps long supplier names or email addresses
   even when the window has plenty of room to spare. `table { width: 100% }`
   below still applies, but percentage widths resolve against the fit-content
   box's own intrinsic (max-content) sizing pass, so it ends up sized to
   exactly what the table needs rather than stretched or clipped. min-width
   keeps a short table (e.g. a single supplier) from looking oddly narrow;
   max-width keeps it from overflowing the content area on a narrow window,
   where it falls back to wrapping like before. */
.admin-section-fluid {
  width: fit-content;
  min-width: 420px;
  max-width: 100%;
}
/* Suppliers: rows of text boxes, which shrink to their own default width under
   fit-content. So the card takes the full width the window leaves (domains lists get
   long), capped at a width where a row still reads as one line. */
/* Users and Trusted Forwarders take the same full width (2026-10-17), so the two lists match
   however long their descriptions are. */
.admin-section-suppliers, .admin-section-wide {
  width: 100%;
  max-width: 1200px;
  min-width: 420px;
}
.admin-section-suppliers .forwarder-add-row input[type="text"],
.admin-section-suppliers .forwarder-add-row input[type="search"] { min-width: 0; }
/* Rows of text beside icon buttons (or text boxes, while one is edited): center the text on them. */
#suppliers-table td, #forwarders-table td, #users-table td { vertical-align: middle; }
.admin-section h2 { font-family: 'Rokkitt', serif; margin-bottom: 8px; }
.admin-section p { color: var(--muted); margin-bottom: 20px; }
.admin-section label { display: block; font-size: 13px; color: var(--text); font-weight: 600; margin: 12px 0 4px; }
.admin-section label.checkbox-filter { display: flex; margin-top: 10px; }
/* Settings → Display: wider cards (Steve, 2026-10-27), so the Jobs List Columns' boxes fit */
.admin-category[data-admin-category="display"] .admin-section { max-width: 900px; }
/* Settings → Email Agent: wider cards (Steve, 2026-10-31), so Trusted Forwarders' names and emails fit on one line */
.admin-category[data-admin-category="email-agent"] .admin-section { max-width: 900px; }
/* Settings → Display's Jobs List Columns: one checkbox per column, down then across, as many columns
   of them as fit (a fixed 2 × 4 grid squeezed the extra ones to nothing once there were 19) */
.jobs-columns-boxes { columns: 4 180px; column-gap: 24px; margin-top: 4px; }
.jobs-columns-boxes label.checkbox-filter { margin-top: 0; padding-top: 8px; break-inside: avoid; color: var(--text, inherit); }
.alerts-choice-boxes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin-top: 4px; }
.alerts-choice-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted, #6b7280); margin-top: 8px; }
.alerts-choice-boxes label.alert-choice { display: flex; align-items: flex-start; gap: 6px; margin-top: 8px; color: var(--text, inherit); }
.alerts-choice-boxes label.alert-choice input { margin-top: 3px; }
.alert-choice-label { display: block; font-weight: 600; font-size: 13px; }
.alert-choice-hint { display: block; font-size: 12px; color: var(--muted, #6b7280); }
/* An upload button is a <label> (for its hidden file box): it keeps the button's look, not a field label's. */
.admin-section label.file-label, .modal label.file-label { display: inline-block; color: white; font-size: 13px; }
.admin-section input[type="number"],
.admin-section input[type="time"] {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 10px;
  font-size: 13px;
  width: 140px;
}
.admin-section input[type="number"]:disabled,
.admin-section input[type="time"]:disabled { background: var(--bg); color: var(--muted); }
/* Company card: full-width text fields, with City / State / ZIP on one row. */
.company-form input[type="text"],
.company-form input[type="search"] {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 10px;
  font-size: 13px;
  width: 100%;
  box-sizing: border-box;
}
.company-form-row { display: flex; gap: 10px; }
.company-form-row > div { flex: 1; }
.company-form-row > .company-form-state { flex: 0 0 70px; }
.company-form-row > .company-form-zip { flex: 0 0 110px; }
.company-logo-row { display: flex; align-items: center; gap: 12px; }
.company-logo-row .file-label { margin-top: 0; }
/* The header's dark blue behind the preview, so the logo shows as it will in the header. */
.company-logo-preview {
  height: 56px; min-width: 52px; padding: 0 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--blue); color: white; border-radius: var(--radius);
  font-family: 'Rokkitt', serif; font-weight: 700; font-size: 18px; white-space: nowrap;
}
.company-logo-preview img { height: 38px; width: auto; }
.company-logo-remove {
  padding: 6px 14px; border-radius: var(--radius);
  border: 1px solid var(--red); background: var(--surface); color: var(--red);
  cursor: pointer; font-size: 13px;
}
.admin-section code {
  background: var(--blue-light);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
}
.admin-actions { margin-top: 18px; }
.admin-actions button.primary {
  padding: 6px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--blue);
  background: var(--blue);
  color: white;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
}
.admin-actions button.primary:hover { opacity: 0.9; }
.admin-unsaved {
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: var(--radius);
  padding: 6px 10px;
  font-size: 12px;
  margin-top: 10px;
}
.admin-success {
  color: #065f46;
  background: #d1fae5;
  border: 1px solid #6ee7b7;
  border-radius: var(--radius);
  padding: 6px 10px;
  font-size: 12px;
  margin-top: 10px;
}
.admin-run-status {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}
.admin-run-status.running { color: var(--blue); }
.admin-run-status.success { color: #065f46; }
.admin-run-status.failed { color: #991b1b; }
.admin-table { width: 100%; margin-top: 8px; }
.admin-table input[type="text"], .admin-table input[type="search"], .admin-table select:not(.tm-select) {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 8px;
  font-size: 13px;
}
.admin-table select { min-width: 90px; }
/* A standard dropdown in a Settings table: the row's width and font, its own padding for the arrow */
.admin-table select.tm-select { width: 100%; box-sizing: border-box; }
/* Trusted Forwarders/Users inline row actions -- same flat icon-button
   treatment as the Jobs/Invoices Reassign/Delete buttons: blue outline for
   the affirmative action, red for the destructive one. .remove-btn reuses
   DELETE_ICON_SVG since it's the same "remove a row" action as Invoices'
   Delete button, just a different label for this context -- width matches
   .delete-invoice-btn (48px) so the same icon renders at the same button
   size everywhere it appears. */
.save-btn, .remove-btn, .edit-btn, .cancel-btn {
  width: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--surface);
}
.save-btn, .edit-btn { border: 1px solid var(--blue); color: var(--blue); }
.save-btn:hover, .edit-btn:hover { background: var(--blue-light); }
/* Suppliers card: Cancel closes an open row unsaved -- grey, neither affirmative nor destructive. */
.cancel-btn { border: 1px solid var(--muted); color: var(--muted); }
.cancel-btn:hover { background: var(--bg); }
.remove-btn { border: 1px solid #c30e2e; color: #c30e2e; }
.remove-btn:hover { background: #fdecec; }
/* DELETE_ICON_SVG's own width/height attrs (18x18) are larger than every
   other icon in the app (16x16, including SAVE_ICON_SVG right next to this
   one) -- rescaled down here so .save-btn/.remove-btn end up the same
   height as each other, and the Invoices-tab Delete button the same height
   as its row's other buttons (so Invoices rows match Jobs rows). */
.remove-btn svg, .delete-invoice-btn svg { width: 16px; height: 16px; }
.save-btn:disabled, .remove-btn:disabled, .edit-btn:disabled {
  border-color: var(--border);
  color: var(--muted);
  background: var(--bg);
  cursor: not-allowed;
}
.forwarder-add-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.forwarder-add-row input[type="text"],
.forwarder-add-row input[type="search"] {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 10px;
  font-size: 13px;
}
.forwarder-add-row select:not(.tm-select) {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 10px;
  font-size: 13px;
}
.forwarder-add-row select.tm-select { padding-top: 7px; padding-bottom: 7px; }   /* as tall as the boxes beside it */
.supplier-sub-check { display: flex; align-items: center; gap: 5px; font-size: 13px; white-space: nowrap; }
.forwarder-add-row button.primary {
  padding: 6px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--blue);
  background: var(--blue);
  color: white;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
}

/* ── Upload ── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  color: var(--muted);
  transition: border-color 0.2s, background 0.2s;
}
.drop-zone.over { border-color: var(--blue); background: var(--blue-light); }
.file-label {
  display: inline-block;
  margin-top: 10px;
  padding: 7px 18px;
  background: var(--blue);
  color: white;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.file-label input { display: none; }
/* The Upload Invoices page: a Settings-style card on the plain page background. */
.upload-section { margin-top: 8px; }
.upload-result {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
}
.upload-result.success { background: #d1fae5; border: 1px solid #6ee7b7; color: #065f46; }
.upload-result.error { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; }
.upload-result.loading { background: var(--blue-light); border: 1px solid #b9cbd3; color: var(--blue); }
.upload-result.success a { color: inherit; font-weight: 600; white-space: nowrap; }
/* Upload page opened from a new supplier's notice: what to check on its first invoice. */
.upload-tips {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--blue-light);
  font-size: 13px;
}
.admin-section .upload-tips p { color: var(--text); margin: 6px 0; }
.upload-tips ul { margin: 6px 0 6px 20px; }
.upload-tips li { margin: 3px 0; }

/* Suppliers card: the suggestion shown after Add. */
.supplier-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--blue-light);
  border: 1px solid #b9cbd3;
  font-size: 13px;
}
.supplier-notice > div { flex: 1; }
.admin-section .supplier-notice p { color: var(--text); margin: 4px 0 0; }
.supplier-notice button.primary {
  padding: 6px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--blue);
  background: var(--blue);
  color: white;
  cursor: pointer;
  white-space: nowrap;
}
.notice-close {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.notice-close:hover { color: var(--text); }

/* ── Comment presence badge ── */
.comment-badge {
  display: inline-block;
  background: var(--blue-light);
  color: var(--blue);
  border: 1px solid #b9cbd3;
  border-radius: var(--radius);
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* ── Manual review flag ── */
.checkbox-filter { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); }
tr.needs-review { background: #fffbeb; }
tr.needs-review:hover { background: #fef3c7; }
.review-badge {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  border-radius: var(--radius);
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.clear-review-btn {
  padding: 2px 8px;
  border-radius: var(--radius);
  border: 1px solid #92400e;
  background: var(--surface);
  color: #92400e;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  margin-left: 4px;
}
.clear-review-btn:hover { background: #fef3c7; }
.flag-review-btn {
  padding: 2px 8px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
}
.flag-review-btn:hover { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
button.review-badge { cursor: pointer; font-family: inherit; }
button.review-badge:hover { background: #fde68a; }

/* ── Review dialog: why an invoice was flagged (tm.checks) ── */
.review-modal { width: 540px; }
.review-reasons {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.review-reasons .modal-hint { padding: 10px; margin: 0; }
.review-reason {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid #f59e0b;
}
.review-reason:last-child { border-bottom: none; }
.review-reason-note { border-left-color: var(--border); }
.review-reason-body { flex: 1; min-width: 0; }
.review-reason-label { font-size: 12px; font-weight: 600; color: #92400e; margin-bottom: 2px; }
.review-reason-note .review-reason-label { color: var(--muted); }
.review-reason-msg { font-size: 13px; word-break: break-word; }
.review-reason-advice { font-size: 12px; color: var(--muted); margin-top: 3px; }
.review-no-pdf { margin-top: 8px; }
.dismiss-reason-btn {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.dismiss-reason-btn:hover { background: #f0fdf4; color: #166534; border-color: #86efac; }
.modal-actions .review-pdf-btn { margin-right: auto; }

/* Line Items: lines with open review reasons */
/* Trade library: the purchase-unit line under a Line Items quantity or price ("4 coils", "$0.587/ft") */
.purchase-sub { font-size: 0.8em; color: #6b7280; white-space: nowrap; }
td.muted-cell { color: #9ca3af; }
.muted-text { color: #9ca3af; }
.library-subhead { margin-top: 24px; margin-bottom: 4px; }
/* Products & Units: new items to review (Product Catalog) */
.review-count-badge { display: inline-block; min-width: 20px; padding: 1px 7px; margin-left: 6px; border-radius: 10px;
  background: #fef3c7; color: #92400e; font-size: 12px; font-weight: 600; text-align: center; vertical-align: middle; }
.review-actions { white-space: nowrap; }
/* Products & Units: a purchase unit that lines use but nobody confirmed */
.unit-review-tag { display: inline-block; padding: 1px 8px; border-radius: 10px; background: #fef3c7; color: #92400e;
  font-size: 12px; font-weight: 600; white-space: nowrap; }
.unit-inputs { white-space: nowrap; }
.unit-inputs select { width: auto; margin-right: 4px; }
/* Buying Units' edit row: the unit and Estimated in dropdowns as wide as their words, so "of 10 ft" fits beside */
.admin-table .unit-inputs select.tm-select, .admin-table select.library-estimate-in { width: auto; }
.review-btn { padding: 4px 8px; font-size: 12px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface);
  cursor: pointer; margin-right: 4px; }
.review-btn:hover:not(:disabled) { background: #f3f4f6; }
.review-btn:disabled { opacity: 0.5; cursor: default; }
.product-review-table input.product-mfr { width: 120px; }
.product-review-table input.product-catalog { width: 100px; }
.product-review-table input.product-std { display: block; width: 100%; min-width: 180px; margin-top: 4px; }
.product-review-table input.product-category { width: 170px; }
/* Products & Units: the ETIM credit its licence asks for */
.attribution-note { margin-top: 20px; font-size: 12px; color: var(--muted); }
.attribution-note a { color: inherit; }
.admin-table input.library-length { width: 70px; }
tr.line-flagged { background: #fffbeb; }
tr.line-flagged:hover { background: #fef3c7; }
.line-review-icon { color: #b45309; margin-right: 5px; cursor: help; }
/* Notes (no check uses them today) keep the amber icon so they're noticed, on a lighter row. */
tr.line-noted { background: #fffdf5; }

/* Comments written by Trade Mechanics (e.g. why an invoice was flagged) */
.comment-system { background: #f8fafc; }
.comment-crew { font-size: 11px; font-weight: 600; padding: 0 6px; border-radius: 8px; margin-left: 6px; background: var(--blue-light); color: var(--blue); white-space: nowrap; }
.comment-crew.comment-office { background: #f3f4f6; color: var(--muted); }
.comment-source { font-weight: 600; color: var(--text, inherit); }

.hidden { display: none !important; }

/* ── Duplicate Check ── */
.dedup-modal { width: 860px; max-height: 88vh; display: flex; flex-direction: column; }
.dedup-clusters { overflow-y: auto; margin-top: 8px; }
.dedup-cluster { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 12px; }
.dedup-members { width: 100%; font-size: 13px; box-shadow: none; }
.dedup-members thead th, .dedup-members thead th:hover { cursor: default; background: none; }
.dedup-members tbody tr:hover { background: none; }
.dedup-members th { font-size: 11px; color: var(--muted); text-align: left; font-weight: 600; padding: 2px 6px; }
.dedup-members td { padding: 4px 6px; vertical-align: top; }
.dedup-name { font-weight: 600; white-space: nowrap; }
.dedup-sub { color: var(--muted); font-size: 12px; }
.dedup-evidence { margin: 6px 0; font-size: 12px; color: var(--muted); }
.dedup-verdict { font-weight: 600; }
.dedup-verdict-yes { color: #166534; }
.dedup-verdict-no { color: var(--red); }
.dedup-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.dedup-actions .dedup-new-job { flex: 1; min-width: 200px; }
.dedup-actions button {
  padding: 6px 12px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; font-size: 13px;
}
.dedup-actions button.primary { background: var(--blue); color: white; border-color: var(--blue); font-weight: 600; }
.dedup-pending { font-size: 13px; margin-bottom: 4px; }
.dedup-runs { margin-top: 16px; }
/* The Data Quality cards are the standard 540px width (2026-10-17, like the other settings cards):
   the recent runs table fits with tighter cells, a short "Groups" heading, and a long "By" cut short
   (its full text on hover). */
.dedup-runs-table th, .dedup-runs-table td { padding: 6px 8px; }
.dedup-runs-table td:first-child { white-space: nowrap; }
.dedup-runs-table td.dedup-run-by { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dedup-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.dedup-advanced { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 10px; }
.dedup-advanced summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.dedup-advanced[open] summary { margin-bottom: 4px; }
.dedup-runs-table { font-size: 12px; }
.admin-actions button.secondary {
  margin-left: 8px; padding: 6px 16px; border-radius: var(--radius);
  border: 1px solid var(--blue); background: var(--surface); color: var(--blue); cursor: pointer; font-size: 13px;
}
.admin-actions button:disabled { opacity: 0.5; cursor: default; }
/* A row of several buttons that may not fit on one line (Jobs List Columns): they wrap with space
   between them, and a wrapped button starts at the left edge */
.admin-actions.wrap-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-actions.wrap-actions button.secondary { margin-left: 0; }
/* Settings' older dropdowns; a standard one (select.tm-select) keeps its own padding, for its arrow */
.admin-section select:not(.tm-select), .admin-section input.dedup-excluded {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 7px 10px; font-size: 13px;
}
.admin-section input.dedup-excluded { width: 100%; box-sizing: border-box; }
/* Job Detail: names merged into this job. */
.alias-row { display: flex; justify-content: space-between; align-items: center; padding: 3px 0; font-size: 13px; }
.alias-remove {
  padding: 2px 10px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); cursor: pointer; font-size: 12px;
}

/* Duplicate Check Schedule: day and time side by side */
.dedup-schedule-when { display: flex; gap: 16px; flex-wrap: wrap; }
.dedup-schedule-when > div { display: flex; flex-direction: column; }

/* Company card until an admin clicks Edit (and always for non-admins): a detail-card view, labels
   beside values (Steve, 2026-10-17: the form shown as text looked messy). */
/* A read-only list of labels beside values on a Settings card (Company, About): no row lines,
   frame or hover, just the labels and values. */
.label-list { border-collapse: collapse; background: none; box-shadow: none; border-radius: 0; }
.label-list tr, .label-list th, .label-list td { border: none; background: none; }
.label-list tbody tr:hover { background: none; }
.label-list th { width: 150px; padding: 6px 16px 6px 0; line-height: 18px; }
.label-list td { padding: 5px 0; line-height: 20px; }
.company-view { margin-top: 4px; }
.company-view .card-subhead { margin: 8px 0 2px; padding-top: 14px; border-top: 1px solid var(--border); }
.company-view .company-logo-preview { display: inline-flex; }
/* The Branding rows get more room, so the logo and the image don't run together. */
.company-view tr.company-view-brand th { padding-top: 14px; padding-bottom: 14px; }
.company-view tr.company-view-brand td { padding-top: 12px; padding-bottom: 12px; }
.company-view .company-banner-preview { display: inline-block; vertical-align: middle; }
.company-view-note { display: block; font-size: 12px; }

/* Catalog -> Products: the list and its detail card */
.page-intro { color: var(--muted); margin: -4px 0 10px; font-size: 13px; }
#prod-search { width: 300px; }
#prod-category { width: auto; max-width: 280px; }
#prod-table td.num { white-space: nowrap; }
tr.clickable-row { cursor: pointer; }
tr.clickable-row:hover td { background: var(--blue-light); }
.modal.product-modal { width: 760px; max-height: 88vh; overflow-y: auto; }
.card-subhead { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--label); margin: 18px 0 6px; }
.card-table th { text-align: left; font-weight: 600; color: var(--text); font-size: 13px; padding: 3px 16px 3px 0; white-space: nowrap; vertical-align: top; width: 1%; }
.card-table td { padding: 3px 0; }
/* Read-only detail cards (Job Detail, Customer, a product's "What it is", a job type, About): labels
   bold in the header's navy, to stand apart from their values (Steve, 2026-10-16). Edit forms keep
   the plain labels beside their boxes. */
.detail-card th { color: var(--blue); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .03em;
  padding-top: 5px; }
.card-table input[type="text"], .card-table input[type="search"] { width: 320px; }
.card-list { margin-bottom: 8px; }
.card-jobs a { color: var(--link); }


/* ── Prices (Price history on the product card, Purchasing → Price Comparison) ── */
#price-table td.num { white-space: nowrap; }
.price-stale { color: var(--muted); }
.price-lowest { font-size: 11px; font-weight: 600; color: var(--green); background: #e7f4ec; border-radius: 3px; padding: 0 4px; }
.price-lowest-cell { color: var(--green); font-weight: 600; }
.price-left-out td { color: var(--muted); }
.price-row-focus td { background: #fff7d6; }
.price-history-table td.num { white-space: nowrap; }
.review-reason-link { display: inline-block; font-size: 12px; margin-top: 3px; }
.price-chart { position: relative; margin: 4px 0 10px; }
.price-chart svg { width: 100%; height: auto; display: block; }
.chart-grid { stroke: #e5e7eb; stroke-width: 1; }
.chart-axis { font-size: 11px; fill: var(--muted); }
.chart-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-dot { stroke: var(--surface); stroke-width: 2; }
.chart-hit { fill: transparent; cursor: default; }
.chart-tip { position: absolute; transform: translate(-50%, -100%); background: var(--text); color: #fff; font-size: 12px;
  padding: 3px 7px; border-radius: 4px; white-space: nowrap; pointer-events: none; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--text); margin-top: 2px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* ── Service Catalog (Catalog → Services, job types on Jobs and Job Detail) ── */
#svc-table td.num { white-space: nowrap; }
/* Two tiers: a category is a section heading (navy rule, small caps, its count); its job types indent under it. */
#svc-table tr.group-row td { background: #e9eef1; border-top: 2px solid var(--blue); padding: 14px 12px 6px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--blue); }
#svc-table tbody tr:first-child.group-row td { border-top: none; }
#svc-table tr.group-row:hover td { background: #e9eef1; }
#svc-table .group-count { margin-left: 8px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); }
#svc-table tr.type-row td:first-child { padding-left: 32px; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #f5f8fb; }
tr.inactive-row td { color: var(--muted); }
.suggested-type { color: var(--muted); font-style: italic; }
/* Job stages: a chip per stage with its count, above the Jobs table */
.stage-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.stage-chip { font-size: 13px; padding: 3px 12px; border-radius: 14px; border: 2px solid var(--border);
  background: var(--surface); color: var(--label); cursor: pointer; }
.stage-chip.active { background: var(--blue-light); border-color: var(--blue); color: var(--blue); font-weight: 600; }
.stage-chip-count { font-weight: 600; margin-left: 2px; }
.return-tag { font-size: 11px; padding: 0 7px; border-radius: 9px; background: #e3f1e8; color: #1d5e36; margin-left: 4px; white-space: nowrap; }
.idle-tag { font-size: 11px; padding: 0 7px; border-radius: 9px; background: #fdf3d7; color: #7a5300; margin-left: 4px; white-space: nowrap; }
/* A yes not signed yet beside the stage (the signed proposal, Release 1a) */
.unsigned-tag { font-size: 11px; padding: 0 7px; border-radius: 9px; background: var(--blue-light); color: var(--blue); margin-left: 4px; white-space: nowrap; }
.job-summary-value .unsigned-tag { font-size: 11px; font-weight: 500; vertical-align: middle; }
.accept-btn { font-size: 12px; padding: 1px 8px; margin-left: 6px; }
/* A job's type buttons (alerts-v2.md, Part C): checkmark and pencil; with a type set, the pencil on hover */
.jt-wrap { display: inline-flex; align-items: center; gap: 4px; }
.jt-icon-btn, .job-fields .jt-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--label); cursor: pointer; }
.jt-icon-btn:hover { border-color: var(--blue-dark); color: var(--blue-dark); }
.jt-accept { color: #1a7f37; }
.jt-accept:hover { border-color: #1a7f37; color: #1a7f37; background: #eef8f0; }
.jt-picker { font-size: 13px; max-width: 220px; }
.job-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; margin: 4px 0 14px; }
/* Job Detail's fields: two columns of label and value, like the Customer card (Steve, 2026-10-16:
   they were on one line). Labels in the header's navy, bold, to stand apart from their values
   (Steve, 2026-10-16: too little contrast; an underline was tried first) */
/* The two columns share the page width equally (Edit at the right), so long text wraps in its own
   column and a wide window is used */
#job-detail-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: start;
  gap: 4px 40px; margin: 4px 0 16px;
  /* framed like the Materials and Purchases cards below, so it reads as its own section (Steve,
     2026-10-16; a light shading was tried first and looked out of place above the white cards) */
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06); padding: 12px 18px; }
#job-detail-fields .job-card tbody tr { border-bottom-color: #eceef1; }
.job-card th { min-width: 90px; }
.job-card { width: 100%; background: none; box-shadow: none; border-radius: 0; }
.job-card th, .job-card td { border: none; background: none; }
.job-card td { padding: 3px 0; vertical-align: top; }
#job-detail-fields > button { align-self: start; }
.job-fields label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; font-weight: 600; color: var(--text); }
.job-fields label select { font-size: 14px; color: var(--text); }
#jobtype-modal textarea { width: 100%; box-sizing: border-box; font: inherit; }
#set-jobtype-select { width: 100%; margin: 6px 0 4px; }
#jobs-type { max-width: 170px; }   /* sized by its longest job type name otherwise */
.job-fields button, .accept-btn, #svc-add-btn {
  padding: 5px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; font-size: 13px; font-family: inherit;
}
.accept-btn { padding: 1px 8px; font-size: 12px; }
.job-fields button.primary, #svc-add-btn { background: var(--blue); color: white; border-color: var(--blue); font-weight: 600; }
.job-fields button:hover, .accept-btn:hover, #svc-add-btn:hover { opacity: 0.9; }
#tab-services .toolbar { display: flex; justify-content: space-between; align-items: center; }
#jobtype-modal .card-table input[type=text], #jobtype-modal select { width: 100%; box-sizing: border-box; }

/* ── New Job / Edit Job, Customers (Service Catalog Release 2b) ── */
.primary-btn {
  padding: 6px 14px; border-radius: var(--radius); border: 1px solid var(--blue); cursor: pointer; font-size: 13px;
  font-family: inherit; background: var(--blue); color: white; font-weight: 600; white-space: nowrap;
}
.primary-btn:hover { opacity: 0.9; }
.jobs-header-actions { display: flex; gap: 8px; }
.job-fields .accept-btn { padding: 1px 8px; font-size: 12px; }
#job-modal .card-table input:is([type=text], [type=search]), #job-modal select,
#customer-modal .card-table input:is([type=text], [type=search]), #contact-modal .card-table input:is([type=text], [type=search]) { width: 100%; box-sizing: border-box; }
#job-modal .card-table td { padding: 4px 0; }
/* Room for the focus ring: the boxes fill the cell, and the dialog's scroll area clips at its edge (Safari) */
#job-modal .card-table td, #customer-modal .card-table td, #contact-modal .card-table td { padding-right: 4px; }
/* The same on the left: tables clip at their rounded edge, and Safari cut off the labels' first letter */
#job-modal .card-table th, #customer-modal .card-table th, #contact-modal .card-table th { padding-left: 4px; }
#job-modal select:not(.tm-select), #job-modal .card-table input:is([type=text], [type=search]), #customer-modal .card-table input:is([type=text], [type=search]), #contact-modal .card-table input:is([type=text], [type=search]) {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 10px; font-size: 14px;
  font-family: inherit; color: var(--text); background: var(--surface);
}
#customer-detail { background: var(--surface); border-radius: var(--radius); padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
#customer-detail h2 { font-family: 'Rokkitt', serif; font-size: 20px; }
#customer-detail .job-detail-actions button {
  padding: 6px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; font-size: 13px; font-family: inherit; font-weight: 600;
}
#customer-detail .job-detail-actions button:first-child { background: var(--blue); color: white; border-color: var(--blue); }
.site-town { display: flex; gap: 6px; margin-top: 6px; }
#job-modal .site-town input:is([type=text], [type=search]) { width: auto; flex: 1; min-width: 0; }
#job-modal .site-town #jm-site-city { flex: 3; }
.link-btn { background: none; border: none; padding: 4px 0 0; color: var(--link); cursor: pointer; font-size: 12px; font-family: inherit; }
.link-btn:hover { text-decoration: underline; }
#tab-customers .toolbar { display: flex; justify-content: space-between; align-items: center; }
#cust-search { width: 280px; }
.customer-card { margin-bottom: 18px; }
/* The job dialog's New customer and New contact areas, and the Person / Company tags */
.new-customer { margin-top: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-admin); font-size: 13px; }
.new-customer p { margin: 0 0 8px; }
.nc-kind { display: flex; gap: 14px; align-items: center; color: var(--label); }
.nc-kind label { display: flex; gap: 4px; align-items: center; cursor: pointer; color: var(--text); }
.nc-kind input[type=radio] { width: auto; margin: 0; }
.nc-pair { display: flex; gap: 8px; margin-top: 8px; }
.nc-hint { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
/* pickList: a picklist drawn by the page under its text box */
.pick-list { position: relative; display: block; }
.pick-list ul { position: absolute; left: 0; right: 0; top: 100%; z-index: 5; margin: 2px 0 0; padding: 4px 0; list-style: none;
  max-height: 220px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.pick-list li { padding: 6px 10px; cursor: pointer; font-size: 13px; }
.pick-list li:hover, .pick-list li.on { background: var(--blue-light); }
.nc-pair label { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 13px; font-weight: 600; color: var(--text); }
#job-modal .nc-pair input:is([type=text], [type=search]) { width: 100%; }
.kind-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 10px; background: var(--blue-light); color: var(--blue); font-size: 11px; font-weight: 600; vertical-align: middle; }
.kind-icon { display: inline-flex; vertical-align: middle; color: var(--blue); }
#customers-table .type-col { width: 56px; text-align: center; }
#customer-detail h2 .kind-icon svg { width: 20px; height: 20px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 8px; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.section-head h3 { margin: 0; border: none; padding: 0; }
.section-head .primary-btn { padding: 4px 12px; font-size: 12px; }
#customer-detail .detail-section + .detail-section { margin-top: 22px; }
.modal-actions .modal-remove { margin-right: auto; color: var(--red); }
#job-modal-estimate { margin-right: auto; }
#customer-modal input[type=checkbox], #contact-modal input[type=checkbox] { width: auto; }

/* ── Every dialog: an X that stays in view, top right (it closes, like Cancel or Close);
   Escape does the same; a click outside does nothing (app.js, "Dialogs") ── */
.modal-x {
  position: sticky; top: 0; z-index: 2; display: block; margin: -14px -14px -14px auto;
  width: 28px; height: 28px; padding: 0; border: none; border-radius: 50%; background: var(--surface);
  color: var(--muted); font-size: 22px; line-height: 26px; text-align: center; cursor: pointer;
}
.modal-x:hover { background: var(--blue-light); color: var(--text); }
.dedup-modal .modal-x { flex: none; }

/* An empty value (Not set, None, Not known yet): light and italic, so a filled one stands out. */
.not-set { color: var(--empty); font-style: italic; }

/* ── Updates history and Settings → About (tm.updates) ── */
.updates-modal { width: 640px; }
.update-entry { border-top: 1px solid var(--border); padding: 12px 0 4px; }
.update-entry h4 { font-size: 15px; color: var(--blue); margin-bottom: 2px; }
.update-meta { color: var(--label); font-size: 12px; font-weight: 600; margin-bottom: 8px; }
.update-entry ul { margin: 0 0 8px 18px; font-size: 13px; }
.update-entry li { margin-bottom: 5px; line-height: 1.45; }
.update-check { background: #fff7d6; border-left: 3px solid #d99a0b; padding: 8px 10px; border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 13px; line-height: 1.45; margin-bottom: 10px; }
.update-entry:not(.update-latest) { color: #374151; }
.about-table { margin: 10px 0 8px; }
/* Settings → Sample Data's confirmation, on the card itself (the Sandbox) */
.sample-data-confirm { margin-top: 12px; padding: 12px 14px; border: 1px solid #f0c36d; background: #fffbeb; border-radius: 6px; }
.sample-data-confirm p { margin: 0 0 4px; }
.about-copyright { color: var(--muted); font-size: 12px; }
.about-link { margin-left: 12px; font-size: 13px; align-self: center; }

/* ── Home (docs/execution-plans/home-page.md) ── */
/* The banner: a photo strip from edge to edge under the menu, darker on the left so the welcome
   reads in white; the logo on a see-through navy tile (a white one hid Klotz's white lettering).
   The photo is set from GET /api/home's banner_url. */
.home-hero {
  margin: -20px -24px 22px;
  padding: 56px 24px 40px;
  background-color: var(--blue);
  background-position: center 60%;
  background-size: cover;
  background-repeat: no-repeat;
}
.home-welcome { max-width: 1280px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.home-welcome h1 { font-family: 'Rokkitt', serif; font-size: 38px; font-weight: 700; color: white; white-space: normal; margin: 0; text-shadow: 0 2px 6px rgba(0,0,0,0.4); }
.home-company { font-size: 16px; color: rgba(255,255,255,0.9); margin-top: 2px; }
.home-logo { max-height: 84px; width: auto; background: rgba(29, 67, 84, 0.85); padding: 8px 12px; border-radius: var(--radius); }
.home { max-width: 1280px; margin: 0 auto; }   /* 1100 until 2026-11-02 (Steve): cards, not paragraphs */
.home-h2, .home-section-head h2 { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--blue); }
.home-h2 { margin: 26px 0 12px; }
/* The heading sits at the bottom of the row (beside a taller button), so every Home heading is the same
   12px above what it heads */
.home-section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 12px; }
.home-btn { font-family: inherit; font-size: 13px; padding: 6px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--blue); cursor: pointer; }
.home-btn:hover { border-color: var(--blue); }
.home-btn-primary { background: var(--blue); color: white; border-color: var(--blue); font-weight: 600; }
/* Messages from the office: a bar on the left, red when important. */
.home-message-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; }
.home-message-form textarea { width: 100%; font-family: inherit; font-size: 14px; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius); resize: vertical; }
.home-message-form-row { display: flex; align-items: center; gap: 16px; margin-top: 8px; font-size: 13px; color: var(--label); }
.home-message-form-row > label:not(:has(input[type="checkbox"])) { font-weight: 600; color: var(--text); }
.home-message-form-row input[type="date"] { font-family: inherit; font-size: 13px; padding: 3px 6px; border: 1px solid var(--border); border-radius: var(--radius); }
.home-message-error { color: var(--red); }
.home-message-form-row .home-btn-primary { margin-left: auto; }
.home-message { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--blue); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 8px; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.home-message-important { border-left-color: var(--red); }
.home-message-text { font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.home-message-important .home-message-text { font-weight: 600; }
.home-message-meta { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; gap: 12px; align-items: baseline; }
.home-message-meta .link-btn { padding: 0; }
.home-empty { color: var(--empty); font-style: italic; }
/* The alerts reminder: amber, or red when something important waits; a solid left edge like a message's. */
.home-reminder { margin-top: 16px; padding: 10px 14px; background: #fef3c7; border: 1px solid #fcd34d; border-left: 4px solid #d97706; border-radius: var(--radius); font-size: 14px; display: flex; align-items: center; gap: 6px; }
.home-reminder .link-btn { padding: 0; font-size: 14px; }
.home-reminder-important { background: #fde8eb; border-color: #f3a5b1; border-left-color: var(--red); }
.home-dot { width: 9px; height: 9px; border-radius: 50%; background: #d97706; }
.home-reminder-important .home-dot { background: var(--red); }
/* The snapshot: one button per card, so each opens its page. */
/* The cards are as wide as what's in them (Job activity's stage counts the widest), growing to share the
   row and wrapping only when they don't fit (Steve, 2026-10-24: Owed to you on the same line) */
.home-snapshot { display: flex; flex-wrap: wrap; gap: 12px; }
.home-snapshot > .home-card { flex: 1 1 auto; max-width: 260px; }
.home-snapshot > .home-card-wide { max-width: 420px; }
.home-card { text-align: left; display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; box-shadow: 0 1px 2px rgba(0,0,0,0.06); cursor: pointer; font-family: inherit; }
.home-card:hover { border-color: var(--blue); }
.home-card .card-value { font-size: 28px; }
.home-card-sub { font-size: 12px; color: var(--muted); }
/* Job Activity: two columns wide, with a count per stage under its number, each opening Jobs on that stage */
.home-card-headline { display: flex; align-items: baseline; gap: 10px; }
.home-card-stages { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 8px; }   /* each count on one line, as many to a row as fit */
.home-card-stage { white-space: nowrap; text-align: left; font-family: inherit; font-size: 12px; padding: 2px 9px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; }
.home-card-stage b { color: var(--blue); }
.home-card-stage:hover { border-color: var(--blue); }
.home-card-stage-none { color: var(--muted); }
.home-card-stage-none b { color: var(--muted); }
/* The snapshot's period: two joined buttons, the chosen one filled */
.home-snapshot-head { margin: 26px 0 12px; }
/* Cards you choose (docs/execution-plans/home-cards.md): up to 5, kept on one row on a desktop window by
   narrowing (each to its smallest width), wrapping below that. The smallest widths fit in 1100px:
   Job activity 330 + This week 270 + three at 150 + four 12px gaps = 1098; the page is up to 1280px wide */
@media (min-width: 1200px) {
  .home-snapshot { flex-wrap: nowrap; }
  .home-snapshot > .home-card { min-width: 150px; flex: 1 1 0; }
  .home-snapshot > .home-card-wide { min-width: 270px; flex: 1.5 1 0; }
  .home-snapshot > .home-card-activity { min-width: 330px; flex-grow: 2.2; }   /* at 1280: about 408px, its counts in two rows */
}
.home-card .card-value.home-card-text { font-size: 17px; margin-top: 4px; overflow-wrap: break-word; }
.home-snapshot > .home-card .card-value.home-card-value-long { font-size: 22px; }
.home-snapshot-info .info-tip { margin: 0 0 0 4px; vertical-align: 1px; font-size: 10px; text-transform: none; letter-spacing: 0; }
.home-card-line { font-size: 12px; color: var(--label); }
.home-card-line-first { margin-top: 6px; }
.home-card-warn { color: #92400e; }
.home-card-days { display: flex; flex-direction: column; margin-top: 6px; }
.home-card-day { display: grid; grid-template-columns: 34px 1fr; gap: 8px; font-size: 12px; padding: 3px 0; border-top: 1px solid #f1f3f5; }
.home-card-day:first-child { border-top: none; }
.home-card-day b { color: var(--label); font-weight: 600; }
.home-card-day-none span { color: var(--muted); }
.home-card-today { background: var(--blue-light); border-radius: 4px; padding: 3px 4px; margin: 0 -4px; border-top-color: transparent; }
.home-card-today + .home-card-day { border-top-color: transparent; }
/* Settings -> Display's Home Page Cards */
.admin-section.home-cards-section { max-width: 760px; }
.home-cards-boxes { display: flex; flex-direction: column; }
.home-cards-boxes label.home-cards-choice { display: grid; grid-template-columns: 22px 170px 1fr; gap: 8px; align-items: start;
  margin: 0; padding: 7px 0; border-top: 1px solid #f1f3f5; font-weight: 400; }
.home-cards-choice input { margin: 2px 0 0; }
.home-cards-name { font-weight: 600; color: var(--text); }
.home-cards-desc { color: var(--muted); font-size: 13px; }
.home-cards-admin { font-size: 11px; font-weight: 600; color: var(--burgundy); margin-left: 6px; }
.home-cards-off .home-cards-name { color: var(--empty); }
.home-cards-off .home-cards-desc { color: #c4c8ce; }
.home-cards-count { margin-top: 12px; font-size: 13px; color: var(--label); }
.period-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.period-toggle button { font-family: inherit; font-size: 12px; padding: 4px 12px; border: none; background: var(--surface);
  color: var(--blue); cursor: pointer; }
.period-toggle button + button { border-left: 1px solid var(--border); }
.period-toggle button.active { background: var(--blue); color: white; font-weight: 600; }
/* How the work flows: six tiles in the business's order, arrow-shaped bands so the row reads as a
   flow; a stage with nothing built is gray, "Coming soon!". Narrower windows wrap the tiles. */
.home-flow-h2 { margin-top: 30px; }
.home-workflow { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); grid-auto-rows: auto; gap: 8px; }
/* Each tile spans two rows of the workflow grid (band, body) and shares them with its neighbors, so
   every band in a row is as tall as the tallest: one-line names match the two-line ones */
.home-stage { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: grid; grid-row: span 2; grid-template-rows: subgrid; row-gap: 0; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.home-stage-band { background: var(--link); color: white; padding: 10px 26px 10px 14px; min-height: 40px; display: flex; align-items: center; gap: 8px; clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%); }
.home-stage-num { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid currentColor; font-size: 11px; font-weight: 700; }
.home-stage-name { font-family: 'Rokkitt', serif; font-size: 18px; font-weight: 700; line-height: 1.05; }
.home-stage-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.home-stage-icon { color: var(--blue); }
.home-stage-blurb { font-size: 12px; color: var(--muted); line-height: 1.35; }
/* New work's New job: green for "go", like Export All (Steve, 2026-10-21) */
.home-stage-button { align-self: flex-start; margin-top: 2px; padding: 8px 16px; font-size: 14px; background: var(--green); border-color: var(--green); }
.home-stage-links { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.home-stage-links .link-btn { padding: 0; font-size: 14px; font-weight: 600; color: var(--link); text-align: left; }
.home-stage-soon { background: #f3f4f6; }
.home-stage-soon .home-stage-band { background: var(--border); color: #4b5563; }
.home-stage-soon .home-stage-icon { color: var(--empty); }
.home-stage-soon-text { margin-top: 4px; font-size: 14px; font-weight: 600; font-style: italic; color: var(--muted); }
/* 35px: the same gap as from the snapshot's cards to the tops of HOW THE WORK FLOWS's letters (30px + 5px) */
.home-values { margin: 35px 0 8px; padding: 16px; text-align: center; font-family: 'Rokkitt', serif; font-size: 22px; color: var(--burgundy); border-top: 2px solid var(--border); border-bottom: 2px solid var(--border); }
.home-footer { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 18px 0 4px; font-size: 12px; color: var(--muted); }
.home-footer button { background: none; border: none; font-family: inherit; font-size: 12px; color: var(--muted); cursor: pointer; padding: 0; }
.home-footer button:hover { color: var(--blue); text-decoration: underline; }
.home-footer .home-footer-mark { display: inline-flex; align-items: center; gap: 6px; font-family: 'Rokkitt', serif; font-size: 14px; font-weight: 700; letter-spacing: 0.04em; }
/* The Trade Mechanics mark as a mask, so it takes the footer's quiet color and turns blue on hover */
.home-tm-badge { display: inline-block; width: 18px; height: 14px; background: var(--muted); -webkit-mask: url('/img/TM-mark.png') center / contain no-repeat; mask: url('/img/TM-mark.png') center / contain no-repeat; }
.home-footer-mark:hover .home-tm-badge { background: var(--blue); }
/* Settings → Company: the Home page image's preview, the banner's shape. */
.company-banner-preview { width: 240px; height: 40px; border-radius: var(--radius); background: var(--blue) center / cover no-repeat; }

/* ── Estimates (Jobs → Estimates; estimates.js) ── */
#est-view { background: var(--surface); border-radius: var(--radius); padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
#est-view h2 { font-family: 'Rokkitt', serif; font-size: 20px; }
.job-link-text { color: var(--link); cursor: pointer; font-weight: 500; }
.job-link-text:hover { text-decoration: underline; }
.est-facts { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: baseline; font-size: 13px; margin: -6px 0 14px; }
.est-fact-label { font-size: 11px; color: var(--label); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-right: 4px; }
.est-summary { display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: center; font-size: 13px; margin-bottom: 14px; }
.est-inline-label { font-size: 13px; font-weight: 600; color: var(--text); margin-right: 4px; }
.est-num-input { width: 76px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 4px; font: inherit; font-size: 13px; text-align: right; }
/* The estimate's own markup and labor rate: room for 100.00 or 1,250.00, and a gap before "per hour" */
.est-summary .est-num-input { width: 64px; margin-right: 6px; }
.est-warn { color: #92400e; background: #fef3c7; border-radius: 4px; padding: 2px 8px; font-size: 12px; }
.est-cards { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.est-cards .card-sub { font-size: 12px; color: var(--muted); }
.est-price-card .card-value { color: var(--green); }
.est-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
#est-search { width: 300px; }
.est-toolbar button, .job-detail-actions button.danger-btn, #est-head .job-detail-actions button, .est-job-new, .est-prop-actions button {
  padding: 6px 12px; border-radius: var(--radius); border: 1px solid var(--blue); background: var(--surface);
  color: var(--blue); cursor: pointer; font-size: 13px; font-family: inherit;
}
.est-toolbar button:hover, #est-head .job-detail-actions button:hover, .est-job-new:hover, .est-prop-actions button:hover { background: var(--blue-light); }
#est-head .job-detail-actions button.danger-btn { border-color: var(--red); color: var(--red); }
#est-head .job-detail-actions button.danger-btn:hover { background: #fde8ec; }
.est-job-new { margin-top: 6px; }
.est-flash { font-size: 13px; color: var(--green); }
.est-facts .est-changed { margin-left: auto; text-align: right; color: var(--muted); }   /* when it last changed, and that changes save themselves */
.est-save-status { white-space: nowrap; }   /* the Changed line's gray, except Saved and Not saved */
.est-save-status.est-save-saved { color: var(--green); }
.est-save-status.est-save-failed { color: var(--red); font-weight: 600; }

.est-item { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px; background: #fbfcfd; }
.est-item-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.est-label-input { width: 140px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 4px; font: inherit; font-weight: 700; }
.est-item-actions { margin-left: auto; display: flex; gap: 2px; }
.est-desc { width: 100%; padding: 6px 8px; border: 1px solid var(--border); border-radius: 4px; font: inherit; font-size: 13px; resize: vertical; margin-bottom: 8px; }
.est-grid { width: 100%; border-collapse: collapse; background: var(--surface); }
.est-grid thead th { cursor: default; padding: 6px 8px; font-size: 12px; }
.est-grid thead th:hover { background: var(--blue); }
.est-grid td { padding: 3px 6px; border-bottom: 1px solid #eef0f2; vertical-align: top; }
.est-col-item { width: auto; }
.est-col-qty { width: 150px; }
.est-col-unit { width: 50px; }
.est-col-price { width: 150px; }
.est-col-total { width: 100px; }
.est-col-actions { width: 84px; }
.est-cell { width: 100%; padding: 4px 6px; border: 1px solid transparent; border-radius: 3px; font: inherit; font-size: 13px; background: transparent; }
.est-cell:hover { border-color: var(--border); }
.est-cell:focus { border-color: var(--blue); background: white; outline: none; }
.est-qty { text-align: right; width: 70px; }
.est-qty-wrap { display: inline-flex; gap: 4px; justify-content: flex-end; align-items: center; }
.est-crew { width: 52px; text-align: right; }
.est-unit { font-size: 12px; color: var(--muted); padding-top: 8px !important; }
.est-labor-row td { background: #f6f8fb; }
.est-new-row td { border-bottom: none; }
.est-new-row .est-cell { border: 1px dashed var(--border); }
/* + Labor and Browse under a scope item's rows: outlined buttons like the row buttons' words (.row-text-btn), not
   links (Steve, 2026-11-06: Browse didn't look like a button) */
.est-add-labor, .est-browse { height: 28px; box-sizing: border-box; display: inline-flex; align-items: center; gap: 5px;
  padding: 0 10px; margin: 0; font-family: inherit; font-size: 13px; font-weight: 600; color: var(--blue);
  background: var(--surface); border: 1px solid var(--blue); border-radius: var(--radius); cursor: pointer; }
.est-add-labor:hover, .est-browse:hover { background: var(--blue-light); }
/* Side by side and centered on the row's text box (a flex row, so the icon doesn't shift Browse off + Labor) */
.est-new-row td { vertical-align: middle; }
.est-new-actions { display: flex; align-items: center; gap: 8px; }
.est-col-catalog { width: 30%; }
.est-grid td.est-catalog { padding-top: 7px; max-width: 0; }
.est-product { display: flex; align-items: center; gap: 4px; max-width: 100%; padding: 0; font-size: 13px; text-align: left; color: var(--text); }
.est-product span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 2px; }
.est-product svg { flex: none; }
.est-product-system { color: #6b7280; font-style: italic; }
.est-product-none { color: #b45309; font-weight: 600; }
.est-product-text { color: var(--muted); }
.est-attention-count { display: inline-flex; align-items: center; gap: 4px; border: none; cursor: pointer; }
.est-attention-count:hover { text-decoration: underline; }
.est-price-btn { font-size: 13px; padding: 0; font-variant-numeric: tabular-nums; }
.est-grid td.num:not(:has(input)) { padding-top: 8px; }
.est-price-typed { font-style: italic; }
.est-price-none { color: var(--muted); }
.est-mark { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; border-radius: 3px; padding: 0 4px; margin-right: 4px; vertical-align: 1px; cursor: help; }
.est-mark-old { background: #e5e7eb; color: #374151; }
.est-mark-check { background: #fef3c7; color: #92400e; }
.est-mark-nowrap { white-space: nowrap; }
.est-row-actions { white-space: nowrap; text-align: right; }
.est-icon-btn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 11px; padding: 4px; border-radius: 3px; line-height: 1; }
.est-icon-btn:hover { background: var(--blue-light); color: var(--text); }
.est-icon-btn svg { width: 14px; height: 14px; vertical-align: -2px; }
.est-icon-btn.est-del:hover { color: var(--red); background: #fde8ec; }
.est-item-totals { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 14px; font-size: 13px; margin-top: 8px; color: var(--label); font-variant-numeric: tabular-nums; }

.modal.est-pick-modal { width: 600px; }
.est-pick-results { max-height: 320px; overflow-y: auto; margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.est-pick-option { display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 1px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); cursor: pointer; font: inherit; font-size: 13px; }
.est-pick-option:hover { background: var(--blue-light); border-color: var(--blue); }
.est-pick-option.current { border-color: var(--green); }
/* 9n: a tick beside each product found, Same Product under them; bought items the System names */
.est-pick-line { display: flex; align-items: center; gap: 8px; }
.est-pick-line .est-pick-option { flex: 1; }
.est-pick-tick { flex: none; width: 16px; height: 16px; cursor: pointer; }
.est-pick-same { display: flex; align-items: center; gap: 10px; margin: 8px 0 4px; }
.est-pick-bought-list { display: flex; flex-direction: column; gap: 6px; }
.est-pick-bought-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#est-pick-bought-group { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
#est-pick-bought-group.hidden { display: none; }
#est-pick-bought { display: flex; flex-direction: column; gap: 6px; padding-bottom: 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
#est-pick-bought.hidden { display: none; }
.est-pick-same button, #est-pick-bought button { padding: 6px 16px; border-radius: var(--radius); border: 1px solid var(--blue); background: var(--surface); color: var(--blue); font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; }
.est-pick-same button:hover, #est-pick-bought button:hover { background: var(--blue-light); }
#est-pick-bought button.primary { background: var(--blue); color: white; }
#est-pick-bought button.primary:hover { opacity: 0.9; }
.est-pick-option .muted-text { font-size: 12px; }
.est-pick-every-size { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 13px; font-weight: 600; cursor: pointer; }
.own-name.own-name-rule { border-style: dashed; }
.est-pick-name { font-weight: 600; }
/* Suggested products: the System's suggestion in "Which product is this?", and on the row */
.est-pick-suggestion { border: 1px solid var(--blue); border-radius: 4px; background: var(--blue-light); padding: 10px 12px; margin: 4px 0 12px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.est-pick-suggestion-head { font-size: 12px; font-weight: 700; color: var(--label); text-transform: uppercase; letter-spacing: .03em; }
.est-pick-suggestion-row { display: flex; gap: 8px; align-items: center; }
.est-pick-suggestion-row input { flex: 1; font-weight: 600; }
.est-pick-suggestion-row button.primary { padding: 7px 16px; border-radius: var(--radius); border: 1px solid var(--blue); background: var(--blue); color: white; font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; }
.est-pick-suggestion-row button.primary:hover { opacity: 0.9; }
.est-pick-suggestion-doubt { color: #92400e; background: #fef3c7; border-radius: 3px; padding: 4px 8px; }
.est-pick-suggestion .modal-hint { margin: 0; }
.est-product-suggested { color: var(--blue); font-weight: 600; }
.est-product-looking { color: var(--muted); font-style: italic; }
.modal.est-price-modal { width: 600px; }
.est-price-table { width: 100%; margin: 6px 0 4px; font-size: 13px; }
.est-price-table th { text-align: left; font-size: 12px; color: var(--label); padding: 4px 8px 4px 0; background: none; }
.est-price-table td { padding: 4px 8px 4px 0; vertical-align: middle; }
.est-price-table button.secondary, .est-price-typed-row button.secondary { padding: 3px 10px; border-radius: var(--radius); border: 1px solid var(--blue); background: var(--surface); color: var(--blue); cursor: pointer; font-size: 12px; }
.est-price-older td { color: var(--muted); }
.est-price-typed-row { display: flex; gap: 8px; align-items: center; }
.est-price-typed-row input { width: 120px !important; }
.modal.est-paste-modal { width: 760px; }
.est-paste-modal textarea { width: 100%; font-family: ui-monospace, Menlo, monospace; font-size: 12px; }

/* Estimating Release 2: status, pricing, notes, revisions, the answer */
.est-status { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; border-radius: 10px; padding: 1px 8px; background: #e5e7eb; color: var(--label); white-space: nowrap; }
.est-status-waiting { background: var(--blue-light); color: var(--blue); }
.est-status-expired { background: #fef3c7; color: #92400e; }
/* Estimating → Proposals: a good-until date passed with no answer; the number, dates, days and price
   on one line (the titles wrap instead) */
td.prop-expired { color: #92400e; font-weight: 600; }
#prop-table td:nth-child(1), #prop-table td:nth-child(5), #prop-table td:nth-child(6),
#prop-table td:nth-child(7), #prop-table td:nth-child(9) { white-space: nowrap; }
.est-status-accepted { background: #dcfce7; color: var(--green); }
.est-status-said_yes { background: var(--blue-light); color: var(--blue); }
.est-status-declined { background: #fde8ec; color: var(--red); }
.est-status-template { background: #ede9fe; color: #5b21b6; vertical-align: middle; margin-left: 6px; }
/* Templates (Estimating Phase 1b) */
.est-origin { margin: -4px 0 8px; font-size: 13px; }
.tpl-modal { width: 520px; max-width: calc(100vw - 32px); }
.tpl-types { max-height: 240px; overflow-y: auto; border: 1px solid var(--border); border-radius: 4px; padding: 6px 10px; margin-bottom: 8px; }
.tpl-types-group { margin-bottom: 6px; }
.tpl-types-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 4px 0 2px; }
.tpl-types label { display: block; font-weight: 400; font-size: 13px; margin: 2px 0; }
.tpl-mode { display: flex; gap: 18px; margin: 4px 0 8px; }
.tpl-mode label { font-weight: 400; font-size: 13px; }
.tpl-bought { margin-top: 18px; }
.tpl-bought h3 { font-size: 15px; margin-bottom: 4px; }
.tpl-bought-into { margin-left: 8px; font-weight: 400; }
#tpl-type { margin-left: 8px; }
.est-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; padding: 8px 12px; margin-bottom: 14px; border-radius: var(--radius); background: #f3f4f6; border: 1px solid var(--border); }
.est-banner-waiting { background: var(--blue-light); border-color: #c7d4e2; }
.est-banner-expired { background: #fffbeb; border-color: #fcd34d; }
.est-banner-accepted { background: #f0fdf4; border-color: #bbf7d0; }
.est-banner-said_yes { background: #f0f9ff; border-color: #bae6fd; }
.est-banner-declined { background: #fff5f6; border-color: #f5c2cb; }
.est-banner-revision { background: #fffbeb; border-color: #fcd34d; }
.est-banner-actions { margin-left: auto; display: flex; gap: 8px; }
.est-banner button { padding: 5px 12px; border-radius: var(--radius); border: 1px solid var(--blue); background: var(--surface); color: var(--blue); cursor: pointer; font-size: 13px; }
.est-banner button.primary { background: var(--blue); color: white; }
.est-banner button.link-btn { border: none; background: none; padding: 0; }
.est-toolbar button.est-send-btn, .est-prop-actions button.est-send-btn { background: var(--blue); color: white; font-weight: 600; }
.est-toolbar button.est-send-btn:hover, .est-prop-actions button.est-send-btn:hover { background: var(--blue-dark); }
.est-pricing-wrap { display: inline-flex; align-items: center; gap: 10px; margin-left: 8px; font-size: 13px; }
.est-pricing { padding: 3px 6px; border: 1px solid var(--border); border-radius: 4px; font: inherit; font-size: 13px; }
.est-plus-tm { display: inline-flex; align-items: center; gap: 4px; color: var(--label); cursor: pointer; }
.est-item-tm { background: #f9fafb; border-style: dashed; }
.est-insert-para { display: block; margin: -6px 0 6px; }
.est-notes { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px; background: #fbfcfd; }
.est-notes .muted-text { font-size: 12px; margin-left: 6px; }
.est-notes .est-desc { margin-top: 6px; }
.est-revisions { margin-top: 8px; }
.est-revisions h3 { font-size: 15px; margin-bottom: 6px; }
.est-revisions .supplier-row { gap: 12px; }
.est-readonly .est-row-actions button, .est-readonly .est-cell { pointer-events: none; }
.est-readonly .est-row-actions { visibility: hidden; }
.est-readonly textarea:disabled, .est-readonly input:disabled, .est-readonly select:disabled { background: transparent; color: var(--text); opacity: 1; -webkit-text-fill-color: var(--text); }
.est-readonly .est-product:disabled, .est-readonly .est-price-btn:disabled { cursor: default; }
.est-proposal-modal { max-width: 640px; }
.est-proposal-modal textarea { width: 100%; font: inherit; font-size: 13px; line-height: 1.45; }
.est-ans-kind { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-bottom: 4px; }
.est-ans-kind label { white-space: nowrap; }
/* Signed: what was signed, our proposal or the general contractor's subcontract */
.est-ans-what { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 4px 22px; padding-left: 10px; border-left: 2px solid #d5dde6; }
/* Wide enough for the change order note on two lines and the Signed copy label on one */
.modal.est-answer-box { width: 430px; }
.est-ans-co-note { margin-top: 10px; }
/* The answer's file: Choose File below its label, outlined as a secondary button, the name beside it */
.est-ans-file-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; min-width: 0; }
.est-ans-file-row #est-ans-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.modal label.file-label.secondary { display: inline-block; margin: 0; padding: 5px 14px; background: var(--surface); color: var(--blue);
  border: 1px solid var(--blue); font-weight: 400; flex-shrink: 0; }
.modal label.file-label.secondary:hover { background: var(--blue-light); }
.est-ans-what-label { font-size: 13px; font-weight: 600; color: #333; }
.est-ans-items { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.est-ans-site { display: grid; grid-template-columns: 1fr 70px 90px; gap: 6px; }
.est-para-preview { white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
/* Settings → Estimating: both cards one width, between the standard 540px and the full-width lists,
   so the paragraphs' text has room and the page's cards line up. */
.admin-section-estimating { width: 100%; max-width: 860px; }
.admin-section-estimating .est-settings-grid select { justify-self: start; width: auto; max-width: 320px; }
.es-para-table td:first-child { min-width: 150px; }
.es-para-table { width: 100%; font-size: 13px; margin-bottom: 10px; }
.es-para-table td { vertical-align: top; padding: 6px 8px; }
.es-para-text { white-space: pre-wrap; color: var(--label); }
.es-para-table button.secondary, .alerts-dismissed-row button.secondary { padding: 3px 10px; border-radius: var(--radius); border: 1px solid var(--blue); background: var(--surface); color: var(--blue); cursor: pointer; font-size: 12px; }
#est-send-warn { display: block; margin-top: 10px; }
.modal span > .est-num-input { width: 80px; display: inline-block; margin-right: 4px; }
.est-revisions .supplier-row { justify-content: flex-start; }

.est-paste-grid-wrap { overflow: auto; max-height: 300px; border: 1px solid var(--border); border-radius: 4px; }
.est-paste-grid { border-collapse: collapse; font-size: 12px; width: 100%; }
.est-paste-grid thead th { background: var(--blue-light); padding: 4px; position: sticky; top: 0; cursor: default; }
.est-paste-grid thead th:hover { background: var(--blue-light); }
.est-paste-grid select { font-size: 12px; }
.est-paste-adds { margin-top: 10px; font-size: 13px; }
.est-paste-adds-head { margin: 0 0 4px; font-weight: 600; }
.est-paste-adds ul { margin: 0 0 4px; padding-left: 20px; }
.est-paste-grid td { padding: 3px 6px; border-top: 1px solid #eef0f2; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }

.est-settings-grid { display: grid; grid-template-columns: max-content 1fr; gap: 10px 16px; align-items: center; margin: 8px 0 12px; }
.est-settings-grid label { margin: 0 !important; }
.est-settings-grid label.plain-check { font-weight: 400; }
/* Settings → Estimating's cards read-only (esSetEditing): a label beside each saved value, like the Company card */
.es-view-table { margin: 8px 0 12px; }
.es-view-table th { width: 240px; }
.es-view .dedup-advanced .es-view-table { margin-top: 4px; }
/* Settings → Estimating's Proposals card (Estimating Phase 2) */
.est-settings-grid #es-prefix { width: 64px; text-align: left; }
.admin-section-estimating .est-settings-grid #es-proposals-in { max-width: none; }
.es-number-input { width: 96px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 4px; font: inherit; font-size: 13px; }
.est-settings-grid #es-signer, .est-settings-grid #es-signer-title { width: 260px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 4px; font: inherit; font-size: 13px; }

.own-name { display: inline-block; background: var(--blue-light); border-radius: 10px; padding: 1px 8px; font-size: 12px; margin: 0 4px 2px 0; }
.own-name-x { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 13px; padding: 0 0 0 2px; }
.own-name-x:hover { color: var(--red); }
.alt-name-add { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.modal .alt-name-add input[type="search"] { width: 170px; padding: 3px 8px; border: 1px solid var(--border); border-radius: 4px; font: inherit; font-size: 13px; }
.alt-name-add button { padding: 3px 10px; font-size: 12px; border-radius: 4px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.alt-name-add button.primary-btn { background: var(--blue); border-color: var(--blue); color: #fff; }
#alt-name-error { display: block; color: var(--red); font-size: 12px; margin-top: 4px; }
#alt-name-error.hidden { display: none; }
.est-grid td.est-supplier { padding-top: 8px; }
.est-supplier { font-size: 12px; white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.est-supplier .link-btn { padding: 0; font-size: 12px; color: var(--text); text-align: left; }
.alt-names-line { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* Estimate vs. Bought (Job Detail, admins; Estimating Release 3) */
.est-settings-hint { display: block; font-size: 12px; margin-top: 2px; max-width: 520px; }
.evb-section .evb-heading { font-size: 14px; font-weight: 600; margin: 0 0 4px; }
.evb-section .modal-hint { font-size: 12px; margin: 0 0 6px; }
.evb-so-far { font-size: 11px; color: #92400e; background: #fef3c7; border-radius: 4px; padding: 1px 6px; text-transform: none; letter-spacing: 0; }
.evb-flag-note { display: inline-block; margin: 2px 0 8px; }
.evb-cards { width: auto; min-width: 560px; border-collapse: collapse; margin: 6px 0 12px; font-size: 13px; }
.evb-cards th, .evb-cards td { padding: 4px 12px 4px 0; border-bottom: 1px solid #eef0f2; text-align: left; vertical-align: top; }
.evb-cards thead th { font-size: 11px; color: var(--label); text-transform: uppercase; letter-spacing: 0.05em; background: none; cursor: default; }
.evb-cards thead th:hover { background: none; }
.evb-cards tbody th { font-weight: 600; color: var(--text); background: none; cursor: default; white-space: nowrap; }
.evb-cards td.num, .evb-table td.num { text-align: right; }
.evb-sub { font-size: 11px; color: var(--muted); }
.evb-over { color: #b91c1c; }
.evb-under { color: var(--green); }
.evb-hours { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 14px; font-size: 13px; }
.evb-note-input { width: 100%; min-width: 160px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 4px; font: inherit; font-size: 13px; }
.evb-hours .evb-note-input { width: 280px; }
.evb-table-title { font-size: 12px; color: var(--label); text-transform: uppercase; letter-spacing: 0.05em; margin: 14px 0 6px; }
.evb-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.evb-table thead th { padding: 6px 8px; font-size: 12px; cursor: default; }
.evb-table td { padding: 4px 8px; border-bottom: 1px solid #eef0f2; vertical-align: middle; }
.evb-table .est-num-input { width: 70px; }
.evb-flagged td { background: #fffbeb; }
.evb-label { font-size: 12px; color: var(--muted); }
.evb-mark { font-size: 12px; }
.evb-mark.evb-over { color: #b91c1c; }
.evb-mark.evb-under { color: #92400e; }
.evb-lines td { background: #f9fafb; }
.evb-lines .supplier-row { gap: 12px; }
.evb-cost-list { max-width: 900px; margin-bottom: 8px; }
.evb-cost-list .supplier-row { gap: 12px; border-bottom: 1px solid var(--border); }
.evb-line-desc { flex: 1; color: var(--muted); }
.evb-link { font-size: 12px; color: var(--link); cursor: pointer; }
.evb-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; margin-top: 8px; }
.evb-add button { display: inline-flex; align-items: center; gap: 6px; }

/* ── Adding from Materials & Tools (add-from-materials.md, add_materials.js) ── */
.modal.addmat-modal { width: min(1100px, 94vw); max-height: 90vh; overflow-y: auto; }
.addmat-filters { margin: 10px 0; }
.addmat-filters #cp-search { width: 320px; }
#cp-table { width: 100%; }
.addmat-bar { background: var(--blue-light); border: 1px solid var(--blue); border-radius: var(--radius); padding: 8px 12px;
  margin: 8px 0 10px; font-size: 13px; }
.addmat-bar-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.addmat-bar .addmat-label { color: var(--blue); }
.addmat-bar label { display: inline; font-weight: 600; margin: 0; }
.addmat-bar select { margin-left: 4px; max-width: 320px; }
.addmat-bar-actions { display: inline-flex; align-items: center; gap: 12px; }
.addmat-count { font-weight: 600; }
.addmat-note { margin-top: 6px; color: var(--text); }
.addmat-bar .error { margin: 6px 0 0; }
.addmat-cell { display: inline-flex; align-items: center; gap: 4px; }
/* The same box in the panel (a .modal): its 80px and 10px padding for boxes in dialogs cut the hint short ("Used in al") */
.addmat-cell .addmat-qty, .modal .addmat-cell .addmat-qty { width: 92px; padding: 4px 6px; }
.addmat-unit { width: 18px; font-size: 12px; color: var(--muted); }
.addmat-cell .addmat-save { width: auto; min-width: 42px; padding: 0 10px; font-size: 12px; font-weight: 600; }
.addmat-done { width: 16px; color: #1a7a3e; display: inline-flex; }
.addmat-recorded { font-size: 11px; color: var(--muted); margin-top: 2px; white-space: normal; }
.modal.addjob-modal { width: 480px; }
.addjob-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.addjob-field > label { font-weight: 600; font-size: 13px; color: var(--text); }
.addjob-field input[type=search]:not(.est-num-input) { width: 100%; box-sizing: border-box; padding: 6px 8px;
  border: 1px solid var(--border); border-radius: 4px; font: inherit; }
.addjob-field .tm-select { width: 100%; }
.addjob-field .est-num-input { width: 100px; }
.addjob-kinds { display: flex; gap: 18px; font-size: 13px; }
.evb-hours .evb-save { margin-top: 0; }

/* Why a job was lost: under a stage box set to Lost (Edit Job, Set Stage) */
.lost-reason { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
/* A New job's decision bar under Job Detail's summary (new-work.md): Start Estimate, Pursue, and Pass in
   gray (closing a job removes nothing, so not red) */
.job-new-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  margin: 14px 0; padding: 10px 14px; border: 1px solid var(--blue); border-radius: var(--radius); background: var(--blue-light); }
.job-new-bar-text { font-weight: 600; color: var(--blue-dark); }
.job-new-bar-buttons { display: flex; gap: 8px; }
.job-new-bar button { padding: 5px 14px; border-radius: var(--radius); border: 1px solid var(--blue); background: var(--surface);
  color: var(--blue); cursor: pointer; font-size: 13px; font-weight: 600; }
.job-new-bar button.primary { background: var(--blue); color: white; }
.job-new-bar button.job-new-pass { border-color: #9ca3af; color: #4b5563; font-weight: 500; }
.job-new-bar button:hover { opacity: 0.9; }
.job-new-bar button.job-new-pass:hover { background: #f3f4f6; opacity: 1; }
.pursue-choices { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 4px; }
.pursue-choices label { margin: 0; }   /* not the dialog labels' 12px above: the two choices read as one list */
/* New work's line under + New job on Home: the New jobs waiting for a yes or no */
.home-stage-line { display: block; margin-top: 8px; text-align: left; }
.lost-reason label { font-size: 13px; font-weight: 600; color: #1f2937; }

/* A table cell kept on one line (the Jobs list's Last Modified date and time) */
.nowrap-cell { white-space: nowrap; }

/* A customer's notes: as typed, lines and all (the customer's page, Job Detail), and their box */
.customer-notes { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 520px; }
.customer-notes-box { width: 100%; font-family: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius); resize: vertical; }

/* Job Detail tabs (mock-up, 2026-10-21) */
.job-summary { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 4px; }
.job-summary-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 16px; min-width: 170px; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.job-summary-item:hover { border-color: var(--blue); }
.job-summary-value { font-size: 20px; font-weight: 700; color: var(--blue); margin-top: 2px; }
.job-summary-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.job-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 16px 0 18px; }
.job-tab { background: transparent; border: none; border-bottom: 3px solid transparent; color: var(--blue);
  padding: 9px 14px 7px; font-size: 14px; font-weight: 500; cursor: pointer; border-radius: 0; }
.job-tab:hover { background: var(--blue-light); }
.job-tab.active { border-bottom-color: var(--red); font-weight: 600; }
.job-tab-count { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 4px; border-radius: 9px;
  background: var(--blue-light); color: var(--blue); font-size: 11px; font-weight: 600; text-align: center; }
.job-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 18px; }
.job-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; cursor: pointer; }
.job-tile:hover { border-color: var(--blue); }
.job-tile-head { font-size: 13px; font-weight: 700; color: var(--blue); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.job-tile-go { float: right; color: var(--muted); }
.job-tile-line { font-size: 13px; color: var(--text); margin-top: 3px; }
.job-breakdowns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.evb-detail-toggle { display: flex; align-items: center; gap: 12px; margin: 14px 0 8px; }

/* Supplier Invoices showing one job's only: the blank job's, from the Jobs list's <Not set> pencil */
.filter-note { margin: 0 0 8px; padding: 8px 12px; background: var(--blue-light); border: 1px solid #b9cbd3; border-radius: 6px; color: var(--blue); font-size: 13px; }
.filter-note a { color: var(--blue); font-weight: 600; }
/* Jobs showing just the jobs a Home stage count counted (roadmap step 9c) */
#jobs-moved-note { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#jobs-moved-note.hidden { display: none; }
.filter-note-clear { height: 28px; padding: 0 12px; border: 1px solid #b9cbd3; border-radius: 6px; background: #fff; color: var(--blue); font-size: 13px; font-weight: 600; cursor: pointer; }
.filter-note-clear:hover { background: #dbeafe; }
#reassign-new-hint { margin: 6px 0 0; font-size: 13px; }

/* Jobs beyond purchasing: the Estimate column's sent and draft amounts are lighter than accepted ones */
.estimate-sent, .estimate-draft { color: #6b7280; }

/* An ⓘ with more information (infoTip): the Estimate column's total, when part of it isn't signed */
.info-tip { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; min-width: 0; margin: 0 5px 0 0; padding: 0; border: 1px solid #9ca3af; border-radius: 50%; background: none; color: #6b7280; font: italic 600 11px/1 Georgia, serif; vertical-align: -2px; cursor: pointer; box-shadow: none; }
.info-tip:hover { border-color: var(--blue-dark); color: var(--blue-dark); background: none; }
.info-pop { position: fixed; z-index: 1000; max-width: 380px; padding: 8px 10px; background: #fff; border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,.12); color: #1f2937; font-size: 13px; line-height: 1.5; white-space: pre-line; text-align: left; }

/* The signed proposal, Release 1b: the estimate's Proposal section, the Terms card, a payment schedule */
.est-proposal { margin-top: 18px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.est-proposal h3 { margin: 0 0 2px; }
.est-proposal > .muted-text { margin: 0 0 10px; }
.est-prop-block { margin-bottom: 10px; }
.est-prop-head { font-weight: 600; font-size: 13px; margin: 6px 0 6px; }
.est-prop-grid { display: grid; grid-template-columns: max-content 1fr; gap: 8px 12px; align-items: center; margin: 8px 0 12px; font-size: 13px; }
.est-prop-grid input[type="date"] { padding: 4px 6px; border: 1px solid var(--border); border-radius: var(--radius); }
.est-prop-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.sched { display: flex; flex-direction: column; gap: 6px; }
.sched-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sched-row input, .sched-row select:not(.tm-select) { padding: 4px 6px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; }
.sched-row .sched-label { width: 160px; }
.sched-row .sched-stage { width: 200px; }
.sched-amount { min-width: 90px; text-align: right; font-variant-numeric: tabular-nums; margin-left: auto; }
.sched-remove { border: none; background: none; color: var(--text-muted, #6b7280); cursor: pointer; padding: 2px 6px; }
.sched-remove:hover { color: #991b1b; }
.sched-add { align-self: flex-start; }
.sched-total { font-size: 12px; color: var(--text-muted, #6b7280); margin-top: 4px; text-align: right; }
.est-deposit-warn { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; border-radius: var(--radius); padding: 6px 10px; font-size: 12px; margin-top: 6px; }
.es-starting { background: #f8fafc; border: 1px dashed var(--border); border-radius: var(--radius); padding: 10px 12px; margin: 10px 0; }
.es-starting p { margin: 0 0 6px; }
.est-ans-sub-terms { margin-top: 8px; }
.est-ans-sub-terms summary { cursor: pointer; font-size: 13px; }
.modal .sched-row input[type="search"] { width: 70px; }
.modal .sched-row input.sched-label { width: 130px; }
.modal .sched-row input.sched-stage { width: 100%; }

/* Change orders (the signed proposal, Release 2) */
.est-item-credit { border-left: 3px solid #b45309; }
.est-prop-grid .est-prop-label { font-weight: 600; }
.est-prop-grid select:not(.tm-select) { padding: 4px 6px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; }
.est-co-row { padding-left: 24px; }
.est-co-total { margin: 8px 0; font-size: 13px; }

/* ── Billing (billing.js; docs/execution-plans/billing.md) ── */
.bill-dates { margin-bottom: 14px; }
.bill-lines { margin-bottom: 8px; }
.bill-lines .bill-desc { width: 100%; min-width: 280px; }
.bill-lines .est-num-input { width: 96px; text-align: right; }
.bill-lines .bill-amount[readonly] { background: #f3f4f6; }
.bill-lines-foot { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.bill-total { font-size: 14px; }
.bill-total strong { margin-left: 8px; font-size: 16px; }
.bill-retainage { margin: -6px 0 14px auto; width: 280px; font-size: 14px; }
.bill-retainage > div { display: flex; justify-content: space-between; padding: 2px 0; }
.bill-retainage-due { border-top: 1px solid var(--border, #ccc); margin-top: 4px; padding-top: 6px !important; }
.bill-retainage-due strong { font-size: 16px; }
.bill-retainage-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bill-figs { margin-bottom: 12px; }
.bill-figs .bill-fig { cursor: default; }
.bill-overdue { display: block; font-size: 12px; font-weight: 600; color: var(--red); }
.bill-figs .bill-fig:hover { border-color: var(--border); }
#bill-view { background: var(--surface); border-radius: var(--radius); padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
#bill-view h2 { font-family: 'Rokkitt', serif; font-size: 20px; }
#bill-head .job-detail-actions button, .bill-lines-foot button.secondary {
  padding: 6px 12px; border-radius: var(--radius); border: 1px solid var(--blue); background: var(--surface);
  color: var(--blue); cursor: pointer; font-size: 13px; font-family: inherit;
}
#bill-head .job-detail-actions button:hover, .bill-lines-foot button.secondary:hover { background: var(--blue-light); }
#bill-head .job-detail-actions button.primary-btn { background: var(--blue); color: white; }
#bill-head .job-detail-actions button.danger-btn { border-color: var(--red); color: var(--red); }
#bill-head .job-detail-actions button.danger-btn:hover { background: #fde8ec; }
#bill-view input[type="date"], .bill-lines .bill-desc, #bill-notes {
  padding: 4px 6px; border: 1px solid var(--border); border-radius: 4px; font: inherit; font-size: 13px;
}
#bill-view .bill-dates { grid-template-columns: max-content 160px; }
#bill-notes { display: block; width: 100%; max-width: 640px; box-sizing: border-box; margin: 4px 0 0; resize: vertical; }
#bill-view label[for="bill-notes"] { display: block; font-size: 13px; font-weight: 600; margin-top: 8px; }
.bill-lines td:first-child { width: 55%; }
.bill-lines .bill-desc { box-sizing: border-box; }
.est-settings-grid #bs-prefix { width: 64px; text-align: left; }
.admin-section-estimating .est-settings-grid #bs-billing-in { max-width: none; }
.est-settings-grid #bs-methods, .est-settings-grid #bs-footer { width: 360px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 4px; font: inherit; font-size: 13px; }
#bill-view .bill-dates label { font-size: 13px; font-weight: 600; color: var(--text); }

/* Settings → Users (docs/execution-plans/people.md): people's details, Deactivate, Trade Levels */
.users-table td, .levels-table td { vertical-align: middle; }
.levels-table input.users-rate-input { width: 90px; flex: 0 0 auto; }
.users-rate-cell { white-space: nowrap; }
.users-rate-cell select { width: auto; min-width: 0; }
.users-table .actions-cell { white-space: nowrap; }
.users-starting { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); margin-left: 6px; }
.users-starting input[type="date"] { font-size: 12px; padding: 4px 6px; border: 1px solid var(--border); border-radius: var(--radius); }
.users-history-link { font-size: 12px; margin-left: 6px; }
.users-history-row td { background: var(--bg); }
.users-history { margin: 0; padding-left: 18px; font-size: 13px; }
/* Trade Mechanics Field (docs/execution-plans/mobile-field-app.md, piece 1): mobile numbers, apps, Ways to Sign In */
#sign-in-section .plain-check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 8px 0 4px; }

/* ── Time tracking (timesheets.js; docs/execution-plans/time-and-scheduling.md) ── */
.ot-badge { display: inline-block; font-size: 10px; font-weight: 700; color: #92400e; background: #fef3c7;
  border: 1px solid #f59e0b; border-radius: 3px; padding: 0 4px; margin-left: 4px; vertical-align: 1px; }
.labor-table, .labor-people { width: 100%; border-collapse: collapse; font-size: 13px; margin: 6px 0 12px; }
.labor-people { width: auto; min-width: 360px; }
.labor-who { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; margin-bottom: 4px; }
.labor-ot { margin-top: 10px; }
.section-head .secondary { padding: 4px 12px; font-size: 12px; margin-right: 6px; }
#tab-timesheets button.secondary, #tab-schedule button.secondary, #tab-on-the-clock button.secondary, #ts-discard, #job-labor button.secondary {
  padding: 5px 12px; border-radius: var(--radius); border: 1px solid var(--blue); background: var(--surface);
  color: var(--blue); cursor: pointer; font-size: 13px; font-family: inherit; }
#tab-timesheets button.secondary:hover:not(:disabled), #tab-on-the-clock button.secondary:hover:not(:disabled), #ts-discard:hover:not(:disabled), #job-labor button.secondary:hover { background: var(--blue-light); }
#ts-save, #ts-edit { padding: 6px 16px; border-radius: var(--radius); border: 1px solid var(--blue); background: var(--blue);
  color: white; font-weight: 600; cursor: pointer; font-size: 13px; font-family: inherit; }
#tab-timesheets button:disabled { opacity: 0.45; cursor: default; }
.ts-table { width: 100%; max-width: 1100px; }
.ts-views { margin-bottom: 14px; }
.ts-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 10px; }
.ts-bar select { min-width: 240px; }
.ts-who { font-weight: 600; }
.ts-week { display: inline-flex; align-items: center; gap: 8px; }
.ts-week b { min-width: 150px; text-align: center; }
.ts-table { border-collapse: collapse; font-size: 13px; }
.ts-table th.ts-row-label { text-align: left; font-weight: 400; min-width: 200px; max-width: 320px; }
/* Row labels and the Total line start where the header's "Job" / "Person" does (td's padding) */
.ts-table tbody th, .ts-table tfoot th { padding: 8px 12px; text-align: left; }
.ts-table td { vertical-align: middle; }
.ts-table .ts-day { min-width: 64px; }
.ts-table .ts-md { font-weight: 500; color: rgba(255, 255, 255, 0.85); font-size: 11px; }
.ts-table thead .ts-today { box-shadow: inset 0 -3px 0 #f59e0b; }
.ts-cell { position: relative; text-align: center; }
.ts-input { width: 52px; text-align: right; padding: 4px 6px; border: 1px solid var(--border); border-radius: 4px; font: inherit; font-size: 13px; }
/* Read-only rows only as tall as their text; the edit view's rows fit the boxes */
.ts-val { line-height: 18px; }
.ts-readonly tbody th, .ts-readonly tbody td { padding-top: 6px; padding-bottom: 6px; }
.ts-sum { display: inline-block; width: 52px; padding: 0 6px; box-sizing: border-box; text-align: right;
  border: 1px solid transparent; font-variant-numeric: tabular-nums; }
.ts-input:disabled { background: #f3f4f6; }
.ts-ot-row th, .ts-ot-row td { background: #fffbeb; }
.ts-ot-label { color: #92400e; font-weight: 400; padding-left: 16px; }
.ts-ot-input { border-color: #f59e0b; }
.ts-note-dot { position: absolute; top: 2px; right: 4px; color: var(--blue); font-size: 14px; line-height: 1; }
.ts-total { font-weight: 600; min-width: 56px; }
/* Read-only: a line either side of each day's column, so a figure reads against its day (Steve, 2026-10-25) */
.ts-readonly td.ts-cell { border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
.ts-readonly thead th.ts-day { border-left: 1px solid rgba(255, 255, 255, 0.25); border-right: 1px solid rgba(255, 255, 255, 0.25); }
.ts-foot th, .ts-foot td { border-top: 2px solid #6b7280; font-weight: 600; }
.ts-add-row { display: flex; gap: 8px; align-items: center; margin: 10px 0; }
.ts-add-row select { min-width: 240px; }
/* Standard dropdowns where the boxes beside them are a little taller or shorter: the same height as them */
#job-modal select.tm-select { padding-top: 6px; padding-bottom: 6px; font-size: 14px; }
.sched-row select.tm-select, .est-prop-grid select.tm-select { padding-top: 4px; padding-bottom: 4px; }
.ts-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 8px; max-width: 1100px; }
.ts-week-note { margin-top: 6px; }

/* The Schedule (Release 2, tm.schedule): a week, a row per crew member, each day's jobs as chips */
#tab-schedule button.secondary:hover:not(:disabled) { background: var(--blue-light); }
#tab-schedule button:disabled { opacity: 0.45; cursor: default; }
#tab-schedule .ts-bar .primary-btn { margin-left: auto; }
.sch-wrap { overflow-x: auto; max-width: 1240px; }
.sch-table { max-width: 1240px; table-layout: fixed; }
.sch-table th.ts-row-label { width: 190px; min-width: 0; }
.sch-table thead th:first-child { width: 190px; }
.sch-table th.actions-col { width: 260px; }
.sch-table td.actions-cell { white-space: nowrap; }
.sch-table thead th.ts-day { border-left: 1px solid rgba(255, 255, 255, 0.25); }
.sch-table .sch-weekend { background: #2c4a63; }
.sch-cell { vertical-align: top !important; padding: 8px 4px 4px; border-left: 1px solid var(--border); min-height: 44px; position: relative; }
.sch-cell.sch-today { background: #fffbeb; }
.sch-cell.sch-gone { background: repeating-linear-gradient(45deg, #f9fafb, #f9fafb 6px, #f3f4f6 6px, #f3f4f6 12px); }
.sch-chip { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; background: var(--blue-light); border: 1px solid #c7d6e4;
  border-left: 3px solid var(--blue); border-radius: 4px; padding: 2px 4px; margin-bottom: 4px; font-size: 12px; }
.sch-chip.sch-proposed { border-left-color: var(--link); background: var(--blue-light); }
.sch-chip.sch-double { border-color: #f59e0b; border-left-color: #f59e0b; background: #fffbeb; }
.sch-chip-job { background: none; border: none; padding: 0; font: inherit; font-weight: 600; color: var(--link); cursor: pointer;
  text-align: left; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.sch-chip-job:hover { text-decoration: underline; }
.sch-time { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.sch-lead, .sch-double-dot, .sch-urgent { font-size: 10px; font-weight: 700; padding: 0 5px; border-radius: 8px; white-space: nowrap; }
.sch-lead { background: var(--blue); color: white; }
.sch-double-dot { background: #fef3c7; color: #92400e; }
.sch-urgent { background: #fde8ec; color: var(--red); margin-left: 4px; }
.sch-chip-x { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 11px; padding: 0 2px; margin-left: auto; }
.sch-chip-x:hover { color: var(--red); }
.sch-add { display: none; width: 100%; border: 1px dashed var(--border); background: none; color: var(--muted); border-radius: 4px;
  cursor: pointer; font-size: 13px; line-height: 18px; }
.sch-cell:hover .sch-add, .sch-add:focus { display: block; }
.sch-add:hover { border-color: var(--blue); color: var(--blue); }
.labor-who label.sch-already { color: var(--muted); }
.sch-going { font-size: 12px; }
.sch-off-who { display: flex; flex-direction: column; gap: 6px; margin: 4px 0; }
.sch-off-who label { margin: 0; font-weight: 400; }
.sch-off-total { font-size: 13px; font-weight: 600; margin: 4px 0 0; min-height: 18px; }
.sch-name { font-size: 12px; line-height: 18px; }
#sch-who { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.modal.sch-modal { width: 480px; }
.sch-modal select.tm-select { width: 100%; }
.sch-dates { display: flex; gap: 12px; align-items: flex-end; }
.sch-dates > span { display: flex; flex-direction: column; }
/* The Jobs list's Profit column (admins) */
.profit-loss { color: var(--red); }   /* Job Detail's profit: a loss, any stage */
.profit-gain { color: var(--green); }   /* Job Detail's profit: made money, the job Complete */
.waiting-tag { font-size: 12px; color: #92400e; white-space: nowrap; }
/* A line on a Home card that opens another page (2026-11-02, Steve): a link with a ›, not a pill; amber only
   when it needs attention, like the cards' other warnings (.home-card-warn) */
.home-card-link { display: block; margin-top: 6px; font-family: inherit; font-size: 12px; padding: 0; border: none;
  background: none; color: var(--link); text-align: left; cursor: pointer; }
.home-card-link:hover { text-decoration: underline; }
.home-card-link.home-card-warn { color: #92400e; }
.home-card-link-line { margin-top: 0; }   /* among a card's other lines, spaced like them */

/* The estimate screen, Release 2: Scope of Work | Estimate | Proposal tabs */
.est-tabs { align-items: center; margin-top: 16px; }
.est-tabs .est-flash { margin-left: auto; }
.est-tab-attention { background: #fef3c7; color: #92400e; }
.est-tab-hint { font-size: 13px; margin: 0 0 12px; }
.est-scope-item .est-label-input::placeholder { font-weight: 400; color: var(--muted); }
.est-item-state { font-size: 12px; color: var(--label); margin-left: 8px; }
.est-state-attention { color: #b45309; font-weight: 600; }
.est-estimate-btn, .est-block-paste, .est-add-scope { font-size: 12px; padding: 4px 12px; border: 1px solid var(--blue); border-radius: 4px; background: var(--surface); color: var(--blue); cursor: pointer; }
.est-estimate-btn:hover, .est-block-paste:hover, .est-add-scope:hover { background: var(--blue-light); }
.est-estimate-btn { margin-left: 8px; }
.est-add-scope { margin: 0 0 16px; font-size: 13px; padding: 6px 14px; }
.est-block-head { margin-bottom: 10px; }
.est-block-title { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.est-block-label { font-weight: 700; font-size: 14px; color: var(--text); }
.est-block-paste { margin-left: auto; }
.est-block-desc { font-size: 13px; line-height: 1.45; color: var(--text); white-space: pre-wrap; }
.est-block-desc-cut { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.est-pricing-section { padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.est-pricing-section h3 { margin: 0 0 8px; font-size: 15px; }
.est-pricing-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.est-pricing-table th { text-align: left; font-size: 12px; color: var(--label); padding: 4px 8px; border-bottom: 1px solid var(--border); background: none; cursor: default; }
.est-pricing-table td { padding: 8px; border-bottom: 1px solid #eef0f2; vertical-align: top; }
.est-pricing-table td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.est-pricing-table tfoot td { border-bottom: none; padding-top: 10px; }
.est-pricing-table .est-plus-tm { margin-left: 10px; font-size: 12px; }
.est-pricing-name { width: 45%; }
.est-pricing-name .link-btn { font-size: 13px; font-weight: 600; padding: 0; }
.est-pricing-desc { font-size: 12px; margin-top: 2px; }
.est-send-wait { display: inline-block; cursor: not-allowed; }
.est-send-wait .est-send-btn:disabled { opacity: 0.5; pointer-events: none; }

/* Line Items' Cost Type (tm.job_costs): a compact dropdown, so the description keeps its room */
select.tm-select.li-cost-type { width: 138px; min-width: 0; font-size: 12px; padding-top: 3px; padding-bottom: 3px; }

/* Settings → Field App: Clock Times (tm.clock, docs/execution-plans/mobile-field-app.md, piece 2) */
.clock-settings-grid { display: grid; grid-template-columns: 220px minmax(0, 420px); gap: 10px 16px; align-items: center; margin: 12px 0; }
.clock-settings-grid label { font-size: 13px; font-weight: 600; color: var(--text); }
.clock-settings-grid .modal-hint { margin-top: -6px; }
.clock-check { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; font-weight: 600; margin: 12px 0 4px; }
input.clock-time { width: 100px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 4px; font: inherit; }
.clock-inline { font-size: 13px; color: var(--text); }
input.clock-num { width: 56px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 4px; font: inherit; }

/* Settings → Users: a view-only list and a page for each person (docs/execution-plans/user-page.md) */
.users-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.users-head h2 { margin-bottom: 0; }
.users-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.users-tools .stage-chips { margin: 0; }
.users-tools input[type="search"] { width: 240px; border: 1px solid var(--border); border-radius: var(--radius); padding: 7px 10px; font: inherit; font-size: 13px; }
.users-table td.users-nowrap { white-space: nowrap; }
.users-table-box { overflow-x: auto; }
.users-table td.users-email { max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.users-table .users-main { font-weight: 600; }
.users-table tr.clickable { cursor: pointer; }
.users-table tr.clickable:hover td { background: var(--blue-light); }
.user-page { max-width: 760px; margin: 0 auto; }
.user-page-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 4px; }
.user-page-head h2 { font-family: 'Rokkitt', serif; font-size: 26px; margin: 0 6px 0 0; }
.user-page-tags { display: contents; }
.user-tag { font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--blue-light); color: var(--blue); }
.user-tag-active { background: #e3f2e8; color: #14532d; }
.user-tag-gone { background: #eef0f3; color: var(--label); }
.user-page .admin-section.user-card { max-width: none; margin: 20px 0; padding: 24px 28px; }
.user-card p { color: var(--text); margin-bottom: 14px; }
.user-card p.user-card-note { color: var(--muted); }
.user-card input[type="search"], .user-card input[type="date"] {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 7px 10px; font: inherit; font-size: 13px; box-sizing: border-box;
}
.user-card input.user-rate-input { width: 120px; }
.user-card input:disabled, .user-card select:disabled { background: var(--bg); color: var(--muted); }
.user-card .user-fixed { font-size: 14px; padding: 2px 0; }
.user-card .modal-hint { display: block; margin-top: 4px; }
.user-card label.user-check { display: flex; align-items: flex-start; gap: 8px; margin-top: 16px; }
.user-card label.user-check input { margin-top: 2px; }
.user-card label.user-check .modal-hint { font-weight: 400; }
.user-card-actions { margin-top: 18px; }
.user-card input#up-left-on { width: 200px; }
.user-section-head { font-family: 'Rokkitt', serif; font-size: 18px; margin: 22px 0 6px; padding-top: 14px; border-top: 1px solid var(--border); }
.user-card .user-section-head:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.user-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.user-form-grid.user-rate-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.user-field input[type="search"], .user-field input[type="date"], .user-field select.tm-select { width: 100%; }
.user-card-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.user-card-subhead { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin: 18px 0 6px;
  border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.user-rate-now { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.user-rate-big { font-size: 24px; font-weight: 700; color: var(--blue); }
.user-rates-table { margin-top: 0; }
button.danger-outline, button.secondary-outline { padding: 6px 16px; border-radius: var(--radius); background: var(--surface);
  font-size: 13px; font-weight: 600; cursor: pointer; }
button.danger-outline { border: 1px solid var(--red); color: var(--red); }
button.danger-outline:hover:not(:disabled) { background: #fde8ec; }
button.secondary-outline { border: 1px solid var(--blue); color: var(--blue); }
button.secondary-outline:hover:not(:disabled) { background: var(--blue-light); }
button.danger-outline:disabled, button.secondary-outline:disabled { border-color: var(--border); color: var(--muted); background: var(--bg); cursor: not-allowed; }

/* Schedule → On the clock (Trade Mechanics Field, piece 3; schedule.js) */
.otc-summary { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 12px; font-size: 14px; }
.otc-count { font-weight: 600; color: var(--blue); }
.otc-table { width: 100%; max-width: 1000px; border-collapse: collapse; font-size: 13px; }
.otc-table td, .otc-table th { padding: 7px 10px; text-align: left; }
.otc-table tr.otc-section th { background: var(--bg-subtle, #f3f4f6); color: var(--text); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.otc-table tr.otc-missed td { background: #fff7ed; }
.est-warn-inline { color: #b45309; font-size: 12px; font-weight: 600; margin-left: 6px; }
.otc-form { max-width: 640px; border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; margin: 0 0 14px; background: var(--card-bg, #fff); }
.otc-form h3 { margin: 0 0 6px; }
input.otc-reason { width: 100%; padding: 4px 6px; border: 1px solid var(--border); border-radius: 4px; font: inherit; }

/* Timesheets: clock rows, a day's clock times, Approve Week (Trade Mechanics Field, piece 3; timesheets.js) */
.ts-clock-row th, .ts-clock-row td { background: #f8fafc; }
.ts-clock-tag, .ts-kind-tag { font-size: 10px; font-weight: 700; padding: 0 5px; border-radius: 8px; margin-left: 4px; white-space: nowrap; }
.ts-clock-tag { background: #e0e7ff; color: #3730a3; }
.ts-kind-tag { background: #ecfdf5; color: #047857; }
.ts-times-btn { display: block; margin: 3px auto 0; font: inherit; font-size: 11px; padding: 0 6px; border-radius: 10px; border: 1px solid rgba(255,255,255,.6); background: transparent; color: white; cursor: pointer; }
.ts-times-btn:hover, .ts-times-btn.active { background: rgba(255,255,255,.2); }
.ts-times-btn.ts-times-check { border-color: #fbbf24; color: #fde68a; }
.ts-week-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 10px; font-size: 13px; }
.ts-approved-tag { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 10px; background: #dcfce7; color: #166534; }
.ts-inline-form { display: inline-flex; gap: 8px; align-items: center; }
.ts-inline-form input.otc-reason { width: 260px; }
.ts-reason { max-width: 640px; margin: 0 0 10px; }
.ts-reason label { font-size: 13px; font-weight: 600; display: block; margin-bottom: 4px; }
.ts-day-panel { max-width: 1100px; margin-top: 16px; border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; }
.ts-day-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ts-day-head h3 { margin: 0; }
.ts-taps { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0 12px; }
.ts-taps td, .ts-taps th { padding: 6px 10px; text-align: left; vertical-align: top; }
.ts-taps tr.ts-tap-check td { background: #fff7ed; }
.ts-day-list { margin: 4px 0 10px; padding-left: 18px; font-size: 13px; }
.ts-day-panel h4 { margin: 12px 0 4px; font-size: 13px; }
.ts-week-bar .primary-btn:disabled { opacity: 0.5; cursor: default; }

/* Job Detail's Photos tab (tm/job_photos.py; the field app's Release 2, piece 4) */
.photo-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.photo-day { font-size: 13px; font-weight: 700; color: #374151; margin: 16px 0 8px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.photo-card { display: flex; flex-direction: column; padding: 0; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); overflow: hidden; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.photo-card:hover { border-color: var(--blue); box-shadow: 0 2px 8px rgba(29, 67, 84, 0.12); }
.photo-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: #e5e7eb; }
.photo-card-text { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.photo-card-caption { font-size: 13px; font-weight: 600; }
.modal.photo-modal { width: 760px; max-width: 94vw; }
.photo-modal-img { display: block; max-width: 100%; max-height: 64vh; margin: 0 auto 10px; border-radius: 8px; background: #111827; }
.photo-modal-caption { font-weight: 600; font-size: 14px !important; }
.modal-actions a.button-link { display: inline-flex; align-items: center; padding: 6px 16px; border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--blue); text-decoration: none; font-size: 13px; font-weight: 600; background: var(--surface); }
.modal-actions a.button-link:hover { border-color: var(--blue); }

/* ── Help (docs/execution-plans/user-guide.md; help.js) ──
   The ? in the header, beside the bell; the panel beside the page (the page gets narrower, so you can follow
   the steps while you click), resizable from its left edge; over the page in a narrow window. The same panel
   fills the guide's own window (help.html). */
:root { --help-w: 380px; }
.help-btn {
  margin-left: auto; flex-shrink: 0; background: transparent; border: none; color: rgba(255,255,255,0.85);
  padding: 6px 8px; border-radius: var(--radius); cursor: pointer; display: flex; align-items: center;
}
.help-btn:hover, .help-btn.active { background: rgba(255,255,255,0.15); color: white; }
.header-inner .help-btn:not(.hidden) ~ .alerts { margin-left: -12px; }
.help-panel {
  position: fixed; top: 59px; right: 0; bottom: 0; width: var(--help-w); z-index: 98;
  background: var(--surface); border-left: 1px solid var(--border); box-shadow: -2px 0 10px rgba(0,0,0,0.06);
  display: flex; flex-direction: column; color: var(--text);
}
.help-panel.hidden { display: none; }
body.help-open main, body.help-open .subnav { margin-right: var(--help-w); }
body.help-resizing { cursor: col-resize; user-select: none; }
.help-resize { position: absolute; left: -4px; top: 0; bottom: 0; width: 8px; cursor: col-resize; z-index: 1; }
.help-resize:hover, body.help-resizing .help-resize { background: rgba(29, 67, 84, 0.18); }
@media (max-width: 1099px) {
  body.help-open main, body.help-open .subnav { margin-right: 0; }
  .help-panel { box-shadow: -6px 0 24px rgba(0,0,0,0.18); max-width: 100vw; }
}
.help-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 6px 14px; border-bottom: 1px solid var(--border); }
.help-modes { display: flex; gap: 4px; }
.help-mode { font-family: 'Rokkitt', serif; font-size: 18px; font-weight: 700; color: var(--blue-dark); padding: 2px 4px; }
.help-actions { display: flex; gap: 2px; }
.help-icon-btn {
  background: transparent; border: 1px solid transparent; border-radius: var(--radius); color: var(--label);
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.help-icon-btn:hover { background: var(--blue-light); border-color: var(--border); color: var(--blue-dark); }
.help-search-row { padding: 10px 14px 6px; }
.help-search-row input { width: 100%; box-sizing: border-box; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius); font: inherit; font-size: 13px; }
.help-here {
  margin: 4px 14px 6px; padding: 7px 10px; text-align: left; background: #fff8e6; border: 1px solid #f0d9a0;
  border-radius: var(--radius); font: inherit; font-size: 13px; color: var(--text); cursor: pointer;
}
.help-here:hover { background: #fdf0cc; }
.help-here.hidden { display: none; }
.help-body { flex: 1; overflow-y: auto; padding: 6px 16px 24px; font-size: 13.5px; line-height: 1.55; position: relative; }
.help-body h2 { font-family: 'Rokkitt', serif; font-size: 22px; margin: 8px 0 6px; color: var(--blue-dark); white-space: normal; }
.help-body h3 { font-size: 14.5px; margin: 18px 0 6px; color: var(--blue-dark); }
.help-body h4 { font-size: 13.5px; margin: 12px 0 4px; }
.help-body p { margin: 0 0 8px; }
.help-body ul, .help-body ol { margin: 0 0 8px; padding-left: 20px; }
.help-body li { margin-bottom: 3px; }
.help-body img { max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: 4px; margin: 4px 0 8px; cursor: zoom-in; }
.help-body table { border-collapse: collapse; width: 100%; margin: 4px 0 10px; font-size: 12.5px; }
.help-body th, .help-body td { text-align: left; vertical-align: top; padding: 4px 6px; border-bottom: 1px solid var(--border); }
.help-body th { border-bottom: 2px solid var(--label); }
.help-body code { background: var(--bg-admin); padding: 0 3px; border-radius: 3px; font-size: 12px; }
.help-body a { color: var(--link); }
.help-body a.help-app-link { font-weight: 600; }
.help-body a.help-app-link::after { content: " ›"; }
.help-sec { border-radius: 4px; transition: background 0.6s; padding: 0 4px; margin: 0 -4px; }
.help-sec.help-flash { background: #fff8e6; }
.help-muted { color: var(--muted); font-size: 12.5px; }
.help-toc-page { margin-bottom: 10px; }
.help-toc-area { font-weight: 700; }
.help-contents ul { margin-top: 2px; }
.help-result { display: block; padding: 8px 6px; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text) !important; }
.help-result:hover { background: var(--blue-light); }
.help-result-title { display: block; font-weight: 600; color: var(--link); }
.help-result-where { display: block; font-size: 11.5px; color: var(--muted); }
.help-result-snip { display: block; font-size: 12.5px; }
.help-body mark { background: #fde68a; padding: 0; }
/* The foot of each page of the guide: Previous and Next, in the menu's order */
.help-prev-next { display: flex; justify-content: space-between; gap: 10px; margin: 22px 0 6px; padding-top: 12px; border-top: 1px solid var(--border); }
.help-body a.help-step {
  display: flex; flex-direction: column; max-width: 48%; padding: 8px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); text-decoration: none; font-weight: 600; color: var(--link);
}
.help-body a.help-step:hover { background: var(--blue-light); border-color: var(--link); }
.help-next { margin-left: auto; text-align: right; }
.help-step-dir { font-size: 11.5px; font-weight: 400; color: var(--muted); }
/* The guide's own window */
.help-window-body { background: var(--surface); margin: 0; }
.help-panel.help-window { position: fixed; top: 0; width: auto; left: 0; border-left: none; box-shadow: none; }
@media print {
  header, .subnav, main, .help-resize, .help-actions, .help-search-row, .help-here { display: none !important; }
  .help-panel, .help-panel.help-window { position: static; width: auto; border: none; box-shadow: none; }
  .help-body { overflow: visible; }
}

/* Export Week on Timesheets (TM Field Release 3, piece 6) */
.ts-bar .ts-export { margin-left: auto; }
.ts-export-warn { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 12px;
  padding: 10px 12px; border: 1px solid #e6c97a; background: #fff8e6; border-radius: 6px; font-size: 13px; }
.ts-export-warn.hidden { display: none; }

/* Settings → Field App: Crew Leads (TM Field Release 3) */
.admin-section .clock-check.lead-sub { margin-left: 26px; margin-top: 6px; }
.admin-section .lead-hint { margin-top: 14px; }
.plain-check.disabled { color: var(--muted); }
/* Schedule Work: a crewed job with no crew lead */
#sch-lead-hint { margin: 4px 0 0; }
.otc-no-lead { margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: #f1f3f5; color: var(--muted); font-size: 11px; font-weight: 700; }
/* Timesheets: the crew lead's Looks right on a day (TM Field Release 3, piece 9) */
.ts-check { margin-top: 3px; font-size: 10px; font-weight: 700; color: #bbf7d0; white-space: nowrap; cursor: help; }
.ts-check-changed { color: #fde68a; }

/* ── Adding a purchase by hand (hand_purchase.js; docs/execution-plans/purchase-by-hand.md) ── */
.modal.hand-modal { width: 760px; }
.hand-top { display: grid; grid-template-columns: 1fr 150px 1fr; gap: 12px; }
.hand-top .addjob-field { margin-bottom: 10px; }
.hand-top input[type=date] { width: 100%; box-sizing: border-box; padding: 5px 8px; border: 1px solid var(--border);
  border-radius: 4px; font: inherit; }
.hand-top .pick-list { display: block; }
.hand-just { display: inline-flex; margin: 0 0 10px; font-size: 13px; }
.hand-lines { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 6px; }
.hand-lines th { text-align: left; font-weight: 600; font-size: 12px; padding: 4px 6px; }
.hand-lines th:first-child { width: 100%; }
.hand-lines th.th-right, .hand-lines td.num { text-align: right; }
.hand-lines td { padding: 3px 4px; vertical-align: top; }
.hand-lines .pick-list { display: block; }
.hand-lines .hand-desc { width: 100%; box-sizing: border-box; padding: 4px 6px; border: 1px solid var(--border);
  border-radius: 4px; font: inherit; font-size: 13px; }
.modal .hand-lines input.hand-qty { width: 70px; padding: 4px 6px; }
.modal .hand-lines input.hand-price { width: 84px; padding: 4px 6px; }
.modal .hand-lines input.hand-desc { min-width: 260px; padding: 4px 6px; }
.hand-lines .tm-select { width: 76px; }
.hand-lines .hand-line-total { width: 80px; padding-top: 7px; white-space: nowrap; }
.hand-picked { font-size: 11px; margin-top: 2px; }
.hand-picked:empty { display: none; }
button.hand-small-btn { height: 28px; padding: 0 10px; font-size: 12px; font-weight: 600; }
.hand-add-line { margin-bottom: 12px; height: 28px; padding: 0 12px; font-size: 13px; font-weight: 600; }
.hand-totals { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 4px 0 14px;
  font-size: 13px; }
.hand-totals label { font-weight: 600; white-space: nowrap; }
.modal .hand-totals input.hand-tax-box, .modal #hand-tax, .modal #hand-amount { width: 96px; padding: 4px 6px; }
.hand-total-label { margin-left: 16px; font-weight: 600; }
.hand-totals strong { font-size: 16px; min-width: 80px; text-align: right; }
.hand-modal input[type=file] { font-size: 13px; }
#hand-receipt-now { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#hand-receipt-now:empty { display: none; }
.hand-dup { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px;
  padding: 8px 10px; background: #fef3c7; color: #92400e; border-radius: var(--radius); font-size: 13px; }
.modal-actions #hand-delete { margin-right: auto; }
.hand-tag { font-size: 11px; padding: 0 7px; border-radius: 9px; background: var(--blue-light); color: var(--blue);
  font-weight: 600; white-space: nowrap; }
.section-head-actions { display: inline-flex; gap: 8px; }
.evb-hand { margin-top: 8px; display: flex; align-items: center; gap: 8px; }
/* Supplier Invoices' filters: narrower name boxes, so the filters, By hand and the two buttons fit one row at 1280 */
#tab-invoices .filters input[type="search"] { width: 130px; }
#tab-invoices .toolbar-actions { margin-left: auto; }

/* Delete Job (tm.job_delete, roadmap step 9g): beside Edit on Job Detail, and its red warning */
.job-fields-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; align-self: start; }
.job-fields .job-fields-actions button.danger-outline { border-color: var(--red); color: var(--red); font-weight: 600; }
.job-fields .job-fields-actions button.danger-outline:hover:not(:disabled) { background: #fde8ec; opacity: 1; }
.job-fields .job-fields-actions button.danger-outline:disabled { border-color: var(--border); color: var(--muted); background: var(--bg); cursor: not-allowed; }
.danger-modal { width: 440px; border-top: 4px solid var(--red); }
.danger-modal h3 { color: var(--red); }
.danger-text { font-size: 14px; line-height: 1.45; color: var(--text); margin: 4px 0 12px; }
.modal-actions button.danger-fill { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.modal-actions button.danger-fill:hover { opacity: 0.9; }

/* A person's page (Steve, 2026-11-07): Active at the top of User Details; Sign-in Methods, one row per way in */
.user-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.user-card-head .user-section-head { margin-bottom: 6px; }
.field-link { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.field-link-text { flex: 1 1 320px; display: flex; flex-direction: column; gap: 10px; }
.field-link-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.field-link-qr { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 140px; }
.field-link-qr img { border: 1px solid #eceef1; padding: 6px; background: #fff; }
.field-link-qr figcaption { font-size: 12px; color: var(--text-muted, #5b6670); text-align: center; }
.signin-method { padding: 10px 0; border-top: 1px solid #eceef1; display: flex; flex-direction: column; gap: 6px; }
.user-card .user-section-head + .signin-method, .signin-gone + .signin-method { border-top: 0; padding-top: 4px; }
.signin-method-head { display: flex; align-items: center; gap: 10px; }
.signin-method-name { font-weight: 600; font-size: 14px; color: var(--text); min-width: 210px; }
.signin-method-said { margin: 0; font-size: 13px; color: var(--text); }
.signin-method-said .modal-hint { display: inline; margin-left: 4px; }
.signin-dimmed .signin-method { opacity: 0.55; }
.signin-gone { margin: 0 0 6px; }

/* Labor hours typed per person (roadmap step 9k): a labor row's crew still to type */
.est-crew.est-crew-needed { border-color: var(--red); background: #fdf2f4; }
.est-qty-wrap .est-times { color: var(--muted); font-size: 13px; margin: 0 4px; }
.es-tax-use { margin-left: 8px; padding: 2px 10px; }

/* A person's Role: the ? beside it, and what the role can do (docs/execution-plans/new-customer-accounts.md) */
.user-role-label { display: flex; align-items: center; gap: 7px; }
.help-q-btn { position: relative; top: 2px; width: 16px; height: 16px; padding: 0; border: 1px solid var(--blue); border-radius: 50%; background: #fff; color: var(--blue); font-weight: 700; font-size: 11px; line-height: 1; cursor: pointer; }
.help-q-btn:hover { background: var(--blue); color: #fff; }
.user-role-can { margin: 4px 0 14px; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 13px; }
.user-role-can-head { font-weight: 700; margin-bottom: 6px; }
.user-role-can-line { display: flex; gap: 8px; line-height: 1.6; }
.role-yes { color: #1a7a3e; font-weight: 700; width: 26px; flex: none; }
.role-no { color: #9ca3af; font-weight: 700; width: 26px; flex: none; }
/* A wide table in the narrow Help panel scrolls on its own, and its first column stays readable */
.help-body table { display: block; overflow-x: auto; max-width: 100%; }
.help-body table th:first-child, .help-body table td:first-child { min-width: 130px; }

/* Sign-in History (sign_in_history.js) */
.sih-pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 10px; white-space: nowrap; }
.sih-ok { background: #e7f4ec; color: var(--green); }
.sih-no { background: #fdecef; color: var(--red); }

/* Import People (people_import.js) */
.users-head-actions { display: flex; gap: 8px; align-items: center; }
.people-import-page { max-width: 1100px; }
.pimp-steps { display: flex; gap: 18px; margin-bottom: 16px; font-size: 13px; color: var(--muted, #6b7280); }
.pimp-steps .pimp-step-now { color: var(--navy, #1f3a5f); font-weight: 700; }
.pimp-drop { border: 2px dashed var(--border); border-radius: var(--radius); padding: 32px 16px; text-align: center; display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; }
.pimp-drop.pimp-over { border-color: var(--navy, #1f3a5f); background: #f3f6fa; }
.pimp-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 12px; }
.pimp-summary { justify-content: flex-start; margin: 0 0 10px; }
.people-import-page td:not(:last-child) { white-space: nowrap; }
.people-import-page tr.pimp-bad td { background: #fff7f8; }
.people-import-page tr.pimp-bad td:last-child { color: var(--red); }
.pimp-warn { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; border-radius: var(--radius); padding: 8px 12px; margin-top: 12px; font-size: 13px; }
.pimp-tick { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; font-size: 13px; }
.pimp-tick input { margin-top: 3px; }
.pimp-done { font-size: 15px; font-weight: 600; }

/* An unexpected error's reference (app.js showErrorNotice; docs/execution-plans/observability.md) */
.error-notice { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 3000; display: flex; gap: 14px;
  align-items: center; background: #fff; border: 1px solid var(--red); border-left: 4px solid var(--red); color: #1f2937;
  border-radius: var(--radius); padding: 10px 14px; box-shadow: 0 4px 16px rgba(0,0,0,0.15); font-size: 14px; max-width: calc(100% - 32px); }
.error-notice button { padding: 4px 12px; }

/* Read-only (tm.account): a subscription that has ended. A band under the header, on every page. */
.read-only-banner { background: #fff4d6; border-bottom: 1px solid #e8c766; color: #5a4300; padding: 8px 24px;
  font-size: 13px; line-height: 1.4; text-align: center; }
.read-only-banner a { color: #5a4300; }

.read-only-banner .read-only-export { margin-left: 10px; padding: 3px 12px; font-size: 12px; vertical-align: middle; }
.export-warning { background: #fff4d6; border: 1px solid #e8c766; color: #5a4300; border-radius: 6px; padding: 10px 12px;
  font-size: 13px; line-height: 1.45; margin: 10px 0 4px; }

/* ── Settings → Plan (plan.js; the mock-up approved 2026-11-14) ── */
.plan-status { display: flex; gap: 12px; align-items: flex-start; border-radius: var(--radius); padding: 12px 14px;
  margin: 4px 0 16px; line-height: 1.5; font-size: 13px; color: var(--text); }
.plan-pill { flex-shrink: 0; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  border-radius: 999px; padding: 3px 10px; margin-top: 1px; color: #fff; }
.plan-status.s-good { background: #e7f4ec; } .plan-status.s-good .plan-pill { background: #1a7a3e; }
.plan-status.s-info { background: #e4ecef; } .plan-status.s-info .plan-pill { background: var(--blue); }
.plan-status.s-warn { background: #fff4d6; color: #5a4300; } .plan-status.s-warn .plan-pill { background: #5a4300; }
.plan-status.s-bad { background: #fdecef; color: #6d0a1c; } .plan-status.s-bad .plan-pill { background: var(--red); }
.plan-facts td { font-variant-numeric: tabular-nums; }
.plan-sub { display: block; color: var(--muted); font-size: 12.5px; }
.plan-over { color: #5a4300; font-weight: 700; }
.plan-meter { height: 8px; background: #edf0f2; border-radius: 999px; margin-top: 6px; max-width: 320px; position: relative; overflow: hidden; }
.plan-meter i { position: absolute; inset: 0 auto 0 0; background: #1a7a3e; border-radius: 999px; }
.plan-meter.over i { background: #c98a12; }
.plan-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 16px; border-top: 1px solid var(--border); }
.plan-actions button.secondary { margin-left: 0; }
.plan-actions button.secondary.danger, .modal-actions button.primary.danger { border-color: var(--red); }
.plan-actions button.secondary.danger { color: var(--red); }
.plan-actions button.secondary.danger:hover:not(:disabled) { background: #fdecef; }
.modal-actions button.primary.danger { background: var(--red); }
.plan-ext { font-size: 11px; opacity: 0.75; margin-left: 4px; }
.plan-table td.num, .plan-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.plan-table tr.plan-current td { background: #e4ecef; font-weight: 600; }
.plan-tag { font-size: 11px; font-weight: 700; color: var(--blue); margin-left: 6px; }
.admin-section p.plan-small { color: var(--muted); font-size: 12.5px; margin: 10px 0 0; }
.plan-mails { list-style: none; margin: 0; padding: 0; }
.plan-mails li { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid #eceff1; font-size: 13px; }
.plan-mails li span:last-child { color: var(--muted); white-space: nowrap; }
.plan-mails li.plan-empty { color: #9ca3af; font-style: italic; }
.plan-warnings li span:last-child { text-align: right; }
#user-reactivate-warning { margin: 0 0 12px; }
.plan-modal { width: 480px; }
.plan-when { background: #e4ecef; border-radius: var(--radius); padding: 10px 12px; line-height: 1.5; }
.plan-choices { display: grid; gap: 8px; margin: 8px 0 12px; }
.modal label.plan-choice { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px; margin: 0; cursor: pointer; font-weight: 400; }
.modal label.plan-choice:has(input:checked) { border-color: var(--blue); background: #e4ecef; }
.modal label.plan-choice.off { opacity: 0.6; cursor: default; }

/* Settings → Field App: Phone Notifications (tm.push): each kind with what it's for under it */
#push-kinds .push-hint { display: block; color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 2px; }
/* Import Customers and Jobs (customer_import.js): the Customers toolbar's two buttons, the two tables */
.toolbar-buttons { display: flex; gap: 8px; align-items: center; }
.cimp-sheet-title { margin: 18px 0 6px; font-size: 15px; }
.sih-same { background: #eef1f5; color: #4b5563; }
.sih-fill { background: #e8f0fb; color: var(--navy, #1f3a5f); }
#customer-import-page { max-width: 1200px; }
#customer-import-page .admin-section.user-card { max-width: none; margin: 20px 0; padding: 24px 28px; }
/* Past Supplier Invoices (past_invoices.js): Upload Supplier Invoices' second card */
#past-invoices-section { margin-top: 20px; }
.past-buttons { justify-content: flex-start; margin: 4px 0 8px; }
.past-bar { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; margin: 6px 0 12px; }
.past-bar div { height: 100%; background: var(--navy, #1f3a5f); transition: width 0.4s; }
.past-bad { color: var(--red); }
.past-last { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 12px; }
.past-failed { margin: 8px 0 12px; font-size: 13px; }
.past-failed summary { cursor: pointer; color: var(--red); }
.past-failed ul { margin: 6px 0 0 18px; }

/* ── Settings → Support and its banner (support.js, tm.support_access) ── */
.support-banner { background: #e8f0fb; border-bottom: 1px solid #a9c3e8; color: #1f3a5f; padding: 8px 24px;
  font-size: 13px; line-height: 1.4; text-align: center; }
.support-banner a { color: #1f3a5f; }
.support-on { background: #e8f0fb; border: 1px solid #a9c3e8; border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; }
.support-choices { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin: 6px 0 14px; font-size: 14px; }
.support-choices label { display: flex; gap: 6px; align-items: center; }
.support-history { margin-top: 18px; font-size: 13px; }
.support-history td { padding: 4px 10px 4px 0; white-space: nowrap; }
.support-history table { display: block; overflow-x: auto; }
