/* Tokyonight Dark Theme */
:root {
  --bg: #1a1b26;
  --bg-dark: #16161e;
  --bg-highlight: #292e42;
  --bg-surface: #24283b;
  --fg: #c0caf5;
  --fg-dark: #a9b1d6;
  --fg-gutter: #3b4261;
  --comment: #565f89;
  --blue: #7aa2f7;
  --cyan: #7dcfff;
  --green: #9ece6a;
  --magenta: #bb9af7;
  --red: #f7768e;
  --orange: #ff9e64;
  --yellow: #e0af68;
  --teal: #1abc9c;
  --border: #292e42;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

.clickable { cursor: pointer; }
.clickable:hover { opacity: 0.85; }
.stat-card.clickable:hover { border-color: var(--blue); }
.dist-item.clickable:hover { background: var(--bg-highlight); }
.role-tag.clickable:hover { background: var(--blue); color: var(--bg); }
td .clickable:hover { text-decoration: underline; }

body {
  font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  background: var(--bg);
  color: var(--fg);
  height: 100vh;
  overflow: hidden;
}

/* Layout */
.app {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: 220px;
  background: var(--bg-dark);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-header h1 {
  font-size: 14px;
  color: var(--blue);
  font-weight: 600;
}

.sidebar-header .subtitle {
  font-size: 11px;
  color: var(--comment);
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--fg-dark);
  text-decoration: none;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.nav-item:hover {
  background: var(--bg-highlight);
  color: var(--fg);
}

.nav-item.active {
  background: var(--bg-highlight);
  color: var(--blue);
}

.nav-item .icon {
  width: 18px;
  text-align: center;
  font-size: 15px;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--comment);
}

/* Main content */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border);
  gap: 16px;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 12px;
  flex: 1;
  max-width: 400px;
}

.search-box input {
  background: none;
  border: none;
  color: var(--fg);
  font-family: inherit;
  font-size: 13px;
  width: 100%;
  outline: none;
}

.search-box input::placeholder { color: var(--comment); }

.content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* Cards */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
}

/* Dashboard */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--blue);
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--comment);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card.critical .stat-value { color: var(--red); }
.stat-card.warning .stat-value { color: var(--orange); }
.stat-card.success .stat-value { color: var(--green); }

/* Distribution bars */
.dist-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.dist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.dist-label { font-size: 13px; color: var(--fg-dark); }
.dist-count { font-size: 13px; font-weight: 600; color: var(--blue); }

/* Machine table */
.machine-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.machine-table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--comment);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-surface);
}

.machine-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.machine-table tr {
  cursor: pointer;
  transition: background 0.1s;
}

.machine-table tbody tr:hover {
  background: var(--bg-highlight);
}

.hostname {
  font-weight: 600;
  color: var(--cyan);
}

/* Status dot */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.status-dot.online { background: var(--green); }
.status-dot.offline { background: var(--red); }

/* Risk badge */
.risk-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.risk-badge.critical { background: rgba(247,118,142,0.2); color: var(--red); }
.risk-badge.high { background: rgba(255,158,100,0.2); color: var(--orange); }
.risk-badge.medium { background: rgba(224,175,104,0.2); color: var(--yellow); }
.risk-badge.low { background: rgba(158,206,106,0.2); color: var(--green); }

/* Role tag */
.role-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  background: var(--bg-highlight);
  color: var(--fg-dark);
}

/* Disk bar */
.disk-bar-container {
  width: 80px;
  height: 6px;
  background: var(--bg-highlight);
  border-radius: 3px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
}

.disk-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
}

.disk-bar.low { background: var(--green); }
.disk-bar.medium { background: var(--yellow); }
.disk-bar.high { background: var(--orange); }
.disk-bar.critical { background: var(--red); }

/* Machine Detail */
.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.detail-header h2 {
  font-size: 20px;
  color: var(--cyan);
}

.back-btn {
  background: var(--bg-highlight);
  border: 1px solid var(--border);
  color: var(--fg-dark);
  padding: 6px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
}

.back-btn:hover { background: var(--bg-surface); color: var(--fg); }

.detail-actions {
  display: flex;
  gap: 8px;
}

.btn {
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary {
  background: var(--blue);
  color: var(--bg-dark);
  border-color: var(--blue);
  font-weight: 600;
}

.btn-primary:hover { opacity: 0.85; }

.btn-secondary {
  background: var(--bg-highlight);
  color: var(--fg-dark);
}

.btn-secondary:hover { background: var(--bg-surface); color: var(--fg); }

.btn-claude {
  background: var(--magenta);
  color: var(--bg-dark);
  border-color: var(--magenta);
  font-weight: 600;
}

.btn-claude:hover { opacity: 0.85; }

/* Info grid */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

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

.info-label {
  font-size: 11px;
  color: var(--comment);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-value {
  font-size: 13px;
  color: var(--fg);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.tab {
  padding: 10px 20px;
  font-size: 13px;
  color: var(--comment);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
}

.tab:hover { color: var(--fg-dark); }
.tab.active { color: var(--blue); border-bottom-color: var(--blue); }

/* Issues — shared bullet */
.issues-bullet {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}
.issues-bullet.critical { background: var(--red); box-shadow: 0 0 6px var(--red); }
.issues-bullet.high     { background: var(--orange); box-shadow: 0 0 6px var(--orange); }
.issues-bullet.medium   { background: var(--yellow); }
.issues-bullet.low      { background: var(--green); }

/* Dashboard — critical issues panel */
.issues-panel {
  background: var(--bg-surface);
  border: 1px solid var(--red);
  border-left: 4px solid var(--red);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}
.issues-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: rgba(247,118,142,0.08);
  border-bottom: 1px solid rgba(247,118,142,0.15);
}
.issues-panel-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--red);
  color: var(--bg);
  font-weight: 800;
  font-size: 16px;
}
.issues-panel-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.issues-machine {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.issues-machine:last-child { border-bottom: none; }
.issues-machine:hover { background: rgba(247,118,142,0.04); }
.issues-machine-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.issues-machine-header .hostname { font-weight: 600; }
.issues-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 14px;
}
.issues-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--fg-dark);
  line-height: 1.5;
}

/* Machine table — inline issues row */
tr.issues-row > td {
  padding: 0 12px 10px 12px !important;
  border-top: none !important;
  background: transparent;
}
tr.issues-row.critical > td { background: rgba(247,118,142,0.04); }
tr.issues-row.high > td    { background: rgba(255,158,100,0.04); }
tr.has-issues > td { border-bottom: none !important; }
.issues-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding-left: 14px;
}
.issues-inline-item {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 11px;
  color: var(--fg-dark);
  line-height: 1.6;
}

