:root {
  --bg: #090909;
  --panel: #111214;
  --panel-soft: #17181c;
  --panel-strong: #1d1f24;
  --line: #2e3138;
  --line-soft: rgba(255, 255, 255, 0.08);
  --text: #f4f4f5;
  --muted: #9da3af;
  --accent: #ff8c1a;
  --accent-soft: #ffb45e;
  --success: #33d17a;
  --danger: #ff5c5c;
  --warning: #ffd166;
  --shadow: 0 16px 42px rgba(0, 0, 0, 0.24);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(255, 140, 26, 0.18), transparent 28%),
    radial-gradient(circle at bottom left, rgba(255, 140, 26, 0.12), transparent 30%),
    linear-gradient(180deg, #050505 0%, #0a0b0d 100%);
  color: var(--text);
  overflow-x: hidden;
}

body.screen-layer-active {
  overflow: hidden;
}

.app-shell {
  position: relative;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 0.9rem;
  bottom: 0.9rem;
  left: 0.9rem;
  z-index: 1060;
  display: flex;
  flex-direction: column;
  width: min(340px, calc(100vw - 1.8rem));
  padding: 1rem;
  background: rgba(12, 12, 14, 0.92);
  border: 1px solid var(--line-soft);
  border-radius: 1.25rem;
  backdrop-filter: blur(18px);
  transform: translateX(calc(-100% - 2rem));
  opacity: 0;
  pointer-events: none;
  transition: transform 0.24s ease, opacity 0.24s ease;
}

.sidebar.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.sidebar-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  padding-right: 0.2rem;
}

.sidebar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.sidebar-header h1 {
  margin: 0;
  font-size: 1.55rem;
}

.sidebar-close {
  flex: 0 0 auto;
}

.sidebar-footer,
.panel-card,
.drawer,
.modal-content,
.summary-card,
.group-card {
  box-shadow: var(--shadow);
}

.sidebar-footer {
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: linear-gradient(180deg, rgba(26, 28, 31, 0.96), rgba(14, 15, 18, 0.98));
}

.section-kicker {
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-soft);
}

