:root {
  /* neutrals — Cal.com-inspired: white canvas, near-black ink, light-gray cards */
  --bg: #F8F9FA;
  --surface: #FFFFFF;
  --surface-2: #F5F5F5;
  --border: #E5E7EB;
  --grid: #D9DCE1;      /* table lines: dark enough to tell rows apart */
  --text: #111111;
  --text-soft: #374151;
  --text-faint: #646B78;
  --on-fill: #FFFFFF;    /* text and icons on dark or accent-ink fills */

  /* brand */
  --brand-ink: #17375E;  /* the JWD wordmark */
  --primary-active: #242424;
  --primary-disabled: #E5E7EB;
  --accent: #3B82F6;
  --accent-soft: #EFF6FF;

  /* two extra accents for fills, flags and icons, never for text (use the
     -ink colours below for that). */
  --accent-orange: #DD5B00;
  --accent-teal: #2A9D99;

  /* semantic status */
  --ok: #10B981;
  --critical-bg: #FEF2F2;

  /* text-safe inks — the tones above are for fills, borders and focus
     rings; anything that is read (text, icons) uses its -ink partner,
     which clears WCAG AA (4.5:1) on white and on its own -bg / -soft. */
  --accent-ink: #1D4ED8;
  --critical-ink: #B91C1C;


  /* status + mode palette — soft fill (-bg) with a deep ink that clears
     WCAG AA on it. Statuses read as a journey (slate → sky → indigo →
     amber → teal → green, rose = stopped); shipping modes use their own
     hues and a squared tag shape so they never read as a status. */
  --slate-bg: #F1F5F9;   --slate-ink: #475569;
  --sky-bg: #E0F2FE;     --sky-ink: #0369A1;
  --indigo-bg: #E0E7FF;  --indigo-ink: #4338CA;
  --amber-bg: #FEF3C7;   --amber-ink: #B45309;
  --teal-bg: #CCFBF1;    --teal-ink: #0F766E;  --teal-dot: #14B8A6;
  --green-bg: #DCFCE7;   --green-ink: #15803D;
  --rose-bg: #FFE4E6;    --rose-ink: #BE123C;
  --violet-bg: #F3E8FF;  --violet-ink: #7E22CE;
  --cyan-bg: #CFFAFE;    --cyan-ink: #0E7490;
  --blue-bg: #DBEAFE;    --blue-ink: #1D4ED8;
  --orange-bg: #FFEDD5;  --orange-ink: #C2410C;
  --stone-bg: #F5F5F4;   --stone-ink: #57534E;

  /* lane palette — Warehouse lanes only: a lane header's dot and a 3px left
     edge on its rows, never a fill or text. Muted earth tones, so a lane
     never reads as a status; each clears 3:1 on white. */
  --lane-brown: #8A5A2B;  --lane-olive: #6B7A12;  --lane-plum: #8E3A80;
  --lane-pine: #2F6B4F;   --lane-clay: #B4543A;   --lane-ochre: #A1781E;

  /* shape & elevation */
  --indigo-border: #C7D2FE;

  /* type scale — every font-size maps to one of these */
  --fs-xs: 11px;    /* chips, badges, column labels */
  --fs-sm: 12px;    /* secondary text */
  --fs-md: 13px;    /* table cells, controls */
  --fs-base: 14px;  /* body */
  --fs-lg: 16px;    /* modal and section titles */
  --fs-xl: 22px;    /* page title */
  --fs-2xl: 26px;   /* KPI numbers */

  /* icon sizes — every icon comes from icon() in icons.js at one of these */
  --icon-xs: 10px;  /* inside chips and tags */
  --icon-sm: 12px;  /* in table cells, menus, inline with text */
  --icon-md: 14px;  /* buttons and toolbars (default) */
  --icon-lg: 16px;  /* sidebar, file lists, search field */
  --icon-xl: 22px;  /* dialog and card headers */
  --icon-2xl: 28px; /* drop zones */

  --radius-xs: 4px;
  --radius-pill: 999px;
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --shadow-card: 0 1px 2px rgba(0,0,0,.05), 0 1px 1px rgba(0,0,0,.03);
}

* { box-sizing: border-box; }

/* Slim, low-contrast scrollbars everywhere instead of the default OS
   chrome — native CSS, no library, same treatment in every scrolling
   container (tables, modals, dropdowns) since it's set on * / -webkit. */
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-pill); }
*::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--surface);
  color: var(--text);
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: var(--fs-base);
}

/* A sideways two-finger swipe on a laptop touchpad that runs past a
   table's edge would go Back / Forward a browser page. Off for mouse and
   touchpad devices only (phones and tablets keep their own gestures).
   Safari ignores this, so app.js blocks the same swipe there too. */
@media (hover: hover) and (pointer: fine) {
  html, body { overscroll-behavior-x: none; }
}

.mono { font-family: 'Geist Mono', monospace; }

/* Icons (icons.js). Sized by token only, so the same icon looks the same everywhere. */
.icon { display: inline-block; flex: none; vertical-align: -0.125em; width: var(--icon-md); height: var(--icon-md); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; } /* here, not on each <svg>: icon() stays short */
.icon-xs { width: var(--icon-xs); height: var(--icon-xs); }
.icon-sm { width: var(--icon-sm); height: var(--icon-sm); }
.icon-lg { width: var(--icon-lg); height: var(--icon-lg); }
.icon-xl { width: var(--icon-xl); height: var(--icon-xl); }
.icon-2xl { width: var(--icon-2xl); height: var(--icon-2xl); }
/* Buttons and marks that hold only an icon: centre it. */
:is(.modal-close, .month-nav-arrow, .month-picker-year-arrow, .inline-edit-save, .inline-edit-cancel, .search-clear-btn, .notes-scope-close, .pickup-card-close, .eta-track-link, .piece-status-icon, .chevron, .driver-picker-caret, .row-context-sub-caret, .arrival-parts-caret, .files-tree-caret, .files-crumb-sep, .row-context-check, .site-menu-check) { display: inline-flex; align-items: center; justify-content: center; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ---------- layout shell ---------- */

.app {
  display: flex;
  height: 100vh;
  width: 100%;
}

.sidebar {
  position: relative;
  width: 216px;
  flex-shrink: 0;
  background: var(--bg);
  border-right: 1px solid var(--border);
  color: var(--text-soft);
  display: flex;
  flex-direction: column;
  transition: width .15s ease;
}

/* Collapse/expand toggle — a full-height strip along the sidebar's edge
   instead of a small button, so the click target never moves (a bottom
   corner button's position shifts every time the sidebar's own width
   changes, which made it fiddly to hit twice in a row). */
.sidebar-collapse-rail {
  position: absolute;
  top: 0;
  right: -9px;
  width: 17px;
  height: 100%;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-collapse-rail:hover { background: var(--accent-soft); }
.sidebar-collapse-rail-arrow {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s ease, transform .15s ease;
}
.sidebar-collapse-rail:hover .sidebar-collapse-rail-arrow { opacity: 1; color: var(--text); border-color: var(--accent); }
.sidebar.collapsed .sidebar-collapse-rail-arrow { transform: rotate(180deg); }

.sidebar.collapsed { width: 60px; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
}

.sidebar.collapsed .sidebar-brand { padding: 20px 0; justify-content: center; }

.brand-word {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--brand-ink);
  font-weight: 700;
  font-size: var(--fs-xl);
  letter-spacing: -.02em;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar.collapsed .brand-word { font-size: var(--fs-xl); }
.sidebar.collapsed .brand-logo { display: none; }
.sidebar.collapsed .brand-mark { display: block; }

.brand-mark { width: 26px; height: 26px; flex-shrink: 0; display: none; } /* only where the full logo doesn't fit */
.brand-logo { display: block; height: 40px; width: auto; border-radius: var(--radius-sm); } /* the client's full logo, as supplied (jwd-logo.jpg) */

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  flex: 1;
}

.sidebar.collapsed .sidebar-nav { padding: 8px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  font-size: var(--fs-md);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar.collapsed .nav-item { justify-content: center; padding: 9px; }
.sidebar.collapsed .nav-item span { display: none; }

.nav-item:hover { background: var(--surface); color: var(--text); }

.nav-item.active {
  background: var(--primary-active);
  color: var(--on-fill);
}


/* Warehouse's dropdown (PMC Inventory): a caret beside the item opens it. */
.nav-group { position: relative; display: flex; flex-direction: column; gap: 2px; }
.nav-group > .nav-item { padding-right: 34px; }
.nav-caret { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border: none; border-radius: var(--radius-sm); background: none; color: var(--text-faint); cursor: pointer; }
.nav-caret svg { transition: transform .15s ease; }
.nav-caret.is-open svg { transform: rotate(180deg); }
.nav-caret:hover { background: var(--surface); color: var(--text); }
.nav-group:has(> .nav-item.active) .nav-caret { color: rgba(255, 255, 255, .85); }
.nav-group:has(> .nav-item.active) .nav-caret:hover { background: rgba(255, 255, 255, .16); color: var(--on-fill); }
.nav-caret[hidden], .nav-sub[hidden] { display: none; }
.nav-sub { display: flex; flex-direction: column; gap: 2px; }
.nav-sub-item { padding-left: 38px; }
.sidebar.collapsed .nav-caret { display: none; }
/* Icon-only sidebar has no caret, so the sub-pages always show (as icons). */
.sidebar.collapsed .nav-sub[hidden] { display: flex; }
.sidebar.collapsed .nav-group > .nav-item { padding-right: 9px; }
.sidebar.collapsed .nav-sub-item { padding-left: 9px; }

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Search left, clock centred, people right — the side columns share the
   leftover width equally so the clock sits in the true centre. */
.topbar {
  height: 58px;
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
}

.topbar-clock {
  font-size: var(--fs-md);
  font-family: 'Geist Mono', monospace;
  color: var(--text-soft);
  white-space: nowrap;
}

.topbar-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar-left .topbar-search { min-width: 0; } /* the search box gives way to Debug on narrow screens */
.topbar-left .topbar-search input { min-width: 0; }
.topbar-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(340px, 100%);
  padding: 7px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-faint);
}
.topbar-search:focus-within { border-color: var(--accent); background: var(--surface); }
.topbar-search svg { flex-shrink: 0; }
.topbar-search input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit; font-size: var(--fs-md); line-height: 1.3;
  color: var(--text);
}

/* One card look for every floating list and menu. */
.search-results, .profile-menu, .suggest-list, .presence-menu {
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
}
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 460px;
  max-width: calc(100vw - 32px);
  max-height: 420px;
  overflow-y: auto;
  z-index: 60;
}
.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.search-result:hover, .search-result.is-active { background: var(--bg); }
/* Which tab the result opens — the same AWB can appear under several. */
.search-result-tab {
  flex-shrink: 0;
  width: 78px;
  padding: 2px 0;
  border-radius: var(--radius-xs);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  text-align: center;
}
.search-tab-receiving { background: var(--accent-soft); color: var(--accent-ink); }
.search-tab-warehouse { background: var(--amber-bg); color: var(--amber-ink); }
.search-tab-outgoing { background: var(--green-bg); color: var(--green-ink); }
.search-tab-clients { background: var(--surface-2); color: var(--text-soft); }
.search-tab-files, .search-tab-vendors, .search-tab-fleet, .search-tab-pickup, .search-tab-pmc, .search-tab-invoice { background: var(--indigo-bg); color: var(--indigo-ink); }
.search-result-main { display: flex; flex-direction: column; min-width: 0; }
.search-result-title { font-family: 'Geist Mono', monospace; font-size: var(--fs-md); }
.search-result-meta { font-size: var(--fs-sm); color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-empty { padding: 12px 10px; font-size: var(--fs-md); color: var(--text-faint); }

/* Drawn on each cell, not the row: the pinned AWB cell has its own background and would hide a row-level glow. */
@keyframes reveal-flash { from { background-color: color-mix(in srgb, var(--accent) 22%, var(--surface)); } }
.reveal-flash:not(tr), tr.reveal-flash > td { animation: reveal-flash 1.6s ease-out; }

.avatar {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xs);
  font-weight: 700;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Your own avatar — always the top-right corner — opens account settings. */
.account-btn {
  display: flex;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}
.account-btn .avatar { width: 30px; height: 30px; }
.account-btn:hover .avatar, .account-btn[aria-expanded="true"] .avatar { box-shadow: 0 0 0 2px var(--accent); }

.profile-menu-wrap { position: relative; }
.profile-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 220px;
  z-index: 50;
}
.profile-menu-header { padding: 8px 10px 10px; border-bottom: 1px solid var(--grid); margin-bottom: 6px; }
.profile-menu-name { font-size: var(--fs-md); font-weight: 600; color: var(--text); }
.profile-menu-email { font-size: var(--fs-sm); color: var(--text-faint); margin-top: 1px; }
.profile-menu-item {
  all: unset;
  box-sizing: border-box;
  display: block;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-md);
  color: var(--text);
  cursor: pointer;
}
.profile-menu-item:hover { background: var(--bg); }
.profile-menu-divider { height: 1px; background: var(--grid); margin: 6px 4px; }

.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: auto;
  padding: 14px 16px 16px;
}

/* ---------- page header ---------- */

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 16px;
}
/* The title/subtitle block is left free to shrink (and wrap its own
   subtitle prose across lines, which reads fine) so the actions block
   never has to give up its own one-line layout to make room — a
   toolbar wrapping mid-row looked broken in a way a wrapped sentence
   doesn't. */
.page-header > div:first-child { min-width: 0; flex: 1 1 auto; }

.page-title {
  color: var(--text);
  font-size: var(--fs-xl);
  font-weight: 600;
  letter-spacing: -.02em;
  margin: 0;
}

.page-subtitle {
  color: var(--text-soft);
  font-size: var(--fs-md);
  margin: 6px 0 0;
  text-transform: none;
}

/* ---------- buttons ---------- */

.btn {
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: var(--fs-md);
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary { background: var(--text); color: var(--on-fill); }
.btn-primary:hover { background: var(--primary-active); }
.btn-primary:disabled { background: var(--primary-disabled); color: var(--slate-ink); cursor: not-allowed; }

.btn-secondary { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-secondary:hover { background: var(--surface-2); }

.btn-sm { padding: 5px 10px; font-size: var(--fs-sm); }

/* ---------- KPI tiles ---------- */

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 16px 18px;
}

.kpi-label {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-faint);
  font-weight: 600;
  margin-bottom: 8px;
}

.kpi-value {
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--text);
  font-family: 'Geist Mono', monospace;
}

.kpi-delta { font-size: var(--fs-md); margin-top: 6px; color: var(--text-faint); }
.kpi-delta.warn { color: var(--amber-ink); }
.kpi-delta.ok { color: var(--green-ink); }

.kpi-tile-clickable { cursor: pointer; transition: box-shadow .15s ease, transform .15s ease; }
.kpi-tile-clickable:hover { box-shadow: 0 4px 14px rgba(0,0,0,.1); transform: translateY(-1px); }

.panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 16px;
}

.panel-title {
  font-weight: 600;
  color: var(--text);
  font-size: var(--fs-md);
}

/* ---------- dashboard calendar ---------- */

.dash-cal-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.dash-cal-toolbar .month-nav { flex-shrink: 0; }
.dash-driver-view-toggle.is-active { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }

.dash-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  /* Only the weekday-label row is explicitly sized (auto) — every week
     row after it is an implicit row, sized by grid-auto-rows, so they
     split whatever height .content's flex column hands this grid
     equally, however many weeks the viewed month has. */
  grid-template-rows: auto;
  grid-auto-rows: 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  flex: 1;
  min-height: 0;
}

.dash-cal-weekday {
  background: var(--bg);
  padding: 8px 10px;
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-faint);
  text-align: center;
}

.dash-cal-cell {
  background: var(--surface);
  min-height: 92px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  container-type: inline-size;
  container-name: dashcalcell;
}
.dash-cal-cell-empty { background: var(--bg); }
/* A background fill here would collide with --accent-soft on the pickup
   bar (both resolve to the same pale blue) and make it disappear —
   an inset ring reads as "today" without touching any bar's color. */
.dash-cal-cell-today { box-shadow: inset 0 0 0 1px var(--accent); }
.dash-cal-cell-today .dash-cal-daynum { color: var(--accent-ink); }

.dash-cal-daynum-row { display: flex; align-items: center; gap: 6px; }
.dash-cal-daynum { font-size: var(--fs-sm); font-weight: 600; color: var(--text-soft); }

.dash-cal-bars { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; flex: 1; min-height: 0; }
.dash-cal-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  cursor: pointer;
}
.dash-cal-bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-cal-bar-count { font-weight: 700; flex-shrink: 0; margin-left: auto; }
.dash-cal-bar-pickup { background: var(--accent-soft); color: var(--accent-ink); }
.dash-cal-bar-delivery { background: var(--accent-soft); color: var(--orange-ink); }
.dash-cal-bar-dispatch { background: var(--green-bg); color: var(--green-ink); }
.dash-cal-bar:hover { filter: brightness(0.92); }

@container dashcalcell (max-width: 130px) {
  .dash-cal-bar-count { display: none; }
}
/* Phone-width days: the count says more than a clipped label; the bar's
   title still names it. */
@container dashcalcell (max-width: 64px) {
  .dash-cal-bar { padding: 2px 3px; gap: 2px; }
  .dash-cal-bar-label { display: none; }
  .dash-cal-bar-count { display: inline; margin-left: 0; }
}

/* ---------- pills ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
  text-transform: uppercase;
}

/* Matches .status-select's own box exactly (same padding, same caret
   slot) so a locked chip takes up the same width in the column as the
   editable dropdown it's standing in for — a gray lock icon fills the
   caret's spot instead of the dropdown arrow. */
.pill-locked {
  position: relative;
  padding: 3px 22px 3px 10px;
}
.pill-lock-icon {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  color: var(--text-faint);
}

/* Fixed width shared by the Type column's editable select and its
   locked pill counterpart, so the chip doesn't visibly shrink/grow
   between rows just because one happens to be locked. Sized for
   "Deliver," the longest of the three type labels. */
.shipment-type-chip { width: 88px; box-sizing: border-box; }
/* The document button beside TYPE (AIR → PTT). */
.type-cell .row-doc-btn, .wh-status-cell .row-doc-btn { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-left: 4px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-soft); cursor: pointer; vertical-align: middle; }
.type-cell .row-doc-btn:hover, .wh-status-cell .row-doc-btn:hover { border-color: var(--accent); color: var(--accent-ink); }
/* Not ready for a PTT / BOL: greyed, same spot; the tooltip says why. */
.type-cell .row-doc-btn.is-unavailable, .type-cell .row-doc-btn.is-unavailable:hover, .wh-status-cell .row-doc-btn.is-unavailable, .wh-status-cell .row-doc-btn.is-unavailable:hover { border-style: dashed; border-color: var(--border); background: var(--bg); color: var(--text-faint); opacity: .7; cursor: not-allowed; }
.type-cell .row-doc-btn-text, .wh-status-cell .row-doc-btn-text { width: auto; padding: 0 6px; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .03em; }
.bol-l-table th, .bol-l-table td { white-space: nowrap; }
.bol-l-input { width: 100%; min-width: 70px; box-sizing: border-box; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; font: inherit; background: var(--surface); color: var(--text); }
/* Driver cover sheet preview (coversheet.js). */
.cover-trip { border: 1px solid var(--border); border-radius: var(--radius-sm, 8px); padding: 12px; margin-bottom: 14px; }
.cover-trip-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.cover-trip-badge.trip-no-badge { position: static; min-width: 28px; height: 28px; border-radius: 14px; font-size: var(--fs-base); align-self: center; }
.cover-trip-badge.is-none { background: var(--border); color: var(--text-soft); }
.cover-trip-field { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-sm); font-weight: 600; color: var(--text-soft); }
.cover-trip-no { width: 70px; min-width: 0; }
.cover-trip-appt { flex: 1; min-width: 160px; }
.cover-remove-trip { margin-left: auto; }
.cover-table td { vertical-align: top; }
.cover-table td:first-child .bol-l-input { min-width: 130px; }
.cover-table .cover-address { min-width: 200px; white-space: normal; }
.cover-table textarea.bol-l-input { resize: vertical; min-height: 30px; }
.cover-remove-line { border: none; background: none; color: var(--text-faint); cursor: pointer; padding: 6px; border-radius: 6px; }
.cover-remove-line:hover { color: var(--critical-ink); background: var(--bg); }
.cover-add-line { margin-top: 8px; }
.bol-l-head { font-weight: 700; }
.status-chip { width: 96px; box-sizing: border-box; }

.pill-live { background: var(--green-bg); color: var(--green-ink); }
.pill-live .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.pill-warn { background: var(--amber-bg); color: var(--amber-ink); }
.pill-ok { background: var(--green-bg); color: var(--green-ink); }
.pill-neutral { background: var(--surface-2); color: var(--text-soft); }
.pill-info { background: var(--accent-soft); color: var(--accent-ink); }

/* ---------- toolbar (search + filter chips) ---------- */

/* Above every table: the toolbar (left: find; right: how the table looks),
   then the row tools on their own line. Every control is 32px tall. */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.toolbar-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.toolbar-group { flex: 0 0 auto; max-width: 100%; }
.toolbar-view { margin-left: auto; justify-content: flex-end; }
/* Desktop: one row, always. An opened search box takes whatever room is left
   (down to 140px) instead of pushing controls onto a second line. */
.toolbar { position: relative; }
/* Wide screens: one row, always. An open search box sits in the row (the
   other buttons slide left) and shrinks, down to 140px, before anything
   would overflow. */
@media (min-width: 1280px) {
  .toolbar, .toolbar-group { flex-wrap: nowrap; }
}
/* With History or Notifications open the page is ~400px narrower than the
   window says: let the toolbar wrap rather than its buttons overlap. */
