/* LifeOS Design Tokens — Single Source of Truth (SSOT)
 * ===========================================================
 * Stand: 2026-04-27
 * Quelle: ctmos/CoworkKanban/style.css (LifeOS Dashboard, ältester Style)
 * Verwendet von: base.moser.ai, health.moser.ai, reflect.moser.ai, finanzen.moser.ai
 *
 * Diese Datei enthält nur die globalen Design-Tokens.
 * Komponenten-spezifisches CSS bleibt in der jeweiligen PWA.
 * Reflect kann tokens-reflect.css zusätzlich laden für Blau-Akzent.
 *
 * Mobile: Touch-Targets ≥44px, Inputs ≥16px Schrift (Auto-Zoom Schutz)
 * Themes: dark (default), light via :root.light-theme
 * ===========================================================
 */

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

:root {
  /* === Color: Dark (Default) === */
  --bg: #16181c;
  --surface: #1a1d22;
  --surface2: #21252b;
  --surface3: #1a1d22;
  --border: #2d3139;
  --border-strong: #3a3f48;
  --text: #e0e4ea;
  --text-secondary: #8a90a0;
  --text-muted: #5a6070;

  /* === Accent: Red (LifeOS Standard) === */
  --accent: #e5484d;
  --accent-dark: #d13438;
  --accent-light: rgba(229,72,77,0.12);
  --accent-bg: rgba(229,72,77,0.06);

  /* === Semantic Colors === */
  --green: #46a758;
  --blue: #3b82f6;
  --purple: #7c3aed;
  --amber: #f59e0b;
  --red-error: #ef4444;

  /* === Nav === */
  --nav-bg: #1a1d22;
  --nav-text: #e0e4ea;

  /* === Shadow Hierarchy === */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.15);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.2), 0 1px 2px rgba(0,0,0,0.12);
  --shadow:    0 2px 8px rgba(0,0,0,0.25), 0 1px 3px rgba(0,0,0,0.15);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.3), 0 2px 4px rgba(0,0,0,0.15);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.35), 0 4px 8px rgba(0,0,0,0.15);

  /* === Radius Scale === */
  --radius-sm: 8px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  /* === Transitions === */
  --transition: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.1s ease;

  /* === Typography === */
  --font-family: "Lexend", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-size-base: 14px;
  --font-size-input: 16px; /* Mobile: ≥16px verhindert iOS/Android Auto-Zoom */
  --font-size-sm: 13px;
  --font-size-xs: 11px;
  --font-size-lg: 18px;
  --line-height: 1.5;

  /* === Spacing (8px Grid) === */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  /* === Touch Targets (Mobile, WCAG AAA = 44x44) === */
  --touch-target: 44px;
}

:root.dark-theme {
  --bg: #16181c;
  --surface: #1a1d22;
  --surface2: #21252b;
  --surface3: #1a1d22;
  --border: #2d3139;
  --border-strong: #3a3f48;
  --text: #e0e4ea;
  --text-secondary: #8a90a0;
  --text-muted: #5a6070;
  --accent: #e5484d;
  --accent-dark: #d13438;
  --accent-light: rgba(229,72,77,0.12);
  --accent-bg: rgba(229,72,77,0.06);
  --nav-bg: #1a1d22;
  --nav-text: #e0e4ea;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.15);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.2), 0 1px 2px rgba(0,0,0,0.12);
  --shadow:    0 2px 8px rgba(0,0,0,0.25), 0 1px 3px rgba(0,0,0,0.15);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.3), 0 2px 4px rgba(0,0,0,0.15);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.35), 0 4px 8px rgba(0,0,0,0.15);
}

:root.light-theme {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface2: #eef1f5;
  --surface3: #ffffff;
  --border: #dde1e8;
  --border-strong: #cdd2da;
  --text: #1a1d24;
  --text-secondary: #5a6070;
  --text-muted: #8a90a0;
  --accent: #e5484d;
  --accent-dark: #d13438;
  --accent-light: rgba(229,72,77,0.08);
  --accent-bg: rgba(229,72,77,0.04);
  --nav-bg: #ffffff;
  --nav-text: #1a1d24;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:    0 2px 8px rgba(0,0,0,0.07), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.09), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.05);
}

/* === Mobile Defaults === */
html, body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: var(--line-height);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Mobile: Inputs müssen ≥16px sein, sonst zoomt iOS/Android beim Fokus */
@media (max-width: 768px) {
  input, textarea, select {
    font-size: var(--font-size-input) !important;
  }
}

/* Touch-Targets ≥44px auf Mobile */
@media (max-width: 768px) {
  button,
  .tab,
  .tab-btn,
  .nav-tab,
  [role="button"],
  a.btn {
    min-height: var(--touch-target);
  }
}
