/* HELM Ops — design system
   Internal tool aesthetic: refined minimal, data-first, high contrast.
   Not the customer-facing portal's serif/ornamental voice. */

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

:root {
  /* Brand — raw tokens (use these only when both brands are shown simultaneously,
     e.g. dual-logo nav, brand pills on cross-brand lists) */
  --brand-helm:          #0000DC;
  --brand-anchor:        #e9695e;
  --brand-helm-header:   #0000DC;
  --brand-anchor-header: #0f2e2b;

  /* Brand — active tokens. Default to HELM at :root; deal pages override via
     body[data-brand="anchor"]. All per-brand styling should use these, not the
     raw tokens above. See body[data-brand] rules below. */
  --brand-primary:      var(--brand-helm);
  --brand-header-bg:    var(--brand-helm-header);
  --brand-glow:         rgba(0, 0, 220, 0.12);
  --brand-tint:         rgba(0, 0, 220, 0.08);

  /* Neutrals — warm-ish greys for less clinical feel */
  --ink-900: #0a0a0b;
  --ink-700: #2a2a2d;
  --ink-500: #5a5a5f;
  --ink-300: #8e8e94;
  --ink-200: #c5c5cb;
  --ink-100: #e8e8ec;
  --ink-50:  #f5f5f7;
  --ink-0:   #ffffff;

  /* Semantic */
  --ok:      #0a7d50;
  --ok-bg:   #e8f4ee;
  --warn:    #b8540a;
  --warn-bg: #fbf1e6;
  --err:     #b4242b;
  --err-bg:  #fbeceb;
  --info:    #1560bd;
  --info-bg: #e8f0fb;

  /* Surfaces */
  --bg:      var(--ink-50);
  --surface: var(--ink-0);
  --border:  var(--ink-100);
  --border-strong: var(--ink-200);

  /* Typography */
  --font-sans: 'Inter Tight', 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Rhythm */
  --radius: 6px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 2px rgba(10, 10, 11, 0.04);
  --shadow-md: 0 4px 16px rgba(10, 10, 11, 0.06), 0 1px 2px rgba(10, 10, 11, 0.04);
  --shadow-lg: 0 12px 40px rgba(10, 10, 11, 0.12), 0 2px 4px rgba(10, 10, 11, 0.04);
}

/* Per-deal brand override. Deal pages set body[data-brand="anchor"] after the
   deal payload arrives; everything else inherits HELM from :root. Only the
   active brand tokens change — neutrals, semantics, layout, type stay identical.
   The nav is deliberately NOT scoped by this (it shows both brands permanently). */
body[data-brand="anchor"] {
  --brand-primary:   var(--brand-anchor);
  --brand-header-bg: var(--brand-anchor-header);
  --brand-glow:      rgba(26, 122, 110, 0.14);
  --brand-tint:      rgba(26, 122, 110, 0.10);
}

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

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-900);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--brand-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

code, .mono { font-family: var(--font-mono); font-size: 0.92em; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 22px; letter-spacing: -0.02em; }
h2 { font-size: 17px; }
h3 { font-size: 14px; color: var(--ink-500); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }

/* ----- Layout ----- */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Deploy Q.4 — nav is now two rows:
 *   row 1 (.nav-row): logo + title + links | search | user
 *   row 2 (.nav-recent): pill strip of recently viewed deals
 *
 * The search slot stretches to fill available width between the left
 * cluster and the user cluster, giving the search bar plenty of room. */
.nav {
  background: var(--ink-0);
  border-bottom: 1px solid var(--border);
  display: block;
  position: sticky;
  top: 0;
  z-index: 10;
}
.nav-row {
  padding: 0 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  height: 56px;
}
.nav-left {
  display: flex;
  align-items: center;
  gap: 24px;
  min-width: 0;
}
.nav-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink-900);
  white-space: nowrap;
  padding: 0 8px 0 4px;
  border-left: 1px solid var(--border);
  margin-left: 4px;
}

/* Deploy Q.3 / Q.4 — global search input in the nav. Stretches to fill the
 * centre grid slot so ops gets a wide target regardless of viewport. */
.nav-search {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 720px;
  justify-self: stretch;
  margin: 0;
}
.nav-search-input {
  width: 100%;
  height: 36px;
  padding: 0 14px 0 36px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--ink-50) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888780' stroke-width='2'><circle cx='11' cy='11' r='7'/><path d='m21 21-4.3-4.3'/></svg>") no-repeat 11px center;
  background-size: 16px 16px;
  font-size: 13px;
  color: var(--ink-900);
  transition: border-color 120ms ease, background-color 120ms ease;
}
.nav-search-input::placeholder {
  color: var(--ink-500);
}
.nav-search-input:focus {
  outline: none;
  background-color: var(--ink-0);
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(0, 0, 220, 0.12);
}

/* Deploy Q.4 — recently viewed deals pill strip. Row below the main nav.
 * Horizontally scrollable if there are more pills than fit; each pill
 * truncates to keep the strip clean. Brand accents via a coloured left
 * border so the pill background stays neutral. */
.nav-recent {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 24px;
  border-top: 1px solid var(--ink-50);
  background: var(--ink-0);
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-recent::-webkit-scrollbar { display: none; }
.nav-recent-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  flex-shrink: 0;
  padding-right: 4px;
}
.nav-recent-pill {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  max-width: 260px;
  padding: 4px 10px 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-900);
  background: var(--ink-50);
  border: 1px solid var(--ink-100);
  border-left-width: 6px;
  border-radius: 6px;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background 120ms ease, border-color 120ms ease;
}
.nav-recent-pill:hover {
  background: var(--ink-100);
  text-decoration: none;
  color: var(--ink-900);
}
.nav-recent-pill.brand-helm   { border-left-color: var(--brand-helm); }
.nav-recent-pill.brand-anchor { border-left-color: #1AA86A; }
/* Deploy Q.5 — completed charters get a faded look and a green "✓" prefix
 * (rendered in JS via [data-complete] attr). Finish-date is in the past. */
.nav-recent-pill.is-complete {
  opacity: 0.72;
  background: transparent;
}
.nav-recent-pill.is-complete::before {
  content: "✓ ";
  color: #1AA86A;
  font-weight: 700;
  margin-right: 2px;
}
/* Nav logo — single HELM mark on the left. Sized so the wheel + wordmark read
   clearly at a 56px nav height without dominating. The wordmark is the HELM
   master brand; per-deal brand switching happens via body[data-brand] on
   accent colours (links, buttons, focus glow), not on the logo itself.
   Deploy Q.5 — the HELM and Anchor logos are transparent PNGs with coloured
   art (navy / coral). On a neutral-grey app background they'd be low-contrast
   at best, invisible at worst. We pad them on a white rounded card so the
   navy reads cleanly regardless of body bg. */
.nav-logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  background: #fff;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--ink-100);
}
.nav-logo-link:hover { text-decoration: none; }
.nav-logo-img {
  height: 28px;
  width: auto;
  display: block;
}

