/* =====================================================================
   Finance IDE – Design-Tokens (Single Source of Truth, D-53)
   Basis (D-100): Hell als Default, Dunkel nur manuell ([data-theme="dark"]),
   IBM Plex Sans, scharfe Ecken, luftige Dichte.
   Regel: Komponenten nutzen NUR diese Variablen, nie Rohwerte.
   ===================================================================== */

:root {
  /* ---- Schrift (D-106) ---------------------------------------------
     --font-sans    = Inter: Fließtext und alle Größen bis --fs-base
     --font-display = IBM Plex Sans: --fs-lg bis --fs-3xl (Überschriften, Kennzahlen) */
  --font-sans: "FI Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "FI Plex", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;

  --fs-2xs: 0.6875rem;  /* 11 */
  --fs-xs: 0.75rem;     /* 12 */
  --fs-sm: 0.8125rem;   /* 13 */
  --fs-md: 0.875rem;    /* 14 – Standard in dichter UI */
  --fs-base: 0.9375rem; /* 15 */
  --fs-lg: 1.125rem;    /* 18 */
  --fs-xl: 1.375rem;    /* 22 */
  --fs-2xl: 1.75rem;    /* 28 */
  --fs-3xl: 2.25rem;    /* 36 – Kennzahlen */

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --lh-tight: 1.2;
  --lh-base: 1.5;

  /* ---- Dichte & Abstände (4er-Raster × Dichte "luftig") ----------- */
  --density: 1.15;
  --sp-1: calc(4px * var(--density));
  --sp-2: calc(8px * var(--density));
  --sp-3: calc(12px * var(--density));
  --sp-4: calc(16px * var(--density));
  --sp-5: calc(20px * var(--density));
  --sp-6: calc(24px * var(--density));
  --sp-8: calc(32px * var(--density));
  --sp-10: calc(40px * var(--density));
  --control-h: calc(32px * var(--density));

  /* ---- Radien (scharf) ------------------------------------------- */
  --r-xs: 2px;
  --r-sm: 3px;
  --r-md: 4px;
  --r-lg: 6px;
  --r-pill: 999px;

  /* ---- Linien ----------------------------------------------------- */
  --line-w: 1px;
  --line-w-strong: 1.5px;
  --cursor-w: 3px;

  /* ---- Bewegung --------------------------------------------------- */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur-fast: 120ms;
  --dur: 180ms;

  /* ---- Ebenen ----------------------------------------------------- */
  --z-sticky: 5;
  --z-header: 20;
  --z-drawer: 30;
  --z-sheet: 40;
  --z-toast: 50;

  /* ---- Layout (Breakpoints nur dokumentiert; in @media als Zahl) ---
     mobile < 768px · tablet < 1200px (Drawer = Overlay) · desktop ≥ 1200px */
  --nav-w: 56px;
  --drawer-w: 440px;     /* Startbreite; per Griff ziehbar, je Gerät gemerkt (D-169) */
  --lane-w: 300px;       /* Breite einer Konto-Spalte in der Timeline */
  --lane-day-w: 84px;    /* Datums-Spalte */
  --entry-h: calc(40px * var(--density)); /* einheitliche Buchungshöhe */

  /* ---- Farben: HELL (Default) -------------------------------------- */
  color-scheme: light;
  --c-bg: #f5f6f8;
  --c-surface: #ffffff;
  --c-surface-2: #f0f2f5;
  --c-sunken: #e9ecf0;
  --c-overlay: rgb(20 27 40 / 0.32);
  --c-line: #e0e4ea;
  --c-line-strong: #c7cdd7;
  --c-text: #1b2130;
  --c-text-2: #4b5466;
  --c-text-3: #7b8597;
  --c-accent: #3a5fd9;
  --c-accent-hover: #2f50c2;
  --c-accent-fg: #ffffff;
  --c-accent-soft: #e7edfc;
  --c-accent-tint: rgb(58 95 217 / 0.08);
  --c-focus: rgb(58 95 217 / 0.4);

  /* Richtung (gedämpft, kein Alarm-Rot – D-44) */
  --c-in: #2c8a5c;
  --c-in-soft: #e2f2e9;
  --c-out: #b4544c;
  --c-out-soft: #f7e6e4;

  /* Ruhiger Hinweis (Unterdeckung, Verzug) – Bernstein statt Rot */
  --c-note: #a86f14;
  --c-note-soft: #faf0dc;

  /* Realms */
  --c-business: #4a68d0;
  --c-private: #8d5bbf;

  /* Threat-Level 1–4 (1 = existenziell; bewusst Orange statt Rot) */
  --c-threat-1: #c26a1c;
  --c-threat-2: #a88b0e;
  --c-threat-3: #7c8596;
  --c-threat-4: #3a86bd;

  /* Konto-Palette 1–12 (data-color, D-95) */
  --c-acc-1: #3a5fd9;
  --c-acc-2: #2c8a7a;
  --c-acc-3: #8d5bbf;
  --c-acc-4: #c26a1c;
  --c-acc-5: #2f8a3e;
  --c-acc-6: #b0457a;
  --c-acc-7: #0f7fa8;
  --c-acc-8: #8a6d12;
  --c-acc-9: #5d6b84;
  --c-acc-10: #a14f2e;
  --c-acc-11: #5a52c9;
  --c-acc-12: #407a55;

  /* Scrollbars */
  --c-scroll-thumb: #c7cdd7;
  --c-scroll-thumb-hover: #9aa3b2;

  --shadow-1: 0 1px 2px rgb(20 27 40 / 0.06), 0 1px 1px rgb(20 27 40 / 0.04);
  --shadow-2: 0 4px 16px rgb(20 27 40 / 0.10), 0 1px 3px rgb(20 27 40 / 0.06);
}

