:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #f4f6f9;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --line: #d8dee8;
  --line-soft: #edf1f6;
  --text: #142033;
  --muted: #526173;
  --muted-strong: #344255;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --green: #087f5b;
  --green-soft: #e7f7ef;
  --amber: #a35b00;
  --amber-soft: #fff5df;
  --red: #b4232a;
  --red-soft: #fff0f0;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
.background-orb { display: none; }
main { width: min(1540px, calc(100% - 28px)); margin: 0 auto; padding: 18px 0 34px; }
header, .header-actions, .panel-heading, .dialog-heading, .dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 1.7rem; letter-spacing: -.03em; }
h2 { margin-bottom: 3px; font-size: 1rem; }
h3 { font-size: .95rem; }
.eyebrow {
  margin-bottom: 4px;
  color: var(--blue);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.muted, .panel-heading p, small, .fine-print { color: var(--muted); }
.button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: var(--panel);
  cursor: pointer;
  text-decoration: none;
}
.button:hover { border-color: #aeb9c9; background: var(--panel-soft); }
.button:disabled { opacity: .55; cursor: wait; }
.primary { background: var(--blue); color: #fff; border-color: var(--blue); font-weight: 750; }
.primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.secondary { background: #f8fafc; }
.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted-strong);
  font-size: 1rem;
  cursor: pointer;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 8px;
  margin: 14px 0 12px;
}
.summary-card, .panel {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.summary-card {
  min-height: 74px;
  padding: 12px 14px;
  border-radius: 9px;
}
.summary-card.wide {
  display: grid;
  grid-template-columns: minmax(130px, .6fr) minmax(220px, 1fr);
  gap: 12px;
  align-items: center;
}
.summary-label {
  color: var(--muted);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.summary-card strong {
  display: block;
  margin-top: 3px;
  font-size: 1.65rem;
  line-height: 1.1;
}
.summary-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted-strong);
  font-size: .78rem;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted-strong);
  font-size: .78rem;
}
.dot { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; }
.dot.stopped { background: var(--green); }
.dot.mixed { background: var(--amber); }
.dot.running { background: var(--red); }
.panel { border-radius: 10px; overflow: hidden; }
.panel-heading {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}
.panel-heading p { margin-bottom: 0; font-size: .84rem; color: var(--muted-strong); }
.search-field {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 250px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: #fff;
}
.search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}
.table-wrap { overflow: auto; }
table { width: 100%; min-width: 1060px; border-collapse: separate; border-spacing: 0; }
th, td {
  padding: 8px 9px;
  border-bottom: 1px solid var(--line-soft);
  border-right: 1px solid var(--line-soft);
  text-align: right;
  white-space: nowrap;
  background: #fff;
}
th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eef2f7;
  color: var(--muted-strong);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}