/* Legacy selectors kept in case any template still references them; safe to
   remove once every page is confirmed to use the new nav-logo classes. */
.nav-logo {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 15px;
  color: var(--ink-900);
}
.nav-logo .dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--brand-helm);
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: 1px;
}
.nav-links {
  display: flex;
  gap: 4px;
}
.nav-link {
  padding: 8px 12px;
  border-radius: var(--radius);
  color: var(--ink-500);
  font-weight: 500;
  font-size: 13px;
}
.nav-link:hover { color: var(--ink-900); background: var(--ink-50); text-decoration: none; }
.nav-link.active { color: var(--ink-900); background: var(--ink-100); }

.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--ink-500);
  justify-content: flex-end;
}
.nav-user button {
  background: none;
  border: none;
  color: var(--ink-500);
  cursor: pointer;
  font: inherit;
  padding: 4px 8px;
  border-radius: 4px;
}
.nav-user button:hover { color: var(--ink-900); background: var(--ink-50); }

.main {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px;
}

/* ----- Cards ----- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.card-tight { padding: 16px; }
.card + .card { margin-top: 16px; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -4px 0 16px;
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  background: var(--ink-0);
  color: var(--ink-900);
  border-radius: var(--radius);
  font: inherit;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  transition: all 120ms ease;
  text-decoration: none;
}
.btn:hover { border-color: var(--ink-300); box-shadow: var(--shadow-sm); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--ink-900);
  color: var(--ink-0);
  border-color: var(--ink-900);
}
.btn-primary:hover { background: var(--ink-700); border-color: var(--ink-700); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-500); }
.btn-ghost:hover { background: var(--ink-50); color: var(--ink-900); border-color: transparent; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ----- Inputs ----- */
.input, input[type="text"], input[type="email"], input[type="search"] {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font: inherit;
  font-size: 14px;
  background: var(--ink-0);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.input:focus, input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-glow);
}
.input-code {
  font-family: var(--font-mono);
  font-size: 24px;
  text-align: center;
  letter-spacing: 8px;
  padding: 12px;
}

label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-500);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ----- Pills / badges ----- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--ink-100);
  color: var(--ink-700);
}
.pill-ok   { background: var(--ok-bg);   color: var(--ok); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-err  { background: var(--err-bg);  color: var(--err); }
.pill-info { background: var(--info-bg); color: var(--info); }
.pill-na   { background: var(--ink-50);  color: var(--ink-300); }

/* Deploy Q.4 — brand pills made bolder. Solid fills instead of soft tints
 * so they actually stand out in dense lists. HELM keeps its navy blue;
 * Anchor shifts to bright green here (pill only — banners stay coral to
 * match the logo art). */
.pill-brand-helm   {
  background: var(--brand-helm);
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.pill-brand-anchor {
  background: #1AA86A;
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* ----- Tables ----- */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th {
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-500);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}
.table tbody tr:hover { background: var(--ink-50); }
.table tbody tr:last-child td { border-bottom: none; }

/* ----- Status rows (Documents tab) ----- */
.status-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.status-row:last-child { border-bottom: none; }
.status-icon {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
}
.status-icon.ok   { background: var(--ok-bg);   color: var(--ok); }
.status-icon.warn { background: var(--warn-bg); color: var(--warn); }
.status-icon.err  { background: var(--err-bg);  color: var(--err); }
.status-icon.na   { background: var(--ink-50);  color: var(--ink-300); }
.status-label { font-weight: 500; flex: 1; }
.status-detail { color: var(--ink-500); font-size: 13px; }

/* ----- Deal header ----- */
.deal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 24px;
}
.deal-header-meta {
  display: flex;
  gap: 16px;
  margin-top: 6px;
  color: var(--ink-500);
  font-size: 13px;
}
.deal-header-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.deal-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Ticket chip in the deal header — shows open ticket's current stage +
   how long it's been there. Click to open the ticket in HubSpot. Only
   rendered when the deal has an active (non-terminal) ticket. */
.deal-ticket-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--ink-50);
  border: 1px solid var(--border);
  color: var(--ink-700);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: all 120ms ease;
}
.deal-ticket-chip:hover {
  background: var(--brand-tint);
  color: var(--brand-primary);
  border-color: var(--brand-primary);
  text-decoration: none;
}
.deal-ticket-chip-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-500);
}
.deal-ticket-chip:hover .deal-ticket-chip-label { color: var(--brand-primary); }
.deal-ticket-chip-sep { color: var(--ink-200); }
.deal-ticket-chip-days { color: var(--ink-500); font-size: 11px; }
.deal-ticket-chip-arrow { font-size: 11px; }

.breadcrumb {
  color: var(--ink-500);
  font-size: 13px;
  margin-bottom: 12px;
}
.breadcrumb a { color: var(--ink-500); }
.breadcrumb .sep { margin: 0 8px; color: var(--ink-200); }

/* ----- Tabs ----- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.tab {
  padding: 10px 16px;
  border: none;
  background: none;
  font: inherit;
  font-weight: 500;
  font-size: 13px;
  color: var(--ink-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--ink-900); }
.tab.active { color: var(--ink-900); border-bottom-color: var(--ink-900); }

/* Deploy AT — Booking confirmation tab. Subtle amber tint to flag that this
   tab demands an action (the deal is in a pre-booking stage and ops needs
   to confirm before the booking is real). Removed when the deal stage
   advances after confirmation, since the tab itself disappears. */
.tab.tab-action-required {
  color: #b07900;
  font-weight: 600;
  position: relative;
}
.tab.tab-action-required::before {
  content: '';
  position: absolute;
  top: 6px;
  right: 4px;
  width: 6px;
  height: 6px;
  background: #f59e0b;
  border-radius: 50%;
}
.tab.tab-action-required:hover { color: #8a5a00; }
.tab.tab-action-required.active {
  color: #8a5a00;
  border-bottom-color: #f59e0b;
}

/* ----- Sign-in ----- */
.signin-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 10% 10%, rgba(0,0,220,0.04), transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(26,122,110,0.03), transparent 40%),
    var(--bg);
}
.signin-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-lg);
}
.signin-card h1 {
  font-size: 20px;
  margin-bottom: 6px;
}
.signin-card .subtitle {
  color: var(--ink-500);
  margin: 0 0 24px;
  font-size: 13px;
}
.signin-card .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
}
.signin-card .logo .dot {
  width: 10px; height: 10px;
  background: var(--brand-helm);
  border-radius: 50%;
}
.signin-form { display: flex; flex-direction: column; gap: 14px; }
.signin-form .btn { justify-content: center; padding: 11px; }

/* ----- Stat cards ----- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
/* Deploy Q.7 (restore) — stat tiles on the home dashboard are clickable
 * anchors (wired in index.html as <a class="stat stat-tile">). Give them
 * a subtle brand-tinted background so they stand out as interactive and
 * match the overall app blue palette. Hover lifts the tint slightly; the
 * coloured left-rule reinforces which workstream each tile belongs to. */
