:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --surface: #ffffff;
  --ink: #18201c;
  --muted: #66736c;
  --line: #dce2dc;
  --accent: #1d6f5f;
  --accent-2: #8a4b2a;
  --warn: #a86100;
  --danger: #b42318;
  --ok: #147d49;
  --shadow: 0 16px 40px rgb(18 30 24 / 10%);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgb(246 247 244 / 96%), rgb(235 239 235 / 100%)),
    radial-gradient(circle at top left, rgb(29 111 95 / 16%), transparent 34%);
  color: var(--ink);
}

.shell {
  width: min(1420px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.eyebrow,
.metric-label,
.timestamp,
.badge {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 4px;
  font-size: clamp(2rem, 4vw, 4.6rem);
  line-height: 0.96;
}

h2 {
  font-size: 1rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.icon-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 8px 20px rgb(20 32 26 / 8%);
  cursor: pointer;
  font-size: 1.2rem;
}

.icon-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

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

.metric,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgb(255 255 255 / 90%);
  box-shadow: var(--shadow);
}

.metric {
  min-height: 132px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric strong {
  display: block;
  font-size: clamp(1.8rem, 4vw, 3.5rem);
  line-height: 1;
}

.metric small {
  color: var(--muted);
  line-height: 1.4;
}

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

.panel {
  min-width: 0;
  overflow: hidden;
}

.panel-wide {
  grid-column: 1 / -1;
}

.panel-header {
  min-height: 58px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f4f6f2;
  white-space: nowrap;
}

.badge.ok {
  color: var(--ok);
  border-color: rgb(20 125 73 / 35%);
}

.badge.warn {
  color: var(--warn);
  border-color: rgb(168 97 0 / 35%);
}

.badge.danger {
  color: var(--danger);
  border-color: rgb(180 35 24 / 35%);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 0.92rem;
}

th {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

td {
  color: #26312b;
}

tr:last-child td {
  border-bottom: 0;
}

.state {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef3ef;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

.state.running,
.state.healthy {
  background: rgb(20 125 73 / 10%);
  color: var(--ok);
}

.state.unhealthy,
.state.exited {
  background: rgb(180 35 24 / 10%);
  color: var(--danger);
}

.log-output {
  min-height: 290px;
  max-height: 420px;
  margin: 0;
  padding: 10px;
  overflow: auto;
  background: #f8faf7;
  color: var(--ink);
}

.log-row {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.log-row + .log-row {
  margin-top: 8px;
}

.log-row-top {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}

.log-level {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: rgb(29 111 95 / 10%);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.log-row.warn .log-level,
.log-row.warning .log-level {
  background: rgb(168 97 0 / 12%);
  color: var(--warn);
}

.log-row.error .log-level,
.log-row.crit .log-level {
  background: rgb(180 35 24 / 12%);
  color: var(--danger);
}

.log-row.debug .log-level {
  background: rgb(102 115 108 / 12%);
  color: var(--muted);
}

.log-meta {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: right;
}

.log-message,
.log-detail,
.empty-log {
  overflow-wrap: anywhere;
}

.log-message {
  color: #1f2c25;
  font-size: 0.92rem;
  line-height: 1.45;
}

.log-detail {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.empty-log {
  padding: 16px;
  color: var(--muted);
  line-height: 1.45;
}

.muted-row {
  color: var(--muted);
}

@media (max-width: 960px) {
  .status-grid,
  .workspace {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 20px, 1420px);
    padding-top: 18px;
  }

  .metric {
    min-height: 116px;
  }

  th,
  td {
    padding: 12px;
  }
}
