:root {
  --solvion-cyan: #00AFCD;
  --solvion-dark: #0B577D;
  --solvion-teal: #3DA497;
  --solvion-orange: #F19F27;
  --solvion-pink: #EB5678;
  --solvion-text: #4D4D4D;
  --solvion-bg: #F2F2F2;
  --white: #FFFFFF;
  --border: #E2E6EA;
  --shadow: 0 1px 3px rgba(11, 87, 125, 0.06), 0 4px 14px rgba(11, 87, 125, 0.05);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", "Open Sans", Arial, sans-serif;
  background: var(--solvion-bg);
  color: var(--solvion-text);
  font-size: 14px;
  line-height: 1.5;
}

/* ---------- Topbar ---------- */
.topbar {
  background: var(--white);
  border-bottom: 3px solid var(--solvion-cyan);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.topbar-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 32px;
}
.topbar-left { display: flex; align-items: center; gap: 24px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-divider { width: 1px; height: 24px; background: var(--border); margin: 0 4px; }

/* Range Pill — sleek time selector */
.range-pill {
  position: relative;
}
.range-pill select {
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 32px 7px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--white);
  color: var(--solvion-dark);
  cursor: pointer;
  transition: all 0.2s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23002F6C' d='M3 4.5l3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.range-pill select:hover {
  border-color: var(--solvion-cyan);
  box-shadow: 0 0 0 3px rgba(0, 175, 205, 0.08);
}
.range-pill select:focus {
  outline: none;
  border-color: var(--solvion-cyan);
  box-shadow: 0 0 0 3px rgba(0, 175, 205, 0.15);
}
.topbar-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 32px;
  background: var(--solvion-bg);
  border-top: 1px solid var(--border);
  font-size: 12px;
}
.toolbar-spacer { flex: 1; }

/* Tenant Pill — elegant capsule in toolbar */
.tenant-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(0, 175, 205, 0.08), rgba(0, 47, 108, 0.06));
  border: 1px solid rgba(0, 175, 205, 0.25);
  font-size: 12px;
  font-weight: 600;
  color: var(--solvion-dark);
  transition: all 0.2s ease;
}
.tenant-pill:hover {
  border-color: var(--solvion-cyan);
  box-shadow: 0 0 8px rgba(0, 175, 205, 0.15);
}
.tenant-pill select {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--solvion-dark);
  cursor: pointer;
  padding: 2px 20px 2px 0;
  outline: none;
  min-width: 80px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%23002F6C' d='M3 4.5l3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
}
.tenant-pill-switcher {
  background: linear-gradient(135deg, rgba(0, 47, 108, 0.06), rgba(0, 175, 205, 0.08));
}
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--white);
  color: var(--solvion-dark);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-icon:hover {
  border-color: var(--solvion-cyan);
  color: var(--solvion-cyan);
  background: rgba(0, 175, 205, 0.06);
}
.user-name-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: #4A5568;
  letter-spacing: 0.01em;
}
.logo { height: 36px; width: auto; }
.product-title {
  font-family: "Segoe UI Semibold", "Segoe UI", sans-serif;
  font-weight: 600;
  color: var(--solvion-dark);
  font-size: 18px;
  border-left: 2px solid var(--border);
  padding-left: 24px;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.selector:not([hidden]) { display: flex; flex-direction: column; gap: 2px; }
.selector label { font-size: 11px; color: var(--solvion-dark); text-transform: uppercase; letter-spacing: 0.5px; }
.selector select {
  font-family: inherit; font-size: 13px;
  padding: 6px 10px; border: 1px solid var(--border);
  border-radius: 4px; background: var(--white);
  color: var(--solvion-text); cursor: pointer;
}
.selector select:focus { outline: 2px solid var(--solvion-cyan); }
.user-chip:not([hidden]) {
  display: flex; align-items: center; gap: 10px;
  padding-left: 18px; border-left: 1px solid var(--border);
}
.data-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 14px;
}
.badge-live { background: rgba(61, 164, 151, 0.15); color: var(--solvion-teal); }
.badge-mock { background: rgba(241, 159, 39, 0.15); color: var(--solvion-orange); }
#refreshBtn { padding: 7px 14px; }
.last-refresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(0, 175, 205, 0.06);
  font-size: 12px;
}
.last-refresh-label {
  font-size: 11px;
  color: var(--solvion-text);
  opacity: 0.7;
}
#lastRefreshText {
  font-size: 12px;
  color: var(--solvion-dark);
  line-height: 1.2;
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--solvion-cyan), var(--solvion-dark));
  color: var(--white); font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-meta strong { font-size: 13px; color: var(--solvion-dark); }
.user-meta span { font-size: 11px; color: var(--solvion-text); }

/* ---------- Layout ---------- */
.container { padding: 24px 32px 48px; max-width: 1600px; margin: 0 auto; }
.container > section { margin-bottom: 24px; }

.status-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.4s ease;
}
.status-banner.ok {
  background: linear-gradient(90deg, rgba(61, 164, 151, 0.08), rgba(61, 164, 151, 0.02));
  color: var(--solvion-teal);
  border: 1px solid rgba(61, 164, 151, 0.2);
}
.status-banner.warning {
  background: linear-gradient(90deg, rgba(241, 159, 39, 0.08), rgba(241, 159, 39, 0.02));
  color: var(--solvion-orange);
  border: 1px solid rgba(241, 159, 39, 0.2);
}
.status-banner.critical {
  background: linear-gradient(90deg, rgba(235, 86, 120, 0.08), rgba(235, 86, 120, 0.02));
  color: var(--solvion-pink);
  border: 1px solid rgba(235, 86, 120, 0.2);
}
.status-banner-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse-dot 2s ease-in-out infinite;
}
.status-banner-info {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
}
.status-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  font-size: 10px;
  font-weight: 700;
  font-style: normal;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.status-info-icon:hover { opacity: 1; }
.status-info-tooltip {
  display: none;
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  transform: translateX(-50%);
  background: var(--solvion-dark);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  white-space: nowrap;
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.status-banner-info:hover .status-info-tooltip { display: block; }

.tenant-empty-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 26px;
  border-radius: 12px;
  margin-bottom: 20px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(0, 175, 205, 0.10), transparent 60%),
    linear-gradient(180deg, rgba(11, 87, 125, 0.06), rgba(11, 87, 125, 0.02));
  border: 1px solid rgba(0, 175, 205, 0.22);
  box-shadow: 0 1px 3px rgba(11, 87, 125, 0.06);
}
.tenant-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 12px;
  background: rgba(0, 175, 205, 0.14);
  color: var(--solvion-cyan);
}
.tenant-empty-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tenant-empty-body strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--solvion-dark);
  letter-spacing: -0.01em;
}
.tenant-empty-body span {
  font-size: 13px;
  line-height: 1.5;
  color: var(--solvion-text);
  max-width: 62ch;
}

@media (max-width: 520px) {
  .tenant-empty-banner { flex-direction: column; text-align: center; align-items: center; }
}

.alerts { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.alert {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; border-radius: 6px;
  background: var(--white); border-left: 4px solid var(--solvion-cyan);
  box-shadow: var(--shadow);
}
.alert-critical { border-left-color: var(--solvion-pink); }
.alert-warning  { border-left-color: var(--solvion-orange); }
.alert-info     { border-left-color: var(--solvion-cyan); }
.alert-icon {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; color: var(--white);
  flex-shrink: 0;
}
.alert-critical .alert-icon { background: var(--solvion-pink); }
.alert-warning  .alert-icon { background: var(--solvion-orange); }
.alert-info     .alert-icon { background: var(--solvion-cyan); }
.alert-body { flex: 1; }
.alert-title { font-weight: 600; color: var(--solvion-dark); margin-bottom: 2px; }
.alert-desc { font-size: 13px; color: var(--solvion-text); }
.alert-action {
  background: transparent; border: 1px solid var(--solvion-cyan);
  color: var(--solvion-cyan); padding: 7px 14px; border-radius: 4px;
  font-family: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.alert-action:hover { background: var(--solvion-cyan); color: var(--white); }
.alert-contact {
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0;
}
.alert-contact-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--solvion-cyan); color: var(--white);
  padding: 6px 13px; border-radius: 4px; font-size: 12px; font-weight: 600;
  text-decoration: none; transition: opacity 0.15s; white-space: nowrap;
}
.alert-contact-badge:hover { opacity: 0.82; }
.alert-contact-mail {
  font-size: 12px; color: var(--solvion-text);
  text-decoration: none; border-bottom: 1px dotted var(--solvion-text);
  transition: color 0.15s;
}
.alert-contact-mail:hover { color: var(--solvion-cyan); border-bottom-color: var(--solvion-cyan); }