.stat-tile {
  display: block;
  text-decoration: none;
  color: inherit;
  background:
    linear-gradient(180deg, rgba(0, 0, 220, 0.05), rgba(0, 0, 220, 0.02)),
    var(--surface);
  border-color: rgba(0, 0, 220, 0.12);
  border-left: 3px solid var(--brand-helm);
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}
.stat-tile:hover {
  background:
    linear-gradient(180deg, rgba(0, 0, 220, 0.09), rgba(0, 0, 220, 0.04)),
    var(--surface);
  border-color: rgba(0, 0, 220, 0.22);
  text-decoration: none;
  color: inherit;
  transform: translateY(-1px);
}
.stat-tile:active {
  transform: translateY(0);
}
.stat-tile .stat-value.live {
  color: var(--brand-helm);
}
.stat-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.stat-value {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.stat-value.placeholder { color: var(--ink-200); }

/* ----- Utility ----- */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.text-muted { color: var(--ink-500); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.hidden { display: none !important; }

/* ----- States ----- */
.empty, .loading, .error {
  padding: 48px 24px;
  text-align: center;
  color: var(--ink-500);
  font-size: 13px;
}
.error { color: var(--err); }

.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid var(--ink-100);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
  vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink-900);
  color: var(--ink-0);
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  animation: toast-in 200ms ease;
}
.toast.err { background: var(--err); }
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ----- Comms tab ------------------------------------------------------- */
/* Contact rows: compact by default. Email is the prominent operational
   field (it's what gets used for outbound sends), so it's the visual
   feature of each row, not a secondary detail. */
.contact-list {
  display: flex;
  flex-direction: column;
}
.contact-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.contact-row:last-child { border-bottom: none; }
.contact-main { flex: 1; min-width: 0; }
.contact-name {
  font-weight: 500;
  color: var(--ink-900);
  margin-bottom: 2px;
}
.contact-email {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--brand-primary);
  word-break: break-all;
}
.contact-phone {
  margin-top: 2px;
}
.contact-phone a { color: var(--ink-700); }
.contact-details-btn { flex-shrink: 0; }

/* Email list */
.email-list {
  display: flex;
  flex-direction: column;
}
.email-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 120ms ease;
}
.email-row:last-child { border-bottom: none; }
.email-row:hover { background: var(--ink-50); margin: 0 -12px; padding: 12px; border-radius: var(--radius); }
.email-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.email-dir {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-500);
  flex-shrink: 0;
}
.email-dir.inbound  { color: var(--info); }
.email-dir.outbound { color: var(--ok); }
.email-counterparty {
  font-size: 13px;
  color: var(--ink-700);
  font-family: var(--font-mono);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.email-time { flex-shrink: 0; }
.email-subject {
  font-weight: 500;
  margin-bottom: 3px;
}
.email-preview {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.email-body {
  margin-top: 12px;
  padding: 12px;
  background: var(--ink-50);
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.55;
  max-height: 480px;
  overflow-y: auto;
}
.email-body img { max-width: 100%; height: auto; }

/* ----- Modal ----------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 11, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: modal-fade 120ms ease;
}
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow: auto;
  margin: 16px;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 16px; }
.modal-close { font-size: 20px; line-height: 1; padding: 2px 8px; }
.modal-body { padding: 16px 20px 20px; }

.detail-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  margin: 0;
}
.detail-list dt {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  align-self: center;
}
.detail-list dd {
  margin: 0;
  font-size: 14px;
  word-break: break-word;
}

/* ----- Compose modal --------------------------------------------------- */
.modal-wide { max-width: 640px; }

.modal-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--ink-50);
}

.comms-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}
/* Primary button uses brand-primary on deal pages so Anchor deals get teal
   CTAs, HELM deals get blue. */
body[data-brand] .btn-primary,
.comms-actions .btn-primary {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--ink-0);
}
body[data-brand] .btn-primary:hover,
.comms-actions .btn-primary:hover {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  opacity: 0.92;
}

.compose-section {
  margin-bottom: 20px;
}
.compose-section:last-child { margin-bottom: 0; }

.compose-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.compose-sublabel {
  display: block;
  font-size: 11px;
  color: var(--ink-500);
  margin-bottom: 4px;
}

.compose-textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  background: var(--ink-0);
  resize: vertical;
  min-height: 44px;
}
.compose-textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

.compose-meta {
  padding: 12px 14px;
  background: var(--ink-50);
  border-radius: var(--radius);
  font-size: 13px;
}

.recipient-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 220px;
  overflow-y: auto;
}
.recipient-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 13px;
}
.recipient-row:last-child { border-bottom: none; }
.recipient-row:hover { background: var(--ink-50); }
.recipient-check { margin: 0; flex-shrink: 0; }
.recipient-name { font-weight: 500; flex-shrink: 0; }
.recipient-email {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-500);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recipient-row .pill {
  background: var(--ink-100);
  color: var(--ink-700);
  flex-shrink: 0;
}

/* ----- Payables page ---------------------------------------------------- */
.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  align-items: center;
  margin-bottom: 16px;
}
.chip-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.chip-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 6px;
}
/* Deploy Q.2 — inactive chips now show no border, giving a clear
 * foreground/background contrast vs the selected one. Selected state
 * is a solid brand-primary pill that visually pops, so ops can tell
 * at a glance which filter is on. */
.chip {
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink-500);
  padding: 5px 12px;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
  white-space: nowrap;
}
.chip:hover {
  background: var(--ink-50);
  color: var(--ink-900);
}
.chip.active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--ink-0);
  box-shadow: 0 1px 3px rgba(0,0,40,0.14);
}
.chip.active:hover {
  background: var(--brand-primary);
  color: var(--ink-0);
}

.totals-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
}
.totals-main {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.totals-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--ink-50);
  border-radius: var(--radius);
  font-size: 13px;
}
.totals-chip .ccy {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--ink-500);
}
.totals-aside {
  font-size: 13px;
  color: var(--ink-500);
}
.totals-aside .text-warn { color: var(--warn); }

.payables-table { font-size: 13px; }
.payables-table th.num, .payables-table td.num { text-align: right; white-space: nowrap; }
.payables-table .deal-link {
  color: var(--ink-900);
  text-decoration: none;
}
.payables-table .deal-link:hover { color: var(--brand-primary); }

.payables-table .row-warning td {
  border-left: 0;
}
.payables-table .row-warning td:first-child {
  border-left: 3px solid var(--warn);
  padding-left: 9px;
}
.payables-table .row-overdue td:first-child {
  border-left: 3px solid var(--err);
  padding-left: 9px;
}

/* ----- Per-cell hover shading (Deploy AA.1) -----
   Whole-row hover gets a soft background; the cell under the cursor
   gets a stronger one. This makes columns feel scannable and the
   page feel responsive without being noisy. Applied to both
   payables and receivables tables. */