/* Machine detail — issues alert box */
.issues-detail-panel {
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}
.issues-detail-panel.critical {
  background: rgba(247,118,142,0.06);
  border: 1px solid var(--red);
  border-left: 5px solid var(--red);
}
.issues-detail-panel.high {
  background: rgba(255,158,100,0.06);
  border: 1px solid var(--orange);
  border-left: 5px solid var(--orange);
}
.issues-detail-panel.medium {
  background: rgba(224,175,104,0.06);
  border: 1px solid var(--yellow);
  border-left: 5px solid var(--yellow);
}
.issues-detail-panel.low {
  background: rgba(158,206,106,0.06);
  border: 1px solid var(--green);
  border-left: 5px solid var(--green);
}
.issues-detail-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
}
.issues-detail-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 14px;
  color: var(--bg);
  flex-shrink: 0;
}
.issues-detail-icon.critical { background: var(--red); }
.issues-detail-icon.high     { background: var(--orange); }
.issues-detail-icon.medium   { background: var(--yellow); }
.issues-detail-icon.low      { background: var(--green); }
.issues-detail-title {
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.issues-detail-panel.critical .issues-detail-title { color: var(--red); }
.issues-detail-panel.high .issues-detail-title     { color: var(--orange); }
.issues-detail-panel.medium .issues-detail-title   { color: var(--yellow); }
.issues-detail-panel.low .issues-detail-title      { color: var(--green); }
.issues-detail-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 16px;
  font-size: 13px;
  line-height: 1.5;
}
.issues-detail-line:last-child { padding-bottom: 14px; }

/* Old issue-item (keep for compat) */
.issue-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  font-size: 13px;
}
.issue-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
  margin-top: 6px;
  flex-shrink: 0;
}

/* Services list */
.service-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius);
  font-size: 12px;
  margin: 2px;
  background: var(--bg-highlight);
  color: var(--fg-dark);
}

.service-badge.active {
  background: rgba(158,206,106,0.15);
  color: var(--green);
}

/* Game server cards */
.gs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.gs-card {
  background: var(--bg-highlight);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

.gs-card .gs-name {
  font-weight: 600;
  color: var(--cyan);
  margin-bottom: 6px;
}

.gs-card .gs-meta {
  font-size: 12px;
  color: var(--comment);
}

.gs-card .gs-prod {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.gs-card .gs-prod.prod { background: rgba(158,206,106,0.2); color: var(--green); }
.gs-card .gs-prod.dev { background: rgba(122,162,247,0.2); color: var(--blue); }

/* Audit Summary Card */
.audit-summary {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 16px;
}

.audit-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.audit-summary-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.audit-summary-title .hostname {
  font-size: 16px;
  font-weight: 700;
}

.audit-summary-os {
  font-size: 12px;
  color: var(--fg-dark);
}

.audit-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 20px;
  margin-bottom: 10px;
}

.audit-summary-section {
  padding: 6px 0;
}

.audit-summary-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--comment);
  margin-bottom: 3px;
}

.audit-summary-value {
  font-size: 13px;
  color: var(--fg);
  line-height: 1.5;
}

.audit-services {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.audit-summary-issues {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.audit-summary-issue {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--fg-dark);
  padding: 3px 0;
  line-height: 1.5;
}

.audit-summary-warnings {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.audit-summary-warning {
  font-size: 12px;
  color: var(--yellow);
  padding: 2px 0;
  line-height: 1.5;
}

.audit-summary-warning::before {
  content: '\26A0  ';
}

/* Audit toggle */
.audit-toggle {
  font-size: 12px !important;
}

.audit-toggle.expanded + span + #audit-raw,
.audit-toggle.expanded ~ #audit-raw {
  /* handled by class toggle on #audit-raw */
}

#audit-raw.collapsed {
  display: none;
}

/* Audit text */
.audit-text {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-x: auto;
  max-height: 600px;
  overflow-y: auto;
  color: var(--fg-dark);
}

/* Notes */
.note-card {
  background: var(--bg-highlight);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 8px;
}

.note-meta {
  font-size: 11px;
  color: var(--comment);
  margin-bottom: 6px;
}

.note-content {
  font-size: 13px;
  white-space: pre-wrap;
}

.note-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.note-form textarea {
  width: 100%;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--fg);
  padding: 10px;
  font-family: inherit;
  font-size: 13px;
  min-height: 80px;
  resize: vertical;
  outline: none;
}

.note-form textarea:focus {
  border-color: var(--blue);
}

/* Ports table */
.ports-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.ports-table th {
  text-align: left;
  padding: 8px;
  color: var(--comment);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.ports-table td {
  padding: 8px;
  border-bottom: 1px solid var(--border);
}

/* Terminal Panel */
.terminal-panel {
  position: fixed;
  bottom: 0;
  left: 220px;
  right: 0;
  background: var(--bg-dark);
  border-top: 2px solid var(--blue);
  z-index: 100;
  display: none;
  flex-direction: column;
}

.terminal-panel.open {
  display: flex;
  height: 45vh;
}

.terminal-panel.maximized {
  height: calc(100vh - 48px);
}

.terminal-tabs {
  display: flex;
  align-items: center;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border);
  padding: 0 8px;
  min-height: 36px;
  gap: 2px;
  overflow-x: auto;
}

.terminal-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--comment);
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  white-space: nowrap;
  background: none;
  border: none;
  font-family: inherit;
}

.terminal-tab:hover { color: var(--fg-dark); background: var(--bg-highlight); }
.terminal-tab.active { color: var(--fg); background: var(--bg-surface); }

.terminal-tab .close-tab {
  font-size: 14px;
  opacity: 0.5;
  cursor: pointer;
  padding: 0 2px;
}

.terminal-tab .close-tab:hover { opacity: 1; color: var(--red); }

.terminal-controls {
  display: flex;
  gap: 4px;
  margin-left: auto;
  align-items: center;
  padding: 0 8px;
}

.terminal-controls button {
  background: none;
  border: none;
  color: var(--comment);
  cursor: pointer;
  font-size: 14px;
  padding: 4px 6px;
}

.terminal-controls button:hover { color: var(--fg); }