body:is(.history-open, .hub-open) :is(.toolbar, .toolbar-group) { flex-wrap: wrap; }
.toolbar-group.toolbar-view { flex: 0 1 auto; min-width: 0; }
/* Its controls keep their size (only an open search box shrinks); when they
   don't fit, fitToolbars() (app.js) sets .is-compact: icon buttons lose their label. */
.toolbar-view > :not(.search-inline) { flex-shrink: 0; }
.toolbar.is-compact :is(.btn-label, .btn-label-extra) { display: none; }
.toolbar.is-compact .btn:has(> .btn-label) { width: 32px; padding: 0; justify-content: center; } /* as .btn-icon */
.toolbar .search-box.search-inline { flex: 0 1 280px; width: auto; min-width: 140px; background: var(--surface); border-color: var(--accent); }
.search-clear-btn { border: none; background: none; color: var(--text-faint); cursor: pointer; padding: 0 2px; font-size: var(--fs-sm); }
.search-clear-btn:hover { color: var(--text); }
.toolbar-search-btn { position: relative; }
.toolbar-search-btn.is-active { color: var(--accent-ink); border-color: var(--accent); background: var(--accent-soft); }
.date-range-btn.btn-icon { position: relative; width: 32px; padding: 0; justify-content: center; color: var(--text-soft); }
.date-range-btn.btn-icon.is-active { color: var(--accent-ink); border-color: var(--accent); background: var(--accent-soft); }
.filter-dot { position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.range-picker-title { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 8px; }
.toolbar-title { margin-right: 10px; }
#content[data-screen="outgoing"] .toolbar { margin: 4px 0 10px; }
.btn-icon { width: 32px; padding: 0; justify-content: center; }
.toolbar .btn-sm, .toolbar .date-range-btn { height: 32px; box-sizing: border-box; padding-top: 0; padding-bottom: 0; border-radius: var(--radius-sm); }
.toolbar .search-box { flex: 0 1 auto; width: 280px; min-width: 200px; height: 32px; box-sizing: border-box; padding-top: 0; padding-bottom: 0; }
.toolbar .month-nav { height: 32px; box-sizing: border-box; }
.toolbar .month-nav-arrow, .toolbar .month-nav-trigger { height: 100%; padding-top: 0; padding-bottom: 0; }
.page-title-row { flex-wrap: wrap; row-gap: 8px; }
.page-date-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.page-date-controls .btn-sm, .page-date-controls .date-range-btn { height: 32px; box-sizing: border-box; padding-top: 0; padding-bottom: 0; border-radius: var(--radius-sm); }
.page-date-controls .month-nav { height: 32px; box-sizing: border-box; }
.page-date-controls .month-nav-arrow, .page-date-controls .month-nav-trigger { height: 100%; padding-top: 0; padding-bottom: 0; }
.btn-pair { display: inline-flex; }
.btn-pair .btn-expand-all:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.btn-pair .btn-expand-all:last-child { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; }

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  min-width: 260px;
  color: var(--text-faint);
}
.search-box input {
  border: none;
  outline: none;
  background: transparent;
  font-size: var(--fs-md);
  width: 100%;
  color: var(--text);
}

.toolbar-spacer { flex: 1; }

.count-label { font-size: var(--fs-md); color: var(--text-faint); white-space: nowrap; }

/* ---------- month + date-range controls ---------- */

.page-header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; flex-shrink: 0; }

.view-toggle {
  display: inline-flex;
  align-items: stretch;
  box-sizing: border-box;
  height: 32px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}
.view-toggle-btn {
  all: unset;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-faint);
  padding: 0 10px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
}
.view-toggle-btn:hover { color: var(--text); }
.view-toggle-btn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-card); }

.btn-expand-all {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-soft);
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.btn-expand-all:hover { background: var(--surface-2); color: var(--text); }

/* Elements with a title + this class get a JS-positioned tooltip (see
   initTooltips/showAppTooltip) instead of either the native title
   tooltip or a pure-CSS ::after one — both get clipped the moment the
   element sits inside a scrolling container like .table-container,
   since overflow-x: auto also clips the y axis. position: fixed here
   escapes that clipping regardless of which ancestor scrolls. */
#tooltip-root { position: fixed; top: 0; left: 0; z-index: 1000; pointer-events: none; }
.app-tooltip {
  position: absolute;
  background: var(--text);
  color: var(--on-fill);
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1.4;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  white-space: pre-line;
  width: max-content;
  max-width: 260px;
  box-shadow: 0 6px 16px rgba(0,0,0,.16);
  opacity: 0;
  animation: tooltip-in .1s ease-out .05s forwards;
}
.app-tooltip-arrow {
  position: absolute;
  top: 100%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--text);
}
.app-tooltip.app-tooltip-flip .app-tooltip-arrow {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: var(--text);
}
@keyframes tooltip-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

.month-nav {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.month-nav-arrow {
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-size: var(--fs-lg);
  line-height: 1;
  padding: 7px 9px;
  cursor: pointer;
}
.month-nav-arrow:hover { background: var(--surface-2); color: var(--text); }
.month-nav-trigger {
  display: flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 7px 10px;
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.month-nav-trigger:hover { background: var(--surface-2); }

.date-range-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 10px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.date-range-btn:hover { background: var(--surface-2); }
.date-range-btn.is-active { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.date-range-clear {
  margin-left: 2px;
  color: var(--text-faint);
  font-size: var(--fs-xs);
}
.date-range-btn.is-active .date-range-clear { color: var(--accent-ink); }
.date-range-clear:hover { color: var(--critical-ink); }

.today-badge {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
}

/* ---------- month picker dropdown ---------- */

.month-picker-dropdown {
  position: fixed;
  width: 210px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 28px rgba(0,0,0,.14);
  z-index: 150;
  padding: 10px;
}
.month-picker-year-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.month-picker-year { font-size: var(--fs-md); font-weight: 700; color: var(--text); }
.month-picker-year-arrow {
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-size: var(--fs-base);
  cursor: pointer;
  padding: 2px 8px;
}
.month-picker-year-arrow:hover { color: var(--text); }

.month-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.month-grid-cell {
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 0;
  font-size: var(--fs-md);
  color: var(--text);
  cursor: pointer;
  text-align: center;
}
.month-grid-cell:hover { background: var(--surface-2); }
.month-grid-cell.selected { background: var(--accent-ink); color: var(--on-fill); font-weight: 600; }

.month-picker-today-link {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  background: transparent;
  border-left: none;
  border-right: none;
  border-bottom: none;
  color: var(--accent-ink);
  font-size: var(--fs-md);
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}
.month-picker-today-link:hover { text-decoration: underline; }

/* ---------- date range popover ---------- */

.range-picker-popover {
  position: fixed;
  width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 28px rgba(0,0,0,.14);
  z-index: 150;
  padding: 12px;
}
.range-picker-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.range-picker-row label { font-size: var(--fs-md); color: var(--text-faint); }
.range-picker-row input[type="date"] {
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
  font-size: var(--fs-md);
  padding: 4px 6px;
  color: var(--text);
  font-family: inherit;
}
.range-picker-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

/* ---------- Excel-style column header sort & filter ---------- */

/* Label, sort arrow and menu caret sit together, centred on one line. */
.col-header { display: flex; align-items: center; justify-content: flex-start; gap: 2px; }
.col-header > span:first-child, th > .col-header-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
th > .col-header-label { display: inline-block; max-width: 100%; vertical-align: middle; white-space: nowrap; }
th.col-compact > .col-header-label { white-space: normal; min-width: 56px; } /* a checkbox column wraps its header rather than widen */
.col-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-faint);
  padding: 0;
  border-radius: var(--radius-xs);
  line-height: 1;
}
.col-filter-btn { position: relative; }
/* 18px to look at, 24px to hit (WCAG 2.5.8). */
/* Leaves the header's top edge to the column-name tooltip. */
.col-filter-btn::after { content: ""; position: absolute; inset: -2px -3px -4px; }
.col-filter-btn:hover { background: var(--surface-2); color: var(--text-soft); }
.col-filter-btn.is-filtered { color: var(--accent-ink); }
.col-filter-btn.is-sorted { color: var(--text); }
.col-sort-indicator { display: inline-flex; align-items: center; color: var(--accent-ink); flex-shrink: 0; margin-left: 2px; }

.col-filter-dropdown {
  position: fixed;
  width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 28px rgba(0,0,0,.14);
  z-index: 150;
  padding: 10px;
  font-size: var(--fs-md);
}
.col-filter-sort-row { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.col-sort-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  text-align: left;
  padding: 5px 6px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: var(--fs-md);
  color: var(--text);
}
.col-sort-btn:hover { background: var(--surface-2); }
.col-sort-reset-btn {
  background: transparent;
  border: none;
  text-align: left;
  padding: 5px 6px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: var(--fs-md);
  color: var(--text-faint);
}
.col-sort-reset-btn:hover { background: var(--surface-2); color: var(--critical-ink); }

.col-filter-search {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 5px 8px;
  margin-bottom: 6px;
  color: var(--text-faint);
}
.col-filter-search input { border: none; outline: none; background: transparent; font-size: var(--fs-md); width: 100%; color: var(--text); }

.col-filter-value-list { max-height: 180px; overflow-y: auto; margin-bottom: 8px; }
.col-filter-value-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 2px;
  cursor: pointer;
  font-size: var(--fs-md);
  color: var(--text);
}
.col-filter-value-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-filter-select-all { padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid var(--grid); font-weight: 600; }
.col-filter-empty { font-size: var(--fs-sm); color: var(--text-faint); padding: 6px 2px; }
.col-filter-actions { display: flex; justify-content: flex-end; }

.column-visibility-presets { display: flex; gap: 8px; flex-wrap: wrap; }
.column-visibility-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px 16px;
  margin-top: 8px;
  max-height: 320px;
  overflow-y: auto;
}
.col-visibility-grid-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 2px;
  cursor: pointer;
  font-size: var(--fs-md);
  color: var(--text);
}

/* ---------- row right-click menu ---------- */

.row-context-menu {
  position: fixed;
  width: 170px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 28px rgba(0,0,0,.14);
  z-index: 150;
  padding: 4px;
  font-size: var(--fs-md);
}
.row-context-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  padding: 8px 10px;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  font-size: var(--fs-md);
}
.row-context-item:hover { background: var(--surface-2); }
.row-context-danger { color: var(--critical-ink); }
.row-context-danger:hover { background: var(--critical-bg); }

/* Notification bell (notify.js): a toolbar icon button with a count, and a
   context-menu panel listing what needs a look, each with a line saying why. */
.notify-bell-btn { position: relative; color: var(--text-soft); }
.notify-bell-btn:has(.notify-count) { margin-right: 6px; } /* room for the count, so it stays inside the toolbar */
.notify-bell-btn.is-active { color: var(--accent-ink); border-color: var(--accent); background: var(--accent-soft); }
.notify-count { position: absolute; top: -6px; right: -6px; min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box; border-radius: var(--radius-pill); background: var(--accent-ink); color: var(--on-fill); font-size: var(--fs-xs); font-weight: 600; line-height: 16px; text-align: center; }
.row-context-menu.notify-panel { width: 380px; max-height: min(480px, calc(100vh - 120px)); overflow-y: auto; padding: 6px; }
.notify-head { display: flex; align-items: center; gap: 6px; padding: 4px 4px 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.notify-head-title { flex: 1; font-weight: 600; color: var(--text); }
.notify-item { display: flex; align-items: flex-start; gap: 2px; }
.notify-item .notify-open { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notify-title { font-weight: 600; font-family: 'Geist Mono', monospace; }
.notify-text { color: var(--text-soft); font-size: var(--fs-sm); }
.notify-dismiss { margin-top: 6px; }
.notify-empty { margin: 8px 6px; color: var(--text-faint); font-size: var(--fs-sm); }

/* ---------- collapsible date-group section rows ---------- */
/* One <table> per screen, one <thead> — date groups are section rows
   inside the same shared <tbody>, not separate mini-tables. */

.date-group-header { cursor: pointer; user-select: none; background: var(--surface-2); }
.date-group-header:hover td { background: var(--bg); }
.date-group-header td { padding: 0; border-right: none; }
tbody tr[data-ship-date]:not(:first-child) > td { border-top: 2px solid var(--border); }
.ship-date-cell { white-space: nowrap; }
.date-group-header-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
}
.date-group-label { font-size: var(--fs-md); font-weight: 700; color: var(--text); }
.date-group-count {
  font-size: var(--fs-xs);
  color: var(--text-faint);
  background: var(--surface);
  border-radius: var(--radius-pill);
  padding: 1px 8px;
}

/* ---------- status dropdown (editable in place) ---------- */

/* Two dropdowns in the app: the in-cell pill (.status-select, uppercase like
   the pills it sits beside) and the plain form dropdown below (bulk bar,
   forms, team, BOL) — one look everywhere, same box as a text input. */
.status-select, .status-select option { text-transform: uppercase; }
select:not(.status-select) {
  height: 32px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface) var(--select-caret) no-repeat right 10px center / var(--icon-sm);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-md);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
select:not(.status-select):hover { border-color: var(--text-faint); }
.form-group select { width: 100%; height: 38px; }

.status-select {
  border: none;
  border-radius: var(--radius-pill);
  padding: 3px 22px 3px 10px;
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 14px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: var(--icon-xs);
  background-image: var(--select-caret);
}
.status-select-live { background-color: var(--green-bg); color: var(--green-ink); }
.status-select-warn { background-color: var(--amber-bg); color: var(--amber-ink); }
.status-select-ok { background-color: var(--green-bg); color: var(--green-ink); }
.status-select-neutral { background-color: var(--surface-2); color: var(--text-soft); }
.status-select-info { background-color: var(--accent-soft); color: var(--accent-ink); }

/* ---------- warehouse received checkbox ---------- */

.check-in-timestamp { font-size: var(--fs-sm); color: var(--text-soft); white-space: nowrap; }
.check-in-clear-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-faint);
  font-size: var(--fs-xs);
  padding: 2px 4px;
  line-height: 1;
}
.check-in-clear-btn:hover { color: var(--critical-ink); }

/* ---------- inline cell editing (click to edit, explicit save/cancel) ---------- */

.editable-cell { cursor: pointer; border-bottom: 1px dashed transparent; }
.editable-cell:hover { border-bottom-color: var(--border); background: var(--accent-soft); }

/* Suggestion list under an input (customer cells, driver field). */
.suggest-list {
  position: fixed;
  z-index: 250;
  max-width: 360px;
  max-height: min(320px, 50vh);
  overflow-y: auto;
}
.suggest-list[hidden] { display: none; }
.suggest-head {
  padding: 4px 8px 6px;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.suggest-item {
  padding: 6px 8px;
  border-radius: var(--radius-xs);
  font-size: var(--fs-md);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.suggest-item:hover, .suggest-item.is-active { background: var(--accent-soft); }
.suggest-item mark { background: none; color: inherit; font-weight: 700; }

/* Another viewer is editing this cell: their colour, their name, their live draft. */
.editable-cell.cell-remote-editing {
  position: relative;
  outline: 2px solid var(--peer-color);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
  background: color-mix(in srgb, var(--peer-color) 10%, transparent);
  cursor: not-allowed;
}
.cell-remote-tag {
  position: absolute;
  left: -4px;
  bottom: calc(100% + 4px);
  padding: 0 5px;
  border-radius: var(--radius-xs);
  background: var(--peer-color);
  color: var(--on-fill);
  font: 600 10px/1.6 'Geist', sans-serif;
  white-space: nowrap;
  pointer-events: none;
  z-index: 1;
}

/* ---------- presence (who's online) ---------- */

.presence-wrap { position: relative; justify-self: end; display: flex; align-items: center; gap: 10px; }
.presence-stack {
  display: flex;
  align-items: center;
  padding: 3px;
  border: none;
  border-radius: var(--radius-pill);
  background: none;
  cursor: pointer;
}
.presence-stack:hover, .presence-stack[aria-expanded="true"] { background: var(--surface-2); }
.presence-stack[hidden] { display: none; }
/* Overlapping avatars in the topbar stack (base look: .member-avatar). */
.member-avatar.presence-avatar { width: 26px; height: 26px; margin-left: -6px; border: 2px solid var(--surface); font-size: var(--fs-xs); }
.member-avatar.presence-avatar:first-child { margin-left: 0; }
.member-avatar.presence-more { background: var(--surface-2); color: var(--text-soft); }

.presence-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 270px;
  z-index: 60;
}
.presence-menu-list { max-height: 300px; overflow-y: auto; }
.presence-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 8px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.presence-menu-item:hover:not(:disabled) { background: var(--bg); }
.presence-menu-item:disabled { cursor: default; }
.presence-menu-item .presence-avatar { margin-left: 0; }
.presence-menu-text { display: flex; flex-direction: column; min-width: 0; }
.presence-menu-name { font-size: var(--fs-md); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.presence-menu-where { font-size: var(--fs-sm); color: var(--text-faint); }
.presence-menu-action { margin-left: auto; font-size: var(--fs-sm); font-weight: 600; color: var(--accent-ink); white-space: nowrap; }
.presence-menu-footer { margin-top: 4px; padding: 8px 8px 4px; border-top: 1px solid var(--grid); }
.presence-count { font-size: var(--fs-sm); color: var(--text-soft); white-space: nowrap; }
.presence-count::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--ok);
  vertical-align: 1px;
}

/* "Following <name>" — pinned just under the topbar while follow mode is on. */
.main { position: relative; }
.follow-banner {
  position: absolute;
  top: 66px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 6px 5px 12px;
  border: 2px solid var(--peer-color);
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .1);
  font-size: var(--fs-md);
  font-weight: 500;
  z-index: 40;
}
.follow-banner[hidden] { display: none; }
.follow-banner button {
  padding: 3px 10px;
  border: none;
  border-radius: var(--radius-lg);
  background: var(--peer-color);
  color: var(--on-fill);
  font-family: inherit; font-weight: 600; font-size: var(--fs-sm); line-height: 1.4;
  cursor: pointer;
}

.nav-item { position: relative; }
.nav-presence {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: var(--fs-xs);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nav-presence[hidden] { display: none; }
.nav-item.active .nav-presence { background: rgba(255, 255, 255, .22); color: var(--on-fill); }
.sidebar.collapsed .nav-item .nav-presence:not([hidden]) {
  display: inline-flex;
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  font-size: var(--fs-xs);
}

/* ---------- ghost row (always-on inline "add row" affordance) ---------- */

.ghost-row { background: var(--bg); }
.ghost-row td { cursor: pointer; }
.ghost-row td[data-ghost-field]:hover { background: var(--accent-soft); }
.ghost-placeholder { color: var(--text-faint); font-style: italic; }

.inline-edit-wrap { position: relative; max-width: 100%; }
.inline-edit-input.is-upper { text-transform: uppercase; } /* shows capitals while typing; saved in capitals */
.inline-edit-input {
  display: block;
  border: 1px solid var(--accent);
  border-radius: var(--radius-xs);
  padding: 4px 6px;
  font-size: var(--fs-md);
  font-family: inherit;
  box-sizing: border-box;
  /* An <input>'s own intrinsic width (~20 characters) is what actually
     stretches an auto-layout table's column when it appears — this
     collapses that intrinsic request to near-zero so the column keeps
     whatever width the column's normal (non-editing) content already
     settled at, then min-width fills back out to that available space
     instead of exceeding it. */
  width: 1px;
  min-width: 100%;
}

/* The one-line editor floats over its cell instead of taking only the room
   the cell already has: next to a button or tag (a container's AWBs, a
   shipment's "+") or in a narrow number column that room can be a sliver.
   It starts at least 9em wide (or the cell's width, if wider), grows with
   what's typed where the browser can, and never pushes the column wider —
   an absolutely placed box adds nothing to the table's layout. The wrap
   keeps one input's height with an invisible line, so the row doesn't jump. */
.inline-edit-wrap:not(.inline-edit-wrap-wide) { flex: 1 1 auto; min-width: 0; }
.inline-edit-wrap:not(.inline-edit-wrap-wide)::before {
  content: "\200b"; display: block; visibility: hidden;
  padding: 4px 0; border: 1px solid transparent; font-size: var(--fs-md); line-height: normal;
}
.inline-edit-wrap:not(.inline-edit-wrap-wide) > .inline-edit-input {
  position: absolute; top: 0; left: 0; z-index: 6;
  width: max(100%, 9em); min-width: 0; max-width: none;
  background: var(--surface); color: var(--text);
}
@supports (field-sizing: content) {
  .inline-edit-wrap:not(.inline-edit-wrap-wide) > .inline-edit-input { field-sizing: content; width: auto; min-width: max(100%, 9em); max-width: max(100%, 32em); }
}
/* Floats below the input instead of sitting beside it (Confluence-style
   inline edit) — a resized-narrow column has no spare horizontal room,
   and side-by-side buttons were spilling past the cell's right edge. */
.inline-edit-actions {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 3px;
  display: flex;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 2px;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  z-index: 5;
}
.inline-edit-save, .inline-edit-cancel {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: var(--fs-md);
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  flex-shrink: 0;
}
.inline-edit-save { color: var(--green-ink); }
.inline-edit-save:hover { background: var(--green-bg); }
.inline-edit-cancel { color: var(--critical-ink); }
.inline-edit-cancel:hover { background: var(--critical-bg); }

/* ---------- Split View (Receiving, Warehouse) ----------
   The schedule and its Unassigned rows side by side, so rows drag straight onto a day.
   Either pane minimizes to a slim bar; the bar brings it back. */
.split-view-btn.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.split-view { flex: 1 1 0; min-height: 240px; display: flex; --split-ratio: .6; }
.split-pane { flex: var(--split-ratio) 1 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.split-pane-unassigned { flex: calc(1 - var(--split-ratio)) 1 0; }
/* The other pane minimized (a bar, not a section): this one takes all the width. A grow under 1 would leave a gap. */
.split-pane:only-of-type { flex: 1 1 0; }
.split-pane-bar + .split-pane, .split-pane + .split-pane-bar { margin-left: 12px; } /* one pane minimized: no resize bar between */
/* The 12px between the panes is the resize bar; a line shows on hover, focus and while dragging. */
.split-resizer { flex: 0 0 12px; position: relative; cursor: col-resize; }
.split-resizer::after { content: ""; position: absolute; top: 34px; bottom: 0; left: 5px; width: 2px; border-radius: 1px; background: transparent; transition: background .15s; }
.split-resizer:hover::after, .split-resizer:focus-visible::after, body.split-resizing .split-resizer::after { background: var(--accent); }
.split-resizer:focus-visible { outline: none; }
body.split-resizing, body.split-resizing * { cursor: col-resize !important; user-select: none; }
.split-pane .table-container-fill { min-height: 0; }
.split-pane-head { display: flex; align-items: center; gap: 8px; min-height: 28px; padding-left: 4px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-soft); }
.split-pane-min { margin-left: auto; width: 28px; height: 28px; }
.split-pane.date-group-drop-target > .table-container { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-soft); }
.split-pane-bar { flex: 0 0 36px; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 0; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-card); color: var(--text-soft); font: inherit; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; cursor: pointer; }
.split-pane-bar:hover { background: var(--surface-2); color: var(--text); }
.split-pane-bar-label { writing-mode: vertical-rl; }
.split-pane-empty td { padding: 24px 16px; border: 0; color: var(--text-faint); font-size: var(--fs-sm); }

