/* ===== Open Sans (self-hosted) =====
   Vendored locally rather than fetched from fonts.googleapis.com so NIX has no
   external runtime dependency: the app must render identically on an air-gapped
   or proxy-restricted on-premise LAN (DEPLOYMENT/Windeploy.md), and an HRIS must
   not disclose every user IP or User-Agent to a third party on each page load.
   Variable font (weight 300 to 800) in one file per subset, matching the same
   Google-served definition and subset list this file used for Inter before the
   swap, with the URLs pointed at ../fonts/. Keeping every subset preserves
   glyph coverage exactly; browsers still fetch only the subsets a page needs,
   via unicode-range. Open Sans is SIL Open Font License 1.1, confirmed against
   the official Google Fonts download manifest for this family - see
   ../fonts/OFL.txt. font-display: swap is retained so text paints immediately
   in the fallback stack (Segoe UI/Roboto/Arial) and swaps when Open Sans
   arrives. */
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('../fonts/open-sans-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('../fonts/open-sans-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('../fonts/open-sans-greek-ext.woff2') format('woff2');
  unicode-range: U+1F00-1FFF;
}
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('../fonts/open-sans-greek.woff2') format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('../fonts/open-sans-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('../fonts/open-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('../fonts/open-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ===== Design tokens =====
   NIX is a light-theme-only application: :root carries the complete light
   palette and the theme-agnostic scales, and there is deliberately no
   [data-theme="dark"] override block - the dark-mode feature was removed
   because its live prefers-color-scheme listener flipped the whole app
   whenever the OS/browser preference changed. Every --nix-* consumed anywhere
   in NIX resolves here. Add a token here rather than hard-coding a color in a
   component. */
:root {
  color-scheme: light;

  /* Palette - light only. NIX is a light-theme-only application; there is no [data-theme="dark"]
     override block. */
  --nix-bg: #f6f8fc;
  --nix-surface: #ffffff;
  --nix-surface-2: #f1f4f8;
  --nix-submenu-bg: #f5f3f8;
  --nix-primary-soft: #eeecff;
  --nix-summary-surface: #f1f6fb;
  --nix-text: #14213d;
  --nix-muted: #64748b;
  --nix-primary: #4f46e5;
  --nix-primary-strong: #4338ca;
  --nix-accent: #0891b2;
  --nix-success: #15803d;
  --nix-success-soft: #e8f5ec;
  --nix-success-text: #166534;
  --nix-warning: #d97706;
  --nix-danger: #dc2626;
  --nix-border: #dfe5f2;
  --nix-shadow: rgba(15, 23, 42, 0.12);
  --nix-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --nix-shadow-md: 0 2px 6px rgba(15, 23, 42, 0.08);
  --nix-shadow-lg: 0 4px 12px rgba(15, 23, 42, 0.12);

  /* Theme-agnostic scales */
  --nix-font-sans: 'Open Sans', 'Segoe UI', Roboto, Arial, sans-serif;
  --nix-font-display: 'Open Sans', 'Segoe UI', Roboto, Arial, sans-serif;
  --nix-font-size-2xs: 0.6875rem;
  --nix-font-size-xs: 0.75rem;
  --nix-font-size-sm: 0.8125rem;
  --nix-font-size-md: 0.875rem;
  --nix-font-size-lg: 1rem;
  --nix-font-size-xl: 1.125rem;
  --nix-font-size-2xl: 1.25rem;
  --nix-font-size-3xl: 1.375rem;
  --nix-radius-sm: 0.5rem;
  --nix-radius-md: 0.5625rem;
  --nix-radius-lg: 0.75rem;
  --nix-space-1: 0.25rem;
  --nix-space-1-5: 0.375rem;
  --nix-space-2: 0.5rem;
  --nix-space-3: 0.75rem;
  --nix-space-4: 1rem;
  --nix-space-5: 1.25rem;
  --nix-space-6: 2rem;
  --nix-transition-fast: 150ms ease-in-out;
  --nix-transition-base: 0.2s ease;
  --nix-transition-slow: 300ms ease-in-out;

  font-family: var(--nix-font-sans);
  background: var(--nix-bg);
  color: var(--nix-text);
}

/* Centralized typography: every plain text node and every raw Bootstrap
   control (not just the tokenized nix and workspace classes) reads from
   the font size scale above. This file loads after bootstrap.css and
   app.css (see the link order in Components dot App dot razor), so these
   rules win the cascade without needing the important flag. Setting
   font-size on body (not html) is deliberate: every spacing, radius, and
   button-height token is expressed in rem, which resolves against the
   unchanged html root, so this cannot shrink those already-tuned
   component dimensions - it only affects inherited text sizing. */
body {
  font-size: var(--nix-font-size-sm);
}

h1, .h1 { font-size: var(--nix-font-size-3xl); font-weight: 700; }
h2, .h2 { font-size: var(--nix-font-size-2xl); font-weight: 700; }
h3, .h3 { font-size: var(--nix-font-size-xl); font-weight: 600; }
h4, .h4 { font-size: var(--nix-font-size-lg); font-weight: 600; }
h5, .h5 { font-size: var(--nix-font-size-md); font-weight: 600; }
h6, .h6 { font-size: var(--nix-font-size-sm); font-weight: 600; }

.btn {
  font-size: var(--nix-font-size-sm);
}

.form-control,
.form-select {
  font-size: var(--nix-font-size-sm);
}

.nix-theme-provider {
  min-height: 100vh;
  background: var(--nix-bg);
  color: var(--nix-text);
}

.nix-shell {
  min-height: 100vh;
  padding: var(--nix-space-5) var(--nix-space-1);
}

/* The page header (title/description) is not a card - it sits directly on the page background,
   with no border/shadow, so it reads as page chrome rather than another floating box. */
.nix-shell__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0 var(--nix-space-3);
  margin-bottom: var(--nix-space-3);
  border-bottom: 1px solid var(--nix-border);
}

.nix-shell__header h2 {
  font-size: var(--nix-font-size-3xl);
  font-weight: 700;
}

.nix-shell__header p {
  font-size: var(--nix-font-size-sm);
}

.nix-shell__footer,
.nix-shell__panel,
.nix-shell__card,
.nix-shell__stat-card {
  background: var(--nix-surface);
  border: 1px solid var(--nix-border);
  border-radius: var(--nix-radius-md);
  box-shadow: none;
}

.nix-shell__content {
  display: grid;
  gap: var(--nix-space-5);
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.nix-shell__panel,
.nix-shell__card,
.nix-shell__stat-card {
  padding: var(--nix-space-4);
}

.nix-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.25rem;
  padding: 0.375rem 0.75rem;
  border-radius: var(--nix-radius-sm);
  border: 1px solid var(--nix-border);
  background: var(--nix-surface);
  color: var(--nix-text);
  box-shadow: none;
  text-decoration: none;
  font-size: var(--nix-font-size-sm);
  font-weight: 500;
  transition: border-color var(--nix-transition-base), background var(--nix-transition-base);
}

.nix-button:hover {
  border-color: var(--nix-primary);
  background: var(--nix-surface-2);
}

.nix-button:focus-visible {
  outline: 2px solid var(--nix-primary);
  outline-offset: 2px;
}

.nix-button--primary {
  background: var(--nix-primary);
  color: white;
  border-color: var(--nix-primary);
}

.nix-button--primary:hover {
  background: var(--nix-primary-strong);
  border-color: var(--nix-primary-strong);
}

.nix-button--ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.nix-button--ghost:hover {
  background: var(--nix-surface-2);
  border-color: transparent;
}

.nix-card {
  border-radius: var(--nix-radius-md);
  border: 1px solid var(--nix-border);
  background: var(--nix-surface);
  box-shadow: none;
  padding: var(--nix-space-4);
}

.nix-text-muted {
  color: var(--nix-muted);
}

/* ===== Dashboard charts (donut, stacked bar, single-hue bar list) =====
   Built from existing NIX tokens only - no new palette added. Status colors
   (nix-warning/success/danger/muted/primary) are always paired with the
   nix-chart-legend list below the mark, never color alone. */
.nix-donut {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 8.5rem;
  height: 8.5rem;
  margin: 0 auto;
}

.nix-donut__svg {
  width: 100%;
  height: 100%;
}

.nix-donut__track {
  stroke: var(--nix-surface-2);
  stroke-width: 4;
}

.nix-donut__segment {
  stroke-width: 4;
  stroke-linecap: butt;
  transition: stroke-dasharray var(--nix-transition-base);
}

.nix-donut__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.nix-donut__center strong {
  font-size: var(--nix-font-size-3xl);
  font-weight: 700;
  color: var(--nix-text);
  line-height: 1.1;
}

.nix-donut__center span {
  font-size: var(--nix-font-size-2xs);
  color: var(--nix-muted);
}

.nix-chart-legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--nix-space-2) var(--nix-space-4);
  justify-content: center;
  margin: var(--nix-space-3) 0 0;
  padding: 0;
}