/* ---- Farben: DUNKEL (nur manuell, D-100) --------------------------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --c-bg: #0e1115;
  --c-surface: #151920;
  --c-surface-2: #1b2028;
  --c-sunken: #0a0c0f;
  --c-overlay: rgb(0 0 0 / 0.55);
  --c-line: #252b35;
  --c-line-strong: #343c4a;
  --c-text: #e5e8ee;
  --c-text-2: #a9b1bf;
  --c-text-3: #7a8393;
  --c-accent: #7d9bff;
  --c-accent-hover: #97afff;
  --c-accent-fg: #0e1115;
  --c-accent-soft: #1c2640;
  --c-accent-tint: rgb(125 155 255 / 0.10);
  --c-focus: rgb(125 155 255 / 0.4);
  --c-in: #5ec393;
  --c-in-soft: #14281e;
  --c-out: #e8847b;
  --c-out-soft: #2f1b1a;
  --c-note: #e3ab4f;
  --c-note-soft: #2c2312;
  --c-business: #8098f2;
  --c-private: #bf92e6;
  --c-threat-1: #ec9a52;
  --c-threat-2: #d8bd47;
  --c-threat-3: #8f98a9;
  --c-threat-4: #69b0e4;
  --c-acc-1: #7d9bff;
  --c-acc-2: #4fc0ad;
  --c-acc-3: #bf92e6;
  --c-acc-4: #ec9a52;
  --c-acc-5: #63c274;
  --c-acc-6: #e27aae;
  --c-acc-7: #4bb6dc;
  --c-acc-8: #d4b54a;
  --c-acc-9: #95a2bb;
  --c-acc-10: #df8a64;
  --c-acc-11: #9b94f5;
  --c-acc-12: #77b98d;
  --c-scroll-thumb: #343c4a;
  --c-scroll-thumb-hover: #4a5466;
  --shadow-1: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-2: 0 6px 24px rgb(0 0 0 / 0.45), 0 1px 3px rgb(0 0 0 / 0.3);
}
