/* Dashboard redesign – layout, KPI, navigation, cards (v4 zones) */

:root {
  --radius-control: 6px;
  --radius-card: 12px;
  --dr-surface: #ffffff;
  --dr-muted: #64748b;
  --dr-line: #e2e8f0;
  --dr-card-border: #c5d0de;
  --dr-card-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 3px 10px rgba(15, 23, 42, 0.08);
  --dr-card-shadow-hover: 0 2px 6px rgba(15, 23, 42, 0.08), 0 8px 18px rgba(15, 23, 42, 0.1);
  --dr-zone-bg: #f1f5f9;
  --dr-accent: #2563eb;
  --dr-accent-soft: #eff6ff;
  --dr-alarm: #c2410c;
  --dr-crit: #b91c1c;
  --dr-host-active: #15803d;
  --dr-host-inactive: #b91c1c;
  --dr-host-active-bg: #f0fdf4;
  --dr-host-inactive-bg: #fef2f2;
  --sidebar-edge: 5px;
  --sidebar-scroll-pad: 5px;
  --sidebar-scroll-track: 12px;
  --sidebar-content-inset-end: calc(var(--sidebar-scroll-pad) + var(--sidebar-scroll-track));
  --sidebar-list-gap: 6px;
  --sidebar-mode-header-slot: 36px;
  --sidebar-service-toolbar-slot: 40px;
  --sidebar-host-card-slot: 70px;
  --sidebar-host-visible: 10;
  --sidebar-service-card-slot: 112px;
  --sidebar-service-visible: 6;
  --sidebar-host-list-max: calc(
    var(--sidebar-host-visible) * var(--sidebar-host-card-slot)
    + (var(--sidebar-host-visible) - 1) * var(--sidebar-list-gap)
  );
  --sidebar-service-list-max: calc(
    var(--sidebar-service-visible) * var(--sidebar-service-card-slot)
    + (var(--sidebar-service-visible) - 1) * var(--sidebar-list-gap)
  );
  --dashboard-sticky-top: 10px;
  --dashboard-sticky-stack-gap: 10px;
  --dashboard-brand-header-sticky-height: 72px;
  --external-monitor-history-build-ms: 1000ms;
}

/* Unified card surfaces (host list, KPIs, report meta, panels) */
.host-list article.host-item,
.hosts-column .host-item:not(.service-monitor-card),
.meta-groups .meta-group,
.metric-card,
.overview-sap-chip,
.overview-content .alerts-panel,
.overview-content .analysis-panel,
.overview-content .detail-card,
.report-card .detail-card,
.report-card .detail-card-collapsible {
  background: var(--dr-surface) !important;
  border: 1px solid var(--dr-card-border) !important;
  border-radius: var(--radius-card) !important;
  box-shadow: var(--dr-card-shadow) !important;
}

.host-list article.host-item:hover,
.hosts-column .host-item:not(.service-monitor-card):hover {
  border-color: #a8b9cc !important;
  box-shadow: var(--dr-card-shadow-hover) !important;
}

.service-monitor-list article.host-item.service-monitor-card {
  border-radius: var(--radius-card) !important;
  box-shadow: var(--dr-card-shadow) !important;
}

.service-monitor-list article.host-item.service-monitor-card:hover {
  box-shadow: var(--dr-card-shadow-hover) !important;
}

.host-list article.host-item.selected,
.hosts-column .host-item.selected:not(.service-monitor-card) {
  border-color: #93c5fd !important;
  box-shadow: var(--dr-card-shadow-hover) !important;
  background: #fff !important;
}

/* ── Zone 1: Brand flatter, KPI neutral ── */
.brand-header {
  position: sticky;
  top: var(--dashboard-sticky-top);
  z-index: 40;
  padding-top: 6px !important;
  padding-bottom: 6px !important;
}

.panel-header {
  top: calc(
    var(--dashboard-sticky-top)
    + var(--dashboard-brand-header-sticky-height)
    + var(--dashboard-sticky-stack-gap)
  ) !important;
}

@media (max-width: 760px) {
  :root {
    --dashboard-sticky-top: 6px;
    --dashboard-sticky-stack-gap: 8px;
  }
}

/* Logo ohne Karten-Rahmen – frei im Header */
.brand-header .app-logo {
  width: 56px !important;
  height: 56px !important;
  flex: 0 0 56px !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.brand-header .app-logo img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

body[data-theme="dark"] .brand-header .app-logo {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.header-stat-chip .header-chip-scope,
.header-stat-chip .header-chip-icon,
.header-chip-trend {
  display: none !important;
}

/* KPI strip: grouped stat cells – override styles.css grid (142px columns clip KPIs) */
.panel-header .panel-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: flex-start !important;
  gap: 8px !important;
  grid-template-columns: none !important;
}

.panel-header .panel-actions .header-kpi-strip {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-wrap: wrap !important;
  align-items: stretch !important;
  gap: 6px !important;
  overflow: visible !important;
  padding: 0 !important;
  min-width: 0 !important;
  width: auto !important;
  max-width: 100% !important;
  grid-auto-flow: unset !important;
  grid-auto-columns: unset !important;
  grid-template-columns: none !important;
}

.panel-header .header-kpi-group {
  display: inline-flex !important;
  flex-direction: column !important;
  flex: 0 0 auto !important;
  flex-shrink: 0 !important;
  align-items: stretch !important;
  gap: 3px !important;
  width: max-content !important;
  max-width: none !important;
  min-width: 0 !important;
  padding: 4px 5px 5px !important;
  border: 1px solid var(--dr-card-border) !important;
  border-radius: var(--radius-card) !important;
  background: var(--dr-surface) !important;
  box-shadow: var(--dr-card-shadow) !important;
  overflow: visible !important;
}

.panel-header .header-kpi-group-title {
  flex: 0 0 auto;
  width: 100%;
  text-align: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--dr-muted);
  line-height: 1.1;
  white-space: nowrap;
  padding: 0 2px;
}

.panel-header .header-kpi-group-cells {
  display: inline-flex !important;
  flex: 0 0 auto !important;
  align-items: stretch !important;
  gap: 3px !important;
  width: 100%;
}

.panel-header .header-kpi-group-cells > .header-stat-chip:not(.header-stat-chip-license) {
  display: inline-flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0 !important;
  flex: 1 1 auto !important;
  flex-shrink: 0 !important;
  width: auto !important;
  min-width: 2.65rem !important;
  max-width: none !important;
  min-height: 32px !important;
  padding: 2px 6px !important;
  margin: 0 !important;
  border: 1px solid var(--dr-line) !important;
  border-radius: 5px !important;
  background: #f8fafc !important;
  box-shadow: none !important;
  color: #334155 !important;
  font-weight: 600 !important;
  transform: none !important;
  overflow: visible !important;
}

.panel-header .header-kpi-group-cells > .header-stat-chip-acknowledged,
.panel-header .header-kpi-group-cells > .header-stat-chip-muted {
  min-width: 3.1rem !important;
}

.panel-header .header-kpi-group-cells > .header-stat-chip-db-reports {
  min-width: 3.35rem !important;
}

.panel-header .header-kpi-group-cells > .header-stat-chip-db-size,
.panel-header .header-kpi-group-cells > .header-stat-chip-db-size-delta {
  min-width: 3.75rem !important;
}

.panel-header .header-kpi-group-cells > .header-stat-chip-db-reports-hour {
  min-width: 3rem !important;
}

.panel-header .header-kpi-group-cells > .header-stat-chip:hover {
  background: rgba(148, 163, 184, 0.14) !important;
  box-shadow: none !important;
  transform: none !important;
}

.panel-header .header-kpi-strip .header-chip-label {
  font-size: 8.5px !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em !important;
  text-transform: none !important;
  color: var(--dr-muted) !important;
  line-height: 1.15 !important;
  white-space: nowrap;
  overflow: visible !important;
  text-align: center;
}

.panel-header .header-kpi-strip .header-chip-count {
  font-size: 12px !important;
  font-weight: 800 !important;
  font-variant-numeric: tabular-nums;
  line-height: 1.1 !important;
  color: #0f172a !important;
  white-space: nowrap;
  overflow: visible !important;
  max-width: none !important;
  text-align: center;
}

.panel-header .header-kpi-strip > .header-kpi-group > .header-kpi-group-cells > .header-stat-chip {
  width: auto !important;
  max-width: none !important;
}

.panel-header .header-kpi-group--alerts .header-stat-chip-alert.header-stat-chip--alarm-active {
  background: #fff7ed !important;
  border-color: #fdba74 !important;
}

.panel-header .header-kpi-group--alerts .header-stat-chip-critical.header-stat-chip--alarm-active {
  background: #fef2f2 !important;
  border-color: #fca5a5 !important;
}

.panel-header .header-kpi-group--alerts .header-stat-chip-alert.header-stat-chip--alarm-active .header-chip-count {
  color: var(--dr-alarm) !important;
}

.panel-header .header-kpi-group--alerts .header-stat-chip-critical.header-stat-chip--alarm-active .header-chip-count {
  color: var(--dr-crit) !important;
}

.panel-header .header-kpi-group--alerts .header-stat-chip-alert.header-stat-chip--alarm-active .header-chip-label,
.panel-header .header-kpi-group--alerts .header-stat-chip-critical.header-stat-chip--alarm-active .header-chip-label {
  color: inherit !important;
  font-weight: 700 !important;
}

/* Hosts: Aktiv grün, Inaktiv rot (immer) */
.panel-header .header-kpi-group--hosts .header-stat-chip-active-hosts {
  background: var(--dr-host-active-bg) !important;
  border-color: #bbf7d0 !important;
}

