/* Brand-Foundation (Phase A – Tokens + Fonts). Vor den bestehenden
   Admin-Variablen geladen, damit sie überschreibbar bleiben. */
@import url('brand-tokens.css');

/* =========================================================
   MeinHeimcheck Admin – Stylesheet
   Stil: navy-blau Sidebar, helle Content-Area, klare Tabellen
   ========================================================= */

/* Alle Farb-Tokens mappen auf die Brand-Palette aus brand-tokens.css.
   Sprint TS (2026-05-13 abend): Theme-Switcher Hell/Dunkel.
   - :root                  = Default (Light, identisch mit pre-TS-Stand)
   - [data-theme="light"]   = Explizit Light
   - [data-theme="dark"]    = Dark-Mode (additiv, Sidebar bleibt navy)
   Mail-Templates + Public-Funnel sind NICHT betroffen (eigene CSS-Files). */
:root,
:root[data-theme="light"] {
  --navy:         var(--mhc-navy);
  --navy-dark:    var(--mhc-navy-deep);
  --navy-soft:    #24436d;       /* Sidebar-Hover-Zwischenton */
  --accent:       var(--mhc-amber);
  --accent-hover: var(--mhc-amber-warm);

  --ink:          var(--mhc-ink);
  --text:         var(--mhc-ink);
  --text-soft:    #6b778a;       /* Mute-Grey für Sekundärtext */
  --bg:           var(--mhc-paper);
  --card:         var(--mhc-white);
  --line:         var(--mhc-mist);
  --creme:        #f7f1e4;       /* leicht dunkler als Paper für Table-Header */

  --green:        #2f8f4d;       /* Semantic-Feedback */
  --red:          #c0392b;
  --orange:       #d17d1e;
  --yellow:       #b39322;
  --blue:         var(--mhc-navy);
  --grey:         #8893a5;

  --radius:       var(--radius-md);
  --shadow:       var(--shadow-md);

  /* Theme-Toggle Icon-Visibility (Light zeigt Sonne) */
  --theme-toggle-sun-display:  inline-block;
  --theme-toggle-moon-display: none;
}

/* Dark-Theme (Sprint TS 2026-05-13). Sidebar bleibt navy für Brand-Konsistenz.
   Content-Area, Cards, Tabellen bekommen Slate-Tones. */
:root[data-theme="dark"] {
  /* Navy-Tokens bleiben (Sidebar identisch) */
  --navy:         var(--mhc-navy);
  --navy-dark:    var(--mhc-navy-deep);
  --navy-soft:    #24436d;
  --accent:       var(--mhc-amber);
  --accent-hover: var(--mhc-amber-warm);

  /* Text: invertiert auf hell */
  --ink:          #e6ebf2;
  --text:         #dce3ec;
  --text-soft:    #8a94a3;

  /* Backgrounds: Slate-Pyramide */
  --bg:           #0e1117;       /* Deep Slate */
  --card:         #1a222c;       /* Card etwas heller */
  --line:         rgba(130,145,165,0.16);
  --creme:        #232c38;       /* Table-Header noch heller */

  /* Semantic-Feedback: gedämpfter für Dark */
  --green:        #6b9474;
  --red:          #b85c4a;
  --orange:       #c49754;
  --yellow:       #c4a854;
  --blue:         #5a8db0;
  --grey:         #7d8798;

  --radius:       var(--radius-md);
  --shadow:       0 4px 12px rgba(0,0,0,0.4);

  /* Theme-Toggle Icon-Visibility (Dark zeigt Mond) */
  --theme-toggle-sun-display:  none;
  --theme-toggle-moon-display: inline-block;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: var(--font-body);
  font-size: 14px; line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- LAYOUT ---------- */
.layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--navy);
  color: #dfe7f3;
  padding: 20px 0;
  position: sticky; top: 0; align-self: start; height: 100vh;
}
.sidebar .brand {
  padding: 0 20px 16px;
  border-bottom: 1px solid var(--navy-soft);
  font-size: 16px; font-weight: 600;
  color: #fff; letter-spacing: .3px;
}
.sidebar .brand small {
  display: block; font-size: 11px; color: #7e94b5;
  font-weight: 400; margin-top: 2px;
}
.nav {
  list-style: none; margin: 16px 0 0; padding: 0;
}
.nav li a {
  display: block;
  padding: 9px 20px;
  color: #dfe7f3; text-decoration: none;
  border-left: 3px solid transparent;
  font-size: 14px;
}
.nav li a:hover { background: var(--navy-soft); }
.nav li a.active {
  background: var(--navy-dark);
  border-left-color: var(--accent);
  color: #fff; font-weight: 500;
}
.nav .section {
  padding: 14px 20px 6px;
  font-size: 11px; text-transform: uppercase;
  letter-spacing: .06em; color: #7e94b5;
}
.sidebar .userbox {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 14px 20px;
  border-top: 1px solid var(--navy-soft);
  font-size: 12px; color: #b6c2d5;
}
.sidebar .userbox .user { color: #fff; margin-bottom: 4px; }

.main {
  padding: 0;
  min-width: 0;
}
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between;
}
.topbar h1 {
  margin: 0; font-size: 18px; font-weight: 600; color: var(--ink);
}
.content {
  padding: 24px 28px;
}