th:first-child, td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 255px;
  text-align: left;
  border-left: 0;
}
th:first-child { z-index: 3; }
tbody tr:nth-child(even):not(.group-row) td { background: #fcfdff; }
tbody tr:hover td { background-color: var(--blue-soft); }
.service-name { display: flex; align-items: center; gap: 8px; }
.status-pill {
  min-width: 29px;
  height: 23px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #eef2f7;
  font-size: .78rem;
  font-weight: 850;
}
.service-name a { color: var(--text); text-decoration: none; font-size: .9rem; font-weight: 750; }
.service-name a:hover { color: var(--blue); text-decoration: underline; }
.service-meta { display: block; margin-top: 2px; color: var(--muted-strong); font-size: .76rem; }
.metric-cell { min-width: 92px; }
.metric-value {
  display: block;
  font-variant-numeric: tabular-nums;
  font-size: .9rem;
  font-weight: 850;
}
.coverage {
  display: block;
  margin-top: 2px;
  color: var(--muted-strong);
  font-size: .72rem;
  line-height: 1.2;
}
.data-warning {
  display: block;
  margin-top: 2px;
  color: var(--amber);
  font-size: .72rem;
  font-weight: 800;
  line-height: 1.2;
}
.heat-low {
  color: var(--green);
  background-color: var(--green-soft);
}
.heat-mid {
  color: var(--amber);
  background-color: var(--amber-soft);
}
.heat-high {
  color: var(--red);
  background-color: var(--red-soft);
}
.metric-value.heat-low,
.metric-value.heat-mid,
.metric-value.heat-high,
.metric-value.heat-none {
  display: inline-block;
  min-width: 44px;
  padding: 2px 6px;
  border-radius: 999px;
}
.heat-none { color: #667085; background: #f2f4f7; }
.group-row td {
  padding: 7px 9px;
  background: #e8edf5 !important;
  color: var(--muted-strong);
  font-size: .76rem;
  font-weight: 850;
  letter-spacing: .04em;
  text-align: left;
  text-transform: uppercase;
}
.notice {
  margin: 10px 14px 0;
  padding: 10px 12px;
  border: 1px solid #f4c56b;
  border-radius: 7px;
  color: #7a4400;
  background: #fff8e8;
  font-size: .84rem;
}
.empty-state { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty-state strong { color: var(--text); }
.empty-state p { margin: 6px 0 0; }
.login-shell { min-height: calc(100vh - 70px); display: grid; place-items: center; }
.login-card {
  width: min(410px, 100%);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  text-align: center;
  box-shadow: 0 12px 32px rgba(16, 24, 40, .08);
}
.brand-mark {
  display: grid;
  width: 50px;
  height: 50px;
  margin: 0 auto 18px;
  place-items: center;
  border: 1px solid #bcd0ff;
  border-radius: 12px;
  color: var(--blue);
  background: var(--blue-soft);
  font-weight: 900;
}
.login-card .muted { margin: 10px auto 22px; max-width: 310px; line-height: 1.5; }
.login-form { display: grid; gap: 10px; text-align: left; }
.login-form label {
  color: var(--muted-strong);
  font-size: .76rem;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.login-form input {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: 0;
  color: var(--text);
  background: #fff;
  text-transform: uppercase;
}
.login-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.login-form .button { width: 100%; margin-top: 2px; }
.fine-print { margin: 14px 0 0; font-size: .75rem; }
dialog {
  width: min(560px, calc(100% - 30px));
  max-height: 85vh;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(16,24,40,.24);
}
dialog::backdrop { background: rgba(15, 23, 42, .45); }
.dialog-card { padding: 20px; }
.dialog-heading { margin-bottom: 16px; }
.dialog-heading h2 { margin: 0; }
.project-list { display: grid; gap: 7px; max-height: 230px; overflow: auto; }
.project-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}
.project-row strong { display: block; font-size: .9rem; }
.project-row small { display: block; margin-top: 2px; font-size: .76rem; color: var(--muted-strong); }
.switch { accent-color: var(--blue); }
.divider { height: 1px; margin: 18px 0; background: var(--line); }
.dialog-card label { display: block; margin-top: 11px; color: var(--muted-strong); font-size: .78rem; font-weight: 750; }
.dialog-card input {
  width: 100%;
  height: 38px;
  margin-top: 6px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: 0;
  color: var(--text);
  background: #fff;
}
.dialog-card input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.optional { color: var(--muted); font-weight: 400; }
.dialog-actions { justify-content: flex-end; margin-top: 18px; }
.form-error { margin: 10px 0 0; color: var(--red); font-size: .82rem; }
@media (max-width: 1080px) {
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .summary-card.wide { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  main { width: min(100% - 18px, 1540px); padding-top: 14px; }
  header { align-items: flex-start; }
  .header-actions { flex-wrap: wrap; justify-content: flex-end; }
  .summary-grid { grid-template-columns: 1fr; }
  .summary-card.wide { grid-template-columns: 1fr; }
  .panel-heading { align-items: flex-start; flex-direction: column; }
  .search-field { width: 100%; }
}
@media (max-width: 480px) {
  .login-card { padding: 26px 20px; }
}
