/* Sun Orchard design language (tokens from the Sun Orchard design system, 2026-09-10).
   One brand colour (navy) used sparingly; the interface is slate so that status colour carries the meaning.
   Fonts are served from this app (Inter, JetBrains Mono; SIL Open Font License): the CSP allows no third-party hosts. */

@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url("/static/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-style: normal; font-display: swap; src: url("/static/fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap; src: url("/static/fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-style: normal; font-display: swap; src: url("/static/fonts/inter-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("/static/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url("/static/fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  --so-navy: #2d3c6e;
  --so-navy-dark: #222e55;
  --so-ground: #f8fafc;
  --so-ink: #0f172a;
  --so-ink-soft: #334155;
  --so-muted: #64748b;
  --so-line: #e2e8f0;
  --so-line-strong: #cbd5e1;
  --so-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --bs-primary: var(--so-navy);
  --bs-primary-rgb: 45, 60, 110;
  --bs-link-color: var(--so-navy);
  --bs-link-color-rgb: 45, 60, 110;
  --bs-link-hover-color: var(--so-navy-dark);
  --bs-link-hover-color-rgb: 34, 46, 85;
  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* 14px: the whole app is one density. The sensitive review screens are read closely, so this is a step up
     from the design system's 12px dense-table default. Keep the ratios if this is changed. */
  --bs-body-font-size: 0.875rem;
  --bs-body-color: var(--so-ink);
  --bs-body-bg: var(--so-ground);
  --bs-border-color: var(--so-line);
  --bs-border-radius: 0.5rem;
}

body { min-height: 100vh; display: flex; flex-direction: column; font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
main { flex: 1 0 auto; }
h1, h2, h3, h4, h5, h6 { font-weight: 600; letter-spacing: -0.01em; }
.h2, h1.h2 { font-size: 1.375rem; }
a { text-underline-offset: 0.18em; }
.mono, code { font-family: var(--so-mono); font-size: 0.92em; }
code { color: var(--so-ink-soft); background: #eef2f7; border-radius: 0.25rem; padding: 0.1em 0.35em; }
/* One page width for the whole app: the full window, so tables do not wrap. */
/* One page width for the whole app: wide enough that tables do not wrap, capped so lines stay readable. */
.container-wide { width: 100%; max-width: none; margin-inline: auto; padding-inline: 1rem; }
@media (min-width: 992px) { .container-wide { padding-inline: 1.5rem; } }
/* Detail and review pages: the main column takes the space, the side column keeps a fixed readable width. */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
@media (min-width: 992px) { .detail-grid { grid-template-columns: minmax(0, 1fr) 23rem; } }

:focus-visible { outline: 2px solid var(--so-navy); outline-offset: 2px; border-radius: 0.25rem; }
.form-control:focus, .form-select:focus { border-color: var(--so-navy); box-shadow: 0 0 0 0.2rem rgba(45, 60, 110, 0.18); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* ---- top bar ---------------------------------------------------------------------------------- */
.navbar { background: #fff; border-bottom: 1px solid var(--so-line); padding-block: 0; min-height: 3.25rem; }
.navbar-brand { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 600; color: var(--so-navy); padding-block: 0.5rem; }
.brand-logo { height: 1.75rem; width: auto; display: block; }
.brand-product { padding-left: 0.6rem; border-left: 1px solid var(--so-line-strong); font-size: 0.9rem; color: var(--so-ink-soft); }
.navbar .nav-link { color: var(--so-ink-soft); font-weight: 500; padding: 1.05rem 0.85rem; border-bottom: 2px solid transparent; }
.navbar .nav-link:hover { color: var(--so-navy); }
.navbar .nav-link[aria-current="page"] { color: var(--so-navy); font-weight: 600; border-bottom-color: var(--so-navy); }
.navbar .dropdown-menu { border: 1px solid var(--so-line); border-radius: 0.5rem; box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08); padding: 0.25rem; margin-top: 0; }
.navbar .dropdown-item { font-size: 0.875rem; color: var(--so-ink-soft); border-radius: 0.375rem; padding: 0.45rem 0.75rem; }
.navbar .dropdown-item:hover, .navbar .dropdown-item:focus { background: #f1f5f9; color: var(--so-navy); }
.navbar .dropdown-item[aria-current="page"] { background: #eef1f8; color: var(--so-navy); font-weight: 600; }
.role-chip { display: inline-block; font-size: 0.6875rem; font-weight: 600; color: var(--so-ink-soft); background: #f1f5f9; border: 1px solid var(--so-line); border-radius: 999px; padding: 0.1rem 0.5rem; }
.env-badge { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; font-weight: 600; letter-spacing: 0.04em; font-size: 0.6875rem; }

/* ---- buttons and cards ------------------------------------------------------------------------ */
.btn { --bs-btn-font-size: 0.875rem; font-weight: 500; }
.btn-sm { --bs-btn-font-size: 0.8125rem; }
.form-control, .form-select { font-size: 0.875rem; }
.form-check-label { font-size: 0.875rem; }
.btn-primary { --bs-btn-bg: var(--so-navy); --bs-btn-border-color: var(--so-navy);
  --bs-btn-hover-bg: var(--so-navy-dark); --bs-btn-hover-border-color: var(--so-navy-dark);
  --bs-btn-active-bg: var(--so-navy-dark); --bs-btn-active-border-color: var(--so-navy-dark);
  --bs-btn-disabled-bg: var(--so-navy); --bs-btn-disabled-border-color: var(--so-navy); }
.btn-outline-primary { --bs-btn-color: var(--so-navy); --bs-btn-border-color: var(--so-navy);
  --bs-btn-hover-bg: var(--so-navy); --bs-btn-hover-border-color: var(--so-navy);
  --bs-btn-active-bg: var(--so-navy-dark); --bs-btn-active-border-color: var(--so-navy-dark); }
.btn-outline-secondary { --bs-btn-color: var(--so-ink-soft); --bs-btn-border-color: var(--so-line-strong);
  --bs-btn-hover-bg: #f1f5f9; --bs-btn-hover-color: var(--so-ink); --bs-btn-hover-border-color: var(--so-line-strong); }
.btn-outline-secondary.show, .btn-outline-secondary:active { --bs-btn-active-bg: #f1f5f9; --bs-btn-active-color: var(--so-ink); --bs-btn-active-border-color: var(--so-line-strong); }
.card { background: #fff; border: 1px solid var(--so-line); border-radius: 0.5rem; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05); }
.card-header { background: #fff; font-weight: 600; color: var(--so-ink); border-bottom: 1px solid var(--so-line); }
.card-footer { background: #fff; border-top: 1px solid var(--so-line); }
.login-card { max-width: 26rem; margin: 4rem auto; }
.link-box { word-break: break-all; background: #f8fafc; border: 1px dashed var(--so-navy); border-radius: 0.375rem; padding: 0.75rem; }
.required::after { content: " *"; color: #b91c1c; }
.small-muted { color: var(--so-muted); font-size: 0.8125rem; }
.timeline { list-style: none; padding-left: 0; margin: 0; }
.timeline li { border-left: 2px solid var(--so-line-strong); padding: 0 0 0.9rem 0.9rem; position: relative; }
.timeline li:last-child { padding-bottom: 0; }
.timeline-history li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.timeline-history .history-main { min-width: 0; overflow-wrap: anywhere; }
.timeline-history .history-time { white-space: nowrap; text-align: right; flex: none; }
@media (max-width: 575.98px) { .timeline-history li { flex-direction: column; gap: 0.1rem; } .timeline-history .history-time { text-align: left; } }

/* ---- status badges: outline, one hue per meaning (design-system contract) ----------------------- */
.status-badge { --tone-bg: #f8fafc; --tone-fg: #334155; --tone-line: #e2e8f0;
  display: inline-flex; align-items: center; gap: 0.35rem; white-space: nowrap; font-size: 0.75rem; font-weight: 600; line-height: 1.2;
  padding: 0.2rem 0.6rem; border-radius: 999px; background: var(--tone-bg); color: var(--tone-fg); border: 1px solid var(--tone-line); }
.status-badge::before { content: ""; width: 0.4rem; height: 0.4rem; border-radius: 50%; background: currentColor; flex: none; }
.status-badge.fs-6 { font-size: 0.8125rem !important; }
.tone-blue    { --tone-bg: #eff6ff; --tone-fg: #1d4ed8; --tone-line: #bfdbfe; }
.tone-purple  { --tone-bg: #faf5ff; --tone-fg: #7e22ce; --tone-line: #e9d5ff; }
.tone-emerald { --tone-bg: #ecfdf5; --tone-fg: #047857; --tone-line: #a7f3d0; }
.tone-green   { --tone-bg: #f0fdf4; --tone-fg: #15803d; --tone-line: #bbf7d0; }
.tone-red     { --tone-bg: #fef2f2; --tone-fg: #b91c1c; --tone-line: #fecaca; }
.tone-amber   { --tone-bg: #fffbeb; --tone-fg: #b45309; --tone-line: #fde68a; }
.tone-orange  { --tone-bg: #fff7ed; --tone-fg: #c2410c; --tone-line: #fed7aa; }
.tone-slate   { --tone-bg: #f8fafc; --tone-fg: #334155; --tone-line: #e2e8f0; }

/* ---- lists and tables ------------------------------------------------------------------------- */
.table { --bs-table-bg: transparent; font-size: 0.8125rem; margin-bottom: 0; }
.table > :not(caption) > * > * { vertical-align: middle; padding: 0.6rem 0.85rem; border-bottom-color: var(--so-line); }
.table thead th { background: #f8fafc; color: var(--so-ink-soft); font-size: 0.75rem; font-weight: 600; white-space: nowrap; border-bottom: 1px solid var(--so-line-strong); }
.table-hover > tbody > tr:hover > * { --bs-table-hover-bg: #f8fafc; }
.table .ref, td.nowrap { white-space: nowrap; }
.table .ref { font-family: var(--so-mono); font-size: 0.8125rem; font-weight: 500; }
.table td.wrap-anywhere { overflow-wrap: break-word; }
.sort-link { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 0.3rem; }
.sort-link:hover { color: var(--so-navy); }
.sort-link::after { content: ""; border: 4px solid transparent; border-top-color: var(--so-line-strong); border-bottom-width: 0; margin-top: 1px; }
th[aria-sort="ascending"] .sort-link::after { border-top-color: transparent; border-bottom: 4px solid var(--so-navy); border-top-width: 0; margin-top: 0; }
th[aria-sort="descending"] .sort-link::after { border-top-color: var(--so-navy); }
th[aria-sort="ascending"], th[aria-sort="descending"] { color: var(--so-navy); }

.quick-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.quick-filters .pill { display: inline-flex; align-items: center; gap: 0.5rem; white-space: nowrap; text-decoration: none; font-weight: 500;
  color: var(--so-ink-soft); background: #fff; border: 1px solid var(--so-line-strong); border-radius: 999px; padding: 0.3rem 0.75rem; }
.quick-filters .pill:hover { border-color: var(--so-navy); color: var(--so-navy); }
.quick-filters .pill[aria-current="true"] { background: var(--so-navy); border-color: var(--so-navy); color: #fff; }
.quick-filters .count { font-size: 0.6875rem; font-weight: 600; background: #f1f5f9; color: var(--so-ink-soft); border-radius: 999px; padding: 0.05rem 0.45rem; min-width: 1.4rem; text-align: center; }
.quick-filters .pill[aria-current="true"] .count { background: rgba(255, 255, 255, 0.2); color: #fff; }

/* ---- form editor: collapsible sections and an action bar that stays in reach --------------------------- */
.editor-section > summary { cursor: pointer; list-style-position: inside; }
.editor-section > summary:focus-visible { outline: 2px solid var(--so-navy); outline-offset: -2px; }
.editor-section[open] > summary { border-bottom: 1px solid var(--so-line); }
.editor-actions { position: sticky; bottom: 0; z-index: 5; background: #fff; border-top: 1px solid var(--so-line-strong); padding: 0.75rem 0; margin-top: 1rem; }

/* ---- public vendor form ------------------------------------------------------------------------ */
.public-header { background: #fff; border-bottom: 1px solid var(--so-line); padding-block: 0.5rem; }
.public-wrap { width: 100%; max-width: 900px; margin-inline: auto; padding-inline: 1rem; }
.stepper { list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0; margin: 0; }
.stepper .step a { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.7rem; border: 1px solid var(--so-line-strong); border-radius: 999px; background: #fff; color: var(--so-ink-soft); text-decoration: none; font-size: 0.8125rem; font-weight: 500; }
.stepper .step a:hover { border-color: var(--so-navy); color: var(--so-navy); }
.stepper .step-mark { display: inline-flex; align-items: center; justify-content: center; width: 1.25rem; height: 1.25rem; border-radius: 50%; background: #f1f5f9; font-size: 0.6875rem; font-weight: 600; }
.stepper .step-complete .step-mark { background: #ecfdf5; color: #047857; }
.stepper .step-started .step-mark { background: #fffbeb; color: #b45309; }
.stepper .step-current a { background: var(--so-navy); border-color: var(--so-navy); color: #fff; }
.stepper .step-current .step-mark { background: rgba(255, 255, 255, 0.2); color: #fff; }
.stepper-progress { width: 100%; height: 0.5rem; accent-color: var(--so-navy); }
.repeat-row { border: 1px solid var(--so-line); border-radius: 0.5rem; padding: 0.75rem; margin-bottom: 0.75rem; background: #fcfdff; }
.cert-text { background: #f8fafc; border: 1px solid var(--so-line); border-radius: 0.5rem; padding: 0.75rem; }
fieldset legend { float: none; width: auto; }

.public-narrow { max-width: 36rem; margin-top: 1.5rem; }
.field-wrap[hidden] { display: none; }
/* A table inside a card scrolls in its own box instead of stretching the whole page. */
.card > .card-body { min-width: 0; }
.table-responsive { position: relative; }   /* keeps visually hidden labels inside the scroll box */
/* Column widths on the Reference lists screen (inline styles are blocked by the content security policy). */
.ref-w5 { width: 5rem; }
.ref-w7 { width: 7rem; }
.ref-w8 { width: 8rem; }
.ref-min11 { min-width: 11rem; }
.ref-min13 { min-width: 13rem; }

/* The row someone just came back to from a record: a navy edge and a faint tint, so it is easy to find again. */
tr[data-row-id]:target > *, tr.row-return > * { --bs-table-bg-state: #eef1f8; background-color: #eef1f8; }
tr[data-row-id]:target > :first-child, tr.row-return > :first-child { box-shadow: inset 4px 0 0 var(--so-navy); }
tr.row-return:focus { outline: none; }
@media (prefers-reduced-motion: no-preference) {
  tr[data-row-id] > * { transition: background-color 0.6s ease; }
}

/* ---- review page: corrections history and subtitle block ----------------------------------------- */
.review-meta { margin-bottom: 1rem; }
.review-meta p { margin: 0 0 0.25rem; }
.review-meta p:last-child { margin-bottom: 0; }
.address-lines > div { margin-bottom: 0.15rem; }
.address-lines .small-muted { display: inline-block; min-width: 7.5rem; }
.timeline.corrections li { padding-bottom: 1.5rem; }
.timeline.corrections li:last-child { padding-bottom: 0; }
.correction-values { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); gap: 0.15rem 0.75rem; margin: 0.35rem 0 0.5rem; }
.correction-values dt { font-weight: 400; color: var(--so-ink-soft); }
.correction-values dd { margin: 0; overflow-wrap: break-word; }
.correction-reason { margin: 0 0 0.35rem; overflow-wrap: break-word; }

/* The filters card on a list screen is closed behind a Filters button; the default marker is hidden. */
.filters-toggle > summary { list-style: none; cursor: pointer; }
.filters-toggle > summary::-webkit-details-marker { display: none; }

/* Drawn signature: the pad needs touch-action none so a finger draws instead of scrolling the page. */
.signature-pad { display: block; width: 100%; height: 160px; touch-action: none; cursor: crosshair; border: 1px solid #adb5bd; border-radius: 4px;
  background: linear-gradient(to bottom, #fff 0, #fff 120px, #adb5bd 120px, #adb5bd 121px, #fff 121px); }
.drawn-signature { display: block; max-width: 320px; max-height: 120px; border: 1px solid #dee2e6; background: #fff; }
