/* ==========================================================================
   BoatPortal design tokens.
   --------------------------------------------------------------------------
   PALETTE SOURCE: OWNER-SPECIFIED (2026-08-04).

   The colour values below are the owner's brand palette, supplied verbatim
   during the design-differentiation pass. They SUPERSEDE the Wave 1 values
   that were pixel-sampled from docs/reference-screenshots/*.webp — the rebuilt
   admin must read as the same layout system as the references while looking
   unmistakably like BoatPortal, not like a copy of them.

   The owner's canonical list:
     App Dark UI (sidebar) ............ #2C3539   sidebar text #FFFFFF
     Main content background .......... #F0F2F5
     System accent (progress, active) . #00A4C4   teal
     Primary action blue (Create) ..... #194B73
     Card & header white .............. #FFFFFF
     Secondary buttons (Edit/Delete) .. #777D85
     UI labels & subtle text .......... #6C757D
     Toast & alert backgrounds ........ #E9ECEF
     Success indicator ................ #A0AAB2   (deliberately desaturated)
     Warning & critical indicators .... #777D85   (deliberately desaturated)
     Primary text ..................... #212529
     Secondary text ................... #6C757D

   The owner's greys are the Bootstrap grey ramp (#212529 / #6C757D / #E9ECEF
   are gray-900 / gray-600 / gray-200), so every DERIVED neutral below is taken
   from the remaining steps of that same ramp — #F8F9FA, #DEE2E6, #CED4DA,
   #ADB5BD, #495057. Derived colour is never a new hue: tints/shades come from
   the owner's own values or from that ramp.

   The four top-bar band colours are sampled with PIL from the owner's asset
   /Users/toph/Downloads/topbar-design.png (200x200, four horizontal bands).

   GEOMETRY IS UNCHANGED. Type scale, spacing, radii, shadows, z-indices,
   layout metrics and motion are still the Wave 1 values measured off the
   reference screenshots; only colour moved.

   Rules for anyone extending this file:
     1. New colour -> derive it from the owner's palette above (or the grey
        ramp it belongs to) and say so in a comment. Never sample the legacy
        app, never invent a hue.
     2. No raw hex outside this file. app.css and pane CSS use var(--bp-*).
     3. Light theme only; the dark theme hooks in at [data-bp-theme="dark"] at
        the bottom by re-declaring the same semantic names.
   ========================================================================== */