/* ---------- tables ---------- */

.table-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow-x: auto;
}

/* A long table's own horizontal scrollbar used to sit at the very
   bottom of however many rows it had, off-screen until the whole page
   was scrolled down to it. Bounding the main tables to a fraction of
   the viewport turns each into its own scroll pane (sticky header
   included) so both scrollbars stay reachable no matter how many rows
   there are. Nested sub-tables (truck/pickup breakdowns) are already
   short and excluded so they don't get a second, redundant scrollbar. */
.table-container:not(.truck-breakdown-table-wrap) {
  max-height: calc(100vh - 320px);
  overflow-y: auto;
}

/* The one primary table on a page (Receiving/Warehouse/Outgoing/
   Clients' own list, not a stacked secondary table like Account
   Book's per-invoice breakdowns) — instead of guessing a fixed
   max-height that leaves dead space or crops early depending on how
   tall the page's own header/toolbar happens to be, this stretches it
   to fill exactly whatever's left of the viewport below them, via
   .content's own flex column (see .content). */
.table-container.table-container-fill {
  max-height: none;
  flex: 1 1 0;
  min-height: 240px;
}

table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }

th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: left;
  padding: 6px 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--grid);
  border-right: 1px solid var(--grid);
  box-shadow: inset 0 -1px 0 var(--grid); /* a collapsed border stays behind when the header sticks; this line goes with it */
  color: var(--text-faint);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.col-resize-handle {
  position: absolute;
  top: 0;
  right: -3px;
  bottom: 0;
  width: 6px;
  cursor: col-resize;
  z-index: 3;
  touch-action: none;
}
.col-resize-handle:hover, body.col-resizing .col-resize-handle { background: var(--accent); opacity: .5; }
body.col-resizing { cursor: col-resize; user-select: none; }
th:last-child { border-right: none; }
th[draggable="true"] { cursor: grab; }
th.col-dragging { opacity: .4; }
th.col-drop-target { box-shadow: inset 2px 0 0 var(--accent), inset -2px 0 0 var(--accent); background: var(--accent-soft); }

/* A confirmed trip's lock sits before the Type pill; a click unlocks it. */
/* A status with a button beside it (PTT, BOL…): one line while it fits; in a column
   made narrower by hand the button drops to a second line, never cut off. Use this
   class on any cell that pairs a status with an action. */
.status-action-cell { white-space: nowrap; }
table[data-fixed-layout] .status-action-cell { white-space: normal; }
.status-action-cell > button { margin-top: 2px; vertical-align: middle; }
.trip-lock-toggle {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-right: 4px;
  cursor: pointer;
  color: var(--text-faint);
  opacity: .85;
}
.trip-lock-toggle:hover { opacity: 1; color: var(--text); }
/* Press and hold to drag rows: a fill sweeps the row while holding, then the
   picked-up rows shrink a little and lift until they're dropped. */
.row-hold-fill {
  position: fixed;
  z-index: 300;
  pointer-events: none;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
  transform-origin: left center;
  animation-name: row-hold-fill;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}
@keyframes row-hold-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
tr.row-lifted {
  transform: scale(.97);
  box-shadow: 0 8px 22px rgba(15, 23, 42, .18), 0 0 0 1px var(--accent);
  position: relative;
  z-index: 2;
  transition: transform .12s ease-out, box-shadow .12s ease-out;
}
tr.row-lifted > td { background: var(--surface); }
body.row-press-dragging, body.row-press-dragging * { cursor: grabbing !important; user-select: none; }
.row-press-drag-badge { position: fixed; z-index: 400; pointer-events: none; }
/* Reduced motion: the bar is full width and fades in over the hold, so
   it still shows how long to hold without anything sliding. */
@keyframes row-hold-fade { from { opacity: .15; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .row-hold-fill { animation-name: row-hold-fade; transform: none; } tr.row-lifted { transform: none; } }
tr.row-dragging { opacity: .4; }
/* Drag image when several selected rows are dragged at once. Rendered
   off-screen only long enough for the browser to snapshot it. */
.row-drag-count {
  position: fixed;
  top: -100px;
  left: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--text);
  color: var(--surface);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
}
body.row-drag-selecting { user-select: none; }
.date-group-header.date-group-drop-target td { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
tr.row-drop-target td { box-shadow: inset 0 2px 0 var(--accent); }
tr.row-drop-target.row-drop-below td { box-shadow: inset 0 -2px 0 var(--accent); }

.link-button { all: unset; cursor: pointer; color: var(--accent-ink); }
.link-button:hover { text-decoration: underline; }

td {
  padding: 4px 10px;
  line-height: 1.3;
  border-bottom: 1px solid var(--grid);
  border-right: 1px solid var(--grid);
  color: var(--text);
  vertical-align: middle;
  /* A column dragged narrower than its content should wrap that content
     onto another line, not force the column back open or spill text
     past the cell edge. */
  overflow-wrap: break-word;
}
td:last-child { border-right: none; }

/* One row height: every data row is exactly 50px (2px padding top and bottom,
   1px border, 45px of content = three 15px lines). Content taller than that is cut at the box
   edge; wrapped text stops after two lines with "…". The box only opens up
   while its cell is being edited, or to show a teammate's name tag or a notes
   count just outside it. */
#content table tbody tr[data-row-id] { height: 50px; }
#content table tbody tr[data-row-id] > td { padding-top: 2px; padding-bottom: 2px; }
/* Three whole lines at most: whatever comes after the third line is hidden
   entirely (text ends in "…"), never sliced through. */
.cell-box {
  max-height: 45px;
  line-height: 15px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}
/* A stack that doesn't fit shows its later items (fitStackedCells). */
.cell-box.is-stack { display: block; -webkit-line-clamp: none; line-clamp: none; }
.stack-hidden { display: none !important; }
.cell-box .driver-picker-caret { line-height: 15px; }
/* Chip lists in a row: lines of chips sit closer, so two lines fit the 45px box. */
.cell-box .truck-chip-list { row-gap: 2px; }
.cell-box :is(.customs-chip, .truck-chip) { padding-top: 1px; padding-bottom: 1px; }
.stack-more { color: var(--text-faint); font-weight: 700; margin-right: 4px; cursor: pointer; border-radius: var(--radius-xs); padding: 0 2px; }
.stack-more:hover { color: var(--accent-ink); background: var(--accent-soft); }
/* Clicked "…": the whole cell, laid over the table below it; the row keeps its height. */
td:has(> .cell-box.is-expanded) { position: relative; overflow: visible !important; z-index: 30; }
.cell-box.is-expanded { position: absolute; top: 2px; left: 0; right: 0; z-index: 30; max-height: none; overflow: visible; display: block; -webkit-line-clamp: none; line-clamp: none; padding: 4px 8px 6px; background: var(--surface); border: 1px solid var(--accent); border-radius: var(--radius-sm); box-shadow: 0 8px 20px rgba(15, 23, 42, .14); }
.cell-box.is-expanded .stack-hidden { display: revert !important; }
.cell-box.is-expanded .stack-more { display: none; }
.cell-box:has(.inline-edit-wrap, .cell-remote-tag, .notes-badge) { max-height: none; overflow: visible; display: block; -webkit-line-clamp: none; line-clamp: none; }

/* Columns sized by hand (table[data-fixed-layout]): nothing leaves its cell.
   One-line values — codes, pills, dropdowns, buttons — end in "…" (hover shows
   them in full); pills and dropdowns first lose some padding (.is-tight). */
/* Whatever is still too wide is cut at the cell edge — except while the cell is
   being edited (its editor floats over its neighbours), or carries a
   teammate's name tag or a notes count, which sit just outside it on purpose. */
table[data-fixed-layout] td:not(:has(.inline-edit-wrap, .cell-remote-tag, .notes-badge)) { overflow: hidden; }
table[data-fixed-layout] :is(td.mono .editable-cell, td.mono .locked-value, .pill, .status-select, .truck-chip, .customs-chip, .driver-picker-trigger, .link-button, .check-in-timestamp, .leg-pmc, .receiving-parts-toggle, .wh-shipments-toggle, .container-group-toggle, .eta-cell-wrap .editable-cell, td .text-faint-sm) {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
table[data-fixed-layout] :is(td.mono, .eta-cell-wrap) :is(.editable-cell, .locked-value) { display: inline-block; }
table[data-fixed-layout] :is(.pill, .truck-chip, .customs-chip, .driver-picker-trigger, .link-button, .check-in-timestamp, .receiving-parts-toggle, .wh-shipments-toggle, .container-group-toggle) { display: inline-block; }
table[data-fixed-layout] td span.text-faint-sm { display: inline-block; }
table[data-fixed-layout] .customs-chip { display: inline-flex; } /* keeps its ✕ centred on the code */
table[data-fixed-layout] .pill .dot { display: inline-block; margin-right: 5px; vertical-align: middle; }
table[data-fixed-layout] :is(.to-address, .cell-sub) { overflow: hidden; text-overflow: ellipsis; }
table[data-fixed-layout] .flight-cell { min-width: 0; }
table[data-fixed-layout] .flight-cell > .editable-cell { flex: 0 1 auto; }
table[data-fixed-layout] .flight-cell > .pickup-info-btn { flex: none; }
table[data-fixed-layout] :is(.pill, .truck-chip).is-tight { padding-left: 6px; padding-right: 6px; }
table[data-fixed-layout] .status-select.is-tight { padding-left: 6px; padding-right: 15px; background-position: right 4px center; }
table[data-fixed-layout] .is-measuring-chip { max-width: none !important; }
/* Double-click a column edge: measured once at natural width, nothing wrapping. */
table.is-measuring :is(td, th) { white-space: nowrap; }
table.is-measuring :is(td, th) * { max-width: none !important; }

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg); }

.remark-original { color: var(--text); font-size: var(--fs-md); }
.remark-english { font-size: var(--fs-md); }

.eta-cell-wrap { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
/* Inside this flex row, .inline-edit-wrap's usual "collapse to 1px,
   then min-width:100% fills back to the column's width" trick has
   nothing stable to resolve that 100% against (its flex-item width
   depends on its own content, which depends on the parent...) and
   collapses to near-nothing — flex:1 gives it a definite width to
   grow into instead, with a floor so a narrow column still usable. */
.eta-cell-wrap .inline-edit-wrap { flex: 1 1 auto; min-width: 100px; }
.eta-track-link {
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
  flex-shrink: 0;
}
.eta-track-link:hover { color: var(--text); }

.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-faint);
  font-size: var(--fs-md);
}

/* ---------- outgoing (AWB rows, truck as sub-unit) ---------- */

.chevron-cell { width: 28px; }
.chevron {
  display: inline-block;
  color: var(--text-faint);
  font-size: var(--fs-lg);
  font-weight: 700;
  transition: transform .15s ease;
}
.chevron.open { transform: rotate(90deg); }

.awb-row { cursor: pointer; }
.awb-detail-row td { padding: 0; border-bottom: 1px solid var(--grid); background: var(--bg); }



/* Clicking a row (not a cell) with siblings — other PARTs of the same
   AWB, or other AWBs in the same container — highlights them together
   without opening an edit. */
/* An accent outline around the whole row, the pinned AWB cell included: top and bottom on every cell, the sides on the end cells. */
tr.receiving-row-highlighted > td, tbody tr.receiving-row-highlighted:hover > td.awb-cell { background: var(--accent-soft); box-shadow: inset 0 2px 0 var(--accent), inset 0 -2px 0 var(--accent); }
tr.receiving-row-highlighted > td:first-child { box-shadow: inset 2px 0 0 var(--accent), inset 0 2px 0 var(--accent), inset 0 -2px 0 var(--accent); }
tr.receiving-row-highlighted > td:last-child { box-shadow: inset -2px 0 0 var(--accent), inset 0 2px 0 var(--accent), inset 0 -2px 0 var(--accent); }
.awb-detail { padding: 18px; }

.awb-detail-fields-row {
  display: flex;
  gap: 32px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.col-label { display: block; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); margin-bottom: 3px; }
.col-value { font-weight: 600; color: var(--text); }

.delivery-leg-breakdown { padding: 8px 10px; border-left: 2px solid var(--accent-soft); background: var(--accent-soft); border-radius: var(--radius-sm); font-size: var(--fs-sm); }

.truck-breakdown { margin-bottom: 14px; }
.truck-breakdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.truck-breakdown-table th, .truck-breakdown-table td { padding: 8px 12px; font-size: var(--fs-md); }

.driver-picker-trigger {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text);
}
.driver-picker-trigger:hover { color: var(--accent-ink); }
/* Same look as the container-group chevron (.chevron) — one dropdown/
   expand arrow style used everywhere instead of a second, different one
   just for this trigger. Color inherits from the trigger button itself,
   so it turns accent-orange right along with the "Assign driver" text
   when unassigned, instead of staying neutral gray. */
.driver-picker-caret {
  display: inline-block;
  color: inherit;
  font-size: var(--fs-lg);
  font-weight: 700;
  transition: transform .15s ease;
}
.driver-picker-caret.open { transform: rotate(90deg); }

/* Waiting for a driver — surfaced wherever a driver cell/row can be blank */

/* One color per PART letter, cycling after 6 — makes A/B/C/D read as
   distinct parts at a glance instead of identical gray text. */
.part-label { font-weight: 600; }
/* Same hues as before at one shared lightness (OKLCH L .48), so every letter
   clears 4.5:1 on white and on its own badge tint, and no part looks heavier
   than the others. */
.part-color-1 { --part-c: #0062A6; } /* sky */
.part-color-2 { --part-c: #7241A0; } /* purple */
.part-color-3 { --part-c: #9E246B; } /* pink */
.part-color-4 { --part-c: #006F6A; } /* teal */
.part-color-5 { --part-c: #00722E; } /* green */
.part-color-6 { --part-c: #844F27; } /* brown */
[class*="part-color-"] { color: var(--part-c); }
/* A part after the AWB number: a small tag with its letter (A, B, C…),
   tinted in the part's colour, exactly the height of the AWB text. One line,
   and not copied with the number. */
.part-badge {
  display: inline-block; vertical-align: baseline;
  margin-left: 4px; padding: 0 4px; border-radius: var(--radius-xs);
  background: color-mix(in srgb, var(--part-c) 16%, transparent); color: var(--part-c);
  font-size: inherit; line-height: inherit; font-weight: 600;
  white-space: nowrap; user-select: none;
}
.part-badge .editable-cell, .part-badge > span { display: inline; padding: 0; margin: 0; color: inherit; background: none; }
/* Renaming: the badge opens into a plain box wide enough to type in. */
.part-badge:has(.inline-edit-input) { background: none; color: var(--text); height: auto; padding: 0; }
.driver-picker-trigger.driver-unassigned { color: var(--orange-ink); text-transform: uppercase; } /* ASSIGN DRIVER: a call to action that stands out in a column of names */
/* On the orange-tinted "unassigned" cell the usual ink falls short of 4.5:1. */
.cell-unassigned .driver-unassigned { color: var(--orange-ink); }
/* Warehouse status chips share one width so the column lines up. */
.wh-status-select { width: 117px; }

.truck-split-row td { padding: 8px 12px; }
.truck-split-form { display: flex; align-items: center; gap: 8px; }
.truck-split-form input[type="text"] {
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 5px 8px;
  font-size: var(--fs-md);
  font-family: inherit;
  color: var(--text);
}
.truck-split-form input[id^="split-truck-input"] { flex: 1; }
.truck-split-form input[id^="split-pickup-driver"] { width: 160px; flex: none; }
.truck-split-form input[id^="split-pieces-input"] { width: 80px; }
.truck-split-form input[id^="split-pickup-pieces"] { width: 110px; }


/* Ctrl/Cmd or Shift-click selection, for bulk actions. */
tr.row-selected td { background: var(--accent-soft); }
tr.row-selected:hover td { background: var(--accent-soft); }

.bulk-action-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  margin-bottom: 10px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
}
.bulk-count { font-size: var(--fs-md); font-weight: 600; color: var(--accent-ink); margin-right: 4px; }
.bulk-move-date-input {
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-size: var(--fs-md);
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
}
.bulk-clear-btn {
  all: unset;
  cursor: pointer;
  font-size: var(--fs-md);
  color: var(--text-faint);
  margin-left: auto;
}
.bulk-clear-btn:hover { color: var(--text); }
/* Row tools: their own line under the toolbar, always shown (greyed out
   until rows are selected) and the same size either way, so selecting a row
   never shifts the table. */
.bulk-action-bar-inline { flex-wrap: wrap; gap: 6px 8px; min-height: 42px; flex-shrink: 0; box-sizing: border-box; padding: 5px 6px 5px 12px; margin: 0 0 10px; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--radius-sm); }
.bulk-action-bar-inline.is-empty { background: var(--surface); border-color: var(--border); }
.bulk-action-bar-inline .bulk-count { font-size: var(--fs-sm); white-space: nowrap; margin-right: 0; }
.bulk-action-bar-inline select, .bulk-action-bar-inline .btn-sm { height: 30px; box-sizing: border-box; padding-top: 0; padding-bottom: 0; }
.bulk-action-bar-inline select { max-width: 160px; }
.bulk-action-bar-inline .bulk-clear-btn { display: inline-flex; align-items: center; gap: 4px; min-height: 30px; margin-left: 0; padding: 0 4px; font-size: var(--fs-sm); }
.bulk-action-bar-inline .bulk-clear-btn:disabled { visibility: hidden; }
/* Edits, a divider, then Documents: one group on the right, one gap throughout. */
.bulk-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.bulk-divider { width: 1px; height: 20px; background: var(--border); }
.bulk-date-wrap { position: relative; display: inline-flex; }
/* Still rendered (showPicker needs it), just not seen: the picker opens under the button. */
.bulk-date-wrap .bulk-move-date-input { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.bulk-docs-wrap .site-menu { left: auto; right: 0; min-width: 200px; z-index: 50; } /* over the table and its row ⋯ button (40) */
.bulk-docs-wrap:not(.open) .site-menu { display: none; }
.site-menu-action:disabled, .site-menu-action[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.site-menu-action:disabled:hover { background: none; }
.bulk-action-hint { font-size: var(--fs-sm); color: var(--text-faint); }
.add-menu-wrap { position: relative; }
/* The caret on + New Shipment opens the menu (touch screens); the rest of the button scans. */
.new-shipment-caret { display: inline-flex; align-items: center; margin: -7px -7px -7px 0; padding: 7px; border-radius: var(--radius-sm); }
.new-shipment-caret:hover { background: rgba(255, 255, 255, 0.18); }
.site-menu.add-menu { left: auto; right: 0; min-width: 250px; display: none; }
/* An invisible bridge over the gap, so moving down onto the menu keeps it open. */
.add-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
.new-shipment-wrap:hover .site-menu.add-menu, .new-shipment-wrap:has(:focus-visible) .site-menu.add-menu, .new-shipment-wrap.open .site-menu.add-menu { display: block; }
.add-menu-key { margin-left: auto; padding-left: 16px; font-size: var(--fs-xs); color: var(--text-faint); }
/* The page's own actions are a step bigger than the table tools below. */
.page-header-actions .btn { height: 38px; box-sizing: border-box; padding: 0 16px; }
.new-shipment-menu-btn { min-width: 170px; justify-content: center; }
.bulk-action-bar.is-empty .bulk-count { color: var(--text-faint); }
.leg-done-stamp { white-space: nowrap; }
.nav-item[hidden] { display: none; }
.bulk-action-bar select:disabled, .bulk-move-date-input:disabled, .bulk-action-bar .btn:disabled { opacity: .55; cursor: not-allowed; }

.truck-chip-list { display: flex; flex-wrap: wrap; gap: 5px; }
.truck-chip {
  display: inline-flex;
  align-items: center;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: var(--fs-sm);
  font-weight: 600;
  font-family: 'Geist Mono', monospace;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.customs-chip-list { align-items: center; }
.customs-chip {
  display: inline-flex;
  align-items: center;
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: var(--fs-xs);
  font-weight: 600;
  font-family: 'Geist Mono', monospace;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
}
.customs-chip-arrow { display: inline-flex; align-items: center; margin: 0 3px; color: var(--text-faint); vertical-align: -1px; }
.customs-chip-cleared, .customs-chip-cleared .editable-cell { background: var(--green-bg); color: var(--green-ink); font-weight: 600; }
.customs-chip-held, .customs-chip-held .editable-cell { background: var(--rose-bg); color: var(--rose-ink); font-weight: 600; }
/* A locked row's latest chip keeps the room of the ✕ (4px gap + 10px icon), so it's as long as the editable one. */
.customs-chip-locked { padding-right: 21px; }
.customs-chip .editable-cell { border-bottom: 0; } /* the chip's hover fill is enough; keeps it as tall as a locked one */

.truck-chip-remove {
  all: unset;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  width: 10px;
  height: 10px;
  font-size: var(--fs-xs);
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
}
.truck-chip-remove:hover { opacity: 1; }

.truck-chip-add {
  all: unset;
  padding: 2px; /* keeps a 20px target around the 16px icon */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  vertical-align: middle;
  border-radius: var(--radius-pill);
  color: var(--text-faint);
  cursor: pointer;
}
.truck-chip-add:hover { color: var(--accent-ink); }

.truck-chip-add-form { display: inline-flex; align-items: center; gap: 4px; }
.truck-chip-add-input {
  width: 66px;
  font-size: var(--fs-sm);
  font-family: 'Geist Mono', monospace;
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--text);
}
/* A longer code stays visible while typing: the box grows with it. */
@supports (field-sizing: content) { .truck-chip-add-input { field-sizing: content; width: auto; min-width: 66px; max-width: 16em; } }
.truck-chip-add-cancel {
  all: unset;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: var(--fs-xs);
  color: var(--text-faint);
  cursor: pointer;
}
.truck-chip-add-cancel:hover { color: var(--critical-ink); }

.fee-panel {
  margin-top: 18px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.fee-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.fee-field label {
  display: block;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-faint);
  margin-bottom: 6px;
  font-weight: 600;
}

.fee-input-wrap { position: relative; }
.fee-input-wrap .currency { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-faint); font-size: var(--fs-md); }
.fee-input-wrap input {
  width: 100%;
  padding: 7px 10px 7px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-md);
  font-family: 'Geist Mono', monospace;
  background: var(--surface);
}
.fee-input-wrap-sm { width: 90px; }
.fee-input-wrap-sm input { padding: 5px 8px 5px 18px; font-size: var(--fs-sm); width: 100%; box-sizing: border-box; }
.fee-input-wrap-sm .currency { font-size: var(--fs-xs); left: 7px; }

.primary-tag {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  margin-left: 4px;
}
.split-badge {
  display: inline-block;
  background: var(--amber-bg);
  color: var(--amber-ink);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  margin-left: 4px;
  cursor: help;
}
.truck-dest-edit { display: flex; gap: 4px; }
.truck-dest-edit input {
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 6px 8px;
  font-size: var(--fs-md);
  font-family: inherit;
  color: var(--text);
}

.fee-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.fee-total-label { font-size: var(--fs-md); color: var(--text-soft); }
.fee-total-value { font-size: var(--fs-lg); font-weight: 700; color: var(--text); font-family: 'Geist Mono', monospace; }

.fee-note { font-size: var(--fs-sm); color: var(--text-faint); margin-top: 10px; line-height: 1.5; }

.checkbox-cell { text-align: center; }
input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); }

/* ---------- new shipment form fields (used inside the modal) ---------- */

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.export-scope-choice { display: flex; gap: 18px; margin-bottom: 14px; }
.export-scope-option { display: flex; align-items: center; gap: 6px; font-size: var(--fs-md); color: var(--text); cursor: pointer; }
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 6px;
}
.form-group input, .form-group textarea, .ship-fields .sf-input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-md);
  background: var(--surface);
  font-family: inherit;
}
.form-group textarea { resize: vertical; min-height: 56px; }
.form-group input:focus, .form-group textarea:focus, .ship-fields .sf-input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.form-group input:disabled { background: var(--surface-2); color: var(--text-soft); cursor: not-allowed; }
.label-optional { margin-left: 4px; font-weight: 400; color: var(--text-faint); }
.field-error { margin: 6px 0 0; font-size: var(--fs-sm); color: var(--critical-ink); }