.panel-header .header-kpi-group--hosts .header-stat-chip-inactive {
  background: var(--dr-host-inactive-bg) !important;
  border-color: #fecaca !important;
}

.panel-header .header-kpi-group--hosts .header-stat-chip-active-hosts:hover {
  background: #dcfce7 !important;
}

.panel-header .header-kpi-group--hosts .header-stat-chip-inactive:hover {
  background: #fee2e2 !important;
}

.panel-header .header-kpi-group--hosts .header-stat-chip-active-hosts .header-chip-label,
.panel-header .header-kpi-group--hosts .header-stat-chip-active-hosts .header-chip-count {
  color: var(--dr-host-active) !important;
}

.panel-header .header-kpi-group--hosts .header-stat-chip-inactive .header-chip-label,
.panel-header .header-kpi-group--hosts .header-stat-chip-inactive .header-chip-count {
  color: var(--dr-host-inactive) !important;
}

body[data-theme="dark"] .panel-header .header-kpi-group--hosts .header-stat-chip-active-hosts {
  background: rgba(34, 197, 94, 0.14) !important;
  border-color: rgba(74, 222, 128, 0.35) !important;
}

body[data-theme="dark"] .panel-header .header-kpi-group--hosts .header-stat-chip-inactive {
  background: rgba(248, 113, 113, 0.14) !important;
  border-color: rgba(248, 113, 113, 0.35) !important;
}

body[data-theme="dark"] .panel-header .header-kpi-group--hosts .header-stat-chip-active-hosts:hover {
  background: rgba(34, 197, 94, 0.22) !important;
}

body[data-theme="dark"] .panel-header .header-kpi-group--hosts .header-stat-chip-inactive:hover {
  background: rgba(248, 113, 113, 0.22) !important;
}

body[data-theme="dark"] .panel-header .header-kpi-group--hosts .header-stat-chip-active-hosts .header-chip-label,
body[data-theme="dark"] .panel-header .header-kpi-group--hosts .header-stat-chip-active-hosts .header-chip-count {
  color: #4ade80 !important;
}

body[data-theme="dark"] .panel-header .header-kpi-group--hosts .header-stat-chip-inactive .header-chip-label,
body[data-theme="dark"] .panel-header .header-kpi-group--hosts .header-stat-chip-inactive .header-chip-count {
  color: #f87171 !important;
}

/* Services: OK grün wie Aktiv, Down rot wie Inaktiv */
.panel-header .header-kpi-group--services .header-stat-chip-services-ok {
  background: var(--dr-host-active-bg) !important;
  border-color: #bbf7d0 !important;
}

.panel-header .header-kpi-group--services .header-stat-chip-services-down {
  background: var(--dr-host-inactive-bg) !important;
  border-color: #fecaca !important;
}

.panel-header .header-kpi-group--services .header-stat-chip-services-ok:hover {
  background: #dcfce7 !important;
}

.panel-header .header-kpi-group--services .header-stat-chip-services-down:hover {
  background: #fee2e2 !important;
}

.panel-header .header-kpi-group--services .header-stat-chip-services-ok .header-chip-label,
.panel-header .header-kpi-group--services .header-stat-chip-services-ok .header-chip-count {
  color: var(--dr-host-active) !important;
}

.panel-header .header-kpi-group--services .header-stat-chip-services-down .header-chip-label,
.panel-header .header-kpi-group--services .header-stat-chip-services-down .header-chip-count {
  color: var(--dr-host-inactive) !important;
}

body[data-theme="dark"] .panel-header .header-kpi-group--services .header-stat-chip-services-ok {
  background: rgba(34, 197, 94, 0.14) !important;
  border-color: rgba(74, 222, 128, 0.35) !important;
}

body[data-theme="dark"] .panel-header .header-kpi-group--services .header-stat-chip-services-down {
  background: rgba(248, 113, 113, 0.14) !important;
  border-color: rgba(248, 113, 113, 0.35) !important;
}

body[data-theme="dark"] .panel-header .header-kpi-group--services .header-stat-chip-services-ok:hover {
  background: rgba(34, 197, 94, 0.22) !important;
}

body[data-theme="dark"] .panel-header .header-kpi-group--services .header-stat-chip-services-down:hover {
  background: rgba(248, 113, 113, 0.22) !important;
}

body[data-theme="dark"] .panel-header .header-kpi-group--services .header-stat-chip-services-ok .header-chip-label,
body[data-theme="dark"] .panel-header .header-kpi-group--services .header-stat-chip-services-ok .header-chip-count {
  color: #4ade80 !important;
}

body[data-theme="dark"] .panel-header .header-kpi-group--services .header-stat-chip-services-down .header-chip-label,
body[data-theme="dark"] .panel-header .header-kpi-group--services .header-stat-chip-services-down .header-chip-count {
  color: #f87171 !important;
}

.panel-header .panel-actions .header-toolbar {
  flex: 0 0 auto;
  margin-left: auto;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.panel-header .panel-actions .header-toolbar .btn-emoji-pill {
  width: 32px !important;
  height: 32px !important;
  padding: 0 !important;
  border: 1px solid var(--dr-line) !important;
  border-radius: var(--radius-control) !important;
  background: #fff !important;
  box-shadow: none !important;
  font-size: 15px !important;
  line-height: 1 !important;
  color: #475569 !important;
}

.panel-header .panel-actions .header-toolbar .btn-emoji-pill:hover:not(:disabled) {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #1e293b !important;
}

body[data-theme="dark"] .panel-header .header-kpi-group {
  background: #1e293b !important;
  border-color: #334155 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

body[data-theme="dark"] .panel-header .header-kpi-group-title {
  color: #94a3b8 !important;
}

body[data-theme="dark"] .panel-header .header-kpi-group-cells > .header-stat-chip:not(.header-stat-chip-license) {
  border-color: #334155 !important;
  background: #0f172a !important;
  color: #e2e8f0 !important;
}

body[data-theme="dark"] .panel-header .header-kpi-strip .header-chip-label {
  color: #94a3b8 !important;
}

body[data-theme="dark"] .panel-header .header-kpi-strip .header-chip-count {
  color: #f1f5f9 !important;
}

body[data-theme="dark"] .panel-header .header-kpi-group--alerts .header-stat-chip-alert.header-stat-chip--alarm-active {
  background: rgba(251, 146, 60, 0.16) !important;
}

body[data-theme="dark"] .panel-header .header-kpi-group--alerts .header-stat-chip-critical.header-stat-chip--alarm-active {
  background: rgba(248, 113, 113, 0.18) !important;
}

body[data-theme="dark"] .panel-header .header-kpi-group--alerts .header-stat-chip-alert.header-stat-chip--alarm-active .header-chip-count {
  color: #fb923c !important;
}

body[data-theme="dark"] .panel-header .header-kpi-group--alerts .header-stat-chip-critical.header-stat-chip--alarm-active .header-chip-count {
  color: #f87171 !important;
}

body[data-theme="dark"] .panel-header .panel-actions .header-toolbar .btn-emoji-pill {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

/* ── Zone 2: Filter dropdowns ── */
.host-filter-control-icons .icon-filter-chips {
  display: none !important;
}

.host-filter-select-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.host-filter-select-wrap select {
  height: 30px;
  min-width: 120px;
  padding: 0 8px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-control);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
}

/* ── Zone 3: Host cards ── */
.host-list article.host-item,
.service-monitor-list article.host-item {
  padding: 8px 10px !important;
}

.host-list article.host-item .host-customer-line {
  font-size: 14px !important;
  font-weight: 900 !important;
  letter-spacing: 0.015em;
  line-height: 1.2;
}

.host-corner-icons .host-flag-icon,
.host-tech-row--ip img,
.host-tech-row--ip .host-os-icon {
  display: none !important;
}

.host-status-pulse {
  width: 8px !important;
  height: 8px !important;
  min-width: 8px !important;
  border-radius: 50% !important;
  animation: none !important;
  box-shadow: none !important;
}

.host-status-pulse--ok { background: #16a34a !important; }
.host-status-pulse--warning { background: #d97706 !important; }
.host-status-pulse--critical { background: #dc2626 !important; }
.host-status-pulse--unknown { background: #94a3b8 !important; }

.host-license-dot {
  width: 7px;
  height: 7px;
  min-width: 7px;
  min-height: 7px;
  padding: 0;
  margin: 0;
  border: 1px solid #fff;
  border-radius: 50%;
  background: #6366f1;
  box-shadow: 0 0 0 1px #c7d2fe;
  cursor: pointer;
  flex-shrink: 0;
  vertical-align: middle;
  touch-action: manipulation;
}

.host-license-dot:hover,
.host-license-dot:focus-visible {
  background: #4f46e5;
  box-shadow: 0 0 0 1px #a5b4fc;
  outline: none;
}

.host-tech-row--host .host-license-dot {
  align-self: center;
}

.host-card-corner-badges {
  position: absolute;
  top: 8px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  z-index: 3;
}

.host-card-os-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  overflow: hidden;
  flex-shrink: 0;
}

.host-card-os-badge img {
  width: 13px;
  height: 13px;
  object-fit: contain;
  display: block;
}

.host-card-country-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  color: #64748b;
  flex-shrink: 0;
}

.host-list article.host-item .host-customer-title-line {
  padding-right: 50px;
}

.host-list article.host-item .host-designation-row,
.host-list article.host-item .host-tech-line {
  width: 100%;
}

.host-list article.host-item .host-detail-line {
  font-size: 10.5px;
  line-height: 1.2;
}

.host-list article.host-item .host-detail-clock {
  font-size: 8px;
}

.host-tech-row--host .host-meta-v {
  font-size: 10.5px !important;
  font-weight: 600 !important;
  color: #7188a3 !important;
}

.host-list article {
  position: relative;
}

.hosts-column .sidebar-card-header h3 {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dr-muted);
}

.hosts-column .sidebar-card-header h3::before {
  content: none;
}

/* ── Zone 3+4: Layout shell cards (sidebar + host detail) ── */
.layout {
  align-items: start;
}

.hosts-column {
  display: flex;
  flex-direction: column;
  background: var(--dr-surface) !important;
  border: 1px solid var(--dr-card-border) !important;
  border-radius: var(--radius-card) !important;
  box-shadow: var(--dr-card-shadow) !important;
  overflow: hidden;
  padding: 8px var(--sidebar-edge) 10px !important;
  align-self: start !important;
}

.reports-column {
  display: flex;
  flex-direction: column;
  background: var(--dr-surface) !important;
  border: 1px solid var(--dr-card-border) !important;
  border-radius: var(--radius-card) !important;
  box-shadow: var(--dr-card-shadow) !important;
  overflow: hidden;
  align-self: start;
  min-width: 0;
}

#hostDashboardPanels {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
}

.reports-column .external-monitor-detail-view {
  border-top: 1px solid var(--dr-line);
}

/* ── Zone 4: Report chrome ── */
.reports-column .section-head {
  display: none !important;
}

.report-chrome-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--dr-line);
  background: transparent;
}