.nix-chart-legend__item {
  display: inline-flex;
  align-items: center;
  gap: var(--nix-space-1-5);
  font-size: var(--nix-font-size-xs);
  color: var(--nix-muted);
}

.nix-chart-legend__swatch {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 999px;
  flex-shrink: 0;
}

.nix-chart-legend__label {
  color: var(--nix-text);
}

.nix-chart-legend__value {
  color: var(--nix-text);
  font-weight: 700;
}

.nix-stacked-bar {
  display: flex;
  align-items: stretch;
  height: 1.5rem;
  gap: 2px;
  border-radius: var(--nix-radius-sm);
  overflow: hidden;
}

.nix-stacked-bar__segment {
  border-radius: 4px;
  min-width: 4px;
}

.nix-bar-list {
  display: flex;
  flex-direction: column;
  gap: var(--nix-space-3);
}

.nix-bar-list__row {
  display: flex;
  flex-direction: column;
  gap: var(--nix-space-1);
}

.nix-bar-list__label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: var(--nix-font-size-sm);
}

.nix-bar-list__label strong {
  color: var(--nix-text);
  font-weight: 700;
}

.nix-bar-list__track {
  height: 0.5rem;
  background: var(--nix-surface-2);
  border-radius: var(--nix-radius-sm);
  overflow: hidden;
}

.nix-bar-list__fill {
  height: 100%;
  border-radius: 0 4px 4px 0;
  transition: width var(--nix-transition-base);
}

@media (max-width: 480px) {
  .nix-shell {
    padding: var(--nix-space-4) var(--nix-space-2);
  }

  .nix-shell__content {
    grid-template-columns: 1fr;
  }

  .nix-shell__header {
    flex-wrap: wrap;
  }
}
