/* Scrollable content area */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 40px;
  min-width: 0;
  background: var(--bg-body);
}

/* Dismiss alert */
.dismissAlert { margin-bottom: 20px; }

/* Stat strip */
.statStrip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

/* Stat breakdown with colored dots */
.breakdown {
  display: flex;
  gap: 8px;
  font-size: 12px;
  font-family: var(--font-mono);
}

.bpLive { color: var(--success); display: inline-flex; align-items: center; gap: 3px; }
.bpStale { color: var(--warning); display: inline-flex; align-items: center; gap: 3px; }
.bpDead { color: var(--error); display: inline-flex; align-items: center; gap: 3px; }

.routesSuccess { color: var(--success); }
.routesWarning { color: var(--warning); }
.routesError { color: var(--error); }

/* Application config bar — card styling via sectionStyles.section */
.configBar {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 20px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.configField {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.configLabel {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.configActions {
  display: flex;
  gap: 8px;
  align-self: flex-end;
}

.sectionMeta {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Group cards grid */
.groupGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

.groupGridSingle {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

/* Compact view grid */
.compactGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
  position: relative;
}

/* Group meta row */
.groupMeta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.groupMeta > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.groupMeta strong {
  font-family: var(--font-mono);
  color: var(--text-secondary);
  font-weight: 600;
}

/* Alert banner in group footer */
.alertBanner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--error-bg);
  font-size: 12px;
  color: var(--error);
  font-weight: 500;
}

.alertIcon {
  font-size: 14px;
  flex-shrink: 0;
}

/* Instance fields */
.instanceName {
  font-weight: 600;
  color: var(--text-primary);
}

.inspectLink {
  background: transparent;
  border: none;
  color: var(--text-muted);
  opacity: 0.75;
  cursor: pointer;
  font-size: 13px;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  line-height: 1;
  display: inline-flex;
}

.inspectLink:hover {
  color: var(--text-primary);
  opacity: 1;
}

.instanceMeta {
  color: var(--text-muted);
  white-space: nowrap;
}

.instanceError {
  color: var(--error);
  white-space: nowrap;
}

.instanceHeartbeatStale {
  color: var(--warning);
  font-weight: 600;
  white-space: nowrap;
}

.instanceHeartbeatDead {
  color: var(--error);
  font-weight: 600;
  white-space: nowrap;
}

/* Detail panel content */
.detailContent {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detailRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-family: var(--font-body);
  padding: 4px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.detailLabel {
  color: var(--text-muted);
  font-weight: 500;
}

.detailProgress {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 140px;
}

.chartPanel {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chartTitle {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.emptyChart {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 80px;
  background: var(--bg-raised);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--text-muted);
}

/* Log + Timeline side by side */
.bottomRow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 20px;
}

/* Compact app card */
.compactCard {
  background: color-mix(in srgb, var(--card-accent) 8%, var(--bg-raised));
  border: 1px solid color-mix(in srgb, var(--card-accent) 25%, transparent);
  border-left: 3px solid var(--card-accent);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  cursor: pointer;
  transition: background 150ms ease;
}

.compactCard:hover {
  background: color-mix(in srgb, var(--card-accent) 12%, var(--bg-raised));
}

.compactCardSuccess { --card-accent: var(--success); }
.compactCardWarning { --card-accent: var(--warning); }
.compactCardError   { --card-accent: var(--error); }

.compactCardHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.compactCardName {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.compactCardName:hover {
  text-decoration: underline;
  color: var(--running);
}

.compactCardChevron {
  color: var(--text-muted);
  flex-shrink: 0;
}

.compactCardMeta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
}

.compactCardLive {
  font-weight: 600;
  color: var(--card-accent);
}

.compactCardTps {
  font-family: var(--font-mono);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.compactCardCpu {
  font-family: var(--font-mono);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.compactCardHeartbeat {
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.compactCardHeartbeatWarn {
  color: var(--card-accent);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* Wrapper for each compact grid cell — anchor for overlay */
.compactGridCell {
  position: relative;
}

/* Expanded card overlay — floats from the clicked card */
.compactGridExpanded {
  position: absolute;
  z-index: 100;
  top: 0;
  left: 0;
  min-width: 500px;
  filter: drop-shadow(0 8px 32px rgba(0, 0, 0, 0.3));
}

/* Click-outside backdrop for expanded overlay */
.overlayBackdrop {
  position: fixed;
  inset: 0;
  z-index: 99;
}

/* Expand/collapse animation wrapper */
.expandWrapper {
  overflow: hidden;
  transition: opacity 200ms ease, transform 200ms ease;
}

.expandWrapperCollapsed {
  opacity: 0;
  transform: scaleY(0.95);
  transform-origin: top;
}

.expandWrapperExpanded {
  opacity: 1;
  transform: scaleY(1);
  transform-origin: top;
}

/* View toolbar — between stat strip and cards grid */
.viewToolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

/* App name filter — matches sidebar search input styling */
.appFilterWrap {
  position: relative;
  display: flex;
  align-items: center;
}

.appFilterIcon {
  position: absolute;
  left: 8px;
  color: var(--text-muted);
  pointer-events: none;
}

.appFilterInput {
  width: 180px;
  height: 29px;
  padding: 6px 26px 6px 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  font-size: 12px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 150ms ease;
}

.appFilterInput::placeholder {
  color: var(--text-muted);
}

.appFilterInput:focus {
  border-color: var(--running);
}

.appFilterClear {
  position: absolute;
  right: 6px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 2px;
}

.appFilterClear:hover {
  color: var(--text-primary);
}

/* Sort buttons */
.sortGroup {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.sortBtn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease;
  white-space: nowrap;
}

.sortBtn:hover {
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.sortBtnActive {
  color: var(--text-primary);
  border-color: var(--border-subtle);
  background: var(--bg-raised);
  font-weight: 600;
}

/* View mode toggle */
.viewToggle {
  display: flex;
  align-items: center;
  gap: 4px;
}

.viewToggleBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.viewToggleBtn:hover {
  color: var(--text-primary);
}

.viewToggleBtnActive {
  background: var(--running);
  border-color: var(--running);
  color: #fff;
}

/* Collapse button in expanded GroupCard header */
.collapseBtn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}

.collapseBtn:hover {
  color: var(--text-primary);
}

