:root {
  color-scheme: light;
  --bg: #eef2f6;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #17202a;
  --muted: #667085;
  --line: #d7dee8;
  --ok: #16825d;
  --ok-soft: #dff6ed;
  --warn: #b15c00;
  --warn-soft: #fff0d6;
  --danger: #c93535;
  --danger-soft: #ffe2e2;
  --accent: #2563eb;
  --shadow: 0 16px 45px rgba(31, 41, 55, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.login-panel {
  width: min(100% - 32px, 380px);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-panel h1 {
  font-size: 2rem;
}

.login-copy {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.94rem;
}

.login-error {
  margin-top: 18px;
  padding: 10px 12px;
  border: 1px solid #ef8a8a;
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 800;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 800;
}

.login-form input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
}

.login-form button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

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

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

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1;
}

h2 {
  font-size: 1.02rem;
}

.muted {
  color: var(--muted);
  font-size: 0.92rem;
}

.status-pill {
  min-width: 118px;
  padding: 9px 12px;
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 0.86rem;
  font-weight: 800;
  text-align: center;
}

.status-pill.online {
  background: var(--ok-soft);
  color: var(--ok);
}

.status-pill.offline {
  background: var(--danger-soft);
  color: var(--danger);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric-card {
  display: grid;
  gap: 14px;
  min-height: 150px;
  padding: 18px;
}

.metric-card.warning {
  border-color: #f0bd73;
  background: var(--warn-soft);
}

.metric-card.critical {
  border-color: #ef8a8a;
  background: var(--danger-soft);
}

.metric-head,
.section-title,
.load-row,
.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.metric-head span,
.section-title span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.metric-head strong {
  font-size: 2rem;
  line-height: 1;
}

.gauge,
.mini-gauge {
  overflow: hidden;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #e6ecf3;
}

.gauge span,
.mini-gauge span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--ok);
  transition: width 240ms ease, background-color 240ms ease;
}

.load-row {
  justify-content: flex-start;
  color: var(--muted);
}

.load-row span {
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--panel-soft);
}

.panel {
  padding: 18px;
  margin-bottom: 16px;
}

.section-title {
  margin-bottom: 14px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sort-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.sort-toggle button {
  min-width: 64px;
  min-height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.sort-toggle button.active {
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 1px 4px rgb(15 23 42 / 10%);
}

.core-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.core-tile {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.core-tile.warning,
.list-item.warning,
.container-row.warning {
  border-color: #f0bd73;
  background: var(--warn-soft);
}

.core-tile.critical,
.list-item.critical,
.container-row.critical {
  border-color: #ef8a8a;
  background: var(--danger-soft);
}

.core-tile div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 800;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.list {
  display: grid;
  gap: 12px;
}

.list-item {
  align-items: flex-start;
  padding: 12px;
  border: 1px solid transparent;
  border-top-color: var(--line);
  border-radius: 8px;
}

.list-item:first-child {
  border-top: 0;
}

.list-meta {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.list-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-value {
  min-width: 92px;
  text-align: right;
  font-weight: 800;
}

.process-table,
.container-table {
  overflow-x: auto;
}

.table-row {
  display: grid;
  grid-template-columns: 80px minmax(180px, 1fr) 140px 90px 90px;
  gap: 12px;
  min-width: 680px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.container-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) minmax(180px, 1.2fr) 130px 80px 150px 190px;
  gap: 12px;
  min-width: 920px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-top-color: var(--line);
  border-radius: 8px;
}

.table-row span,
.container-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.container-row span:first-child {
  display: grid;
  gap: 2px;
}

.container-row small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.76rem;
  text-overflow: ellipsis;
}

.container-status {
  display: inline-block;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.78rem;
  font-weight: 800;
  font-style: normal;
  text-overflow: ellipsis;
}

.container-status.running {
  background: var(--ok-soft);
  color: var(--ok);
}

.table-head {
  border-top: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
}

@media (max-width: 900px) {
  .split {
    grid-template-columns: 1fr 1fr;
  }
}

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

  .topbar {
    display: grid;
  }

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

  .status-pill {
    width: 100%;
  }
}
