/*
 * TMS (DigiTasks) design tokens, v0.1, 2026-10-21.
 * Source of truth: the "DigiTasks redesign" canvas (Foundations artboard).
 * Every colour, size and shadow the components use lives here as a custom property.
 */

/* Fonts: self-hosted, no CDN. Put the woff2 files in /fonts (see HANDOFF.md, section 2). */
@font-face {
  font-family: "Inter";
  src: url("../fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/SourceSans3VF-Upright.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/SourceSans3VF-Italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

:root {
  /* Type */
  --font-ui: "Inter", "Segoe UI", system-ui, sans-serif;
  /* Brand type: the TMS lockup and the loader. (No Myriad Pro: there is no web licence.) */
  --font-brand: "Source Sans 3", "Segoe UI", sans-serif;

  --fs-kpi: 34px;    --lh-kpi: 38px;   /* 700, tracking -0.02em */
  --fs-h1: 28px;     --lh-h1: 34px;    /* 700, tracking -0.02em */
  --fs-section: 20px; --lh-section: 26px; /* 700 */
  --fs-h2: 17px;     --lh-h2: 24px;    /* 650 */
  --fs-h3: 16px;     --lh-h3: 22px;    /* 700 */
  --fs-body: 14px;   --lh-body: 20px;  /* 400 */
  --fs-small: 12.5px; --lh-small: 16px; /* 500 */
  --fs-label: 11.5px; --lh-label: 16px; /* 600, caps, tracking 0.04em */

  /* Spacing (4 px base) */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-7: 32px; --sp-8: 48px;

  /* Radii */
  --r-tag: 7px;    /* department chips, small tags */
  --r-ctl: 10px;   /* buttons, inputs, selects, nav items */
  --r-card: 16px;  /* cards, panels */
  --r-pill: 999px; /* status pills, filter chips, badges */

  /* Elevation */
  --sh-card: 0 1px 2px rgba(16, 42, 48, 0.04), 0 6px 20px rgba(16, 42, 48, 0.04);
  --sh-panel: 0 1px 2px rgba(16, 42, 48, 0.04), 0 12px 32px rgba(16, 42, 48, 0.08);
  --sh-pop: 0 12px 32px rgba(16, 42, 48, 0.14);
  --sh-toast: 0 12px 32px rgba(16, 42, 48, 0.24);
  --focus: rgba(14, 140, 153, 0.45);
  --focus-soft: rgba(14, 140, 153, 0.18);

  /* Brand (Medpark) */
  --teal-600: #0E8C99;       /* rings, icons, focus, accents. NOT for white text (4.0:1) */
  --teal-700: #0A6C77;       /* primary buttons, links, active chip (6.1:1 with white) */
  --teal-700-hover: #085A63;
  --teal-800: #0B4D55;       /* sidebar */
  --teal-50: #E4F2F4;        /* tints, selected */
  --teal-light: #7FE0E8;     /* accents on the dark sidebar */
  --teal-bar-dark: #5CCFD9;  /* loader bar on deep teal */
  --brand-orange: #EA703D;   /* TMS lockup bar, loader dots (decorative only) */
  --badge-new: #BF4C1C;      /* "2 new" badge: white text 4.9:1 */
  --logo-grey: #4D4D4F;

  /* Neutrals */
  --ink: #17262B;            /* headings, numbers */
  --text-strong: #1E2A2F;
  --body: #333333;
  --text-2: #3A4449;
  --text-3: #4A5459;
  --muted: #5F686E;          /* secondary text; passes AA on --page too */
  --disabled: #9AA3A8;
  --line: #DFE4E6;
  --line-card: #E3E8EA;
  --line-soft: #EEF2F3;
  --control-border: #D5DDE0;
  --track: #EEF2F3;          /* progress bar tracks */
  --chip-bg: #F1F4F5;        /* department chips */
  --seg-bg: #EAF0F1;         /* segmented control track */
  --table-head: #F7FAFA;
  --row-hover: #F5F9FA;
  --row-selected: #E6F3F4;
  --page: #F2F6F7;
  --surface: #FFFFFF;

  /* Sidebar (deep teal, default) */
  --sb-bg: var(--teal-800);
  --sb-fg: #FFFFFF;
  --sb-nav: #DCEDEF;
  --sb-muted: #B9D6D9;
  --sb-line: rgba(255, 255, 255, 0.16);
  --sb-active-bg: rgba(255, 255, 255, 0.14);
  --sb-active-fg: #FFFFFF;
  --sb-card: rgba(255, 255, 255, 0.08);
  --sb-border: 0;
  --sb-logo-filter: brightness(0) invert(1);
  --lockup-fg: #FFFFFF;
  --lockup-muted: #B9D6D9;

  /* Indicator palette: solid / tint / text-on-tint */
  --blue: #2563EB;    --blue-tint: #DBEAFE;    --blue-text: #1D4ED8;
  --violet: #7C3AED;  --violet-tint: #EDE9FE;  --violet-text: #6D28D9;
  --orange: #EA580C;  --orange-tint: #FFEDD5;  --orange-text: #9A3412;
  --green: #16A34A;   --green-tint: #DCFCE7;   --green-text: #166534;
  --amber: #F59E0B;   --amber-tint: #FEF3C7;   --amber-text: #92400E;
  --pink: #DB2777;    --pink-tint: #FCE7F3;    --pink-text: #BE185D;
  --cyan: #0891B2;    --cyan-tint: #CFFAFE;    --cyan-text: #0E7490;
  --rose: #E11D48;    --rose-tint: #FFE4E6;    --rose-text: #BE123C;
  --slate: #94A3B8;   --slate-tint: #F1F5F9;   --slate-text: #475569;

  /* Incoming request statuses */
  --st-started-fg: var(--blue-text);    --st-started-bg: var(--blue-tint);    --st-started-dot: var(--blue);
  --st-progress-fg: var(--amber-text);  --st-progress-bg: var(--amber-tint);  --st-progress-dot: var(--amber);
  --st-hold-fg: var(--violet-text);     --st-hold-bg: var(--violet-tint);     --st-hold-dot: var(--violet);
  --st-done-fg: var(--green-text);      --st-done-bg: var(--green-tint);      --st-done-dot: var(--green);
  --st-rejected-fg: var(--slate-text);  --st-rejected-bg: var(--slate-tint);  --st-rejected-dot: var(--slate);

  /* HIS task statuses */
  --his-worklist: var(--blue);   --his-progress: var(--amber); --his-ontest: var(--cyan);
  --his-completed: var(--green); --his-postponed: var(--violet);
  --his-cancelled: var(--slate); --his-refused: var(--rose);

  /* Quarter headline figures */
  --hl-plan: var(--blue);
  --hl-accepted: var(--violet);
  --hl-bugs: var(--orange);
  --hl-internal: var(--green);
  --hl-overall: var(--teal-600);

  /* HIS modules */
  --mod-medapp: var(--blue);   --mod-clinic: var(--teal-600); --mod-finance: var(--amber);
  --mod-it: var(--violet);     --mod-reception: var(--pink);  --mod-administration: var(--orange);

  /* Weak objective sections: 60% and below is weak, turning redder as it drops */
  --weak-1-bg: var(--amber-tint);  --weak-1-fg: var(--amber-text);  /* 41-60 % */
  --weak-2-bg: var(--orange-tint); --weak-2-fg: var(--orange-text); /* 21-40 % */
  --weak-3-bg: var(--rose-tint);   --weak-3-fg: var(--rose-text);   /* 0-20 % */

  /* Warnings and errors */
  --warn-fg: #C2410C;          /* "7 days" waiting text, 5.2:1 */
  --warn-chip-bg: #FFF4EA;
  --warn-chip-fg: #9A3412;
  --danger: #B91C1C;
  --danger-hover: #991B1B;
  --danger-disabled: #E9B7B7;
  --danger-bg: #FFF7F7;
  --danger-line: #FBD5D5;
  --primary-disabled: #A9C9CD;
}

/* Light sidebar option (Tweaks: Sidebar = Light) */
.tms-sidebar--light {
  --sb-bg: #FFFFFF;
  --sb-fg: #1E2A2F;
  --sb-nav: #3A4449;
  --sb-muted: #5F686E;
  --sb-line: #E3E8EA;
  --sb-active-bg: #E4F2F4;
  --sb-active-fg: #0A6C77;
  --sb-card: #F3F7F8;
  --sb-border: 1px solid #E3E8EA;
  --sb-logo-filter: none;
  --lockup-fg: #4D4D4F;
  --lockup-muted: #5F686E;
}
