/* Olmi design tokens · version 1.0 · October 2, 2026
 *
 * The one source for colour, type, space, shape, depth and motion across the staff portal,
 * the patient app, Olmi and printouts. Components use the role tokens (the second block).
 * The primitives (the first block) exist only to define the roles; don't use them directly.
 * A value that isn't here needs a new token, agreed first (Olmi Design System, Governance).
 */

:root {
  /* ---------------------------------------------------------------- primitives ---- */

  /* Moss: the neutrals, greys with an olive cast. Surfaces, lines and text. */
  --moss-0:   #ffffff;
  --moss-25:  #fcfdf9;
  --moss-50:  #f8f9f5;
  --moss-75:  #f3f5ef;
  --moss-100: #f0f2eb;
  --moss-150: #edf0e6;
  --moss-200: #e5e8df;
  --moss-300: #dce2d3;
  --moss-400: #c9d1bd;
  --moss-500: #a1a996;
  --moss-600: #78836d;
  --moss-700: #5d6953;
  --moss-800: #3d4a33;
  --moss-900: #27321f;

  /* Olive: action and selection. */
  --olive-50:  #f3f6ec;
  --olive-100: #e7edda;
  --olive-200: #d7e1c0;
  --olive-300: #b7c29f;
  --olive-400: #849b6b;
  --olive-500: #657741;
  --olive-600: #536533;
  --olive-700: #45562b;

  /* Bark: the logo, and nothing else. */
  --bark-500: #7c7366;

  /* Signals. Red is urgent; clay is destructive or risky; sand is new. */
  --red-50:   #fff3f2;
  --red-200:  #efcccc;
  --red-600:  #b83d3d;
  --clay-50:  #fdf5f1;
  --clay-200: #e9ccc0;
  --clay-600: #9d533e;
  --sand-50:  #f6f1e4;
  --sand-700: #846931;

  /* Identity: avatar tints that tell people apart. They never mean anything. */
  --id-sage-bg:  #e6ebdc;  --id-sage-fg:  #57694b;
  --id-clay-bg:  #f0e1d8;  --id-clay-fg:  #835b49;
  --id-sand-bg:  #eee8d8;  --id-sand-fg:  #706643;
  --id-lilac-bg: #e9e5ef;  --id-lilac-fg: #71607d;

  /* ---------------------------------------------------------------- roles ---- */

  /* Surfaces */
  --surface-ground: var(--moss-150);   /* behind the workspace; the sidebar sits on it */
  --surface-canvas: var(--moss-50);    /* the workspace and page background */
  --surface:        var(--moss-0);     /* cards, inputs, tables */
  --surface-raised: var(--moss-25);    /* top bar and side panels */
  --surface-sunken: var(--moss-100);   /* board columns and quiet groups */
  --fill-hover:     var(--moss-75);    /* hover on rows, tabs and quiet buttons */
  --fill-selected:  var(--olive-100);  /* selected navigation, chips and segments */

  /* Lines */
  --line:        var(--moss-200);      /* hairlines between rows and around cards */
  --line-strong: var(--moss-300);      /* the workspace edge, inputs, secondary buttons */

  /* Text (contrast on --surface: 13.4, 9.4, 5.8, 4.0 and 2.4 to 1) */
  --text-strong: var(--moss-900);      /* titles, names, numbers */
  --text:        var(--moss-800);      /* body text */
  --text-muted:  var(--moss-700);      /* secondary text that carries information */
  --text-subtle: var(--moss-600);      /* icons, placeholders, large text only */
  --text-faint:  var(--moss-500);      /* disabled text and decoration */

  /* Action and selection */
  --action:        var(--olive-500);   /* primary buttons, links, the focus ring */
  --action-hover:  var(--olive-600);   /* hover and pressed; links on tinted ground */
  --action-press:  var(--olive-700);
  --on-action:     var(--moss-0);      /* text and icons on olive */
  --selected-text: var(--olive-600);   /* selected navigation and tabs */
  --focus-ring:    var(--olive-500);

  /* Status */
  --urgent:      var(--red-600);       /* the urgent marker, alert counts */
  --urgent-fill: var(--red-50);
  --urgent-line: var(--red-200);
  --danger:      var(--clay-600);      /* destructive buttons, errors */
  --danger-fill: var(--clay-50);
  --danger-line: var(--clay-200);
  --new:         var(--sand-700);      /* "New patient" and similar tags */
  --new-fill:    var(--sand-50);
  --settled:     var(--olive-600);     /* settled states, always with a word: "Handed off", "Confirmed" */
  --settled-fill: var(--olive-50);
  --brand:       var(--bark-500);      /* the logo */

  /* ---------------------------------------------------------------- type ---- */

  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-document: Georgia, 'Times New Roman', serif;   /* headings in long patient documents only */

  --weight-regular: 400;
  --weight-medium:  500;
  --weight-strong:  600;

  /* size / line height / tracking */
  --type-hero:     44px; --type-hero-lh:     48px; --type-hero-track:     -0.035em;
  --type-display:  30px; --type-display-lh:  36px; --type-display-track:  -0.035em;
  --type-title:    23px; --type-title-lh:    29px; --type-title-track:    -0.03em;
  --type-heading:  17px; --type-heading-lh:  23px; --type-heading-track:  -0.015em;
  --type-body:     14px; --type-body-lh:     21px;
  --type-ui:     12.5px; --type-ui-lh:       18px;
  --type-meta:   11.5px; --type-meta-lh:     17px;
  --type-caption: 10.5px; --type-caption-lh: 15px;
  --type-overline: 10.5px; --type-overline-track: 0.08em;   /* uppercase group labels only */

  /* The patient app: the same styles, larger, for a phone held in one hand */
  --app-type-hero: 34px; --app-type-title: 22px; --app-type-heading: 17px;
  --app-type-body: 16px; --app-type-meta: 14px;  --app-type-caption: 12px;

  /* ---------------------------------------------------------------- space ---- */

  --space-0-5: 2px;
  --space-1:   4px;
  --space-2:   8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* ---------------------------------------------------------------- shape ---- */

  --radius-sm:    6px;     /* buttons, inputs, chips, navigation items, tabs */
  --radius-md:   10px;     /* cards, menus, boxes inside a page */
  --radius-lg:   14px;     /* the workspace, side panels, board columns, toasts */
  --radius-full: 999px;    /* avatars, counts, tags, switches */

  /* ---------------------------------------------------------------- depth ---- */

  --elevation-0: none;                                                         /* flat: a border is enough */
  --elevation-1: 0 1px 2px rgba(29, 37, 20, 0.04);                             /* resting objects: cards, the active tab */
  --elevation-2: 0 4px 23px rgba(53, 70, 44, 0.035);                           /* the workspace sheet */
  --elevation-3: -9px 12px 46px rgba(54, 70, 35, 0.10), 0 3px 10px rgba(54, 70, 35, 0.035); /* side panels, menus */
  --elevation-4: 0 18px 44px rgba(40, 56, 20, 0.18), 0 2px 6px rgba(40, 56, 20, 0.06);       /* toasts */

  /* ---------------------------------------------------------------- motion ---- */

  --motion-instant: 120ms;                  /* menus, hover colour, tab changes */
  --motion-quick:   180ms;                  /* toasts and popovers appearing, fades */
  --motion-settle:  340ms;                  /* side panel, sidebar, the Olmi column */
  --motion-bump:    350ms;                  /* a count changing: the one bounce */
  --motion-breathe: 1400ms;                 /* Olmi's dot while it works */
  --ease-out:    cubic-bezier(0.2, 0.7, 0.3, 1);
  --ease-settle: cubic-bezier(0.22, 0.72, 0.18, 1);
  --ease-bump:   cubic-bezier(0.3, 1.6, 0.5, 1);

  /* ---------------------------------------------------------------- layout ---- */

  --sidebar-width:          218px;
  --sidebar-width-rail:      72px;
  --olmi-column-width:      400px;
  --topbar-height:           62px;
  --side-panel-width:       430px;
  --side-panel-width-wide:  460px;
  --shell-inset:              8px;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --motion-instant: 0ms; --motion-quick: 0ms; --motion-settle: 0ms; --motion-bump: 0ms; --motion-breathe: 0ms;
  }
}