/* ---------- account settings / team / support ---------- */

.settings-stack { display: flex; flex-direction: column; gap: 20px; max-width: 760px; }
/* Account Settings (tabs): one panel, each setting a row: name and why on the
   left, its fields (and Save) on the right, using the page's full width. */
.settings-tabs { margin-bottom: 16px; }
.settings-rows { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.settings-rows > .settings-card { display: grid; grid-template-columns: minmax(220px, 320px) minmax(0, 1fr); column-gap: 48px; align-items: start; padding: 24px 28px; background: none; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; box-shadow: none; }
.settings-rows > .settings-card:last-child { border-bottom: 0; }
.settings-rows > .settings-card > * { grid-column: 2; max-width: 760px; }
.settings-rows > .settings-card > .settings-card-head { grid-column: 1; grid-row: 1 / span 9; padding: 0; }
.settings-rows .settings-card-body { padding: 0; }
.settings-rows .settings-card-foot { justify-content: flex-start; padding: 14px 0 0; border: 0; background: none; border-radius: 0; }
@media (max-width: 900px) {
  .settings-rows > .settings-card { grid-template-columns: minmax(0, 1fr); row-gap: 14px; padding: 20px; }
  .settings-rows > .settings-card > *, .settings-rows > .settings-card > .settings-card-head { grid-column: 1; grid-row: auto; }
}
.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.settings-card-head { padding: 18px 22px 0; }
.settings-card-head h2 { margin: 0; font-size: var(--fs-lg); font-weight: 600; color: var(--text); }
.settings-card-head p { margin: 4px 0 0; font-size: var(--fs-md); line-height: 1.5; color: var(--text-soft); max-width: 60ch; }
.settings-card-body { padding: 18px 22px 4px; }
.settings-card-foot {
  display: flex;
  justify-content: flex-end;
  padding: 12px 22px;
  border-top: 1px solid var(--grid);
  background: var(--bg);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.settings-photo-row { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.settings-photo-actions { display: flex; flex-direction: column; gap: 6px; }
.settings-photo-buttons { display: flex; gap: 8px; }
.settings-hint { margin: 6px 0 0; font-size: var(--fs-sm); color: var(--text-faint); }
.settings-signin-row { padding-bottom: 18px; }
.settings-signin-row .settings-hint { margin: 0; font-size: var(--fs-md); }
.settings-note {
  margin-bottom: 14px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: var(--fs-md);
  color: var(--text-soft);
}

.member-avatar {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--peer-color);
  color: var(--on-fill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xs);
  font-weight: 700;
  overflow: hidden;
}
.member-avatar img { width: 100%; height: 100%; object-fit: cover; }
.member-cell { display: flex; align-items: center; gap: 10px; }
.member-text { display: flex; flex-direction: column; min-width: 0; }
.member-name { font-weight: 500; }
.role-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text-soft);
}
.role-pill.role-owner { background: var(--accent-soft); color: var(--accent-ink); }
.role-pill.role-editor { background: var(--accent-soft); color: var(--accent-ink); }
.member-status { font-size: var(--fs-md); color: var(--text-faint); white-space: nowrap; }
.member-status.is-online { color: var(--green-ink); font-weight: 500; }
.member-status.is-online::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--ok);
  vertical-align: 1px;
}

.support-intro { margin: 0 0 16px; font-size: var(--fs-md); color: var(--text-soft); }
.support-attach-hint { display: inline; margin-left: 8px; }
.support-shot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.support-shot img { width: 72px; height: 48px; object-fit: cover; border-radius: var(--radius-xs); border: 1px solid var(--grid); }
.support-shot-name { flex: 1; min-width: 0; font-size: var(--fs-md); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.support-sent { padding: 12px 0; text-align: center; }
.support-sent h3 { margin: 12px 0 6px; font-size: var(--fs-lg); color: var(--text); }
.support-sent p { margin: 4px 0; font-size: var(--fs-md); color: var(--text-soft); }
.support-sent-mark {
  width: 44px;
  height: 44px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--green-bg);
  color: var(--green-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xl);
  font-weight: 700;
}

.calc-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--green-bg);
  color: var(--green-ink);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
  font-family: 'Geist Mono', monospace;
}

/* ---------- clients (CRM) ---------- */

.logo-tile {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-sm);
  font-weight: 700;
  flex-shrink: 0;
}

.client-company-cell { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.text-faint-sm { font-size: var(--fs-sm); color: var(--text-faint); }

.piece-status-icon { position: relative; display: inline-flex; vertical-align: middle; margin-left: 6px; cursor: default; }
.piece-status-ok { color: var(--green-ink); }
/* Total pieces: the number and its ring in one row, centred on each other. */
.pieces-progress { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0; vertical-align: middle; }
.pieces-progress > .piece-status-icon { margin-left: 0; margin-top: -2px; flex: none; } /* numerals sit 1px above the line box's middle */
.breadcrumb {
  align-items: center;
  gap: 4px;
  font-size: var(--fs-md);
  color: var(--accent-ink);
  cursor: pointer;
  font-weight: 500;
  margin-bottom: 16px;
  display: inline-flex;
}
.breadcrumb:hover { text-decoration: underline; }

.client-header-left { display: flex; align-items: center; gap: 14px; }

.client-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.contact-card-body { display: flex; gap: 14px; align-items: flex-start; }
.avatar-lg { width: 44px; height: 44px; font-size: var(--fs-base); flex-shrink: 0; }
.contact-name { font-weight: 600; color: var(--text); margin-bottom: 2px; }

.additional-contact-panel { margin-bottom: 8px; }
.additional-contact-row { margin-bottom: 12px; }
.additional-contact-name { font-weight: 600; color: var(--text); font-size: var(--fs-md); }

/* ---------- client detail tabs + account book ---------- */

.detail-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.detail-tab {
  background: transparent;
  border: none;
  padding: 9px 14px;
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text-faint);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.detail-tab:hover { color: var(--text-soft); }
.detail-tab.active { color: var(--accent-ink); border-bottom-color: var(--accent); }

.account-book-rollup {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin-bottom: 10px;
}

.account-book-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.account-book-history-title { margin: 22px 0 10px; font-size: var(--fs-lg); font-weight: 600; }
.fee-cell { white-space: nowrap; }
.fee-cell-amount { display: flex; align-items: center; gap: 6px; }
.fee-status-btn { border: none; cursor: pointer; margin-top: 4px; font-size: var(--fs-xs); padding: 2px 8px; }
.fee-status-btn:hover { filter: brightness(.95); }

/* ---------- invoice / edit line items ---------- */

.eli-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--grid);
}
.eli-row:last-child { border-bottom: none; }
.eli-row-info { flex: 1; min-width: 0; }
.eli-amount-wrap { width: 110px; flex-shrink: 0; }

/* ---------- new shipment modal ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17,17,17,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
}

.modal-dialog {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 48px rgba(0,0,0,.22);
  width: 100%;
  max-width: 640px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-title { font-size: var(--fs-lg); font-weight: 600; letter-spacing: -.01em; color: var(--text); margin: 0; }

.modal-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-faint);
  font-size: var(--fs-lg);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }

.modal-body {
  padding: 22px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* Driver/delivery assignment — a small floating form anchored under
   whatever opened it, not a centered modal behind a backdrop. No title
   bar: the popup's position next to the row it's for is context enough. */
.driver-assign-popup {
  position: fixed;
  z-index: 210;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(0,0,0,.18);
  width: 300px;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px);
  overflow-y: auto;
  overscroll-behavior: contain; /* scrolling it doesn't scroll the table behind */
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.driver-assign-popup::-webkit-scrollbar { width: 6px; }
.driver-assign-popup::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.driver-assign-form { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.driver-assign-form .form-group { margin-bottom: 0; }
/* Pieces and PMC share a row, half each. */
.leg-pmc { font-size: var(--fs-xs); line-height: 1.3; color: var(--text-soft); white-space: nowrap; }
/* A locked trip's number: an inline tag after the driver's name. */
.trip-tag {
  display: inline-block; vertical-align: 1px; margin-left: 2px; padding: 0 5px;
  border-radius: var(--radius-xs); background: var(--slate-bg); color: var(--slate-ink);
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: var(--fs-xs); font-weight: 600; line-height: 16px;
  font-variant-numeric: tabular-nums; white-space: nowrap; cursor: default;
}
/* The cover sheet's printed trip circle. */
.trip-no-badge {
  min-width: 20px; height: 20px; padding: 0 5px; box-sizing: border-box; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-ink); color: var(--on-fill);
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: var(--fs-sm); font-weight: 700; line-height: 1;
  cursor: default;
}
.row-context-item:disabled { color: var(--text-faint); cursor: not-allowed; background: none; }
.da-pmc-field input[type="checkbox"]:disabled { cursor: not-allowed; opacity: .5; }
.da-pieces-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.da-pieces-row .form-group input[type="number"] { width: 100%; min-width: 0; }
.da-pmc-field { display: flex; align-items: center; gap: 8px; }
.da-pmc-field input[type="checkbox"] { flex: none; width: 16px; height: 16px; margin: 0; }
.da-pmc-field input[type="text"] { flex: 1; min-width: 0; width: 100%; padding-left: 8px; padding-right: 8px; font-size: var(--fs-md); text-transform: uppercase; }
.da-pmc-field input[type="text"]::placeholder { text-transform: none; }
.da-pmc-field input[type="text"]:disabled { background: var(--surface-2); color: var(--text-faint); cursor: not-allowed; }


.form-checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-md);
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}

.driver-assign-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}
/* The optional "Remove this pickup" button plus Cancel/Save don't all fit
   on one line inside the popup's fixed 300px width — forcing it onto its
   own full-width row keeps Save from spilling past the popup edge. */
.driver-assign-form-actions .remove-pickup-btn { flex: 1 1 100%; }
.driver-assign-form-actions-right { display: flex; gap: 8px; margin-left: auto; }

.upload-zone {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  color: var(--text-soft);
  margin-bottom: 20px;
}
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--accent); background: var(--accent-soft); }
.upload-zone-title { font-size: var(--fs-md); font-weight: 600; color: var(--text); margin-top: 10px; }
.upload-zone-sub { font-size: var(--fs-sm); color: var(--text-faint); margin-top: 4px; }

.scan-error {
  background: var(--amber-bg);
  color: var(--amber-ink);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: var(--fs-md);
  margin-bottom: 18px;
}

.scan-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 48px 20px;
  text-align: center;
}

.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid var(--surface-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.scan-progress-label { font-size: var(--fs-md); font-weight: 600; color: var(--text); }
.scan-progress-file { font-size: var(--fs-sm); color: var(--text-faint); }


/* Scan review: document on the left, what was read on the right. */
.modal-dialog.modal-dialog-wide { max-width: 1180px; }
.modal-dialog-wide .modal-body { display: flex; min-height: 0; padding: 0; }
.scan-review {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  flex: 1;
  min-height: 0;
  width: 100%;
}
.scan-review-doc {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--border);
  background: var(--bg);
}
.scan-review-doc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.scan-review-file { font-size: var(--fs-md); font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-review-doc-body { flex: 1; min-height: 0; overflow: auto; padding: 14px; }
.scan-review-doc-body img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  background: var(--surface);
  cursor: zoom-in;
}
.scan-review-doc-body.is-zoomed img { width: 220%; max-width: none; cursor: zoom-out; }
.scan-review-data { min-height: 0; overflow-y: auto; padding: 18px 22px; }
.scan-review-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: var(--fs-sm); color: var(--text-faint); }
.scan-engine { padding: 2px 8px; border-radius: var(--radius-pill); font-size: var(--fs-sm); font-weight: 600; background: var(--surface-2); color: var(--text-soft); }
.scan-engine-claude { background: var(--accent-soft); color: var(--accent-ink); }
.scan-engine-note { margin-top: 10px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--amber-bg); color: var(--amber-ink); font-size: var(--fs-sm); }
.scan-review-hint { margin: 10px 0 14px; font-size: var(--fs-md); line-height: 1.5; color: var(--text-soft); }
.scan-found-tag {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  background: var(--green-bg);
  color: var(--green-ink);
  font-size: var(--fs-xs);
  font-weight: 600;
  white-space: nowrap;
}
.seg-toggle { display: inline-flex; margin-bottom: 16px; padding: 2px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.seg-toggle-btn {
  padding: 5px 14px;
  border: none;
  border-radius: var(--radius-xs);
  background: none;
  color: var(--text-soft);
  font-family: inherit; font-weight: 600; font-size: var(--fs-md); line-height: 1.3;
  cursor: pointer;
}
.seg-toggle-btn.is-active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.scan-json {
  margin: 0;
  padding: 14px;
  max-height: 460px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font: 12px/1.6 'Geist Mono', monospace;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
/* New Shipment: one field per line — its label, its box under it, and
   (CBM / weight) the worked-out pallets / lbs under that. */
.modal-dialog.modal-dialog-ship:not(.modal-dialog-wide) { max-width: 520px; }
.ship-fields { margin-bottom: 4px; }
.ship-field { margin-bottom: 12px; }
.sf-label { display: block; margin-bottom: 4px; font-size: var(--fs-sm); font-weight: 600; color: var(--text-soft); }
.sf-label .scan-found-tag { margin-left: 6px; }
.ship-fields .sf-input { display: block; width: 100%; height: 37px; }
.ship-fields .sf-input.mono { font-family: 'Geist Mono', monospace; }
.sf-calc { margin-top: 6px; }
@media (max-width: 860px) {
  .scan-review { grid-template-columns: 1fr; }
  .modal-dialog-wide .modal-body { display: block; overflow-y: auto; }
  .scan-review-doc { border-right: none; border-bottom: 1px solid var(--border); max-height: 50vh; }
}

/* ---------- toast ---------- */

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  max-width: min(440px, calc(100vw - 40px));
  background: var(--text);
  color: var(--on-fill);
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-md);
  box-shadow: 0 8px 24px rgba(0,0,0,.22);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 14px;
}
.toast[hidden] { display: none; }
/* With a button (Undo, Open): the message takes the left, the button sits at the right edge. */
.toast:has(.toast-undo-btn) { justify-content: space-between; min-width: min(320px, calc(100vw - 40px)); }

.toast-undo-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,.35);
  color: var(--on-fill);
  border-radius: var(--radius-xs);
  padding: 4px 10px;
  font-size: var(--fs-md);
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}
.toast-undo-btn:hover { background: rgba(255,255,255,.15); }
.toast-actions { display: flex; gap: 8px; flex-shrink: 0; }

.coming-soon {
  padding: 64px 24px;
  text-align: center;
  color: var(--text-faint);
  font-size: var(--fs-base);
}

/* ---------- release notes ---------- */

/* A plain text link pinned to the bottom of the sidebar nav, not a tab. */
.sidebar-changelog-link { margin-top: auto; padding: 8px 12px; font-size: var(--fs-sm); color: var(--text-faint); }
.sidebar-changelog-link:hover { color: var(--text-soft); text-decoration: underline; }
.sidebar.collapsed .sidebar-changelog-link { display: none; }
.changelog { max-width: 760px; font-size: var(--fs-md); line-height: 1.6; color: var(--text-soft); }
.changelog h2 { margin: 24px 0 6px; font-size: var(--fs-lg); color: var(--text); }
.changelog h2:first-child { margin-top: 0; }
.changelog p { margin: 10px 0 4px; }
.changelog strong { color: var(--text); }
.changelog ul { margin: 4px 0; padding-left: 20px; }
.changelog li { margin: 3px 0; }
.changelog code { font-family: 'Geist Mono', monospace; font-size: var(--fs-sm); background: var(--surface-2); padding: 1px 5px; border-radius: var(--radius-xs); }
.changelog hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

/* ---------- AWB timeline report ---------- */
.awb-timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--border); }
.timeline-step { position: relative; display: grid; grid-template-columns: 210px 1fr; gap: 2px 12px; padding: 6px 0 10px 14px; }
.timeline-step::before { content: ""; position: absolute; left: -25px; top: 10px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border); }
.timeline-step.done::before { background: var(--text); border-color: var(--text); }
.timeline-label { font-size: var(--fs-md); font-weight: 600; color: var(--text); }
.timeline-step:not(.done) .timeline-label, .timeline-step:not(.done) .timeline-when { color: var(--text-faint); }
.timeline-when { font-size: var(--fs-sm); }
.timeline-detail { grid-column: 2; }
.timeline-link { background: none; border: none; padding: 0; font: inherit; font-size: var(--fs-sm); color: var(--text); cursor: pointer; text-decoration: underline; }
@media print {
  .app, #toast, #dropdown-root, #eli-root, .no-print { display: none !important; }
  .awb-timeline-overlay { position: static; background: none; }
  .awb-timeline-dialog { box-shadow: none; max-width: none !important; max-height: none; }
}
.awb-timeline-report { background: var(--surface); padding: 4px; }
.timeline-report-sub { margin: 2px 0 16px; }
.timeline-awb-title { font-size: var(--fs-base); margin: 18px 0 8px; color: var(--text); }
.timeline-latest { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.timeline-latest th, .timeline-latest td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--border); }
.awb-timeline-dialog .modal-footer { align-items: center; }

