/* Nuronteq UI tokens: the semantic layer shared by every surface (admin, portal, scanner, control).
   brand/tokens.css holds the fonts and the logo colours; this file says what each UI colour is for.

   Rules (IBM Carbon, adopted by Adeel 2026-11-07; they replace the indigo / Inter rules of UI Phase 2):
   - Carbon g10 is the light default; g100 applies on [data-theme="dark"], or on a dark OS unless [data-theme="light"].
     Each value is the Carbon token named beside it, so a designer can read the mapping both ways.
   - Blue 60 (#0F62FE) is the one interactive colour: buttons, selection bars and the 2 px focus ring in g10.
     Text links use --nq-accent-fg (Blue 70 in g10, Blue 40 in g100).
   - Body text is 4.5:1 or better on every ground, control borders and the focus ring 3:1 or better (WCAG AA).
     --nq-faint is for placeholders and disabled text only. tests/test_ui_tokens.py checks each pair in both themes.
   - Corners are square, and only floating items cast a shadow.
   - IBM Plex Sans for UI text with tabular numerals; IBM Plex Mono only for codes; Space Grotesk only in the logo. */

:root {
  color-scheme: light;

  /* Surfaces: $background, $layer-01, $layer-hover-01, $border-subtle-01 */
  --nq-bg: #f4f4f4;
  --nq-side: #ffffff;
  --nq-surface: #ffffff;
  --nq-hover: #e8e8e8; /* $layer-hover-01: row hover, quiet fills */
  --nq-line: #e0e0e0; /* $border-subtle-01 */
  --nq-line-strong: #c6c6c6; /* $border-subtle-02: section rules */
  --nq-control: #8d8d8d; /* $border-strong-01: field underline, checkbox: 3.32:1 on white */

  /* Text: $text-primary, $text-secondary, $text-placeholder */
  --nq-fg: #161616;
  --nq-muted: #525252;
  --nq-faint: #8d8d8d; /* placeholders and disabled text only */

  /* Interactive (Blue 60). --nq-accent fills buttons and selection bars; text links use --nq-accent-fg, Blue 70,
     because Blue 60 is 4.08:1 on a hovered row (Adeel's rule: a darker shade of the same family when one fails). */
  --nq-accent: #0f62fe; /* $interactive, $button-primary */
  --nq-accent-fg: #0043ce; /* $link-primary-hover used as the resting link colour */
  --nq-accent-hover: #002d9c; /* link hover (Blue 80) */
  --nq-pill: #e0e0e0; /* $layer-selected-01: selected rows, palette selection, the current route */
  --nq-pill-hover: #d1d1d1; /* $layer-selected-hover-01, $layer-accent-hover-01: hovered table header or selected row */
  --nq-pill-fg: #161616;
  --nq-teq: #5b5bff; /* "teq" in the wordmark: the logo, not UI */
  --nq-live: #198038; /* live indicators: $support-success at 3:1 or better */
  --nq-focus: #0f62fe; /* $focus */

  /* Fields (Carbon field anatomy, docs/carbon.md): $field-02 on a white layer, a $border-strong underline, placeholder
     text at 4.5:1. Support colours mark notifications and invalid fields next to words, never alone. */
  --nq-field: #f4f4f4; /* $field-02 */
  --nq-field-hover: #e8e8e8; /* $field-hover-02 */
  --nq-field-line: #8d8d8d; /* $border-strong-01: 3.02:1 on the field, 3.32:1 on white */
  --nq-field-placeholder: #636363;
  --nq-support-error: #da1e28;
  --nq-support-success: #24a148;
  --nq-support-warning: #f1c21b;
  --nq-support-info: #0043ce;

  /* Status: text on its own tint (Carbon low-contrast notification grounds, 70-grade text) */
  --nq-crit: #a2191f;
  --nq-crit-bg: #fff1f1;
  --nq-warn: #684e00;
  --nq-warn-bg: #fcf4d6;
  --nq-ok: #0e6027;
  --nq-ok-bg: #defbe6;
  --nq-info: #0043ce;
  --nq-info-bg: #edf5ff;
  --nq-neutral: #393939; /* also "Planned" */
  --nq-neutral-bg: #e0e0e0;

  /* Buttons (white text): $button-secondary, $button-primary, $button-danger and their hovers */
  --nq-btn: #393939;
  --nq-btn-hover: #474747;
  --nq-btn-default: #0f62fe;
  --nq-btn-default-hover: #0050e6;
  --nq-btn-danger: #da1e28;
  --nq-btn-danger-hover: #b81921;

  /* Depth: layers are told apart by colour; only floating items (menus, toasts, dialogs) cast Carbon's shadow */
  --nq-shadow-xs: none;
  --nq-shadow-sm: none;
  --nq-shadow-md: 0 2px 6px rgb(0 0 0 / 0.3);
  --nq-shadow-lg: 0 2px 6px rgb(0 0 0 / 0.3);
  --nq-shadow-overlay: 0 2px 6px rgb(0 0 0 / 0.3);
  --nq-backdrop: rgb(22 22 22 / 0.5); /* $overlay */

  /* Shape: Carbon corners are square. The names stay so every component keeps working. */
  --nq-radius-sm: 0px;
  --nq-radius-md: 0px;
  --nq-radius-lg: 0px;
  --nq-radius-xl: 0px;
  --nq-radius-2xl: 0px;
  --nq-radius-pill: 24px; /* tags only: Carbon tags are the one rounded shape */

  /* Spacing: the 2x grid. Layout uses multiples of 8; 4 px and 2 px only inside components. */
  --nq-space: 4px;

  /* Motion: Carbon productive durations and curves */
  --nq-duration-fast: 110ms; /* $duration-fast-02 */
  --nq-duration-base: 150ms; /* $duration-moderate-01 */
  --nq-duration-slow: 240ms; /* $duration-moderate-02 */
  --nq-ease: cubic-bezier(0.2, 0, 0.38, 0.9); /* productive standard */
  --nq-ease-emphasized: cubic-bezier(0.4, 0.14, 0.3, 1); /* expressive standard */

  /* Type: Carbon productive scale in IBM Plex Sans */
  --nq-text-meta: 0.75rem; /* 12/16 label-01, helper-text-01 */
  --nq-text-table: 0.875rem; /* 14/18 body-compact-01: row height sets density, not a smaller font */
  --nq-text-body: 0.875rem; /* 14/18 body-compact-01 */
  --nq-text-page-title: 1.75rem; /* 28/36 heading-04 */
  --nq-tracking-body: 0.16px;
  --nq-tracking-label: 0.32px;

  /* Shell header: Carbon's UI shell is Gray 100 in both themes, so these values do not change with the theme. */
  --nq-shell: #161616;
  --nq-shell-fg: #f4f4f4; /* 16.45:1 */
  --nq-shell-muted: #c6c6c6; /* 10.59:1 on the header, 8.86:1 on the search field */
  --nq-shell-line: #393939;
  --nq-shell-field: #262626;
  --nq-shell-hover: #333333;
  --nq-shell-teq: #2ee6d6; /* "teq" in the wordmark on Gray 100 (brand Signal Cyan) */
  --nq-shell-focus: #ffffff;

  /* Layout: the 2x grid (16 columns from 66rem / 1056 px, 8 from 42rem / 672 px, 4 below) */
  --nq-shell-h: 3rem;
  --nq-gutter: 2rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --nq-bg: #161616;
    --nq-side: #262626;
    --nq-surface: #262626;
    --nq-hover: #333333;
    --nq-line: #393939;
    --nq-line-strong: #525252;
    --nq-control: #6f6f6f;
    --nq-fg: #f4f4f4;
    --nq-muted: #c6c6c6;
    --nq-faint: #6f6f6f;
    --nq-accent: #0f62fe;
    --nq-accent-fg: #78a9ff;
    --nq-accent-hover: #a6c8ff;
    --nq-pill: #393939;
    --nq-pill-hover: #4c4c4c;
    --nq-pill-fg: #f4f4f4;
    --nq-teq: #2ee6d6;
    --nq-live: #42be65;
    --nq-focus: #ffffff;
    --nq-field: #393939;
    --nq-field-hover: #474747;
    --nq-field-line: #8d8d8d;
    --nq-field-placeholder: #bdbdbd;
    --nq-support-error: #fa4d56;
    --nq-support-success: #42be65;
    --nq-support-warning: #f1c21b;
    --nq-support-info: #4589ff;
    --nq-crit: #ff8389;
    --nq-crit-bg: #520408;
    --nq-warn: #f1c21b;
    --nq-warn-bg: #302400;
    --nq-ok: #6fdc8c;
    --nq-ok-bg: #022d0d;
    --nq-info: #a6c8ff;
    --nq-info-bg: #001d6c;
    --nq-neutral: #c6c6c6;
    --nq-neutral-bg: #393939;
    --nq-btn: #6f6f6f;
    --nq-btn-hover: #5e5e5e;
    --nq-btn-default: #0f62fe;
    --nq-btn-default-hover: #0050e6;
    --nq-btn-danger: #da1e28;
    --nq-btn-danger-hover: #b81921;
    --nq-shadow-xs: none;
    --nq-shadow-sm: none;
    --nq-shadow-md: 0 2px 6px rgb(0 0 0 / 0.8);
    --nq-shadow-lg: 0 2px 6px rgb(0 0 0 / 0.8);
    --nq-shadow-overlay: 0 2px 6px rgb(0 0 0 / 0.8);
    --nq-backdrop: rgb(0 0 0 / 0.6);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --nq-bg: #161616;
  --nq-side: #262626;
  --nq-surface: #262626;
  --nq-hover: #333333;
  --nq-line: #393939;
  --nq-line-strong: #525252;
  --nq-control: #6f6f6f;
  --nq-fg: #f4f4f4;
  --nq-muted: #c6c6c6;
  --nq-faint: #6f6f6f;
  --nq-accent: #0f62fe;
  --nq-accent-fg: #78a9ff;
  --nq-accent-hover: #a6c8ff;
  --nq-pill: #393939;
  --nq-pill-hover: #4c4c4c;
  --nq-pill-fg: #f4f4f4;
  --nq-teq: #2ee6d6;
  --nq-live: #42be65;
  --nq-focus: #ffffff;
  --nq-field: #393939;
  --nq-field-hover: #474747;
  --nq-field-line: #8d8d8d;
  --nq-field-placeholder: #bdbdbd;
  --nq-support-error: #fa4d56;
  --nq-support-success: #42be65;
  --nq-support-warning: #f1c21b;
  --nq-support-info: #4589ff;
  --nq-crit: #ff8389;
  --nq-crit-bg: #520408;
  --nq-warn: #f1c21b;
  --nq-warn-bg: #302400;
  --nq-ok: #6fdc8c;
  --nq-ok-bg: #022d0d;
  --nq-info: #a6c8ff;
  --nq-info-bg: #001d6c;
  --nq-neutral: #c6c6c6;
  --nq-neutral-bg: #393939;
  --nq-btn: #6f6f6f;
  --nq-btn-hover: #5e5e5e;
  --nq-btn-default: #0f62fe;
  --nq-btn-default-hover: #0050e6;
  --nq-btn-danger: #da1e28;
  --nq-btn-danger-hover: #b81921;
  --nq-shadow-xs: none;
  --nq-shadow-sm: none;
  --nq-shadow-md: 0 2px 6px rgb(0 0 0 / 0.8);
  --nq-shadow-lg: 0 2px 6px rgb(0 0 0 / 0.8);
  --nq-shadow-overlay: 0 2px 6px rgb(0 0 0 / 0.8);
  --nq-backdrop: rgb(0 0 0 / 0.6);
}