.payables-table tbody tr:hover,
.receivables-table tbody tr:hover {
  background: var(--ink-50);
}
.payables-table tbody td,
.receivables-table tbody td {
  transition: background-color 0.08s ease-out;
}
.payables-table tbody td:hover,
.receivables-table tbody td:hover {
  background: var(--ink-100);
}
/* Cells whose entire purpose is to navigate or trigger an action
   should look clickable. The cell-link wrapper takes the whole TD
   (so the click target matches the hover area visually). */
.cell-link {
  display: block;
  margin: -12px;          /* cancel TD padding so hover area is the cell */
  padding: 12px;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.cell-link:hover { color: var(--brand-primary); }
.cell-link.is-button {
  /* For elements that need to be <button> not <a> (e.g. invoice
     preview triggers). Reset native button styles. */
  background: none;
  border: 0;
  font: inherit;
  text-align: left;
  width: 100%;
}
/* Smaller "View invoice ↗" affordance — typically tucked under a
   reference cell so the eye sees the reference first and the link
   second. */
.view-invoice-link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  color: var(--ink-500);
  text-decoration: none;
  margin-top: 2px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}
.view-invoice-link:hover {
  color: var(--brand-primary);
  text-decoration: underline;
}

.overdue-d { color: var(--err); font-weight: 500; }

.collapsible-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: inherit;
}
.collapsible-head:hover { color: var(--brand-primary); }

/* ----- Receivables page ------------------------------------------------ */
.bulk-action-bar {
  position: sticky;
  top: 56px;
  z-index: 5;
  background: var(--brand-primary);
  color: var(--ink-0);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
}
.bulk-action-bar.hidden { display: none; }
.bulk-bar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  font-size: 14px;
}
.bulk-bar-inner .btn {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--ink-0);
}
.bulk-bar-inner .btn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
}
.bulk-bar-inner .btn-primary {
  background: var(--ink-0);
  color: var(--brand-primary);
  border-color: var(--ink-0);
  font-weight: 600;
}
.bulk-bar-inner .btn-primary:hover {
  background: var(--ink-50);
  border-color: var(--ink-50);
}

.receivables-table th.num, .receivables-table td.num { text-align: right; white-space: nowrap; }
.receivables-table .deal-link {
  color: var(--ink-900);
  text-decoration: none;
}
.receivables-table .deal-link:hover { color: var(--brand-primary); }
.receivables-table .row-overdue td:first-child {
  border-left: 3px solid var(--err);
  padding-left: 9px;
}
.receivables-table .pill-ok {
  background: var(--ok-bg);
  color: var(--ok);
}

/* Bulk-send preview list inside the compose modal */
.alert-warn {
  padding: 12px 16px;
  background: var(--warn-bg);
  color: var(--warn);
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.5;
}

.bulk-preview-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 280px;
  overflow-y: auto;
}
.bulk-preview-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.bulk-preview-row:last-child { border-bottom: none; }
.bulk-preview-row.has-issues {
  background: var(--warn-bg);
}
.bulk-preview-main { flex: 1; min-width: 0; }
.bulk-preview-name {
  font-weight: 500;
  font-size: 13px;
  color: var(--ink-900);
  margin-bottom: 2px;
}
.bulk-issues {
  margin-top: 4px;
  font-size: 12px;
  color: var(--warn);
  font-weight: 500;
}

/* ----- Responsive ----- */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .main { padding: 20px 16px; }
  .nav { padding: 0 16px; gap: 16px; }
  .nav-links .nav-link { padding: 6px 10px; font-size: 12px; }
  .deal-header { flex-direction: column; }
}
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------------
   Deal Timeline tab — compose-on-read audit trail
   --------------------------------------------------------------------------- */
.timeline-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}
.timeline-header h2 { margin: 0; }
.timeline-meta { color: var(--ink-500); font-size: 13px; }

.timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.timeline-event {
  display: grid;
  grid-template-columns: 110px 28px 1fr;
  column-gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}
.timeline-event:last-child { border-bottom: none; }
.timeline-event.has-detail { cursor: pointer; }
.timeline-event.has-detail:hover .timeline-title { color: var(--brand-primary); }

.timeline-when {
  font-size: 12px;
  color: var(--ink-500);
  line-height: 1.5;
}
.timeline-when-abs {
  font-family: var(--font-mono);
  color: var(--ink-300);
  display: block;
  font-size: 11px;
  margin-top: 2px;
}

.timeline-dot {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.timeline-dot.neutral { background: var(--ink-100); color: var(--ink-700); }
.timeline-dot.blue    { background: var(--info-bg); color: var(--info); }
.timeline-dot.green   { background: var(--ok-bg);   color: var(--ok); }
.timeline-dot.amber   { background: var(--warn-bg); color: var(--warn); }

.timeline-body { min-width: 0; }
.timeline-title {
  font-weight: 500;
  color: var(--ink-900);
  line-height: 1.4;
  word-wrap: break-word;
}
.timeline-actor {
  font-size: 12px;
  color: var(--ink-500);
  margin-top: 2px;
}
.timeline-detail {
  display: none;
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--ink-50);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--ink-700);
  white-space: pre-wrap;
  word-wrap: break-word;
}
.timeline-event.expanded .timeline-detail { display: block; }
.timeline-event.expanded .timeline-title::after {
  content: '';
}

.timeline-empty {
  padding: 32px 0;
  text-align: center;
  color: var(--ink-500);
}

@media (max-width: 600px) {
  .timeline-event {
    grid-template-columns: 24px 1fr;
    grid-template-areas:
      "dot body"
      "when when";
    row-gap: 6px;
  }
  .timeline-when { grid-area: when; order: 2; }
  .timeline-dot  { grid-area: dot; }
  .timeline-body { grid-area: body; }
  .timeline-when-abs { display: inline; margin-left: 6px; }
}

/* =============================================================================
   Deploy K — Charter Brief (Documents tab two-column layout + brief card)
   ============================================================================= */

/* Two-column layout on the Documents tab: left = existing docs + quick actions,
   right = new Charter Brief card. Collapses to single column with Brief on top
   on mobile, per Layout B. */
.docs-brief-layout {
  display: grid;
  grid-template-columns: minmax(0, 55fr) minmax(0, 45fr);
  gap: 16px;
  align-items: start;
}
.docs-brief-layout > .docs-col { min-width: 0; }
.docs-brief-layout > .brief-col { min-width: 0; }
@media (max-width: 960px) {
  .docs-brief-layout {
    grid-template-columns: 1fr;
  }
  /* On mobile the Brief stacks ABOVE docs so ops sees critical flags
     before scrolling past status rows. */
  .docs-brief-layout > .brief-col { order: -1; }
}

/* Repeat-client chip in the deal header */
.repeat-client-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--info-bg);
  color: var(--info);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  cursor: help;
}
.repeat-client-chip .sep {
  opacity: 0.5;
}

