/* Copyright (c) Health Dynamics Consulting Ltd. All rights reserved. Proprietary: see LICENSE. */
/*
 * Layer 1 of 5: tokens. Load order: tokens.css, base.css, components.css, layout.css, app.css.
 *
 * The Health Dynamics design system's tokens (tokens.json, version 2, synced 15 October 2026) as CSS custom
 * properties, exactly as published, then the few WFP additions the agreed design needs (7 November 2026, product
 * owner: see docs/design-standard.md), then the older names the pages still use, mapped onto the
 * tokens so a page not yet restyled keeps working. New CSS uses the --hd-* and --wfp-* names only.
 * Light theme only. Fonts are self-hosted (the content security policy allows fonts from this site only).
 */

@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/plus-jakarta-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 800; font-display: swap; src: url("../fonts/plus-jakarta-sans-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/montserrat-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/montserrat-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/montserrat-latin-700-normal.woff2") format("woff2"); }

:root {
  /* ---------------------------------------------------------------- Health Dynamics: colour */
  --hd-cerise: #e20b88;
  --hd-cerise-dark: #c40976;
  --hd-deep-blue: #1b5299;
  --hd-oxford: #101131;
  --hd-purple: #9e278b;
  --hd-sky: #29abe2;          /* decorative only */
  --hd-orange: #f69323;       /* decorative only */
  --hd-tint-pink: #f7e0f3;
  --hd-tint-blue: #dce8f9;
  --hd-tint-sky: #e4f4fb;
  --hd-tint-peach: #fef2e3;
  --hd-bg: #f6f7fb;
  --hd-surface: #ffffff;
  --hd-text: #101131;
  --hd-text-soft: #3a3c5c;
  --hd-muted: #5b5e7a;
  --hd-border: #dde0ea;       /* dividers and card edges only, never a control edge */
  --hd-border-input: #5b5e7a; /* control edges, 3:1 */
  --hd-grey-bg: #eef0f5;
  --hd-primary: var(--hd-cerise);
  --hd-primary-hover: var(--hd-cerise-dark);
  --hd-link: var(--hd-cerise-dark);
  --hd-accent: var(--hd-deep-blue);
  --hd-heading: var(--hd-oxford);
  --hd-success: #1e6b45;
  --hd-success-bg: #e3f2ea;
  --hd-warning: #8a4b00;
  --hd-warning-bg: #fef2e3;
  --hd-error: #b00020;
  --hd-error-bg: #fde7ea;
  --hd-info: #1b5299;
  --hd-info-bg: #dce8f9;
  --hd-amber: #a86200;
  --hd-neutral: #6f728c;
  --hd-focus-color: var(--hd-deep-blue);

  /* ---------------------------------------------------------------- Health Dynamics: type */
  --font-heading: "Plus Jakarta Sans", "Segoe UI", Arial, sans-serif;
  --font-body: "Montserrat", "Segoe UI", Arial, sans-serif;
  --hd-text-base: 1rem;
  --hd-line-height: 1.55;
  --hd-text-h1: 1.85rem;
  --hd-text-h2: 1.3rem;
  --hd-text-h3: 1.08rem;
  --hd-text-small: .85rem;
  --hd-weight-h1: 800;
  --hd-weight-h2: 800;
  --hd-weight-h3: 700;
  --hd-heading-case: none;
  --hd-ui-case: none;

  /* ---------------------------------------------------------------- Health Dynamics: spacing, shape, depth */
  --hd-space-1: .25rem;
  --hd-space-2: .5rem;
  --hd-space-3: .75rem;
  --hd-space-4: 1rem;
  --hd-space-5: 1.25rem;
  --hd-space-6: 1.5rem;
  --hd-space-8: 2rem;
  --hd-space-10: 2.5rem;
  --hd-radius: 12px;
  --hd-radius-sm: 8px;
  --hd-radius-pill: 999px;
  --hd-shadow: 0 1px 2px rgba(16, 17, 49, .06);
  --hd-shadow-md: 0 12px 32px rgba(16, 17, 49, .10);
  --hd-focus-ring: 0 0 0 2px #ffffff, 0 0 0 5px #1b5299;
  --hd-palette-stripe: linear-gradient(90deg, #e20b88, #9e278b, #1b5299, #29abe2, #f69323);
  --hd-card-stripe: linear-gradient(90deg, #e20b88, #f69323);
  --hd-hero-gradient: linear-gradient(135deg, #fddef0 0%, #f7e0f3 30%, #dce8f9 60%, #e4f4fb 85%, #fef2e3 100%);

  /* ---------------------------------------------------------------- Health Dynamics: layout */
  --hd-topbar-height: 68px;
  --hd-sidebar-width: 252px;
  --hd-content-max: 1280px;
  --hd-public-max: 1180px;
  --hd-prose-max: 75ch;

  /* ---------------------------------------------------------------- Health Dynamics: tables and filters (product owner, 8 November 2026) */
  --hd-table-text-size: .94rem;     /* 15px table text */
  --hd-table-row-height: 40px;      /* standard table rows (the default density) */
  --hd-filter-column: 280px;        /* the filter panel column on list pages */
  --hd-table-header-fill: #f8fafb;  /* table header and sheet footer fill */

  /* ---------------------------------------------------------------- WFP additions (agreed 7 November 2026) */
  /* Type: the caption above h1, the lead (56ch), labels and hints (table text is --hd-table-text-size). */
  --wfp-text-caption: .95rem;
  --wfp-text-lead: 1.08rem;
  --wfp-lead-max: 56ch;
  --wfp-text-label: .95rem;
  --wfp-text-hint: .88rem;
  --wfp-text-badge: .8rem;
  --wfp-target: 44px;           /* controls; 36px for small buttons */
  --wfp-target-sm: 36px;
  --wfp-tag-radius: var(--hd-radius-pill);
  --wfp-motion: 180ms ease;
  --font-mono: ui-monospace, Consolas, Menlo, monospace;
  /* Charts (chart rule): four series that differ in lightness, from the status marks, in this order. */
  --wfp-series-1: var(--hd-deep-blue);
  --wfp-series-2: var(--hd-cerise-dark);
  --wfp-series-3: var(--hd-amber);
  --wfp-series-4: var(--hd-neutral);
  --wfp-series-5: var(--hd-purple);
  --wfp-series-6: var(--hd-oxford);
  --wfp-axis: var(--hd-muted);
  --wfp-gridline: var(--hd-border);
  /* Hybrid app design (agreed 8 November 2026): the compact app shell. Bars have fixed heights. */
  --wfp-topbar-height: 59px;      /* a 56px bar and the 3px palette stripe */
  --wfp-toolbar-height: 52px;     /* the page toolbar and the collapsed Case header */
  --wfp-scrub-height: 28px;       /* the thin month slider */
  --wfp-chips-height: 44px;       /* the count and filter chips row */
  --wfp-control: 40px;            /* toolbar controls and icon buttons (44px on a phone) */
  --wfp-help-width: 340px;        /* the help side panel */
  --wfp-rail-width: 64px;         /* the main menu folded to icons */
  --wfp-row-compact: 36px;        /* table rows, compact density (an option) */
  --wfp-row-regular: var(--hd-table-row-height); /* table rows, standard density (the default) */
  --wfp-tooltip-bg: var(--hd-oxford);
  --wfp-batch-bg: var(--hd-oxford); /* the batch action bar */
  --wfp-stat: var(--hd-oxford);   /* stat figures: oxford, so cerise means act */
  --wfp-progress: var(--hd-deep-blue);
  --wfp-hover: #eef0f5;

  /* ---------------------------------------------------------------- Older names, mapped (do not use in new CSS) */
  --cerise: var(--hd-cerise);
  --cerise-dark: var(--hd-cerise-dark);
  --purple: var(--hd-purple);
  --deep-blue: var(--hd-deep-blue);
  --sky: var(--hd-sky);
  --sky-dark: #1c97cc;
  --orange: var(--hd-orange);
  --oxford: var(--hd-oxford);
  --white: #ffffff;
  --hero-gradient: var(--hd-hero-gradient);
  --palette-stripe: var(--hd-palette-stripe);
  --wfp-text-table: var(--hd-table-text-size);
  --wfp-table-head-bg: var(--hd-table-header-fill);
  --wfp-row-height: var(--hd-table-row-height);
  --wfp-filter-width: var(--hd-filter-column);
  --card-stripe: var(--hd-card-stripe);
  --surface: var(--hd-bg);
  --border: var(--hd-border);
  --control-border: var(--hd-border-input);
  --muted: var(--hd-muted);
  --oxford-soft: var(--hd-text-soft);
  --cerise-soft: var(--hd-tint-pink);
  --tint-pink: var(--hd-tint-pink);
  --tint-blue: var(--hd-tint-blue);
  --tint-sky: var(--hd-tint-sky);
  --tint-peach: var(--hd-tint-peach);
  --error: var(--hd-error);
  --error-tint: var(--hd-error-bg);
  --warning: var(--hd-warning);
  --warning-tint: var(--hd-warning-bg);
  --success: var(--hd-success);
  --success-tint: var(--hd-success-bg);
  --info: var(--hd-info);
  --info-tint: var(--hd-info-bg);
  --amber: var(--hd-amber);
  --neutral: var(--hd-neutral);
  /* Chart series: now the chart rule's palette (orange and sky failed 3:1 as marks). */
  --series-1: var(--wfp-series-1);
  --series-2: var(--wfp-series-2);
  --series-3: var(--wfp-series-3);
  --series-4: var(--wfp-series-4);
  --series-5: var(--wfp-series-5);
  --series-6: var(--wfp-series-6);
  /* Data colours for the structure picture and its charts (0.34.0), each 3:1 against white. */
  --data-1: var(--hd-deep-blue);
  --data-2: var(--hd-cerise-dark);
  --data-3: var(--hd-amber);
  --data-4: var(--hd-purple);
  --data-5: var(--sky-dark);
  --data-6: var(--hd-success);
  --data-7: var(--hd-oxford);
  --data-8: var(--hd-neutral);
  --data-9: var(--hd-cerise);
  --data-10: var(--hd-text-soft);
  --data-none: var(--hd-neutral);
  --state-filled: var(--hd-success);
  --state-vacant: var(--hd-amber);
  --state-proposed: var(--hd-deep-blue);
  --state-frozen: var(--hd-text-soft);
  --state-closed: var(--hd-neutral);
  --state-unfunded: var(--hd-error);
  --scale-0: var(--hd-bg);
  --scale-1: var(--hd-tint-pink);
  --scale-2: #f6b6db;
  --scale-3: #ef79be;
  --scale-4: var(--hd-cerise-dark);
  --scale-5: var(--hd-oxford);
  --text-body: var(--hd-text-base);
  --text-dense: 14px;
  --text-label: var(--wfp-text-label);
  --text-hint: var(--wfp-text-hint);
  --text-small: var(--hd-text-small);
  --text-badge: var(--wfp-text-badge);
  --radius-card: var(--hd-radius);
  --radius-pill: var(--hd-radius-pill);
  --radius-chip: 6px;
  --radius-control: var(--hd-radius-sm);
  --shadow-sm: var(--hd-shadow);
  --shadow-md: var(--hd-shadow-md);
  /* The older spacing scale in px (it does not match hd-space-N step for step; keep it for unrestyled pages). */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 40px;
  --space-8: 48px;
  --space-9: 56px;
  --space-10: 64px;
  --gutter: 24px;
  --header-height: var(--wfp-topbar-height);
  --rail-width: var(--hd-sidebar-width);
  --rail-collapsed: var(--wfp-rail-width);
  --focus: 3px solid var(--hd-focus-color);
  --focus-ring: var(--hd-focus-ring);
  --motion: var(--wfp-motion);
}

@media (max-width: 639px) {
  :root {
    --gutter: 16px;
    --wfp-control: 44px;
  }
}
