/* Universe Admin Analytics — Command Deck */
.uaa-root {
  --uaa-bg0: #0b1220;
  --uaa-bg1: #121a2b;
  --uaa-line: rgba(148, 183, 255, 0.18);
  --uaa-text: #e8eef7;
  --uaa-muted: #9aa7b8;
  --uaa-accent: #5eead4;
  color: var(--uaa-text);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(94, 234, 212, 0.12), transparent 55%),
    radial-gradient(900px 400px at 90% 0%, rgba(167, 139, 250, 0.14), transparent 50%),
    linear-gradient(180deg, var(--uaa-bg0), var(--uaa-bg1));
  border: 1px solid var(--uaa-line);
  border-radius: 18px;
  padding: 18px 18px 28px;
  min-height: 70vh;
}

.uaa-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.uaa-eyebrow {
  margin: 0 0 4px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--uaa-accent);
}

.uaa-title {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.uaa-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 10px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  white-space: nowrap;
  scrollbar-width: thin;
  padding-bottom: 2px;
  width: 100%;
  max-width: 100%;
}

.uaa-tab {
  background: rgba(8, 14, 26, 0.75);
  color: var(--uaa-muted);
  border: 1px solid var(--uaa-line);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 0.85rem;
  flex: 0 0 auto;
  scroll-snap-align: start;
}

.uaa-tab.is-active,
.uaa-tab:hover {
  color: var(--uaa-accent);
  border-color: var(--uaa-accent);
}

.uaa-preferred-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 12px;
  font-size: 0.86rem;
  opacity: 0.92;
  cursor: pointer;
}

.uaa-sub, .uaa-meta, .uaa-loading {
  color: var(--uaa-muted);
  font-size: 0.9rem;
}

.uaa-error { color: #fda4af; }

/* KPI-/Info-Kacheln: horizontal swipebar (Discuss/CFD-Muster) */
.uaa-kpi-row,
.uaa-summary-kpi {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 10px;
  margin-bottom: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  padding-bottom: 4px;
  width: 100%;
  max-width: 100%;
}

.uaa-kpi {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--uaa-line);
  border-radius: 12px;
  padding: 12px 12px 10px;
  flex: 0 0 min(42vw, 140px);
  width: min(42vw, 140px);
  min-width: min(42vw, 140px);
  box-sizing: border-box;
  scroll-snap-align: start;
}

