/* Design tokens: the single source of truth. Nothing else may contain a raw hex
 * value or a magic pixel size; if you need one that is not here, add it here first.
 *
 * The reference is HubSpot's *application* UI, because that is what the sales
 * team already has muscle memory for — not HubSpot's marketing brand. Measured
 * from a live HubSpot session:
 *
 *     primary button   #00494B   dark, desaturated teal — pill shaped
 *     link             #006162   dark teal, weight 600, no underline
 *     body text        #333333   at 14px / 1.71
 *     canvas           #f0f0f0
 *     page title       20px, weight 500
 *
 * The lesson is that HubSpot's orange is *brand*, and their interface runs on a
 * dark desaturated action colour over neutral greys. So this system keeps
 * Beyond Codes' own navy in that role: same calm, same contrast, our identity
 * rather than a clone of theirs.
 *
 * THE COLOUR RULE, in one line: navy acts, red destroys, green confirms.
 * Red was once the primary colour, so "New deal" and "Closed won" wore the colour
 * every other tool reserves for delete — never put it on a non-destructive action.
 */

:root {
  /* --- brand ------------------------------------------------------------- */
  --bc-navy: #020e3a;          /* Beyond Codes navy — actions, headings       */
  --bc-red: #ea1b15;           /* Beyond Codes red — destructive only         */

  /* --- action ------------------------------------------------------------ */
  --action: var(--bc-navy);
  --action-hover: #0b1f52;
  --action-active: #010823;
  --action-text: #ffffff;
  --action-ring: rgba(2, 14, 58, 0.22);
  --scrim: rgba(2, 14, 58, 0.32); /* behind the slide-in navigation on a tablet */
  /* An editor's dark top bar, HubSpot's, and what sits on it. */
  --editor-bar-bg: var(--text);
  --editor-bar-hover: rgba(255, 255, 255, 0.12);
  --editor-bar-line: rgba(255, 255, 255, 0.45);
  --editor-bar-muted: rgba(255, 255, 255, 0.75);

  /* --- neutrals ---------------------------------------------------------- */
  --canvas: #f1f3f7;           /* the page behind everything                  */
  --surface: #ffffff;          /* cards, rows, inputs                         */
  --surface-sunken: #f7f8fb;   /* board columns, table headers, wells         */
  --surface-hover: #f2f4fa;
  --border: #dfe3ec;
  --border-strong: #c6ccdb;

  --text: #1b2437;             /* body copy                                   */
  --text-muted: #5b6479;       /* secondary values, meta                      */
  --text-subtle: #8a93a8;      /* labels, timestamps, placeholders            */
  --text-inverse: #ffffff;

  --link: #24408e;             /* navy-family blue: reads as a link on white  */
  --link-hover: #16295c;

  /* --- semantic ---------------------------------------------------------- */
  /* Each has a text-safe foreground and a tint for badges and banners.       */
  --positive: #0f7a4d;
  --positive-hover: #0c6640;
  --positive-bg: #e7f5ee;
  --positive-border: #b6ded0;

  --negative: #c1271f;
  --negative-bg: #fdecea;
  --negative-border: #f3c3bf;

  --warning: #8a5a06;
  --warning-bg: #fff4e0;
  --warning-border: #f0d9ae;

  --info: #24408e;
  --info-bg: #eaefff;
  --info-border: #c7d3f5;

  --neutral-bg: #eef0f5;
  --neutral-border: #dbdfe9;

  /* --- typography -------------------------------------------------------- */
  /* A system stack, deliberately: the CSP blocks webfont CDNs, and it renders
   * instantly with no network. A webfont needs `font-src` and a self-hosted file. */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --text-xs: 0.6875rem;   /* 11px — uppercase labels                          */
  --text-sm: 0.75rem;     /* 12px — badges, timestamps, meta; never a control */
  --text-base: 0.8125rem; /* 13px — dense UI text                             */
  --text-body: 0.875rem;  /* 14px — body copy, matching HubSpot               */
  --text-lg: 1rem;        /* 16px — card titles                               */
  --text-xl: 1.25rem;     /* 20px — page titles, matching HubSpot             */
  --text-2xl: 1.5rem;     /* 24px — stat values                               */

  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;

  --leading-tight: 1.25;
  --leading-normal: 1.55;

  --tracking-label: 0.06em;   /* uppercase micro-labels only                  */

  /* --- space ------------------------------------------------------------- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  /* --- radius ------------------------------------------------------------ */
  --radius-sm: 4px;
  --thumb-width: 120px;        /* a logo or image shown in a settings list    */
  --thumb-height: 72px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-xl: 16px;          /* cards, HubSpot's                              */
  --radius-pill: 999px;       /* buttons, chips — HubSpot's defining shape    */

  /* --- elevation --------------------------------------------------------- */
  /* Navy-tinted rather than black: shadows over a cool canvas look muddy in
   * pure black. */
  --shadow-sm: 0 1px 2px rgba(2, 14, 58, 0.06);
  --shadow-md: 0 2px 6px rgba(2, 14, 58, 0.09);
  --shadow-lg: 0 8px 24px rgba(2, 14, 58, 0.14);

  /* --- layout ------------------------------------------------------------ */
  --sidebar-w: 232px;
  --settings-nav-w: 13rem;
  --topbar-h: 52px;           /* the bar that replaces the sidebar below 1024px  */
  --board-col-w: 280px;
  --content-max: 1600px;      /* wide enough that a monitor shows more board, not more margin */
  --calendar-cell-h: 104px;   /* a month grid day: room for three entries        */
  --public-form-max: 560px;   /* the embedded lead form's column                 */
  --public-form-banner-max: 960px; /* the form with a step banner beside it         */
  --form-banner-min: 160px;
  --input-narrow-w: 5rem;   /* a currency code, a short number */
  --booking-day-label-w: 8rem; /* the weekday column of a booking page's hours */
  --line-summary-w: 320px;  /* the line-item editor's totals block */
  --search-panel-w: 40rem;  /* the global search panel, HubSpot's width */
  --search-panel-top: 12vh; /* where it sits: high, so results have room below */
  --control-h: 32px;        /* a small control: a filter pill */
  --filter-bar-h: 40px;     /* a filter on an index's filter row, HubSpot's   */
  --check-size: 18px;       /* a table row's select box                      */
  --btn-h: 36px;            /* a button, HubSpot's                           */
  --btn-sm-h: 28px;         /* a small button                                */
  --btn-editor-h: 40px;     /* an editor's top-bar buttons                   */
  --icon-size: 18px;        /* a line icon in a rail or toolbar              */
  --icon-size-lg: 24px;     /* a line icon on a module tile                  */
  --module-tile-w: 6rem;    /* an editor's module tile: room for "Countdown"  */
  --search-h: 30px;         /* a search box, HubSpot's pill                  */
  --tab-pad-x: 28px;        /* a page tab (Manage / Analyze), HubSpot's      */
  --tab-bar: 5px;           /* the bar under the active page tab             */
  --filter-menu-w: 280px;   /* a quick filter's popover, HubSpot's width */
  --filter-list-max-h: 280px; /* its ticked list, before the list scrolls */
  --index-name-min: 12rem;  /* an index's name column, so a name keeps to a line or two */
  --index-row-h: 53px;      /* an index table's row, HubSpot's                 */
  --index-name-w: 18rem;    /* an index table's name column, so most names keep to one line */
  --index-name-max: 26rem;  /* past this a name is cut short with an ellipsis, as HubSpot's */

  /* --- chart series ------------------------------------------------------ */
  /* A categorical ramp for report series, navy through teal. Deliberately NOT the
   * semantic colours: --positive and --negative mean "good news" and "destructive"
   * everywhere else, and a bar chart where the second series happens to be red
   * would say something the data does not. */
  --series-1: #020e3a;
  --series-2: #2b4b8f;
  --series-3: #1f6f8b;
  --series-4: #3f8f86;
  --series-5: #7a86b8;
  --series-6: #9fb1c9;
  /* The window a report is compared against: the same series, paler. */
  --series-previous: #c7d0e0;

  --report-label-w: 11rem;  /* a report bar's row label: a stage or a person's name */
  --report-bar-h: 18px;     /* one horizontal bar in a report chart */
  --report-value-w: 5.5rem; /* the figure at the end of a report bar */
  --dashboard-card-w: 420px;/* the narrowest a dashboard card may be before it wraps */
  --report-chart-h: 220px;  /* a column or line chart's plot area */
  --report-col-min-w: 18px; /* the narrowest a column may be before the chart scrolls */
  --report-col-max-w: 56px; /* the widest one column may grow when there are few of them */

  /* --- motion ------------------------------------------------------------ */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 120ms;
}

@media (prefers-reduced-motion: reduce) {
  :root { --duration: 0ms; }
}
