/* =====================================================================
   ONTIVITY DESIGN SYSTEM · brand/ontivity.css
   Served at https://ontivity.cc/brand/ontivity.css (public, cached).
   Single source of truth for colour, type and base components used by
   the Control Center, Audit Analytics, the login page and (later) mobile.
   Palette is derived from ontivity.com. To change a brand colour, change it here only.
   ===================================================================== */

/* ---------- Fonts (self-hosted, latin subset) ---------- */
@font-face { font-family: 'Bai Jamjuree'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/baijamjuree-500.woff2') format('woff2'); }
@font-face { font-family: 'Bai Jamjuree'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/baijamjuree-600.woff2') format('woff2'); }
@font-face { font-family: 'Bai Jamjuree'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/baijamjuree-700.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/barlow-400.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/barlow-500.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/barlow-600.woff2') format('woff2'); }
@font-face { font-family: 'Azeret Mono'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('fonts/azeretmono-var.woff2') format('woff2'); }

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;

  /* Surfaces: near-black navy, stepping up toward Ontivity navy */
  --bg:            #07111C;
  --surface-1:     #0C1A28;   /* sidebar, topbar, panels */
  --surface-2:     #112236;   /* cards, inputs, table header */
  --surface-3:     #17304A;   /* hover, raised, selected */
  --border:        #1C3350;
  --border-strong: #2A4A6E;
  --line-subtle:   rgba(232, 238, 245, 0.06);

  /* Brand (ontivity.com) */
  --navy:       #112F5B;
  --slate:      #22495A;
  --blue:       #1FA0FC;
  --blue-hover: #4FB5FD;
  --blue-deep:  #1166A7;
  --blue-pale:  #9EC4E2;
  --lime:       #CBE83B;
  --lime-soft:  #E1F096;
  --ink:        #06121E;      /* text on blue / lime fills */
  --white:      #FFFFFF;      /* text on saturated fills (red badges, company chips) */

  /* Text */
  --text:   #E8EEF5;
  --text-2: #A9BCD0;
  --text-3: #7590AD;          /* labels, axes: min 4.5:1 on surface-1/2 */
  --text-4: #4A6580;          /* decorative / disabled only */

  /* Status: same meaning everywhere */
  --c-pending:      #8FB8C9;
  --c-inprogress:   #1FA0FC;
  --c-onhold:       #F6A000;
  --c-complete:     #CBE83B;
  --c-overdue:      #EC4230;
  --c-overdue-text: #FF6B5A;
  --c-cancelled:    #8F8F8F;

  /* Legacy companies: always shown with their abbreviation */
  --co-mw:  #7C8CFF;
  --co-er:  #D9A45B;
  --co-lt:  #B38BFF;
  --co-et:  #F27DB0;
  --co-cms: #34CDBA;

  /* Type */
  --font-display: 'Bai Jamjuree', 'Barlow', system-ui, sans-serif;
  --font-ui:      'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:    'Azeret Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;

  /* Shape & depth */
  --radius-sm: 4px;
  --radius:    6px;
  --radius-lg: 10px;
  --shadow:    0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 24px 60px rgba(0, 0, 0, 0.6);

  /* Spacing scale */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;

  /* Signature: the lime "signal" indicator */
  --signal-w: 2px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.005em;
  color: var(--text);
  margin: 0;
}

a { color: var(--blue); }
a:hover { color: var(--blue-hover); }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

::selection { background: color-mix(in srgb, var(--blue) 35%, transparent); color: var(--text); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }
* { scrollbar-color: var(--border) transparent; scrollbar-width: thin; }

/* ---------- Utilities ---------- */
.o-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.o-mono { font-family: var(--font-mono); }
.o-num  { font-variant-numeric: tabular-nums; }

/* ---------- Components ---------- */
.o-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.o-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  font: 600 14px/1 var(--font-ui);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.o-btn:hover { background: var(--surface-3); border-color: var(--blue-deep); }
.o-btn-primary { background: var(--blue); border-color: var(--blue); color: var(--ink); }
.o-btn-primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); color: var(--ink); }

.o-input, .o-select {
  height: 36px; padding: 0 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text);
  font: 400 14px var(--font-ui);
}
.o-input::placeholder { color: var(--text-4); }
.o-input:focus, .o-select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 25%, transparent); }

/* Badge: set --c to any status/company token */
.o-badge {
  --c: var(--text-3);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--c) 32%, transparent);
  background: color-mix(in srgb, var(--c) 14%, transparent);
  color: var(--c);
  font: 500 11px/1.3 var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Signal-arc motif (wireless infrastructure): decorative background */
.o-arcs {
  background-image: url('arcs.svg');
  background-repeat: no-repeat;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