.terminal-body {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.terminal-container {
  position: absolute;
  inset: 0;
  display: none;
}

.terminal-container.active {
  display: block;
}

/* Filter bar */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-select {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--fg);
  padding: 6px 10px;
  font-family: inherit;
  font-size: 12px;
  outline: none;
}

.filter-select:focus { border-color: var(--blue); }
.filter-select option { background: var(--bg-surface); }

.machine-count {
  font-size: 12px;
  color: var(--comment);
  margin-left: auto;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--fg-gutter); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--comment); }

/* Loading */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--comment);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 10px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--comment);
}

/* Quick access grid */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.quick-card {
  background: var(--bg-highlight);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.quick-card:hover {
  border-color: var(--blue);
  background: var(--bg-surface);
}

.quick-card .qc-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--cyan);
  margin-bottom: 4px;
}

.quick-card .qc-ip {
  font-size: 11px;
  color: var(--comment);
}

.quick-card .qc-risk {
  margin-top: 4px;
}

/* Responsive adjustments when terminal is open */
.content.terminal-open {
  padding-bottom: 45vh;
}

/* ============================================
   TASK MANAGER
   ============================================ */

.tasks-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.task-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.task-stat {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  text-align: center;
  transition: border-color 0.2s;
}
.task-stat.active { border-color: var(--blue); }
.task-stat.in-progress { border-left: 3px solid var(--cyan); }
.task-stat.done { border-left: 3px solid var(--green); }
.task-stat-value { display: block; font-size: 22px; font-weight: 700; color: var(--fg); }
.task-stat-label { font-size: 11px; color: var(--comment); text-transform: uppercase; }

.task-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-card {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
}
.task-card:hover { border-color: var(--fg-gutter); }
.task-card.done { opacity: 0.6; }
.task-card.cancelled { opacity: 0.4; }

.task-card-priority {
  width: 4px;
  flex-shrink: 0;
}

.task-card-body {
  flex: 1;
  padding: 12px 16px;
  min-width: 0;
}

.task-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.task-card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.task-card-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--fg);
}

.task-status-icon {
  font-size: 14px;
  flex-shrink: 0;
}
.task-status-icon.pending { color: var(--comment); }
.task-status-icon.in-progress { color: var(--cyan); }
.task-status-icon.done { color: var(--green); }
.task-status-icon.cancelled { color: var(--red); }

.task-card-badges {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.task-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}
.task-badge.priority.critical { background: rgba(247,118,142,0.2); color: var(--red); }
.task-badge.priority.high { background: rgba(255,158,100,0.2); color: var(--orange); }
.task-badge.priority.medium { background: rgba(224,175,104,0.2); color: var(--yellow); }
.task-badge.priority.low { background: rgba(158,206,106,0.2); color: var(--green); }
.task-badge.category { background: rgba(122,162,247,0.15); color: var(--blue); }
.task-badge.machine { background: rgba(187,154,247,0.15); color: var(--magenta); }
.task-badge.global { background: rgba(86,95,137,0.3); color: var(--comment); }

.task-card-desc {
  font-size: 12px;
  color: var(--fg-dark);
  margin-top: 6px;
  line-height: 1.5;
  max-height: 40px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

.task-card-date {
  font-size: 11px;
  color: var(--comment);
}

.task-card-actions {
  display: flex;
  gap: 4px;
}

.btn-sm {
  font-size: 11px !important;
  padding: 3px 8px !important;
}

.btn-claude {
  background: var(--magenta);
  color: var(--bg);
  border: none;
  border-radius: var(--radius);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.btn-claude:hover { opacity: 0.9; }

/* ============================================
   MODALS
   ============================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(2px);
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 90%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; color: var(--fg); }
.modal-subtitle { font-size: 12px; color: var(--comment); }
.modal-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--comment);
  font-size: 20px;
  cursor: pointer;
}
.modal-close:hover { color: var(--fg); }

.modal-body { padding: 20px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.form-group { margin-bottom: 14px; }
.form-group label, .form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-dark);
  margin-bottom: 4px;
}
.form-input {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--fg);
  font-family: inherit;
  font-size: 13px;
}
.form-input:focus { border-color: var(--blue); outline: none; }
textarea.form-input { resize: vertical; }

.form-row {
  display: flex;
  gap: 12px;
}
.form-row .form-group { flex: 1; }

/* ============================================
   CLAUDE LAUNCH DIALOG
   ============================================ */

.claude-launch-modal { max-width: 500px; }
.claude-launch-section {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.claude-launch-section:last-child { border-bottom: none; padding-bottom: 0; }

.claude-launch-option {
  padding: 8px;
  border-radius: 6px;
  margin-bottom: 4px;
}
.claude-launch-option:hover { background: var(--bg-highlight); }

.claude-radio-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}
.claude-radio-label input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--blue);
}
.claude-radio-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.claude-radio-text strong { font-size: 13px; color: var(--fg); }
.claude-radio-text small { font-size: 11px; color: var(--comment); }

/* ============================================
   OPERATOR PANEL (right side of terminal)
   ============================================ */

.operator-panel {
  position: fixed;
  right: 0;
  bottom: 0;
  width: 280px;
  height: 45vh;
  background: var(--bg-dark);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  z-index: 1001;
  display: none;
  overflow-y: auto;
  font-size: 12px;
}
.operator-panel.open { display: block; }

/* When operator panel is open, adjust terminal body width */
body:has(.operator-panel.open) .terminal-body {
  margin-right: 280px;
}

.op-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  position: sticky;
  top: 0;
  z-index: 1;
}
.op-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--fg);
}
.op-close {
  background: none;
  border: none;
  color: var(--comment);
  font-size: 16px;
  cursor: pointer;
}
.op-close:hover { color: var(--fg); }

.op-section {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.op-section-title {
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--comment);
  margin-bottom: 6px;
}
.op-section-title.op-warning { color: var(--orange); }

.op-info {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  color: var(--fg-dark);
  font-size: 11px;
}

.op-issue {
  font-size: 11px;
  color: var(--orange);
  padding: 2px 0;
  line-height: 1.4;
}

.op-task {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  font-size: 11px;
}
.op-task-status { flex-shrink: 0; }
.op-task-status.pending { color: var(--comment); }
.op-task-status.in_progress { color: var(--cyan); }
.op-task-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fg-dark);
}

