:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --line: #d9dee7;
  --text: #1d2430;
  --muted: #667085;
  --blue: #2563eb;
  --green: #198754;
  --amber: #b7791f;
  --red: #c2413a;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

button,
input {
  font: inherit;
}

button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  padding: 6px 10px;
  white-space: nowrap;
}

button:hover {
  border-color: #aeb8c8;
  background: #f9fafb;
}

button.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
}

button.danger {
  border-color: #e7b4af;
  color: var(--red);
}

input {
  min-height: 34px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  padding: 6px 8px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 18px;
  font-weight: 700;
}

h2 {
  font-size: 15px;
  font-weight: 700;
}

.topbar p,
.muted {
  color: var(--muted);
}

.top-actions,
.actions,
.section-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.top-actions input {
  width: 190px;
}

main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px;
}

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

.band {
  margin-bottom: 16px;
}

.panel {
  min-width: 0;
}

.section-head {
  justify-content: space-between;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.split {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(360px, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

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

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

td {
  word-break: break-word;
}

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

.gateway-title {
  font-weight: 700;
}

.gateway-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin: 0 4px 4px 0;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
}

.pill.ok {
  background: #e8f5ee;
  color: var(--green);
}

.pill.warn {
  background: #fff4dd;
  color: var(--amber);
}

.pill.bad {
  background: #fdecea;
  color: var(--red);
}

.pill.neutral {
  background: #eef1f6;
  color: var(--muted);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

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

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.job-list {
  max-height: 282px;
  overflow: auto;
  padding: 8px;
}

.info-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.info-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.info-key {
  color: var(--muted);
  font-weight: 700;
}

.job {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.job:last-child {
  border-bottom: 0;
}

.job:hover {
  background: #f9fafb;
}

.job-title {
  font-weight: 700;
}

.job-meta {
  color: var(--muted);
  font-size: 12px;
}

.log {
  min-height: 220px;
  max-height: 420px;
  margin: 0;
  overflow: auto;
  padding: 12px;
  background: #101828;
  color: #d1fadf;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.login-body {
  min-height: 100vh;
  background: var(--bg);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-panel h1 {
  font-size: 20px;
}

.login-panel p {
  color: var(--muted);
}

@media (max-width: 900px) {
  .topbar,
  .split {
    display: block;
  }

  .top-actions {
    justify-content: flex-start;
    margin-top: 12px;
  }

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

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