/* ==========================================================================
   Backbone CRM/ATS — base.css
   Grundsystem: Reset, Design-Tokens (CSS-Variablen), Typografie, Fokus.
   Theme-Faehig via [data-theme] auf <html> (hell/dunkel/Farbwechsel).
   ========================================================================== */

:root {
  /* Farben — eine Akzentfarbe (Indigo), reduzierte Palette, Bauhaus-Klarheit */
  --bg: #f6f7fb;
  --bg-subtle: #eef0f6;
  --card: #ffffff;
  --card-hover: #fafbff;
  --ink: #1f2430;
  --ink-soft: #4b5563;
  --muted: #6b7280;
  --line: #e5e7ef;
  --line-strong: #d3d7e3;

  --accent: #4f6df5;
  --accent-hover: #3f5ce0;
  --accent-soft: #eef1fe;
  --accent-contrast: #ffffff;

  --ok: #16a34a;
  --ok-soft: #ecfdf3;
  --warn: #d97706;
  --warn-soft: #fffbeb;
  --err: #dc2626;
  --err-soft: #fef2f2;

  --sidebar-bg: #ffffff;
  --sidebar-ink: #374151;
  --sidebar-active-bg: var(--accent-soft);
  --sidebar-active-ink: var(--accent);
  --topbar-bg: rgba(255, 255, 255, 0.9);

  /* Abstaende — 8-px-Raster */
  --sp-1: 8px;
  --sp-2: 16px;
  --sp-3: 24px;
  --sp-4: 32px;
  --sp-5: 48px;

  /* Radien, Schatten */
  --radius-s: 8px;
  --radius: 12px;
  --radius-l: 16px;
  --shadow-s: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 4px 16px rgba(16, 24, 40, 0.06);
  --shadow-l: 0 8px 30px rgba(16, 24, 40, 0.14);

  /* Typografie */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --fs-base: 15px;
  --fs-sm: 13px;
  --fs-xs: 12px;
  --fs-lg: 18px;
  --fs-xl: 22px;
  --fs-2xl: 28px;
  --lh: 1.5;

  /* Layout-Masse */
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 68px;
  --topbar-h: 60px;
  --content-max: 1440px;
  --callbar-w: 320px;

  /* Motion */
  --tr: 0.16s ease;
}

[data-theme="dark"] {
  --bg: #14161d;
  --bg-subtle: #1b1e27;
  --card: #1f232e;
  --card-hover: #262b38;
  --ink: #e8eaf1;
  --ink-soft: #b6bccb;
  --muted: #8b93a7;
  --line: #2c3242;
  --line-strong: #3a4154;
  --accent: #7d93ff;
  --accent-hover: #93a6ff;
  --accent-soft: #2a3152;
  --sidebar-bg: #1b1e27;
  --sidebar-ink: #c2c8d6;
  --topbar-bg: rgba(27, 30, 39, 0.9);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.35);
}

/* -------- Reset -------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: var(--lh);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
h1, h2, h3, h4 { font-weight: 600; line-height: 1.3; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; display: inline-block; vertical-align: middle; }
button, input, select, textarea { font: inherit; color: inherit; }
table { border-collapse: collapse; width: 100%; }
::placeholder { color: var(--muted); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* -------- Basis-Typo-Klassen -------- */
.h1 { font-size: var(--fs-xl); font-weight: 700; }
.h2 { font-size: var(--fs-lg); font-weight: 600; }
.subtitle { color: var(--muted); font-size: var(--fs-sm); }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; }

/* -------- Utility: Abstaende -------- */
.mt-1 { margin-top: var(--sp-1); } .mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); } .mb-1 { margin-bottom: var(--sp-1); }
.mb-2 { margin-bottom: var(--sp-2); } .mb-3 { margin-bottom: var(--sp-3); }
.p-2 { padding: var(--sp-2); } .p-3 { padding: var(--sp-3); }
.gap-1 { gap: var(--sp-1); } .gap-2 { gap: var(--sp-2); }
.flex { display: flex; } .items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.hidden { display: none !important; }

/* -------- Scrollbars (dezente, helle Optik) -------- */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }