/* ──────────────────────────────────────
   DESIGN TOKENS – Apple System
────────────────────────────────────── */
:root {
  --blue:   #007AFF;
  --red:    #FF3B30;
  --orange: #FF9500;
  --green:  #34C759;
  --purple: #AF52DE;
  --teal:   #32ADE6;

  --bg:        #F2F2F7;
  --surface:   #FFFFFF;
  --surface-2: #F2F2F7;
  --surface-3: #E5E5EA;

  --text:   #1C1C1E;
  --text-2: #3C3C43;
  --text-3: rgba(60,60,67,0.55);
  --text-4: rgba(60,60,67,0.28);

  --sep: rgba(60,60,67,0.13);
  --sep-2: rgba(60,60,67,0.18);

  --sidebar-bg: #FFFFFF;
  --sidebar-w:  220px;

  --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 0 0 0.5px rgba(0,0,0,0.05);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.10);

  --radius: 12px;
  --radius-sm: 8px;

  --c-red-bg:    rgba(255,59,48,0.1);
  --c-orange-bg: rgba(255,149,0,0.1);
  --c-green-bg:  rgba(52,199,89,0.1);
  --c-blue-bg:   rgba(0,122,255,0.1);
  --c-purple-bg: rgba(175,82,222,0.1);
  --c-teal-bg:   rgba(50,173,230,0.1);

  /* Legacy compat */
  --primary: var(--blue);
  --primary-light: #3d8eff;
  --accent: var(--orange);
  --white: var(--surface);
  --text-muted: var(--text-3);
  --border: var(--sep);
  --success: var(--green);
  --success-bg: var(--c-green-bg);
  --warning: var(--orange);
  --warning-bg: var(--c-orange-bg);
  --danger: var(--red);
  --danger-bg: var(--c-red-bg);
  --info: var(--blue);
  --info-bg: var(--c-blue-bg);
  --shadow: var(--shadow-card);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  -webkit-font-smoothing: antialiased;
}

/* ──────────────────────────────────────
   SIDEBAR
────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 0.5px solid var(--sep);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  left: 0; top: 0;
  z-index: 100;
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
}

.sidebar-header {
  padding: 22px 16px 14px;
  border-bottom: 0.5px solid var(--sep);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo-icon {
  width: 32px; height: 32px;
  background: var(--blue);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-logo-icon svg {
  width: 16px; height: 16px;
  fill: none; stroke: white;
  stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

.sidebar-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.sidebar-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-4);
  padding: 10px 7px 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s;
  margin-bottom: 1px;
  user-select: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.nav-item svg {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
  color: var(--text-3);
}

.nav-item:hover { background: var(--surface-2); }
.nav-item.active { background: var(--c-blue-bg); color: var(--blue); }
.nav-item.active svg { color: var(--blue); }

.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  line-height: 16px;
}

.sidebar-footer {
  padding: 10px 10px 18px;
  border-top: 0.5px solid var(--sep);
  display: flex;
  flex-direction: column;
  gap: 1px;
}

/* ──────────────────────────────────────
   MAIN LAYOUT
────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

.topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 52px;
  background: var(--sidebar-bg);
  border-bottom: 0.5px solid var(--sep);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-brand { font-size: 14px; font-weight: 600; color: var(--text); }

.hamburger {
  width: 32px; height: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4.5px;
  padding: 8px;
  cursor: pointer;
  border: none;
  background: none;
  border-radius: 6px;
}

.hamburger span {
  display: block;
  height: 1.5px;
  background: var(--text-2);
  border-radius: 2px;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.25s;
}

/* ──────────────────────────────────────
   PAGE
────────────────────────────────────── */
.page {
  padding: 32px;
  flex: 1;
  max-width: 1280px;
  width: 100%;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 3px;
}

/* ──────────────────────────────────────
   CARDS
────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px 13px;
  border-bottom: 0.5px solid var(--sep);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.card-meta { font-size: 12px; color: var(--text-3); }
.card-body { padding: 20px; }

/* ──────────────────────────────────────
   CHARTS GRID (index.html)
────────────────────────────────────── */
.charts-grid {
  display: grid;
  grid-template-columns: 3fr 2fr 1.5fr;
  gap: 12px;
  margin-bottom: 24px;
  align-items: stretch;
}

.chart-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}

.chart-card-area .chart-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}

.chart-metric-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  margin-bottom: 4px;
}

.chart-metric-value {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1;
}

.chart-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 8px;
  vertical-align: middle;
}

.chart-trend.up   { color: var(--green); }
.chart-trend.down { color: var(--red); }

.period-seg {
  display: inline-flex;
  background: var(--surface-2);
  border-radius: 7px;
  padding: 2px;
  flex-shrink: 0;
}

.period-btn {
  padding: 4px 10px;
  border-radius: 5px;
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
}

.period-btn.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.chart-canvas-wrap {
  position: relative;
  height: 145px;
  width: 100%;
}

.chart-card-donut {
  align-items: center;
}

.chart-card-donut .chart-metric-label {
  margin-bottom: 12px;
  align-self: flex-start;
  width: 100%;
}

.donut-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  flex-shrink: 0;
  margin: 0 auto 16px;
}

.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.donut-center-num {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1;
}

.donut-center-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}

.donut-legend {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
}

.legend-left {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-2);
}

.legend-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-count {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}

.chart-card-metrics {
  justify-content: space-between;
}

.metric-row {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 14px 0;
}

.metric-row + .metric-row {
  border-top: 0.5px solid var(--sep);
}

.metric-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-3);
  margin-bottom: 5px;
}

.metric-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}

.metric-sub {
  font-size: 11.5px;
  color: var(--text-4);
  margin-top: 3px;
}

/* ──────────────────────────────────────
   STATS GRID (simple number cards)
────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  margin-bottom: 8px;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-sub { font-size: 12px; color: var(--text-4); }

/* ──────────────────────────────────────
   FILTER BAR
────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-4);
}

.filter-segment {
  display: inline-flex;
  background: var(--surface-2);
  border-radius: 9px;
  padding: 3px;
  gap: 1px;
}

.filter-btn {
  padding: 5px 11px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s;
  font-family: inherit;
  white-space: nowrap;
}

.filter-btn:hover { color: var(--text-2); }

.filter-btn.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 0 0 0.5px rgba(0,0,0,0.05);
}

.filter-sep {
  width: 0.5px; height: 18px;
  background: var(--sep);
  align-self: center;
}

/* ──────────────────────────────────────
   TABLE
────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
tbody tr { cursor: pointer; }

table { width: 100%; border-collapse: collapse; }

th {
  padding: 9px 16px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-3);
  border-bottom: 0.5px solid var(--sep);
  white-space: nowrap;
  text-align: left;
  letter-spacing: 0.01em;
}

td {
  padding: 14px 16px;
  border-bottom: 0.5px solid var(--sep);
  vertical-align: middle;
  font-size: 13.5px;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-2); }

/* Notfall row */
tr.row-notfall td { background: rgba(255,59,48,0.04); }
tr.row-notfall td:first-child {
  border-left: 2.5px solid var(--red);
  padding-left: 13.5px;
}
tr.row-notfall:hover td { background: rgba(255,59,48,0.07); }

.table-link {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  display: block;
}
.table-link:hover { color: var(--blue); }

/* ──────────────────────────────────────
   BADGES
────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-neu          { background: var(--c-blue-bg);   color: var(--blue); }
.badge-in_bearbeitung { background: var(--c-purple-bg); color: var(--purple); }
.badge-angenommen   { background: var(--c-green-bg);  color: var(--green); }
.badge-abgelehnt    { background: var(--c-red-bg);    color: var(--red); }
.badge-abgeschlossen { background: var(--surface-2);  color: var(--text-3); }
.badge-termin_geplant { background: var(--c-teal-bg); color: var(--teal); }
.badge-voice_eingang  { background: var(--c-purple-bg); color: var(--purple); }

.badge-notfall    { background: var(--c-red-bg);    color: var(--red); }
.badge-dringend   { background: var(--c-orange-bg); color: var(--orange); }
.badge-geplant    { background: var(--c-green-bg);  color: var(--green); }

.badge-hoch       { background: var(--c-red-bg);    color: var(--red); }
.badge-mittel     { background: var(--c-orange-bg); color: var(--orange); }
.badge-niedrig    { background: var(--c-green-bg);  color: var(--green); }

/* ──────────────────────────────────────
   BUTTONS
────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
  font-family: inherit;
}

.btn-primary  { background: var(--blue);  color: white; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-success  { background: var(--green); color: white; }
.btn-success:hover { filter: brightness(1.1); }
.btn-danger   { background: var(--red);   color: white; }
.btn-danger:hover { filter: brightness(1.1); }
.btn-outline  {
  background: var(--surface-2);
  color: var(--text-2);
  border: none;
}
.btn-outline:hover { background: var(--surface-3); }
.btn-sm { padding: 5px 10px; font-size: 12px; }

.btn-icon {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: var(--surface-2);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
  text-decoration: none;
}
.btn-icon:hover { background: var(--surface-3); color: var(--text-2); }

/* ──────────────────────────────────────
   DETAIL PAGE
────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.detail-field { margin-bottom: 16px; }
.detail-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-3);
  margin-bottom: 4px;
}
.detail-value { font-size: 14px; color: var(--text); }

.ki-box {
  background: var(--c-blue-bg);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
}

.ki-box-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--blue);
  margin-bottom: 8px;
}

.ki-summary { font-size: 14px; line-height: 1.6; color: var(--text); }

.ki-meta {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.ki-meta-item { display: flex; flex-direction: column; gap: 2px; }
.ki-meta-label { font-size: 10px; text-transform: uppercase; font-weight: 600; color: var(--text-3); }
.ki-meta-value { font-size: 13px; font-weight: 600; }

/* ──────────────────────────────────────
   STATS PAGE – BAR CHARTS
────────────────────────────────────── */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.bar-chart { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-label { width: 100px; font-size: 13px; color: var(--text); text-align: right; flex-shrink: 0; }
.bar-track { flex: 1; background: var(--surface-2); border-radius: 4px; height: 24px; overflow: hidden; }
.bar-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 4px;
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  padding-left: 8px;
  min-width: 30px;
}
.bar-fill span { color: white; font-size: 11px; font-weight: 700; }
.bar-count { width: 30px; font-size: 13px; font-weight: 600; color: var(--text-3); }

/* ──────────────────────────────────────
   FORM / TEXTAREA
────────────────────────────────────── */
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 0.5px solid var(--sep);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
  color: var(--text);
  background: var(--surface);
}

textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,122,255,0.12);
}

/* ──────────────────────────────────────
   EMPTY STATE / LOADING
────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-3);
}

.empty-state-icon { font-size: 36px; margin-bottom: 12px; }
.empty-state-text { font-size: 15px; font-weight: 600; color: var(--text); }
.empty-state-sub { font-size: 13px; margin-top: 4px; }

.loading { text-align: center; padding: 32px; color: var(--text-3); }

/* ──────────────────────────────────────
   TOAST
────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  z-index: 1000;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.2s;
}

.toast.show  { opacity: 1; transform: translateY(0); }
.toast.success { background: var(--green); }
.toast.error   { background: var(--red); }

/* ──────────────────────────────────────
   RESPONSIVE
────────────────────────────────────── */
@media (max-width: 1100px) {
  .charts-grid {
    grid-template-columns: 1fr 1fr;
  }
  .chart-card:first-child {
    grid-column: span 2;
  }
}

@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; }
  .chart-grid  { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: 0 0 40px rgba(0,0,0,0.12);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { display: block; }
  .sidebar-overlay.open { opacity: 1; pointer-events: all; }
  .main { margin-left: 0; }
  .topbar { display: flex; }
  .page { padding: 16px; }
  .page-header { flex-wrap: wrap; }
  .charts-grid { grid-template-columns: 1fr; }
  .chart-card:first-child { grid-column: span 1; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .page-title { font-size: 20px; }
  .col-ort, .col-aufwand, .col-prioritaet { display: none; }
  th, td { padding: 12px; }
}

@media (max-width: 420px) {
  .col-kategorie { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ══════════════════════════════════════════════════════════════
   ÜBERSICHTS-SEITE — ck- Komponenten-System
══════════════════════════════════════════════════════════════ */

.ck-page { padding: 24px 28px; max-width: 1200px; }

.ck-greeting { margin-bottom: 20px; }
.ck-greeting-text { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.2; }
.ck-greeting-sub  { font-size: 13px; color: var(--text-3); margin-top: 2px; }

.ck-status-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); margin-right: 5px; vertical-align: middle;
}
.ck-status-pill {
  display: inline-flex; align-items: center; font-size: 12px;
  color: var(--green); background: var(--c-green-bg); border-radius: 20px;
  padding: 3px 10px; font-weight: 500; gap: 4px;
}

.ck-notfall-alert {
  display: flex; align-items: center; gap: 14px;
  background: var(--c-red-bg); border: 1px solid rgba(255,59,48,0.25);
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 20px;
}
.ck-notfall-icon  { color: var(--red); flex-shrink: 0; }
.ck-notfall-body  { flex: 1; }
.ck-notfall-title { font-size: 14px; font-weight: 600; color: var(--red); }
.ck-notfall-text  { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.ck-notfall-btn {
  font-size: 13px; font-weight: 500; color: var(--red);
  background: var(--surface); border: 1px solid rgba(255,59,48,0.3);
  border-radius: 8px; padding: 6px 14px; text-decoration: none;
  white-space: nowrap; flex-shrink: 0;
}
.ck-notfall-btn:hover { background: rgba(255,59,48,0.08); }

.ck-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.ck-kpi {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-card); padding: 16px;
  display: flex; align-items: center; gap: 12px; transition: box-shadow 0.15s;
}
.ck-kpi:hover { box-shadow: var(--shadow-md); }
.ck-kpi-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ck-kpi-icon svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ck-kpi-body  { min-width: 0; }
.ck-kpi-val   { font-size: 24px; font-weight: 700; line-height: 1; color: var(--text); }
.ck-kpi-label { font-size: 12px; color: var(--text-3); margin-top: 3px; white-space: nowrap; }

.ck-kpi[data-color="blue"]   .ck-kpi-icon { background: var(--c-blue-bg);   color: var(--blue); }
.ck-kpi[data-color="orange"] .ck-kpi-icon { background: var(--c-orange-bg); color: var(--orange); }
.ck-kpi[data-color="green"]  .ck-kpi-icon { background: var(--c-green-bg);  color: var(--green); }
.ck-kpi[data-color="red"]    .ck-kpi-icon { background: var(--c-red-bg);    color: var(--red); }
.ck-kpi[data-color="purple"] .ck-kpi-icon { background: var(--c-purple-bg); color: var(--purple); }
.ck-kpi[data-color="teal"]   .ck-kpi-icon { background: var(--c-teal-bg);   color: var(--teal); }

.ck-mid-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px; margin-bottom: 16px;
}
@media (max-width: 700px) { .ck-mid-row { grid-template-columns: 1fr; } }

.ck-card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-card); padding: 18px 20px; margin-bottom: 16px;
}
.ck-card-head {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 14px;
}
.ck-card-title { font-size: 15px; font-weight: 600; color: var(--text); }
.ck-card-badge {
  font-size: 12px; color: var(--text-3);
  background: var(--bg); border-radius: 20px; padding: 2px 10px;
}
.ck-see-all {
  font-size: 13px; color: var(--blue); text-decoration: none;
  display: inline-flex; align-items: center; gap: 3px;
}
.ck-see-all:hover { text-decoration: underline; }

