:root {
  color-scheme: light;
  --ink: #172027;
  --muted: #66727c;
  --line: #d8dee2;
  --soft: #f3f5f6;
  --paper: #ffffff;
  --canvas: #edf1f2;
  --green: #167653;
  --green-soft: #e6f3ed;
  --coral: #b84a3a;
  --coral-soft: #faece9;
  --amber: #94651a;
  --amber-soft: #fbf2df;
  --focus: #246f9b;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--canvas);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-size: 15px;
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

button {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  color: var(--paper);
  background: var(--ink);
  cursor: pointer;
  font-weight: 650;
}

button:hover {
  background: #2c3941;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgb(36 111 155 / 25%);
  outline-offset: 1px;
  border-color: var(--focus);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

input {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid #b8c1c6;
  border-radius: 5px;
  color: var(--ink);
  background: var(--paper);
}

.topbar {
  border-bottom: 1px solid #c9d1d5;
  background: var(--paper);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1480px, calc(100% - 40px));
  min-height: 70px;
  margin: 0 auto;
}

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

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  background: var(--green);
  font-weight: 800;
}

.product-name,
.product-context {
  margin: 0;
}

.product-name {
  font-size: 15px;
  font-weight: 750;
}

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

.quiet-button {
  min-height: 34px;
  color: var(--ink);
  border-color: var(--line);
  background: var(--paper);
}

.quiet-button:hover {
  background: var(--soft);
}

.workspace {
  width: min(1480px, calc(100% - 40px));
  margin: 24px auto 32px;
}

.status-band {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
}

.status-item {
  min-width: 0;
  padding: 15px 18px;
  border-right: 1px solid var(--line);
}

.status-item:last-child {
  border-right: 0;
}

.status-label,
.status-value {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-label {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.status-value {
  font-size: 17px;
  font-weight: 720;
}

.page-alert {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid #e6b6ad;
  border-radius: 6px;
  color: #873328;
  background: var(--coral-soft);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 24px;
  margin-top: 24px;
  align-items: start;
}

.operations,
.activity {
  min-width: 0;
}

.section-heading {
  display: flex;
  min-height: 58px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-heading.compact {
  min-height: 58px;
}

.section-heading h1,
.section-heading h2 {
  margin: 2px 0 0;
  font-size: 24px;
  line-height: 1.2;
}

.section-heading h2 {
  font-size: 20px;
}

.eyebrow {
  margin: 0;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.state-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 750;
}

.state-badge.idle,
.state-badge.completed {
  color: var(--green);
  background: var(--green-soft);
}

.state-badge.running,
.state-badge.queued {
  color: var(--amber);
  background: var(--amber-soft);
}

.state-badge.failed,
.state-badge.interrupted {
  color: var(--coral);
  background: var(--coral-soft);
}

.operation-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
}

.operation-row {
  display: grid;
  grid-template-columns: 38px minmax(180px, 0.8fr) minmax(250px, 1.4fr) 112px;
  gap: 14px;
  min-height: 76px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.operation-row:last-child {
  border-bottom: 0;
}

.operation-row:hover {
  background: #fafbfb;
}

.operation-index {
  color: #89949b;
  font-size: 12px;
  font-weight: 750;
}

.operation-name {
  min-width: 0;
}

.operation-name strong,
.operation-name span {
  display: block;
}

.operation-name strong {
  font-size: 14px;
}

.operation-name span {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operation-fields {
  display: grid;
  grid-template-columns: minmax(120px, 190px);
  gap: 10px;
  min-width: 0;
}

.operation-fields.three-fields {
  grid-template-columns: repeat(3, minmax(100px, 1fr));
}

.operation-fields label {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.activity {
  padding: 0 18px 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
}

.job-meta,
.dataset-summary dl {
  margin: 0;
}

.job-meta > div,
.dataset-summary dl > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid #e8ecee;
}

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

.job-meta dd,
.dataset-summary dd {
  margin: 0;
  text-align: right;
  font-size: 12px;
  font-weight: 700;
}

.progress-track {
  width: 100%;
  height: 5px;
  margin-top: 16px;
  overflow: hidden;
  border-radius: 3px;
  background: #e5eaec;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--green);
  transition: width 250ms ease;
}

.progress-track span.active {
  width: 68%;
}

.progress-track span.done {
  width: 100%;
}

.job-message {
  min-height: 38px;
  margin: 12px 0 8px;
  color: var(--ink);
  font-size: 13px;
}

.job-log {
  width: 100%;
  min-height: 150px;
  max-height: 260px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: #d8e3e6;
  background: #20292e;
  font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}

.dataset-summary {
  margin-top: 20px;
}

.dataset-summary h3 {
  margin: 0 0 7px;
  font-size: 14px;
}

.footer {
  width: min(1480px, calc(100% - 40px));
  margin: 0 auto 28px;
  color: var(--muted);
  font-size: 11px;
}

.login-page {
  background: #e9eef0;
}

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

.login-panel {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 18px 14px;
  width: min(420px, 100%);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 18px 50px rgb(23 32 39 / 10%);
}

.login-panel h1 {
  margin: 4px 0 0;
  font-size: 21px;
}

.login-form,
.notice,
.version {
  grid-column: 1 / -1;
}

.login-form {
  display: grid;
  gap: 8px;
}

.login-form label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.login-form button {
  margin-top: 6px;
}

.notice {
  margin: 0;
  padding: 10px 12px;
  border-radius: 5px;
  font-size: 13px;
}

.notice.error {
  color: #873328;
  background: var(--coral-soft);
}

.version {
  margin: 0;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}

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

  .activity {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 24px;
  }

  .activity .section-heading,
  .activity .dataset-summary {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .workspace,
  .topbar-inner,
  .footer {
    width: min(100% - 24px, 1480px);
  }

  .status-band {
    grid-template-columns: repeat(2, 1fr);
  }

  .status-item {
    border-bottom: 1px solid var(--line);
  }

  .status-item:nth-child(2n) {
    border-right: 0;
  }

  .status-item:last-child {
    grid-column: 1 / -1;
    border-bottom: 0;
  }

  .operation-row {
    grid-template-columns: 28px 1fr 106px;
  }

  .operation-fields {
    grid-column: 2 / -1;
    grid-row: 2;
  }

  .operation-row > button {
    grid-column: 3;
    grid-row: 1;
  }
}

@media (max-width: 560px) {
  .topbar-inner {
    min-height: 62px;
  }

  .product-context {
    display: none;
  }

  .status-band {
    grid-template-columns: 1fr;
  }

  .status-item,
  .status-item:nth-child(2n),
  .status-item:last-child {
    grid-column: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .status-item:last-child {
    border-bottom: 0;
  }

  .operation-row {
    grid-template-columns: 26px 1fr;
    gap: 10px;
    padding: 14px 12px;
  }

  .operation-row > button,
  .operation-fields {
    grid-column: 2;
    grid-row: auto;
  }

  .operation-fields.three-fields {
    grid-template-columns: 1fr;
  }

  .operation-row > button {
    width: 100%;
  }

  .activity {
    display: block;
  }
}