.op-action {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 3px 0;
  font-size: 10px;
}
.op-action-type {
  color: var(--blue);
  font-weight: 600;
}
.op-action-text {
  color: var(--fg-dark);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.op-action-time {
  color: var(--comment);
  font-size: 9px;
}

.op-session {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  font-size: 10px;
}
.op-session-type {
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 9px;
  text-transform: uppercase;
}
.op-session-type.ssh { background: rgba(158,206,106,0.2); color: var(--green); }
.op-session-type.claude { background: rgba(187,154,247,0.2); color: var(--magenta); }
.op-session-time { color: var(--comment); flex: 1; }
.op-session-status { color: var(--comment); }

.op-empty {
  font-size: 11px;
  color: var(--comment);
  font-style: italic;
  padding: 4px 0;
}

/* ============================================
   TASK TREE VIEW
   ============================================ */

.view-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-left: 12px;
}
.view-toggle-btn {
  padding: 5px 14px;
  font-size: 12px;
  font-family: inherit;
  background: var(--bg-surface);
  color: var(--comment);
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}
.view-toggle-btn:not(:last-child) {
  border-right: 1px solid var(--border);
}
.view-toggle-btn.active {
  background: var(--blue);
  color: var(--bg-dark);
  font-weight: 600;
}
.view-toggle-btn:hover:not(.active) {
  background: var(--bg-highlight);
  color: var(--fg-dark);
}

.task-tree {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-tree-group {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
}
.task-tree-group:hover {
  border-color: var(--fg-gutter);
}

.task-tree-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-highlight);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.task-tree-header:hover {
  background: var(--bg-surface);
}

.task-tree-toggle {
  font-size: 10px;
  color: var(--comment);
  transition: transform 0.2s;
  flex-shrink: 0;
  width: 16px;
  text-align: center;
}
.task-tree-group.collapsed .task-tree-toggle {
  transform: rotate(-90deg);
}

.task-tree-hostname {
  font-weight: 700;
  font-size: 14px;
  color: var(--cyan);
  flex: 1;
}
.task-tree-hostname.infra {
  color: var(--comment);
  font-style: italic;
}

.task-tree-summary {
  font-size: 11px;
  color: var(--fg-dark);
  display: flex;
  gap: 8px;
  align-items: center;
}
.task-tree-summary .count {
  color: var(--fg);
  font-weight: 600;
}
.task-tree-summary .critical-count {
  color: var(--red);
  font-weight: 700;
}
.task-tree-summary .high-count {
  color: var(--orange);
  font-weight: 600;
}

.task-tree-header-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.task-tree-tasks {
  border-top: 1px solid var(--border);
}
.task-tree-group.collapsed .task-tree-tasks {
  display: none;
}

.task-tree-node {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 42px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
  position: relative;
}
.task-tree-node:last-child {
  border-bottom: none;
}
.task-tree-node:hover {
  background: rgba(122,162,247,0.04);
}
.task-tree-node.done,
.task-tree-node.cancelled {
  opacity: 0.5;
}

.task-tree-checkbox {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
  cursor: pointer;
}

.task-tree-priority-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.task-tree-priority-dot.critical { background: var(--red); box-shadow: 0 0 6px var(--red); }
.task-tree-priority-dot.high { background: var(--orange); }
.task-tree-priority-dot.medium { background: var(--yellow); }
.task-tree-priority-dot.low { background: var(--green); }

.task-tree-node-title {
  flex: 1;
  font-size: 13px;
  color: var(--fg);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-tree-node-badges {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.task-tree-node-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* Dependency connector line */
.task-tree-node.has-dependency::before {
  content: '';
  position: absolute;
  left: 52px;
  top: -1px;
  width: 1px;
  height: 12px;
  background: var(--comment);
  opacity: 0.4;
}
.task-tree-node.has-dependency::after {
  content: '\2514';
  position: absolute;
  left: 48px;
  top: -2px;
  font-size: 12px;
  color: var(--comment);
  opacity: 0.4;
  line-height: 1;
}

/* Floating "Run Selected" bar */
.task-tree-selection-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-surface);
  border: 1px solid var(--blue);
  border-radius: 12px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  z-index: 500;
  animation: slideUp 0.2s ease-out;
}
.task-tree-selection-bar.hidden {
  display: none;
}
.task-tree-selection-count {
  font-size: 13px;
  color: var(--fg);
  font-weight: 600;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Adjust selection bar position when terminal is open */
.content.terminal-open .task-tree-selection-bar {
  bottom: calc(45vh + 20px);
}

/* ============================================
   AUTH PAGES
   ============================================ */

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}

.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  width: 360px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.4);
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-header h1 {
  font-size: 18px;
  color: var(--blue);
  font-weight: 700;
  letter-spacing: 2px;
}

.auth-subtitle {
  font-size: 12px;
  color: var(--comment);
  margin-top: 4px;
}

.auth-field {
  margin-bottom: 16px;
}

.auth-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-dark);
  margin-bottom: 4px;
}

.auth-field input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--fg);
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

.auth-field input:focus {
  border-color: var(--blue);
}

.auth-error {
  background: rgba(247,118,142,0.1);
  border: 1px solid rgba(247,118,142,0.3);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--red);
  margin-bottom: 16px;
}

.auth-btn {
  width: 100%;
  padding: 10px;
  background: var(--blue);
  color: var(--bg-dark);
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.auth-btn:hover { opacity: 0.85; }
.auth-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============================================
   SIDEBAR USER & NAV BADGES
   ============================================ */

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.sidebar-user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg);
}

.sidebar-logout {
  background: none;
  border: none;
  color: var(--comment);
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  padding: 0;
}

.sidebar-logout:hover {
  color: var(--red);
}

.nav-badge {
  display: inline-block;
  background: var(--red);
  color: var(--bg);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 4px;
  min-width: 16px;
  text-align: center;
}

/* ============================================
   ROLE BADGES
   ============================================ */

.user-role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.user-role-badge.role-monitor { background: rgba(122,162,247,0.2); color: var(--blue); }
.user-role-badge.role-operator { background: rgba(125,207,255,0.2); color: var(--cyan); }
.user-role-badge.role-admin { background: rgba(187,154,247,0.2); color: var(--magenta); }
.user-role-badge.role-superadmin { background: rgba(247,118,142,0.2); color: var(--red); }

/* ============================================
   APPROVAL CARDS
   ============================================ */

.approval-queue {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.approval-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color 0.2s;
}

.approval-card.risk-critical { border-left: 4px solid var(--red); }
.approval-card.risk-high { border-left: 4px solid var(--orange); }
.approval-card.risk-low { border-left: 4px solid var(--green); }

