/*
 * admin/css/tokens.css — the admin's visual tokens. This file is their ONLY
 * home: every other admin stylesheet reads var(--…) and never repeats a value.
 *
 * Source: spec docs/superpowers/specs/2026-10-08-admin-redesign-design.md §6,
 * itself copied from FrontRow styles/admin/_admin.scss (.admin-app and its
 * [data-admin-theme='dark'] override), styles/tokens/_vars.scss (radii, ease,
 * fonts) and styles/components/_checkbox.scss (the admin checkbox).
 *
 * Light is the default. <html data-admin-theme="dark"> switches the palette;
 * ui/theme.js writes that attribute and the shell's no-flash script applies it
 * before first paint. The rail is dark in BOTH themes, so its tokens sit in the
 * theme-independent block.
 */

/* ── Light (default) — spec §6 table, light column ─────────────────────── */
:root,
[data-admin-theme="light"] {
  --bg: #f5f5f7;
  --text: #0d0d0f;
  --text-dim: rgba(13,13,15,.78);
  --text-faint: rgba(13,13,15,.62);
  --border: rgba(13,13,15,.12);
  --surface: rgba(13,13,15,.04);
  --surface-hi: rgba(13,13,15,.08);
  --glass-bg: rgba(255,255,255,.72);
  --accent: #0d0d0f;
  --accent-fg: #fff;
  --field-bg: rgba(13,13,15,.04);
  --danger: #c0392b;
  --success: #15803d;
  --warning: #8a4108;

  /* FrontRow companions of the table (same file, same values). */
  --field-focus-border: rgba(13,13,15,.5);
  /* The focus ring is the page ink. Declared beside --accent so it resolves
     on the same element and follows the theme. */
  --focus-ring: var(--accent);
  --cbx-bg: rgba(13,13,15,.43);
  /* Stat tile value ink (FrontRow _overview.scss). */
  --tile-cool-ink: #5b7a99;
  --tile-hot-ink: #d95e26;
  /* The transparency plate behind asset thumbnails. */
  --checker-a: #ffffff;
  --checker-b: #e4e4e8;
  /* Workspace header panel (FrontRow _workspace.scss): a light ground needs
     its own tint; the dark value over #f5f5f7 drops --text-dim under 4.5:1. */
  --header-bg: rgba(255,255,255,.55);
  /* The phone drawer's shadow (it lifts the dark rail off a light page). */
  --drawer-shadow: 0 0 40px rgba(0,0,0,.5);
  /* The select's own chevron (base.css .field-select), in --text-dim ink. */
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(13,13,15,.78)' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");

  color-scheme: light;
}

/* ── Dark — spec §6 table, dark column ──────────────────────────────────── */
[data-admin-theme="dark"] {
  --bg: #0d0d0f;
  --text: #ffffff;
  --text-dim: rgba(255,255,255,.78);
  --text-faint: rgba(255,255,255,.62);
  --border: rgba(255,255,255,.16);
  --surface: rgba(255,255,255,.045);
  --surface-hi: rgba(255,255,255,.085);
  --glass-bg: rgba(255,255,255,.04);
  --accent: #fff;
  --accent-fg: #0d0d0f;
  --field-bg: rgba(0,0,0,.24);
  --danger: #ff7a6b;
  --success: #6bd39a;
  --warning: #ffc65c;

  --field-focus-border: rgba(255,255,255,.5);
  --focus-ring: var(--accent);
  --cbx-bg: #fff;
  --tile-cool-ink: #8aaecc;
  --tile-hot-ink: #ff7a45;
  --checker-a: #2a2a2f;
  --checker-b: #1c1c20;
  --header-bg: rgba(0,0,0,.3);
  /* A shadow is invisible on near-black: the drawer gets a faint edge too. */
  --drawer-shadow: inset -1px 0 rgba(255,255,255,.08), 0 0 40px rgba(0,0,0,.7);
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,.78)' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");

  color-scheme: dark;
}

/* ── Theme-independent ──────────────────────────────────────────────────── */
:root {
  /* Radii (FrontRow tokens/_vars.scss) and the shapes spec §6 names. */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --radius-card: 20px;   /* cards, tiles, empty states */
  --radius-input: 6px;
  --radius-btn: 8px;
  --radius-pill: 999px;  /* tabs, chips */

  /* Motion. --ease for movement, --ease-ui for colour; most runs ~.18s. */
  --ease: cubic-bezier(.25,.8,.25,1);
  --ease-ui: ease-in-out;
  --dur: .18s;

  /* Fonts — loaded by the shell's <head>. */
  --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Rail — the same in both themes (spec §6 "Rail"). */
  --rail-bg: #08080a;
  --rail-text: rgba(255,255,255,.5);
  --rail-active-text: #fff;
  --rail-active-bg: rgba(255,255,255,.1);
  --rail-hover-bg: rgba(255,255,255,.07);
  --rail-group-bg: rgba(0,0,0,.2);
  /* FrontRow WorkspaceRail companions: group label chip, icon tile, the faint
     body every row has, the drawer's close button. */
  --rail-hdr-bg: rgba(0,0,0,.2);
  --rail-icon-bg: rgba(0,0,0,.4);
  --rail-row-bg: rgba(255,255,255,.015);
  --rail-close-border: rgba(255,255,255,.18);
  --rail-close-text: rgba(255,255,255,.7);

  /* Shell chrome: the phone drawer's 45% scrim, popover shadow (the drawer's
     shadow is per theme, above). */
  --scrim: rgba(0,0,0,.45);
  --popover-shadow: 0 8px 32px rgba(0,0,0,.16);

  /* Stat tile washes (spec §6). */
  --tile-cool: rgba(91,122,153,.12);
  --tile-warm: rgba(245,166,35,.12);
  --tile-hot: rgba(255,122,69,.12);
  --tile-green: rgba(107,191,138,.12);

  /* The admin checkbox: a flat filled circle with a dot (FrontRow _checkbox.scss). */
  --cbx-size: 20px;
  --cbx-dot: #000;
  --cbx-dot-scale: .75;
}