.report-chrome-logo-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 32px;
  padding: 2px 4px;
  border: 1px solid var(--dr-line);
  border-radius: var(--radius-control);
  background: #fff;
  overflow: visible;
}

.report-chrome-logo-wrap.hidden {
  display: none !important;
}

.report-chrome-logo {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
}

.report-chrome-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0;
  min-width: 0;
}

.report-chrome-customer {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.01em;
  line-height: 1.22;
  color: #0f3f5f;
}

.report-chrome-host {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.24;
  color: #6a819d;
}

.report-chrome-title .sep {
  color: #cbd5e1;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.22;
  margin: 0 6px;
}

.report-chrome-env {
  padding: 2px 8px;
  border-radius: var(--radius-control);
  border: 1px solid var(--dr-line);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--dr-muted);
}

.report-chrome-env.env-prod {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.report-chrome-date {
  margin-left: auto;
  font-family: var(--kv-value-family);
  font-size: 11px;
  font-weight: 600;
  color: var(--dr-muted);
}

.report-chrome-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.reports-column .view-tabs-shell {
  padding: 0 14px;
  border-bottom: 2px solid var(--dr-line);
  background: transparent;
}

.reports-column .view-tabs {
  gap: 0;
}

.reports-column .view-tabs .tab-button {
  padding: 10px 14px 8px !important;
  border: none !important;
  border-bottom: 3px solid transparent !important;
  border-radius: 0 !important;
  background: transparent !important;
  margin-bottom: -2px;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: var(--dr-muted) !important;
}

.reports-column .view-tabs .tab-button.active {
  color: var(--dr-accent) !important;
  border-bottom-color: var(--dr-accent) !important;
  background: transparent !important;
}

/* Horizontal mode nav (Übersicht + Einzelmeldungen sidebars) */
.reports-column .overview-layout,
#overviewView .overview-layout,
#reportsView .overview-layout {
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
}

.reports-column .overview-sidebar,
#overviewView .overview-sidebar,
#reportsView .overview-sidebar {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
  margin-right: 0;
  margin-bottom: 0;
  padding: 8px 14px;
  gap: 4px;
  border: none;
  border-bottom: 1px solid var(--dr-line);
  border-radius: 0;
  background: #fafbfc;
  align-self: auto;
}

.reports-column .overview-sidebar-item,
#overviewView .overview-sidebar-item,
#reportsView .overview-sidebar-item {
  width: auto;
  min-height: 30px;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  box-shadow: none !important;
  white-space: nowrap;
  font-size: 12px;
  color: var(--dr-muted);
}

.reports-column .overview-sidebar-item:hover,
#overviewView .overview-sidebar-item:hover,
#reportsView .overview-sidebar-item:hover {
  background: #fff;
  border-color: var(--dr-line);
  color: #334155;
}

.reports-column .overview-sidebar-item.active,
#overviewView .overview-sidebar-item.active,
#reportsView .overview-sidebar-item.active {
  background: var(--dr-accent-soft) !important;
  border-color: #93c5fd !important;
  color: var(--dr-accent) !important;
  font-weight: 700;
}

.reports-column .overview-sidebar .osi-icon,
#overviewView .overview-sidebar .osi-icon,
#reportsView .overview-sidebar .osi-icon {
  display: none;
}

.reports-column .overview-sidebar-divider,
#overviewView .overview-sidebar-divider,
#reportsView .overview-sidebar-divider {
  display: none;
}

.reports-column .overview-sidebar-range,
#overviewView .overview-sidebar-range {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 0;
  font-size: 11px;
  flex-shrink: 0;
}

/* Keep tab row visible: Zeitraum is margin-left:auto; Kundeninfos must sit before it in DOM */
#overviewView .overview-sidebar > .overview-sidebar-item {
  flex-shrink: 0;
}

.reports-column .overview-sidebar-range select,
#overviewView .overview-sidebar-range select {
  width: auto;
  min-width: 140px;
}

#overviewView .overview-sidebar--reports-only {
  display: none !important;
}

#reportsView .overview-sidebar--overview-only {
  display: none !important;
}

#reportsView:not(.reports-mode-active) .overview-sidebar--reports-only {
  display: none !important;
}

#reportsView.reports-mode-active .overview-sidebar--reports-only {
  display: flex !important;
}

/* Report jump row in reports nav */
.report-jump-row--inline {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 0;
  border: none;
  background: transparent;
}

.report-jump-row--inline .report-nav-btn,
.report-jump-row--inline .time-btn {
  height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-control);
  font-size: 11px;
}

.report-jump-bounds-hint,
#reportJumpBounds.report-jump-bounds-hint {
  margin-left: 6px !important;
  padding-left: 10px;
  border-left: 1px solid var(--dr-line);
  font-size: 11px !important;
  font-weight: 600;
  color: var(--dr-muted);
  white-space: nowrap !important;
  text-align: left !important;
  line-height: 1.2 !important;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 280px !important;
  overflow: hidden;
  text-overflow: ellipsis;
}

.report-jump-bounds-hint.hidden {
  display: none !important;
}

@media (max-width: 1100px) {
  .report-jump-bounds-hint {
    flex-basis: 100%;
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    max-width: none;
  }
}

#reportsView > .overview-layout > .overview-content > .report-jump-row:not(.report-jump-row--inline) {
  display: none;
}

/* Overview host metrics grid */
#overviewView .overview-content,
#reportsView .overview-content,
.reports-column .overview-content {
  background: var(--dr-zone-bg);
  border-radius: var(--radius-card);
  padding: 12px 14px;
}

.overview-host-metrics {
  margin-top: 2px;
  margin-bottom: 14px;
}

.overview-sap-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.overview-sap-chip {
  padding: 6px 12px;
  font-size: 10px;
  font-weight: 700;
  color: var(--dr-muted);
}

.overview-sap-chip span {
  display: block;
  font-size: 12px;
  color: #1e293b;
  font-family: var(--kv-value-family);
  margin-top: 2px;
}

.overview-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

@media (max-width: 820px) {
  .overview-metrics-grid { grid-template-columns: 1fr; }
}

.overview-metrics-grid .metric-card--wide {
  grid-column: 1 / -1;
}

.metric-card,
.meta-groups .meta-group {
  --dr-kv-label-width: 8.25rem;
}

.overview-metrics-grid .metric-card {
  --dr-kv-label-width: 8.5rem;
}

.metric-card {
  padding: 12px 14px;
}

.metric-card h4 {
  margin: 0 0 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dr-muted);
}

.metric-row {
  display: grid;
  grid-template-columns: var(--dr-kv-label-width) minmax(0, 1fr);
  column-gap: 10px;
  row-gap: 2px;
  align-items: baseline;
  padding: 5px 0;
  border-bottom: 1px solid #f1f5f9;
}

.metric-row:last-child { border-bottom: 0; }

.metric-row .metric-label {
  font-weight: 600;
  color: #475569;
  font-size: 12px;
  line-height: 1.35;
}