.approval-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.approval-card-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--fg);
  margin-left: 8px;
}

.approval-card-meta {
  font-size: 11px;
  color: var(--comment);
  white-space: nowrap;
}

.approval-card-desc {
  font-size: 12px;
  color: var(--fg-dark);
  margin-bottom: 10px;
  line-height: 1.5;
}

.approval-card-plan {
  margin-bottom: 12px;
}

.approval-plan-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--comment);
  margin-bottom: 4px;
}

.approval-plan-code {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-x: auto;
  max-height: 300px;
  overflow-y: auto;
  color: var(--fg-dark);
}

.approval-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.approval-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.approval-status.pending { background: rgba(224,175,104,0.2); color: var(--yellow); }
.approval-status.approved { background: rgba(158,206,106,0.2); color: var(--green); }
.approval-status.rejected { background: rgba(247,118,142,0.2); color: var(--red); }

/* ============================================
   TASK STATUS ICONS (new statuses)
   ============================================ */

.task-status-icon.pending-approval { color: var(--yellow); }
.task-status-icon.approved { color: var(--green); }

.task-card.pending_approval { border-left: 3px solid var(--yellow); }
.task-card.approved { border-left: 3px solid var(--green); }

/* ============================================
   Cloud / vSphere / Optimizer Styles
   ============================================ */

/* Tab buttons */
.cloud-tabs {
  display: flex;
  gap: 4px;
}

.tab-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--fg-dark);
  padding: 8px 16px;
  border-radius: var(--radius) var(--radius) 0 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  transition: all 0.15s;
}

.tab-btn:hover {
  background: var(--bg-highlight);
  color: var(--fg);
}

.tab-btn.active {
  background: var(--bg-highlight);
  color: var(--blue);
  border-bottom-color: var(--bg-highlight);
}

/* Power badges */
.power-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.power-badge.on {
  background: rgba(158, 206, 106, 0.15);
  color: var(--green);
}

.power-badge.off {
  background: rgba(247, 118, 142, 0.15);
  color: var(--red);
}

/* VM action buttons */
.vm-actions {
  display: flex;
  gap: 4px;
}

.vm-btn {
  background: var(--bg-highlight);
  border: 1px solid var(--border);
  color: var(--fg-dark);
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.vm-btn:hover {
  background: var(--blue);
  color: var(--bg);
  border-color: var(--blue);
}

.vm-btn.on:hover {
  background: var(--green);
  border-color: var(--green);
}

.vm-btn.off:hover {
  background: var(--red);
  border-color: var(--red);
}

/* vSphere status */
.vsphere-status {
  font-size: 12px;
  font-weight: 500;
}

.vsphere-status.green { color: var(--green); }
.vsphere-status.yellow { color: var(--yellow); }
.vsphere-status.red { color: var(--red); }
.vsphere-status.gray { color: var(--comment); }

/* Capacity bars */
.capacity-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-highlight);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 2px;
}

.capacity-fill {
  height: 100%;
  background: var(--green);
  border-radius: 4px;
  transition: width 0.3s;
}

.capacity-fill.med { background: var(--yellow); }
.capacity-fill.high { background: var(--red); }

.capacity-label {
  font-size: 11px;
  color: var(--comment);
}

/* Sync status items */
.sync-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.sync-source {
  color: var(--fg-dark);
  font-weight: 500;
}

.sync-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.sync-badge.ok {
  background: rgba(158, 206, 106, 0.15);
  color: var(--green);
}

.sync-badge.error {
  background: rgba(247, 118, 142, 0.15);
  color: var(--red);
}

.sync-time {
  color: var(--comment);
  font-size: 11px;
}

/* Recommendation cards */
.rec-grid {
  display: grid;
  gap: 12px;
}

.rec-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color 0.15s;
}

.rec-card:hover {
  border-color: var(--fg-gutter);
}

.rec-card.resolved {
  opacity: 0.5;
}

.rec-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.rec-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 6px;
}

.rec-desc {
  font-size: 13px;
  color: var(--fg-dark);
  line-height: 1.5;
  margin-bottom: 10px;
}

.rec-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--comment);
  margin-bottom: 8px;
}

.rec-actions {
  margin-top: 8px;
}

.rec-status-select {
  background: var(--bg-highlight);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 4px 8px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}

/* Priority badges */
.priority-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.priority-badge.high {
  background: rgba(247, 118, 142, 0.15);
  color: var(--red);
}

.priority-badge.medium {
  background: rgba(224, 175, 104, 0.15);
  color: var(--yellow);
}

.priority-badge.low {
  background: rgba(158, 206, 106, 0.15);
  color: var(--green);
}

/* Rec status badges */
.rec-status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

.rec-status-badge.new { color: var(--blue); }
.rec-status-badge.acknowledged { color: var(--cyan); }
.rec-status-badge.in_progress { color: var(--yellow); }
.rec-status-badge.done { color: var(--green); }
.rec-status-badge.dismissed { color: var(--comment); }

/* Effort badges */
.effort-badge {
  font-weight: 600;
}

.effort-badge.low { color: var(--green); }
.effort-badge.medium { color: var(--yellow); }
.effort-badge.high { color: var(--red); }

/* ===== Security Section ===== */
.sec-type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-highlight);
  color: var(--fg-dark);
}

/* ===== Firewall Section ===== */
.fw-status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.fw-status-badge.active { background: rgba(158,206,106,0.15); color: var(--green); }
.fw-status-badge.permissive { background: rgba(224,175,104,0.15); color: var(--yellow); }
.fw-status-badge.none { background: rgba(247,118,142,0.15); color: var(--red); }
.fw-status-badge.unknown { background: var(--bg-highlight); color: var(--comment); }

.fw-rules-code {
  background: var(--bg-dark);
  color: var(--fg-dark);
  padding: 12px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 11px;
  line-height: 1.5;
  max-height: 400px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  border: 1px solid var(--border);
}

/* ===== Toast Notifications ===== */
.toast {
  padding: 12px 20px;
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--fg);
  font-size: 13px;
  line-height: 1.4;
  min-width: 280px;
  max-width: 420px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  border-left: 4px solid var(--blue);
  transition: opacity 0.3s, transform 0.3s;
  animation: toast-slide-in 0.3s ease;
}
.toast-critical { border-left-color: var(--red); }
.toast-warning { border-left-color: var(--yellow); }
.toast-info { border-left-color: var(--blue); }