/* ---------- status + mode colors (tokens in :root) ---------- */
.pill-slate, .status-select-slate { background-color: var(--slate-bg); color: var(--slate-ink); }
.pill-sky, .status-select-sky { background-color: var(--sky-bg); color: var(--sky-ink); }
.pill-indigo, .status-select-indigo { background-color: var(--indigo-bg); color: var(--indigo-ink); }
.pill-amber, .status-select-amber { background-color: var(--amber-bg); color: var(--amber-ink); }
.pill-teal, .status-select-teal { background-color: var(--teal-bg); color: var(--teal-ink); }
.pill-green, .status-select-green { background-color: var(--green-bg); color: var(--green-ink); }
.pill-rose, .status-select-rose { background-color: var(--rose-bg); color: var(--rose-ink); }
.pill-violet, .status-select-violet { background-color: var(--violet-bg); color: var(--violet-ink); }
.pill-cyan, .status-select-cyan { background-color: var(--cyan-bg); color: var(--cyan-ink); }
.pill-blue, .status-select-blue { background-color: var(--blue-bg); color: var(--blue-ink); }
.pill-orange, .status-select-orange { background-color: var(--orange-bg); color: var(--orange-ink); }
.pill-stone, .status-select-stone { background-color: var(--stone-bg); color: var(--stone-ink); }
.pill-unset, .status-select-unset { background-color: transparent; color: var(--text-faint); box-shadow: inset 0 0 0 1px var(--border); }
.pill-teal .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal-dot); }
/* Modes are tags, not pills. */
.shipment-type-chip { border-radius: var(--radius-xs); }

/* ---------- tracking links in remark cells + timeline report ---------- */
/* A quiet text link: ink colour + a small arrow, underline only on hover. */
.remark-link { display: inline-flex; align-items: center; gap: 3px; color: var(--sky-ink); font-weight: 600; text-decoration: none; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.remark-link:hover { text-decoration: underline; text-underline-offset: 2px; }
.remark-link-icon { flex-shrink: 0; opacity: .7; }
/* Full URLs only on paper / PNG / PDF, where a link cannot be clicked. */
.remark-link-url { display: none; }
.exporting .remark-link-url { display: block; font-size: var(--fs-xs); color: var(--text-faint); word-break: break-all; }
.timeline-tracking { display: flex; align-items: baseline; gap: 12px; margin: 0 0 14px; }
.timeline-tracking .timeline-label { width: 210px; flex-shrink: 0; }
.timeline-tracking-item { display: inline-block; margin-right: 14px; }
@media print { .remark-link-url { display: block; font-size: var(--fs-xs); color: var(--text-faint); word-break: break-all; } }

/* Remark editor: same width as the cell, grows downward with the text,
   so the whole note is visible without spilling past the column. */
.inline-edit-pop { position: relative; }
.inline-edit-textarea { width: 1px; min-width: 100%; min-height: 32px; max-height: 320px; resize: none; line-height: 1.45; font-family: inherit; overflow-y: auto; }
td.remark-original, td.remark-english { white-space: pre-line; min-width: 220px; }

/* ---------- Warehouse shipments (an AWB's remark split by destination) ---------- */
.wh-unassigned { color: var(--amber-ink); font-weight: 600; }
/* Citation in the master remark: the excerpt a shipment was made from. */
.remark-cite { background: var(--indigo-bg); border-radius: var(--radius-xs); padding: 0 2px; transition: background .15s; }
.remark-cite:hover { background: var(--indigo-bg); box-shadow: 0 0 0 1px var(--indigo-border); }
.remark-cite-n { font-size: inherit; font-weight: 700; cursor: pointer; margin-right: 3px; vertical-align: baseline; }
.remark-cite-n:hover { text-decoration: underline; }
/* Receiving: an AWB's parts grouped under their master row. */

/* ---------- grouped rows: master AWB + its shipments / parts ---------- */
/* Dropdown on the master row that opens its sub-list: bordered like a select,
   count badge, chevron that flips when open. */
.group-tag { display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; padding: 2px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--indigo-ink); font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; /* the app font, even in a mono AWB cell */ font-weight: 600; font-size: var(--fs-xs); font-variant-numeric: tabular-nums; /* 1 and 2 take the same width */ line-height: 1.3; cursor: pointer; white-space: nowrap; box-shadow: 0 1px 1px rgba(0,0,0,.04); }
.group-tag:hover { border-color: var(--indigo-ink); color: var(--indigo-ink); }
.group-tag-count { font-weight: 700; } /* plain indigo text like the rest of the tag: a shaded square changes width with the digit */
.group-tag-noun { margin-left: 2px; } /* with the 4px gap: a clear space after the count */
.group-tag-chevron { position: relative; top: 1px; color: inherit; transition: transform .15s; } /* sits on the lowercase text's middle, not the line box's */
.group-tag:hover .group-tag-chevron { color: var(--indigo-ink); }
.group-tag.open { background: var(--group-bg); border-color: var(--group-ink); color: var(--group-ink); box-shadow: none; } /* open = the group's own tint and ink (ink on tint is 4.5:1 or more), the chevron turned up */
.group-tag.open .group-tag-chevron { color: var(--group-ink); transform: rotate(180deg); }
/* An open group reads as one block: a tinted header row under a 2px line,
   lighter-tinted shipment rows, a 4px rail down the left, and a line under the last row.
   The hue is indigo, or the group's status hue when all its rows share one (groupTintStyle). */
tr { --group-bg: var(--indigo-bg); --group-ink: var(--indigo-ink); }
tr.group-master-open > td, tr.group-master-open > td.awb-cell { background: color-mix(in srgb, var(--group-bg) 75%, var(--surface)); border-top: 2px solid var(--group-ink); }
/* The 2px top border takes half a pixel more than a 1px one: half a pixel less padding keeps the row 50px. */
#content table tbody tr.group-master-open[data-row-id] > td { padding-top: 1.5px; }
#content table tbody tr.group-child-row.is-last[data-row-id] > td { padding-bottom: 1.5px; }
tr.group-child-row > td, tr.group-child-row > td.awb-cell { background: color-mix(in srgb, var(--group-bg) 30%, var(--surface)); }
tr.group-child-row.is-last > td, tr.group-child-row.is-last > td.awb-cell { border-bottom: 2px solid var(--group-ink); }
/* The rail is positioned against the row (not the clipping cell) and runs 1px past it,
   so it paints over the grey line between rows instead of being crossed by it. */
tr:is(.group-master-open, .group-child-row) { position: relative; --rail: var(--group-ink); }
tr:is(.group-master-open, .group-child-row) > td:first-child::before { content: ""; position: absolute; left: 0; top: 0; bottom: -1px; width: 4px; background: var(--rail); pointer-events: none; z-index: 2; }
tr.row-selected:is(.group-master-open, .group-child-row) { --rail: var(--accent); } /* selection still shows inside a group, with an accent rail */
tr.row-selected:is(.group-master-open, .group-child-row) > td { background: var(--accent-soft); }
/* The other parts of a selected AWB: selected with it, but not the row the
   user clicked, so no fill, only the accent rail. Highlight Related Rows
   outlines every part alike instead (receiving-row-highlighted). */
tr.row-selected-sibling.row-selected:not(.receiving-row-highlighted) > td { background: var(--surface); box-shadow: none; }
tr.row-selected-sibling.row-selected:not(.receiving-row-highlighted):hover > td { background: var(--bg); }
tr.row-selected-sibling.row-selected:not(.receiving-row-highlighted) > td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
tr.row-lifted:is(.group-master-open, .group-child-row) > td { background: var(--accent-soft); } /* a whole group lifts together */
.group-branch { display: inline-flex; vertical-align: -1px; color: var(--group-ink); margin-right: 6px; }

/* ---------- Version history drawer (every change on the screen) ---------- */
.history-toggle-btn, .topbar-hub-btn { display: inline-flex; align-items: center; gap: 6px; } /* History and Notifications: the same icon + word button */
.topbar-history-btn[hidden] { display: none; }
.history-toggle-btn.active, .topbar-hub-btn.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
body:is(.history-open, .hub-open) .main { margin-right: 380px; transition: margin-right .15s; }
body.hub-open .main { margin-right: 440px; }
.history-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 120; width: 380px; display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--border); box-shadow: -8px 0 24px rgba(15,23,42,.08); }
.history-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 18px 14px; border-bottom: 1px solid var(--border); }
.history-title { font-size: var(--fs-lg); font-weight: 700; color: var(--text); }
.history-body { flex: 1; overflow-y: auto; padding: 4px 0 24px; }
.history-empty { padding: 24px 18px; font-size: var(--fs-md); color: var(--text-faint); }
.history-day { position: sticky; top: 0; z-index: 1; padding: 10px 18px 6px; background: var(--surface); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-faint); }
.history-entry { padding: 10px 18px 12px; border-bottom: 1px solid var(--border); }
.history-entry:hover { background: var(--surface-2); }
.history-entry:has(.history-row-link) { cursor: pointer; } /* the whole entry opens its row */
.history-entry-top { display: flex; align-items: center; gap: 8px; font-size: var(--fs-md); }
.history-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.history-who { font-weight: 600; color: var(--text); }
.history-time { margin-left: auto; font-size: var(--fs-sm); color: var(--text-faint); }
.history-row-link { margin: 4px 0 2px 17px; padding: 0; border: none; background: none; font-family: "Geist Mono", monospace; font-weight: 600; font-size: var(--fs-sm); line-height: 1.3; color: var(--indigo-ink); cursor: pointer; text-align: left; }
.history-row-link:hover { text-decoration: underline; }
.history-row-gone { margin: 4px 0 2px 17px; font-size: var(--fs-sm); color: var(--text-faint); text-decoration: line-through; }
.history-changes { margin: 4px 0 0; padding-left: 32px; font-size: var(--fs-md); color: var(--text-soft); }
.history-changes li { margin: 2px 0; }
.activity-from { color: var(--text-faint); text-decoration: line-through; }
.activity-val { font-weight: 600; color: var(--text); }

/* ---------- Warehouses (sites) ---------- */
.page-title-row { display: flex; align-items: center; gap: 12px; }
.site-select { text-transform: none; }
/* One width for every warehouse pill in a column, dropdown or locked
   (like the Status pills): long names end in "…". */
.site-select { width: 132px; box-sizing: border-box; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; justify-content: flex-start; }

/* Warehouse switcher next to the page title: a button + menu. */
.site-menu-wrap { position: relative; }
.site-switcher { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px 6px 12px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); color: var(--text); font-family: inherit; font-weight: 600; font-size: var(--fs-md); line-height: 1.2; cursor: pointer; box-shadow: var(--shadow-card); transition: border-color .15s, background .15s; }
.site-switcher svg:first-child { color: var(--accent-ink); }
.site-switcher:hover { border-color: var(--accent); }
.site-switcher.open { border-color: var(--accent); background: var(--accent-soft); }
.site-switcher-chevron { color: var(--text-faint); transition: transform .15s; }
.site-switcher.open .site-switcher-chevron { transform: rotate(180deg); color: var(--accent-ink); }
.site-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 280px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(15,23,42,.14); }
.site-menu-label { padding: 6px 8px 4px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-faint); }
.site-menu-item, .site-menu-action { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px; border: none; border-radius: var(--radius-sm); background: none; font-family: inherit; font-weight: 500; font-size: var(--fs-md); line-height: 1.3; color: var(--text); text-align: left; cursor: pointer; }
.site-menu-item:hover, .site-menu-action:hover { background: var(--surface-2); }
.site-menu-item.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.site-menu-check { width: 14px; color: var(--accent-ink); }
.site-menu-name { flex: 1; }
.site-menu-count { min-width: 22px; padding: 1px 6px; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--text-faint); font-size: var(--fs-xs); text-align: center; }
.site-primary-badge { padding: 1px 6px; border-radius: var(--radius-xs); background: var(--green-bg); color: var(--green-ink); font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.site-menu-sep { height: 1px; margin: 6px 4px; background: var(--border); }
.site-menu-action { color: var(--text-soft); }
.site-menu-hint { padding: 6px 8px 4px; font-size: var(--fs-xs); color: var(--text-faint); }

/* Right-click submenu: one item, its choices in a second column on hover. */
.row-context-sub { position: relative; }
.row-context-sub-trigger { display: flex !important; align-items: center; justify-content: space-between; }
.row-context-sub-caret { color: var(--text-faint); font-size: var(--fs-base); line-height: 1; }
.row-context-sub:hover > .row-context-sub-trigger { background: var(--surface-2); }
/* Hides after a short grace period, so a diagonal move toward it doesn't close it. */
.row-context-submenu { visibility: hidden; opacity: 0; transition: visibility 0s linear .3s, opacity .1s linear .2s; position: absolute; top: -5px; left: calc(100% + 2px); min-width: 190px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: 0 12px 28px rgba(0,0,0,.14); }
/* invisible bridge so the pointer can cross the gap without closing it */
.row-context-submenu::before { content: ""; position: absolute; top: 0; bottom: 0; left: -6px; width: 6px; }
.row-context-sub.flip .row-context-submenu { left: auto; right: calc(100% + 2px); }
.row-context-sub.flip .row-context-submenu::before { left: auto; right: -6px; }
.row-context-sub:hover > .row-context-submenu, .row-context-sub:focus-within > .row-context-submenu { visibility: visible; opacity: 1; transition-delay: 0s; }
.row-context-submenu .row-context-item { display: flex; align-items: center; gap: 6px; }
.row-context-check { width: 12px; color: var(--accent-ink); font-weight: 700; }
.row-context-item.current { color: var(--accent-ink); font-weight: 600; }

/* ---------- Delete confirmation ---------- */
.btn-danger { background: var(--rose-ink); border-color: var(--rose-ink); color: var(--on-fill); }
.btn-danger:hover { filter: brightness(.88); }
.btn-danger:focus-visible { outline: 2px solid var(--rose-bg); outline-offset: 2px; }
.confirm-dialog .modal-body { text-align: center; padding-top: 26px; }
.confirm-icon { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 50%; background: var(--rose-bg); color: var(--rose-ink); box-shadow: 0 0 0 6px color-mix(in srgb, var(--rose-bg) 45%, transparent); }
.confirm-message { margin: 8px 0 0; font-size: var(--fs-md); color: var(--text-soft); }
.confirm-dialog .modal-footer { justify-content: center; }
.history-deleted { color: var(--rose-ink); font-weight: 600; }

/* ---------- Resource center ---------- */
.back-link { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 10px; padding: 4px 8px 4px 4px; border: none; border-radius: var(--radius-sm); background: none; color: var(--text-soft); font-family: inherit; font-size: var(--fs-md); font-weight: 600; cursor: pointer; }
.back-link:hover { background: var(--surface-2); color: var(--text); }
.resource-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; max-width: 900px; }
.resource-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-card); text-align: left; font-family: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.resource-card:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(0,0,0,.1); transform: translateY(-1px); }
.resource-card-icon { display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-ink); }
.resource-card-title { font-size: var(--fs-lg); font-weight: 700; color: var(--text); }
.resource-card-desc { font-size: var(--fs-md); line-height: 1.45; color: var(--text-soft); }
.resource-card-count { margin-top: 4px; font-size: var(--fs-sm); font-weight: 600; color: var(--accent-ink); display: inline-flex; align-items: center; gap: 4px; }

/* Fleet book table */
.fleet-table td { vertical-align: middle; }
tr.fleet-inactive > td { color: var(--text-faint); }
.fleet-active { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-md); white-space: nowrap; cursor: pointer; }
.fleet-actions { text-align: right; width: 40px; white-space: nowrap; }
/* An LTL carrier's learned quote logos (quote.js): a swatch of the logo's colour. */
.fleet-logo { display: inline-flex; align-items: center; gap: 2px; margin-right: 6px; vertical-align: middle; }
.fleet-logo-swatch { width: 12px; height: 12px; border-radius: var(--radius-xs); border: 1px solid var(--border); }
.icon-btn { border: none; background: none; color: var(--text-faint); font-size: var(--fs-md); cursor: pointer; padding: 4px 6px; border-radius: var(--radius-xs); }
.icon-btn:hover { background: var(--rose-bg); color: var(--rose-ink); }

/* Fleet quick-pick in driver pop-ups */
/* Driver label row: the label, and "Import from fleet" on the right. */
.da-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.fleet-pick-toggle { all: unset; display: inline-flex; align-items: center; gap: 3px; padding: 4px 0; margin: -4px 0; font-size: var(--fs-sm); font-weight: 500; color: var(--accent-ink); cursor: pointer; }
.fleet-pick-toggle:hover { color: var(--text); }
.fleet-pick-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-xs); }
.fleet-pick-toggle svg { transition: transform .15s ease; }
.fleet-pick-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .fleet-pick-toggle svg { transition: none; } }
/* Open (the default): the four most-used drivers, 2x2, under the Driver field. */
.fleet-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.fleet-pick[hidden] { display: none; }
.fleet-pick-chip { display: flex; align-items: center; gap: 5px; min-width: 0; min-height: 28px; box-sizing: border-box; padding: 2px 8px 2px 3px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); color: var(--text); font-family: inherit; font-size: var(--fs-sm); font-weight: 500; white-space: nowrap; text-align: left; cursor: pointer; }
.fleet-pick-driver { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.fleet-pick-chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.fleet-pick-chip:hover { border-color: var(--accent); }
.fleet-pick-vehicle { flex: none; padding: 1px 5px; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--text-soft); font-size: var(--fs-xs); font-weight: 600; }

/* ---------- Notes (message board per AWB) ---------- */
td.notes-cell { width: 52px; text-align: center; }
.notes-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 28px; border: 1px solid transparent; border-radius: var(--radius-sm); background: none; color: var(--text-faint); cursor: pointer; }
.notes-btn:hover { border-color: var(--border); background: var(--surface); color: var(--accent-ink); }
.notes-btn.has-notes { color: var(--accent-ink); }
.notes-badge { position: absolute; top: -5px; right: -6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: var(--radius-pill); background: var(--accent-ink); color: var(--on-fill); font-size: var(--fs-xs); font-weight: 700; line-height: 16px; text-align: center; box-shadow: 0 0 0 2px var(--surface); }
.notes-dialog { display: flex; flex-direction: column; max-height: min(720px, 90vh); }
.notes-tabs { display: flex; gap: 4px; padding: 0 22px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.notes-tab { padding: 8px 10px; border: none; border-bottom: 2px solid transparent; background: none; font-family: inherit; font-size: var(--fs-md); font-weight: 600; color: var(--text-soft); cursor: pointer; white-space: nowrap; }
.notes-tab.active { border-bottom-color: var(--accent); color: var(--accent-ink); }
.notes-tab-count { margin-left: 4px; padding: 0 5px; border-radius: var(--radius-pill); background: var(--surface-2); font-size: var(--fs-xs); }
.notes-scope { display: flex; align-items: flex-start; gap: 10px; margin: 10px 22px 0; padding: 8px 10px 8px 12px; border-radius: var(--radius); background: var(--surface-2); color: var(--text-soft); font-size: var(--fs-sm); line-height: 1.45; }
.notes-scope > span { flex: 1; }
.notes-scope-close { flex-shrink: 0; border: none; background: none; padding: 0 2px; color: var(--text-faint); font-size: var(--fs-sm); cursor: pointer; }
.notes-scope-close:hover { color: var(--text); }
.notes-body { flex: 1; overflow-y: auto; padding-top: 6px; }
.notes-empty { padding: 20px 0; font-size: var(--fs-md); color: var(--text-faint); text-align: center; }
.notes-day { margin: 12px 0 4px; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-faint); }
.note-item { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; background: var(--surface); }
.note-meta { display: flex; align-items: center; gap: 6px; font-size: var(--fs-md); }
.note-actions { margin-left: auto; display: flex; gap: 10px; opacity: 0; transition: opacity .15s; }
.note-item:hover .note-actions, .note-item:focus-within .note-actions { opacity: 1; }
.note-link { border: none; background: none; padding: 0; font-family: inherit; font-size: var(--fs-sm); color: var(--text-faint); cursor: pointer; }
.note-link:hover { color: var(--accent-ink); text-decoration: underline; }
.note-delete-btn:hover { color: var(--rose-ink); }
.note-text { margin-top: 4px; font-size: var(--fs-md); line-height: 1.5; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.note-edit-input, #notes-compose { width: 100%; box-sizing: border-box; margin-top: 6px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: inherit; font-size: var(--fs-md); line-height: 1.45; resize: vertical; }
.note-edit-input:focus, #notes-compose:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.note-edit-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 6px; }
.notes-compose { display: flex; align-items: flex-end; gap: 8px; padding: 12px 22px 16px; border-top: 1px solid var(--border); }
.notes-compose #notes-compose { margin-top: 0; }
/* Notes in the timeline report */
.timeline-notes { display: grid; grid-template-columns: 210px 1fr; gap: 2px 12px; margin: 6px 0 14px; }
.timeline-notes > .timeline-label { grid-row: 1 / span 99; }
.timeline-notes-day { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); margin-top: 6px; }
.timeline-note { font-size: var(--fs-md); color: var(--text); white-space: pre-wrap; }
.timeline-note-meta { display: block; font-size: var(--fs-xs); color: var(--text-faint); }
.timeline-latest-note { max-width: 240px; font-size: var(--fs-sm); }

/* ---------- Master rows: summary of their shipments / parts ---------- */
.agg-mixed { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border: 1px dashed var(--text-faint); border-radius: var(--radius-pill); background: var(--surface); color: var(--text-soft); font-family: inherit; font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; cursor: pointer; }
.agg-mixed:hover { border-color: var(--accent); border-style: solid; color: var(--accent-ink); }
.agg-status { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.status-action-cell .agg-status { display: inline-flex; vertical-align: middle; } /* inline, so the BOL beside it stays on the line while it fits (a block always took its own line) */
/* A master row's status summary ("2 COMPLETED") is the same pill as the
   rows' own Status dropdowns: same font, padding and (in Warehouse) width;
   only the caret is missing. Two stacked (mixed statuses) sit a little
   tighter so they still fit the 50px row. */
.agg-status-pill { font-size: var(--fs-sm); line-height: 14px; padding: 3px 22px 3px 10px; box-sizing: border-box; }
tr[data-row-section="warehouse"] .agg-status-pill { width: 117px; }
.agg-status:has(.agg-status-pill + .agg-status-pill) { gap: 2px; }
.agg-status:has(.agg-status-pill + .agg-status-pill) .agg-status-pill { padding-top: 1px; padding-bottom: 1px; }
.agg-status-pill b { font-weight: inherit; }

/* ---------- UX audit: focus, menus, small screens ---------- */

/* One visible keyboard focus ring for everything that can take focus. */
:is(button, a, select, summary, [tabindex]):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.search-box:focus-within { border-color: var(--accent); }
.modal-dialog:focus { outline: none; }
.editable-cell:focus-visible { background: var(--accent-soft); border-radius: var(--radius-xs); }

.btn-quiet { background: transparent; border-color: transparent; color: var(--text-soft); }
.btn-quiet:hover { background: var(--surface-2); color: var(--text); }

.row-more-btn { position: fixed; z-index: 40; width: 26px; height: 24px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-soft); font-size: var(--fs-lg); line-height: 1; cursor: pointer; box-shadow: var(--shadow-card); }
.row-more-btn:hover { color: var(--text); border-color: var(--text-faint); }
.row-more-btn[hidden] { display: none; }