.metric-row .metric-value {
  font-family: var(--kv-value-family);
  font-size: 11px;
  font-weight: 600;
  color: #1e293b;
  text-align: right;
  min-width: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.metric-row .metric-value:has(.text-truncate-mid),
.metric-row .metric-value.metric-value--nowrap {
  overflow-wrap: normal;
  word-break: normal;
}

.metric-row .metric-value.metric-value--nowrap {
  white-space: nowrap;
}

.metric-row .metric-value .text-truncate-mid,
.meta-group-item .kv-value .text-truncate-mid {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
  cursor: help;
}

.metric-bar-row {
  padding: 6px 0 8px;
  border-bottom: 1px solid #f1f5f9;
}

.metric-bar-head {
  display: grid;
  grid-template-columns: var(--dr-kv-label-width) minmax(0, 1fr);
  column-gap: 10px;
  align-items: baseline;
  margin-bottom: 4px;
  font-weight: 600;
  font-size: 12px;
  color: #475569;
}

.metric-bar-head > span:last-child {
  text-align: right;
  font-family: var(--kv-value-family);
  font-size: 11px;
  font-weight: 600;
  color: #1e293b;
}

.metric-bar-track {
  height: 6px;
  border-radius: 3px;
  background: #e2e8f0;
  overflow: hidden;
}

.metric-bar-fill {
  height: 100%;
  border-radius: 3px;
}

.metric-bar-fill--low { background: #22c55e; }
.metric-bar-fill--mid { background: #f59e0b; }
.metric-bar-fill--high { background: #ef4444; }

.overview-resource-bars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 900px) {
  .overview-resource-bars { grid-template-columns: 1fr; }
}

/* Report card meta → grid with bars */
.meta-groups {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

.meta-groups .meta-group {
  border-left-width: 1px !important;
  margin: 0 !important;
  padding: 12px 14px !important;
}

.meta-groups .meta-group:nth-child(1),
.meta-groups .meta-group:nth-child(2),
.meta-groups .meta-group:nth-child(3),
.meta-groups .meta-group:nth-child(4) {
  grid-column: auto !important;
}

.meta-group-title {
  font-size: 10px !important;
  font-weight: 800 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  color: var(--dr-muted) !important;
  border-bottom: none !important;
  padding-bottom: 8px !important;
}

.meta-group-item {
  display: grid !important;
  grid-template-columns: var(--dr-kv-label-width) minmax(0, 1fr) !important;
  column-gap: 10px !important;
  row-gap: 2px !important;
  align-items: baseline !important;
  margin: 0 !important;
  padding: 5px 0 !important;
  line-height: 1.35 !important;
}

.meta-group-item .kv-label {
  font-weight: 600 !important;
  color: #475569 !important;
  font-size: 12px !important;
  font-family: inherit !important;
  letter-spacing: normal !important;
}

.meta-group-item .kv-value {
  display: block !important;
  text-align: right !important;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.report-card .report-header {
  display: none !important;
}

.report-sap-kpi-row--chrome {
  display: none;
}

@media (max-width: 1100px) {
  .meta-groups { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

@media (max-width: 640px) {
  .meta-groups { grid-template-columns: 1fr !important; }
}

/* Sub-panels: cards, tables */
.overview-content .alerts-panel,
.overview-content .analysis-panel,
.overview-content .detail-card {
  padding: 12px 14px !important;
}

.overview-content .alerts-panel--overview-top {
  margin-bottom: 12px;
}

.overview-content .alerts-panel--overview-top .alerts-panel-header {
  margin-bottom: 0;
}

.overview-content .alerts-panel--overview-top:not(.alerts-panel--collapsed) .alerts-panel-header {
  margin-bottom: 8px;
}

.report-list .report-card {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.overview-content .analysis-header h4,
.detail-card h4,
.alerts-panel h4 {
  font-size: 13px !important;
  font-weight: 800 !important;
  color: #1e293b !important;
}

button,
input[type="text"],
input[type="search"],
input[type="number"],
input[type="password"],
input[type="datetime-local"],
select,
.search-input,
.auto-refresh-interval-select {
  border-radius: var(--radius-control) !important;
}

.host-context-menu {
  border-radius: var(--radius-control) !important;
}

/* Dark mode */
body[data-theme="dark"] {
  --dr-surface: #111b2f;
  --dr-line: #24344d;
  --dr-card-border: #334155;
  --dr-card-shadow: 0 1px 2px rgba(0, 0, 0, 0.28), 0 4px 14px rgba(0, 0, 0, 0.32);
  --dr-card-shadow-hover: 0 2px 8px rgba(0, 0, 0, 0.34), 0 10px 22px rgba(0, 0, 0, 0.38);
  --dr-zone-bg: #0c1422;
  --dr-muted: #9fb3cc;
}

body[data-theme="dark"] .header-stat-chip {
  background: var(--dr-surface) !important;
  border-color: var(--dr-line) !important;
  color: #e2e8f0 !important;
}

body[data-theme="dark"] .host-list article.host-item.selected,
body[data-theme="dark"] .hosts-column .host-item.selected:not(.service-monitor-card) {
  background: #172033 !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35), var(--dr-card-shadow-hover) !important;
}

body[data-theme="dark"] .host-license-dot {
  background: #818cf8;
  border-color: #111b2f;
  box-shadow: 0 0 0 1px #4338ca;
}

body[data-theme="dark"] .host-license-dot:hover,
body[data-theme="dark"] .host-license-dot:focus-visible {
  background: #a5b4fc;
}

body[data-theme="dark"] .reports-column .overview-content,
body[data-theme="dark"] #overviewView .overview-content,
body[data-theme="dark"] #reportsView .overview-content {
  background: var(--dr-zone-bg);
}

body[data-theme="dark"] .hosts-column,
body[data-theme="dark"] .reports-column {
  background: var(--dr-surface) !important;
  border-color: var(--dr-card-border) !important;
  box-shadow: var(--dr-card-shadow) !important;
}

body[data-theme="dark"] .report-chrome-bar {
  background: transparent !important;
  border-bottom-color: var(--dr-line) !important;
}

body[data-theme="dark"] .report-chrome-logo-wrap {
  background: var(--dr-surface) !important;
  border-color: var(--dr-line) !important;
}

body[data-theme="dark"] .report-chrome-customer {
  color: #f4f8ff;
}

body[data-theme="dark"] .report-chrome-host {
  color: #9fb4cb;
}

body[data-theme="dark"] .report-chrome-title .sep {
  color: #475569;
}

body[data-theme="dark"] .report-chrome-env.env-prod {
  background: rgba(34, 197, 94, 0.14) !important;
  border-color: rgba(74, 222, 128, 0.35) !important;
  color: #4ade80 !important;
}

body[data-theme="dark"] .report-chrome-date {
  color: #94a3b8;
}

body[data-theme="dark"] .reports-column .view-tabs-shell {
  background: transparent !important;
  border-bottom-color: var(--dr-line) !important;
}

body[data-theme="dark"] .reports-column .overview-sidebar,
body[data-theme="dark"] #overviewView .overview-sidebar,
body[data-theme="dark"] #reportsView .overview-sidebar {
  background: #0f1a2c !important;
  border-color: var(--dr-line) !important;
}

body[data-theme="dark"] .reports-column .overview-sidebar-item.active,
body[data-theme="dark"] #overviewView .overview-sidebar-item.active,
body[data-theme="dark"] #reportsView .overview-sidebar-item.active {
  background: #1e3a5f !important;
  border-color: #3b82f6 !important;
  color: #93c5fd !important;
}

/* Systemübersicht: 2-zeilige Toolbar (Zeile 1: Stats/Suche/Aktionen, Zeile 2: Länder) */
#systemOverviewView .system-overview-toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  flex-wrap: nowrap;
}

#systemOverviewView .system-overview-toolbar-primary {
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(220px, 1fr) repeat(4, max-content);
  align-items: center;
  gap: 8px;
}

#systemOverviewView #systemOverviewStats {
  grid-column: 1;
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

#systemOverviewView #systemOverviewSearchInput {
  grid-column: 2;
  width: 100%;
  max-width: none;
  min-width: 0;
  flex: unset;
}

#systemOverviewView #toggleSystemOverviewSortModeButton {
  grid-column: 3;
}

#systemOverviewView #toggleSystemOverviewAddonsButton {
  grid-column: 4;
}

#systemOverviewView #expandAllSystemOverviewButton {
  grid-column: 5;
}

#systemOverviewView #refreshSystemOverviewButton {
  grid-column: 6;
}

#systemOverviewView .system-overview-toolbar-countries {
  display: flex;
  align-items: center;
  min-width: 0;
  padding-top: 2px;
  border-top: 1px solid rgba(201, 216, 236, 0.65);
}

#systemOverviewView #systemOverviewCountryFilter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

#systemOverviewView .system-overview-land-chip {
  flex: 0 0 auto;
}

#systemOverviewView .so-country-filter-list {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

@media (max-width: 1180px) {
  #systemOverviewView .system-overview-toolbar-primary {
    grid-template-columns: minmax(0, max-content) minmax(180px, 1fr);
    grid-template-rows: auto auto;
  }

  #systemOverviewView #systemOverviewStats {
    grid-column: 1;
    grid-row: 1;
  }

  #systemOverviewView #systemOverviewSearchInput {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }

  #systemOverviewView #toggleSystemOverviewSortModeButton,
  #systemOverviewView #toggleSystemOverviewAddonsButton,
  #systemOverviewView #expandAllSystemOverviewButton,
  #systemOverviewView #refreshSystemOverviewButton {
    grid-row: 1;
  }
}

/* Brand header: account card + compact toggle column */
.brand-user-controls {
  display: flex;
  align-items: stretch;
  gap: 4px;
  flex-shrink: 0;
}

.brand-user-toggles {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  align-self: stretch;
  gap: 0;
  flex-shrink: 0;
  padding: 0;
}

.brand-user-toggles .theme-toggle {
  height: 18px !important;
  width: 32px !important;
  min-height: 0 !important;
  padding: 0 !important;
  flex: 0 0 auto;
}

.brand-user-controls:has(.brand-account-shell.hidden) .brand-user-toggles {
  justify-content: center;
  gap: 2px;
  align-self: center;
}

.live-report-feed-toggle[aria-pressed="true"] .theme-toggle-track {
  background: #bfdbfe;
}

.live-report-feed-toggle[aria-pressed="true"] .live-report-feed-toggle-thumb {
  transform: translateX(14px);
  background: #1d4ed8;
  color: #eff6ff;
}

.live-report-feed-toggle-thumb::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
  display: block;
}

.live-report-feed-toggle[aria-pressed="true"] .live-report-feed-toggle-thumb::before {
  background: #5eead4;
  box-shadow: 0 0 0 2px rgba(94, 234, 212, 0.35);
}