.sidebar-section {
  margin-top: 0.35rem;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.sidebar-collapsible {
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: linear-gradient(180deg, rgba(26, 28, 31, 0.9), rgba(14, 15, 18, 0.94));
  overflow: hidden;
}

.sidebar-collapse-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  width: 100%;
  padding: 0.95rem 1rem;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.sidebar-collapse-toggle:hover {
  background: rgba(255, 140, 26, 0.08);
}

.sidebar-collapse-toggle:focus-visible {
  outline: 2px solid rgba(255, 180, 94, 0.6);
  outline-offset: -2px;
}

.sidebar-collapse-title {
  font-size: 0.94rem;
  font-weight: 600;
}

.sidebar-collapse-icon {
  position: relative;
  width: 0.85rem;
  height: 0.85rem;
  flex: 0 0 auto;
  color: var(--accent-soft);
}

.sidebar-collapse-icon::before {
  content: "";
  position: absolute;
  inset: 0.15rem 0.1rem 0.1rem 0.15rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.24s ease;
}

.sidebar-collapse-toggle[aria-expanded="true"] .sidebar-collapse-icon::before {
  transform: rotate(225deg);
}

.sidebar-collapse-body {
  display: grid;
  gap: 0.85rem;
  padding: 0 1rem 1rem;
}

.sidebar-action-list {
  gap: 0.75rem;
}

.sidebar-user-card {
  margin-top: auto;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: linear-gradient(180deg, rgba(26, 28, 31, 0.96), rgba(14, 15, 18, 0.98));
}

.sidebar-user-name {
  font-size: 1rem;
  font-weight: 600;
}

.sidebar-user-role {
  margin-top: 0.2rem;
  color: var(--muted);
  text-transform: capitalize;
}

.sidebar-logout-form {
  margin-top: 0.85rem;
}

.status-user-chip {
  display: inline-flex;
  flex-direction: column;
  min-width: 140px;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.95rem;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.status-user-chip small {
  color: var(--muted);
  text-transform: capitalize;
}

.app-topbar {
  position: sticky;
  top: 1rem;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  backdrop-filter: blur(18px);
}

.app-topbar-main {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.app-topbar h1 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.app-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.menu-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3rem;
  padding: 0.8rem 1rem;
  white-space: nowrap;
}

.menu-toggle-btn.active {
  color: #0c0c0c;
  background: var(--accent-soft);
  border-color: var(--accent-soft);
}

.menu-toggle-icon {
  width: 1rem;
  height: 0.85rem;
  flex: 0 0 auto;
  background:
    linear-gradient(currentColor 0 0) 0 0 / 100% 2px no-repeat,
    linear-gradient(currentColor 0 0) 0 50% / 100% 2px no-repeat,
    linear-gradient(currentColor 0 0) 0 100% / 100% 2px no-repeat;
}

.header-inline-form {
  margin: 0;
}

.events-page-shell {
  max-width: 1320px;
  margin: 0 auto;
}

.nav-link {
  border: 1px solid transparent;
  border-radius: 0.95rem;
  padding: 0.8rem 0.95rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
  border-color: rgba(255, 140, 26, 0.32);
  background: linear-gradient(180deg, rgba(255, 140, 26, 0.16), rgba(255, 140, 26, 0.06));
}

.action-btn {
  width: 100%;
  text-align: left;
  border-radius: 0.95rem;
  padding: 0.85rem 1rem;
}

.btn-orange {
  background: linear-gradient(180deg, var(--accent), #ff7a00);
  color: #151515;
  border: none;
  font-weight: 700;
}

.btn-orange:hover,
.btn-orange:focus {
  color: #0c0c0c;
  background: linear-gradient(180deg, #ff9d3a, var(--accent));
}

.btn-outline-orange {
  border: 1px solid rgba(255, 140, 26, 0.55);
  color: var(--accent-soft);
  background: transparent;
}

.btn-outline-orange:hover,
.btn-outline-orange:focus {
  color: #0c0c0c;
  background: var(--accent-soft);
  border-color: var(--accent-soft);
}

.sidebar-footer {
  margin-top: 0;
}

.metric-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0;
  color: var(--muted);
}

.metric-line strong {
  color: var(--text);
}

.metric-line.danger strong {
  color: var(--danger);
}

.auth-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.auth-shell {
  width: min(460px, calc(100vw - 2rem));
  padding: 1.5rem 0;
}

.auth-card {
  padding: 1.5rem;
}

.auth-card h1 {
  margin: 0 0 0.6rem;
}

.auth-copy {
  margin-bottom: 1.25rem;
}

.auth-form {
  display: grid;
  gap: 1rem;
}

.auth-alert {
  margin-bottom: 1rem;
}

.main-stage {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 1.5rem 1.75rem 2rem;
  transition: padding-right 0.24s ease;
}

body.drawer-active .main-stage {
  padding-right: clamp(24rem, 34vw, 33rem);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.section-header h1,
.section-header h2 {
  margin: 0;
  font-size: 2rem;
}

.section-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.section-actions > * {
  min-width: 0;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.summary-strip-main {
  grid-template-columns: repeat(auto-fit, minmax(180px, 220px));
  align-items: stretch;
}

.summary-card,
.panel-card,
.group-card,
.group-description-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: linear-gradient(180deg, rgba(29, 31, 36, 0.95), rgba(17, 18, 20, 0.98));
}

.summary-card {
  padding: 0.9rem 1rem;
}

.summary-card.compact {
  min-height: 100%;
}

.summary-card::after,
.group-card::after,
.group-description-card::after {
  content: "";
  position: absolute;
  inset: auto -15% -45% auto;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(255, 140, 26, 0.16), transparent 68%);
  pointer-events: none;
}

.summary-label {
  color: var(--muted);
  font-size: 0.84rem;
}

.summary-value {
  margin-top: 0.35rem;
  font-size: 1.55rem;
  font-weight: 700;
}

.summary-value.small {
  font-size: 1.05rem;
  line-height: 1.35;
}

.summary-value.danger {
  color: var(--danger);
}

.summary-value.success {
  color: var(--success);
}

.panel-card {
  padding: 0.95rem 1rem;
}

.system-status-panel {
  margin-bottom: 1rem;
}

.events-filter-panel {
  margin-bottom: 1rem;
}

.events-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.events-filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.7rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.events-list-header {
  margin-bottom: 0.85rem;
}

.system-status-head,
.system-status-footer,
.insight-panel-header,
.diagnostics-head,
.diagnostics-block-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.system-status-head,
.insight-panel-header,
.diagnostics-head,
.diagnostics-block-header {
  margin-bottom: 0.9rem;
}

.system-status-copy {
  max-width: 72ch;
}

.system-status-footer {
  margin-top: 0.35rem;
  flex-wrap: wrap;
}

.system-status-notes {
  display: grid;
  gap: 0.35rem;
}

.system-status-note.issue,
.issue-text {
  color: var(--danger);
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.insight-panel {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.insight-panel > * {
  min-width: 0;
}

.insight-panel h2 {
  margin: 0;
  font-size: 1.35rem;
}

.insight-panel-collapsible {
  gap: 0;
}

.insight-panel-toggle {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.insight-panel-toggle:hover {
  color: var(--text);
}

.insight-panel-toggle:focus-visible {
  outline: 2px solid rgba(255, 180, 94, 0.65);
  outline-offset: 0.35rem;
  border-radius: 0.75rem;
}

.insight-panel-toggle-copy {
  margin-top: 0.35rem;
  max-width: 34rem;
}

.insight-panel-toggle-side {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  flex: 0 0 auto;
  padding-top: 0.25rem;
  color: var(--accent-soft);
}

.insight-panel-toggle-state {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.insight-panel-toggle-state-expanded {
  display: inline-flex;
}

.insight-panel-toggle-state-collapsed,
.insight-panel-toggle.collapsed .insight-panel-toggle-state-expanded {
  display: none;
}

.insight-panel-toggle.collapsed .insight-panel-toggle-state-collapsed {
  display: inline-flex;
}

.insight-panel-toggle-icon {
  position: relative;
  width: 0.9rem;
  height: 0.9rem;
  flex: 0 0 auto;
}

.insight-panel-toggle-icon::before {
  content: "";
  position: absolute;
  inset: 0.14rem 0.12rem 0.12rem 0.14rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(225deg);
  transition: transform 0.18s ease;
}

.insight-panel-toggle.collapsed .insight-panel-toggle-icon::before {
  transform: rotate(45deg);
}

.insight-panel-body {
  display: grid;
  gap: 0.85rem;
  padding-top: 0.95rem;
}

.insight-panel-actions {
  justify-content: flex-end;
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

#eventsFeed {
  flex: 1 1 auto;
  max-height: 26rem;
  overflow-y: auto;
  padding-right: 0.2rem;
}

#hostDiagnosticsPanel {
  flex: 1 1 auto;
  max-height: 26rem;
  overflow-y: auto;
  padding-right: 0.2rem;
}

#hostDiagnosticsPanel > :last-child {
  margin-bottom: 0;
}

.timeline-list.compact {
  gap: 0.55rem;
}

.timeline-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 0.95rem;
  background: rgba(255, 255, 255, 0.025);
}

.timeline-item.issue {
  border-color: rgba(255, 92, 92, 0.2);
  background: linear-gradient(180deg, rgba(46, 20, 20, 0.42), rgba(17, 18, 20, 0.96));
}

.timeline-item.good {
  border-color: rgba(51, 209, 122, 0.2);
  background: linear-gradient(180deg, rgba(20, 41, 29, 0.42), rgba(17, 18, 20, 0.96));
}

.timeline-main {
  min-width: 0;
}

.timeline-topline {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.timeline-title {
  margin-top: 0.35rem;
  font-weight: 700;
}

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.timeline-meta-disabled {
  color: #d9dde4;
}

.timeline-copy {
  margin-top: 0.25rem;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
}

.timeline-time {
  color: var(--muted);
  font-size: 0.9rem;
}

.timeline-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
}

.timeline-badge.issue {
  background: rgba(255, 92, 92, 0.12);
  color: var(--danger);
}

.timeline-badge.good {
  background: rgba(51, 209, 122, 0.12);
  color: var(--success);
}

.timeline-badge.neutral {
  background: rgba(157, 163, 175, 0.16);
  color: #d9dde4;
}

.timeline-freshness {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.timeline-freshness.new {
  background: rgba(255, 180, 94, 0.16);
  color: var(--accent-soft);
}

.timeline-freshness.neutral {
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.diagnostics-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.diagnostics-callout {
  margin-bottom: 0.9rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.95rem;
  background: rgba(255, 255, 255, 0.025);
}

.diagnostics-callout.issue {
  border-color: rgba(255, 92, 92, 0.2);
  background: linear-gradient(180deg, rgba(46, 20, 20, 0.42), rgba(17, 18, 20, 0.96));
}

.diagnostics-callout.warning {
  border-color: rgba(255, 209, 102, 0.2);
  background: linear-gradient(180deg, rgba(54, 40, 16, 0.4), rgba(17, 18, 20, 0.96));
}

.diagnostics-callout.good {
  border-color: rgba(51, 209, 122, 0.2);
  background: linear-gradient(180deg, rgba(20, 41, 29, 0.42), rgba(17, 18, 20, 0.96));
}

.diagnostics-callout-title {
  margin-bottom: 0.3rem;
  font-weight: 700;
}

.diagnostics-callout-text {
  margin-bottom: 0.35rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.diagnostics-block + .diagnostics-block {
  margin-top: 0.9rem;
}

.check-type-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.check-type-card {
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 0.95rem;
  background: rgba(255, 255, 255, 0.025);
}

.check-type-card.issue {
  border-color: rgba(255, 92, 92, 0.2);
  background: linear-gradient(180deg, rgba(46, 20, 20, 0.42), rgba(17, 18, 20, 0.96));
}

.check-type-card.good {
  border-color: rgba(51, 209, 122, 0.2);
  background: linear-gradient(180deg, rgba(20, 41, 29, 0.42), rgba(17, 18, 20, 0.96));
}

.check-type-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.check-type-copy {
  margin-top: 0.5rem;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 0.85rem;
  align-items: start;
  scroll-margin-top: 6.5rem;
}

.workspace-pane {
  padding: 1rem;
}

.groups-pane,
.detail-pane {
  min-height: 100%;
}

.pane-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.15rem;
}

.pane-header h2 {
  margin: 0;
  font-size: 1.35rem;
}

.detail-header {
  margin-bottom: 1rem;
}

.workspace-detail {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
}

.detail-empty {
  min-height: 16rem;
  display: flex;
  align-items: center;
}

.groups-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.group-card {
  cursor: pointer;
  padding: 1.05rem;
  scroll-margin-top: 7rem;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.group-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 140, 26, 0.55);
}

.group-card.active {
  border-color: rgba(255, 140, 26, 0.7);
  background: linear-gradient(180deg, rgba(46, 28, 11, 0.92), rgba(19, 18, 18, 0.98));
}

#groupDetailPanel {
  scroll-margin-top: 7rem;
}

.group-card.navigation-target,
#groupDetailPanel.navigation-target,
.panel-card.panel-target {
  border-color: rgba(255, 180, 94, 0.82);
  box-shadow:
    0 0 0 1px rgba(255, 180, 94, 0.36),
    0 0 0 0.45rem rgba(255, 140, 26, 0.12),
    var(--shadow);
}

.group-card-title {
  margin-bottom: 0.55rem;
  font-size: 1.15rem;
  font-weight: 700;
}

.group-card-meta {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.group-card-description {
  margin-top: 0.8rem;
  overflow: hidden;
  white-space: pre-line;
  word-break: break-word;
  line-height: 1.35;
  max-height: calc(1.35em * 4);
}

.group-host-count {
  font-size: 2rem;
  font-weight: 700;
}

.group-description-card {
  margin-bottom: 1rem;
  padding: 0.95rem 1rem;
  color: var(--muted);
}

.group-detail-description {
  max-height: 14rem;
  overflow-y: auto;
  padding-right: 0.35rem;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
}

.host-panel {
  padding: 1rem;
}

.host-panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.search-box {
  max-width: 460px;
  width: 100%;
}

.filter-pills {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.host-list,
.drawer-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.host-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.9rem;
  align-items: center;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0.95rem;
  background: rgba(255, 255, 255, 0.02);
}

.host-row:hover {
  border-color: rgba(255, 140, 26, 0.24);
  background: rgba(255, 140, 26, 0.045);
}

.host-row.selected {
  border-color: rgba(255, 180, 94, 0.52);
  background: rgba(255, 140, 26, 0.09);
}

.host-row.problem-target {
  border-color: rgba(255, 92, 92, 0.52);
  background: linear-gradient(180deg, rgba(72, 24, 24, 0.32), rgba(255, 140, 26, 0.08));
  box-shadow: 0 0 0 1px rgba(255, 92, 92, 0.18), 0 0 0 10px rgba(255, 92, 92, 0.06);
}

.host-row:focus {
  outline: none;
}

.host-row.disabled {
  border-color: rgba(157, 163, 175, 0.2);
  background: rgba(157, 163, 175, 0.05);
}

.host-title {
  font-weight: 700;
  color: #fff1dd;
  letter-spacing: 0.01em;
}

.host-row.disabled .host-title {
  color: #d9dde4;
}

.host-subtitle,
.muted-text {
  color: var(--muted);
}

.host-description {
  max-height: 6.4rem;
  margin-top: 0.35rem;
  padding-right: 0.35rem;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.host-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.host-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.host-actions .btn,
.section-actions .btn,
.events-filter-actions .btn {
  min-height: 2.625rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-pill.up {
  background: rgba(51, 209, 122, 0.12);
  color: var(--success);
}

.status-pill.down {
  background: rgba(255, 92, 92, 0.12);
  color: var(--danger);
}

.status-pill.unknown {
  background: rgba(157, 163, 175, 0.12);
  color: #c8ccd3;
}

.status-pill.disabled {
  border: 1px solid rgba(157, 163, 175, 0.22);
  background: rgba(157, 163, 175, 0.16);
  color: #d9dde4;
}

.host-actions .btn:disabled {
  opacity: 0.56;
  color: var(--muted);
  border-color: rgba(157, 163, 175, 0.18);
  background: rgba(255, 255, 255, 0.03);
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 5, 8, 0.34);
  backdrop-filter: blur(2px);
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.24s ease, visibility 0.24s ease;
}

.drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  width: clamp(340px, 34vw, 500px);
  max-width: calc(100vw - 2rem);
  padding: 1.2rem;
  transform: translateX(calc(100% + 1.5rem));
  transition: transform 0.24s ease;
  background: linear-gradient(180deg, rgba(19, 20, 23, 0.98), rgba(13, 14, 17, 0.98));
  border: 1px solid rgba(255, 140, 26, 0.24);
  border-radius: 1.25rem;
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}

.drawer-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.drawer-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
  padding: 1rem 0;
}

.drawer-list {
  min-height: 0;
  overflow: auto;
  padding-right: 0.2rem;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.modal-content {
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  background: linear-gradient(180deg, rgba(27, 29, 33, 0.98), rgba(13, 14, 16, 0.99));
}

.modal-header,
.modal-footer {
  border-color: var(--line);
}

.host-monitoring-switch {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.8rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.02);
}

.host-monitoring-switch .form-check-input {
  margin-top: 0;
}

.host-monitoring-switch .form-check-label {
  color: var(--text);
}

.confirm-action-body {
  color: var(--text);
  line-height: 1.5;
}

.confirm-action-consequences {
  margin-top: 0.9rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(255, 209, 102, 0.18);
  border-radius: 0.95rem;
  background: rgba(255, 209, 102, 0.05);
  color: var(--muted);
}

.form-control,
.form-select,
.input-group-text {
  border-radius: 0.8rem;
  border: 1px solid var(--line);
  background: #0d0f11;
  color: var(--text);
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(255, 140, 26, 0.72);
  box-shadow: 0 0 0 0.22rem rgba(255, 140, 26, 0.14);
  background: #101214;
  color: var(--text);
}

.input-group-text {
  color: var(--accent-soft);
}

.empty-state {
  padding: 1.4rem;
  text-align: center;
  color: var(--muted);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 0.95rem;
}

.empty-state.good {
  border-color: rgba(51, 209, 122, 0.18);
  background: rgba(51, 209, 122, 0.04);
}

.empty-state.warning {
  border-color: rgba(255, 209, 102, 0.18);
  background: rgba(255, 209, 102, 0.04);
}

.empty-state-title {
  font-weight: 700;
  color: var(--text);
}

.empty-state-copy {
  margin-top: 0.35rem;
}

.empty-state-actions {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.95rem;
}

.focus-panel {
  padding: 0.95rem 1rem;
}

.focus-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.focus-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.focus-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 0.95rem;
  background: rgba(255, 255, 255, 0.025);
}

.focus-item.issue {
  border-color: rgba(255, 92, 92, 0.2);
  background: linear-gradient(180deg, rgba(46, 20, 20, 0.48), rgba(17, 18, 20, 0.96));
}

.focus-item.good {
  border-color: rgba(51, 209, 122, 0.2);
  background: linear-gradient(180deg, rgba(20, 41, 29, 0.48), rgba(17, 18, 20, 0.96));
}

.focus-item-main {
  min-width: 0;
}

.focus-item-title {
  font-weight: 700;
}

.focus-item-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.panel-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.panel-badge.issue {
  background: rgba(255, 92, 92, 0.12);
  color: var(--danger);
}

.panel-badge.warning {
  background: rgba(255, 209, 102, 0.14);
  color: var(--warning);
}

.panel-badge.good {
  background: rgba(51, 209, 122, 0.12);
  color: var(--success);
}

.panel-badge.neutral {
  background: rgba(157, 163, 175, 0.16);
  color: #d9dde4;
}

.text-danger-strong {
  color: var(--danger);
}

.text-success-strong {
  color: var(--success);
}

@media (max-width: 1200px) {
  .app-shell {
    min-height: 100vh;
  }

  body.drawer-active .main-stage {
    padding-right: 1.75rem;
  }

  .workspace-grid {
    grid-template-columns: 300px minmax(0, 1fr);
  }

  .insight-grid {
    grid-template-columns: 1fr;
  }

  .events-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar {
    width: min(320px, calc(100vw - 1.8rem));
  }
}

@media (max-width: 992px) {
  .app-topbar {
    top: 0.75rem;
    align-items: stretch;
  }

  .app-topbar-actions {
    width: 100%;
  }

  .app-topbar-actions .status-user-chip {
    width: 100%;
    min-width: 0;
  }

  .main-stage {
    padding: 1rem;
  }

  body.drawer-active .main-stage {
    padding-right: 1rem;
  }

  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .diagnostics-summary {
    grid-template-columns: 1fr;
  }

  .check-type-grid {
    grid-template-columns: 1fr;
  }

  .events-filter-grid {
    grid-template-columns: 1fr;
  }

  #eventsFeed,
  #hostDiagnosticsPanel {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .drawer {
    top: 0;
    right: 0;
    bottom: 0;
    width: min(560px, 100vw);
    max-width: 100vw;
    border-radius: 0;
    border-right: none;
    border-bottom: none;
  }

  .drawer-controls,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    top: 0;
    bottom: 0;
    left: 0;
    width: min(360px, 92vw);
    border-radius: 0 1.2rem 1.2rem 0;
  }

  .summary-strip-main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .main-stage {
    padding: 0.85rem 0.85rem 1.25rem;
  }

  .app-topbar {
    top: 0.5rem;
    margin-bottom: 0.85rem;
    padding: 0.9rem;
  }

  .app-topbar-main,
  .section-header,
  .host-panel-toolbar,
  .focus-panel-header,
  .focus-item,
  .pane-header,
  .system-status-head,
  .system-status-footer,
  .insight-panel-header,
  .diagnostics-head,
  .diagnostics-block-header,
  .timeline-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .menu-toggle-btn {
    justify-content: center;
  }

  .host-row {
    grid-template-columns: 1fr;
  }

  .section-actions,
  .host-actions,
  .host-meta,
  .events-filter-actions {
    width: 100%;
  }

  .host-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
  }

  .filter-pills {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .summary-strip,
  .summary-strip-main,
  .events-filter-actions,
  .diagnostics-summary {
    grid-template-columns: 1fr;
  }

  .group-card-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .section-actions .btn,
  .section-actions .header-inline-form,
  .host-actions .btn,
  .filter-pills .btn,
  .events-filter-actions .btn {
    flex: 1 1 calc(50% - 0.35rem);
    width: 100%;
  }

  .header-inline-form {
    display: flex;
  }

  .focus-item .btn,
  .pane-header .section-actions,
  .section-actions,
  .host-actions,
  .host-meta,
  .filter-pills {
    margin-top: 0.75rem;
  }

  .modal-dialog {
    margin: 0.5rem;
  }

  .modal-footer {
    gap: 0.65rem;
    flex-wrap: wrap;
  }

  .modal-footer .btn,
  .modal-footer .btn.me-auto {
    width: 100%;
    margin: 0 !important;
  }

  .drawer {
    padding: 1rem;
  }

  .drawer-header h2 {
    font-size: 1.3rem;
  }

  .sidebar {
    width: min(360px, calc(100vw - 1rem));
  }
}

@media (max-width: 576px) {
  .filter-pills {
    grid-template-columns: 1fr;
  }

  .section-actions .btn,
  .section-actions .header-inline-form,
  .host-actions .btn,
  .events-filter-actions .btn {
    flex-basis: 100%;
  }
}