.row-context-divider { height: 1px; margin: 4px 0; background: var(--border); }
.row-context-divider:first-child, .row-context-divider + .row-context-divider, .row-context-divider:last-child { display: none; }

.topbar-center { display: flex; align-items: center; gap: 12px; }
.offline-pill { padding: 3px 10px; border-radius: var(--radius-pill); background: var(--amber-bg); color: var(--amber-ink); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }
.offline-pill[hidden] { display: none; }
.profile-menu-note { padding: 6px 12px 8px; font-size: var(--fs-sm); color: var(--text-faint); }

.tips-list { margin: 0; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 10px 16px; font-size: var(--fs-md); }
.tips-list dt { font-weight: 600; color: var(--text); }
.tips-list dd { margin: 0; color: var(--text-soft); }

@media (max-width: 900px) {
  .sidebar { width: 60px; }
  .sidebar .sidebar-brand { padding: 20px 0; justify-content: center; }
  .sidebar .brand-logo, .sidebar .nav-item span, .sidebar-changelog-link, .sidebar-collapse-rail { display: none; }
  .sidebar .brand-mark { display: block; }
  .sidebar .sidebar-nav { padding: 8px; }
  .sidebar .nav-item { justify-content: center; padding: 9px; }
  .sidebar .nav-caret { display: none; }
  .sidebar .nav-sub[hidden] { display: flex; }
  .sidebar .nav-group > .nav-item, .sidebar .nav-sub-item { padding: 9px; }
  .topbar { grid-template-columns: minmax(0, 1fr) auto auto; padding: 0 12px; gap: 10px; }
  .topbar-clock { display: none; }
  .content { padding: 16px 12px 32px; }
  .page-header { flex-direction: column; }
  .page-header-actions { flex-wrap: wrap; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  body:is(.history-open, .hub-open) .main { margin-right: 0; }
  .tips-list { grid-template-columns: 1fr; gap: 2px 0; }
  .tips-list dd { margin-bottom: 10px; }
}

/* Reduced motion: nothing slides, lifts, spins round or scrolls smoothly.
   Fades, colour changes, the jump-to-row glow and progress stay, because
   they confirm what happened without moving anything. */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sidebar, body.history-open .main, .chevron, .driver-picker-caret, .nav-caret svg,
  .group-tag-chevron, .site-switcher-chevron, .files-tree-caret,
  .kpi-tile-clickable, .resource-card, .sidebar-collapse-rail-arrow { transition-property: opacity, color, background-color, border-color, box-shadow; }
  .kpi-tile-clickable:hover, .resource-card:hover { transform: none; }
  .app-tooltip { animation-name: fade-in; }
  /* Spinners keep turning (they mean "still working"), just slower. */
  .spinner, .track-lookup-btn.is-running svg { animation-duration: 1.6s; }
}

/* ---------- compact tables: more AWBs per screen ---------- */
/* The four table screens give the subtitle's line back to the table. */
#content:is([data-screen="receiving"], [data-screen="warehouse"], [data-screen="outgoing"], [data-screen="clients"]) .page-subtitle { display: none; }
@media (min-width: 901px) {
  #content:is([data-screen="receiving"], [data-screen="warehouse"], [data-screen="outgoing"], [data-screen="clients"]) .page-header { align-items: center; }
}

/* ---------- sign-in screen (hosted version) ---------- */
.auth-screen { position: fixed; inset: 0; z-index: 500; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--bg); overflow: auto; }
.auth-card { width: 100%; max-width: 380px; padding: 28px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-card); }
.auth-brand { margin-bottom: 20px; }
.auth-title { margin: 0 0 18px; font-size: var(--fs-lg); font-weight: 600; color: var(--text); }
.auth-wide { width: 100%; margin-top: 4px; }
.auth-message { min-height: 18px; margin: 0 0 10px; font-size: var(--fs-sm); color: var(--text-soft); }
.auth-links { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 16px; }
.auth-link { padding: 0; border: none; background: none; color: var(--accent-ink); font-family: inherit; font-size: var(--fs-md); cursor: pointer; }
.auth-link:hover { text-decoration: underline; }
.auth-note { margin: 16px 0 0; font-size: var(--fs-sm); color: var(--text-faint); }

/* ---------- Team: invite bar and role controls ---------- */
.team-invite { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; }
.team-invite label { font-weight: 600; color: var(--text); }
.team-invite input { height: 32px; padding: 0 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-family: inherit; font-size: var(--fs-md); }
.team-invite input { width: 240px; max-width: 100%; }
.team-invite .settings-hint { flex-basis: 100%; margin: 0; }

/* ---------- paste a list / BOL ---------- */
.paste-list { max-height: 260px; overflow: auto; }
.paste-list tr.paste-off td { color: var(--text-faint); }
.paste-warn { color: var(--amber-ink); font-size: var(--fs-sm); font-weight: 600; }
.bol-total-row td { font-weight: 700; background: var(--bg); }

/* ---------- cells: wrap everywhere, AWB on one line, remarks at most two lines ---------- */
td.awb-cell, td.awb-part-cell { white-space: nowrap; }
/* 1F requested (nomination.js): a corner flag over the AWB cell's padding,
   no extra width. Teal = waiting, amber = 24 h+ with no 1F, dot = sent twice+.
   The span is a 14px hover target; the visible triangle is 9px. */
td.awb-cell { position: relative; }
.nom-flag { position: absolute; top: 0; right: 0; width: 14px; height: 14px; cursor: help; z-index: 1; }
.nom-flag::before { content: ""; position: absolute; top: 0; right: 0; border-style: solid; border-width: 0 9px 9px 0; border-color: transparent var(--accent-teal) transparent transparent; }
.nom-flag-overdue::before { border-right-color: var(--amber-ink); }
.nom-flag-again::after { content: ""; position: absolute; top: 1.5px; right: 1.5px; width: 3px; height: 3px; border-radius: 50%; background: var(--surface); }
td.remark-original .editable-cell, td.remark-english .editable-cell,
td.remark-original > span, td.remark-english > span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
/* Remark expand chevron: top-right corner, on hover, only when the remark is
   cut off (or already open). Open, the whole remark shows in its own row,
   which grows to fit; only that row opens, never the AWB's other parts. */
td.remark-original, td.remark-english { position: relative; }
.remark-toggle { position: absolute; top: 3px; right: var(--remark-toggle-right, 3px); z-index: 31; display: none; align-items: center; justify-content: center; width: 18px; height: 18px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-xs); background: var(--surface); color: var(--text-faint); cursor: pointer; }
.remark-toggle::after { content: ""; position: absolute; inset: -3px; } /* 24px to hit */
.remark-toggle:hover { color: var(--text); border-color: var(--text-faint); }
.remark-toggle svg { transition: transform .15s ease; }
td.remark-open .remark-toggle svg { transform: rotate(180deg); }
td.remark-clamped:hover .remark-toggle, td.remark-open:hover .remark-toggle { display: inline-flex; }
td:has(textarea) .remark-toggle { display: none; } /* not while editing */
td.remark-open > .cell-box, td.remark-open .editable-cell, td.remark-open .cell-box > span { max-height: none; display: block; -webkit-line-clamp: unset; line-clamp: none; overflow: visible; }
@media (prefers-reduced-motion: reduce) { .remark-toggle svg { transition: none; } }
.floating-date-input { position: fixed; z-index: 400; width: 1px; height: 1px; opacity: 0; border: 0; padding: 0; }

/* ---------- narrow and touch screens (desktop layout unchanged) ---------- */
/* Toolbars and the bulk bar wrap instead of running off the screen. */
.bulk-action-bar, .settings-photo-buttons { flex-wrap: wrap; }

/* The AWB, the row's main identifier, stays in view once the table scrolls sideways past it. */
td.awb-cell, th:is([data-col-key="awb"], [data-col-key="primaryAwb"]) { position: sticky; left: 0; }
td.awb-cell { z-index: 1; background: var(--surface); }
td.awb-cell:has(.inline-edit-wrap) { z-index: 31; } /* its Save / Cancel pop out below, over the next row's pinned AWB */
th:is([data-col-key="awb"], [data-col-key="primaryAwb"]) { z-index: 3; }
/* Divider on the pinned column's right edge, only once it's stuck (.awb-stuck, set in app.js). A pseudo-element, since collapsed borders don't stick and row highlights replace box-shadows. */
.awb-stuck :is(td.awb-cell, th:is([data-col-key="awb"], [data-col-key="primaryAwb"]))::after { content: ""; position: absolute; top: 0; bottom: 0; right: -1px; width: 2px; background: var(--text-faint); opacity: .35; pointer-events: none; }
tbody tr:hover > td.awb-cell { background: var(--bg); }

@media (max-width: 900px) {
  .page-header-actions { overflow-x: auto; max-width: 100%; }
}

@media (max-width: 600px) {
  /* Phones: one line of header buttons and one scrollable line of table
     controls, so the table starts near the top of the screen. */
  .content { padding: 10px 10px 16px; }
  .page-title { font-size: var(--fs-lg); }
  .page-header { gap: 8px; margin-bottom: 8px; }
  .page-header-actions { flex-wrap: nowrap; gap: 6px; padding-bottom: 2px; }
  .page-header-actions .btn { padding: 7px 10px; }
  .toolbar { flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding-bottom: 2px; margin-bottom: 8px; }
  .toolbar .search-box { flex: 0 0 180px; min-width: 0; }
  .toolbar-group { flex-wrap: nowrap; }
  .toolbar > *, .toolbar-group > * { flex-shrink: 0; }
  /* Groups keep their natural width so the row scrolls instead of the
     groups being squeezed and drawn over each other. */
  .toolbar-group, .toolbar-group.toolbar-view { flex: 0 0 auto; max-width: none; }
  .page-date-controls { flex-wrap: nowrap; }
  /* Top bar: History and Notifications keep their icons; the search box gives up the room. */
  .topbar-history-label { display: none; }
  .presence-wrap { gap: 6px; }
  /* Calendar: seven columns fit a phone. */
  .dash-cal-weekday { padding: 6px 0; }
  .dash-cal-cell { min-height: 64px; padding: 4px; }
  .bulk-action-bar { gap: 6px 8px; }
  /* Two-column forms (BOL, New Shipment, settings) stack. */
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .modal-overlay { padding: 12px; }
  .modal-dialog { max-height: calc(100vh - 24px); }
}

@media (pointer: coarse) {
  /* Fingers need bigger targets than a mouse; desktop density is untouched. */
  #content .btn, #content select, #modal-root .btn, .row-context-item { min-height: 36px; }
  #content input[type="checkbox"], #modal-root input[type="checkbox"] { width: 20px; height: 20px; }
  .status-select { min-height: 30px; }
  .row-more-btn { width: 36px; height: 32px; }
}

/* Row menu taller than the window scrolls; fly-outs low on screen open upward. */
.row-context-menu.is-scrolling { max-height: calc(100vh - 16px); overflow-y: auto; }
.row-context-sub.up .row-context-submenu { top: auto; bottom: -5px; }

/* ---------- Pickup location book ---------- */
.pickup-book-location { white-space: normal; min-width: 280px; line-height: 1.45; }
.flight-cell { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
/* While editing, the box takes the cell's width (it shrank to nothing in an inline-flex). */
.flight-cell > .inline-edit-wrap { flex: 1; min-width: 0; }
/* TO's second line: the pickup address from the book ("836 (AGI)"). */
.to-address, .cell-sub { display: block; font-size: var(--fs-xs); line-height: 1.3; color: var(--text-faint); white-space: nowrap; }
.modal-dialog.book-import-dialog { max-width: 900px; }
.pickup-info-btn { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; padding: 0; border: none; border-radius: var(--radius-pill); background: transparent; color: var(--accent-ink); cursor: pointer; flex-shrink: 0; }
.pickup-info-btn:hover, .pickup-info-btn:focus-visible { background: var(--accent-soft); }
.pickup-card { position: fixed; z-index: 450; width: 320px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(15, 23, 42, .16); font-size: var(--fs-md); color: var(--text); pointer-events: none; }
.pickup-card.is-pinned { pointer-events: auto; border-color: var(--accent); }
.pickup-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-faint); }
.pickup-card-close { border: none; background: none; color: var(--text-faint); cursor: pointer; font-size: var(--fs-md); padding: 0 2px; }
.pickup-card-close:hover { color: var(--text); }
.pickup-card-body { display: flex; flex-direction: column; gap: 3px; line-height: 1.45; word-break: break-word; }
.pickup-card-body a { color: var(--accent-ink); }
.pickup-card-hint { margin-top: 8px; font-size: var(--fs-xs); color: var(--text-faint); }
.pickup-card-links { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.pickup-card-form { display: flex; flex-direction: column; gap: 4px; }
.pickup-card-label { font-size: var(--fs-xs); font-weight: 600; color: var(--text-faint); margin-top: 4px; }
.pickup-card-input { width: 100%; box-sizing: border-box; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; resize: vertical; text-transform: none; }
.pickup-card-input.mono { text-transform: uppercase; width: 90px; }
.pickup-card-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.pickup-card-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.book-import-preview { max-height: 340px; overflow: auto; margin-top: 10px; }
.book-import-preview td { vertical-align: top; }
/* Add to truck ›: its trucks can be many and long (truck # · driver · destination · date). */
.row-context-truck-list { max-height: 320px; overflow-y: auto; min-width: 280px; }
.row-context-truck-list .row-context-item { white-space: nowrap; }
/* Outgoing's Ship date / Destination: set in Warehouse, so view-only here. */
.view-only-cell { cursor: not-allowed; }

/* 1F nomination review window (nomination.js). */
.nom-tabs { display: inline-flex; flex-wrap: wrap; margin: 4px 0 12px; }
.nom-awbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.nom-duplicate { margin: 0 0 12px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--amber-bg, var(--amber-bg)); color: var(--amber-ink, var(--amber-ink)); font-size: var(--fs-sm); }
.nom-error { margin: 4px 0 0; color: var(--critical-ink); font-size: var(--fs-sm); }
.nom-error.nom-missing { margin: 0 0 12px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--critical-bg); }
.nom-held .btn { margin-left: 6px; vertical-align: middle; }

/* Handler tracking lookup (tracking.js): the refresh icon spins while it runs. */
.track-lookup-btn.is-running svg { animation: track-spin .9s linear infinite; }
.track-lookup-btn.is-running, .track-lookup-btn.is-running:hover { opacity: .6; cursor: progress; border-color: var(--border); color: var(--text-faint); }
@keyframes track-spin { to { transform: rotate(360deg); } }

/* Here or not on a split AWB: arrived/total pieces, opens the parts window. */
.arrival-parts-btn, .part-box-btn { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 6px 0 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); cursor: pointer; font-size: var(--fs-sm); }
.arrival-parts-btn:hover, .part-box-btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.arrival-parts-btn.is-all { border-color: var(--green-ink); color: var(--green-ink); }
.arrival-parts-caret { font-size: var(--fs-base); line-height: 1; }
.arrival-table { width: 100%; border-collapse: collapse; }
.arrival-table th, .arrival-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.arrival-table .arrival-pieces { width: 80px; }
/* A fee worked out from the data (Pickup from KG × rate, ISC from Receiving): read-only. */
.fee-auto input { background: var(--bg); color: var(--text-soft); cursor: default; }

/* New Shipment: Add AWB / Add Ocean Container tabs, under the title. */
.ship-tabs-bar { padding: 12px 22px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
/* Reviewing a client's portal submission: where it came from, in place of the tabs. */
.ship-review-bar { display: flex; align-items: flex-start; gap: 10px; background: var(--accent-soft); color: var(--text); font-size: var(--fs-md); }
.ship-review-bar .icon { flex: none; margin-top: 2px; color: var(--accent-ink); }
.ship-review-docs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.portal-doc-open { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; white-space: nowrap; }
.portal-doc-open > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.portal-doc-open .icon { flex: none; color: var(--accent-ink); }
.portal-submit-switches { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.ship-tabs { width: 100%; }
.ship-tab { flex: 1; justify-content: center; }

/* Add Ocean Container: the container # on top, a table of its shipments under it. */
.modal-dialog.modal-dialog-ship.modal-dialog-container { max-width: 920px; }
.cont-ships { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.cont-ships-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cont-ships-total { font-size: var(--fs-sm); color: var(--text-faint); font-variant-numeric: tabular-nums; }
.cont-ships-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.cont-ships-table { width: 100%; min-width: 820px; border-collapse: collapse; }
.cont-ships-table th { text-align: left; font-size: var(--fs-xs, 11px); font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: .03em; padding: 6px 6px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.cont-ships-table td { padding: 4px; border-bottom: 1px solid var(--border); }
.cont-ships-table tr:last-child td { border-bottom: 0; }
.cont-ships-table .sf-input { width: 100%; box-sizing: border-box; min-width: 0; height: 32px; padding: 5px 8px; border: 1px solid transparent; border-radius: var(--radius-xs); font-size: var(--fs-md); font-family: inherit; background: transparent; color: var(--text); }
.cont-ships-table .sf-input.mono { font-family: 'Geist Mono', monospace; }
.cont-ships-table .sf-input:hover { border-color: var(--border); }
.cont-ships-table .sf-input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); background: var(--surface); }
.ship-fields.cont-top { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 720px) { .ship-fields.cont-top { grid-template-columns: 1fr 1fr; } }
.cont-ships-table .cs-awb { width: 25%; } .cont-ships-table .cs-destination { width: 15%; } .cont-ships-table .cs-remarkOriginal { width: 27%; }
.cont-ships-table .cs-pieces, .cont-ships-table .cs-kg, .cont-ships-table .cs-cbm { width: 9%; }
.cont-ships-table textarea.sf-input { height: auto; min-height: 32px; resize: vertical; line-height: 1.35; display: block; }
.cont-ships-table td { vertical-align: top; }
.cont-ships-table .sf-input.from-document { background: var(--accent-soft); }
.cont-ship-remove { all: unset; cursor: pointer; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-xs); color: var(--text-faint); }
.cont-ship-remove:hover:not([disabled]) { background: var(--surface-2); color: var(--text); }
.cont-ship-remove[disabled] { opacity: .3; cursor: default; }


.cont-ships-manifest { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: var(--fs-sm); color: var(--text-soft); }
.cont-ships-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cont-ship-combine { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-soft); cursor: pointer; }

/* Container page: a container's # in the AWB column, its MAWB (and a lone Ocean row's container #) as small lines under it. */
.awb-sub { font-size: var(--fs-sm); color: var(--text-faint); line-height: 1.3; }
.awb-sub .editable-cell { color: inherit; }
.container-awb-number { font-weight: 600; }
/* A container's number with its MAWB under it, and its "x AWBs" button at the right, centred on the pair. */
.container-awb-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; white-space: nowrap; }
.container-awb-ids { min-width: 0; }
.container-awb-line > .group-tag { margin-top: 0; flex: none; }
/* Editing the container number: inside this flex line the editor's usual
   "collapse to 1px, then fill the column" sizing has nothing to fill and
   shrinks to a sliver (as in .eta-cell-wrap) — so the number grows to take
   the line, with a floor wide enough for a full container number. */
.container-awb-ids:has(.inline-edit-wrap) { flex: 1 1 auto; min-width: 150px; }
.container-awb-number .inline-edit-wrap { width: 100%; }

/* New Shipment → Add AWB: a compact drop zone, the AWBs as table rows, the checked row's document under it. */
.modal-dialog.modal-dialog-ship.modal-dialog-awbs { max-width: 1240px; }
.modal-footer-spacer { flex: 1; }
.upload-zone.upload-zone-compact { padding: 14px 16px; margin-bottom: 14px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.upload-zone.upload-zone-compact .upload-zone-title { font-size: var(--fs-md); }
.upload-zone.is-busy { border-color: var(--accent); background: var(--accent-soft); }
.spinner.spinner-sm { width: 18px; height: 18px; border-width: 2px; }
.awb-rows-table { min-width: 1180px; table-layout: fixed; } /* the widths below hold, whatever a cell holds */
.awb-rows-table th:last-child { width: 36px; }
.awb-rows-table .ar-n { width: 28px; text-align: right; padding-right: 6px; }
.awb-rows-table .ar-target { width: 30px; text-align: center; }
.awb-rows-table .sf-input.is-warn { border-color: var(--amber-ink); background: var(--amber-bg); }

/* Radio: one choice of a group (the Add AWB paste target). Unselected: a border ring; selected: an accent ring and dot. */
.radio { appearance: none; -webkit-appearance: none; flex: none; width: 16px; height: 16px; margin: 0; border: 1.5px solid var(--border); border-radius: 50%; background: var(--surface); cursor: pointer; display: inline-grid; place-content: center; vertical-align: middle; }
.radio::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); transform: scale(0); transition: transform .12s; }
.radio:checked { border-color: var(--accent); }
.radio:checked::before { transform: scale(1); }
.radio:hover:not(:disabled) { border-color: var(--accent); }
.radio:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.radio:disabled { cursor: not-allowed; background: var(--surface-2); }