.live-report-feed-toggle[aria-pressed="false"] .live-report-feed-toggle-thumb::before {
  background: #94a3b8;
  opacity: 0.55;
}

/* Live report card embedded in brand header */
.header-live-report {
  flex: 0 0 auto;
  width: min(268px, calc(100vw - 560px));
  min-width: 0;
  max-width: 268px;
  margin: 0 auto;
  align-self: center;
}

.header-live-report-viewport {
  --header-live-scroll-duration: 1.2s;
  --header-live-scroll-fade-duration: 1.02s;
  width: 100%;
  height: 68px;
  overflow: hidden;
  position: relative;
}

.header-live-report-stack {
  position: relative;
  width: 100%;
  min-height: 100%;
}

.header-live-report-card {
  width: 100%;
  flex: 0 0 68px !important;
  height: 68px !important;
  min-height: 68px !important;
  max-height: 68px !important;
  padding: 6px 8px !important;
  border-radius: 10px !important;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.06),
    0 4px 10px rgba(15, 23, 42, 0.08) !important;
}

.header-live-report-stack.is-animating .header-live-report-card.is-exiting {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1;
  pointer-events: none;
  transition:
    transform var(--header-live-scroll-duration) cubic-bezier(0.22, 1, 0.36, 1),
    opacity var(--header-live-scroll-fade-duration) ease;
}

.header-live-report-card.is-exiting.is-exiting-active {
  transform: translateY(calc(100% + 8px));
  opacity: 0;
}

.header-live-report-card.is-entering {
  opacity: 0;
  transform: translateY(calc(-100% - 8px));
  transition:
    transform var(--header-live-scroll-duration) cubic-bezier(0.22, 1, 0.36, 1),
    opacity var(--header-live-scroll-fade-duration) ease;
}

.header-live-report-card:hover {
  transform: translateY(-1px);
}

.header-live-report-stack.is-animating .header-live-report-card.is-exiting:hover,
.header-live-report-card.is-entering:hover {
  transform: none;
}

@media (max-width: 1080px) {
  .header-live-report {
    display: none !important;
  }
}

/* Legacy floating feed (mobile-alerts) */
.live-report-feed {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1250;
  width: min(258px, calc(100vw - 20px));
  display: flex;
  flex-direction: column;
  background: var(--dr-surface);
  border: 1px solid var(--dr-card-border);
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.14);
  overflow: hidden;
}

.live-report-feed.is-dragging {
  user-select: none;
  cursor: grabbing;
}