:root {
  /* ---------------------------------------------------------------- type */
  /* Spec §11: Jost, Google Fonts, variable weight 100..900, roman + italic. */
  --bp-font-sans: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI',
                  Roboto, 'Helvetica Neue', Arial, sans-serif;
  --bp-font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo,
                  'Roboto Mono', monospace;

  /* Sizes below are back-computed from measured glyph boxes in the refs:
     ref08 eyebrow "NO CONTACT" cap-height 9px -> 12px uppercase;
     ref08 nav label ascender 13px / descender-to-cap 18px -> 15-17px;
     ref08 stat number digit height 31px -> 40px;
     ref08 "Monthly Orders" 19px w/ descender -> 20px;
     ref06 card heading "Customer" 16px cap -> 22px;
     ref06 page title "Order #607-0001" 27px cap -> 36px. */
  --bp-text-2xs: 11px;
  --bp-text-xs: 12px;   /* ref08 stat-card eyebrow, ref01 column header */
  --bp-text-sm: 13px;   /* ref06 summary-strip label, table cells */
  --bp-text-base: 14px; /* ref03 field label, button label */
  --bp-text-md: 15px;   /* ref08 sidebar nav label, topbar company name */
  --bp-text-lg: 17px;   /* ref06 summary-strip value */
  --bp-text-xl: 20px;   /* ref08 "Monthly Orders" card heading */
  --bp-text-2xl: 22px;  /* ref06 "Order Summary" / "Customer" card heading */
  --bp-text-3xl: 28px;
  --bp-text-4xl: 36px;  /* ref05/06 page title "Job #607-611311" */
  --bp-text-stat: 40px; /* ref08 KPI number */

  --bp-fw-light: 300;
  --bp-fw-normal: 400;
  --bp-fw-medium: 500;
  --bp-fw-semibold: 600;
  --bp-fw-bold: 700;

  --bp-lh-tight: 1.15;
  --bp-lh-snug: 1.3;
  --bp-lh-normal: 1.5;
  --bp-lh-loose: 1.7;

  --bp-tracking-tight: -0.01em;
  --bp-tracking-normal: 0;
  --bp-tracking-wide: 0.04em;
  --bp-tracking-caps: 0.07em;

  /* -------------------------------------------------------------- surface */
  --bp-canvas: #f0f2f5;         /* OWNER — main content background          */
  --bp-canvas-sunken: #e9ecef;  /* OWNER — toast/alert background grey       */
  --bp-surface: #ffffff;        /* OWNER — card & header white               */
  --bp-surface-muted: #f8f9fa;  /* derived — grey ramp 100                   */
  --bp-surface-head: #e9ecef;   /* OWNER — table head / kanban column        */
  --bp-surface-hover: #f5f6f8;  /* derived — between canvas and white        */
  --bp-scrim: rgba(33, 37, 41, 0.45); /* derived from primary text #212529   */

  /* -------------------------------------------------------------- borders */
  --bp-border: #dee2e6;         /* derived — grey ramp 300                   */
  --bp-border-strong: #ced4da;  /* derived — grey ramp 400                   */
  --bp-border-subtle: #e9ecef;  /* OWNER — grey ramp 200                     */
  --bp-rule: #e2e6ea;           /* derived — between ramp 200 and 300        */

  /* ----------------------------------------------------------------- text */
  --bp-text-color: #212529;     /* OWNER — primary text                      */
  --bp-text-strong: #16191c;    /* derived — one step darker for big values  */
  --bp-text-muted: #6c757d;     /* OWNER — secondary text                    */
  --bp-text-subtle: #6c757d;    /* OWNER — UI labels & subtle text           */
  --bp-label: #6c757d;          /* OWNER — form labels                       */
  --bp-placeholder: #adb5bd;    /* derived — grey ramp 500                   */
  --bp-text-invert: #ffffff;

  /* -------------------------------------------------------------- primary */
  /* OWNER — primary action blue. Create/Save/primary buttons and links. */
  --bp-primary: #194b73;
  --bp-primary-hover: #143c5c;   /* derived -8% L on #194B73                 */
  --bp-primary-active: #0f2e46;  /* derived -16% L on #194B73                */
  --bp-primary-ink: #194b73;     /* links + active text read at full strength */
  --bp-primary-tint: #eef3f8;    /* derived — #194B73 at ~6% over white      */
  --bp-primary-tint-strong: #dde7f0; /* derived — ~12% over white            */
  --bp-primary-soft: rgba(25, 75, 115, 0.10);
  --bp-on-primary: #ffffff;

  /* --------------------------------------------------------------- accent */
  /* OWNER — system accent teal. Progress bars, active icons, chart bars.
     Per the owner's system the teal is a STATE colour, not an action colour;
     buttons stay --bp-primary. */
  /* THE ONE RED ON THE PLATFORM, and the owner put it there: 2026-09-24,
     "red notification on the bottom bar inbox icon if there is something."
     Everything else in this system is the owner's palette, whose status
     family is deliberately grey and told apart by glyph — so this hue is for
     an UNREAD COUNT and nothing else. It is never a status, never a button,
     and never an error: those stay grey with their own glyph. Chosen to hold
     4.5:1 against both the dark bar it sits on and white. */
  --bp-notify: #d8232f;
  --bp-notify-ink: #ffffff;

  --bp-accent: #00a4c4;
  --bp-accent-ink: #04788f;      /* derived — darker teal, readable on white */
  --bp-accent-tint: #e2f5f9;     /* derived — #00A4C4 at ~10% over white     */

  /* ── THE PROCESS RAIL: Estimate -> Order -> Invoice ──────────────────────
     OWNER-SPECIFIED, 2026-11-18: *"estimate circle should be orange, order
     should be blue, invoice should be green. only color when it is in that
     process."*

     A DELIBERATE EXCEPTION to §6's "the status family is grey, told apart by
     a glyph". These are not statuses competing inside one family — they are
     three NAMED STAGES of one flow, and the owner asked for them by colour.
     They are only ever worn by the step an order is ON; a step already passed
     or not yet reached stays in the grey family, so the rail still reads with
     colour ignored.

     Blue is the palette's own `--bp-primary`, not a new hue. Orange and green
     are new and are muted to sit beside it rather than shout over it: both
     are picked at roughly the primary's lightness so no one stage looks more
     urgent than another. */
  --bp-stage-estimate: #b4690e;        /* amber, L-matched to #194B73        */
  --bp-stage-estimate-tint: #fdf1e1;   /* derived — ~10% over white          */
  --bp-stage-order: #194b73;           /* the palette's own primary blue     */
  --bp-stage-order-tint: #e7edf3;      /* derived — ~10% over white          */
  --bp-stage-invoice: #1c7049;         /* green, L-matched to #194B73        */
  --bp-stage-invoice-tint: #e5f2eb;    /* derived — ~10% over white          */

  --bp-avatar: #194b73;          /* OWNER primary blue; white ring on topbar  */
  --bp-avatar-ink: #ffffff;

  /* --------------------------------------------------------------- status */
  /* OWNER's call: the status family is deliberately DESATURATED. Success and
     Warning/Critical are greys, not green/amber/red. Because two of the three
     resolve to the same grey, the component library differentiates them with a
     CHECK vs ALERT glyph (see app.css §5 badge ::before and the toast icons),
     never by inventing a hue.
     The `-ink` variants are a darker step of the SAME grey, used only where the
     token has to carry small text on white (form errors, menu items). */
  --bp-neutral-tint: #e9ecef;    /* OWNER — alert/badge background            */
  --bp-neutral-ink: #495057;     /* derived — grey ramp 700                   */

  --bp-success: #a0aab2;         /* OWNER — success state indicator           */
  --bp-success-ink: #6f7a83;     /* derived shade of #A0AAB2 for small text   */
  --bp-success-tint: #eef0f2;    /* derived — #A0AAB2 at ~18% over white      */
  --bp-warning: #777d85;         /* OWNER — warning indicator                 */
  --bp-warning-ink: #5a6067;     /* derived shade of #777D85 for small text   */
  --bp-warning-tint: #e9ecef;    /* OWNER — alert background                  */
  --bp-danger: #777d85;          /* OWNER — critical indicator                */
  --bp-danger-ink: #5a6067;      /* derived shade of #777D85 for small text   */
  --bp-danger-tint: #e9ecef;     /* OWNER — alert background                  */
  --bp-info: var(--bp-accent-ink);
  --bp-info-tint: var(--bp-accent-tint);

  /* Secondary buttons (Edit / Delete) — OWNER #777D85. */
  --bp-secondary: #777d85;
  --bp-secondary-ink: #5a6067;   /* derived shade for label on white          */
  --bp-secondary-tint: #eff1f3;  /* derived — #777D85 at ~8% over white       */

  /* ----------------------------------------------- pipeline stage accents */
  /* Re-derived from the owner's top-bar bands (see the four --bp-band-* below)
     so the Leads Kanban sits inside the brand's navy -> teal ramp instead of
     the reference board's four unrelated hues. */
  --bp-stage-1: #1c4c70;  --bp-stage-1-tint: #e4eaf0;
  --bp-stage-2: #066aab;  --bp-stage-2-tint: #e0edf6;
  --bp-stage-3: #028abb;  --bp-stage-3-tint: #dcf0f7;
  --bp-stage-4: #02a0bb;  --bp-stage-4-tint: #daf2f6;

  /* --------------------------------------------------- part-order tracker */
  /* Owner's system: "progress bars = teal". The reference tracker's lime and
     violet are replaced by accent teal + the neutral alert grey. */
  --bp-track-active: #00a4c4;
  --bp-track-active-ink: #212529;
  --bp-track-pending: #e9ecef;
  --bp-track-pending-ink: #6c757d;
  --bp-track-ink: #2c3539;
  --bp-track-panel: #f0f2f5;

  /* ------------------------------------------------------- sidebar (dark) */
  /* OWNER — the sidebar is dark: #2C3539 with white text. Inactive icons are
     muted white; the active row is accent teal plus a translucent teal tint,
     and dividers are light-on-dark hairlines. */
  --bp-sidebar-bg: #2c3539;
  --bp-sidebar-ink: #ffffff;
  /* OWNER (2026-11-11): *"I can see the icon line overlap. Instead make it the
     same color, fully opaque."* This ink draws LUCIDE STROKES — the sidebar's
     inactive icons and the phone tab bar's. Where two strokes of one glyph
     cross (the house's roof over its wall, the inbox's tray), a translucent
     ink composites TWICE and the crossing shows as a brighter line through the
     drawing. Alpha cannot be used here at all: the fault is the alpha, not its
     value. So the colour is the same colour, solved rather than blended —
     white at 64% over --bp-sidebar-bg (#2C3539 = 44, 53, 57):
         R .64x255 + .36x44 = 179.0   G .64x255 + .36x53 = 182.3
         B .64x255 + .36x57 = 183.7                     -> #B3B6B8
     Identical on the bar it is drawn on, and it cannot double up. Every
     consumer of this token sits on that same dark chrome (admin sidebar,
     crew portal top bar, super console, the phone tab bar via
     --bpm-tabbar-ink-muted), so nothing changes colour anywhere. Do not put
     an alpha back; if a new surface needs muted white at a different value,
     solve it over that surface and add a token of its own. */
  --bp-sidebar-ink-muted: #b3b6b8;
  /* A RAISED DISC ON THE DARK CHROME (2026-11-13). The crew app's clocked-in
     band needed something that reads as a button without a word on it, and a
     translucent white would composite against whatever is behind it. Solved
     the same way the ink above is, over the same surface — white at 12% over
     #2C3539 (44, 53, 57):
         R .12x255 + .88x44 = 69.3   G .12x255 + .88x53 = 77.2
         B .12x255 + .88x57 = 80.8                      -> #454D51         */
  --bp-sidebar-lift: #454d51;
  --bp-sidebar-hover: rgba(255, 255, 255, 0.08);
  --bp-sidebar-active-ink: #00a4c4;
  --bp-sidebar-active-bg: rgba(0, 164, 196, 0.16);
  --bp-sidebar-divider: rgba(255, 255, 255, 0.11);
  --bp-sidebar-border: rgba(255, 255, 255, 0.08);
  --bp-sidebar-scrollbar: rgba(255, 255, 255, 0.18);

  /* ---------------------------------------------------- top bar (banded)  */
  /* The FOUR-BAND design comes from the owner's topbar-design.png (bands at
     21% / 29% / 29% / 21%), but per owner feedback (2026-08-04) the band
     colours are re-derived from the theme's own palette so the bar blends in:
     sidebar slate-blue -> primary action blue -> deep-teal step -> accent.
     Keep four bands; tune hues only within the theme family. */
  /* Owner reversal (2026-08-04): every top bar wears the LANDING PAGE's
     original navy hull gradient — four deep-navy bands, 24/25/25/26 stops
     (templates/landing.html --hull-gradient is the reference). White ink
     reads at 12:1+ on all four bands. */
  --bp-band-1: #0a1b33;
  --bp-band-2: #0d2238;
  --bp-band-3: #102942;
  --bp-band-4: #13314d;
  --bp-topbar-bg: linear-gradient(
    180deg,
    var(--bp-band-1) 0 24%,
    var(--bp-band-2) 24% 49%,
    var(--bp-band-3) 49% 74%,
    var(--bp-band-4) 74% 100%
  );
  --bp-topbar-ink: #ffffff;
  --bp-topbar-ink-muted: rgba(255, 255, 255, 0.84);
  --bp-topbar-hover: rgba(255, 255, 255, 0.18);
  --bp-topbar-border: #d0d5da; /* grey, not black — owner request 2026-08-04 */

  /* -------------------------------------------------------------- spacing */
  /* 4px base. ref08: 14-15px gap between KPI cards, ~20-24px card padding,
     ~24px page gutter. */
  --bp-space-0: 0;
  --bp-space-1: 4px;
  --bp-space-2: 8px;
  --bp-space-3: 12px;
  --bp-space-4: 16px;
  --bp-space-5: 20px;
  --bp-space-6: 24px;
  --bp-space-7: 32px;
  --bp-space-8: 40px;
  --bp-space-9: 48px;
  --bp-space-10: 64px;
  --bp-gap-card: 15px;          /* ref08 measured gap between the KPI cards  */
  --bp-pad-card: 20px;          /* ref08 measured KPI card inner padding     */
  --bp-pad-page: 24px;

  /* --------------------------------------------------------------- radius */
  /* Corner-arc scans: ref08 KPI card ~10px, ref05 content card ~8px,
     ref08 "+ New Order" ~6px, ref03 input ~6px, ref07 outline button ~7px. */
  --bp-radius-xs: 4px;
  --bp-radius-sm: 6px;   /* buttons, inputs, selects */
  --bp-radius-md: 8px;   /* badges, sidebar rows, small cards */
  --bp-radius-lg: 10px;  /* content cards */
  --bp-radius-xl: 14px;  /* modal shell */
  --bp-radius-pill: 999px;
  --bp-radius-circle: 50%;

  /* -------------------------------------------------------------- shadows */
  /* Hairline border plus a very soft, nearly-neutral drop, tinted with the
     owner's primary text #212529 rather than pure black. */
  --bp-shadow-xs: 0 1px 2px rgba(33, 37, 41, 0.04);
  --bp-shadow-sm: 0 1px 3px rgba(33, 37, 41, 0.06), 0 1px 2px rgba(33, 37, 41, 0.04);
  --bp-shadow-md: 0 4px 12px rgba(33, 37, 41, 0.08);
  --bp-shadow-lg: 0 12px 32px rgba(33, 37, 41, 0.12);
  --bp-shadow-modal: 0 24px 64px rgba(33, 37, 41, 0.26);
  --bp-shadow-focus: 0 0 0 3px rgba(25, 75, 115, 0.20);
  --bp-shadow-focus-danger: 0 0 0 3px rgba(119, 125, 133, 0.26);

  /* ------------------------------------------------------------ z-indices */
  --bp-z-base: 0;
  --bp-z-sticky: 100;
  --bp-z-topbar: 200;
  --bp-z-sidebar: 300;
  --bp-z-scrim: 800;
  --bp-z-drawer: 810;
  --bp-z-dropdown: 900;
  --bp-z-modal: 1000;
  --bp-z-toast: 1100;

  /* --------------------------------------------------------------- layout */
  --bp-sidebar-w: 248px;
  --bp-topbar-h: 56px;     /* ref08 top bar measured 54px + 1px rule */
  --bp-impersonate-h: 38px;/* Wave T5 super-impersonation band, in normal flow
                              above the top bar (see .bp-impersonate)          */
  --bp-navrow-h: 46px;     /* ref08 row pitch is 53px; tightened to fit 19 */
  --bp-icon-sm: 16px;
  --bp-icon: 20px;         /* ref08 sidebar + top-bar icons measured 19-21px */
  --bp-icon-lg: 24px;
  --bp-stroke: 1.75;       /* Lucide stroke-width used everywhere */
  --bp-control-h: 40px;    /* ref06 header buttons measured 41px tall */
  --bp-control-h-sm: 32px;
  --bp-row-h: 46px;        /* ref01 table row pitch measured 46px */
  --bp-content-max: 1560px;

  /* Brand slot — the owner asked for a noticeably larger mark + wordmark on
     the dark sidebar than the Wave 1 26x28 / 15px pairing. */
  --bp-brand-mark: 31px;
  --bp-brand-text: 19px;

  /* --------------------------------------------------------------- motion */
  --bp-ease: cubic-bezier(0.2, 0.6, 0.35, 1);
  --bp-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --bp-dur-fast: 120ms;
  --bp-dur: 180ms;
  --bp-dur-slow: 280ms;

  /* ------------------------------------------------------------- skeleton */
  --bp-skeleton-base: #e4e7eb;   /* derived one step off --bp-canvas */
  --bp-skeleton-sheen: #f4f6f8;

  /* --------------------------------------------------------- illustration */
  /* The empty state is now the owner's line-art asset
     static/app/empty-state.png. These tokens still drive any inline SVG art
     and are pinned to the asset's own grey so the two families match. */
  --bp-illus-stroke: #a0aab2;
  --bp-illus-blob: #eef0f3;
  --bp-illus-blob-2: #f5f7f9;
  --bp-empty-art-w: 220px;       /* owner: ~200-240px wide inside a card */
}

/* --------------------------------------------------------------------------
   Dark theme placeholder. Not shipped — re-declare the semantic names here,
   never add new ones, and the whole component library follows.
   -------------------------------------------------------------------------- */
:root[data-bp-theme='dark'] {
  /* intentionally empty until a dark reference exists */
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --bp-dur-fast: 0ms;
    --bp-dur: 0ms;
    --bp-dur-slow: 0ms;
  }
}