/* Broker line in header meta */
.broker-line {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Flag categories */
.flag-category {
  margin-top: 12px;
}
.flag-category:first-child { margin-top: 0; }
.flag-category-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-400);
  font-weight: 600;
}
.flag-category-header .count {
  background: var(--ink-50);
  color: var(--ink-500);
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0;
  text-transform: none;
}
.flag-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.flag-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--ink-100);
  border-radius: 8px;
  background: var(--surface, #fff);
  transition: background 120ms ease, border-color 120ms ease, opacity 120ms ease;
}
.flag-item.is-actioned {
  background: var(--ok-bg);
  border-color: transparent;
  opacity: 0.75;
}
.flag-item.is-actioned .flag-label {
  text-decoration: line-through;
  color: var(--ink-400);
}
.flag-item-body {
  flex: 1;
  min-width: 0;
}
.flag-label {
  font-weight: 500;
  font-size: 13px;
  color: var(--ink-900);
  margin-bottom: 2px;
  word-wrap: break-word;
}
.flag-detail {
  font-size: 12px;
  color: var(--ink-500);
  line-height: 1.4;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.flag-meta {
  font-size: 11px;
  color: var(--ink-300);
  margin-top: 4px;
}
.flag-action-btn {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--ink-200);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--ink-500);
  cursor: pointer;
  transition: all 120ms ease;
}
.flag-action-btn:hover {
  border-color: var(--ink-400);
  color: var(--ink-900);
}
.flag-action-btn.is-done {
  background: var(--ok);
  border-color: var(--ok);
  color: white;
}
.flag-action-btn.is-done:hover {
  background: transparent;
  color: var(--ok);
}

/* Internal notes */
.notes-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--ink-100);
}
.notes-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.notes-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-400);
  font-weight: 600;
}
.note-composer {
  margin-bottom: 12px;
}
.note-composer textarea {
  width: 100%;
  min-height: 70px;
  padding: 10px 12px;
  border: 1px solid var(--ink-200);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink-900);
  background: var(--surface, #fff);
  resize: vertical;
  line-height: 1.4;
  box-sizing: border-box;
}
.note-composer textarea:focus {
  outline: none;
  border-color: var(--ink-400);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
}
.note-composer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  justify-content: flex-end;
}
.notes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.note-item {
  padding: 10px 12px;
  border: 1px solid var(--ink-100);
  border-radius: 8px;
  background: var(--surface, #fff);
}
.note-item.is-pinned {
  border-color: rgba(255, 184, 0, 0.5);
  background: rgba(255, 184, 0, 0.04);
}
.note-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 11px;
}
.note-author {
  font-weight: 600;
  color: var(--ink-900);
}
.note-timestamp {
  color: var(--ink-400);
  margin-left: 6px;
}
.note-body {
  font-size: 13px;
  color: var(--ink-900);
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.note-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.note-action-btn {
  background: none;
  border: none;
  color: var(--ink-400);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 120ms ease, background 120ms ease;
}
.note-action-btn:hover {
  color: var(--ink-900);
  background: var(--ink-50);
}
.note-action-btn.pin-active {
  color: rgb(191, 133, 0);
}

.brief-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--ink-400);
  font-size: 13px;
  border: 1px dashed var(--ink-100);
  border-radius: 8px;
}

.brief-loading {
  padding: 24px 16px;
  text-align: center;
  color: var(--ink-400);
  font-size: 13px;
}

/* =============================================================================
   Deploy L — Client card, skipper, transfer, flight cards
   ============================================================================= */

/* The brief column is a stack of cards. Give them consistent spacing. */
.brief-col > * + * { margin-top: 12px; }

/* Urgency states — applied to a card wrapper to colour-code its border.
   Used by skipper + transfer cards when charter is close and work is
   incomplete. Colours come from the existing CSS vars. */
.urgency-red {
  border-color: var(--err);
  box-shadow: 0 0 0 3px var(--err-bg);
}
.urgency-amber {
  border-color: var(--warn);
  box-shadow: 0 0 0 3px var(--warn-bg);
}
.urgency-green {
  border-color: var(--ok);
}

.urgency-label {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.urgency-label.red   { background: var(--err-bg);  color: var(--err); }
.urgency-label.amber { background: var(--warn-bg); color: var(--warn); }
.urgency-label.green { background: var(--ok-bg);   color: var(--ok); }
.urgency-label.neutral { background: var(--ink-50); color: var(--ink-500); }

/* Client card */
.client-card-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.client-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ink-50);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-500);
  flex-shrink: 0;
}
.client-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-900);
  margin-bottom: 1px;
}
.client-email {
  font-size: 11px;
  color: var(--ink-500);
  word-break: break-all;
}

/* The strong repeat-client chip used inside the client card.
   The existing .repeat-client-chip in the header stays subtle; this
   version is the highlighted one Simon asked for. */
.repeat-client-chip-strong {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--info);
  color: white;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: help;
}
.repeat-client-chip-strong .sep { opacity: 0.6; }

/* 2-col grid inside client card for detail rows */
.client-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px 16px;
  padding-top: 10px;
  border-top: 1px solid var(--ink-100);
}
@media (min-width: 600px) {
  .client-detail-grid { grid-template-columns: 1fr 1fr; }
}
.client-detail-row {
  display: flex;
  gap: 8px;
  font-size: 12px;
  padding: 3px 0;
}
.client-detail-label {
  color: var(--ink-400);
  flex-shrink: 0;
  min-width: 60px;
}
.client-detail-value {
  color: var(--ink-900);
  word-break: break-word;
}

/* Flight card */
.flight-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--ink-100);
}
.flight-row:last-child { border-bottom: none; }
.flight-row:first-child { padding-top: 0; }
.flight-no {
  font-family: var(--mono, monospace);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 6px;
  background: var(--ink-50);
  border-radius: 4px;
  white-space: nowrap;
}
.flight-details {
  font-size: 12px;
  color: var(--ink-900);
  min-width: 0;
}
.flight-notes {
  font-size: 11px;
  color: var(--ink-500);
  margin-top: 2px;
  line-height: 1.3;
}
.flight-time {
  font-size: 12px;
  color: var(--ink-500);
  white-space: nowrap;
}

/* Transfer workflow card — three stages stacked */
.transfer-stage {
  padding: 10px 12px;
  border: 1px solid var(--ink-100);
  border-radius: 8px;
  margin-top: 8px;
}
.transfer-stage:first-child { margin-top: 0; }
.transfer-stage.is-done {
  background: var(--ok-bg);
  border-color: transparent;
}
.transfer-stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.transfer-stage-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-400);
  font-weight: 600;
}
.transfer-stage.is-done .transfer-stage-title {
  color: var(--ok);
}
.transfer-stage-body {
  font-size: 12px;
  color: var(--ink-900);
  line-height: 1.4;
}
.transfer-stage-meta {
  font-size: 11px;
  color: var(--ink-400);
  margin-top: 4px;
}
.transfer-stage-empty {
  font-size: 12px;
  color: var(--ink-300);
  font-style: italic;
}
.transfer-stage textarea {
  width: 100%;
  min-height: 48px;
  margin-top: 6px;
  padding: 6px 8px;
  font-family: inherit;
  font-size: 12px;
  border: 1px solid var(--ink-200);
  border-radius: 6px;
  resize: vertical;
  box-sizing: border-box;
  color: var(--ink-900);
  background: white;
  line-height: 1.4;
}
.transfer-stage-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 6px;
}

