:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #dfe4ee;
  --accent: #2447ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

a {
  color: var(--accent);
  text-decoration: none;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.hero,
.panel,
.cards article {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 12px 40px rgba(23, 32, 51, 0.06);
}

.hero {
  padding: 48px;
}

.badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

h1 {
  margin: 18px 0 14px;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.05;
}

h2 {
  margin-top: 0;
}

p {
  font-size: 18px;
  line-height: 1.55;
}

.muted {
  color: var(--muted);
}

.actions,
.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.actions {
  margin-top: 28px;
}

.actions a,
.topnav a,
button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 700;
}

.actions a:first-child {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.cards article,
.panel {
  padding: 28px;
}

.topnav {
  margin-bottom: 18px;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 18px;
  padding: 24px;
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.chatbox {
  display: grid;
  gap: 12px;
}

textarea {
  width: 100%;
  min-height: 160px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  font: inherit;
  resize: vertical;
}

button {
  width: fit-content;
  color: var(--muted);
}

@media (max-width: 800px) {
  .hero {
    padding: 28px;
  }

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

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.form-grid label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  background: #fff;
  color: var(--text);
}

.alert {
  margin-top: 18px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
  border-radius: 16px;
  padding: 14px 16px;
  font-weight: 700;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

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

th {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.small {
  margin-top: 4px;
  font-size: 13px;
}

.pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 8px;
  background: #eef2ff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

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

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

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.status-grid div {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: #fbfcff;
}

.status-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.status-grid strong {
  font-size: 18px;
}

.details-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

.meta-list {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px 18px;
}

.meta-list dt {
  color: var(--muted);
  font-weight: 700;
}

.meta-list dd {
  margin: 0;
  word-break: break-word;
}

.steps {
  margin: 0;
  padding-left: 22px;
}

.steps li {
  margin: 0 0 10px;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .status-grid,
  .details-grid {
    grid-template-columns: 1fr;
  }

  .meta-list {
    grid-template-columns: 1fr;
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.stat-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  background: #fbfcff;
  color: var(--text);
}

.stat-card span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.stat-card strong {
  font-size: 36px;
  line-height: 1;
}

.danger-card strong {
  color: #b42318;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fbfcff;
}

.filters-grid label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.filters-grid label span {
  font-size: 13px;
  color: var(--muted);
}

.filters-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  align-items: center;
}

.filters-actions a {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 700;
}

.status-working,
.sync-synced,
.index-indexed {
  background: #ecfdf3;
  color: #027a48;
}

.status-approved {
  background: #eff8ff;
  color: #175cd3;
}

.status-archived,
.status-superseded {
  background: #f2f4f7;
  color: #475467;
}

.status-error,
.sync-error,
.index-error {
  background: #fef3f2;
  color: #b42318;
}

.sync-never_synced,
.index-not_indexed {
  background: #fffaeb;
  color: #b54708;
}

.sync-queued,
.sync-syncing,
.index-queued,
.index-indexing {
  background: #eef4ff;
  color: #3538cd;
}

@media (max-width: 1000px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 620px) {
  .stats-grid,
  .filters-grid {
    grid-template-columns: 1fr;
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(245, 247, 251, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.site-header-inner {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  letter-spacing: -0.06em;
}

.brand-text {
  display: grid;
  gap: 2px;
}

.brand-text strong {
  font-size: 16px;
}

.brand-text small {
  color: var(--muted);
  font-size: 12px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.site-nav a {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 13px;
  color: var(--muted);
  font-weight: 700;
}

.site-nav a:hover,
.site-nav a.is-active {
  background: #fff;
  border-color: var(--line);
  color: var(--accent);
}

.hero-neo {
  position: relative;
  overflow: hidden;
}

.hero-neo::after {
  content: "";
  position: absolute;
  right: -100px;
  top: -120px;
  width: 360px;
  height: 360px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(36, 71, 255, 0.16), rgba(36, 71, 255, 0));
  pointer-events: none;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
  position: relative;
  z-index: 1;
}

.quick-actions a {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 800;
}

.quick-actions .primary-action {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.panel + .panel,
.panel + .details-grid,
.details-grid + .panel {
  margin-top: 18px;
}

@media (max-width: 820px) {
  .site-header-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 0;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .brand-text small {
    display: none;
  }
}