.live-report-feed-head {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 5px 4px 4px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.live-report-feed-drag-zone {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1 1 auto;
  min-width: 0;
  padding: 2px 4px;
  border-radius: 5px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.live-report-feed-drag-zone:active,
.live-report-feed.is-dragging .live-report-feed-drag-zone {
  cursor: grabbing;
}

.live-report-feed-grip {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: -0.12em;
  color: #94a3b8;
  line-height: 1;
  flex: 0 0 auto;
}

.live-report-feed-head strong {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #334155;
}

.live-report-feed-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  background: #2563eb;
}

.live-report-feed-actions {
  margin-left: auto;
  display: inline-flex;
  gap: 2px;
}

.live-report-feed-icon-btn {
  width: 20px;
  height: 20px;
  min-width: 20px;
  padding: 0;
  font-size: 11px;
  line-height: 1;
  box-shadow: none;
}

.live-report-feed-body {
  --live-feed-slot: 64px;
  --live-feed-gap: 4px;
  --live-feed-body-pad: 6px;
  height: calc(
    var(--live-feed-visible-slots, 5) * var(--live-feed-slot)
    + (var(--live-feed-visible-slots, 5) - 1) * var(--live-feed-gap)
    + (2 * var(--live-feed-body-pad))
  );
  overflow: hidden;
  padding: var(--live-feed-body-pad);
  display: flex;
  flex-direction: column;
  gap: var(--live-feed-gap);
  flex: 0 0 auto;
}

.live-report-feed.is-minimized .live-report-feed-body {
  display: none;
}

.live-report-feed-item {
  box-sizing: border-box;
  position: relative;
  display: block;
  width: 100%;
  flex: 0 0 var(--live-feed-slot);
  height: var(--live-feed-slot) !important;
  min-height: var(--live-feed-slot) !important;
  max-height: var(--live-feed-slot) !important;
  margin: 0;
  text-align: left;
  padding: 8px 10px;
  border: 1px solid #d5e0ef;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f6f9fd 100%);
  color: #1e293b;
  cursor: pointer;
  font: inherit;
  line-height: 1;
  overflow: hidden;
  box-shadow:
    0 1px 1px rgba(15, 23, 42, 0.05),
    0 3px 6px rgba(15, 23, 42, 0.07),
    0 6px 12px rgba(15, 23, 42, 0.05);
  transition:
    border-color 0.12s ease,
    background-color 0.12s ease,
    box-shadow 0.12s ease,
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.28s ease;
  will-change: transform;
}

.live-report-feed-body.is-animating .live-report-feed-item:hover {
  transform: none;
}

.live-report-feed-item:hover {
  border-color: #93c5fd;
  background: linear-gradient(180deg, #ffffff 0%, #f0f7ff 100%);
  box-shadow:
    0 2px 3px rgba(15, 23, 42, 0.06),
    0 6px 12px rgba(15, 23, 42, 0.1),
    0 10px 18px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

.live-report-feed-item.is-entering {
  opacity: 0;
  transform: translateY(-14px) scale(0.98);
}

.live-report-feed-item.is-new:not(.is-entering) {
  animation: live-report-feed-flash 0.9s ease-out 1;
}

@keyframes live-report-feed-flash {
  0% {
    background: #dbeafe;
    border-color: #60a5fa;
    box-shadow:
      0 0 0 2px rgba(59, 130, 246, 0.35),
      0 4px 14px rgba(37, 99, 235, 0.22);
  }
  55% {
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #93c5fd;
  }
  100% {
    background: linear-gradient(180deg, #ffffff 0%, #f6f9fd 100%);
    border-color: #d5e0ef;
    box-shadow:
      0 1px 1px rgba(15, 23, 42, 0.05),
      0 3px 6px rgba(15, 23, 42, 0.07),
      0 6px 12px rgba(15, 23, 42, 0.05);
  }
}

@media (prefers-reduced-motion: reduce) {
  .live-report-feed-item {
    transition: border-color 0.12s ease, background-color 0.12s ease, box-shadow 0.12s ease !important;
    animation: none !important;
    will-change: auto;
  }
}

.live-report-feed-item-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: 11px 10px 12px 11px;
  row-gap: 1px;
  align-content: start;
  width: 100%;
  height: 100%;
}

.live-report-feed-customer-bg-watermark {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 4px;
  bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0.08;
  z-index: 0;
  overflow: hidden;
}

.live-report-feed-customer-bg-watermark-logo {
  width: 86%;
  height: 86%;
  object-fit: contain;
  object-position: center center;
  display: block;
}

.live-report-feed-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  height: 11px;
  min-height: 11px;
  max-height: 11px;
}

.live-report-feed-customer-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  flex: 1 1 auto;
}

.live-report-feed-customer {
  font-size: 10px;
  font-weight: 700;
  color: #0f172a;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-report-feed-time {
  flex: 0 0 auto;
  font-size: 8.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #64748b;
  padding: 1px 4px;
  border-radius: 3px;
  background: #eef2f7;
}

.live-report-feed-designation {
  margin: 0;
  height: 10px;
  min-height: 10px;
  max-height: 10px;
  font-size: 9px;
  font-weight: 600;
  color: #475569;
  line-height: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-report-feed-hostline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  margin: 0;
  height: 12px;
  min-height: 12px;
  max-height: 12px;
  font-family: var(--kv-value-family);
  font-size: 9px;
  font-weight: 500;
  line-height: 1;
  color: #7188a3;
}

.live-report-feed-host-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.live-report-feed-hostname,
.live-report-feed-ip {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-report-feed-sep {
  flex: 0 0 auto;
  color: #cbd5e1;
}

.live-report-feed-hostline .delivery-chip {
  flex: 0 0 auto;
  margin: 0;
  padding: 1px 5px;
  font-size: 7px;
  line-height: 1;
  letter-spacing: 0.04em;
}

.live-report-feed-item-foot {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  margin: 0;
  padding: 4px 0 0;
  height: 11px;
  min-height: 11px;
  max-height: 11px;
  border-top: 1px solid rgba(226, 232, 240, 0.75);
  box-sizing: border-box;
}

.live-report-feed-stats {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 8.5px;
  font-weight: 600;
  color: #64748b;
}

body[data-theme="dark"] .host-card-os-badge,
body[data-theme="dark"] .host-card-country-code {
  border-color: #475569;
  background: #1e293b;
  color: #94a3b8;
}

body[data-theme="dark"] .header-live-report-card {
  border-color: #334155 !important;
  background: linear-gradient(180deg, #152238 0%, #111b2f 100%) !important;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(51, 65, 85, 0.65) !important;
}

body[data-theme="dark"] .header-live-report-card:hover {
  border-color: #3b82f6 !important;
  background: linear-gradient(180deg, #1a2d4a 0%, #14233a 100%) !important;
}

body[data-theme="dark"] .live-report-feed {
  background: #0f172a;
  border-color: #334155;
}

body[data-theme="dark"] .live-report-feed-head {
  background: #1e293b;
  border-color: #334155;
}

body[data-theme="dark"] .live-report-feed-head strong {
  color: #e2e8f0;
}

body[data-theme="dark"] .live-report-feed-toggle[aria-pressed="true"] .theme-toggle-track {
  background: #1e3a8a;
}

body[data-theme="dark"] .live-report-feed-toggle[aria-pressed="true"] .live-report-feed-toggle-thumb::before {
  background: #2dd4bf;
  box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.28);
}

body[data-theme="dark"] .live-report-feed-toggle[aria-pressed="false"] .live-report-feed-toggle-thumb::before {
  background: #64748b;
  opacity: 0.7;
}

body[data-theme="dark"] .live-report-feed-item {
  background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
  border-color: #3b4a63;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.28),
    0 4px 10px rgba(0, 0, 0, 0.32),
    0 8px 16px rgba(0, 0, 0, 0.24);
}

body[data-theme="dark"] .live-report-feed-item:hover {
  background: linear-gradient(180deg, #172033 0%, #111827 100%);
  border-color: #3b82f6;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.3),
    0 8px 16px rgba(0, 0, 0, 0.36),
    0 12px 22px rgba(37, 99, 235, 0.18);
}

body[data-theme="dark"] .live-report-feed-item.is-new:not(.is-entering) {
  animation: live-report-feed-flash-dark 0.9s ease-out 1;
}

@keyframes live-report-feed-flash-dark {
  0% {
    background: #1e3a8a;
    border-color: #60a5fa;
    box-shadow:
      0 0 0 2px rgba(96, 165, 250, 0.4),
      0 4px 14px rgba(37, 99, 235, 0.28);
  }
  55% {
    background: linear-gradient(180deg, #1e3a8a 0%, #172554 100%);
    border-color: #3b82f6;
  }
  100% {
    background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
    border-color: #3b4a63;
    box-shadow:
      0 1px 2px rgba(0, 0, 0, 0.28),
      0 4px 10px rgba(0, 0, 0, 0.32),
      0 8px 16px rgba(0, 0, 0, 0.24);
  }
}

body[data-theme="dark"] .live-report-feed-count {
  background: #3b82f6;
}

body[data-theme="dark"] .live-report-feed-customer-bg-watermark {
  opacity: 0.065;
}

body[data-theme="dark"] .live-report-feed-customer {
  color: #f1f5f9;
}

body[data-theme="dark"] .live-report-feed-time {
  color: #94a3b8;
  background: #1e293b;
}

body[data-theme="dark"] .live-report-feed-designation {
  color: #94a3b8;
}

body[data-theme="dark"] .live-report-feed-hostline {
  color: #7188a3;
}

body[data-theme="dark"] .live-report-feed-item-foot {
  border-top-color: #1e293b;
}

body[data-theme="dark"] .live-report-feed-stats {
  color: #94a3b8;
}

/* Final pass: legacy styles.css grid must not shrink KPI groups (shows only 2 cells each) */
.panel-header .panel-actions .header-kpi-strip > .header-kpi-group {
  width: max-content !important;
  max-width: none !important;
  overflow: visible !important;
}

.panel-header .panel-actions .header-kpi-strip > .header-kpi-group > .header-kpi-group-cells > .header-stat-chip:not(.header-stat-chip-license) {
  width: auto !important;
  max-width: none !important;
}

/* ── External service monitors ── */
.sidebar-card-header--toggle {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: 100%;
  max-width: 100%;
  padding: 2px var(--sidebar-content-inset-end) 0 0 !important;
  margin-bottom: 0 !important;
  box-sizing: border-box;
}

.sidebar-card-header--toggle .sidebar-mode-toggle {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}

.sidebar-header-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 4px;
  flex: 0 0 auto;
  margin-left: auto;
}

.sidebar-header-actions .btn-secondary--compact {
  width: 28px;
  min-width: 28px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.sidebar-mode-toggle {
  display: inline-flex;
  align-items: stretch;
  gap: 4px;
  padding: 3px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  min-width: 0;
  box-sizing: border-box;
}

.sidebar-mode-btn {
  flex: 1 1 0;
  min-width: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 6px 8px;
  cursor: pointer;
  line-height: 1.2;
}

.sidebar-mode-btn.active {
  background: #fff;
  color: #1e3a5f;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.sidebar-mode-btn[data-sidebar-mode="services"].active {
  background: #eff6ff;
  color: #1d4ed8;
}

.hosts-column-scroll {
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 6px !important;
  padding: 0 0 6px !important;
  box-sizing: border-box;
  overflow: hidden;
}

.hosts-column-scroll:has(.sidebar-panel--hosts:not(.hidden)) {
  max-height: calc(var(--sidebar-mode-header-slot) + var(--sidebar-host-list-max) + 12px) !important;
}

.hosts-column-scroll:has(.sidebar-panel--services:not(.hidden)) {
  max-height: calc(
    var(--sidebar-mode-header-slot)
    + var(--sidebar-service-toolbar-slot)
    + var(--sidebar-service-list-max)
    + 12px
  ) !important;
}

.sidebar-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 0 0 auto;
}

.sidebar-panel--hosts .host-list-shell,
.sidebar-panel--services .service-monitor-list-shell {
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 var(--sidebar-scroll-pad) 0 0 !important;
  box-sizing: border-box;
  scrollbar-gutter: stable;
}

.sidebar-panel--hosts .host-list-shell {
  max-height: var(--sidebar-host-list-max);
}

.sidebar-panel--services .service-monitor-list-shell {
  max-height: var(--sidebar-service-list-max);
}

.sidebar-panel--hosts .host-list,
.sidebar-panel--services .service-monitor-list {
  padding-top: var(--space-1);
}

.sidebar-panel--hosts .host-list {
  overflow: visible;
  padding-right: 0;
  scrollbar-gutter: auto;
}

.host-list,
.service-monitor-list {
  gap: 6px !important;
}

.host-list article.host-item,
.service-monitor-list article.host-item {
  width: 100%;
  box-sizing: border-box;
}

body[data-theme="dark"] .sidebar-mode-toggle {
  border-color: #475569;
  background: #1e293b;
}

body[data-theme="dark"] .sidebar-mode-btn.active {
  background: #334155;
  color: #e2e8f0;
}

body[data-theme="dark"] .sidebar-mode-btn[data-sidebar-mode="services"].active {
  background: #1e3a5f;
  color: #bfdbfe;
}

.btn-secondary--compact {
  min-height: 24px;
  padding: 0 8px;
  font-size: 14px;
  line-height: 1;
}

.service-monitor-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
  padding: 0 var(--sidebar-content-inset-end) 6px 0 !important;
  box-sizing: border-box;
}

.service-monitor-filter-select {
  width: 100%;
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 10px;
  font-weight: 700;
  padding: 6px 8px;
}

.service-monitor-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.service-monitor-pill-row--top {
  margin-bottom: 4px;
}

.service-monitor-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 3px;
  padding: 0;
  min-width: 0;
}

.service-monitor-type-label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.service-monitor-head-row .service-monitor-pill--definition {
  flex: 0 1 auto;
  max-width: 62%;
  margin-left: auto;
  font-size: 12px;
  font-weight: 800;
  color: #000000;
  letter-spacing: 0.01em;
  border-color: #cbd5e1;
}

.service-monitor-pill-row--bottom {
  margin-top: 2px;
}

.service-monitor-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.service-monitor-pill--definition {
  font-size: 12px;
  font-weight: 800;
  color: #000000;
}

.service-monitor-pill--intern {
  color: #15803d;
}

.service-monitor-pill--extern {
  color: #1d4ed8;
}

.service-monitor-list article.host-item.service-monitor-card--up:not(.selected),
.hosts-column .service-monitor-list article.host-item.service-monitor-card--up:not(.selected) {
  background: #ffffff !important;
  border: 2px solid #22c55e !important;
  opacity: 1 !important;
}

.service-monitor-list article.host-item.service-monitor-card--down:not(.selected),
.hosts-column .service-monitor-list article.host-item.service-monitor-card--down:not(.selected) {
  background: #ffffff !important;
  border: 2px solid #ef4444 !important;
  opacity: 1 !important;
}

.service-monitor-list article.host-item.service-monitor-card--warn:not(.selected),
.hosts-column .service-monitor-list article.host-item.service-monitor-card--warn:not(.selected) {
  background: #ffffff !important;
  border: 2px solid #f97316 !important;
  opacity: 1 !important;
}

.service-monitor-list article.host-item.service-monitor-card--unknown:not(.selected),
.hosts-column .service-monitor-list article.host-item.service-monitor-card--unknown:not(.selected) {
  background: #ffffff !important;
  border: 2px solid #94a3b8 !important;
  opacity: 1 !important;
}

.service-monitor-list article.host-item.service-monitor-card.selected.service-monitor-card--up,
.hosts-column .service-monitor-list article.host-item.service-monitor-card.selected.service-monitor-card--up {
  background: #f7fef9 !important;
  border: 2px solid #22c55e !important;
  box-shadow: inset 0 0 0 1px #4ade80, var(--dr-card-shadow-hover) !important;
}

.service-monitor-list article.host-item.service-monitor-card.selected.service-monitor-card--down,
.hosts-column .service-monitor-list article.host-item.service-monitor-card.selected.service-monitor-card--down {
  background: #fff7f7 !important;
  border: 2px solid #ef4444 !important;
  box-shadow: inset 0 0 0 1px #f87171, var(--dr-card-shadow-hover) !important;
}

.service-monitor-list article.host-item.service-monitor-card.selected.service-monitor-card--warn,
.hosts-column .service-monitor-list article.host-item.service-monitor-card.selected.service-monitor-card--warn {
  background: #fffbf5 !important;
  border: 2px solid #f97316 !important;
  box-shadow: inset 0 0 0 1px #fb923c, var(--dr-card-shadow-hover) !important;
}

.service-monitor-list article.host-item.service-monitor-card.selected.service-monitor-card--unknown,
.hosts-column .service-monitor-list article.host-item.service-monitor-card.selected.service-monitor-card--unknown {
  background: #fafbfc !important;
  border: 2px solid #94a3b8 !important;
  box-shadow: inset 0 0 0 1px #93c5fd, var(--dr-card-shadow-hover) !important;
}

.service-definition-create-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 10px;
}

.service-definition-table-wrap {
  overflow: auto;
}

.service-definition-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.service-definition-name-input {
  width: 100%;
  min-width: 0;
}

.service-monitor-list {
  display: grid;
  gap: 6px;
}

.service-monitor-list article {
  position: relative;
}

.service-monitor-list article.host-item {
  cursor: pointer;
}

.service-monitor-card .host-card-main {
  gap: 3px;
}

.service-monitor-card .host-designation-row {
  gap: 6px;
}

.service-monitor-card .host-detail-line {
  font-size: 10.5px;
  line-height: 1.15;
  padding-bottom: 0;
}

.service-monitor-card .host-detail-clock {
  font-size: 8px;
}

.service-monitor-card .host-tech-line {
  gap: 8px;
}

.service-monitor-card .host-tech-row {
  gap: 4px;
}

.service-monitor-card .host-tech-row--host .host-meta-v,
.service-monitor-card .host-tech-row--ip .host-meta-v {
  font-size: 9.5px !important;
  line-height: 1.15;
}

.service-monitor-type-line {
  padding-right: 0 !important;
}

.service-monitor-type-line .host-customer-line {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.service-monitor-cert {
  margin-top: 2px;
  font-size: 8px;
  padding: 1px 5px;
  border-radius: 4px;
  display: inline-block;
  font-weight: 600;
  line-height: 1.2;
}

.service-monitor-cert--ok { background: #f0fdf4; color: #166534; }
.service-monitor-cert--warn { background: #fffbeb; color: #92400e; }

body[data-theme="dark"] .service-monitor-filter-select {
  border-color: #334155;
  background: #0f172a;
  color: #e2e8f0;
}

body[data-theme="dark"] .service-monitor-type-label {
  color: #94a3b8;
}

body[data-theme="dark"] .service-monitor-pill {
  background: #f8fafc;
  border-color: #cbd5e1;
}

body[data-theme="dark"] .service-monitor-pill--definition,
body[data-theme="dark"] .service-monitor-head-row .service-monitor-pill--definition {
  color: #f8fafc;
}

body[data-theme="dark"] .service-monitor-pill--intern {
  color: #15803d;
}

body[data-theme="dark"] .service-monitor-pill--extern {
  color: #1d4ed8;
}

body[data-theme="dark"] .service-monitor-list article.host-item.service-monitor-card--up:not(.selected),
body[data-theme="dark"] .hosts-column .service-monitor-list article.host-item.service-monitor-card--up:not(.selected) {
  background: var(--dr-surface) !important;
  border: 2px solid #4ade80 !important;
}

body[data-theme="dark"] .service-monitor-list article.host-item.service-monitor-card--down:not(.selected),
body[data-theme="dark"] .hosts-column .service-monitor-list article.host-item.service-monitor-card--down:not(.selected) {
  background: var(--dr-surface) !important;
  border: 2px solid #f87171 !important;
}

body[data-theme="dark"] .service-monitor-list article.host-item.service-monitor-card--warn:not(.selected),
body[data-theme="dark"] .hosts-column .service-monitor-list article.host-item.service-monitor-card--warn:not(.selected) {
  background: var(--dr-surface) !important;
  border: 2px solid #fb923c !important;
}

body[data-theme="dark"] .service-monitor-list article.host-item.service-monitor-card--unknown:not(.selected),
body[data-theme="dark"] .hosts-column .service-monitor-list article.host-item.service-monitor-card--unknown:not(.selected) {
  background: var(--dr-surface) !important;
  border: 2px solid #64748b !important;
}

body[data-theme="dark"] .service-monitor-list article.host-item.service-monitor-card.selected.service-monitor-card--up,
body[data-theme="dark"] .hosts-column .service-monitor-list article.host-item.service-monitor-card.selected.service-monitor-card--up {
  background: #1f5c42 !important;
  border: 2px solid #4ade80 !important;
}

body[data-theme="dark"] .service-monitor-list article.host-item.service-monitor-card.selected.service-monitor-card--down,
body[data-theme="dark"] .hosts-column .service-monitor-list article.host-item.service-monitor-card.selected.service-monitor-card--down {
  background: #8b3333 !important;
  border: 2px solid #f87171 !important;
}

body[data-theme="dark"] .service-monitor-list article.host-item.service-monitor-card.selected.service-monitor-card--warn,
body[data-theme="dark"] .hosts-column .service-monitor-list article.host-item.service-monitor-card.selected.service-monitor-card--warn {
  background: #9a4d28 !important;
  border: 2px solid #fb923c !important;
}

body[data-theme="dark"] .service-monitor-list article.host-item.service-monitor-card.selected.service-monitor-card--unknown,
body[data-theme="dark"] .hosts-column .service-monitor-list article.host-item.service-monitor-card.selected.service-monitor-card--unknown {
  background: #2a3648 !important;
  border: 2px solid #64748b !important;
}

.host-linked-monitors {
  margin-top: 4px;
  display: grid;
  gap: 4px;
}

.host-linked-monitors-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.host-linked-monitors-title {
  font-size: 8.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
}

.host-linked-monitors-summary {
  font-size: 8.5px;
  font-weight: 700;
  color: #64748b;
}

.host-linked-monitor-groups {
  display: grid;
  gap: 3px;
}

.host-linked-monitor-group {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
  overflow: hidden;
}

.host-linked-monitor-group--up {
  border-color: #d1fae5;
  background: #f7fef9;
}

.host-linked-monitor-group--down {
  border-color: #fecaca;
  background: #fff7f7;
}

.host-linked-monitor-group--degraded {
  border-color: #fed7aa;
  background: #fffbf5;
}

.host-linked-monitor-group--unknown {
  border-color: #e2e8f0;
  background: #fafbfc;
}

.host-linked-monitor-group-summary {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 3px 6px;
  cursor: pointer;
  list-style: none;
  font-size: 9px;
  font-weight: 800;
  color: #334155;
}

.host-linked-monitor-group-summary::-webkit-details-marker {
  display: none;
}

.host-linked-monitor-group-summary::before {
  content: "▶";
  flex: 0 0 auto;
  font-size: 7px;
  color: #64748b;
  line-height: 1;
}

.host-linked-monitor-group[open] > .host-linked-monitor-group-summary::before {
  content: "▼";
}

.host-linked-monitor-group-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  flex: 0 0 auto;
  background: #94a3b8;
}

.host-linked-monitor-group--up .host-linked-monitor-group-dot {
  background: #22c55e;
}

.host-linked-monitor-group--down .host-linked-monitor-group-dot {
  background: #ef4444;
}

.host-linked-monitor-group--degraded .host-linked-monitor-group-dot {
  background: #f97316;
}

.host-linked-monitor-group-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.host-linked-monitor-group-stats {
  flex: 0 0 auto;
  font-size: 8px;
  font-weight: 700;
  color: #64748b;
  white-space: nowrap;
}

.host-linked-monitor-group-items {
  display: grid;
  gap: 2px;
  padding: 0 4px 4px;
}

.host-linked-monitor-item {
  display: block;
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  background: #fff;
  color: #334155;
  font-size: 8.5px;
  font-weight: 700;
  line-height: 1.2;
  padding: 2px 6px 2px 8px;
  text-align: left;
  cursor: pointer;
  border-left-width: 3px;
}

.host-linked-monitor-item--up {
  border-left-color: #22c55e;
  background: #f7fef9;
}

.host-linked-monitor-item--down {
  border-left-color: #ef4444;
  background: #fff7f7;
}

.host-linked-monitor-item--degraded {
  border-left-color: #f97316;
  background: #fffbf5;
}

.host-linked-monitor-item--unknown {
  border-left-color: #94a3b8;
  background: #fafbfc;
}

.host-linked-monitor-item-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-monitor-linked-host {
  display: grid;
  gap: 1px;
  width: 100%;
  margin-top: 2px;
  padding: 3px 5px;
  border-radius: 5px;
  border: 1px solid #e8f0fe;
  background: #f8fbff;
  color: #1e3a5f;
  font-size: 9px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.service-monitor-linked-host-main {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.service-monitor-linked-host--missing {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #64748b;
}

.service-monitor-linked-host-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
}

.service-monitor-linked-host-meta {
  display: block;
  padding-left: 12px;
  font-size: 7.5px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.15;
}

.service-monitor-linked-host-alerts {
  flex: 0 0 auto;
  font-size: 8px;
  font-weight: 700;
  color: #b45309;
  white-space: nowrap;
}

.external-monitor-linked-host-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: none;
  background: transparent;
  color: #1d4ed8;
  font-size: inherit;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.external-monitor-linked-host-link:hover {
  text-decoration: underline;
}

.reports-column--service-mode #reportChromeBar,
.reports-column--service-mode .section-head,
.reports-column--service-mode #hostDashboardPanels {
  display: none !important;
}

.external-monitor-detail-view {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.external-monitor-detail-header {
  border: 1px solid var(--dr-card-border);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
  padding: 14px 16px;
}

.external-monitor-detail-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.external-monitor-detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.external-monitor-detail-header h4 {
  margin: 0 0 4px;
  font-size: 20px;
  color: #1e3a5f;
}

.external-monitor-detail-header .sub {
  margin: 0;
  font-size: 12px;
  color: #64748b;
  word-break: break-word;
}

.external-monitor-history-chart {
  display: grid;
  gap: 8px;
}

.external-monitor-history-chart-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.external-monitor-history-chart-stat {
  border: 1px solid #e4edf7;
  border-radius: 8px;
  background: #f8fbff;
  padding: 8px 10px;
}

.external-monitor-history-chart-stat .label {
  display: block;
  font-size: 10px;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 700;
}

.external-monitor-history-chart-stat .value {
  display: block;
  font-size: 18px;
  font-weight: 800;
  color: #1e3a5f;
  line-height: 1.2;
}

.external-monitor-history-timeline {
  border: 1px solid #e4edf7;
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
  overflow: hidden;
}

.external-monitor-history-track {
  display: block;
  width: 100%;
  padding: 6px 8px;
  box-sizing: border-box;
}

.external-monitor-history-row {
  display: grid;
  grid-template-columns: repeat(var(--point-count), minmax(2px, 1fr));
  column-gap: 2px;
  width: 100%;
}

.external-monitor-history-row--status {
  row-gap: 0;
  margin-bottom: 2px;
}

.external-monitor-status-cell {
  height: 44px;
  border-radius: 2px 2px 0 0;
  opacity: 0;
  transform: scaleY(0);
  transform-origin: bottom center;
}

.external-monitor-history-chart.external-monitor-history-chart--build .external-monitor-status-cell,
.external-monitor-history-chart.external-monitor-history-chart--build .external-monitor-latency-cell {
  animation: externalMonitorHistoryCellPop 0.16s ease forwards;
  animation-delay: calc(
    var(--cell-index) * (var(--external-monitor-history-build-ms) / max(var(--point-count) - 1, 1))
  );
}

@keyframes externalMonitorHistoryCellPop {
  0% {
    opacity: 0;
    transform: scaleY(0);
  }

  70% {
    opacity: 1;
    transform: scaleY(1.08);
  }

  100% {
    opacity: 1;
    transform: scaleY(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .external-monitor-status-cell,
  .external-monitor-latency-cell {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
}

.external-monitor-history-bar--up { background: #16a34a; }
.external-monitor-history-bar--down { background: #dc2626; }
.external-monitor-history-bar--degraded { background: #d97706; }
.external-monitor-history-bar--unknown { background: #94a3b8; }

.external-monitor-history-chart-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  color: #64748b;
}

.external-monitor-history-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 11px;
  color: #64748b;
}

.external-monitor-history-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.external-monitor-history-legend-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.external-monitor-history-empty {
  margin: 0;
}

.external-monitor-edit-enabled {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 13px;
}

.external-monitor-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.external-monitor-metric {
  border: 1px solid #d1dfed;
  border-left: 4px solid #2563eb;
  border-radius: 10px;
  background: #fff;
  padding: 10px;
}

.external-monitor-metric--up { border-left-color: #16a34a; }
.external-monitor-metric--down { border-left-color: #dc2626; }
.external-monitor-metric--warn { border-left-color: #d97706; }

.external-monitor-metric .label {
  font-size: 10px;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 700;
}

.external-monitor-metric .value {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
  margin: 4px 0;
}

.external-monitor-metric .hint {
  font-size: 11px;
  color: #64748b;
}

.external-monitor-panel {
  border: 1px solid #d6e3f1;
  border-radius: 10px;
  background: #fff;
  padding: 12px;
}

.external-monitor-panel h5 {
  margin: 0 0 10px;
  font-size: 13px;
  color: #274b71;
}

.external-monitor-panel--collapsible {
  padding-top: 10px;
  padding-bottom: 10px;
}

.external-monitor-panel--collapsible > summary {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #274b71;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.external-monitor-panel--collapsible > summary::-webkit-details-marker {
  display: none;
}

.external-monitor-panel--collapsible > summary::before {
  content: "▸";
  font-size: 11px;
  color: #64748b;
  line-height: 1;
}

.external-monitor-panel--collapsible[open] > summary::before {
  content: "▾";
}

.external-monitor-panel--collapsible .external-monitor-panel-body {
  margin-top: 10px;
}

.external-monitor-latency-section {
  border-top: 1px solid #e8eef5;
  padding-top: 4px;
}

.external-monitor-latency-chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 0 0 4px;
}

.external-monitor-latency-chart-head .label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
}

.external-monitor-latency-chart-head .value {
  font-size: 11px;
  font-weight: 700;
  color: #1e3a5f;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

.external-monitor-latency-row {
  position: relative;
  width: 100%;
}

.external-monitor-latency-avg-line {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--avg-pct);
  border-top: 1px dashed #0ea5e9;
  pointer-events: none;
  z-index: 2;
}

.external-monitor-latency-cell {
  height: 32px;
  display: flex;
  align-items: flex-end;
  background: #eef4fb;
  border-radius: 0 0 2px 2px;
  overflow: hidden;
  opacity: 0;
  transform: scaleY(0);
  transform-origin: bottom center;
}

.external-monitor-latency-cell--empty {
  background: #f1f5f9;
}

.external-monitor-latency-fill {
  width: 100%;
  min-height: 2px;
  background: #2563eb;
  border-radius: 1px 1px 0 0;
}

.external-monitor-latency-empty {
  margin: 0;
  font-size: 11px;
}

.external-monitor-latency-legend {
  margin: 0;
  font-size: 10px;
}

.external-monitor-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.external-monitor-table th,
.external-monitor-table td {
  text-align: left;
  padding: 7px 6px;
  border-bottom: 1px solid #e4edf7;
}

.external-monitor-table th {
  color: #64748b;
  font-size: 10px;
  text-transform: uppercase;
}

.external-monitor-create-push-wrap {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px dashed #c8d5e6;
  border-radius: 10px;
  background: #f8fbff;
}

.external-monitor-probe-workflow {
  margin: 0 0 10px;
  padding-left: 20px;
  font-size: 12px;
  color: #475569;
}

.external-monitor-probe-workflow li {
  margin-bottom: 4px;
}

.external-monitor-probe-script-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-size: 11px;
  color: #475569;
}

.external-monitor-probe-monitor-list {
  margin: 0 0 8px;
  padding-left: 18px;
  font-size: 12px;
}

.external-monitor-probe-script-actions {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
}

.external-monitor-probe-os-toggle {
  display: inline-flex;
  gap: 6px;
}

.external-monitor-probe-os-btn {
  border: 1px solid #c8d5e6;
  background: #fff;
  color: #334155;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.external-monitor-probe-os-btn.active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}

.external-monitor-probe-script-output {
  width: 100%;
  min-height: 280px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
  padding: 10px;
  border: 1px solid #c8d5e6;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  resize: vertical;
}

body[data-theme="dark"] .service-monitor-type-line .host-customer-line {
  color: #94a3b8;
}

body[data-theme="dark"] .host-linked-monitor-group {
  border-color: #334155;
  background: #1e293b;
}

body[data-theme="dark"] .host-linked-monitor-group--up {
  border-color: #166534;
  background: #1f5c42;
}

body[data-theme="dark"] .host-linked-monitor-group--down {
  border-color: #991b1b;
  background: #8b3333;
}

body[data-theme="dark"] .host-linked-monitor-group--degraded {
  border-color: #c96a35;
  background: #9a4d28;
}

body[data-theme="dark"] .host-linked-monitor-group-summary {
  color: #e2e8f0;
}

body[data-theme="dark"] .host-linked-monitor-group-stats {
  color: #94a3b8;
}

body[data-theme="dark"] .host-linked-monitor-item {
  border-color: #334155;
  background: #0f172a;
  color: #e2e8f0;
}

body[data-theme="dark"] .host-linked-monitor-item--up {
  border-left-color: #22c55e;
  background: #14532d;
}

body[data-theme="dark"] .host-linked-monitor-item--down {
  border-left-color: #ef4444;
  background: #7f1d1d;
}

body[data-theme="dark"] .host-linked-monitor-item--degraded {
  border-left-color: #f97316;
  background: #9a4d28;
}

body[data-theme="dark"] .service-monitor-linked-host {
  border-color: #475569;
  background: #2a3648;
  color: #e2e8f0;
}

body[data-theme="dark"] .service-monitor-linked-host-meta {
  color: #94a3b8;
}

body[data-theme="dark"] .external-monitor-linked-host-link {
  color: #93c5fd;
}
body[data-theme="dark"] .external-monitor-detail-header {
  border-color: #334155;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
}

body[data-theme="dark"] .external-monitor-detail-header h4 {
  color: #e2e8f0;
}

body[data-theme="dark"] .external-monitor-panel--collapsible > summary {
  color: #cbd5e1;
}

body[data-theme="dark"] .external-monitor-latency-chart-head .value {
  color: #e2e8f0;
}

body[data-theme="dark"] .external-monitor-history-chart-stat {
  border-color: #334155;
  background: #0f172a;
}

body[data-theme="dark"] .external-monitor-history-chart-stat .value {
  color: #e2e8f0;
}

body[data-theme="dark"] .external-monitor-history-timeline {
  border-color: #334155;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
}

body[data-theme="dark"] .external-monitor-latency-section {
  border-top-color: #334155;
}

body[data-theme="dark"] .external-monitor-latency-cell {
  background: #1e293b;
}

body[data-theme="dark"] .external-monitor-latency-cell--empty {
  background: #0f172a;
}

body[data-theme="dark"] .external-monitor-latency-fill {
  background: #60a5fa;
}

body[data-theme="dark"] .external-monitor-latency-avg-line {
  border-top-color: #38bdf8;
}