@keyframes toast-slide-in {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

/* ===== Platform Intelligence ===== */
.platform-overall {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}
.platform-overall-healthy { background: rgba(158,206,106,0.15); color: var(--green); }
.platform-overall-degraded { background: rgba(224,175,104,0.15); color: var(--yellow); }
.platform-overall-critical { background: rgba(247,118,142,0.15); color: var(--red); }

.svc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  padding: 12px;
}

.svc-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.svc-card:hover { border-color: var(--blue); }

.svc-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.svc-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
}

.svc-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.svc-healthy { background: var(--green); box-shadow: 0 0 6px var(--green); }
.svc-degraded { background: var(--yellow); box-shadow: 0 0 6px var(--yellow); }
.svc-down { background: var(--red); box-shadow: 0 0 6px var(--red); animation: pulse-dot 1.5s infinite; }
.svc-unknown { background: var(--comment); }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.svc-card-body { font-size: 12px; color: var(--fg-dark); }
.svc-info { display: flex; justify-content: space-between; margin-bottom: 4px; }
.svc-host { color: var(--comment); font-family: monospace; }
.svc-status-label { font-weight: 600; }
.svc-standby { color: var(--cyan); font-size: 11px; }
.svc-vip { color: var(--magenta); font-size: 11px; font-family: monospace; }
.svc-response-time { color: var(--comment); font-size: 11px; margin-top: 4px; }

.svc-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.btn { padding: 6px 12px; border-radius: 4px; border: none; cursor: pointer; font-size: 12px; font-family: inherit; }
.btn-sm { padding: 4px 8px; font-size: 11px; }
.btn-danger { background: rgba(247,118,142,0.2); color: var(--red); }
.btn-danger:hover { background: rgba(247,118,142,0.35); }
.btn-warning { background: rgba(224,175,104,0.2); color: var(--yellow); }
.btn-warning:hover { background: rgba(224,175,104,0.35); }

.svc-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 13px;
}
.svc-detail-grid strong { color: var(--fg); }

/* Dependency Chain */
.dep-chain { padding: 16px; font-size: 13px; }
.dep-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.dep-label { color: var(--fg-dark); font-weight: 600; min-width: 80px; }
.dep-arrow { color: var(--comment); font-size: 16px; }
.dep-node {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
}
.dep-healthy { background: rgba(158,206,106,0.12); color: var(--green); border-color: var(--green); }
.dep-degraded { background: rgba(224,175,104,0.12); color: var(--yellow); border-color: var(--yellow); }
.dep-down { background: rgba(247,118,142,0.12); color: var(--red); border-color: var(--red); }
.dep-unknown { background: var(--bg-highlight); color: var(--comment); }
.dep-game { background: rgba(122,162,247,0.12); color: var(--blue); border-color: var(--blue); }

/* Health Sparkline */
.health-sparkline {
  display: flex;
  gap: 2px;
  align-items: center;
  padding: 8px 0;
}
.spark-dot {
  width: 8px;
  height: 20px;
  border-radius: 2px;
  display: inline-block;
}
.spark-healthy { background: var(--green); }
.spark-degraded { background: var(--yellow); }
.spark-down { background: var(--red); }
.spark-unknown { background: var(--comment); }

/* Diagnosis */
.diag-root-cause {
  padding: 12px;
  background: var(--bg);
  border-radius: 6px;
  border: 1px solid var(--border);
}
.diag-cause-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 8px;
}
.diag-process_crash { background: rgba(247,118,142,0.15); color: var(--red); }
.diag-machine_down { background: rgba(247,118,142,0.15); color: var(--red); }
.diag-disk_full { background: rgba(224,175,104,0.15); color: var(--yellow); }
.diag-oom { background: rgba(247,118,142,0.15); color: var(--red); }
.diag-network { background: rgba(122,162,247,0.15); color: var(--blue); }
.diag-upstream_dependency { background: rgba(187,154,247,0.15); color: var(--magenta); }
.diag-unknown { background: var(--bg-highlight); color: var(--comment); }

.diag-check-pass { color: var(--green); }
.diag-check-fail { color: var(--red); }
.diag-check-skip { color: var(--comment); }
.diag-check-error { color: var(--yellow); }

.diag-recommendations {
  padding-left: 20px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--fg-dark);
  line-height: 1.6;
}

/* ===== Resilience / Failover ===== */
.fo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 16px;
  padding: 16px;
}

.fo-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.fo-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-highlight);
  border-bottom: 1px solid var(--border);
}

.fo-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
}

.fo-card-body { padding: 16px; }

.fo-machines {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.fo-machine {
  flex: 1;
  padding: 10px;
  border-radius: 6px;
  text-align: center;
  border: 1px solid var(--border);
}
.fo-active {
  border-color: var(--green);
  background: rgba(158,206,106,0.08);
}
.fo-inactive {
  border-color: var(--border);
  background: var(--bg-dark);
  opacity: 0.7;
}

.fo-machine-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--comment);
  margin-bottom: 4px;
}

.fo-machine-host {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
}

.fo-active-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  background: var(--green);
  color: var(--bg);
}

.fo-arrow {
  color: var(--comment);
  font-size: 20px;
  flex-shrink: 0;
}

.fo-vip {
  font-size: 12px;
  color: var(--magenta);
  font-family: monospace;
  margin-bottom: 4px;
}

.fo-readiness { font-size: 12px; margin-bottom: 4px; }
.fo-last { margin-top: 4px; }

.fo-card-actions {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}