/* Skipper card */
.skipper-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.skipper-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.skipper-field label {
  font-size: 11px;
  color: var(--ink-400);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.skipper-field input {
  padding: 6px 8px;
  border: 1px solid var(--ink-200);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  box-sizing: border-box;
  color: var(--ink-900);
  background: white;
}
.skipper-field input:focus {
  outline: none;
  border-color: var(--ink-400);
}
.skipper-meta {
  font-size: 11px;
  color: var(--ink-400);
  margin-top: 6px;
}

/* Header meta tweaks for broker + ops specialist */
.deal-header-meta .person-line {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.deal-header-meta .person-line + .person-line::before {
  content: "·";
  color: var(--ink-300);
  margin: 0 8px 0 0;
}

/* =============================================================================
   Deploy M — Quick actions strip, payment pills, bookings modal,
   flight edit, payment summary card
   ============================================================================= */

/* Persistent quick actions strip — sits between header and tabs */
.quick-actions-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 0;
  border-bottom: 1px solid var(--ink-100);
  margin-bottom: 4px;
}
.quick-actions-strip .btn {
  font-size: 12px;
  padding: 5px 10px;
}

/* Payment pills in header meta row */
.payment-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 120ms ease;
}
.payment-pill:hover { opacity: 0.8; }
.payment-pill.client   { background: var(--ok-bg);   color: var(--ok); }
.payment-pill.supplier { background: var(--warn-bg); color: var(--warn); }
.payment-pill.client.is-overdue,
.payment-pill.supplier.is-overdue {
  background: var(--err-bg);
  color: var(--err);
}
.payment-pill.is-paid {
  opacity: 0.7;
}

/* Payment summary mini-card (right column, non-Payment tabs) */
.payment-mini-card .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.payment-mini-card .row:last-of-type { margin-bottom: 0; }
.payment-mini-card .row-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-500);
}
.payment-mini-card .side-pill {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.payment-mini-card .side-pill.client { background: var(--ok-bg); color: var(--ok); }
.payment-mini-card .side-pill.supplier { background: var(--warn-bg); color: var(--warn); }
.payment-mini-card .row-amount {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-900);
}
.payment-mini-card .progress-bar {
  height: 3px;
  background: var(--ink-50);
  border-radius: 2px;
  overflow: hidden;
  margin: 2px 0 8px;
}
.payment-mini-card .progress-fill {
  height: 100%;
  transition: width 200ms ease;
}
.payment-mini-card .progress-fill.client   { background: var(--ok); }
.payment-mini-card .progress-fill.supplier { background: var(--warn); }
.payment-mini-card .next-due {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--ink-500);
  padding-top: 8px;
  border-top: 1px solid var(--ink-100);
}
.payment-mini-card .view-link {
  font-size: 11px;
  color: var(--ink-400);
  text-decoration: none;
}
.payment-mini-card .view-link:hover {
  color: var(--ink-900);
  text-decoration: underline;
}

/* Flight edit row + add button */
.flight-row.is-edit {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr auto auto;
  gap: 6px;
  align-items: center;
  padding: 8px 0;
}
.flight-row.is-edit input {
  padding: 5px 8px;
  font-size: 12px;
  border: 1px solid var(--ink-200);
  border-radius: 6px;
  background: white;
  font-family: inherit;
  color: var(--ink-900);
  min-width: 0;
}
.flight-row.is-edit input:focus {
  outline: none;
  border-color: var(--ink-400);
}
.flight-source-badge {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--ink-50);
  color: var(--ink-400);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-right: 6px;
}
.flight-source-badge.manual {
  background: var(--info-bg);
  color: var(--info);
}
.flight-row-actions {
  display: flex;
  gap: 4px;
}
.flight-row-actions button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-400);
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
}
.flight-row-actions button:hover {
  color: var(--ink-900);
  background: var(--ink-50);
}
.flight-add-row {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--ink-100);
  text-align: center;
}

/* Client name is clickable (opens bookings modal) */
.client-name-clickable {
  cursor: pointer;
  transition: color 120ms ease;
}
.client-name-clickable:hover {
  color: var(--info);
  text-decoration: underline;
}

