:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-raised: #fbfcfd;
  --ink: #111827;
  --ink-soft: #344054;
  --muted: #667085;
  --line: #d8dee7;
  --line-soft: #edf1f5;
  --accent: #1d4ed8;
  --accent-strong: #1e40af;
  --success: #047857;
  --success-bg: #e7f6ef;
  --warning: #a16207;
  --warning-bg: #fff6d9;
  --danger: #b42318;
  --danger-bg: #fff1f0;
  --shadow: 0 14px 36px rgba(16, 24, 40, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, #eef2f6 0, var(--bg) 260px),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 800;
}

.brand-mark {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 7px;
  color: #ffffff;
  background: #182230;
  font-size: 0.92rem;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.primary-nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border-radius: 7px;
  padding: 7px 11px;
  color: var(--ink-soft);
  font-size: 0.93rem;
  font-weight: 700;
}

.primary-nav a:hover {
  background: #eef2f6;
  color: var(--ink);
}

.workspace {
  width: min(1240px, calc(100% - 36px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 1.75rem;
  line-height: 1.18;
}

h2,
legend {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
}

.summary-line,
.card-header p {
  margin: 0;
  color: var(--muted);
}

.notice-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  margin-bottom: 16px;
  padding: 12px 14px;
  color: #1e3a8a;
  background: #eff6ff;
}

.notice-banner strong,
.notice-banner span {
  display: block;
}

.notice-banner span {
  color: #475467;
}

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

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

.metric-card {
  min-height: 92px;
  padding: 15px 16px;
}

.metric-card span,
label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  color: var(--ink);
  font-size: 1.55rem;
  line-height: 1;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.45fr);
  gap: 16px;
  margin-bottom: 16px;
}

.side-stack {
  display: grid;
  gap: 16px;
  align-content: start;
}

.panel-card,
.table-card {
  margin-bottom: 16px;
}

.panel-card {
  padding: 18px;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
}

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

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

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  background: var(--surface-raised);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  color: var(--ink-soft);
}

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

.table-link {
  color: var(--accent);
  font-weight: 800;
}

.table-link:hover {
  color: var(--accent-strong);
}

.mono-cell,
.numeric {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.numeric {
  text-align: right;
}

.empty-cell {
  color: var(--muted);
  text-align: center;
}

.compact-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.compact-list li {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-soft);
}

.compact-list li:last-child {
  border-bottom: 0;
}

.compact-list strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.status-pill {
  display: inline-flex;
  min-height: 26px;
  max-width: 100%;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  background: #eef2f6;
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.status-success,
.status-running {
  background: var(--success-bg);
  color: var(--success);
}

.status-warn,
.status-partial_failure {
  background: var(--warning-bg);
  color: var(--warning);
}

.status-failure {
  background: var(--danger-bg);
  color: var(--danger);
}

.status-muted,
.status-not_run {
  background: #eef2f6;
  color: var(--muted);
}

form {
  margin: 0;
}

.inline-form,
.settings-form {
  display: grid;
  gap: 14px;
}

.inline-form {
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 0.75fr) auto;
  align-items: end;
}

.settings-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

fieldset {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 16px;
}

label {
  display: grid;
  gap: 7px;
}

input,
select {
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  color: var(--ink);
  background: #ffffff;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

.checkbox-row {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 9px;
}

.checkbox-row input {
  width: auto;
}

button,
.primary-action,
.secondary-action {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  padding: 8px 12px;
  font-weight: 800;
  cursor: pointer;
}

.primary-action {
  border: 1px solid var(--accent);
  color: #ffffff;
  background: var(--accent);
}

.primary-action:hover {
  background: var(--accent-strong);
}

.secondary-action {
  border: 1px solid var(--line);
  color: var(--ink-soft);
  background: #ffffff;
}

.secondary-action:hover {
  border-color: #c7d1dd;
  background: #f8fafc;
}

.error-message {
  border: 1px solid #f6c7c2;
  border-radius: 8px;
  margin: 0 0 16px;
  padding: 11px 13px;
  color: var(--danger);
  background: var(--danger-bg);
  font-weight: 700;
}

.condition-list,
ul:not(.compact-list) {
  margin: 8px 0 0;
  padding-left: 18px;
}

@media (max-width: 900px) {
  .workspace {
    width: min(100% - 24px, 1240px);
    padding-top: 20px;
  }

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

  .topbar {
    gap: 10px;
    padding: 14px 18px;
  }

  .primary-nav {
    width: 100%;
    overflow-x: auto;
  }

  .metric-grid,
  .content-grid,
  .settings-form,
  .inline-form {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 1.45rem;
  }
}