.fo-action {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.fo-failover { background: rgba(247,118,142,0.15); color: var(--red); }
.fo-failback { background: rgba(158,206,106,0.15); color: var(--green); }
.fo-vip_assign { background: rgba(187,154,247,0.15); color: var(--magenta); }
.fo-vip_remove { background: rgba(224,175,104,0.15); color: var(--yellow); }

.fo-status {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
}
.fo-success { background: rgba(158,206,106,0.15); color: var(--green); }
.fo-failed { background: rgba(247,118,142,0.15); color: var(--red); }
.fo-pending { background: rgba(224,175,104,0.15); color: var(--yellow); }

.fo-pair-status { font-size: 12px; color: var(--fg-dark); }

/* ===== DNS Management ===== */
.dns-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.dns-header h2 { color: var(--fg); margin: 0; }

.dns-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.dns-stat-card {
  background: var(--bg-highlight);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  text-align: center;
  min-width: 80px;
}
.dns-stat-card.small { padding: 8px 12px; min-width: 60px; }
.dns-stat-value { font-size: 24px; font-weight: 700; color: var(--blue); }
.dns-stat-card.small .dns-stat-value { font-size: 18px; }
.dns-stat-label { font-size: 11px; color: var(--fg-dark); text-transform: uppercase; margin-top: 2px; }

.dns-issues-card { margin-bottom: 16px; }
.dns-issues-card h3 { color: var(--fg); margin: 0 0 8px; }
.dns-issues-list { display: flex; flex-direction: column; gap: 6px; }
.dns-issue {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  flex-wrap: wrap;
}
.dns-issue-critical { background: rgba(247,118,142,0.1); border-left: 3px solid var(--red); }
.dns-issue-warning { background: rgba(224,175,104,0.1); border-left: 3px solid var(--yellow); }
.dns-issue-info { background: rgba(122,162,247,0.1); border-left: 3px solid var(--blue); }
.dns-issue-severity {
  font-weight: 700;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  min-width: 60px;
  text-align: center;
}
.dns-issue-critical .dns-issue-severity { background: rgba(247,118,142,0.2); color: var(--red); }
.dns-issue-warning .dns-issue-severity { background: rgba(224,175,104,0.2); color: var(--yellow); }
.dns-issue-record { font-family: monospace; color: var(--fg); }
.dns-issue-type { color: var(--purple); font-size: 11px; }
.dns-issue-text { color: var(--fg-dark); flex: 1; }
.dns-issue-fix { color: var(--green); font-style: italic; }

.dns-table-wrapper { overflow-x: auto; }
.dns-table td { font-size: 12px; }
.dns-table .hostname { font-family: monospace; color: var(--blue); }

.dns-critical-row { background: rgba(224,175,104,0.05); }
.dns-critical-badge { color: var(--yellow); margin-right: 4px; }

.dns-zone-tag {
  font-size: 10px;
  color: var(--comment);
  margin-left: 6px;
  padding: 1px 4px;
  background: var(--bg-dark);
  border-radius: 3px;
}

.dns-type-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  font-family: monospace;
}
.dns-type-A { background: rgba(122,162,247,0.15); color: var(--blue); }
.dns-type-AAAA { background: rgba(125,207,255,0.15); color: var(--cyan); }
.dns-type-CNAME { background: rgba(187,154,247,0.15); color: var(--purple); }
.dns-type-MX { background: rgba(224,175,104,0.15); color: var(--yellow); }
.dns-type-TXT { background: rgba(158,206,106,0.15); color: var(--green); }
.dns-type-SRV { background: rgba(255,158,100,0.15); color: var(--orange); }
.dns-type-NS { background: rgba(169,177,214,0.15); color: var(--fg-dark); }

.dns-content { font-family: monospace; font-size: 12px; max-width: 300px; overflow: hidden; text-overflow: ellipsis; }

.dns-ip-type {
  display: inline-block;
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 2px;
  margin-left: 4px;
  text-transform: uppercase;
  font-weight: 600;
}
.dns-ip-vrack { background: rgba(122,162,247,0.15); color: var(--blue); }
.dns-ip-tinc { background: rgba(187,154,247,0.15); color: var(--purple); }
.dns-ip-tailscale { background: rgba(125,207,255,0.15); color: var(--cyan); }
.dns-ip-public { background: rgba(158,206,106,0.15); color: var(--green); }
.dns-ip-local { background: rgba(224,175,104,0.15); color: var(--yellow); }
.dns-ip-localhost { background: rgba(247,118,142,0.15); color: var(--red); }

.dns-ttl-warn { color: var(--yellow); font-weight: 600; }

.dns-proxied { color: var(--blue); }
.dns-direct { color: var(--fg-dark); font-size: 11px; }

.dns-category {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}
.dns-cat-game_login { background: rgba(247,118,142,0.15); color: var(--red); }
.dns-cat-game_server { background: rgba(224,175,104,0.15); color: var(--yellow); }
.dns-cat-game_launcher { background: rgba(255,158,100,0.15); color: var(--orange); }
.dns-cat-game_web { background: rgba(122,162,247,0.15); color: var(--blue); }
.dns-cat-game_proxy { background: rgba(187,154,247,0.15); color: var(--purple); }
.dns-cat-game_assets { background: rgba(125,207,255,0.15); color: var(--cyan); }
.dns-cat-internal { background: rgba(169,177,214,0.1); color: var(--fg-dark); }
.dns-cat-infra { background: rgba(158,206,106,0.15); color: var(--green); }
.dns-cat-other { background: var(--bg-dark); color: var(--comment); }

.dns-unmapped { color: var(--comment); font-size: 11px; font-style: italic; }

.dns-actions { white-space: nowrap; }
.btn-icon {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--fg-dark);
  cursor: pointer;
  padding: 2px 6px;
  font-size: 14px;
  margin: 0 1px;
}
.btn-icon:hover { border-color: var(--blue); color: var(--blue); }
.btn-failover { color: var(--yellow); }
.btn-failover:hover { border-color: var(--yellow); }
.btn-danger { color: var(--red); }
.btn-danger:hover { border-color: var(--red); }

.dns-action-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}
.dns-action-create { background: rgba(158,206,106,0.15); color: var(--green); }
.dns-action-update { background: rgba(122,162,247,0.15); color: var(--blue); }
.dns-action-delete { background: rgba(247,118,142,0.15); color: var(--red); }
.dns-action-failover { background: rgba(224,175,104,0.15); color: var(--yellow); }

.dns-change-status { font-size: 11px; font-weight: 600; }
.dns-change-success { color: var(--green); }
.dns-change-failed { color: var(--red); }

/* DNS Modal */
.dns-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
}
.dns-modal {
  background: var(--bg-highlight);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  min-width: 400px;
  max-width: 500px;
}
.dns-modal h3 { color: var(--fg); margin: 0 0 16px; }
.dns-modal-info {
  background: var(--bg-dark);
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--fg);
}
.dns-modal-info code { color: var(--blue); }
.dns-modal-form { display: flex; flex-direction: column; gap: 8px; }
.dns-modal-form label { color: var(--fg-dark); font-size: 12px; }
.dns-modal-form input[type="text"],
.dns-modal-form input[type="number"] {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--fg);
  padding: 8px;
  font-size: 13px;
}
.dns-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}
.dns-failover-modal h3 { color: var(--yellow); }
.btn-primary { background: var(--blue); color: var(--bg); border-color: var(--blue); }
.btn-primary:hover { opacity: 0.9; }
.btn-danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn-danger:hover { opacity: 0.9; }