/* Bookings modal list */
.booking-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 4px;
}
.booking-list-item {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--ink-100);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: all 120ms ease;
}
.booking-list-item:hover {
  border-color: var(--ink-300);
  background: var(--ink-50);
  text-decoration: none;
}
.booking-list-item.is-current {
  background: var(--info-bg);
  border-color: var(--info);
  pointer-events: none;
  cursor: default;
}
.booking-list-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.booking-list-item-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-900);
}
.booking-list-item-meta {
  font-size: 11px;
  color: var(--ink-500);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.booking-list-item-meta .sep { opacity: 0.5; }

/* Manual transfer stage edit */
.transfer-stage-edit-toggle {
  background: none;
  border: none;
  color: var(--ink-400);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.transfer-stage-edit-toggle:hover {
  color: var(--ink-900);
  background: var(--ink-50);
}

/* =============================================================================
   Deploy N — Charter checklist card
   ============================================================================= */

.checklist-item {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  font-size: 12px;
}
.checklist-item + .checklist-item {
  border-top: 1px solid var(--ink-100);
}
.checklist-checkbox {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--ink-300);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  font-size: 11px;
  transition: all 120ms ease;
  background: white;
}
.checklist-checkbox:hover {
  border-color: var(--ink-500);
}
.checklist-checkbox.is-done {
  background: var(--ok);
  border-color: var(--ok);
}
.checklist-checkbox.is-na {
  background: var(--ink-50);
  border-color: var(--ink-100);
  cursor: not-allowed;
  color: var(--ink-300);
}
.checklist-checkbox.is-busy {
  opacity: 0.5;
  pointer-events: none;
}
.checklist-label {
  color: var(--ink-900);
  word-wrap: break-word;
}
.checklist-item.is-na .checklist-label {
  color: var(--ink-300);
}
.checklist-item.is-done .checklist-label {
  color: var(--ink-400);
  text-decoration: line-through;
}
.checklist-meta {
  font-size: 11px;
  color: var(--ink-400);
  text-align: right;
  white-space: nowrap;
}
.checklist-tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.checklist-tag.na        { background: var(--ink-50); color: var(--ink-400); }
.checklist-tag.expected  { background: var(--warn-bg); color: var(--warn); }
.checklist-tag.done      { background: var(--ok-bg);   color: var(--ok); }

/* =============================================================================
   Deploy O — HubSpot records row (deal + ticket links below meta)
   ============================================================================= */
.hs-records-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--ink-100);
}
.hs-record-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--ink-100);
  border-radius: 6px;
  background: var(--bg);
  font-size: 11px;
  color: var(--ink-700);
  text-decoration: none;
  transition: all 120ms ease;
}
.hs-record-chip:hover:not(.hs-record-chip-disabled) {
  border-color: var(--ink-300);
  background: white;
  color: var(--ink-900);
}
.hs-record-chip-kind {
  font-weight: 600;
  color: var(--ink-900);
  letter-spacing: 0.02em;
}
.hs-record-chip-deal .hs-record-chip-kind { color: #0000DC; }
.hs-record-chip-ticket .hs-record-chip-kind { color: #A85D00; }
.hs-record-chip-sep { color: var(--ink-300); }
.hs-record-chip-id { color: var(--ink-500); font-size: 10.5px; }
.hs-record-chip-days {
  padding: 1px 6px;
  background: var(--warn-bg);
  color: var(--warn);
  border-radius: 999px;
  font-weight: 500;
  font-size: 10px;
}
.hs-record-chip-arrow {
  color: var(--ink-400);
  margin-left: 2px;
}
.hs-record-chip:hover .hs-record-chip-arrow { color: var(--ink-700); }
.hs-record-chip-disabled {
  opacity: 0.55;
  cursor: default;
}

/* =============================================================================
   Deploy O — Header redesign (brand banner + essentials grid + readiness ring)
   ============================================================================= */

/* V2 header container — replaces the old .deal-header flex row */
.deal-header-v2 {
  background: white;
  border: 1px solid var(--ink-100);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
}

/* Brand banner ribbon — coloured background with logo on left, deal id on right */
.brand-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  min-height: 72px;
  border-bottom: 1px solid var(--ink-100);
}
.brand-banner-logo {
  height: 48px;
  width: auto;
  max-width: 320px;
  object-fit: contain;
  display: block;
}
.brand-banner-dealid {
  font-size: 11px;
  color: var(--ink-500);
  letter-spacing: 0.04em;
}
.brand-banner-fallback {
  background: var(--ink-100);
  color: var(--ink-700);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
}
.brand-banner-fallback .brand-banner-dealid {
  color: var(--ink-500);
}

/* Header body below the banner */
.deal-header-body {
  padding: 14px 16px 16px;
}
.deal-header-body h1 {
  font-size: 22px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}

/* Essentials grid — 4-column labelled data cells */
.essentials-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 8px;
  margin-top: 10px;
}
.essential-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.essential-label {
  font-size: 9px;
  color: var(--ink-400);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.essential-value {
  font-size: 13px;
  color: var(--ink-900);
  font-weight: 500;
  word-wrap: break-word;
  min-width: 0;
}
.essential-value-big {
  font-size: 16px;
  line-height: 1.2;
}
.essential-sub {
  font-size: 11px;
  color: var(--ink-500);
  font-weight: 400;
}

/* Readiness ring cell — slightly different layout (svg + text side-by-side) */
.essential-cell-ring {
  flex-direction: row !important;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  cursor: pointer;
  border-radius: 6px;
  padding: 2px 4px;
  transition: background 120ms ease;
}
.essential-cell-ring:hover {
  background: white;
}
.essential-cell-ring-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

/* Deal header meta row (operator/broker/payment pills) */
.deal-header-v2 .deal-header-meta {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
  font-size: 12px;
  color: var(--ink-700);
}

/* Link buttons row inside header-body */
.deal-header-v2 .deal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--ink-100);
}

/* Quick actions strip — grouped with category labels + separators */
.quick-actions-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  background: white;
  border: 1px solid var(--ink-100);
  border-radius: 10px;
  margin-bottom: 16px;
}
.qa-group-label {
  font-size: 9px;
  color: var(--ink-400);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  align-self: center;
  padding-right: 2px;
}
.qa-sep {
  width: 1px;
  height: 20px;
  background: var(--ink-100);
  margin: 0 4px;
  align-self: center;
}

/* Responsive: on narrower screens stack the essentials to 2 columns */
@media (max-width: 900px) {
  .essentials-row {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 560px) {
  .essentials-row {
    grid-template-columns: 1fr;
  }
}

/* =============================================================================
   Deploy O — Full-width Charter Brief below the two-column layout
   ============================================================================= */

.full-width-brief-layout {
  margin-top: 16px;
}

/* 2-column flag grid when flags live in the full-width section.
   Use grid auto-fit so it gracefully falls back to 1-column on narrow views. */
.full-width-brief-layout .flag-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
}

/* When brief is full-width, split flags (2-up) and notes (full width below)
   into their own sections inside the card. */
.full-width-brief-layout .flag-category {
  min-width: 0;
}

/* Deploy Q.3 — new full-colour logos on white background. Both brands get
   the same 48px height; Anchor's wordmark is wider so max-width ceilings
   the overall footprint. */
.brand-banner-anchor .brand-banner-logo,
.brand-banner-helm .brand-banner-logo {
  height: 48px;
}

/* =============================================================================
   Deploy P — Overview tab layout: three paired rows + full-width Charter brief
   ============================================================================= */

/* Two-column grid with equal-height rows. Each .pair-slot wraps a card so
   the card can flex to fill the cell; .pair-card inside flexes column so
   content distributes top-to-bottom without collapsing. */
.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}
.pair-slot {
  min-width: 0;
  display: flex;
}
.pair-slot > .pair-card,
.pair-slot > .card {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Skipper spans full width below the grid, when applicable. Hidden when
   renderSkipperCard returns ''. */
.overview-skipper-row {
  margin-top: 16px;
}
.overview-skipper-row:empty {
  display: none;
  margin-top: 0;
}

/* Deploy P — "View all N bookings" action pinned to bottom of Customer card
   so the card fills its pair-slot height uniformly. */
.client-card-actions {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--ink-100);
}
.client-card-actions .btn {
  width: 100%;
  justify-content: center;
  text-align: center;
}

/* On narrow viewports drop to single column. */
@media (max-width: 960px) {
  .overview-grid {
    grid-template-columns: 1fr;
  }
}

/* Deploy Q.1 — inline HubSpot link beside client email */
.client-hs-link {
  color: var(--ink-500);
  font-size: 11px;
  margin-left: 8px;
  text-decoration: none;
  padding: 1px 6px;
  background: var(--ink-50);
  border-radius: 4px;
  transition: background 120ms ease;
}
.client-hs-link:hover {
  background: var(--ink-100);
  color: var(--ink-900);
}

