/* =========================================================================
   Guardian RFID — OD & CC Tools App
   Design tokens: color, typography, spacing, shape, motion
   Dark theme only. Direction: "Console" — terminal / data-grid aesthetic.
   Near-black warm-neutral canvas · Titillium Web + JetBrains Mono · Guardian red.
   Fonts are self-hosted (GovCloud environments may block external CDNs).
   ========================================================================= */

/* ----- Self-hosted fonts ----- */
@font-face {
  font-family: 'Titillium Web';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/titillium-web-300.woff2') format('woff2');
}
@font-face {
  font-family: 'Titillium Web';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/titillium-web-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Titillium Web';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/titillium-web-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Titillium Web';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/titillium-web-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Titillium Web';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('../fonts/titillium-web-900.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 700;            /* variable font covers 400 / 500 / 700 */
  font-display: swap;
  src: url('../fonts/jetbrains-mono-var.woff2') format('woff2');
}

:root {
  /* ----- Warm neutral ramp (near-black, low-chroma warm) ----- */
  --bg-0:        #0c0b0a;   /* sidebar / deepest */
  --bg-1:        #121110;   /* page canvas (carries faint grid) */
  --bg-2:        #1a1816;   /* cards, topbar */
  --bg-3:        #262320;   /* hover, input fill */
  --bg-input:    #0e0d0c;   /* field interior */

  --line:        #312d28;   /* hairline borders */
  --line-soft:   #211e1b;   /* faint row dividers */
  --line-strong: #443e36;   /* emphasized edges, stat-tile top rules */

  --fg-1:        #f0ede8;   /* headings */
  --fg-2:        #c7c0b6;   /* body */
  --fg-3:        #8c8378;   /* labels, timestamps, mono captions */
  --fg-muted:    #756a5f;   /* placeholder, disabled */

  /* ----- Brand (Guardian red) ----- */
  --brand:       #d8332f;   /* accent, focus border, active icon, > caret */
  --brand-2:     #b3201f;   /* primary fill, active nav */
  --brand-3:     #8f1719;   /* pressed */
  --brand-ink:   #ffece9;   /* text on brand fill */
  --brand-ring:  rgba(216, 51, 47, 0.34);  /* focus halo */
  --brand-wash:  rgba(216, 51, 47, 0.12);  /* tints, active nav bg */

  /* ----- Semantic state ----- */
  --success:     #4fd394;
  --warning:     #f2b03c;
  --error:       #f5736f;
  --info:        #6ba6f0;

  --success-bg:  rgba(79, 211, 148, 0.13);
  --warning-bg:  rgba(242, 176, 60, 0.13);
  --error-bg:    rgba(245, 115, 111, 0.13);
  --info-bg:     rgba(107, 166, 240, 0.13);

  /* ----- System notices ----- */
  --footer-bg:   #7a3d10;   /* security notice strip */
  --footer-bd:   #f2b03c;
  --audit-bg:    #7c1f1f;   /* audit DB warning strip */

  /* ----- Typography ----- */
  --font-sans:   "Titillium Web", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:   "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;

  --fs-xs:   12px;
  --fs-sm:   13px;
  --fs-base: 14px;
  --fs-md:   15px;
  --fs-lg:   18px;
  --fs-xl:   22px;
  --fs-2xl:  28px;
  --fs-3xl:  36px;

  --fw-light:   300;
  --fw-regular: 400;
  --fw-semi:    600;
  --fw-bold:    700;
  --fw-black:   900;

  --lh-tight: 1.15;
  --lh-snug:  1.4;
  --lh-body:  1.55;

  /* ----- Spacing scale (4px base) ----- */
  --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;

  /* short aliases used by component styles */
  --s1: var(--space-1);  --s2: var(--space-2);  --s3: var(--space-3);
  --s4: var(--space-4);  --s5: var(--space-5);  --s6: var(--space-6);
  --s8: var(--space-8);  --s10: var(--space-10); --s12: var(--space-12);

  /* ----- Layout ----- */
  --sidebar-w:   248px;
  --topbar-h:    60px;
  --content-max: 1100px;
  --content-pad: 32px;

  /* ----- Radius (Console — sharp) ----- */
  --radius-sm:   2px;   /* inputs, buttons, chips, icon tiles */
  --radius-md:   3px;   /* sub-cards, tables */
  --radius-lg:   4px;   /* page cards */
  --radius-pill: 3px;   /* status tokens / chips (kept as dot + tinted chip) */

  /* short aliases used by component styles */
  --r-sm:   var(--radius-sm);
  --r-md:   var(--radius-md);
  --r-lg:   var(--radius-lg);
  --r-pill: var(--radius-pill);

  /* ----- Elevation (Console is flat — borders + grid do the work) ----- */
  --shadow-card:   none;
  --shadow-sticky: 0 1px 0 rgba(0, 0, 0, 0.40);
  --shadow-lift:   none;

  /* ----- Card structure ----- */
  --card-pad:    22px;
  --card-bg:     var(--bg-2);
  --card-shadow: var(--shadow-card);
  --card-border: 1px solid var(--line);
  --section-gap: var(--space-6);

  /* ----- Motion ----- */
  --ease:      cubic-bezier(.2, .7, .2, 1);
  --dur-fast:  110ms;
  --dur-base:  200ms;
}

/* =========================================================================
   Base
   ========================================================================= */
body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  color: var(--fg-2);
  background: var(--bg-1);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Console signature: faint engineering grid on the app canvas.
   Apply to the top-level app container. */
.bg-grid {
  background:
    repeating-linear-gradient(0deg,  rgba(255,255,255,0.015) 0 1px, transparent 1px 40px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.015) 0 1px, transparent 1px 40px),
    var(--bg-1);
}

/* =========================================================================
   Semantic type roles — apply these classes anywhere
   ========================================================================= */
.t-page-title {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  color: var(--fg-1);
  letter-spacing: -0.01em;
}

/* Console section header convention: monospace, lowercase, red prompt caret.
   Markup:  <h2 class="t-section">recent_actions</h2>  →  > recent_actions */
.t-section {
  font-family: var(--font-mono);
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  color: var(--fg-1);
  text-transform: lowercase;
  letter-spacing: 0;
}
.t-section::before { content: "> "; color: var(--brand); }

.t-h2 {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--fg-1);
  line-height: var(--lh-snug);
  letter-spacing: -0.01em;
}

.t-h3 {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--fg-1);
}

.t-body {
  font-size: var(--fs-base);
  color: var(--fg-2);
  line-height: var(--lh-body);
}

.t-label {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semi);
  color: var(--fg-2);
  letter-spacing: 0.01em;
}

/* Console stat/eyebrow label: mono, uppercase, tracked */
.t-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: var(--fw-semi);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-3);
}

.t-caption {
  font-size: var(--fs-xs);
  color: var(--fg-3);
}

.t-meta {                       /* timestamps, IDs, low-key metadata */
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--fg-3);
  font-variant-numeric: tabular-nums;
}

.t-th {                         /* table headers — uppercase tracked */
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-3);
}

.t-mono {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--fg-2);
}

.t-mono-sm {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--fg-3);
}