/* === Incident Investigation Dashboard === */
.incident-card {
  background: var(--bg-highlight);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.incident-card:hover { border-color: var(--blue); }

.incident-card-header {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.severity-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.severity-badge.severity-critical { background: var(--red); color: #fff; }
.severity-badge.severity-high { background: var(--orange); color: var(--bg); }
.severity-badge.severity-medium { background: var(--yellow); color: var(--bg); }
.severity-badge.severity-low { background: var(--green); color: var(--bg); }

.incident-status-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.incident-status-badge.status-open { background: var(--blue); color: var(--bg); }
.incident-status-badge.status-investigating { background: var(--magenta); color: #fff; }
.incident-status-badge.status-resolved { background: var(--green); color: var(--bg); }
.incident-status-badge.status-closed { background: var(--comment); color: var(--fg); }

.incident-category {
  color: var(--comment);
  font-size: 12px;
}
.incident-title {
  margin: 0 0 4px;
  font-size: 16px;
  color: var(--fg);
}
.incident-desc {
  color: var(--fg-dark);
  font-size: 13px;
  margin: 0 0 8px;
  line-height: 1.4;
}
.incident-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--comment);
}
.incident-rootcause {
  color: var(--yellow);
  font-style: italic;
}

/* Incident detail */
.incident-detail-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.incident-info-panel {
  background: var(--bg-highlight);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}
.incident-info-panel h3 {
  margin: 0 0 12px;
  color: var(--fg);
}
.incident-info-meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--fg-dark);
}
.incident-description {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.incident-description h4 {
  margin: 0 0 8px;
  color: var(--comment);
  font-size: 12px;
  text-transform: uppercase;
}
.incident-description p {
  margin: 0;
  color: var(--fg-dark);
  line-height: 1.5;
}

/* Investigation progress */
.investigation-progress {
  background: var(--bg-highlight);
  border: 1px solid var(--magenta);
  border-radius: 8px;
  padding: 24px;
  text-align: center;
}
.investigation-progress h3 {
  color: var(--magenta);
  margin: 12px 0 8px;
}
.investigation-progress p {
  color: var(--fg-dark);
  margin: 4px 0;
}
.investigation-progress .evidence-count {
  color: var(--blue);
  font-weight: 600;
}

/* Analysis panel */
.analysis-panel {
  background: var(--bg-highlight);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}
.analysis-panel h3 {
  margin: 0 0 16px;
  color: var(--blue);
}
.analysis-section {
  margin-bottom: 16px;
  padding: 12px;
  border-radius: 6px;
  background: var(--bg-dark);
}
.analysis-section h4 {
  margin: 0 0 8px;
  font-size: 13px;
  text-transform: uppercase;
  color: var(--comment);
}
.analysis-rootcause {
  border-left: 3px solid var(--yellow);
}
.analysis-rootcause h4 { color: var(--yellow); }
.analysis-rootcause p {
  color: var(--fg);
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}
.analysis-remediation {
  border-left: 3px solid var(--green);
}
.analysis-remediation h4 { color: var(--green); }
.analysis-text {
  margin: 0;
  white-space: pre-wrap;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--fg-dark);
  line-height: 1.5;
}

/* Evidence panel */
.evidence-panel {
  background: var(--bg-highlight);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}
.evidence-panel h3 {
  margin: 0 0 16px;
  color: var(--fg);
}

.evidence-host-group {
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 8px;
  overflow: hidden;
}
.evidence-host-group.collapsed .evidence-host-body { display: none; }
.evidence-host-group.collapsed .evidence-toggle { transform: rotate(-90deg); }

.evidence-host-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-dark);
  cursor: pointer;
  user-select: none;
}
.evidence-host-header:hover { background: var(--bg); }
.evidence-toggle {
  font-size: 10px;
  transition: transform 0.2s;
  color: var(--comment);
}
.evidence-count-badge {
  font-size: 11px;
  color: var(--comment);
  margin-left: auto;
}
.evidence-error-badge {
  font-size: 11px;
  color: var(--red);
  font-weight: 600;
}

.evidence-host-body {
  border-top: 1px solid var(--border);
}

.evidence-item {
  border-bottom: 1px solid var(--border);
}
.evidence-item:last-child { border-bottom: none; }
.evidence-item.evidence-error { border-left: 3px solid var(--red); }

.evidence-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
}
.evidence-item-header:hover { background: var(--bg-highlight); }

.evidence-item:not(.expanded) .evidence-item-body { display: none; }

.evidence-source-badge {
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
}
.evidence-source-badge.source-ssh_system { background: var(--blue); color: var(--bg); }
.evidence-source-badge.source-ssh_network { background: var(--cyan); color: var(--bg); }
.evidence-source-badge.source-ssh_services { background: var(--green); color: var(--bg); }
.evidence-source-badge.source-ssh_logs { background: var(--yellow); color: var(--bg); }
.evidence-source-badge.source-ssh_gameserver { background: var(--magenta); color: #fff; }
.evidence-source-badge.source-ssh_error { background: var(--red); color: #fff; }
.evidence-source-badge.source-ovh_ddos { background: var(--orange); color: var(--bg); }
.evidence-source-badge.source-zabbix { background: #e33; color: #fff; }
.evidence-source-badge.source-service_health { background: var(--teal); color: var(--bg); }

.evidence-command {
  color: var(--fg-dark);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.evidence-duration {
  color: var(--comment);
  font-size: 11px;
  white-space: nowrap;
}
.evidence-error-icon {
  color: var(--red);
  font-size: 14px;
}

.evidence-item-body {
  padding: 8px 12px;
  background: var(--bg-dark);
}
.evidence-error-msg {
  color: var(--red);
  font-size: 12px;
  margin-bottom: 8px;
  padding: 4px 8px;
  background: rgba(255,0,0,0.1);
  border-radius: 4px;
}
.evidence-output {
  margin: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--fg-dark);
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 400px;
  overflow-y: auto;
  padding: 8px;
  background: var(--bg);
  border-radius: 4px;
}

/* Spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  text-align: center;
  color: var(--comment);
  padding: 40px;
  font-size: 14px;
}
.loading-text {
  text-align: center;
  color: var(--comment);
  padding: 40px;
}
.error-text {
  text-align: center;
  color: var(--red);
  padding: 40px;
}