.uaa-kpi-label {
  font-size: 0.72rem;
  color: var(--uaa-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.uaa-kpi-value {
  margin-top: 4px;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--uaa-accent);
  line-height: 1.15;
  word-break: break-word;
}

.uaa-kpi[data-light="green"] .uaa-kpi-value { color: #22c55e; }
.uaa-kpi[data-light="yellow"] .uaa-kpi-value { color: #eab308; }
.uaa-kpi[data-light="red"] .uaa-kpi-value { color: #ef4444; }

.uaa-filters,
.uaa-filter-strip {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  padding-bottom: 4px;
  width: 100%;
  max-width: 100%;
}

.uaa-filters > *,
.uaa-filter-strip > * {
  flex: 0 0 auto;
  scroll-snap-align: start;
  min-width: 140px;
}

.uaa-filter-strip label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  opacity: 0.92;
  min-width: 148px;
}

.uaa-filter-strip input,
.uaa-filter-strip select {
  font-size: 0.85rem;
  padding: 6px 8px;
  background: rgba(8, 14, 26, 0.85);
  color: var(--uaa-text);
  border: 1px solid var(--uaa-line);
  border-radius: 10px;
}

/* Händler-Filter: Multi wie Select + ▾, Checkboxen erst nach Aufklappen */
.lmac-multi-field {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px;
  min-width: 148px !important;
  scroll-snap-align: start;
}
.lmac-multi-field-label {
  font-size: 0.78rem;
  opacity: 0.92;
}
.lmac-multi-details {
  position: relative;
  width: 100%;
}
.lmac-multi-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.85rem;
  padding: 6px 8px;
  background: rgba(8, 14, 26, 0.85);
  color: var(--uaa-text);
  border: 1px solid var(--uaa-line);
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  min-height: 2.1em;
  box-sizing: border-box;
}
.lmac-multi-summary::-webkit-details-marker { display: none; }
.lmac-multi-summary::after {
  content: "▾";
  flex: 0 0 auto;
  opacity: 0.85;
  font-size: 0.85rem;
  line-height: 1;
}
.lmac-multi-details[open] > .lmac-multi-summary::after { content: "▴"; }
.lmac-multi-summary-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.lmac-multi-panel {
  display: none;
  z-index: 12000;
  min-width: 220px;
  max-width: min(320px, 92vw);
  border: 1px solid var(--uaa-line);
  border-radius: 12px;
  padding: 8px 10px;
  background: #121a2b;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}
.lmac-multi-details[open] > .lmac-multi-panel,
.lmac-multi-panel.is-fixed-open {
  display: block;
}
.lmac-multi-panel.is-fixed-open {
  position: fixed;
}
.lmac-check-group-opts {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
}
.lmac-check {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 6px;
  min-width: 0 !important;
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
}
.lmac-check input[type="checkbox"] {
  width: auto;
  min-width: 0;
  margin: 0;
  flex: 0 0 auto;
}
.lmac-check-group-hint {
  margin-top: 6px;
  font-size: 0.7rem;
  opacity: 0.7;
}

.lmac-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 12px;
  width: auto;
  max-width: 100%;
}
.lmac-actions .lmac-action-btn,
.lmac-actions .uaa-btn {
  width: auto !important;
  max-width: none;
  flex: 0 0 auto;
  white-space: nowrap;
}

.lmac-table th,
.lmac-table td {
  border-bottom: 1px solid rgba(127, 127, 127, 0.25);
  padding: 8px 6px;
  text-align: left;
  vertical-align: top;
}
.lmac-table th {
  position: sticky;
  top: 0;
  background: var(--card-bg, #152033);
  z-index: 1;
}
.lmac-row-sim {
  background: rgba(234, 179, 8, 0.12);
}
.lmac-row-sim td:first-child {
  box-shadow: inset 3px 0 0 #eab308;
}
.lmac-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  vertical-align: middle;
  text-transform: uppercase;
}
.lmac-badge-sim {
  color: #0b1220;
  background: #eab308;
}
.lmac-mode-sim {
  color: #fbbf24;
  font-weight: 600;
}
.lmac-mrr-sim {
  color: #fbbf24;
  font-weight: 600;
}
.lmac-mrr-sim small {
  font-weight: 700;
  opacity: 0.95;
}
.lmac-life {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.lmac-life-active {
  color: #14532d;
  background: rgba(34, 197, 94, 0.22);
}
.lmac-life-cancel {
  color: #713f12;
  background: rgba(234, 179, 8, 0.28);
}
.lmac-life-out {
  color: #7f1d1d;
  background: rgba(239, 68, 68, 0.25);
}

.uaa-input, .uaa-btn {
  background: rgba(8, 14, 26, 0.85);
  color: var(--uaa-text);
  border: 1px solid var(--uaa-line);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.85rem;
}

.uaa-input { min-width: 140px; flex: 1 1 140px; }
.uaa-btn { cursor: pointer; white-space: nowrap; }
.uaa-btn:hover { border-color: var(--uaa-accent); color: var(--uaa-accent); }

.uaa-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.uaa-chart-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--uaa-line);
  border-radius: 14px;
  padding: 10px;
  height: 260px;
}

.uaa-chart-wide { grid-column: 1 / -1; height: 280px; }

.uaa-org-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin: 0 0 16px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  padding-bottom: 4px;
  width: 100%;
  max-width: 100%;
}

.uaa-org-chips .uaa-chip {
  flex: 0 0 auto;
  scroll-snap-align: start;
  white-space: nowrap;
}

.uaa-chip {
  background: rgba(8, 14, 26, 0.85);
  color: var(--uaa-text);
  border: 1px solid var(--uaa-line);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 0.82rem;
}

.uaa-chip span {
  color: var(--uaa-accent);
  margin-left: 4px;
}

.uaa-chip:hover {
  border-color: var(--uaa-accent);
  color: var(--uaa-accent);
}

.uaa-th-avatar {
  width: 52px;
  cursor: default;
}

.uaa-td-avatar {
  width: 52px;
  padding-right: 4px !important;
}

.uaa-avatar-btn {
  display: inline-flex;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
}