/* carbon-glyphs:begin */
/* Generated by portal/scripts/carbon-icons.mjs from @carbon/icons@11.90.0; do not edit by hand. Masks: paint
   them with background-color so they follow the theme. */
:root {
  --nq-glyph-error: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8,1C4.1,1,1,4.1,1,8s3.1,7,7,7s7-3.1,7-7S11.9,1,8,1z M10.7,11.5L4.5,5.3l0.8-0.8l6.2,6.2L10.7,11.5z'/%3E%3C/svg%3E");
  --nq-glyph-success: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8,1C4.1,1,1,4.1,1,8c0,3.9,3.1,7,7,7s7-3.1,7-7C15,4.1,11.9,1,8,1z M7,11L4.3,8.3l0.9-0.8L7,9.3l4-3.9l0.9,0.8L7,11z'/%3E%3C/svg%3E");
  --nq-glyph-warning: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8,1C4.2,1,1,4.2,1,8s3.2,7,7,7s7-3.1,7-7S11.9,1,8,1z M7.5,4h1v5h-1C7.5,9,7.5,4,7.5,4z M8,12.2 c-0.4,0-0.8-0.4-0.8-0.8s0.3-0.8,0.8-0.8c0.4,0,0.8,0.4,0.8,0.8S8.4,12.2,8,12.2z'/%3E%3C/svg%3E");
  --nq-glyph-invalid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8,1C4.2,1,1,4.2,1,8s3.2,7,7,7s7-3.1,7-7S11.9,1,8,1z M7.5,4h1v5h-1C7.5,9,7.5,4,7.5,4z M8,12.2 c-0.4,0-0.8-0.4-0.8-0.8s0.3-0.8,0.8-0.8c0.4,0,0.8,0.4,0.8,0.8S8.4,12.2,8,12.2z' fill='%23da1e28'/%3E%3Cpath d='M7.5,4h1v5h-1C7.5,9,7.5,4,7.5,4z M8,12.2c-0.4,0-0.8-0.4-0.8-0.8s0.3-0.8,0.8-0.8 c0.4,0,0.8,0.4,0.8,0.8S8.4,12.2,8,12.2z' opacity='1' fill='%23ffffff'/%3E%3C/svg%3E");
  --nq-glyph-warning-alt: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16.002,6.1714h-.004L4.6487,27.9966,4.6506,28H27.3494l.0019-.0034ZM14.875,12h2.25v9h-2.25ZM16,26a1.5,1.5,0,1,1,1.5-1.5A1.5,1.5,0,0,1,16,26Z'/%3E%3Cpath d='M29,30H3a1,1,0,0,1-.8872-1.4614l13-25a1,1,0,0,1,1.7744,0l13,25A1,1,0,0,1,29,30ZM4.6507,28H27.3493l.002-.0033L16.002,6.1714h-.004L4.6487,27.9967Z'/%3E%3C/svg%3E");
  --nq-glyph-info: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16,2A14,14,0,1,0,30,16,14,14,0,0,0,16,2Zm0,6a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,16,8Zm4,16.125H12v-2.25h2.875v-5.75H13v-2.25h4.125v8H20Z'/%3E%3C/svg%3E");
}
/* carbon-glyphs:end */