.ck-donut-card { margin-bottom: 0; }
.ck-donut-inner { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.ck-donut-svg-wrap { flex-shrink: 0; }
.ck-donut-legend { flex: 1; min-width: 120px; }
.ck-legend-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ck-legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.ck-legend-lbl { flex: 1; font-size: 13px; color: var(--text-2); }
.ck-legend-n   { font-size: 13px; font-weight: 600; color: var(--text); }

.ck-status-breakdown-card { margin-bottom: 0; }
.ck-sb-row { display: flex; align-items: stretch; justify-content: space-around; margin-bottom: 16px; }
.ck-sb-item { text-align: center; flex: 1; }
.ck-sb-n    { font-size: 28px; font-weight: 700; color: var(--text); line-height: 1; }
.ck-sb-lbl  { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.ck-sb-divider { width: 1px; background: var(--sep); margin: 0 8px; }
.ck-sb-progress-track {
  height: 8px; border-radius: 4px; background: var(--bg);
  display: flex; overflow: hidden; gap: 2px;
}
.ck-sb-progress-offen       { background: var(--orange); transition: width 0.5s; }
.ck-sb-progress-verarbeitet { background: var(--green);  transition: width 0.5s; }
.ck-sb-progress-eskaliert   { background: var(--red);    transition: width 0.5s; }
.ck-sb-progress-labels { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.ck-sb-pct-lbl { font-size: 12px; color: var(--text-3); }
.ck-sb-link { font-size: 12px; color: var(--blue); text-decoration: none; }

.ck-feed-empty, .ck-feed-loading {
  text-align: center; padding: 24px 0; font-size: 13px; color: var(--text-3);
}
.ck-feed-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--sep);
  cursor: pointer;
}
.ck-feed-item:last-child { border-bottom: none; }
.ck-feed-item:hover { background: var(--bg); border-radius: 8px; }
.ck-feed-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--c-blue-bg); color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; flex-shrink: 0;
}
.ck-feed-notfall .ck-feed-avatar { background: var(--c-red-bg); color: var(--red); }
.ck-feed-main    { flex: 1; min-width: 0; }
.ck-feed-top     { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 2px; }
.ck-feed-name    { font-size: 14px; font-weight: 600; color: var(--text); }
.ck-feed-badge   {
  font-size: 11px; font-weight: 500; padding: 2px 8px;
  border-radius: 20px; background: var(--c-blue-bg); color: var(--blue);
}
.ck-feed-notfall .ck-feed-badge { background: var(--c-red-bg); color: var(--red); }
.ck-feed-anliegen { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ck-feed-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.ck-feed-time  { font-size: 12px; color: var(--text-3); }
.ck-feed-dur   { font-size: 11px; color: var(--text-3); }
.ck-feed-phone { font-size: 12px; color: var(--blue); }

.ck-badge-new  { background: var(--c-orange-bg); color: var(--orange); }
.ck-badge-done { background: var(--c-green-bg);  color: var(--green); }
.ck-badge-esc  { background: var(--c-red-bg);    color: var(--red); }

[data-theme="dark"] .ck-notfall-btn { background: rgba(255,255,255,0.06); }

.selection-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface-3); color: var(--text);
  padding: .85rem 2rem;
  display: flex; align-items: center; gap: 1rem;
  transform: translateY(100%); transition: transform .2s ease;
  z-index: 200; box-shadow: 0 -2px 12px rgba(0,0,0,.15);
  font-size: 14px; font-weight: 500;
  border-top: 0.5px solid var(--sep);
}
.selection-bar.visible { transform: translateY(0); }
[data-theme="dark"] .selection-bar { background: var(--surface-2); box-shadow: 0 -2px 16px rgba(0,0,0,.4); }

/* ── Dark Mode ──────────────────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:        #1C1C1E;
  --surface:   #2C2C2E;
  --surface-2: #3A3A3C;
  --surface-3: #48484A;

  --text:   #F2F2F7;
  --text-2: #EBEBF5;
  --text-3: rgba(235,235,245,0.55);
  --text-4: rgba(235,235,245,0.28);

  --sep:   rgba(255,255,255,0.10);
  --sep-2: rgba(255,255,255,0.07);

  --c-blue-bg:   rgba(10,132,255,0.18);
  --c-green-bg:  rgba(52,199,89,0.18);
  --c-orange-bg: rgba(255,159,10,0.18);
  --c-red-bg:    rgba(255,69,58,0.18);
  --c-purple-bg: rgba(175,82,222,0.18);
  --c-teal-bg:   rgba(90,200,250,0.18);
}

[data-theme="dark"] body { color-scheme: dark; }

[data-theme="dark"] .sidebar { background: #1C1C1E; border-right-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .topbar  { background: rgba(28,28,30,0.92); border-bottom-color: rgba(255,255,255,0.08); }

[data-theme="dark"] .card,
[data-theme="dark"] .detail-panel,
[data-theme="dark"] #detail-panel,
[data-theme="dark"] .modal-box { background: var(--surface); border-color: var(--sep); }

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--sep);
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder { color: var(--text-3); }
[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus { border-color: var(--blue); }

[data-theme="dark"] table thead th { border-bottom-color: var(--sep); color: var(--text-3); }
[data-theme="dark"] table tbody tr:hover { background: var(--surface-2); }
[data-theme="dark"] table tbody tr td { border-bottom-color: var(--sep); }

[data-theme="dark"] .btn-outline {
  background: transparent;
  border-color: var(--sep);
  color: var(--text-2);
}
[data-theme="dark"] .btn-outline:hover { background: var(--surface-2); }

[data-theme="dark"] .nav-item { color: var(--text-2); }
[data-theme="dark"] .nav-item:hover,
[data-theme="dark"] .nav-item.active { background: var(--surface-2); color: var(--text); }

[data-theme="dark"] .modal-overlay { background: rgba(0,0,0,0.7); }
[data-theme="dark"] .ck-notfall-btn { background: rgba(255,255,255,0.06); }
