/**
 * =============================================================================
 *                  SP BOUCHER | SOFTWARE & RESEARCH
 *             ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING
 * =============================================================================
 *
 * Project          : SPIDER — Universal Web Intelligence Engine
 * File             : apps/dashboard/css/base.css
 * Module           : Dashboard
 * Repository       : https://git.spboucher.ai/spider
 * Project Website  : Not specified
 * Created          : 2026-12-04
 * Last Modified    : 2026-12-04
 *
 * Author           : Simon-Pierre Boucher
 * Position         : Professor of Finance
 * Institution      : Université du Québec en Outaouais (UQO)
 * Organization     : SP Boucher
 * Website          : https://spboucher.ai
 * Git              : https://git.spboucher.ai
 *
 * Preferred Contact: contact@spboucher.ai
 * Development      : dev@spboucher.ai
 * Support          : support@spboucher.ai
 * Security/Admin   : admin@spboucher.ai
 *
 * Copyright (c) 2026
 * Simon-Pierre Boucher
 * All rights reserved where applicable. This file is governed by the
 * applicable project license, copyright notices and relevant law.
 * Existing third-party rights and notices remain unaffected.
 *
 * License          : ISC
 *
 * Do not embed credentials, private keys, access tokens,
 * certificates or confidential personal information.
 *
 * =============================================================================
 * END OF SP BOUCHER SOURCE HEADER
 * =============================================================================
 */

/* SPIDER dashboard — tokens, reset, typography, application frame.
   Identity: instrument panel / technical drawing. Ink on paper, hairline rules, one signal colour
   (cobalt) for interaction and live state, four semantic colours that are always paired with a
   shape and a text label. No gradients, no shadows used as decoration, no blur. */

