/* ============================================================
   ICOS Design-Tokens für Apps, Tools, Rechner und Dashboards
   Version 1.1 (04.11.2026) · ICOS Brand & Style Guide 3.5
   https://brand-guide.icos-online.de/apps.html

   Quelle: App-Design-System im Brand & Style Guide,
   app/styleguide.html (Hell) und app/referenz-app.html (Dunkel).
   Komplettes Briefing zum Weitergeben: ICOS-App-Briefing-Standard.md.
   Gilt für Apps, nicht für Webseiten und Landingpages
   (dafür icos-webseiten-tokens.css).

   Modi: Hell ist Standard. data-theme="dark" auf <html> erzwingt
   Dunkel, data-theme="light" erzwingt Hell, ohne Attribut folgt
   die App der Systemeinstellung (Auto).
   ============================================================ */

/* ---------- Schrift (lokal gehostet, keine Google-Fonts-Verbindung) ---------- */
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/open-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/open-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Hell (Standard) ---------- */
:root {
  color-scheme: light;
  /* Marke: identisch mit der Webseite */
  --blue-base: #1E4975;
  --blue-90: #355B83; --blue-80: #4B6D91; --blue-70: #62809E;
  --blue-20: #D2DBE3; --blue-10: #E9EDF1;
  --orange-base: #FF940A;          /* nur Flächen, nie Text auf Weiß */
  --orange-10: #FFF4E7; --orange-20: #FFEACE;
  --orange-text: #B65E00;          /* Orange als Text auf Hell */
  --gray-base: #191919;
  --gray-70: #5E5E5E; --gray-50: #8C8C8C;

  /* Semantik */
  --success: #1E8E57; --success-strong: #136540; --success-soft: #E7F4EC;
  --error: #D23B2E;   --error-strong: #A82318;   --error-soft: #FBEAE8;
  --warn-soft: #FFF4E7; --warn-strong: #8A5A00;

  /* Flächen und Text */
  --bg: #FFFFFF;          /* Karte, Inputs, Topbar */
  --bg-subtle: #F5F7F9;   /* Seitenhintergrund */
  --bg-sunken: #EAEFF3;   /* Segmented Control */
  --border: #E6EBEF;      /* fein: Karten, Trennlinien */
  --border-strong: #D2DBE3; /* stark: Input-Rahmen */
  --text: #191919; --text-secondary: #5E5E5E; --text-muted: #8C8C8C;

  /* Typografie */
  --font-sans: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --fs-page-title: 16px;   /* 600 */
  --fs-card-title: 14.5px; /* 600 */
  --fs-body: 14px;         /* 400, LH 1.5 */
  --fs-label: 13px;        /* 700 */
  --fs-hint: 12px;
  --fs-kpi: 26px;          /* 700, tabellarische Ziffern */
  --fs-button: 13.5px;     /* 600 */

  /* Radien: App-Standard, anders als auf der Webseite */
  --radius-xs: 6px;   /* Badges, kleine Chips */
  --radius-sm: 8px;   /* Buttons, Inputs, Segmented, Alerts */
  --radius-md: 12px;  /* Karten */

  /* Abstände, 4er-Raster */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px;

  /* Maße */
  --ctrl-h: 34px;         /* Buttons und Felder, klein 30px */
  --ctrl-h-sm: 30px;
  --sidebar-w: 256px;
  --topbar-h: 64px;
  --content-max: 1180px;

  /* Schatten nur wo nötig, Trennung sonst über Linien */
  --shadow-sm: 0 1px 2px rgba(25,35,53,.05), 0 1px 1px rgba(25,35,53,.04);
  --focus-ring: 0 0 0 3px rgba(30,73,117,.10); /* Felder: Navy-Rahmen plus dieser Ring */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Dunkel (erzwungen) ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --blue-10: #243447; --blue-20: #35516E;
  --orange-10: #3D2E15; --orange-20: #4E3B1C; --orange-text: #FFB45C;
  --success: #2FA76B; --success-strong: #7BD3A5; --success-soft: #1A3328;
  --error: #E05445;   --error-strong: #F49287;   --error-soft: #3B211D;
  --bg: #1C2127; --bg-subtle: #14181D; --bg-sunken: #262D35;
  --border: #2B333C; --border-strong: #3B4650;
  --text: #E9EDF1; --text-secondary: #A9B4BF; --text-muted: #7B8794;
  --shadow-sm: none;
  /* Orange #FF940A bleibt unverändert */
}

/* ---------- Auto: folgt der Systemeinstellung ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --blue-10: #243447; --blue-20: #35516E;
    --orange-10: #3D2E15; --orange-20: #4E3B1C; --orange-text: #FFB45C;
    --success: #2FA76B; --success-strong: #7BD3A5; --success-soft: #1A3328;
    --error: #E05445;   --error-strong: #F49287;   --error-soft: #3B211D;
    --bg: #1C2127; --bg-subtle: #14181D; --bg-sunken: #262D35;
    --border: #2B333C; --border-strong: #3B4650;
    --text: #E9EDF1; --text-secondary: #A9B4BF; --text-muted: #7B8794;
    --shadow-sm: none;
  }
}

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-sans); font-size: var(--fs-body); line-height: 1.5;
  color: var(--text); background: var(--bg-subtle);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
