/* App-Design Tokens – clean & minimalistisch
   Global einbinden, danach nur diese Variablen verwenden. */

/* Schrift: Inter. Für Produktion lieber selbst hosten (Datenschutz/DSGVO, offline),
   z. B. Dateien aus https://rsms.me/inter/ nach /fonts legen und per @font-face einbinden.
   Ohne Netz greift automatisch die System-Schrift. */

:root {
  /* Farben – hell */
  --color-bg: #fafafa;
  --color-surface: #ffffff;
  --color-surface-muted: #f4f4f5;
  --color-border: #e4e4e7;
  --color-text: #18181b;
  --color-text-muted: #6b6b76;
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-primary-soft: #eff4ff;
  --color-on-primary: #ffffff;
  --color-success: #16a34a;
  --color-warning: #d97706;
  --color-danger: #dc2626;

  /* Typografie */
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --text-xs: 0.75rem;   /* 12 */
  --text-sm: 0.875rem;  /* 14 */
  --text-base: 1rem;    /* 16 */
  --text-lg: 1.125rem;  /* 18 */
  --text-xl: 1.375rem;  /* 22 */
  --text-2xl: 1.75rem;  /* 28 */
  --text-3xl: 2.25rem;  /* 36 */
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --leading-tight: 1.25;
  --leading-normal: 1.5;

  /* Abstände (4-px-Raster) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Formen & Tiefe */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 999px;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.04), 0 4px 12px rgb(0 0 0 / 0.06);
  --focus-ring: 0 0 0 3px rgb(37 99 235 / 0.35);

  /* Größen */
  --container-max: 1120px;
  --form-max: 480px;
  --modal-max: 480px;
  --header-height: 64px;
  --control-height: 40px;
  --badge-height: 22px;
  --icon-size: 20px;
  --icon-size-sm: 16px;
  --count-size: 20px;
  --icon-size-lg: 32px;
  --icon-stroke: 1.75;
  --table-min: 600px;
  --grid-min: 240px;

  /* Zustände & Bewegung */
  --opacity-disabled: 0.5;
  --overlay: rgb(0 0 0 / 0.4);
  --transition: 150ms ease;

  color-scheme: light dark; /* native Controls (Datum, Select, Scrollbars) folgen dem Modus */
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0f0f11;
    --color-surface: #18181b;
    --color-surface-muted: #1f1f23;
    --color-border: #2e2e33;
    --color-text: #f4f4f5;
    --color-text-muted: #a1a1aa;
    --color-primary: #60a5fa;
    --color-primary-hover: #93c5fd;
    --color-primary-soft: #172036;
    --color-on-primary: #0b1220;
    --color-success: #4ade80;
    --color-warning: #fbbf24;
    --color-danger: #f87171;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4), 0 4px 12px rgb(0 0 0 / 0.4);
    --focus-ring: 0 0 0 3px rgb(96 165 250 / 0.4);
  }
}

@media (prefers-reduced-motion: reduce) {
  :root { --transition: 0ms; }
}

/* Basis */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { line-height: var(--leading-tight); font-weight: var(--weight-semibold); margin: 0; }
h1 { font-size: var(--text-3xl); letter-spacing: -0.02em; }
h2 { font-size: var(--text-2xl); letter-spacing: -0.01em; }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
p { margin: 0; max-width: 65ch; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.container { max-width: var(--container-max); margin-inline: auto; padding-inline: var(--space-6); }
.muted { color: var(--color-text-muted); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