:root {
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --paper: #f5f3ee;
  --surface: #fdfcf9;
  --sunken: #ece9e2;
  --ink: #16191d;
  --ink-2: #3f454d;
  --ink-3: #5f666f;
  --rule: #d5d1c7;
  --rule-2: #b9b4a8;
  --signal: #1d48c4;
  --signal-ink: #ffffff;
  --signal-wash: #e3e9fb;
  --ok: #17693b;
  --ok-wash: #e2f1e7;
  --partial: #8a5500;
  --partial-wash: #f7ecd4;
  --blocked: #5d3fa8;
  --blocked-wash: #ece6f8;
  --failed: #a8231c;
  --failed-wash: #f9e4e1;
  --neutral: #5f666f;
  --neutral-wash: #e9e6df;
  --mark: #ffe58a;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --nav-w: 216px;
  --bar-h: 52px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #111315;
  --surface: #181b1e;
  --sunken: #0c0e0f;
  --ink: #ebe8e2;
  --ink-2: #c0c4c9;
  --ink-3: #979da5;
  --rule: #2c3136;
  --rule-2: #454b52;
  --signal: #8eabff;
  --signal-ink: #0b1020;
  --signal-wash: #1b2540;
  --ok: #64c891;
  --ok-wash: #15281d;
  --partial: #e2ac52;
  --partial-wash: #2c2312;
  --blocked: #b7a2f2;
  --blocked-wash: #231d36;
  --failed: #f28b83;
  --failed-wash: #331917;
  --neutral: #979da5;
  --neutral-wash: #23272b;
  --mark: #6b5600;
  --box-ocr: #8eabff; --box-block: #979da5; --box-ev: #ffa257; --box-ev-fill: rgba(255, 162, 87, 0.16); --box-hover: rgba(142, 171, 255, 0.2); --box-hl: #ff6b6b;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 14px/1.45 var(--font-ui);
  font-feature-settings: "tnum" 1, "cv11" 1;
  min-height: 100vh;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure, pre { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1 { font-size: 20px; line-height: 1.2; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 15px; line-height: 1.3; font-weight: 650; }
h3 { font-size: 13px; line-height: 1.3; font-weight: 650; }
small, .small { font-size: 12px; }
a { color: var(--signal); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
code, kbd, samp, pre, .mono { font-family: var(--font-mono); font-size: 12.5px; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; }
hr { border: 0; border-top: 1px solid var(--rule); margin: var(--s4) 0; }
mark { background: var(--mark); color: inherit; padding: 0 1px; }
img { max-width: 100%; }
[hidden] { display: none !important; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: 1px; }

.muted { color: var(--ink-3); }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; word-break: break-word; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.unit { color: var(--ink-3); font-size: 0.85em; margin-left: 2px; font-weight: 400; }

/* ------------------------------------------------------------------ frame */
.skip-link {
  position: absolute; left: var(--s2); top: -48px; background: var(--ink); color: var(--paper);
  padding: var(--s2) var(--s3); z-index: 50; text-decoration: none;
}
.skip-link:focus { top: var(--s2); }

.frame { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); min-height: 100vh; }
.frame.bare { display: block; }

.side {
  border-right: 1px solid var(--rule); background: var(--surface);
}
.side-inner { position: sticky; top: 0; max-height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand {
  height: var(--bar-h); display: flex; align-items: center; gap: var(--s2);
  padding: 0 var(--s4); border-bottom: 1px solid var(--rule); flex: none;
  color: var(--ink); text-decoration: none;
}
.brand-mark { width: 18px; height: 18px; flex: none; }
.brand-name { font-family: var(--font-mono); font-weight: 700; letter-spacing: 0.22em; font-size: 13px; }
.brand-ver { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }

.nav { padding: var(--s3) 0 var(--s5); }
.nav-group + .nav-group { margin-top: var(--s3); }
.nav-label {
  font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3);
  padding: var(--s2) var(--s4) var(--s1); font-weight: 600;
}
.nav a {
  display: flex; align-items: center; gap: var(--s2); padding: 5px var(--s4) 5px calc(var(--s4) - 3px);
  color: var(--ink-2); text-decoration: none; border-left: 3px solid transparent; font-size: 13.5px;
}
.nav a:hover { color: var(--ink); background: var(--sunken); }
.nav a[aria-current="page"] { color: var(--ink); border-left-color: var(--signal); font-weight: 600; background: var(--sunken); }
.nav a:focus-visible { outline-offset: -2px; }

.main-col { min-width: 0; display: flex; flex-direction: column; }
.bar {
  height: var(--bar-h); display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s5);
  border-bottom: 1px solid var(--rule); background: var(--surface); position: sticky; top: 0; z-index: 10;
}
.bar-title { min-width: 0; display: flex; align-items: baseline; gap: var(--s3); flex: 1; }
.bar-title h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.bar-tools { display: flex; align-items: center; gap: var(--s2); flex: none; }
.who { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-btn { display: none; }

main { padding: var(--s5); min-width: 0; flex: 1; }
main:focus-visible { outline: none; }
.view { display: grid; gap: var(--s5); align-content: start; min-width: 0; }
.view > * { min-width: 0; }

.foot {
  border-top: 1px solid var(--rule); padding: var(--s3) var(--s5); color: var(--ink-3); font-size: 12px;
  display: flex; gap: var(--s4); flex-wrap: wrap; justify-content: space-between;
}

@media (max-width: 860px) {
  .frame { display: block; }
  .side { border-right: 0; border-bottom: 1px solid var(--rule); }
  .side-inner { position: static; max-height: none; }
  .side .nav { display: none; }
  .side.open .nav { display: block; }
  .brand { padding-right: var(--s2); }
  .menu-btn { display: inline-flex; margin-left: var(--s2); }
  .brand-ver { margin-left: auto; }
  .bar { padding: 0 var(--s3); position: static; }
  .who { display: none; }
  main { padding: var(--s3); }
  .view { gap: var(--s4); }
  h1 { font-size: 17px; }
  .crumb { display: none; }
  .foot { padding: var(--s3); }
}

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