/* ---------- Toggle Switch (Direct Routing / Operator Connect) ---------- */
.toggle-switch {
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; user-select: none;
  font-size: 12px; color: var(--solvion-dark);
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px;
}
.toggle-switch input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-slider {
  position: relative;
  width: 36px; height: 20px;
  background: #C7CCD1;
  border-radius: 20px;
  transition: background 0.15s;
  flex-shrink: 0;
}
.toggle-slider::before {
  content: '';
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: var(--white);
  border-radius: 50%;
  transition: transform 0.15s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--solvion-cyan); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(16px); }
.toggle-switch input:focus-visible + .toggle-slider { outline: 2px solid var(--solvion-cyan); outline-offset: 2px; }
.toggle-label { white-space: nowrap; }

/* SBC-Komponenten verbergen, wenn kein Direct Routing konfiguriert */
body.hide-sbc .sbc-section,
body.hide-sbc .kpi-card.kpi-sbc,
body.hide-sbc #section-sbc-live,
body.hide-sbc #agentStatus { display: none; }

/* ---------- KPI Cards ---------- */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
  background: linear-gradient(135deg, rgba(0, 175, 205, 0.03) 0%, rgba(11, 87, 125, 0.04) 100%);
  padding: 20px;
  border-radius: 10px;
}
.kpi-row.has-warnings {
  animation: kpi-pulse 3s ease-in-out infinite;
}
.kpi-row.all-green {
  position: relative;
  overflow: hidden;
}
.kpi-row.all-green::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--solvion-teal), var(--solvion-cyan), var(--solvion-teal));
  background-size: 200% 100%;
  animation: shimmer-bar 3s linear infinite;
  border-radius: 10px 10px 0 0;
}
@keyframes kpi-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(241, 159, 39, 0); }
  50% { box-shadow: 0 0 0 3px rgba(241, 159, 39, 0.15); }
}
@keyframes shimmer-bar {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.kpi-card {
  background: var(--white);
  border-radius: 6px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--solvion-cyan);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(11, 87, 125, 0.12);
}
.kpi-label { font-size: 12px; color: var(--solvion-dark); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.kpi-value {
  font-family: "Segoe UI Semibold", "Segoe UI", sans-serif;
  font-size: 28px; font-weight: 600;
  color: var(--solvion-dark);
  margin: 6px 0 4px;
}
/* Wenn die Verfügbarkeits-Kachel statt einer Zahl einen Status-Text zeigt
   (z. B. "Beeinträchtigung"), kleinere Schrift, damit nichts überläuft. */
.kpi-value > .is-status { font-size: 17px; line-height: 1.3; }
.kpi-unit { font-size: 14px; font-weight: 400; color: var(--solvion-text); }
.kpi-trend { font-size: 12px; font-weight: 600; }
.trend-up   { color: var(--solvion-teal); }
.trend-down { color: var(--solvion-pink); }
.trend-flat { color: var(--solvion-text); }
.kpi-sub { font-size: 11px; color: var(--solvion-text); margin-top: 4px; }
.kpi-sub.good { color: var(--solvion-teal); }
.kpi-sub.bad  { color: var(--solvion-pink); }

/* ---- KPI Info-Tooltip (z.B. MOS-Erklärung) ---- */
.kpi-info {
  display: inline-flex; align-items: center; justify-content: center;
  position: relative; vertical-align: middle;
  margin-left: 5px; cursor: default;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--solvion-cyan); color: #fff;
  font-size: 10px; font-weight: 700; font-style: normal;
  line-height: 1; user-select: none;
}
.kpi-info .kpi-tooltip {
  display: none;
  position: absolute; bottom: calc(100% + 9px); left: 50%;
  transform: translateX(-50%);
  background: var(--solvion-dark); color: #fff;
  font-size: 12px; font-weight: 400; line-height: 1.65;
  text-transform: none; letter-spacing: 0;
  padding: 10px 13px; border-radius: 6px;
  width: 230px; white-space: normal;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
  z-index: 200; pointer-events: none;
}
.kpi-info .kpi-tooltip::after {
  content: ''; position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--solvion-dark);
}
.kpi-info:hover .kpi-tooltip { display: block; }
.kpi-bar {
  margin-top: 8px; height: 5px; background: var(--solvion-bg); border-radius: 3px; overflow: hidden;
}
.kpi-bar > span {
  display: block; height: 100%; background: var(--solvion-cyan); border-radius: 3px;
}