/* ---------- CARDS ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.card-head {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  display: flex; align-items: center; justify-content: space-between;
}
.card-body { padding: 18px 20px; }

.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin-bottom: 20px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.stat .label {
  font-size: 12px; color: var(--text-soft);
  text-transform: uppercase; letter-spacing: .03em;
}
.stat .val {
  font-size: 26px; font-weight: 600; color: var(--ink);
  margin-top: 6px; line-height: 1.1;
}
.stat .sub { font-size: 12px; color: var(--text-soft); margin-top: 4px; }

/* ---------- TABELLEN ---------- */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%; border-collapse: collapse;
  background: var(--card);
}
table.data th, table.data td {
  padding: 10px 14px;
  text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
table.data thead th {
  background: var(--creme);
  font-weight: 600; color: var(--ink);
  border-bottom: 2px solid var(--line);
  font-size: 12px; text-transform: uppercase;
  letter-spacing: .04em;
}
table.data tbody tr:hover { background: #fafbfd; }
table.data td.numeric { text-align: right; font-variant-numeric: tabular-nums; }

.empty {
  padding: 40px 20px; text-align: center; color: var(--text-soft);
  font-style: italic;
}

/* ---------- BADGES ---------- */
.badge {
  display: inline-block; padding: 2px 8px;
  font-size: 11px; font-weight: 600; border-radius: 10px;
  text-transform: uppercase; letter-spacing: .03em;
  background: #eef1f5; color: #566178;
}
.badge-green  { background: #e3f1e8; color: #226e3b; }
.badge-red    { background: #fbe6e3; color: #8c2318; }
.badge-orange { background: #fdeed9; color: #8a5314; }
.badge-yellow { background: #fbf3cf; color: #7a6212; }
.badge-blue   { background: #e1ecff; color: #184799; }
.badge-grey   { background: #eef1f5; color: #566178; }

/* ---------- FORMULARE ---------- */
form.inline { display: inline; }
.form-row {
  display: grid; grid-template-columns: 180px 1fr;
  gap: 14px; margin-bottom: 12px; align-items: start;
}
.form-row label {
  padding-top: 8px; font-weight: 500; color: var(--ink);
}
input[type=text], input[type=email], input[type=password],
input[type=number], input[type=url], select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  background: var(--card);
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46,125,255,.12);
}
textarea { min-height: 100px; font-family: "SF Mono", Consolas, monospace; font-size: 13px; }

.btn {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--navy);
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--navy-dark); text-decoration: none; }
.btn-ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: var(--bg); }
.btn-danger {
  background: var(--red); border-color: var(--red);
}
.btn-danger:hover { background: #9e2d22; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ---------- FILTER / TOOLBAR ---------- */
.toolbar {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-bottom: 16px; padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  align-items: center;
}
.toolbar label { font-size: 12px; color: var(--text-soft); margin-right: 4px; }
.toolbar select, .toolbar input[type=text], .toolbar input[type=date] {
  padding: 5px 8px; font-size: 13px;
  min-width: 140px;
}

/* ---------- FLASH ---------- */
.flash {
  padding: 10px 14px;
  margin-bottom: 14px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 13px;
}
.flash-success { background: #e3f1e8; border-color: #b8dcc3; color: #226e3b; }
.flash-error   { background: #fbe6e3; border-color: #ecbeb6; color: #8c2318; }
.flash-warning { background: #fdeed9; border-color: #eecba1; color: #8a5314; }

/* ---------- LOGIN-SEITE ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 380px;
  background: #fff; border-radius: 8px; padding: 30px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-card h2 {
  margin: 0 0 4px; font-size: 22px; color: var(--ink);
}
.login-card .sub {
  color: var(--text-soft); font-size: 13px; margin-bottom: 20px;
}
.login-card input { margin-bottom: 12px; }
.login-card .btn { width: 100%; padding: 10px; font-size: 14px; }

/* ---------- KEY-VALUE LIST (Detail-Seiten) ---------- */
.kv {
  display: grid; grid-template-columns: 180px 1fr; gap: 6px 16px;
  font-size: 13px;
}
.kv dt { color: var(--text-soft); font-weight: 500; }
.kv dd { margin: 0; color: var(--ink); word-break: break-word; }

/* ---------- PAGINATION ---------- */
.pagination {
  margin-top: 16px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  font-size: 13px;
}
.pagination a, .pagination span {
  padding: 5px 10px;
  border: 1px solid var(--line); border-radius: 4px;
  color: var(--text); background: var(--card);
}
.pagination a:hover { background: var(--bg); text-decoration: none; }
.pagination .current { background: var(--navy); color: #fff; border-color: var(--navy); }
.pagination .info { border: 0; background: transparent; color: var(--text-soft); }

/* ---------- MOBILE ---------- */
@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto;
    padding: 10px 0;
  }
  .sidebar .userbox { position: static; }
  .nav { display: flex; flex-wrap: wrap; margin: 10px; gap: 4px; }
  .nav li a { border-left: none; border-radius: 4px; padding: 6px 10px; }
  .form-row { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
}

/* ========= Dashboard v2: Sidebar-Badges, NEU-Kachel, Tabs, Sparkline ========= */

/* Sidebar-Badges für Nav-Items */
.nav li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.nav-badge {
  display: inline-block;
  min-width: 20px;
  padding: 1px 7px;
  background: #e74c3c;
  color: #fff;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

/* "NEU"-Kachel prominenter */
.stat--new {
  border-color: #e74c3c;
  background: linear-gradient(to bottom, #fff5f4 0%, #fff 100%);
}
.stat--new .label { color: #c0392b; }
.stat--new .val   { color: #c0392b; }
.stat--new .stat-pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #e74c3c;
  border-radius: 50%;
  margin-right: 6px;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

/* Zeitraum-Tabs */
.period-tabs {
  display: inline-flex;
  gap: 4px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 3px;
}
.period-tab {
  padding: 5px 14px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-soft);
  text-decoration: none;
  cursor: pointer;
  border: 0;
  background: transparent;
  font-weight: 500;
}
.period-tab:hover {
  background: var(--bg);
  color: var(--ink);
  text-decoration: none;
}
.period-tab.is-active {
  background: var(--navy);
  color: #fff;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* NEU & UNBEARBEITET Block */
.new-leads-list .lead-row {
  display: grid;
  grid-template-columns: 18px 60px 1fr 120px 110px 90px;
  gap: 14px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}
.new-leads-list .lead-row:hover {
  background: #fafbfd;
  text-decoration: none;
}
.new-leads-list .dot {
  width: 10px;
  height: 10px;
  background: #e74c3c;
  border-radius: 50%;
}
.new-leads-list .lead-id {
  font-variant-numeric: tabular-nums;
  color: var(--navy);
  font-weight: 600;
  font-size: 13px;
}
.new-leads-list .lead-main strong {
  color: var(--ink);
  display: block;
  font-size: 13px;
}
.new-leads-list .lead-main small {
  color: var(--text-soft);
  display: block;
  font-size: 12px;
}
.new-leads-list .lead-cat {
  color: var(--text-soft);
  font-size: 12px;
}
.new-leads-list .lead-time {
  color: var(--text-soft);
  font-size: 12px;
  text-align: right;
}
.new-leads-list .seen-btn {
  font-size: 11px;
  padding: 4px 9px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-soft);
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
}
.new-leads-list .seen-btn:hover {
  border-color: var(--navy);
  color: var(--navy);
}

/* Mini-Sparkline (7-Tages-Trend) */
.sparkline {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 48px;
  padding: 6px 0 0;
}
.sparkline-bar {
  flex: 1;
  background: var(--navy);
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  position: relative;
}
.sparkline-bar--empty {
  background: var(--line);
}
.sparkline-labels {
  display: flex;
  gap: 3px;
  margin-top: 4px;
  font-size: 10px;
  color: var(--text-soft);
}
.sparkline-labels span {
  flex: 1;
  text-align: center;
}

/* Lead-Liste Tabelle: NEU-Mini-Badge */
.lead-new-tag {
  display: inline-block;
  padding: 1px 6px;
  margin-left: 4px;
  background: #e74c3c;
  color: #fff;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
  vertical-align: middle;
}

@media (max-width: 800px) {
  .new-leads-list .lead-row {
    grid-template-columns: 18px 1fr auto;
  }
  .new-leads-list .lead-id,
  .new-leads-list .lead-cat,
  .new-leads-list .lead-time { display: none; }
}

/* ========= Unified Stats-Row + Page-Head + Sparkline-Card (v2) ========= */

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 16px;
}
.page-head h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
}
.period-label {
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 12px;
}
.period-label strong {
  color: var(--ink);
}

@media (max-width: 720px) {
  .page-head { flex-direction: column; align-items: flex-start; }
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 900px) { .stats-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .stats-row { grid-template-columns: 1fr; } }

.stats-row .stat {
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.stats-row .stat .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-soft);
  font-weight: 600;
  margin-bottom: 6px;
}
.stats-row .stat .val {
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
  word-break: break-word;
}
.stats-row .stat .sub {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 6px;
}

.stats-row .stat--new {
  border-color: #e74c3c;
  background: linear-gradient(to bottom, #fff5f4 0%, #fff 100%);
}
.stats-row .stat--new .label { color: #c0392b; }
.stats-row .stat--new .val   { color: #c0392b; }

.stats-row .stat--warn {
  border-color: #f5a524;
  background: linear-gradient(to bottom, #fff9f0 0%, #fff 100%);
}
.stats-row .stat--warn .label { color: #a16a07; }
.stats-row .stat--warn .val   { color: #d68910; }

/* Sparkline-Card als eigener Block */
.sparkline-card {
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.sparkline-card .sparkline-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.sparkline-card .sparkline-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.sparkline-card .sparkline-meta {
  font-size: 11px;
  color: var(--text-soft);
}
.sparkline-card .sparkline {
  height: 52px;
  gap: 8px;
  align-items: flex-end;
}
.sparkline-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
}
.sparkline-col .sparkline-bar { width: 100%; }
.sparkline-day {
  font-size: 10px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ================================================================
   Phase B – Brand-Overrides (Navy / Amber / Paper + Fraunces/Inter)
   Ziel: bestehende Selektoren auf die neue Brand-Linie ziehen,
   ohne die Struktur zu verändern.
   ================================================================ */

/* --- Typografie: Topbar, Stat-Values, Page-Head auf Fraunces ---- */
.topbar h1,
.page-head h1 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.stat .val,
.stats-row .stat .val {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--mhc-navy);
}

/* --- Sidebar: Logo-Block + Navi-Active + Hover -------------------- */
.sidebar .brand {
  border-bottom-color: rgba(255,255,255,.08);
  padding: 4px 18px 16px;
}
.sidebar .brand .logo {
  display: block;
  width: 100%;
  max-width: 180px;
  height: auto;
}
.sidebar .brand small {
  color: #a8b6cd;
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 10px;
}

.nav li a:hover {
  background: var(--mhc-navy-deep);
  color: #fff;
}
.nav li a.active {
  background: var(--mhc-amber);
  border-left-color: var(--mhc-amber-warm);
  color: var(--mhc-navy);
  font-weight: 600;
}
.nav li a.active:hover {
  background: var(--mhc-amber-warm);
  color: var(--mhc-navy);
}

/* --- Nav-Badges: Amber statt Rot (Brand) -------------------------- */
.nav-badge {
  background: var(--mhc-amber);
  color: var(--mhc-navy);
  font-weight: 700;
  border-radius: var(--radius-full);
}
/* Aktive Nav-Zeile: Badge wird Navy + Paper, damit Kontrast stimmt */
.nav li a.active .nav-badge {
  background: var(--mhc-navy);
  color: var(--mhc-paper);
}

/* --- Buttons: Primär = Navy, Akzent-CTA = Amber ------------------- */
.btn {
  font-family: var(--font-body);
  letter-spacing: .01em;
  transition: background var(--transition-fast), transform var(--transition-fast);
}
.btn:hover { background: var(--mhc-navy-deep); }
.btn-accent {
  background: var(--mhc-amber);
  border-color: var(--mhc-amber);
  color: var(--mhc-navy);
}
.btn-accent:hover {
  background: var(--mhc-amber-warm);
  border-color: var(--mhc-amber-warm);
  color: var(--mhc-navy);
}

/* Focus-Ring: amber-getönt statt Legacy-Blau */
input:focus, select:focus, textarea:focus {
  box-shadow: 0 0 0 3px rgba(245, 165, 36, .22);
}

/* --- Table-Header: Paper/Mist statt Creme ------------------------- */
table.data thead th {
  background: var(--mhc-paper);
  border-bottom-color: var(--mhc-mist);
  color: var(--mhc-navy);
}
table.data tbody tr:hover { background: #f5ede0; }

/* --- Stat-Modifier: NEU + WARN auf Amber-Tönung ------------------- */
.stat--new,
.stats-row .stat--new {
  border-color: var(--mhc-amber);
  background: linear-gradient(to bottom, #fff6e4 0%, #fff 100%);
}
.stat--new .label,
.stats-row .stat--new .label { color: var(--mhc-amber-warm); }
.stat--new .val,
.stats-row .stat--new .val   { color: var(--mhc-navy); }
.stat--new .stat-pulse {
  background: var(--mhc-amber);
}

.stats-row .stat--warn {
  border-color: var(--mhc-amber-warm);
  background: linear-gradient(to bottom, #fff6e4 0%, #fff 100%);
}
.stats-row .stat--warn .label { color: var(--mhc-amber-warm); }
.stats-row .stat--warn .val   { color: var(--mhc-navy); }

/* --- Neue-Leads-Liste: Dot + Tag in Amber ------------------------- */
.new-leads-list .dot        { background: var(--mhc-amber); }
.new-leads-list .lead-id    { color: var(--mhc-navy); }
.lead-new-tag {
  background: var(--mhc-amber);
  color: var(--mhc-navy);
  font-weight: 700;
}

/* --- Zeitraum-Tabs: aktiver Tab in Amber -------------------------- */
.period-tab.is-active {
  background: var(--mhc-amber);
  color: var(--mhc-navy);
  font-weight: 600;
}
.period-tab.is-active:hover {
  background: var(--mhc-amber-warm);
  color: var(--mhc-navy);
}

/* --- Pagination-Current in Amber --------------------------------- */
.pagination .current {
  background: var(--mhc-amber);
  color: var(--mhc-navy);
  border-color: var(--mhc-amber);
}

/* --- Flashes: Paper-BG + Brand-Akzente, ruhiger Look -------------- */
.flash-success { background: #eaf4ec; border-color: #c7dfcd; color: #1f5b32; }
.flash-warning { background: #fff3dc; border-color: #f3d7a0; color: #8a5a0f; }
.flash-error   { background: #fde8e6; border-color: #efbfb9; color: #7a1e15; }

/* --- Sparkline: Navy-Default + sanfter Hover ---------------------- */
.sparkline-bar {
  background: var(--mhc-navy);
}
.sparkline-bar:hover {
  background: var(--mhc-amber-warm);
}
.sparkline-bar--empty { background: var(--mhc-mist); }
.sparkline-card {
  border-radius: var(--radius-lg);
}

/* --- Karten: weichere Brand-Schatten ------------------------------ */
.card,
.stat,
.stats-row .stat,
.sparkline-card,
.toolbar {
  box-shadow: var(--shadow-sm);
  border-color: var(--mhc-mist);
  border-radius: var(--radius-lg);
}
.card-head {
  border-bottom-color: var(--mhc-mist);
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--mhc-navy);
}

/* ================================================================
   LOGIN – Split-Screen Hero (Navy links, Paper-Form rechts)
   Tagline: "Denn es ist Ihr Zuhause"
   ================================================================ */
.login-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 100vh;
  padding: 0;
  background: var(--mhc-paper);
}
.login-hero {
  background:
    radial-gradient(circle at 20% 30%, rgba(245,165,36,.18), transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(232,137,16,.12), transparent 55%),
    linear-gradient(160deg, var(--mhc-navy) 0%, var(--mhc-navy-deep) 100%);
  color: var(--mhc-paper);
  padding: 56px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
}
.login-hero .login-logo {
  width: 240px; height: auto;
  display: block;
}
.login-hero .hero-body {
  max-width: 420px;
  margin: auto 0;
}
.login-hero .hero-eyebrow {
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--mhc-amber);
  margin-bottom: 14px;
}
.login-hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(30px, 3.2vw, 44px);
  line-height: 1.1;
  margin: 0 0 14px;
  color: var(--mhc-paper);
  letter-spacing: -0.01em;
}
.login-hero h1 em {
  color: var(--mhc-amber);
  font-style: italic;
  font-weight: 400;
}
.login-hero p {
  font-size: 15px;
  line-height: 1.55;
  color: #d8dfec;
  margin: 0;
  max-width: 380px;
}
.login-hero .hero-foot {
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #8a9bbb;
}

.login-form-col {
  background: var(--mhc-paper);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 40px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--mhc-white);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--mhc-mist);
}
.login-card h2 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 24px;
  color: var(--mhc-navy);
  letter-spacing: -0.01em;
}
.login-card .sub {
  color: var(--text-soft);
  font-size: 13px;
  margin: 0 0 22px;
}
.login-card input {
  margin-bottom: 14px;
  padding: 11px 13px;
  border-radius: var(--radius-md);
}
.login-card .btn {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  background: var(--mhc-navy);
  border-color: var(--mhc-navy);
  font-weight: 600;
  letter-spacing: .02em;
}
.login-card .btn:hover {
  background: var(--mhc-navy-deep);
  border-color: var(--mhc-navy-deep);
}

@media (max-width: 860px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { min-height: auto; padding: 40px 32px; }
  .login-hero .hero-body { margin: 24px 0; }
  .login-form-col { padding: 32px 20px; }
}

/* ================================================================
   Mobile: Aktiver Nav-Link auch im Tab-Modus markieren
   ================================================================ */
@media (max-width: 800px) {
  .nav li a.active {
    border-left: none;
    border-radius: var(--radius-md);
  }
}

/* ================================================================
   Phase 1B (2026-04-29) — Sidebar Coming-Soon Items
   Items aus nav-config.php mit status='coming_soon' bekommen die
   Klasse .coming-soon zusätzlich auf <a>. Pille .nav-soon als visueller
   "bald"-Marker, konsistent zu .nav-badge (Bindestrich-Naming).
   ================================================================ */
.nav li a.coming-soon {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}
.nav li a.coming-soon:hover {
  background: transparent;
}
.nav-soon {
  margin-left: auto;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--mhc-amber, #F5A524);
  background: rgba(245, 165, 36, 0.15);
  padding: 1px 6px;
  border-radius: var(--radius-sm, 4px);
  display: inline-block;
  line-height: 1.4;
}

/* === Phase 1C — Phone-Consent Badges (lead.php Card "Einwilligungen" + leads.php Spalte "Tel") === */
.badge-yes {
  color: #16a34a;
  background: rgba(34, 197, 94, 0.15);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.85rem;
  display: inline-block;
}
.badge-no {
  color: #c0392b;
  background: rgba(192, 57, 43, 0.10);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.85rem;
  display: inline-block;
}
.badge-yes-mini,
.badge-no-mini {
  display: inline-block;
  text-align: center;
  min-width: 1.5rem;
  font-size: 0.95rem;
}
.badge-yes-mini { color: #16a34a; }
.badge-no-mini  { color: #999; }

/* ================================================================
   Phase 003 — Dashboard Tile-Grid (Kategorien + Abnehmer)
   ================================================================ */

.mhc-section { margin-block: 1.25rem; }
.mhc-section .card-head .mhc-meta {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 400;
  margin-left: 0.4rem;
}

/* Auto-fill responsive grid */
.mhc-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.mhc-tile-grid--abnehmer {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Tile base — Sprint 3c (2026-05-13 Nachmittag): kompakter (Stefan-Plan ~30%) */
.mhc-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 0.65rem;
  background: var(--card, #fff);
  border: 1px solid var(--line, #e8e2d5);
  border-radius: var(--radius, 8px);
  text-decoration: none;
  color: var(--ink, #163259);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  min-height: 86px;
}
.mhc-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(22, 50, 89, 0.12);
  border-color: var(--orange, #F5A524);
}

/* Kategorie-Tile — Sprint 3c kompakter */
.mhc-tile--kategorie .mhc-tile__icon-svg {
  width: 24px;
  height: 24px;
  margin-bottom: 0.25rem;
}
.mhc-tile--kategorie .mhc-tile__icon-emoji {
  font-size: 1.35rem;
  margin-bottom: 0.25rem;
  line-height: 1;
}
.mhc-tile--kategorie .mhc-tile__count {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1;
}
.mhc-tile--kategorie .mhc-tile__label {
  font-size: 0.74rem;
  margin-top: 0.25rem;
  color: var(--text-soft, #555);
  text-align: center;
  line-height: 1.2;
}

/* Sprint 3c — Quelle-Tile (Lead-Source-Mini-Block im Dashboard) */
.mhc-tile-grid--quelle {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.mhc-tile--quelle {
  align-items: center;
  text-align: center;
  position: relative;
}
.mhc-tile--quelle .mhc-tile__icon-emoji {
  font-size: 1.1rem;
  margin-bottom: 0.2rem;
  line-height: 1;
  opacity: 0.7;
}
.mhc-tile--quelle .mhc-tile__count {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1;
  color: var(--ink, #163259);
}
.mhc-tile--quelle .mhc-tile__label {
  font-size: 0.72rem;
  margin-top: 0.2rem;
  color: var(--text-soft, #555);
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: 'JetBrains Mono', Menlo, Consolas, monospace;
}
.mhc-tile--quelle .mhc-tile__hint {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 0.68rem;
  color: var(--orange, #F5A524);
  font-weight: 600;
}
.mhc-tile--empty {
  opacity: 0.5;
}
.mhc-tile--empty:hover {
  opacity: 1;
}

/* Σ Total Tile */
.mhc-tile--sum {
  background: linear-gradient(135deg, #fdfaef 0%, #f7efd9 100%);
  border-style: dashed;
  cursor: default;
}
.mhc-tile--sum:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--line, #e8e2d5);
}
.mhc-tile--sum .mhc-tile__sum-label {
  color: #888;
  font-size: 0.82rem;
  margin-bottom: 0.4rem;
  letter-spacing: 0.04em;
}
.mhc-tile--sum .mhc-tile__sum-value {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.85rem;
  font-weight: 600;
  color: var(--orange, #F5A524);
}

/* Abnehmer-Tile */
.mhc-tile--abnehmer {
  align-items: stretch;
  text-align: left;
  padding: 0.95rem 1.1rem;
  min-height: auto;
}
.mhc-tile--abnehmer .mhc-tile__name {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.05rem;
  margin: 0 0 0.3rem 0;
  font-weight: 600;
}
.mhc-tile__status-badge {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  background: #d4edda;
  color: #155724;
  font-size: 0.72rem;
  border-radius: 4px;
  align-self: flex-start;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mhc-tile--inaktiv .mhc-tile__status-badge {
  background: #f0f0f0;
  color: #777;
}
.mhc-tile--inaktiv {
  opacity: 0.65;
}
.mhc-tile__metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  margin-top: 0.7rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--line, #ebe2d0);
}
.mhc-tile__metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.05rem;
}
.mhc-tile__metric-label {
  font-size: 0.66rem;
  color: var(--text-soft, #888);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.mhc-tile__metric-value {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink, #163259);
  line-height: 1.1;
}
.mhc-tile__metric-cap {
  font-size: 0.7rem;
  color: var(--text-soft, #888);
}

/* ---------- THEME-TOGGLE (Sprint TS 2026-05-13 abend) ----------
   Circular Button in .top-actions; Icon swap je nach :root[data-theme]
   via CSS-Custom-Properties (Tokens in :root-Blocks oben).            */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  padding: 0;
  font-size: 16px;
  line-height: 1;
  transition: background 150ms ease-out, border-color 150ms ease-out, transform 100ms ease-out;
  user-select: none;
}
.theme-toggle:hover {
  background: var(--creme);
  border-color: var(--accent);
}
.theme-toggle:active {
  transform: scale(0.95);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.theme-toggle__icon--sun  { display: var(--theme-toggle-sun-display,  inline-block); }
.theme-toggle__icon--moon { display: var(--theme-toggle-moon-display, none); }

/* Smooth Theme-Transition global (alle BG/Text/Border) */
html[data-theme],
html[data-theme] body,
html[data-theme] .topbar,
html[data-theme] .card,
html[data-theme] .table,
html[data-theme] input,
html[data-theme] textarea,
html[data-theme] select,
html[data-theme] button {
  transition: background-color 200ms ease-out, color 200ms ease-out, border-color 200ms ease-out;
}

/* Dark-Mode Form-Inputs (typischer Override-Bedarf) */
:root[data-theme="dark"] input[type="text"],
:root[data-theme="dark"] input[type="email"],
:root[data-theme="dark"] input[type="tel"],
:root[data-theme="dark"] input[type="number"],
:root[data-theme="dark"] input[type="search"],
:root[data-theme="dark"] input[type="url"],
:root[data-theme="dark"] input[type="password"],
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] select {
  background: var(--bg);
  color: var(--text);
  border-color: var(--line);
}
:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder {
  color: var(--text-soft);
}

/* Dark-Mode Code/Pre-Blocks */
:root[data-theme="dark"] pre,
:root[data-theme="dark"] code {
  background: var(--creme);
  color: var(--text);
  border: 1px solid var(--line);
}

/* ============================================================
   Sprint CF.2 — Cashflow-Übersicht (Mock-First, 2026-05-13 abend)
   ============================================================
   Theme-aware via existing CSS-Vars: --bg/--card/--text/--ink/--accent/--line/--creme
   Light = MHC-Brand (Paper #FBF7EE + Navy #163259 + Amber #F5A524)
   Dark  = Slate-Pyramide (BG #0e1117 + Card #1a222c)
   Alle Klassen Prefix `.cf-*` für strikte Scope-Trennung.
   ============================================================ */

/* Mock-Modus Banner */
.cf-mock-banner {
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid var(--accent-hover);
}
.cf-mock-banner strong { font-weight: 700; }
.cf-mock-banner code {
  background: rgba(255,255,255,0.18);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 12px;
}

/* Page-Head */
.cf-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.cf-head h1.cf-h1 {
  margin: 4px 0 4px;
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  font-family: 'Fraunces', Georgia, serif;
}
.cf-head .cf-sub {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
}
.cf-head-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.cf-head-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 143, 77, 0.18);
}

/* Period-Pill */
.cf-range-pill {
  display: inline-flex;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.cf-range-pill button {
  background: transparent;
  border: none;
  color: var(--text-soft);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 500;
  transition: background 150ms, color 150ms;
}
.cf-range-pill button:hover { color: var(--ink); }
.cf-range-pill button.on {
  background: var(--navy);
  color: #fff;
}

/* KPI-Row */
.cf-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.cf-kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}
.cf-kpi::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
}
.cf-kpi-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.cf-kpi-label {
  font-size: 12px;
  color: var(--text-soft);
  font-weight: 500;
}
.cf-kpi-trend {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
}
.cf-kpi-trend.up   { color: var(--green); background: rgba(47, 143, 77, 0.12); }
.cf-kpi-trend.down { color: var(--red);   background: rgba(192, 57, 43, 0.12); }
.cf-kpi-val {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 26px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
  margin: 6px 0 8px;
}
.cf-kpi-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-soft);
}
.cf-kpi-spark { color: var(--accent); }
.cf-kpi-spark.up   { color: var(--green); }
.cf-kpi-spark.down { color: var(--red); }

/* Section-Head */
.cf-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 28px 0 14px;
}
.cf-section-head h2.cf-h2 {
  margin: 0;
  font-size: 16px;
  color: var(--ink);
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
}
.cf-section-count {
  font-size: 11px;
  color: var(--text-soft);
  letter-spacing: 0.04em;
}

/* Provider-Integration-Cards */
.cf-intg-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.cf-intg {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cf-intg.live { border-color: var(--green); }
.cf-intg.live::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--green);
  border-radius: 12px 12px 0 0;
}
.cf-intg-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cf-intg-logo {
  width: 38px; height: 38px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  letter-spacing: -0.5px;
}
.cf-intg-name { display: flex; flex-direction: column; flex: 1; }
.cf-intg-title {
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
}
.cf-intg-kind {
  color: var(--text-soft);
  font-size: 11px;
}
.cf-intg-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.cf-intg-badge.badge-ok   { background: rgba(47, 143, 77, 0.16);  color: var(--green); }
.cf-intg-badge.badge-mute { background: rgba(136, 147, 165, 0.15); color: var(--text-soft); }
.cf-intg-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
}
.cf-intg-stats > div { text-align: center; }
.cf-intg-stats strong {
  display: block;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 17px;
  color: var(--ink);
  font-weight: 600;
}
.cf-intg-stats span {
  font-size: 10px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.cf-intg-desc {
  margin: 0;
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.5;
  min-height: 48px;
}
.cf-intg-actions {
  display: flex;
  gap: 8px;
}

/* Add-Card */
.cf-intg-add {
  background: transparent;
  border: 2px dashed var(--line);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: border-color 150ms, background 150ms;
  min-height: 92px;
  justify-content: center;
}
.cf-intg-add:hover { border-color: var(--accent); background: rgba(154, 137, 118, 0.05); }
.cf-intg-add-icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  font-weight: 600;
  flex-shrink: 0;
}
.cf-intg-add-text { display: flex; flex-direction: column; }
.cf-intg-add-text strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}
.cf-intg-add-text span {
  color: var(--text-soft);
  font-size: 11px;
}

/* Generische Buttons im CF-Scope */
.cf-btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 500;
  transition: all 150ms;
}
.cf-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.cf-btn-ghost { background: transparent; }
.cf-btn-primary {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.cf-btn-primary:hover:not(:disabled) { background: var(--navy-dark); }

/* Card-Wrapper */
.cf-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 18px 0;
  overflow: hidden;
}
.cf-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.cf-card-head h2.cf-h2 { margin: 0; font-size: 15px; }
.cf-card-body { padding: 14px 18px; }

/* Bestellungs-Tabelle */
.cf-table-wrap { overflow-x: auto; }
.cf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.cf-table thead th {
  background: var(--creme);
  color: var(--text-soft);
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--line);
}
.cf-table tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  color: var(--text);
}
.cf-table tbody tr:hover td { background: rgba(154, 137, 118, 0.04); }
.cf-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.cf-mono {
  font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 11.5px;
  color: var(--ink);
  font-weight: 600;
}
.cf-sub-small { font-size: 10.5px; color: var(--text-soft); }

/* Partner-Avatar */
.cf-partner-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cf-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

/* Paket-Typ-Badges */
.cf-pkg {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cf-pkg.pkg-directpool { background: rgba(47, 143, 77, 0.14); color: var(--green); }
.cf-pkg.pkg-multilead  { background: rgba(154, 137, 118, 0.16); color: var(--accent); }
.cf-pkg.pkg-marktplatz { background: rgba(209, 125, 30, 0.14); color: var(--orange); }
.cf-pkg.pkg-bulk       { background: rgba(22, 50, 89, 0.10); color: var(--navy); }

/* Pay-Status-Badges */
.cf-pay-badge, .cf-acc-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
}
.cf-pay-badge.pay-paid { background: rgba(47, 143, 77, 0.16); color: var(--green); }
.cf-pay-badge.pay-open { background: rgba(179, 147, 34, 0.18); color: var(--yellow); }
.cf-pay-badge.pay-fail { background: rgba(192, 57, 43, 0.16); color: var(--red); }
.cf-pay-badge.pay-blue { background: rgba(22, 50, 89, 0.12); color: var(--navy); }
.cf-acc-badge.acc-ok   { background: rgba(47, 143, 77, 0.16); color: var(--green); }
.cf-acc-badge.acc-sync { background: rgba(209, 125, 30, 0.14); color: var(--orange); }
.cf-acc-badge.acc-gray { background: rgba(136, 147, 165, 0.15); color: var(--text-soft); }

/* Progress-Bar */
.cf-progress {
  position: relative;
  background: var(--creme);
  height: 18px;
  border-radius: 4px;
  overflow: hidden;
  min-width: 80px;
  width: 100%;
}
.cf-progress-bar {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: var(--green);
  border-radius: 4px;
  transition: width 300ms ease-out;
}
.cf-progress-label {
  position: relative;
  z-index: 1;
  display: block;
  text-align: center;
  font-size: 10.5px;
  line-height: 18px;
  color: var(--ink);
  font-weight: 600;
}

/* Bottom-Grid (Region + Top-Partner) */
.cf-bot-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
  margin-top: 8px;
}

/* Region-Rows */
.cf-region-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.cf-region-row:last-child { border-bottom: none; }
.cf-region-name {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12.5px;
  color: var(--ink);
  font-weight: 500;
}
.cf-region-meta {
  font-size: 11px;
  color: var(--text-soft);
}
.cf-region-bar {
  background: var(--creme);
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
}
.cf-region-bar-fill {
  height: 100%;
  background: var(--accent);
  transition: width 300ms ease-out;
}

/* Top-Partner-Rows */
.cf-top-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.cf-top-row:last-child { border-bottom: none; }
.cf-top-rank {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
  width: 36px;
}
.cf-top-info { flex: 1; display: flex; flex-direction: column; }
.cf-top-name {
  font-size: 12.5px;
  color: var(--ink);
  font-weight: 600;
}
.cf-top-meta {
  font-size: 11px;
  color: var(--text-soft);
}
.cf-top-rev {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

/* Mobile-Breakpoint */
@media (max-width: 880px) {
  .cf-kpi-row { grid-template-columns: 1fr 1fr; }
  .cf-intg-grid { grid-template-columns: 1fr; }
  .cf-bot-grid { grid-template-columns: 1fr; }
  .cf-head { flex-direction: column; align-items: stretch; }
  .cf-head-tools { width: 100%; }
  .cf-range-pill { width: 100%; justify-content: space-between; }
}
@media (max-width: 520px) {
  .cf-kpi-row { grid-template-columns: 1fr; }
  .cf-table { font-size: 11px; }
  .cf-table thead th, .cf-table tbody td { padding: 8px 6px; }
}

/* ========================================================================== */
/* Sprint INT.1.UX (2026-05-17) — Integrations-Dashboard-Refactor             */
/* 9 Kategorie-Cards 3x3-Grid + Detail-Mode + Filter-Tabs                     */
/* MHC-Brand Navy+Amber Pattern, MOBILE responsive                            */
/* ========================================================================== */

/* Dashboard-Grid: 3 Spalten desktop, 2 tablet, 1 mobile */
.int-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 16px 0;
}
@media (max-width: 1024px) { .int-dashboard-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .int-dashboard-grid { grid-template-columns: 1fr; } }

/* Category-Card */
.int-cat-card {
  background: var(--cf-card-bg, #fff);
  border: 1px solid var(--cf-border, #e2e1de);
  border-radius: 6px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.int-cat-card:hover {
  border-color: var(--accent, #9a8976);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22, 50, 89, 0.08);
}
.int-cat-card--empty {
  background: var(--cf-card-bg-muted, #fafaf8);
  opacity: 0.78;
}
.int-cat-card--empty:hover { opacity: 1; }

/* Card Header */
.int-cat-card__header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.int-cat-card__icon {
  font-size: 1.6rem;
  line-height: 1;
}
.int-cat-card__name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--cf-text, #163259);
}

/* Card Description */
.int-cat-card__desc {
  margin: 0;
  font-size: 0.85rem;
  color: var(--cf-muted, #6b7280);
  line-height: 1.4;
  min-height: 2.4em;
}

/* Card Badges-Row */
.int-cat-card__badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.int-cat-card__counter {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--cf-text-soft, #4b5563);
  background: var(--cf-card-bg-muted, #f3f4f6);
  padding: 3px 9px;
  border-radius: 12px;
}
.int-cat-card__live-badge {
  font-size: 0.74rem;
  font-weight: 700;
  color: #065f46;
  background: #d1fae5;
  padding: 3px 9px;
  border-radius: 12px;
}
.int-cat-card__soon-badge {
  font-size: 0.74rem;
  font-weight: 600;
  color: #92400e;
  background: #fef3c7;
  padding: 3px 9px;
  border-radius: 12px;
}
.int-cat-card__inactive-badge {
  font-size: 0.74rem;
  font-weight: 600;
  color: #6b7280;
  background: #f3f4f6;
  padding: 3px 9px;
  border-radius: 12px;
}

/* LIVE-Liste (Cross-Module-Display) */
.int-cat-card__live-list {
  font-size: 0.78rem;
  color: var(--cf-text-soft, #4b5563);
  border-top: 1px dashed var(--cf-border, #e2e1de);
  padding-top: 8px;
  line-height: 1.35;
}
.int-cat-card__live-list strong { color: #065f46; }

/* Card CTA */
.int-cat-card__cta {
  margin-top: auto;
  padding-top: 4px;
}
.int-cat-card__cta .cf-btn { width: 100%; text-align: center; }

/* Detail-Mode Breadcrumb */
.int-detail-breadcrumb {
  font-size: 0.88rem;
  color: var(--cf-muted, #6b7280);
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 4px 0 12px 0;
}
.int-detail-breadcrumb a {
  color: var(--cf-link, #1e3a8a);
  text-decoration: none;
  font-weight: 500;
}
.int-detail-breadcrumb a:hover { text-decoration: underline; }
.int-detail-breadcrumb strong { color: var(--cf-text, #163259); font-weight: 600; }

/* Detail-Mode Filter-Tabs */
.int-detail-filter-tabs {
  display: inline-flex;
  gap: 4px;
  background: var(--cf-card-bg-muted, #f3f4f6);
  padding: 4px;
  border-radius: 8px;
  margin: 8px 0 16px 0;
  border: 1px solid var(--cf-border, #e2e1de);
}
.int-detail-filter-tabs a {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--cf-text-soft, #4b5563);
  transition: background 0.15s ease, color 0.15s ease;
}
.int-detail-filter-tabs a:hover { background: rgba(255,255,255,0.7); color: var(--cf-text, #163259); }
.int-detail-filter-tabs a.on {
  background: #fff;
  color: var(--cf-text, #163259);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

/* Dark-Theme-Overrides */
:root[data-theme="dark"] .int-cat-card {
  background: var(--cf-card-bg, #1a222c);
  border-color: var(--cf-border, #2d3845);
}
:root[data-theme="dark"] .int-cat-card--empty {
  background: var(--cf-card-bg-muted, #161d26);
}
:root[data-theme="dark"] .int-cat-card__name { color: var(--cf-text, #e5e7eb); }
:root[data-theme="dark"] .int-cat-card__counter,
:root[data-theme="dark"] .int-cat-card__inactive-badge {
  color: #cbd5e1;
  background: #2d3845;
}
:root[data-theme="dark"] .int-cat-card__live-list { border-top-color: #2d3845; }
:root[data-theme="dark"] .int-detail-filter-tabs { background: #161d26; border-color: #2d3845; }
:root[data-theme="dark"] .int-detail-filter-tabs a { color: #cbd5e1; }
:root[data-theme="dark"] .int-detail-filter-tabs a.on { background: #2d3845; color: #fff; }

/* ════════════════════════════════════════════════════════════════════
   Sidebar-Collapse + Section-Fold (Sprint 2026-05-18 Tag 16 abend)
   - Smooth-Transition für width + label/section-fade
   - localStorage-persistent (Logic in /js/sidebar.js)
   - Auto-Collapse < 768px Viewport
   - CSP-strict (kein inline-JS)
   ════════════════════════════════════════════════════════════════════ */

.layout {
  transition: grid-template-columns 0.25s ease;
}
.sidebar {
  transition: width 0.25s ease;
  overflow-x: hidden;
}

/* Burger-Toggle-Button im brand-Bereich */
.sidebar-toggle {
  position: absolute;
  top: 16px; right: 12px;
  width: 28px; height: 28px;
  background: transparent;
  border: 1px solid #5a6c8c;
  border-radius: 4px;
  color: #dfe7f3;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  transition: background 0.15s, border-color 0.15s;
}
.sidebar-toggle:hover { background: var(--navy-soft); border-color: var(--accent); }
.sidebar-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Collapsed-Mode */
.layout.sidebar-collapsed { grid-template-columns: 64px 1fr; }
.sidebar.collapsed { width: 64px; }
.sidebar.collapsed .brand small { display: none; }
.sidebar.collapsed .brand .logo { width: 36px; height: 36px; }
.sidebar.collapsed .brand a { display: flex; justify-content: center; padding: 4px 0; }
.sidebar.collapsed .nav-label { display: none; }
.sidebar.collapsed .nav-soon  { display: none; }
.sidebar.collapsed .section-label { display: none; }
.sidebar.collapsed .section-chevron { display: none; }
.sidebar.collapsed .section-header {
  padding: 8px 0;
  justify-content: center;
  cursor: default;
}
.sidebar.collapsed .userbox .user,
.sidebar.collapsed .userbox a {
  font-size: 10px;
  text-align: center;
  display: block;
}
.sidebar.collapsed .nav li a {
  padding: 10px 0;
  display: flex;
  justify-content: center;
  border-left-width: 0;
  border-right: 3px solid transparent;
}
.sidebar.collapsed .nav li a.active {
  border-right-color: var(--accent);
  border-left-color: transparent;
}
.sidebar.collapsed .nav-icon { font-size: 18px; margin: 0; }
.sidebar.collapsed .nav-badge {
  position: absolute;
  top: 6px; right: 6px;
  transform: scale(0.8);
}

/* Tooltip CSS-only für collapsed-Mode */
.sidebar.collapsed .nav li a {
  position: relative;
}
.sidebar.collapsed .nav li a:hover::after {
  content: attr(title);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: #163259;
  color: #fff;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 13px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  z-index: 1000;
  pointer-events: none;
}
.sidebar.collapsed .nav li a:hover::before {
  content: '';
  position: absolute;
  left: calc(100% + 2px);
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: #163259;
  z-index: 1000;
  pointer-events: none;
}

/* Section-Header (Toggle-Button) */
.section-group { list-style: none; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: transparent;
  border: 0;
  padding: 14px 20px 6px;
  cursor: pointer;
  color: #7e94b5;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: inherit;
  text-align: left;
  transition: color 0.15s;
}
.section-header:hover { color: #b6c2d5; }
.section-header:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.section-chevron {
  font-size: 10px;
  transition: transform 0.2s ease;
  display: inline-block;
}
.section-group.folded .section-chevron { transform: rotate(-90deg); }
.section-group.folded .section-items {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}
.section-items {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 9999px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease;
}

/* Nav-Icon + Nav-Label Inner-Spacing */
.nav-icon {
  display: inline-block;
  margin-right: 8px;
  font-size: 14px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}
.nav-label {
  flex: 1;
}
.nav li a {
  display: flex;
  align-items: center;
  gap: 0;
}

/* Mobile: Auto-Hide Sidebar bei sehr kleinen Screens */
@media (max-width: 767px) {
  .layout { grid-template-columns: 0 1fr; }
  .layout.sidebar-mobile-open { grid-template-columns: 220px 1fr; }
  .sidebar { width: 0; }
  .layout.sidebar-mobile-open .sidebar { width: 220px; }
  .sidebar-toggle { display: flex; }
}

/* Dark-Mode Anpassungen */
:root[data-theme="dark"] .sidebar-toggle {
  border-color: #2d3845;
  color: #cbd5e1;
}
:root[data-theme="dark"] .sidebar-toggle:hover { background: #1a222c; }
:root[data-theme="dark"] .section-header { color: #6b7280; }
:root[data-theme="dark"] .section-header:hover { color: #cbd5e1; }
:root[data-theme="dark"] .sidebar.collapsed .nav li a:hover::after {
  background: #0e1117;
  border: 1px solid #2d3845;
}
:root[data-theme="dark"] .sidebar.collapsed .nav li a:hover::before {
  border-right-color: #2d3845;
}