/* Document chips: a file kept with a New Shipment row or container (intake.js). */
.doc-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.doc-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 2px 4px 2px 6px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface-2); color: var(--text-soft); font-size: var(--fs-xs); line-height: 1.4; cursor: grab; }
.doc-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.doc-chip.needs-check { border-color: var(--amber-ink); background: var(--amber-bg); color: var(--amber-ink); }
.doc-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.doc-chip-x { all: unset; display: inline-flex; padding: 2px; border-radius: 50%; cursor: pointer; color: var(--text-faint); }
.doc-chip-x:hover { color: var(--text); background: var(--border); }
.doc-chip-x:focus-visible { outline: 2px solid var(--accent); }
.doc-chips-more { all: unset; cursor: pointer; font-size: var(--fs-xs); color: var(--accent-ink); padding: 2px 4px; }
.doc-chips-more:focus-visible { outline: 2px solid var(--accent); border-radius: var(--radius-xs); }
.doc-check { font-size: var(--fs-xs); color: var(--amber-ink); margin-top: 2px; }
.cont-docs { margin: 4px 0 10px; }
.cont-docs .doc-chip { cursor: default; }
.awb-rows-table .ar-customer { width: 12%; } .awb-rows-table .ar-awb { width: 13%; } /* room for 131-80837245 */
/* Never narrower than a whole AWB (12 characters), however long the other columns are. */
.awb-rows-table .ar-awb .sf-input { min-width: calc(12ch + 26px); }
.awb-rows-table .ar-pieces, .awb-rows-table .ar-kg, .awb-rows-table .ar-cbm { width: 7%; }
.awb-rows-table .ar-destAirport, .awb-rows-table .ar-flightNumber { width: 7%; }
.awb-rows-table .ar-remarkOriginal, .awb-rows-table .ar-operationEnglish { width: 15%; }
.awb-rows-table .ar-doc { width: 10%; }
.awb-rows-table tr.is-scanning td { background: var(--accent-soft); }
.awb-rows-table tr.is-viewed td { background: var(--surface-2); }
.awb-rows-table .sf-input.from-document { background: var(--accent-soft); }
.awb-rows-table .sf-input.is-dupe { border-color: var(--critical-ink); background: var(--critical-bg); }
.awb-found-swatch { display: inline-block; width: 22px; height: 11px; border-radius: 3px; background: var(--accent-soft); vertical-align: middle; border: 1px solid var(--border); }
.awb-doc-btn { all: unset; cursor: pointer; display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-sm); color: var(--accent-ink); }
.awb-doc-btn:hover:not([disabled]), .awb-doc-btn.is-open { text-decoration: underline; }
.awb-doc-btn[disabled] { color: var(--text-faint); cursor: default; }
/* Add AWB uses the window's full height; a row's document sits on the left, the table on the right. */
.modal-dialog.modal-dialog-ship.modal-dialog-awbs { height: calc(100vh - 48px); }
.modal-dialog.modal-dialog-ship.modal-dialog-awbs:has(.awb-layout.has-doc) { max-width: 1760px; }
.modal-dialog-awbs:has(.awb-layout.has-doc) .modal-body { overflow: hidden; }
.awb-layout.has-doc { display: grid; grid-template-columns: minmax(340px, 38%) minmax(0, 1fr); gap: 16px; height: 100%; }
.awb-layout.has-doc .awb-main { min-width: 0; min-height: 0; overflow: auto; }
.awb-layout.has-doc .awb-doc-pane { margin-top: 0; display: flex; flex-direction: column; min-height: 0; }
.awb-layout.has-doc .awb-doc-pane .scan-review-doc-body { max-height: none; flex: 1; min-height: 0; }
@media (max-width: 900px) {
  .awb-layout.has-doc { grid-template-columns: minmax(0, 1fr); grid-template-rows: 45% minmax(0, 1fr); }
}
.awb-doc-pane { margin-top: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.awb-doc-pane .scan-review-doc-head { padding: 8px 10px; display: flex; justify-content: space-between; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.awb-doc-pane .scan-review-doc-body { max-height: 420px; overflow: auto; }
.awb-doc-pane .scan-review-doc-body img { display: block; max-width: 100%; margin: 0 auto; }
.awb-doc-pane .scan-review-doc-body.is-zoomed img { max-width: none; width: 200%; }

/* Account Book / invoice: a container's shipment #s under its container #. */
.container-bill-head td { background: var(--surface-2); padding-top: 8px; padding-bottom: 6px; }
.container-bill-label { font-weight: 700; font-family: 'Geist Mono', monospace; }

/* Selected cells (drag across cells, Shift+click): Ctrl+C copies them as a table. */
#content td.cell-selected { background: color-mix(in srgb, var(--accent) 14%, transparent) !important; box-shadow: inset 0 0 0 1px var(--accent); }

/* Table search: one query per line. One line sits in the toolbar like an input;
   several open downward over the table (the toolbar row never moves). */
.search-box textarea { border: none; outline: none; background: transparent; font: inherit; font-size: var(--fs-md); color: var(--text); width: 100%; resize: none; padding: 0; margin: 0; height: 20px; line-height: 20px; overflow: hidden; white-space: pre; }
.toolbar .search-box.search-inline { position: relative; }
.toolbar .search-box.search-inline.is-multi textarea { position: absolute; top: -1px; left: -1px; right: -1px; z-index: 30; height: auto; max-height: 200px; overflow-y: auto; padding: 5px 34px 6px 34px; box-sizing: border-box; background: var(--surface); border: 1px solid var(--accent); border-radius: var(--radius-sm); box-shadow: var(--shadow-card); }
.toolbar .search-box.search-inline.is-multi > svg, .toolbar .search-box.search-inline.is-multi .search-clear-btn { position: relative; z-index: 31; align-self: flex-start; margin-top: 1px; }
.toolbar .search-box.search-inline.is-multi .search-clear-btn { margin-left: auto; }

/* Fleet book Type: a typeable drop-down (pick a type or type any other). */
/* The ▾ is drawn by CSS, so copying the cell copies only the type. */
.fleet-type-caret { margin-left: 6px; color: var(--text-faint); }
.fleet-type-cell .editable-cell:hover .fleet-type-caret { color: var(--text); }

/* ---------- Note types, open instructions, holds ---------- */
.notes-badge-open { background: var(--amber-ink); }
.notes-badge-hold { top: -6px; right: -16px; height: 14px; padding: 0 4px; background: var(--rose-ink); font-size: 9px; letter-spacing: .04em; line-height: 14px; }
.notes-btn.is-held { color: var(--rose-ink); }
/* A quote saved on the AWB (quote.js): a small calculator at the Notes button's foot. */
.notes-quote-mark { position: absolute; bottom: -3px; right: -4px; display: inline-flex; padding: 1px; border-radius: var(--radius-pill); background: var(--surface); color: var(--accent-ink); }

/* ---------- Quote window (quote.js) ---------- */
/* Clear space from Reminders, so one isn't clicked for the other (quote PRD D1). */
.page-date-controls .quote-open-btn { margin-left: 18px; }
.quote-awbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.quote-awbs input { flex: 1; min-width: 160px; border: none; outline: none; padding: 4px; }
.quote-dialog .form-group .form-checkbox-field { display: flex; margin: 0; font-weight: 400; }
.quote-dialog .form-checkbox-field input[type="checkbox"] { width: auto; flex: none; margin: 0; }
.quote-part.is-busy { color: var(--text-faint); cursor: not-allowed; }
.quote-parts { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.quote-zip input { margin-bottom: 8px; }
.quote-dropzone { min-height: 80px; margin-bottom: 8px; }
.quote-note { margin: 6px 0; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--amber-bg); color: var(--amber-ink); font-size: var(--fs-sm); }
.quote-logo-ask { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: var(--fs-sm); }
.quote-logo-ask .fleet-logo-swatch { width: 18px; height: 18px; }
.quote-lines { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.quote-lines th { text-align: left; font-size: var(--fs-xs); color: var(--text-faint); font-weight: 600; padding: 4px 6px; }
.quote-lines td { padding: 4px 6px; border-top: 1px solid var(--grid); }
.quote-lines input[type="number"] { width: 80px; }
.quote-lines select { max-width: 200px; }
/* Values read from the screenshot: tinted so they're checked. */
.quote-lines .quote-read { background: var(--accent-soft); }
.quote-line-off td { color: var(--text-faint); }
.quote-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.quote-preview-head .detail-tabs { margin: 0; }
#quote-text { width: 100%; font-family: inherit; }
.quote-card .quote-lines-saved { margin: 6px 0; }
.quote-show-cost { margin-bottom: 8px; }
/* A delivery fee filled from a saved quote, until someone types over it. */
.truck-fee-input.fee-from-quote { background: var(--accent-soft); }
.portal-quote { margin-bottom: 12px; }
.portal-quote-text { white-space: pre-wrap; font-size: var(--fs-md); color: var(--text); }
.note-kind-tag { padding: 1px 7px; border-radius: var(--radius-pill); font-size: var(--fs-xs); font-weight: 700; background: var(--surface-2); color: var(--text-soft); }
.note-kind-tag.note-kind-hold { background: var(--rose-bg); color: var(--rose-ink); }
.note-kind-tag.note-kind-release { background: var(--green-bg); color: var(--green-ink); }
.note-kind-tag.note-kind-change { background: var(--indigo-bg); color: var(--indigo-ink); }
.note-kind-tag.note-kind-issue { background: var(--amber-bg); color: var(--amber-ink); }
.note-item.is-open { border-left: 3px solid var(--amber-ink); }
.note-item.note-hold.is-open { border-left-color: var(--rose-ink); background: color-mix(in srgb, var(--rose-bg) 35%, var(--surface)); }
.note-item.is-done .note-text { color: var(--text-soft); }
.note-done-open { margin-top: 8px; }
.note-done-line { margin-top: 6px; font-size: var(--fs-sm); color: var(--text-faint); }
.notes-open-head { color: var(--amber-ink); }
.notes-history-head { margin: 16px 0 0; padding-top: 10px; border-top: 1px dashed var(--border); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-faint); }
.notes-compose { flex-direction: column; align-items: stretch; }
.notes-compose-row { display: flex; align-items: flex-end; gap: 8px; }
.note-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.note-kind-chip { padding: 3px 10px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); color: var(--text-soft); font-family: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
.note-kind-chip:hover { border-color: var(--accent); }
.note-kind-chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.note-kind-chip.note-kind-hold.active { border-color: var(--rose-ink); background: var(--rose-bg); color: var(--rose-ink); }
.note-kind-chip.note-kind-release.active { border-color: var(--green-ink); background: var(--green-bg); color: var(--green-ink); }
.note-kind-chip.note-kind-issue.active { border-color: var(--amber-ink); background: var(--amber-bg); color: var(--amber-ink); }
.confirm-icon-hold { background: var(--rose-bg); color: var(--rose-ink); }

/* ---------- Files (files.js) ---------- */
.files-layout { display: grid; grid-template-columns: minmax(220px, 280px) 1fr; gap: 16px; align-items: start; }
.files-tree { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 8px; max-height: calc(100vh - 190px); overflow: auto; position: sticky; top: 0; }
.files-tree-row { display: flex; align-items: center; padding-left: calc(var(--depth, 0) * 14px); }
.files-tree-caret, .files-tree-caret-gap { width: 20px; flex: none; }
/* 20px wide in the indent, 24px to hit. */
.files-tree-caret { position: relative; height: 24px; }
.files-tree-caret::after { content: ""; position: absolute; inset: 0 -2px; }
.files-tree-caret { border: 0; background: none; color: var(--text-faint); cursor: pointer; padding: 0; font-size: var(--fs-xs); line-height: 1; transition: transform .12s; }
.files-tree-caret.open { transform: rotate(90deg); }
.files-tree-item { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; border: 0; background: none; text-align: left; padding: 6px 8px; border-radius: var(--radius-sm); cursor: pointer; color: var(--text); font: inherit; font-size: var(--fs-md); }
.files-tree-item:hover { background: var(--bg); }
.files-tree-row.active .files-tree-item { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.files-tree-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files-tree-count { font-size: var(--fs-sm); color: var(--text-faint); }
.files-tree-empty { margin: 4px 8px 8px 28px; font-size: var(--fs-sm); color: var(--text-faint); }
.files-main { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; min-width: 0; }
.files-pane-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; min-height: 30px; }
.files-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: var(--fs-md); }
.files-crumb, .files-also-link { border: 0; background: none; padding: 0; color: var(--accent-ink); cursor: pointer; font: inherit; }
.files-crumb:hover, .files-also-link:hover { text-decoration: underline; }
.files-crumb-sep { color: var(--text-faint); }
.files-crumb-current { font-weight: 600; color: var(--text); }
.files-note { margin: 0 0 10px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--bg); color: var(--text-soft); font-size: var(--fs-sm); }
.files-note-warn { background: var(--amber-bg); color: var(--amber-ink); }
.files-meta { margin: 0 0 10px; font-size: var(--fs-sm); color: var(--text-soft); }
.files-fileunder { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--amber-bg); color: var(--amber-ink); font-size: var(--fs-sm); }
.files-fileunder-select { width: auto; min-width: 180px; height: 30px; padding: 0 8px; font-size: var(--fs-sm); }
.files-drop { border-radius: var(--radius-md, 8px); }
.files-dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 100%; min-height: 96px; margin: 0 0 14px; padding: 16px; border: 1.5px dashed var(--border); border-radius: var(--radius-md, 8px); background: var(--bg); color: var(--text-soft); font: inherit; cursor: pointer; transition: border-color .12s, background .12s, color .12s; }
.files-dropzone-empty { min-height: 170px; }
.files-dropzone svg { color: var(--accent-teal); }
.files-dropzone-title { font-size: var(--fs-md); font-weight: 600; color: var(--text); }
.files-dropzone-title u { color: var(--accent-ink); text-underline-offset: 2px; }
.files-dropzone-sub { font-size: var(--fs-sm); color: var(--text-faint); text-align: center; }
.files-dropzone:hover, .files-dropzone:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.files-drop.drag-over .files-dropzone { border-color: var(--accent); background: var(--accent-soft); min-height: 170px; }
.files-table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.files-table th { text-align: left; font-weight: 600; font-size: var(--fs-sm); color: var(--text-faint); padding: 6px 8px; border-bottom: 1px solid var(--border); }
.files-table td { padding: 7px 8px; border-bottom: 1px solid var(--grid, var(--border)); vertical-align: middle; }
.files-row:hover td { background: var(--bg); }
.files-name { display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; padding: 0; cursor: pointer; color: var(--text); font: inherit; text-align: left; max-width: 100%; }
.files-name span { overflow-wrap: anywhere; }
.files-name:hover span { color: var(--accent-ink); text-decoration: underline; }
.files-name svg { flex: none; color: var(--text-faint); }
.files-row-folder .files-name svg { color: var(--accent-teal); }
.files-sub { display: block; margin: 2px 0 0 23px; font-size: var(--fs-sm); color: var(--text-faint); }
.files-also { color: var(--text-soft); }
.files-muted { color: var(--text-faint); font-size: var(--fs-sm); white-space: nowrap; }
.files-actions { text-align: right; white-space: nowrap; }
.files-actions .btn + .btn { margin-left: 4px; }
.files-actions-col { width: 1%; }
.files-version { margin-left: 6px; border: 1px solid var(--border); background: var(--bg); border-radius: 999px; padding: 0 7px; font-size: var(--fs-xs); font-weight: 600; color: var(--text-soft); cursor: pointer; }
.files-version:hover { border-color: var(--accent); color: var(--accent-ink); }
.files-versions { padding: 10px 12px; background: var(--bg); border-radius: var(--radius-sm); }
.files-versions-head { display: flex; align-items: center; justify-content: space-between; }
.files-versions-list { margin: 6px 0 0; padding-left: 20px; }
.files-versions-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 0; font-size: var(--fs-sm); }
.files-orphan, .files-orphan .files-name span { color: var(--text-faint); }
.files-empty { margin: 18px 0; text-align: center; color: var(--text-faint); }
.files-search { width: 260px; height: 38px; }
.files-panel { max-width: 860px; width: calc(100vw - 32px); }
.files-panel .modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.files-panel-head-actions { display: flex; align-items: center; gap: 8px; }
.files-panel .files-muted { white-space: normal; }
.files-dialog-text { margin: 6px 0 8px; color: var(--text-soft); }
.files-dialog-list { margin: 0; padding-left: 18px; color: var(--text-soft); font-size: var(--fs-sm); line-height: 1.6; }
.files-dialog-input { width: 100%; margin-top: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#files-dialog-root .modal-overlay { z-index: 1200; }
/* The AWB's folder icon: bottom-right corner of the AWB cell, over its padding (no extra width). */
td.files-cell:not(.awb-cell) { position: relative; } /* a sticky AWB cell already anchors its icons */
.awb-folder-btn { position: absolute; right: 4px; bottom: 4px; width: 15px; height: 15px; padding: 0; border: 0; background: none; color: var(--teal-ink); cursor: pointer; opacity: .8; z-index: 1; line-height: 0; }
.awb-folder-btn:hover { opacity: 1; color: var(--accent-ink); }
/* The AWB's copy button: right after the number (corners are for the folder and other markers), shown while the cell is hovered. */
.awb-copy-btn { display: inline-flex; align-items: center; justify-content: center; vertical-align: top; width: 18px; height: 15px; /* the cell's 15px line, so it doesn't push the group button down */ margin-left: 2px; padding: 0; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text-faint); cursor: pointer; opacity: 0; }
td.awb-cell:hover .awb-copy-btn, .awb-copy-btn:focus-visible { opacity: 1; }
.awb-copy-btn:hover { color: var(--accent-ink); background: var(--accent-soft); }
td.awb-cell:has(.inline-edit-wrap) .awb-copy-btn { display: none; }
@media (max-width: 900px) {
  .files-layout { grid-template-columns: 1fr; }
  .files-tree { position: static; max-height: 260px; }
  .files-search { width: 100%; }
}
.files-search, .files-dialog-input { padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: var(--fs-md); background: var(--surface); font-family: inherit; color: var(--text); }
.files-search:focus, .files-dialog-input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.files-storage { margin: 10px 8px 2px; padding-top: 8px; border-top: 1px solid var(--border); font-size: var(--fs-sm); color: var(--text-faint); }
.files-storage-line { margin: 0; color: var(--text-soft); }
.files-sub-flush { margin-left: 0; }
/* Shared with the client portal (an active state: accent), or shared but paused (a warning). */
.files-shared { color: var(--accent-ink); }
.files-sub-warn { color: var(--amber-ink); }
.files-shared .icon, .files-sub-warn .icon { vertical-align: -2px; margin-right: 4px; }
.files-share-off { display: inline-flex; }

/* ---------- switch: one on/off setting (button role="switch", aria-checked) ---------- */
.switch { display: inline-flex; align-items: center; gap: 6px; padding: 4px 2px; border: 0; background: none; color: var(--text-soft); font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; white-space: nowrap; vertical-align: middle; }
.switch-track { position: relative; flex: none; width: 28px; height: 16px; border-radius: var(--radius-pill); background: var(--text-faint); transition: background .15s; }
.switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--on-fill); transition: transform .15s; }
.switch[aria-checked="true"] { color: var(--accent-ink); }
.switch[aria-checked="true"] .switch-track { background: var(--accent-ink); }
.switch[aria-checked="true"] .switch-track::after { transform: translateX(12px); }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-xs); }
.switch:disabled { cursor: not-allowed; color: var(--text-faint); }
.switch:disabled .switch-track { background: var(--border); }
.files-table .files-share-col { width: 1%; text-align: center; white-space: nowrap; }
.files-pane-head .files-delete { margin-left: auto; }

/* ---------- Containers on Warehouse ---------- */
tr.wh-container-row { cursor: pointer; }
tr.wh-container-row > td { background: var(--surface-2); }
tr.wh-container-row.row-selected > td { background: var(--accent-soft); }

/* Completion before Here or not: greyed out */
.completion-blocked { display: inline-flex; cursor: not-allowed; }
.completion-blocked input[type="checkbox"]:disabled { opacity: .35; cursor: not-allowed; pointer-events: none; }

/* Deliver directly: the AWB's remark, to select this delivery's part. */
.deliver-remark-text { width: 100%; box-sizing: border-box; resize: vertical; font: inherit; line-height: 1.5; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); white-space: pre-wrap; }

/* Manifest query (manifestquery.js). */
.confirm-icon-send { background: var(--accent-soft); color: var(--accent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.manifest-query-btn.is-running { cursor: progress; opacity: .7; }
.mq-sub { margin: 0 0 12px; font-size: var(--fs-sm); color: var(--text-faint); }
.mq-status { margin: 0 0 12px; padding: 8px 10px; border-radius: var(--radius-sm, 8px); background: var(--bg); font-size: var(--fs-sm); }
.mq-status.is-waiting { background: var(--accent-soft); }
.mq-status.is-error { background: var(--rose-bg); color: var(--rose-ink); }
.mq-section { margin-bottom: 18px; }
.mq-section h3 { margin: 0 0 8px; font-size: var(--fs-md); font-weight: 700; color: var(--text-soft); text-transform: uppercase; letter-spacing: .04em; }
.mq-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 16px; }
@media (max-width: 640px) { .mq-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mq-field { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mq-label { font-size: var(--fs-xs); color: var(--text-faint); }
.mq-value { font-size: var(--fs-md, 14px); font-weight: 600; overflow-wrap: anywhere; }
.mq-value.is-empty { color: var(--text-faint); font-weight: 400; }
.mq-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.mq-table th { text-align: left; font-weight: 600; color: var(--text-faint); padding: 4px 8px; border-bottom: 1px solid var(--border); }
.mq-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.mq-table tr.mq-code-other td { color: var(--text-faint); }
.mq-house { border: 1px solid var(--border); border-radius: var(--radius-sm, 8px); padding: 6px 10px; margin-bottom: 6px; }
.mq-house summary { cursor: pointer; font-size: var(--fs-sm); }
.mq-house .mq-table { margin-top: 6px; }
.mq-pending-btn.is-running { cursor: progress; opacity: .7; }
/* A manifest query waiting for CBP: a triangle in the Customs cell's top-right corner. */
#content table tbody tr[data-row-id] > td:has(.mq-pending-flag) { position: relative; }
.mq-pending-flag { position: absolute; top: 0; right: 0; width: 0; height: 0; padding: 0; background: none; border-style: solid; border-width: 0 12px 12px 0; border-color: transparent var(--amber-ink) transparent transparent; cursor: pointer; }

/* ---------- Files Inbox (inbox.js) ---------- */
.inbox-tag { display: inline-block; margin: 3px 0 0 23px; padding: 1px 8px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; }
.inbox-tag-none { background: var(--amber-bg); color: var(--amber-ink); }
.inbox-tag-busy { background: var(--accent-soft); color: var(--accent); }
.inbox-row .files-sub { margin-top: 3px; }
.inbox-place { white-space: nowrap; text-align: right; }
.inbox-place-input { width: 230px; height: 30px; padding: 0 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); font: inherit; font-size: var(--fs-sm); background: var(--surface); color: var(--text); }
.inbox-place-input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.inbox-place .btn { margin-left: 4px; }
.inbox-overlay { position: fixed; inset: 0; z-index: 1300; display: flex; align-items: center; justify-content: center; background: rgba(15, 23, 42, .35); padding: 16px; }
.inbox-overlay-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 34px 44px; border: 2px dashed var(--accent); border-radius: var(--radius-lg); background: var(--surface); color: var(--text-soft); text-align: center; pointer-events: none; }
.inbox-overlay-card svg { color: var(--accent-teal); }
.inbox-overlay-card strong { font-size: var(--fs-lg); color: var(--text); }
@media (max-width: 900px) { .inbox-place { white-space: normal; } .inbox-place-input { width: 100%; margin-bottom: 4px; } }

/* ---------- Skeleton: the page's shape while it draws (navigateTo) ---------- */
.skeleton-page { display: flex; flex-direction: column; gap: 14px; }
.skeleton { background: var(--surface-2); border-radius: var(--radius-sm); animation: skeleton-pulse 1.2s ease-in-out infinite; }
.skeleton-title { width: 220px; height: 28px; }
.skeleton-text { width: 420px; max-width: 70%; height: 12px; }
.skeleton-bar { height: 32px; }
.skeleton-table { display: flex; flex-direction: column; gap: 18px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.skeleton-row { height: 14px; }
.skeleton-rows { display: flex; flex-direction: column; gap: 18px; padding: 16px; } /* inside a table's own card, while a month draws */
.skeleton-row:nth-child(3n + 2) { width: 86%; }
.skeleton-row:nth-child(3n) { width: 72%; }
@keyframes skeleton-pulse { 50% { opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* ---------- Spreadsheet import + Import Review ---------- */
.import-tabs { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 12px; margin-bottom: 12px; max-height: 180px; overflow-y: auto; }
.import-layout-title { margin: 12px 0 4px; font-size: var(--fs-md); font-weight: 600; color: var(--text); }
.import-loose td { background: var(--amber-bg); }
.import-loose td:first-child { color: var(--amber-ink); }
.import-actions { white-space: nowrap; text-align: right; }
.import-table-wrap { overflow-x: auto; }
.import-review-table { table-layout: fixed; min-width: 760px; }
.import-review-table td { vertical-align: top; overflow-wrap: anywhere; }
.import-review-table select, .import-review-table input { width: 100%; min-width: 0; }
.import-actions .btn + .btn, .vendor-card-head .btn + .btn { margin-left: 6px; }

/* ---------- Vendors book (vendors.js) ---------- */
.vendor-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 14px; }
.vendor-card h2 { margin: 0 0 10px; font-size: var(--fs-lg); font-weight: 600; color: var(--text); }
.vendor-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.vendor-table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.vendor-table th { text-align: left; font-weight: 600; font-size: var(--fs-sm); color: var(--text-faint); padding: 6px 8px; border-bottom: 1px solid var(--border); }
.vendor-table td { padding: 6px 8px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
.vendor-table input { width: 100%; min-width: 70px; height: 32px; padding: 0 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); font: inherit; background: var(--surface); color: var(--text); }
.vendor-table input:focus, .vendor-field input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.vendor-list .vendor-row { cursor: pointer; }
.vendor-list .vendor-row:hover td { background: var(--bg); }
.vendor-num { text-align: right; white-space: nowrap; }
.vendor-muted { color: var(--text-faint); font-size: var(--fs-sm); }
.vendor-empty { margin: 4px 0 2px; }
.vendor-owed, .vendor-summary .vendor-owed strong { color: var(--rose-ink); }
.vendor-total td { font-weight: 600; border-bottom: 0; }
.vendor-remove { width: 1%; }
.vendor-summary { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.vendor-summary > div { flex: 1 1 160px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 16px; }
.vendor-summary span { display: block; font-size: var(--fs-sm); color: var(--text-faint); }
.vendor-summary strong { font-size: var(--fs-xl); color: var(--text); }
.vendor-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 14px; }
.vendor-field { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-sm); color: var(--text-soft); }
.vendor-field-wide { grid-column: 1 / -1; }
.vendor-field input { height: 36px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); font: inherit; font-size: var(--fs-md); background: var(--surface); color: var(--text); }
@media (max-width: 700px) { .vendor-card { overflow-x: auto; } }

/* ---------- Ship out (Warehouse) ---------- */
/* The Ship Out button drops under the box when the column is narrow. */
.completion-cell { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.completion-cell input[type="checkbox"] { margin-block: 0; } /* so box + button fit the 45px cell on two lines */
.ship-out-btn { padding: 2px 10px; white-space: nowrap; }
.ship-out-btn { display: block; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; } /* a column narrowed by hand: "Ship…", never sliced */
.ship-out-truck { padding: 10px 12px; margin-bottom: 10px; border: 1px solid var(--border); border-radius: var(--radius); }
.ship-out-truck.is-blocked { background: var(--surface-2); }
.ship-out-truck-head { margin-bottom: 4px; }
.ship-out-rows { margin-bottom: 8px; line-height: 1.5; }
.ship-out-block { margin: 0; font-size: var(--fs-sm); color: var(--rose-ink); }
.dock-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dock-chip { min-width: 72px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-family: inherit; font-size: var(--fs-md); font-weight: 600; cursor: pointer; }
.dock-chip:hover { border-color: var(--accent); }
.dock-chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
/* A split AWB's Box count: the parts' total, opening the Parts window (counts per part). */
.part-box-empty { font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: var(--text-faint); }
.arrival-table .arrival-boxes { width: 96px; }
.part-box-sub { white-space: nowrap; } /* one line, so the cell keeps the row's height */

/* ---------- client portal (portal.html, portal.js) ---------- */
body.portal { height: auto; min-height: 100%; background: var(--bg); }
.portal-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; padding: 12px 24px; border-bottom: 1px solid var(--border); background: var(--surface); }
.portal-top .brand-word { font-size: var(--fs-lg); }
.portal-kicker { margin: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--text-faint); }
.auth-brand .portal-kicker { margin-top: 4px; }
.portal-client { padding-left: 12px; border-left: 1px solid var(--border); font-weight: 600; color: var(--text); }
.portal-spacer { flex: 1; }
.portal-email { font-size: var(--fs-sm); color: var(--text-soft); }
.portal-main { max-width: 1180px; margin: 0 auto; padding: 22px 24px 48px; }
.portal-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.portal-toolbar .search-box { flex: 1 1 320px; max-width: 480px; min-width: 0; }
.portal-stages { max-width: 100%; overflow-x: auto; }
.portal-table-wrap.table-container { max-height: none; }
.portal-table td { height: 50px; }
.portal-table .num { text-align: right; }
.portal-row { cursor: pointer; }
.portal-row:hover { background: var(--bg); }
.portal-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.portal-awb { white-space: nowrap; font-weight: 600; }
.portal-sub { display: block; font-size: var(--fs-sm); color: var(--text-faint); }
.portal-table td .icon { vertical-align: -2px; color: var(--text-faint); }
.portal-foot { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 16px; }
.portal-foot p { margin: 0; }
.portal-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 22px; margin: 0 0 22px; }
.portal-field dt { margin-bottom: 4px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-faint); }
.portal-field dd { margin: 0; color: var(--text); }
.portal-h3 { margin: 0 0 10px; font-size: var(--fs-md); font-weight: 600; color: var(--text); }
.portal-parts, .portal-docs { list-style: none; margin: 0 0 22px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); }
.portal-parts li, .portal-docs li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--grid); }
.portal-parts li:first-child, .portal-docs li:first-child { border-top: none; }
.portal-parts li .mono { flex: 1; }
.portal-docs { margin-bottom: 0; }
.portal-doc-name { display: flex; align-items: flex-start; gap: 8px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.portal-doc-name > .icon { flex: none; margin-top: 2px; color: var(--text-faint); }
.portal-doc-actions { display: flex; gap: 6px; flex: none; }
.portal-doc-actions .btn { display: inline-flex; align-items: center; gap: 6px; }
.portal-main .page-header-actions .btn { display: inline-flex; align-items: center; gap: 6px; }
.portal-ship-note { margin: 0 0 12px; font-size: var(--fs-sm); color: var(--text-soft); }
/* The portal's New Shipment: the app's window with fewer columns, as tall as its rows. */
#portal-ship .modal-dialog.modal-dialog-awbs { height: auto; max-width: 1080px; }
#portal-ship .awb-rows-table { min-width: 980px; }
#portal-ship .awb-rows-table .ar-awb { width: 16%; } #portal-ship .awb-rows-table .ar-remarkOriginal { width: 22%; } #portal-ship .awb-rows-table .ar-doc { width: 17%; }
#portal-ship .awb-rows-table .ar-pieces, #portal-ship .awb-rows-table .ar-kg, #portal-ship .awb-rows-table .ar-destAirport, #portal-ship .awb-rows-table .ar-flightNumber, #portal-ship .awb-rows-table .ar-cbm { width: 9%; }
.portal-attach { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; margin: 2px 0; }
.portal-attach:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.portal-attach-name { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 4px 0 4px 6px; font-size: var(--fs-sm); color: var(--text); }
.portal-attach-name > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.portal-attach-name .icon { flex: none; color: var(--text-faint); }
#portal-ship .sf-input.is-dupe { border-color: var(--critical-ink); background: var(--critical-bg); }
.portal-ship-docs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-top: 14px; }
#portal-ship .cont-ships-table .ar-n { width: 28px; text-align: right; padding-right: 6px; }
.portal-pending { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 12px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.portal-pending-title { font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.portal-pending-item { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-md); }
/* Phones: each shipment is a card, its labels from the column headings. */
@media (max-width: 720px) {
  .portal-top { flex-wrap: nowrap; padding: 10px 16px; }
  .portal-top > .portal-kicker, .portal-email, .portal-spacer { display: none; }
  .portal-top .brand-logo { display: none; }
  .portal-top .brand-mark { display: block; }
  .portal-client { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .portal-main { padding: 16px 16px 40px; }
  .portal-toolbar .search-box { max-width: none; }
  .portal-table thead { display: none; }
  .portal-table, .portal-table tbody { display: block; }
  .portal-table tr.portal-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; padding: 12px 14px; border-bottom: 1px solid var(--grid); }
  .portal-table tr.portal-row td { height: auto; padding: 0; border: none; text-align: left; }
  .portal-table tr.portal-row td::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-faint); }
  .portal-table tr.portal-row td:first-child { grid-column: 1 / -1; }
  .portal-table tr.portal-row td:first-child::before { display: none; }
  .portal-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal-docs li { flex-wrap: wrap; }
  .portal-main .page-header { flex-direction: row; align-items: center; }
  #portal-ship .modal-dialog { max-height: 96vh; }
  #portal-ship .ship-fields.cont-top { grid-template-columns: 1fr; }
  .modal-overlay#portal-detail { padding: 0; align-items: flex-end; }
  #portal-detail .modal-dialog { max-height: 92vh; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
}

/* ---------- Charges (ISC column → Charges window, charges.js) ---------- */
.charges-cell { display: inline-block; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; vertical-align: bottom; border: none; background: none; padding: 2px 4px; margin: -2px -4px; border-radius: var(--radius-xs); font: inherit; color: inherit; cursor: pointer; text-align: left; }
.charges-cell:hover { background: var(--surface-2); }
.charges-cell:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.charges-cell-check { background: var(--amber-bg); }
.charges-more { margin-left: 6px; font-size: var(--fs-xs); color: var(--text-faint); }
.charges-popup { width: 340px; }
.charges-head, .charges-line { display: grid; grid-template-columns: 1fr 120px 24px; gap: 8px; align-items: center; }
.charges-head label { margin: 0; }
.charges-list { display: flex; flex-direction: column; gap: 6px; }
.charges-row { padding: 6px; margin: 0 -6px; border-radius: var(--radius-sm); }
.charges-row-check { background: var(--amber-bg); }
.charges-line select, .charges-line .fee-input-wrap { width: 100%; min-width: 0; }
.charges-type, .charges-amount { font-size: var(--fs-md); }
.charges-amount { text-align: right; }
.charges-lock { color: var(--text-faint); display: inline-flex; justify-content: center; }
.charges-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.charges-receipt { cursor: pointer; font: inherit; font-size: var(--fs-xs); }
.charges-total { display: flex; justify-content: space-between; padding-top: 8px; border-top: 1px solid var(--border); font-weight: 600; font-size: var(--fs-md); }
.charges-check-note { display: flex; align-items: center; gap: 6px; margin: 0; }
.charge-type-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.charge-type-list .pill { display: inline-flex; align-items: center; gap: 4px; }
.charge-type-add-row { display: flex; gap: 8px; max-width: 360px; }
.fee-cell-charges { vertical-align: top; }
.fee-charge + .fee-charge { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); }
.fee-charge-type { display: block; font-size: var(--fs-xs); color: var(--text-faint); }

/* ---------- Billing (billing.js) ---------- */
/* The four totals: each is the filter for the list under it (selected = accent, like a tab). */
.billing-totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.billing-total { all: unset; box-sizing: border-box; display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; min-width: 0; }
.billing-total:hover { border-color: var(--text-faint); }
.billing-total:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.billing-total.is-active { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.billing-total-label { font-size: var(--fs-xs); font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: .02em; }
.billing-total-value { font-family: 'Geist Mono', monospace; font-size: var(--fs-xl); font-weight: 600; color: var(--text); margin-top: 4px; }
.billing-total.is-late .billing-total-value { color: var(--rose-ink); }
.billing-total-sub { font-size: var(--fs-sm); color: var(--text-faint); }
.billing-filter-note { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--text-soft); margin: -4px 0 10px; }
.billing-table th.num, .billing-table td.num { text-align: right; }
.billing-table th.num .col-header { justify-content: flex-end; }
.billing-table td { height: 50px; white-space: nowrap; }
.billing-table tr.client-row { cursor: pointer; }
.billing-client { font-weight: 600; }
.billing-action { text-align: right; width: 1%; }
.billing-age-due { color: var(--amber-ink); }
.billing-age-late { color: var(--rose-ink); }
.billing-table tfoot td { font-weight: 600; border-top: 1px solid var(--border); }
@media (max-width: 900px) { .billing-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.client-contact-field { display: grid; grid-template-columns: 90px 1fr; gap: 8px; align-items: baseline; padding: 4px 0; font-size: var(--fs-md); }
.client-contact-label { font-size: var(--fs-sm); color: var(--text-faint); }

/* ---------- Notifications drawer (notifications.js): History's drawer, with tabs and unread / done ---------- */
.hub-drawer { width: 440px; max-width: 100vw; } /* six tabs fit */
.hub-head-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.hub-tabs { display: flex; justify-content: space-between; gap: 2px; padding: 0 14px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.hub-tab { all: unset; display: inline-flex; align-items: center; gap: 4px; padding: 9px 2px 8px; font-size: var(--fs-sm); font-weight: 500; color: var(--text-faint); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.hub-tab:hover { color: var(--text); }
.hub-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.hub-tab.active { color: var(--accent-ink); border-bottom-color: var(--accent); font-weight: 600; }
.hub-tab-count { min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box; border-radius: var(--radius-pill); background: var(--accent-ink); color: var(--on-fill); font-size: var(--fs-xs); font-weight: 600; line-height: 16px; text-align: center; }
.hub-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.hub-dot-none { background: none; } /* only important changes get a dot; this keeps the names lined up */
.hub-entry.is-unread { background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface)); }
.hub-entry.is-unread .history-who { font-weight: 700; }
.hub-text { font-size: var(--fs-md); color: var(--text-soft); margin-top: 2px; }
/* The bell's dot: something important came in since the drawer was last opened. */
.topbar-hub-btn { position: relative; }
.hub-new-dot { position: absolute; top: 3px; left: 19px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--surface); }
/* Unread and Read: each folds away under its header (one always stays open). */
.hub-body { padding-top: 0; }
.hub-section + .hub-section { border-top: 1px solid var(--border); }
.hub-section-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 14px 8px 10px; background: var(--surface); border-bottom: 1px solid var(--border); }
.hub-section-toggle { all: unset; display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: var(--radius-sm); font-size: var(--fs-sm); font-weight: 700; color: var(--text); cursor: pointer; }
.hub-section-toggle:hover { background: var(--surface-2); }
.hub-section-toggle:focus-visible { outline: 2px solid var(--accent); }
.hub-section-toggle svg { color: var(--text-faint); transition: transform .15s ease; }
.hub-section.is-folded .hub-section-toggle svg { transform: rotate(-90deg); }
.hub-section-count { font-weight: 600; color: var(--text-faint); }
.hub-section-body .history-day { top: 45px; } /* under the sticky section header */
@media (prefers-reduced-motion: reduce) { .hub-section-toggle svg { transition: none; } }
.hub-actions { margin-left: 4px; display: inline-flex; gap: 2px; visibility: hidden; }
.hub-entry:hover .hub-actions, .hub-entry:focus-within .hub-actions { visibility: visible; }
.hub-actions .icon-btn { color: var(--text-faint); }
.hub-actions .icon-btn:hover { color: var(--accent-ink); }
@media (hover: none) { .hub-actions { visibility: visible; } }

/* Team page: a role picked but not saved yet shows Save / Cancel beside it. */
.team-role-edit { display: flex; align-items: center; gap: 6px; }
.team-role-select.is-changed { border-color: var(--accent); background-color: var(--accent-soft); }

/* ---------- TEMPORARY debug role switch (debug-role.js): remove before release ---------- */
.debug-role { position: relative; flex-shrink: 0; z-index: 400; font-size: var(--fs-sm); }
.debug-role-btn { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 12px; border: 1px dashed var(--amber-ink); border-radius: var(--radius-pill); background: var(--amber-bg); color: var(--amber-ink); cursor: pointer; box-shadow: var(--shadow-card); }
.debug-role-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.debug-role-menu { position: absolute; left: 0; top: 38px; min-width: 180px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(15,23,42,.14); }
.debug-role-item { all: unset; box-sizing: border-box; display: block; width: 100%; padding: 7px 10px; border-radius: var(--radius-sm); color: var(--text); cursor: pointer; }
.debug-role-item:hover { background: var(--surface-2); }
.debug-role-item.is-on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }

/* Completion ticked with no Box count: the Box count cell asks to be filled */
td.box-count-needed { background: color-mix(in srgb, var(--rose-bg) 70%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rose-ink) 35%, transparent); }

/* ---------- Warehouse lanes (lanes.js) ---------- */
tr.lane-header > td { padding: 6px 10px; background: var(--surface); border-bottom: 1px solid var(--grid); box-shadow: inset 3px 0 0 var(--lane-color); cursor: pointer; }
tr.lane-header:hover > td { background: var(--surface-2); }
.lane-header-inner { display: flex; align-items: center; gap: 8px; font-size: var(--fs-md); }
.lane-header-inner .lane-name { font-weight: 600; color: var(--text); }
.lane-meta { font-size: var(--fs-sm); color: var(--text-faint); }
.lane-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--lane-color); flex-shrink: 0; }
tr.in-lane > td:first-child { box-shadow: inset 3px 0 0 var(--lane-color); }
tr.in-lane.group-child-row > td:first-child, tr.in-lane.group-master-open > td:first-child { box-shadow: inset 3px 0 0 var(--lane-color), inset 7px 0 0 var(--group-ink); }
.lane-split-note { margin-top: 1px; }
.lane-setting { padding: 12px 0; border-bottom: 1px solid var(--border); display: grid; gap: 8px; }
.lane-setting-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lane-name-field { flex: 1 1 180px; min-width: 140px; margin: 0; }
.lane-colors { display: flex; gap: 6px; }
.lane-color { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--surface); background: var(--lane-color); box-shadow: 0 0 0 1px var(--border); cursor: pointer; padding: 0; }
.lane-color.active { box-shadow: 0 0 0 2px var(--accent); }
.lane-color:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lane-setting-actions { display: flex; gap: 2px; margin-left: auto; }
.lane-setting-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; }
.lane-setting-label { width: 100px; font-size: var(--fs-sm); color: var(--text-soft); }
.lane-types { display: flex; flex-wrap: wrap; gap: 4px 14px; }
#lane-add { margin: 16px 0 18px; }