/* ---------- Cards ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.card {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 6px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.4);
}
.card-header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.card-header-volume { align-items: center; }
.card-header h3 {
  margin: 0;
  font-family: "Segoe UI Semibold", "Segoe UI", sans-serif;
  font-size: 14px; font-weight: 600; color: var(--solvion-dark);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.live-pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--solvion-teal);
  border-radius: 50%;
  margin-left: 8px;
  animation: pulse-dot 2s ease-in-out infinite;
  vertical-align: middle;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(61, 164, 151, 0.7); }
  50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(61, 164, 151, 0); }
}
.card-meta { font-size: 11px; color: var(--solvion-text); }
.card-header-aside {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.card-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(11, 87, 125, 0.08);
  color: var(--solvion-dark);
  font-size: 11px;
  font-weight: 600;
}
.card-badge-acd {
  background: rgba(0, 175, 205, 0.12);
  color: var(--solvion-cyan);
}

/* ---------- Donut ---------- */
.donut-wrap {
  display: grid; grid-template-columns: 180px 1fr; gap: 24px; align-items: center;
}
.donut-wrap canvas { max-height: 180px; }
.donut-legend { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.donut-legend > div { display: flex; align-items: center; gap: 8px; }
.donut-legend strong { margin-left: auto; color: var(--solvion-dark); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* ---------- Compact Health ---------- */
.health-compact {
  display: flex; flex-direction: column; gap: 8px; padding: 4px 0;
}
.health-compact-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 10px;
  background: #F7F9FB; border: 1px solid #E8ECF0;
  transition: all 0.2s ease;
}
.health-compact-item:hover { transform: translateX(3px); box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.health-compact-icon {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.health-compact-good .health-compact-icon { background: #E6F9ED; color: #16A34A; }
.health-compact-warn .health-compact-icon { background: #FEF5E0; color: #D4A017; }
.health-compact-bad  .health-compact-icon { background: #FEE8E8; color: #DC2626; }
.health-compact-detail { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.health-compact-detail strong { font-size: 13px; color: var(--solvion-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.health-compact-label { font-size: 11px; color: #8896A4; }

/* ---------- Tables ---------- */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  background: var(--solvion-cyan); color: var(--white);
  font-family: "Segoe UI Semibold", "Segoe UI", sans-serif; font-weight: 600;
  text-align: left; padding: 9px 12px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
}
.data-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--border);
}
.data-table tbody tr:nth-child(even) { background: var(--solvion-bg); }
.data-table.compact td { padding: 7px 10px; }

.pill {
  display: inline-block; padding: 2px 9px; border-radius: 10px;
  font-size: 11px; font-weight: 600;
}
.pill-bad  { background: rgba(235, 86, 120, 0.15); color: var(--solvion-pink); }
.pill-warn { background: rgba(241, 159, 39, 0.15); color: var(--solvion-orange); }
.pill-good { background: rgba(61, 164, 151, 0.15); color: var(--solvion-teal); }

/* ---------- Top-Fehlerursachen ---------- */
#section-health { margin-bottom: 24px; }

.fail-list { display: flex; flex-direction: column; gap: 13px; margin-top: 2px; }
.fail-row { animation: cardFadeIn .35s ease both; }
.fail-row-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.fail-label { font-weight: 600; color: var(--solvion-dark); font-size: 13.5px; }
.fail-code {
  font-size: 10.5px; font-weight: 700; letter-spacing: .3px;
  color: var(--solvion-text); opacity: .55;
  border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px;
}
.fail-stat {
  margin-left: auto; font-size: 12px; color: var(--solvion-text);
  opacity: .8; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.fail-bar {
  height: 9px; background: var(--solvion-bg); border-radius: 6px; overflow: hidden;
}
.fail-bar-fill {
  display: block; height: 100%; border-radius: 6px;
  transform-origin: left center;
  animation: failGrow .7s cubic-bezier(.22,.61,.36,1) both;
  box-shadow: 0 1px 4px rgba(0,0,0,0.10);
}
@keyframes failGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.fail-bar-fill.cat-network { background: linear-gradient(90deg, var(--solvion-pink), #f4839c); }
.fail-bar-fill.cat-routing { background: linear-gradient(90deg, var(--solvion-orange), #f6bb63); }
.fail-bar-fill.cat-user    { background: linear-gradient(90deg, #94a0aa, #b7c0c7); }
.fail-bar-fill.cat-other   { background: linear-gradient(90deg, #7e8a94, #9aa6b0); }
.fail-row:hover .fail-bar-fill { filter: brightness(1.06) saturate(1.05); }
.fail-others { font-size: 11px; color: var(--solvion-text); opacity: .55; margin-top: 2px; text-align: right; }
.fail-allgood { text-align: center; color: var(--solvion-teal); font-weight: 600; padding: 28px 0; font-size: 14px; }
.fail-legend {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border);
  font-size: 11px; color: var(--solvion-text); opacity: .8;
}
.fail-legend span { display: inline-flex; align-items: center; gap: 5px; }
.fail-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.fail-dot.cat-network { background: var(--solvion-pink); }
.fail-dot.cat-routing { background: var(--solvion-orange); }
.fail-dot.cat-user    { background: #94a0aa; }

.status { font-size: 12px; font-weight: 600; }
.status-good { color: var(--solvion-teal); }
.status-warn { color: #D4A017; }
.status-bad  { color: var(--solvion-pink); }

.health-inc-section { border-top: 1px solid var(--solvion-border); margin-top: 8px; }
.health-inc-section > summary { list-style: none; }
.health-inc-section > summary::-webkit-details-marker { display: none; }
.health-inc-header {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--solvion-text);
  padding: 10px 0 8px; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 6px;
}
.health-inc-header::after {
  content: '\203A'; font-size: 16px; margin-left: auto;
  transition: transform 0.2s; display: inline-block;
  transform: rotate(90deg);
}
.health-inc-section:not([open]) > .health-inc-header::after { transform: rotate(0deg); }

.incident-item {
  border-radius: 8px; margin-bottom: 6px;
  background: rgba(235, 86, 120, 0.06); border-left: 3px solid var(--solvion-pink);
}
.incident-item > summary { list-style: none; }
.incident-item > summary::-webkit-details-marker { display: none; }
.incident-item .incident-title {
  font-size: 13px; font-weight: 600; color: var(--solvion-dark);
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 8px 12px; cursor: pointer; user-select: none;
}
.incident-item .incident-title::before {
  content: '\203A'; font-size: 14px; color: var(--solvion-text);
  transition: transform 0.2s; flex-shrink: 0; order: -1;
  transform: rotate(0deg);
}
.incident-item[open] .incident-title::before { transform: rotate(90deg); }
.incident-item .incident-age {
  font-size: 11px; font-weight: 400; color: var(--solvion-text); margin-left: auto;
}
.incident-body { padding: 0 12px 10px; }
.incident-item .incident-impact {
  font-size: 12px; color: var(--solvion-text); margin-bottom: 4px;
}
.incident-item .incident-update {
  font-size: 12px; color: var(--solvion-dark); background: var(--solvion-bg);
  border-radius: 4px; padding: 6px 8px; margin-bottom: 4px;
  white-space: pre-wrap; word-break: break-word;
}
.incident-item .incident-meta {
  font-size: 11px; color: var(--solvion-text); opacity: 0.7;
}

/* ---------- Bottom row ---------- */
.metric-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 12px; margin-bottom: 14px;
}
.metric-row > div { display: flex; flex-direction: column; align-items: flex-start; }
.metric-num {
  font-family: "Segoe UI Semibold", "Segoe UI", sans-serif;
  font-size: 22px; font-weight: 600; color: var(--solvion-dark);
}
.metric-num.cyan { color: var(--solvion-cyan); }
.metric-lbl { font-size: 11px; color: var(--solvion-text); text-transform: uppercase; letter-spacing: 0.4px; }

.queue-list { display: flex; flex-direction: column; gap: 0; margin-top: 8px; }
.queue-header {
  display: grid; grid-template-columns: 1fr 56px 90px;
  align-items: center; gap: 8px; font-size: 11px;
  color: var(--solvion-text); text-transform: uppercase; letter-spacing: 0.4px;
  padding: 0 4px 6px; border-bottom: 1px solid var(--border);
}
.queue-header span:not(:first-child) { text-align: right; }
.queue-item {
  display: grid; grid-template-columns: 1fr 56px 90px;
  align-items: center; gap: 8px; font-size: 13px;
  padding: 7px 4px; border-bottom: 1px solid var(--border);
}
.queue-item:last-child { border-bottom: none; }
.queue-item .q-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-item .q-num { text-align: right; color: var(--solvion-dark); }
.queue-item .q-pct-simple { text-align: right; font-weight: 600; }

.license-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.lic-row {
  display: grid; grid-template-columns: 1fr 100px 70px;
  align-items: center; gap: 10px;
}
.lic-label { font-size: 13px; color: var(--solvion-text); }
.lic-bar { height: 8px; background: var(--solvion-bg); border-radius: 4px; overflow: hidden; }
.lic-bar > span { display: block; height: 100%; background: var(--solvion-cyan); border-radius: 4px; }
.lic-num { font-size: 12px; color: var(--solvion-dark); font-weight: 600; text-align: right; }
.lic-savings {
  margin-top: 8px; padding: 8px 12px;
  background: rgba(61, 164, 151, 0.08);
  border-left: 3px solid var(--solvion-teal);
  border-radius: 3px; font-size: 12px;
}
.lic-savings strong { color: var(--solvion-teal); }

/* ---------- SBC Section ---------- */
.sbc-section { margin-bottom: 24px; }
.agent-status-bar {
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 4px;
  margin-bottom: 12px;
  display: none;
}
.agent-status-bar.online {
  display: block;
  background: #e6f9f0;
  color: #1a7d4e;
  border: 1px solid #b2ecd3;
}
.agent-status-bar.offline {
  display: block;
  background: #fdecea;
  color: #b33030;
  border: 1px solid #f5c6c2;
}
.sbc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.sbc-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: #888;
  padding: 24px;
  font-size: 13px;
}
.sbc-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 4px solid var(--solvion-cyan);
  border-radius: 6px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sbc-card.sbc-online    { border-left-color: var(--solvion-teal); }
.sbc-card.sbc-degraded  { border-left-color: var(--solvion-orange); }
.sbc-card.sbc-offline   { border-left-color: var(--solvion-pink); }
.sbc-card.sbc-unknown   { border-left-color: #B0B5BB; }
.sbc-card-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 10px;
}
.sbc-name {
  font-family: "Segoe UI Semibold", "Segoe UI", sans-serif;
  font-weight: 600;
  color: var(--solvion-dark);
  font-size: 14px;
  line-height: 1.25;
}
.sbc-loc {
  font-size: 11px;
  color: var(--solvion-text);
  margin-top: 2px;
}
.sbc-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 11px;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.4px;
  white-space: nowrap;
}
.sbc-pill::before { content: '●'; font-size: 10px; }
.sbc-pill.online   { background: rgba(61, 164, 151, 0.15); color: var(--solvion-teal); }
.sbc-pill.degraded { background: rgba(212, 160, 23, 0.15); color: #D4A017; }
.sbc-pill.offline  { background: rgba(235, 86, 120, 0.15); color: var(--solvion-pink); }
.sbc-pill.unknown  { background: rgba(176, 181, 187, 0.20); color: #6B7178; }
.sbc-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.sbc-metric { display: flex; flex-direction: column; gap: 1px; }
.sbc-metric-lbl {
  font-size: 10px; color: var(--solvion-text);
  text-transform: uppercase; letter-spacing: 0.4px;
}
.sbc-metric-val {
  font-family: "Segoe UI Semibold", "Segoe UI", sans-serif;
  font-size: 16px; font-weight: 600; color: var(--solvion-dark);
}
.sbc-metric-val.warn { color: var(--solvion-orange); }
.sbc-metric-val.bad  { color: var(--solvion-pink); }
.sbc-meta-row {
  display: flex; justify-content: space-between;
  font-size: 11px; color: #888;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
}
.sbc-mode {
  display: inline-block;
  padding: 1px 6px;
  font-size: 10px;
  border-radius: 3px;
  background: var(--solvion-bg);
  color: var(--solvion-dark);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.sbc-error {
  font-size: 11px;
  color: var(--solvion-pink);
  background: rgba(235, 86, 120, 0.08);
  border-radius: 3px;
  padding: 6px 8px;
  margin-top: 4px;
}
.sbc-cert {
  font-size: 11px;
  border-radius: 3px;
  padding: 6px 8px;
  margin-top: 4px;
  font-weight: 500;
}
.sbc-cert-warn {
  color: #e6a700;
  background: rgba(230, 167, 0, 0.08);
}
.sbc-cert-critical {
  color: var(--solvion-pink);
  background: rgba(235, 86, 120, 0.12);
  font-weight: 600;
}
.sbc-alarm-details {
  margin-top: 6px;
}
.sbc-alarm-summary {
  font-size: 11px;
  font-weight: 600;
  color: #7A4510;
  cursor: pointer;
  padding: 4px 0;
  list-style: none;
  user-select: none;
}
.sbc-alarm-summary::-webkit-details-marker { display: none; }
.sbc-alarm-summary::before {
  content: '▸ ';
}
.sbc-alarm-details[open] > .sbc-alarm-summary::before {
  content: '▾ ';
}
.sbc-alarm-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 4px;
}
.sbc-alarm-item {
  font-size: 11px;
  color: #7A4510;
  background: rgba(241, 159, 39, 0.08);
  border-radius: 3px;
  padding: 4px 8px;
  font-weight: 500;
}

/* ---------- Chart Range Buttons ---------- */
.chart-range-btns {
  display: flex;
  gap: 4px;
  margin-left: auto;
  margin-right: 12px;
}
.range-btn {
  padding: 3px 10px;
  font-size: 11px;
  border: 1px solid #dde2e8;
  border-radius: 4px;
  background: #fff;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.range-btn:hover { border-color: var(--solvion-cyan); color: var(--solvion-cyan); }
.range-btn.active {
  background: var(--solvion-cyan);
  color: #fff;
  border-color: var(--solvion-cyan);
}

/* ---------- Live Active Calls ---------- */
.sbc-live-section { border-left: 4px solid var(--solvion-cyan); }
.card.sbc-live-section { border-left: 4px solid var(--solvion-cyan); }
.live-calls-panel {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: start;
}
.live-calls-total {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 24px;
  background: linear-gradient(135deg, rgba(0,175,205,0.08), rgba(11,87,125,0.06));
  border-radius: 10px;
  min-width: 120px;
}
.live-calls-number {
  font-family: "Segoe UI Semibold", "Segoe UI", sans-serif;
  font-size: 48px;
  font-weight: 700;
  color: var(--solvion-dark);
  line-height: 1;
}
.live-calls-label {
  font-size: 11px;
  color: var(--solvion-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}
.live-calls-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
}
.live-sbc-row {
  display: grid;
  grid-template-columns: 140px 1fr 50px;
  align-items: center;
  gap: 10px;
}
.live-sbc-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--solvion-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.live-sbc-bar-wrap {
  height: 18px;
  background: var(--solvion-bg);
  border-radius: 9px;
  overflow: hidden;
  position: relative;
}
.live-sbc-bar {
  height: 100%;
  border-radius: 9px;
  background: var(--solvion-cyan);
  transition: width 0.6s ease;
  min-width: 2px;
}
.live-sbc-bar.high-load {
  background: var(--solvion-orange);
}
.live-sbc-bar.critical {
  background: var(--solvion-pink);
}
.live-sbc-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--solvion-dark);
  text-align: right;
}
@media (max-width: 600px) {
  .live-calls-panel { grid-template-columns: 1fr; }
  .live-sbc-row { grid-template-columns: 100px 1fr 40px; }
}
.live-calls-chart-wrap {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  max-height: 140px;
}

/* ---------- Footer ---------- */
.footer {
  margin-top: 32px; padding-top: 16px;
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--solvion-text);
  border-top: 1px solid var(--border);
}

/* ---------- Login / Onboard Screens ---------- */
/* :not([hidden]) stellt sicher, dass display:flex das HTML hidden-Attribut nicht überschreibt */
.login-screen:not([hidden]) {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: var(--solvion-bg);
}
.login-card {
  background: var(--white);
  border-radius: 8px;
  padding: 48px 44px;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 8px 28px rgba(11, 87, 125, 0.10);
  border-top: 4px solid var(--solvion-cyan);
  text-align: center;
}
.login-logo { height: 48px; margin-bottom: 24px; }
.login-card h1 {
  font-family: "Segoe UI Semibold", "Segoe UI", sans-serif;
  font-size: 22px; font-weight: 600; color: var(--solvion-dark);
  margin: 0 0 12px;
}
.login-card p {
  font-size: 14px; color: var(--solvion-text);
  margin: 0 0 24px; line-height: 1.55;
}
.login-card .login-note {
  font-size: 12px; color: #888;
  margin-top: 18px; margin-bottom: 0;
}
.btn-primary {
  display: inline-block;
  background: var(--solvion-cyan);
  color: var(--white);
  padding: 12px 24px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--solvion-dark); }

/* ---------- Tenant Info ---------- */
.tenant-display {
  display: flex; flex-direction: column; line-height: 1.2;
}
.tenant-display strong { font-size: 13px; color: var(--solvion-dark); }
.tenant-status {
  font-size: 11px; font-weight: 600; margin-top: 2px;
}
.user-logout {
  margin-left: 8px;
  color: var(--solvion-text);
  text-decoration: none;
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s;
}
.user-logout:hover { color: var(--solvion-pink); background: var(--solvion-bg); }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .grid-3  { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .kpi-row, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .topbar-main { flex-direction: column; gap: 12px; padding: 10px 16px; }
  .topbar-toolbar { flex-wrap: wrap; padding: 6px 16px; }
  .topbar-right { justify-content: flex-start; gap: 8px; }
  .alert-action {
    padding: 6px 10px;
    font-size: 12px;
  }
  .selector select {
    font-size: 12px;
    padding: 4px 8px;
  }
  .toggle-switch { font-size: 10px; }
  .kpi-value { font-size: 22px; }
  .sbc-metrics {
    grid-template-columns: 1fr 1fr;
    font-size: 12px;
  }
  .donut-wrap {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .donut-wrap canvas {
    max-height: 140px;
    margin: 0 auto;
  }
  .last-refresh { min-width: 0; width: 100%; }
  .container { padding: 16px; }
}

/* ---------- Trend Arrows ---------- */
.trend-up { color: var(--solvion-teal); }
.trend-down { color: var(--solvion-pink); }
.trend-flat { color: var(--solvion-text); opacity: 0.6; }

/* ---------- Anomaly Alert ---------- */
.alert-anomaly { border-left: 4px solid var(--solvion-cyan); background: rgba(0, 175, 205, 0.06); }
.alert-anomaly .alert-icon { background: rgba(0, 175, 205, 0.15); color: var(--solvion-cyan); }

/* ---------- License Recommendations ---------- */
.recs-header { font-size: 13px; font-weight: 600; color: var(--solvion-dark); margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.rec-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.rec-item:last-child { border-bottom: none; }
.rec-icon { font-size: 16px; flex-shrink: 0; margin-top: 2px; }
.rec-body { flex: 1; }
.rec-title { font-size: 12px; font-weight: 600; color: var(--solvion-dark); }
.rec-detail { font-size: 11px; color: var(--solvion-text); margin-top: 2px; }
.rec-reduce .rec-title { color: var(--solvion-teal); }
.rec-expand .rec-title { color: var(--solvion-orange); }

/* ---------- Settings Panel ---------- */
.settings-panel {
  position: fixed; top: 70px; right: 24px; width: 280px;
  background: var(--white); border-radius: 8px; box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  z-index: 200; overflow: hidden;
}
.settings-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.settings-close { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--solvion-text); }
.settings-body { padding: 12px 16px; max-height: 400px; overflow-y: auto; }
.settings-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 13px; cursor: pointer; }
.settings-item input { accent-color: var(--solvion-cyan); }

/* ---------- Benachrichtigungs-Einstellungen (im Settings-Panel) ---------- */
.settings-sep { height: 1px; background: var(--border); margin: 12px 0; }
.settings-subhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 13px; color: var(--solvion-dark); }
.notify-perm { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: rgba(11,87,125,0.10); }
.notify-perm.good { color: var(--solvion-teal); background: rgba(61,164,151,0.14); }
.notify-perm.warn { color: var(--solvion-orange); background: rgba(241,159,39,0.14); }
.notify-perm.bad  { color: var(--solvion-pink); background: rgba(235,86,120,0.14); }
.notify-btn { width: 100%; margin: 4px 0 8px; }
.notify-blocked-hint { font-size: 11px; color: var(--solvion-pink); background: rgba(235,86,120,0.08); border-radius: 4px; padding: 8px 10px; margin: 6px 0; line-height: 1.4; }
.notify-signals { display: flex; flex-direction: column; gap: 2px; margin: 4px 0; }
.notify-row { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 5px 0; cursor: pointer; }
.notify-row input[type="checkbox"] { accent-color: var(--solvion-cyan); flex: 0 0 auto; }
.notify-row-label { flex: 1 1 auto; }
.notify-crit { font-style: normal; font-size: 10px; font-weight: 700; color: var(--solvion-pink); background: rgba(235,86,120,0.12); padding: 1px 5px; border-radius: 8px; margin-left: 4px; }
.notify-th-wrap { flex: 0 0 auto; color: #888; font-size: 11px; white-space: nowrap; }
.notify-th { width: 46px; font-family: inherit; font-size: 12px; padding: 3px 5px; border: 1px solid var(--border); border-radius: 4px; text-align: right; }
.notify-cooldown { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--solvion-text); margin-top: 8px; }
.notify-cooldown select { font-family: inherit; font-size: 12px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 4px; background: var(--white); }

/* ---------- Toasts (In-Page-Benachrichtigungen) ---------- */
.toast-host { position: fixed; right: 18px; bottom: 18px; z-index: 2500; display: flex; flex-direction: column; gap: 10px; max-width: min(380px, 92vw); }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: var(--white); color: var(--solvion-text);
  border: 1px solid var(--border); border-left: 4px solid var(--solvion-orange);
  border-radius: 10px; box-shadow: 0 10px 30px rgba(11,87,125,0.18);
  font-size: 13px; font-weight: 600; animation: toastIn .28s ease both;
}
.toast-bad { border-left-color: var(--solvion-pink); }
.toast-warn { border-left-color: var(--solvion-orange); }
.toast-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--solvion-orange); flex: 0 0 auto; }
.toast-bad .toast-dot { background: var(--solvion-pink); }
.toast-msg { flex: 1 1 auto; }
.toast-x { background: none; border: none; cursor: pointer; color: #9aa7b0; font-size: 14px; line-height: 1; padding: 0 2px; }
.toast-x:hover { color: var(--solvion-pink); }
.toast-out { animation: toastOut .3s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(12px); } }
html[data-theme="dark"] .toast { background: #1B2127; border-color: #2A323A; }
html[data-theme="dark"] .notify-th,
html[data-theme="dark"] .notify-cooldown select { background: #12171B; border-color: #2A323A; color: #D7DCE0; }

/* ---------- Onboarding Wizard ---------- */
.wizard-card {
  max-width: 520px; margin: 0 auto; text-align: center;
  background: var(--white); border-radius: 12px; padding: 48px 40px;
  box-shadow: var(--shadow);
}
.wizard-intro { color: var(--solvion-text); margin-bottom: 32px; }
.wizard-steps {
  display: flex; align-items: center; justify-content: center; gap: 0; margin-bottom: 32px;
}
.wizard-step {
  display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--solvion-text); opacity: 0.5;
}
.wizard-step.active { opacity: 1; color: var(--solvion-cyan); font-weight: 600; }
.wizard-step.done { opacity: 1; color: var(--solvion-teal); }
.wizard-step-icon {
  width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--border); font-weight: 600; font-size: 12px;
}
.wizard-step.active .wizard-step-icon { background: var(--solvion-cyan); color: white; }
.wizard-step.done .wizard-step-icon { background: var(--solvion-teal); color: white; }
.wizard-connector { width: 32px; height: 2px; background: var(--border); margin: 0 8px; }
.wizard-body { text-align: left; }
.wizard-body h2 { font-size: 18px; color: var(--solvion-dark); margin-bottom: 12px; }
.wizard-waiting { text-align: center; padding: 24px 0; }
.wizard-spinner {
  width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--solvion-cyan);
  border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ====================================================================== */
/* Dark Mode — überschreibt die Farb-Variablen. Da fast alle Flächen      */
/* var(--white)/var(--border)/var(--solvion-*) nutzen, greift das global. */
/* Akzentfarben (cyan/teal/orange/pink) bleiben, nur Flächen & Text drehen.*/
html[data-theme="dark"] {
  --solvion-text: #D7DCE0;
  --solvion-dark: #5BC2DC;   /* Überschriften/Labels in Dunkel heller */
  --solvion-bg:   #12171B;
  --white:        #1B2127;   /* Karten-/Topbar-Oberfläche */
  --border:       #2A323A;
  --shadow: 0 1px 3px rgba(0,0,0,0.45), 0 4px 14px rgba(0,0,0,0.35);
  color-scheme: dark;        /* native Scrollbars/Inputs dunkel */
}
/* Hart kodierte Hellwerte gezielt nachziehen */
html[data-theme="dark"] .sbc-empty,
html[data-theme="dark"] .card-meta,
html[data-theme="dark"] .selector label { color: #8A96A0; }
html[data-theme="dark"] .kpi-tooltip { background: #0C1014; border: 1px solid var(--border); }
html[data-theme="dark"] .data-badge.badge-mock { background: rgba(241,159,39,0.18); }
html[data-theme="dark"] .login-screen { background: var(--solvion-bg); }
html[data-theme="dark"] .card {
  background: rgba(30, 40, 55, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .kpi-value { text-shadow: 0 0 20px rgba(0, 175, 205, 0.3); }
html[data-theme="dark"] .kpi-card { border-top-color: rgba(0, 175, 205, 0.6); }
html[data-theme="dark"] .sbc-pill.online { box-shadow: 0 0 8px rgba(61, 164, 151, 0.4); }
html[data-theme="dark"] .live-calls-number { text-shadow: 0 0 30px rgba(0, 175, 205, 0.4); }
html[data-theme="dark"] .live-sbc-bar { box-shadow: 0 0 6px rgba(0, 175, 205, 0.3); }
html[data-theme="dark"] .btn-icon { background: #1B2127; border-color: #2A323A; color: #D7DCE0; }
html[data-theme="dark"] .btn-icon:hover { border-color: var(--solvion-cyan); color: var(--solvion-cyan); background: rgba(0, 175, 205, 0.12); }
html[data-theme="dark"] .user-name-label { color: #D7DCE0; }
html[data-theme="dark"] .topbar-toolbar { background: #12171B; border-top-color: #2A323A; }
html[data-theme="dark"] .tenant-pill { background: linear-gradient(135deg, rgba(0, 175, 205, 0.12), rgba(0, 47, 108, 0.15)); border-color: rgba(0, 175, 205, 0.3); }
html[data-theme="dark"] .tenant-pill select { color: #D7DCE0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%235BC2DC' d='M3 4.5l3 3 3-3'/%3E%3C/svg%3E"); }
html[data-theme="dark"] .range-pill select { background-color: #1B2127; color: #D7DCE0; border-color: #2A323A; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235BC2DC' d='M3 4.5l3 3 3-3'/%3E%3C/svg%3E"); }
html[data-theme="dark"] .range-pill select:hover { border-color: var(--solvion-cyan); }
html[data-theme="dark"] .topbar-divider { background: #2A323A; }
html[data-theme="dark"] .health-compact-item { background: #1B2127; border-color: #2A323A; }
html[data-theme="dark"] .health-compact-detail strong { color: #D7DCE0; }
html[data-theme="dark"] .health-compact-label { color: #6B7A8A; }
/* Etwas mehr Kontrast für Tabellen-Zebra/Hover in Dunkel */
html[data-theme="dark"] .data-table tbody tr:hover { background: rgba(255,255,255,0.04); }

/* ====================================================================== */
/* UX-Politur                                                             */
/* ====================================================================== */

/* Karten beim Erscheinen sanft einblenden */
@media (prefers-reduced-motion: no-preference) {
  .card, .kpi-card {
    animation: cardFadeIn 0.35s ease both;
  }
}
@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.container > section {
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
}
.container > section:nth-of-type(1) { animation-delay: 0.05s; }
.container > section:nth-of-type(2) { animation-delay: 0.1s; }
.container > section:nth-of-type(3) { animation-delay: 0.15s; }
.container > section:nth-of-type(4) { animation-delay: 0.2s; }
.container > section:nth-of-type(5) { animation-delay: 0.25s; }
.container > section:nth-of-type(6) { animation-delay: 0.3s; }
.container > section:nth-of-type(7) { animation-delay: 0.35s; }
.container > section:nth-of-type(8) { animation-delay: 0.4s; }
.container > section:nth-of-type(9) { animation-delay: 0.45s; }
.container > section:nth-of-type(10) { animation-delay: 0.5s; }
.container.loaded > section {
  opacity: 1;
  animation: none;
}

/* Live-Calls-Zähler: kurzer Puls, wenn sich der Wert ändert */
.live-calls-number.pulse {
  animation: livePulse 0.6s ease;
}
@keyframes livePulse {
  0%   { transform: scale(1);    color: var(--solvion-cyan); }
  40%  { transform: scale(1.12); color: var(--solvion-teal); }
  100% { transform: scale(1); }
}

/* Skeleton-Shimmer für Lade-Platzhalter (Klasse .skeleton an ein Element) */
.skeleton {
  background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
  color: transparent !important;
  user-select: none;
}
.skeleton * { visibility: hidden; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Smooth-Transition beim Theme-Wechsel (nur Farben, nicht Layout) */
@media (prefers-reduced-motion: no-preference) {
  body, .card, .kpi-card, .topbar, .data-table, .sbc-card, select {
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
  }
}

/* ====================================================================== */
/* Health-Score Hero + Auto-Insights (Bento)                              */
/* ====================================================================== */
.hero-grid { display: grid; grid-template-columns: 300px 1fr; gap: 18px; margin-bottom: 24px; }
@media (max-width: 880px) { .hero-grid { grid-template-columns: 1fr; } }

.hero-score-card {
  display: flex; flex-direction: column; align-items: center;
  background: linear-gradient(160deg, var(--white) 0%, rgba(0,175,205,0.05) 100%);
}
.hero-score-card .card-header { align-self: stretch; }

.gauge { position: relative; width: 190px; height: 190px; margin: 10px 0 4px; }
.gauge svg { transform: rotate(-90deg); }
.gauge-track { fill: none; stroke: var(--solvion-bg); stroke-width: 15; }
.gauge-prog {
  fill: none; stroke: url(#heroGaugeGrad); stroke-width: 15; stroke-linecap: round;
  stroke-dasharray: 534; stroke-dashoffset: 534;
  transition: stroke-dashoffset 1.1s cubic-bezier(.22,.61,.36,1), stroke .4s ease;
}
.gauge-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gauge-score { font-size: 48px; font-weight: 700; color: var(--solvion-dark); line-height: 1; font-variant-numeric: tabular-nums; }
.gauge-score small { font-size: 16px; color: #8A96A0; font-weight: 600; }
.gauge-label { margin-top: 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #8A96A0; }
.gauge-label.good { color: var(--solvion-teal); }
.gauge-label.warn { color: var(--solvion-orange); }
.gauge-label.bad  { color: var(--solvion-pink); }

.hero-signals { display: flex; gap: 16px; margin-top: 14px; flex-wrap: wrap; justify-content: center; }
.hero-signals .sig { display: flex; flex-direction: column; align-items: center; font-size: 11px; color: var(--solvion-text); opacity: .8; }
.hero-signals .sig b { font-size: 15px; color: var(--solvion-dark); font-variant-numeric: tabular-nums; }
.hero-signals .sig-dot { width: 7px; height: 7px; border-radius: 50%; margin-bottom: 4px; display: inline-block; background: #8A96A0; }
.sig-dot.good { background: var(--solvion-teal); }
.sig-dot.warn { background: var(--solvion-orange); }
.sig-dot.bad  { background: var(--solvion-pink); }

.hero-insights-card .ins-title { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.hero-insights-card .ins-title h3 { margin: 0; font-size: 14px; font-weight: 600; color: var(--solvion-dark); }
.hero-insights-card .ins-spark { font-size: 16px; }
.hero-insights-card .ins-list { display: flex; flex-direction: column; gap: 9px; }
.hero-insights-card .ins {
  display: flex; gap: 11px; align-items: flex-start; font-size: 13.5px; line-height: 1.45;
  padding: 9px 12px; border-radius: 10px;
  background: linear-gradient(90deg, rgba(0,175,205,0.05), transparent);
  animation: cardFadeIn .4s ease both;
}
.hero-insights-card .ins b { color: var(--solvion-dark); }
.hero-insights-card .ins-ic {
  flex: 0 0 22px; height: 22px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
}
.hero-insights-card .ins-ic.up   { background: var(--solvion-teal); }
.hero-insights-card .ins-ic.down { background: var(--solvion-pink); }
.hero-insights-card .ins-ic.warn { background: var(--solvion-orange); }
.hero-insights-card .ins-ic.info { background: var(--solvion-cyan); }
.hero-insights-card .ins-ic.lock { background: var(--solvion-dark); }
.ins-chip { font-size: 11px; font-weight: 600; color: #8A96A0; margin-left: 6px; }

/* ====================================================================== */
/* Volles Bento-Layout (ab Desktop) — ein 12-Spalten-Raster mit            */
/* asymmetrischen Karten. CSS-only, reversibel; Personalisierung intakt.   */
/* ====================================================================== */
@media (min-width: 1024px) {
  #mainView:not([hidden]) {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 18px;
    align-content: start;
  }
  #mainView > section,
  #mainView > .status-banner,
  #mainView > .footer { margin-bottom: 0; }

  /* Voll-Breite Bänder */
  #statusBanner,
  #tenantEmptyBanner,
  #section-hero,
  #section-kpis,
  #mainView > .alerts,
  #section-health,
  #mainView > .footer { grid-column: 1 / -1; }

  /* Gruppensektionen auflösen → ihre Karten werden Items des Master-Rasters */
  #section-charts,
  #section-sip-health,
  #section-sbc-live,
  #section-bottom { display: contents; }

  /* Ausblenden (Dashboard-Anpassung) trotz display:contents weiter möglich */
  #mainView > section[hidden] { display: none !important; }

  /* Einheitliche Spalten-Spans — gleich breite Karten, gleich hohe Reihen */
  #section-charts     > .card { grid-column: span 6; }  /* 2 × 1/2 */
  #section-sip-health > .card { grid-column: span 6; }  /* 2 × 1/2 */
  #section-sbc-live   > .card { grid-column: span 6; }  /* 2 × 1/2 */
  #section-bottom     > .card { grid-column: span 4; }  /* 3 × 1/3 */

  /* Karten einer Reihe auf gleiche Höhe strecken (kein Masonry) */
  #mainView:not([hidden]) > .card,
  #section-charts > .card,
  #section-sip-health > .card,
  #section-sbc-live > .card,
  #section-bottom > .card { align-self: stretch; }
}

/* ====================================================================== */
/* Kompakte Alerts (dünner Streifen) — Insights decken Details bereits ab  */
/* ====================================================================== */
.alerts { gap: 8px; margin-bottom: 0; }
.alert {
  padding: 8px 14px; gap: 10px; box-shadow: none;
  border: 1px solid var(--border); border-left-width: 3px; border-left-style: solid;
}
.alert-critical { border-left-color: var(--solvion-pink); }
.alert-warning  { border-left-color: var(--solvion-orange); }
.alert-info     { border-left-color: var(--solvion-cyan); }
.alert-anomaly  { border-left-color: var(--solvion-cyan); }
.alert-icon { width: 20px; height: 20px; font-size: 11px; }
.alert-body { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.alert-title { margin-bottom: 0; font-size: 13px; }
.alert-desc { font-size: 12px; opacity: .8; }
.alert-contact { flex-direction: row; align-items: center; gap: 10px; }
.alert-contact-badge { padding: 3px 10px; font-size: 11px; }
.alert-contact-mail { display: none; }

/* ---------- KPI-Sparklines (echte Tagesreihen aus den Anrufdaten) -------- */
.kpi-spark { width: 100%; height: 30px; margin-top: 10px; display: block; animation: cardFadeIn .4s ease both; }
.kpi-spark .spark-area { fill: rgba(0,175,205,0.14); stroke: none; }
.kpi-spark .spark-line { fill: none; stroke: var(--solvion-cyan); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* Anomalie-Punkt am letzten Tageswert */
.kpi-spark .spark-dot { stroke: var(--white); stroke-width: 1.5; }
.kpi-spark .spark-dot.anomaly-low  { fill: var(--solvion-pink); }
.kpi-spark .spark-dot.anomaly-high { fill: var(--solvion-orange); }
/* Karte mit erkanntem Ausreißer dezent hervorheben */
.kpi-card.kpi-anomaly { box-shadow: inset 0 2px 0 0 var(--solvion-pink), var(--card-shadow, 0 1px 3px rgba(0,0,0,.06)); }

/* ====================================================================== */
/* Karten-Optik an die Preview angleichen: weiche, runde, frei schwebende  */
/* Karten · einheitlicher Hintergrund · kein graues KPI-Band · kein Cyan-  */
/* Top-Streifen. (Override am Dateiende → gewinnt.)                        */
/* ====================================================================== */

/* Sanfter Radial-Verlauf wie in der Preview (nur Light Mode; Dark behält bg) */
html:not([data-theme="dark"]) body {
  background: radial-gradient(1200px 600px at 80% -10%, #E7F6FA 0%, var(--solvion-bg) 55%);
  background-attachment: fixed;
}

/* KPI-Band entfernen → Kacheln schweben wie die übrigen Karten */
.kpi-row { background: none; padding: 0; border-radius: 0; }
.kpi-row.all-green::before { display: none; }

/* Karten: weich gerundet, dezenter Rahmen statt Cyan-Top-Streifen */
.card,
.kpi-card {
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--white);
}
.kpi-card { border-top: none; padding: 18px 20px; }

/* ====================================================================== */
/* Karten „geiler" wie in der UX-Preview: weicher Float-Schatten, sanfter  */
/* Hover-Lift, mehr Luft, ruhigere Header (mixed case, ohne Trennlinie).    */
/* ====================================================================== */
.card, .kpi-card {
  box-shadow: 0 1px 2px rgba(11, 87, 125, 0.05), 0 12px 32px rgba(11, 87, 125, 0.08);
  transition: transform .25s cubic-bezier(.22,.61,.36,1), box-shadow .25s ease;
}
.card { padding: 22px 24px; }
.card:hover, .kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 2px 6px rgba(11, 87, 125, 0.08), 0 18px 44px rgba(11, 87, 125, 0.13);
}

/* Ruhigere Card-Header (wie Preview): keine Trennlinie, gemischte Schreibung */
.card-header {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 14px;
}
.card-header h3 {
  text-transform: none;
  letter-spacing: .01em;
  font-size: 15px;
}
.card-meta { color: #8A96A0; }

/* KPI-Label ebenfalls ruhiger: gemischte Schreibung statt Versalien */
.kpi-label {
  text-transform: none;
  letter-spacing: normal;
  font-size: 12.5px;
}

/* Dark Mode: dezenter, neutraler Schatten statt blau */
html[data-theme="dark"] .card,
html[data-theme="dark"] .kpi-card {
  box-shadow: 0 1px 2px rgba(0,0,0,0.35), 0 12px 32px rgba(0,0,0,0.45);
}
html[data-theme="dark"] .card:hover,
html[data-theme="dark"] .kpi-card:hover {
  box-shadow: 0 2px 6px rgba(0,0,0,0.4), 0 18px 44px rgba(0,0,0,0.55);
}

/* ====================================================================== */
/* KPI-Kacheln im Preview-Layout: Delta/Badge oben rechts (kompakter).     */
/* ====================================================================== */
.kpi-card { position: relative; }
.kpi-card .kpi-label { padding-right: 66px; }
.kpi-card .kpi-trend {
  position: absolute; top: 18px; right: 20px; margin: 0;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}

/* ====================================================================== */
/* KPI-Zahl nach Status einfärben (Klarheit auf einen Blick).             */
/* Nur die Zahl; die Einheit (.kpi-unit) bleibt gedämpft.                 */
/* ====================================================================== */
.kpi-value.val-good { color: var(--solvion-teal); }
.kpi-value.val-warn { color: var(--solvion-orange); }
.kpi-value.val-bad  { color: var(--solvion-pink); }
html[data-theme="dark"] .kpi-value.val-good { color: #4fd1be; }
html[data-theme="dark"] .kpi-value.val-warn { color: #f7b24a; }
html[data-theme="dark"] .kpi-value.val-bad  { color: #ff7a98; }

/* ====================================================================== */
/* Header-Refresh: glasiger, schwebender Single-Row-Header (Override).     */
/* ====================================================================== */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 6px 24px rgba(11, 87, 125, 0.06);
  padding: 0;
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 11px 28px; max-width: 1600px; margin: 0 auto;
}
.topbar-left { display: flex; align-items: center; gap: 18px; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.topbar-divider { width: 1px; height: 26px; background: var(--border); margin: 0 2px; }

/* Ghost-Icon-Buttons */
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid transparent; background: transparent;
  color: var(--solvion-dark); font-size: 15px; cursor: pointer;
  transition: background .15s ease, color .15s ease, transform .12s ease;
}
.btn-icon:hover { background: rgba(0, 175, 205, 0.10); color: var(--solvion-cyan); }
.btn-icon:active { transform: scale(.93); }
.btn-icon:focus-visible { outline: 2px solid var(--solvion-cyan); outline-offset: 2px; }

/* Live-/Refresh-Pille mit Puls */
.live-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--white);
  font-size: 12px; font-weight: 600; color: var(--solvion-text);
  cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease;
}
.live-pill:hover { border-color: var(--solvion-cyan); box-shadow: 0 0 0 3px rgba(0, 175, 205, 0.08); }
.live-pill-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--solvion-teal);
  animation: pulse-dot 2s ease-in-out infinite;
}

/* Login-Button (ausgeloggt) */
.btn-primary-sm {
  display: inline-flex; align-items: center; padding: 7px 16px; border-radius: 20px;
  background: var(--solvion-cyan); color: #fff; text-decoration: none;
  font-size: 13px; font-weight: 600; transition: opacity .15s ease;
}
.btn-primary-sm:hover { opacity: .9; }

/* Avatar + Dropdown-Menü */
.user-menu { position: relative; }
.user-avatar-btn { border: none; background: transparent; padding: 0; cursor: pointer; border-radius: 50%; line-height: 0; }
.user-avatar-btn:focus-visible { outline: 2px solid var(--solvion-cyan); outline-offset: 2px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--solvion-cyan), var(--solvion-dark));
  color: #fff; font-weight: 700; font-size: 13px; letter-spacing: .02em;
  display: inline-flex; align-items: center; justify-content: center;
}
.avatar-lg { width: 44px; height: 44px; font-size: 15px; }
.user-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0;
  min-width: 244px; background: var(--white);
  border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 14px 36px rgba(11, 87, 125, 0.18);
  padding: 14px; z-index: 200; animation: ddIn .18s ease both;
}
@keyframes ddIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.user-dropdown-head {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 8px;
}
.user-dropdown-meta { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.user-dropdown-meta strong { color: var(--solvion-dark); font-size: 14px; }
.user-dropdown-meta span {
  color: #8A96A0; font-size: 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 190px;
}
.user-dropdown-item {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 9px;
  color: var(--solvion-text); text-decoration: none; font-size: 13px; font-weight: 600;
  transition: background .15s ease, color .15s ease;
}
.user-dropdown-item:hover { background: rgba(235, 86, 120, 0.09); color: var(--solvion-pink); }

/* Dark Mode für den Header */
html[data-theme="dark"] .topbar {
  background: rgba(27, 33, 39, 0.72);
  border-bottom-color: var(--border);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}
html[data-theme="dark"] .btn-icon:hover { background: rgba(0, 175, 205, 0.16); }

/* ====================================================================== */
/* hidden-Attribut muss IMMER ausblenden — sonst überschreiben display-    */
/* Klassen (.btn-primary-sm, .tenant-pill, …) das [hidden] und Elemente    */
/* wie „Anmelden" oder die leere Tenant-Pille blitzen trotzdem auf.        */
/* ====================================================================== */
[hidden] { display: none !important; }

/* Theme-Toggle-Icon (SVG) sauber zentrieren */
#themeBtn svg { display: block; }

/* ====================================================================== */
/* Wall-Mode — Vollbild-Overlay (dunkel, Großformat)                     */
/* ====================================================================== */
body.wall-open { overflow: hidden; }

.wall {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; flex-direction: column;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(0,175,205,0.16), transparent 60%),
    radial-gradient(900px 500px at 0% 110%, rgba(11,87,125,0.30), transparent 55%),
    #0C1116;
  color: #EAF1F5; padding: clamp(16px, 2.4vmin, 34px);
  gap: clamp(12px, 2vmin, 26px);
  --wall-card: rgba(255,255,255,0.045);
  --wall-border: rgba(255,255,255,0.10);
}

/* Kopf */
.wall-head { display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto; }
.wall-brand { display: flex; align-items: center; gap: 16px; font-size: clamp(16px, 2.1vmin, 26px); font-weight: 700; letter-spacing: .01em; }
.wall-logo { height: clamp(26px, 3.4vmin, 44px); width: auto; }
.wall-head-right { display: flex; align-items: center; gap: clamp(14px, 2vmin, 28px); }
.wall-live { display: inline-flex; align-items: center; gap: 8px; font-size: clamp(12px, 1.5vmin, 17px); font-weight: 700; color: #8FE3D6; text-transform: uppercase; letter-spacing: .12em; }
.wall-clock { font-size: clamp(20px, 3vmin, 40px); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.wall-exit {
  width: clamp(34px, 4vmin, 46px); height: clamp(34px, 4vmin, 46px); border-radius: 12px;
  border: 1px solid var(--wall-border); background: var(--wall-card); color: #EAF1F5;
  font-size: 18px; cursor: pointer; line-height: 1; transition: background .15s ease;
}
.wall-exit:hover { background: rgba(235,86,120,0.22); }

/* Bühne + Szenen (Crossfade) */
.wall-stage { position: relative; flex: 1 1 auto; min-height: 0; }
.wall-scene {
  position: absolute; inset: 0; opacity: 0; visibility: hidden;
  transition: opacity .6s ease; display: flex; flex-direction: column;
  gap: clamp(12px, 2vmin, 26px); justify-content: center;
}
.wall-scene.is-active { opacity: 1; visibility: visible; }
.wall-scene-title {
  font-size: clamp(13px, 1.6vmin, 19px); text-transform: uppercase; letter-spacing: .18em;
  color: #7FA7BC; font-weight: 700;
}

/* Szene: Gesamtlage */
.wall-lage { display: flex; align-items: center; gap: clamp(20px, 4vmin, 64px); height: 100%; }
.wall-gauge {
  flex: 0 0 auto; width: clamp(180px, 34vmin, 420px); aspect-ratio: 1 / 1; border-radius: 50%;
  display: grid; place-items: center; --c: var(--solvion-teal);
  background: conic-gradient(var(--c) calc(var(--p) * 3.6deg), rgba(255,255,255,0.07) 0);
  box-shadow: 0 0 60px rgba(0,175,205,0.18);
}
.wall-gauge-warn { --c: var(--solvion-orange); box-shadow: 0 0 60px rgba(241,159,39,0.20); }
.wall-gauge-bad  { --c: var(--solvion-pink);   box-shadow: 0 0 60px rgba(235,86,120,0.22); }
.wall-gauge-inner {
  width: 78%; height: 78%; border-radius: 50%; background: #0E141A;
  display: grid; place-items: center; text-align: center; line-height: 1;
}
.wall-score { font-size: clamp(54px, 12vmin, 150px); font-weight: 800; font-variant-numeric: tabular-nums; }
.wall-score-sub { font-size: clamp(13px, 1.8vmin, 22px); color: #7FA7BC; margin-top: -4px; }
.wall-score-label { margin-top: 10px; font-size: clamp(16px, 2.4vmin, 30px); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.wall-lage-side { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: clamp(12px, 2vmin, 22px); }
.wall-sigs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: clamp(10px, 1.6vmin, 18px); }
.wall-sig {
  background: var(--wall-card); border: 1px solid var(--wall-border); border-radius: 16px;
  padding: clamp(12px, 1.8vmin, 22px); display: flex; flex-direction: column; gap: 4px; position: relative;
}
.wall-sig-val { font-size: clamp(22px, 3.4vmin, 44px); font-weight: 800; font-variant-numeric: tabular-nums; }
.wall-sig-lbl { font-size: clamp(11px, 1.4vmin, 16px); color: #7FA7BC; text-transform: uppercase; letter-spacing: .12em; }
.wall-sig-dot { position: absolute; top: 14px; right: 14px; width: 12px; height: 12px; border-radius: 50%; background: #5b6b77; }
.wall-summary { font-size: clamp(15px, 2vmin, 26px); color: #C7D6DF; font-weight: 600; }

/* Statusfarben (Punkte/Werte) */
.wall .good { color: #6FE0CF; } .wall-sig-dot.good { background: var(--solvion-teal); }
.wall .warn { color: #FFC061; } .wall-sig-dot.warn { background: var(--solvion-orange); }
.wall .bad  { color: #FF8AA4; } .wall-sig-dot.bad  { background: var(--solvion-pink); }

/* Szene: Live-Betrieb */
.wall-live-grid { display: grid; grid-template-columns: minmax(280px, 1fr) 1.4fr; gap: clamp(18px, 3vmin, 48px); align-items: center; height: 100%; }
.wall-big { background: var(--wall-card); border: 1px solid var(--wall-border); border-radius: 22px; padding: clamp(18px, 3vmin, 40px); text-align: center; }
.wall-big-num { font-size: clamp(60px, 14vmin, 190px); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; color: #79E0FF; }
.wall-big-lbl { font-size: clamp(14px, 1.8vmin, 22px); color: #7FA7BC; text-transform: uppercase; letter-spacing: .14em; margin-top: 6px; }
.wall-stats { display: flex; justify-content: center; gap: clamp(20px, 4vmin, 56px); margin-top: clamp(14px, 2.4vmin, 30px); }
.wall-stat span { display: block; font-size: clamp(22px, 3.4vmin, 46px); font-weight: 800; font-variant-numeric: tabular-nums; }
.wall-stat small { font-size: clamp(11px, 1.4vmin, 15px); color: #7FA7BC; text-transform: uppercase; letter-spacing: .12em; }
.wall-sbcs { display: flex; flex-direction: column; gap: clamp(10px, 1.6vmin, 20px); max-height: 100%; overflow: hidden; }
.wall-sbc { background: var(--wall-card); border: 1px solid var(--wall-border); border-radius: 14px; padding: clamp(10px, 1.5vmin, 18px) clamp(14px, 2vmin, 22px); }
.wall-sbc-top { display: flex; align-items: center; gap: 12px; font-size: clamp(14px, 1.8vmin, 22px); font-weight: 700; }
.wall-sbc-name { flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wall-sbc-ac { font-variant-numeric: tabular-nums; }
.wall-sbc-bar { margin-top: 8px; height: 8px; border-radius: 6px; background: rgba(255,255,255,0.08); overflow: hidden; }
.wall-sbc-fill { display: block; height: 100%; border-radius: 6px; background: var(--solvion-cyan); }
.wall-sbc-fill.good { background: var(--solvion-teal); } .wall-sbc-fill.warn { background: var(--solvion-orange); } .wall-sbc-fill.bad { background: var(--solvion-pink); }

/* Szene: Qualität & Volumen */
.wall-qual-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(16px, 2.6vmin, 34px); height: 100%; align-content: center; }
.wall-metric { background: var(--wall-card); border: 1px solid var(--wall-border); border-radius: 22px; padding: clamp(18px, 3vmin, 40px); }
.wall-metric-val { font-size: clamp(40px, 8vmin, 110px); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.wall-metric-val small { font-size: clamp(14px, 2vmin, 26px); font-weight: 700; color: #7FA7BC; }
.wall-metric-lbl { font-size: clamp(13px, 1.7vmin, 20px); color: #7FA7BC; text-transform: uppercase; letter-spacing: .12em; margin-top: 8px; }
.wall-spark { height: clamp(34px, 5vmin, 64px); margin-top: 14px; }
.wall-spark .spark-area { fill: rgba(0,175,205,0.18); }
.wall-spark .spark-line { stroke: #79E0FF; stroke-width: 2.5; }

.wall-empty { color: #7FA7BC; font-size: clamp(14px, 2vmin, 22px); padding: 20px; }

/* Fuß: Alarm-Ticker + Szenen-Punkte */
.wall-foot { flex: 0 0 auto; display: flex; align-items: center; gap: clamp(12px, 2vmin, 24px); }
.wall-ticker-label {
  flex: 0 0 auto; font-size: clamp(11px, 1.4vmin, 15px); font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  padding: 7px 14px; border-radius: 20px; background: rgba(255,255,255,0.06); color: #8FE3D6;
}
.wall-ticker-label.warn { color: var(--solvion-orange); background: rgba(241,159,39,0.12); }
.wall-ticker { flex: 1 1 auto; overflow: hidden; white-space: nowrap; position: relative; -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.wall-ticker-track { display: inline-block; white-space: nowrap; will-change: transform; }
.wall-tick { display: inline-block; padding: 0 clamp(20px, 3vmin, 44px); font-size: clamp(14px, 1.8vmin, 22px); font-weight: 600; }
.wall-tick.ok { color: #6FE0CF; } .wall-tick.warn { color: #FFC061; } .wall-tick.bad { color: #FF8AA4; }
.wall-dots { flex: 0 0 auto; display: flex; gap: 9px; }
.wall-dot { width: 11px; height: 11px; border-radius: 50%; background: rgba(255,255,255,0.18); cursor: pointer; transition: background .2s ease, transform .2s ease; }
.wall-dot.active { background: var(--solvion-cyan); transform: scale(1.25); }

@keyframes wallMarquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

@media (prefers-reduced-motion: reduce) {
  .wall-scene { transition: none; }
  .wall-ticker-track { animation: none !important; }
}
