@font-face { font-family: "Archivo"; src: url("/archivo.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
:root {
  --ink: #0b0d10;
  --muted: #55616c;
  --faint: #6b7480;
  --paper: #f3f5f7;
  --panel: #ffffff;
  --white: #ffffff;
  --line: #e0e5e9;
  --rail: #0a1622;
  --rail-soft: #073d56;
  --cream: #ffffff;
  --accent: #073d56;
  --accent-dark: #052c3e;
  --good: #1c6a43;
  --good-bg: #e4f3ea;
  --warn: #8a5610;
  --warn-bg: #f8efd4;
  --bad: #8d2e2e;
  --bad-bg: #f8e5e2;
  --info: #1d4e72;
  --info-bg: #e5f0f7;
  --shadow: 0 18px 50px rgba(10, 22, 34, 0.05);
  color: var(--ink);
  background: var(--paper);
  font-family: "Archivo", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, .serif { font-family: "Archivo", Arial, sans-serif; font-weight: 750; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: var(--accent-dark); }

.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 1.05fr) minmax(320px, 0.95fr);
}
.login-hero {
  color: var(--cream);
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(circle at 12% 18%, rgba(190, 75, 30, 0.45), transparent 26%),
    linear-gradient(165deg, #2c261f 0%, #16130f 72%);
}
.brand-kicker { letter-spacing: 0.22em; font-size: 12px; font-weight: 700; }
.login-hero h1 { font-size: clamp(40px, 5vw, 68px); line-height: 0.96; margin: 24px 0 16px; max-width: 11ch; }
.login-hero p { max-width: 36ch; color: #e6dccf; font-size: 18px; }
.hero-note { font-size: 13px; color: #cbbbaa; max-width: 42ch; }
.login-panel { display: grid; place-items: center; padding: 32px 24px; }
.login-card { width: min(420px, 100%); }
.login-card h2 { font-size: 34px; margin: 0 0 8px; }
.login-card .lede { color: var(--muted); margin-bottom: 22px; }
label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
input, select {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  outline: none;
}
input:focus, select:focus { border-color: #b9a48c; box-shadow: 0 0 0 3px rgba(7, 61, 86, 0.14); }
.stack { display: grid; gap: 14px; }
.btn {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  background: var(--accent);
  color: white;
  font-weight: 700;
}
.btn:hover { background: var(--accent-dark); }
.btn.secondary, .btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost { color: var(--cream); border-color: #6a5d52; }
.btn.danger { background: var(--bad); }
.btn.small { padding: 7px 12px; font-size: 14px; }
.btn:disabled { opacity: 0.55; cursor: wait; }
.alert { background: var(--bad-bg); color: var(--bad); border-radius: 12px; padding: 10px 12px; }
.note { background: var(--warn-bg); color: #5e3d0c; border-radius: 12px; padding: 12px 14px; font-size: 14px; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 232px 1fr; }
.rail {
  background: var(--rail);
  color: var(--cream);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.brand-name { font-size: 28px; margin: 4px 0 0; }
.nav { display: grid; gap: 6px; }
.nav button {
  text-align: left;
  background: transparent;
  color: #e3edf3;
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
}
.nav button.active, .nav button:hover { background: var(--rail-soft); }
.rail-foot { margin-top: auto; display: grid; gap: 8px; }
.main { padding: 28px 32px 56px; }
.top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 22px;
}
.top h1 { margin: 0; font-size: 40px; }
.crumbs { color: var(--faint); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pill {
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--white);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
}
.pill.demo { background: #fff1e8; color: var(--accent-dark); border-color: #f0c7b4; }
.pill.live { background: var(--good-bg); color: var(--good); border-color: #b7dfc8; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.card, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.card { padding: 16px 16px 14px; }
.card span, .muted { color: var(--muted); }
.card strong { display: block; margin-top: 8px; font-size: 28px; font-variant-numeric: tabular-nums; }
.section { margin-top: 22px; }
.overview-grid { grid-template-columns: 1.2fr 0.8fr; }
.gap { margin-bottom: 14px; }
.detail-meta { margin-top: 8px; }
.section-head, .row-actions { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.panel { padding: 16px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.delta { color: var(--good); font-weight: 700; }
.state { display: inline-flex; border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 700; background: var(--info-bg); color: var(--info); }
.state.reduced { background: var(--good-bg); color: var(--good); }
.state.conflict, .state.failed, .state.deleted { background: var(--bad-bg); color: var(--bad); }
.state.skipped, .state.missed { background: #eeeae4; color: var(--muted); }
.state.restored, .state.external_kept { background: var(--warn-bg); color: var(--warn); }
.state.scheduled, .state.pending { background: var(--info-bg); color: var(--info); }
.state.active { background: var(--good-bg); color: var(--good); }
.state.reverting { background: var(--warn-bg); color: var(--warn); }
.state.ended { background: #eeeae4; color: #4d473f; }

.editor { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr); gap: 16px; align-items: start; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.span-2 { grid-column: span 2; }
.choice { display: flex; gap: 8px; flex-wrap: wrap; }
.choice label {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 600;
}
.choice input { width: auto; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 600; }
.check input { width: auto; margin-top: 3px; }
.filters { display: grid; gap: 8px; }
.filter-row { display: grid; grid-template-columns: 1.1fr 0.9fr 1.3fr auto; gap: 8px; }
.help { color: var(--muted); font-size: 13px; }
.split { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.sticky { position: sticky; top: 16px; display: grid; gap: 12px; }
.list-button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 0;
}
.list-button strong { font-size: 16px; }
.empty { padding: 28px 8px; color: var(--muted); }
.table-wrap { overflow-x: auto; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.log { display: grid; gap: 8px; margin-top: 8px; }
.log div { font-size: 14px; }
.log time { color: var(--faint); margin-right: 8px; }

@media (max-width: 980px) {
  .login, .shell, .editor, .grid, .form-grid, .overview-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .shell { display: block; }
  .rail { padding: 16px; }
  .nav { grid-auto-flow: column; overflow-x: auto; }
  .rail-foot { margin-top: 12px; }
  .main { padding: 20px 16px 40px; }
  .top { display: grid; }
  .filter-row { grid-template-columns: 1fr; }
  .login-hero { min-height: 280px; padding: 28px 22px; }
}

.brand-logo { display: block; width: 184px; max-width: 100%; height: auto; margin: 2px 0 18px; }
.brand-name { font-size: 23px; font-weight: 700; letter-spacing: -.03em; }
.rail { border-top: 4px solid #073d56; }
.top h1 { font-size: clamp(28px, 3vw, 38px); letter-spacing: -.04em; }
.card, .panel { border-radius: 14px; }
.btn { border-radius: 10px; }
.btn.ghost { border-color: #51616d; }
.nav button.active { box-shadow: inset 3px 0 0 #7bb5ce; }
.note { background: #edf4f7; color: #174357; border: 1px solid #d2e3eb; }
.existing-compare { background: #fff1dd; color: #8a4c0a; margin-bottom: 4px; }
input:focus, select:focus { border-color: #073d56; }
.preview-panel { margin-top: 20px; }
.preview-panel table { table-layout: fixed; min-width: 680px; }
.preview-panel th:first-child { width: 28%; }
.preview-panel th:nth-child(2) { width: 18%; }
.preview-panel th:nth-child(3), .preview-panel th:nth-child(4) { width: 16%; }
.preview-panel th:last-child { width: 22%; }
.preview-panel .help { white-space: normal; }
.preview-panel .state { max-width: 100%; }
