:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --line: #d7e0ea;
  --line-soft: rgba(15, 23, 42, 0.08);
  --text: #0f172a;
  --muted: #5b6677;
  --accent: #1d4ed8;
  --accent-strong: #0f172a;
  --good: #0f9d6c;
  --warn: #b7791f;
  --bad: #c2415a;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top, rgba(37, 99, 235, 0.12) 0, transparent 32%),
    radial-gradient(circle at right top, rgba(14, 165, 233, 0.08) 0, transparent 28%),
    linear-gradient(180deg, #fbfdff 0%, var(--bg) 100%);
  color: var(--text);
}
body.drawer-open { overflow: hidden; }

h1, h2, h3, p { margin: 0; }

.shell { max-width: 1500px; margin: 0 auto; padding: 24px; }

.hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.98));
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}
.eyebrow {
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  margin-bottom: 6px;
}
.subtitle, .muted, .hint { color: var(--muted); }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip, .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 0.8rem;
}
.chip {
  background: rgba(143, 174, 249, 0.12);
  border: 1px solid rgba(143, 174, 249, 0.22);
  color: var(--accent-strong);
}
.badge {
  background: rgba(29, 78, 216, 0.08);
  border: 1px solid rgba(29, 78, 216, 0.12);
  color: var(--accent-strong);
}
.hero-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn {
  border: 1px solid #c8d4e3;
  background: linear-gradient(180deg, #ffffff, #eef4fb);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:hover { border-color: var(--accent); }
.btn.ghost { background: rgba(255, 255, 255, 0.7); }
.btn.tiny { padding: 6px 9px; font-size: 0.8rem; line-height: 1; }

.status-strip, .grid { display: grid; gap: 16px; }
.status-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}
.status-card, .panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
}
.status-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.status-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.status-card strong { font-size: 1.35rem; letter-spacing: -0.01em; }
.panel { padding: 16px; }
.panel-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 14px; }
.section-label { color: var(--accent); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.7rem; margin-bottom: 4px; }

.grid.two-up { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 16px; }
.mini-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.mini-grid > div, .audit-item, .notes > div, .drawer-grid > div {
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 14px;
  padding: 12px;
}
.mini-grid span, .drawer-grid span { color: var(--muted); font-size: 0.84rem; }
.mini-grid strong, .drawer-grid strong { display: block; margin-top: 6px; font-size: 1rem; }

.table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-gutter: stable;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
table.compact-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
  th, td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    text-align: left;
    vertical-align: top;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
th {
  position: sticky;
  top: 0;
  background: #eef3f8;
  z-index: 1;
  font-size: 0.84rem;
  color: var(--muted);
}
tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 0.85rem; }

.pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-transform: capitalize;
}
.pill.healthy { background: rgba(15, 157, 108, 0.10); color: var(--good); }
.pill.running { background: rgba(29, 78, 216, 0.10); color: var(--accent); }
.pill.unhealthy { background: rgba(194, 65, 90, 0.10); color: var(--bad); }
.pill.unknown { background: rgba(183, 121, 31, 0.10); color: var(--warn); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.actions .btn { flex: 0 0 auto; }

.workload-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.workload-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.workload-actions .btn { flex: 0 0 auto; }
.action-btn {
  align-self: flex-start;
  min-width: 96px;
}
.workload-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.workload-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(143, 174, 249, 0.12);
  border: 1px solid rgba(143, 174, 249, 0.18);
  flex: 0 0 auto;
}
.workload-title { font-weight: 650; }
.workload-subtitle {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 3px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-list { display: flex; flex-direction: column; gap: 10px; }
.audit-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.notes { display: grid; gap: 10px; }
.notes p { margin-top: 6px; line-height: 1.5; }

.compact-table-system th:nth-child(1), .compact-table-system td:nth-child(1) { width: 14%; }
.compact-table-system th:nth-child(2), .compact-table-system td:nth-child(2) { width: 46%; }
.compact-table-system th:nth-child(3), .compact-table-system td:nth-child(3) { width: 40%; }
.compact-table-docker th:nth-child(1), .compact-table-docker td:nth-child(1) { width: 40%; }
.compact-table-docker th:nth-child(2), .compact-table-docker td:nth-child(2) { width: 15%; }
.compact-table-docker th:nth-child(3), .compact-table-docker td:nth-child(3) { width: 10%; }
.compact-table-docker th:nth-child(4), .compact-table-docker td:nth-child(4) { width: 15%; }
.compact-table-docker th:nth-child(5), .compact-table-docker td:nth-child(5) { width: 20%; }
.compact-table-k8s-deployments th:nth-child(1), .compact-table-k8s-deployments td:nth-child(1) { width: 14%; }
.compact-table-k8s-deployments th:nth-child(2), .compact-table-k8s-deployments td:nth-child(2) { width: 40%; }
.compact-table-k8s-deployments th:nth-child(3), .compact-table-k8s-deployments td:nth-child(3) { width: 10%; }
.compact-table-k8s-deployments th:nth-child(4), .compact-table-k8s-deployments td:nth-child(4) { width: 10%; }
.compact-table-k8s-deployments th:nth-child(5), .compact-table-k8s-deployments td:nth-child(5) { width: 10%; }
.compact-table-k8s-deployments th:nth-child(6), .compact-table-k8s-deployments td:nth-child(6) { width: 16%; }
.compact-table-k8s-pods th:nth-child(1), .compact-table-k8s-pods td:nth-child(1) { width: 14%; }
.compact-table-k8s-pods th:nth-child(2), .compact-table-k8s-pods td:nth-child(2) { width: 40%; }
.compact-table-k8s-pods th:nth-child(3), .compact-table-k8s-pods td:nth-child(3) { width: 10%; }
.compact-table-k8s-pods th:nth-child(4), .compact-table-k8s-pods td:nth-child(4) { width: 10%; }
.compact-table-k8s-pods th:nth-child(5), .compact-table-k8s-pods td:nth-child(5) { width: 10%; }
.compact-table-k8s-pods th:nth-child(6), .compact-table-k8s-pods td:nth-child(6) { width: 16%; }

.inspector-panel {
  margin-top: 4px;
}
.inspector-head {
  position: sticky;
  top: 0;
  z-index: 1;
  padding-bottom: 10px;
  margin-bottom: 2px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.94));
  backdrop-filter: blur(10px);
}
.drawer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.drawer-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.drawer-actions-wrap { margin-top: 2px; }
.drawer-logs-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.log-window {
  margin: 0;
  padding: 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: #10213a;
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.55;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.78rem;
  max-height: 360px;
}

@media (max-width: 1240px) {
  .status-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.two-up { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { padding: 16px; }
  .hero { flex-direction: column; align-items: start; }
  .status-strip { grid-template-columns: 1fr; }
  .panel-head { align-items: start; flex-direction: column; }
  .audit-item { align-items: start; flex-direction: column; }
  .actions { gap: 4px; }
  .btn.tiny { width: 100%; }
  th, td { white-space: normal; }
  .inspector-panel { margin-top: 12px; }
  .drawer-grid { grid-template-columns: 1fr; }
}