.uaa-avatar-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--uaa-line);
  background: rgba(255, 255, 255, 0.06);
  display: block;
}

.uaa-link {
  background: none;
  border: none;
  color: var(--uaa-accent);
  cursor: pointer;
  padding: 0;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.uaa-link:hover { color: #99f6e4; }

.uaa-table-actions {
  margin-top: 10px;
  display: flex;
  justify-content: center;
}

.uaa-table-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.uaa-table-wrap {
  border: 1px solid var(--uaa-line);
  border-radius: 14px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.18);
}

.uaa-table-scroll {
  width: 100%;
  max-height: min(70vh, 720px);
  overflow: auto;
  border-radius: 10px;
}

.uaa-table {
  width: max(100%, 980px);
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.84rem;
}

.uaa-table th,
.uaa-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left;
  white-space: nowrap;
}

.uaa-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #152033;
  color: #d7e3f5;
  cursor: pointer;
  user-select: none;
}

.uaa-table tbody tr:hover td {
  background: rgba(94, 234, 212, 0.06);
}

.uaa-universe-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.uaa-universe-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.3;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(30, 41, 59, 0.85);
  color: #e2e8f0;
  white-space: nowrap;
}
.uaa-universe-badge[data-universe="social"] {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(14, 116, 144, 0.35);
}
.uaa-universe-badge[data-universe="vitalpass"] {
  border-color: rgba(52, 211, 153, 0.55);
  background: rgba(6, 95, 70, 0.35);
}
.uaa-universe-badge[data-universe="cannalytica"] {
  border-color: rgba(167, 139, 250, 0.55);
  background: rgba(76, 29, 149, 0.35);
}

.uaa-th.is-asc::after { content: " ↑"; color: var(--uaa-accent); }
.uaa-th.is-desc::after { content: " ↓"; color: var(--uaa-accent); }

@media (max-width: 720px) {
  .uaa-root { padding: 12px; border-radius: 12px; }
  .uaa-title { font-size: 1.35rem; }
  .uaa-chart-card { height: 220px; }
}

/* Performance-Ampel (ops-health) */
.ops-health {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.55);
}
.ops-health-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.ops-health-lamp {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #64748b;
  box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.25);
  flex: 0 0 auto;
}
.ops-health[data-light="green"] .ops-health-lamp {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
}
.ops-health[data-light="yellow"] .ops-health-lamp {
  background: #eab308;
  box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.28);
}
.ops-health[data-light="red"] .ops-health-lamp {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.28);
}
.ops-health-title {
  margin: 0;
  font-size: 1.05rem;
  color: #e2e8f0;
}
.ops-health-sub {
  margin: 2px 0 0;
  font-size: 0.85rem;
  color: #94a3b8;
}
.ops-health-refresh { margin-left: auto; }
.ops-health-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  padding-bottom: 4px;
  width: 100%;
  max-width: 100%;
}
.ops-health-cell {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.7);
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 0 0 min(42vw, 150px);
  width: min(42vw, 150px);
  min-width: min(42vw, 150px);
  box-sizing: border-box;
  scroll-snap-align: start;
}
.ops-health-cell span {
  font-size: 0.75rem;
  color: #94a3b8;
}
.ops-health-cell strong {
  font-size: 0.95rem;
  color: #f1f5f9;
  font-weight: 600;
}
.ops-health-hint {
  margin: 10px 0 0;
  font-size: 0.8rem;
  color: #94a3b8;
}
.ops-health--error { border-color: rgba(239, 68, 68, 0.45); }
.ops-health-loading { color: #94a3b8; margin: 0 0 12px; }
.ops-health-history {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
}
.ops-health-history h4 {
  margin: 0 0 8px;
  font-size: 0.92rem;
  color: #e2e8f0;
}
.ops-health-spark-block {
  margin: 0 0 10px;
}
.ops-health-spark-block span {
  display: block;
  font-size: 0.75rem;
  color: #94a3b8;
  margin-bottom: 2px;
}
.ops-health-spark {
  display: block;
  background: rgba(2, 6, 23, 0.45);
  border-radius: 8px;
}
.ops-health-history-empty {
  margin: 0;
  font-size: 0.8rem;
  color: #94a3b8;
}