/* Deploy Q.2 — status pills on home page deal cards */
.qv-row-status {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.qv-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 1px 8px;
  border-radius: 10px;
  line-height: 16px;
  white-space: nowrap;
}
.qv-pill-ok      { background: #e3f5e8; color: #1D5C3A; }
.qv-pill-warn    { background: #fef3d6; color: #854F0B; }
.qv-pill-err     { background: #fbe2e2; color: #8a1f1f; }
.qv-pill-neutral { background: var(--ink-100); color: var(--ink-700); }

/* Deploy Q.2 — plain link (no underline, inherits size/colour) for
 * clickable table cells like invoice contact name */
.btn-link-plain {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.btn-link-plain:hover {
  color: var(--brand-primary);
  text-decoration: underline;
}

/* Deploy Q.2 — btn-icon for small inline action (like 🔗 unlink) */
.btn-icon {
  background: transparent;
  border: 1px solid transparent;
  padding: 2px 6px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  color: var(--ink-500);
  margin-left: 4px;
  transition: all 120ms ease;
}
.btn-icon:hover {
  background: #fbe2e2;
  border-color: #e4a5a5;
  color: #8a1f1f;
}

/* Deploy Q.4 — inline search results on home page (nav-driven search) */
.search-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px 8px;
}
.search-results .search-empty {
  padding: 20px;
  text-align: center;
  color: var(--ink-500);
}

/* Deploy Q.5 — payment mini card: margin row + basis toggle */
.payment-mini-card .margin-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--ink-50);
  border-radius: 6px;
  margin-bottom: 10px;
}
.payment-mini-card .margin-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-700);
}
.payment-mini-card .margin-basis {
  color: var(--ink-500);
  font-weight: 400;
}
.payment-mini-card .margin-amount {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-weight: 600;
  font-size: 14px;
}
.payment-mini-card .margin-pos { color: #1D5C3A; }
.payment-mini-card .margin-neg { color: #8a1f1f; }

.basis-toggle {
  display: inline-flex;
  background: var(--ink-100);
  border-radius: 999px;
  padding: 2px;
  gap: 0;
}
.basis-btn {
  background: transparent;
  border: 0;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-500);
  border-radius: 999px;
  cursor: pointer;
  transition: all 120ms ease;
}
.basis-btn:hover { color: var(--ink-900); }
.basis-btn.is-active {
  background: var(--ink-0);
  color: var(--ink-900);
  box-shadow: 0 1px 2px rgba(0,0,40,0.12);
}

/* Deploy Q.6 — global nav search dropdown */
.nav-search { position: relative; }
.nav-search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--ink-0);
  border: 1px solid var(--ink-100);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 40, 0.12);
  max-height: 560px;
  overflow-y: auto;
  z-index: 50;
  padding: 4px;
}
.nav-search-dropdown[hidden] { display: none; }
.nav-search-count {
  padding: 8px 12px 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.nav-search-empty {
  padding: 20px;
  text-align: center;
  color: var(--ink-500);
  font-size: 13px;
}

/* Rich deal cards */
.nav-search-card {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  border-left: 3px solid transparent;
  transition: background 120ms ease;
}
.nav-search-card:hover {
  background: var(--ink-50);
  text-decoration: none;
  color: inherit;
}
.nav-search-card.brand-helm   { border-left-color: var(--brand-helm); }
.nav-search-card.brand-anchor { border-left-color: #1AA86A; }

.nav-search-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}
.nav-search-card-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--ink-900);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-search-brand-pill {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 3px;
  color: #fff;
  flex-shrink: 0;
}
.nav-search-brand-pill.brand-helm   { background: var(--brand-helm); }
.nav-search-brand-pill.brand-anchor { background: #1AA86A; }

.nav-search-card-meta {
  font-size: 12px;
  color: var(--ink-500);
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-search-card-pills {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.nav-search-status-pill,
.nav-search-pay-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  letter-spacing: 0.02em;
}
.nav-search-status-pill.is-upcoming { background: #dde6ff; color: #1a3578; }
.nav-search-status-pill.is-now      { background: #fef3d6; color: #854F0B; }
.nav-search-status-pill.is-complete { background: #e3f5e8; color: #1D5C3A; }
.nav-search-pay-pill.pay-ok   { background: #e3f5e8; color: #1D5C3A; }
.nav-search-pay-pill.pay-warn { background: #fef3d6; color: #854F0B; }
.nav-search-pay-pill.pay-err  { background: #fbe2e2; color: #8a1f1f; }

.nav-search-more {
  display: block;
  padding: 10px 12px;
  margin-top: 4px;
  border-top: 1px solid var(--ink-50);
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--brand-primary);
  text-decoration: none;
}
.nav-search-more:hover { background: var(--ink-50); text-decoration: none; }

/* Deploy Q.6 — recently-viewed cards (on the home page) share the nav
 * dropdown card styling via .nav-search-card + .recent-card. We just
 * add vertical spacing between them. */
#recent-list .nav-search-card.recent-card {
  margin-bottom: 6px;
}
#recent-list .nav-search-card.recent-card:last-child {
  margin-bottom: 0;
}
.recent-viewed-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--ink-50);
  color: var(--ink-500);
}

/* Deploy Q.7 — readiness pill on search/recent cards. Mirrors the
 * qv-pill colour rules on the home-page qv cards so "0/4", "2/4", "4/4"
 * read the same across surfaces. */
.nav-search-ready-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  letter-spacing: 0.02em;
}
.nav-search-ready-pill.is-complete { background: #e3f5e8; color: #1D5C3A; }
.nav-search-ready-pill.is-partial  { background: #fef3d6; color: #854F0B; }
.nav-search-ready-pill.is-none     { background: #fbe2e2; color: #8a1f1f; }

/* ----- Deploy V — Additional Documents card ----------------------------- */
.adoc-card .adoc-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.adoc-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 4px;
  border-radius: 6px;
}
.adoc-row + .adoc-row { border-top: 1px solid var(--border, #eee); }
.adoc-row:hover { background: var(--ink-50, #f7f7f8); }
.adoc-icon {
  font-size: 16px;
  line-height: 1;
  text-align: center;
  color: var(--ink-500);
}
.adoc-meta { min-width: 0; }
.adoc-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.adoc-sub {
  font-size: 11px;
  color: var(--ink-500);
  margin-top: 1px;
}
.adoc-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

/* ----- Deploy V — Warning chip on home cards ---------------------------- */
.warning-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  cursor: help;
  border: 1px solid transparent;
}
.warning-chip.sev-red {
  background: #fdeaea;
  color: #8a1f1f;
  border-color: #f5c6c6;
}
.warning-chip.sev-amber {
  background: #fef3d6;
  color: #854F0B;
  border-color: #f5dfae;
}

/* Deploy AV — Toggle switch (used in Settings for feature flags). */
.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
}
.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--ink-300, #cbd5e1);
  border-radius: 24px;
  transition: background 120ms ease;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 120ms ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.toggle input:checked + .toggle-slider {
  background: #0c7c4a;
}
.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}
.toggle input:disabled + .toggle-slider {
  opacity: 0.5;
  cursor: not-allowed;
}
