:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #667085;
  --line: #e4ded3;
  --paper: #fffdf8;
  --page: #f4f1e9;
  --panel: #fbf8f0;
  --yellow: #ffd83d;
  --teal: #0e9488;
  --green: #2f8b57;
  --rose: #d8486f;
  --blue: #2c5f9e;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 216, 61, 0.26), rgba(244, 241, 233, 0) 220px),
    var(--page);
}

button,
select {
  font: inherit;
}

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

.admin-topbar,
.panel-head,
.status-strip,
.ops-layout,
.two-column {
  display: grid;
  gap: 12px;
}

.admin-topbar {
  grid-template-columns: 1fr auto;
  align-items: center;
  margin-bottom: 16px;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1;
}

h2 {
  font-size: 18px;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.top-actions a,
.top-actions button,
.nav-list button {
  min-height: 38px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 8px;
  color: var(--ink);
  background: var(--paper);
  padding: 0 12px;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}

.top-actions button:last-child {
  background: var(--yellow);
}

.status-strip {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 14px;
}

.metric,
.panel,
.side-panel {
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.07);
}

.metric {
  min-height: 78px;
  padding: 12px;
}

.metric span,
.panel-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric strong {
  display: block;
  margin-top: 7px;
  font-size: 22px;
  line-height: 1;
}

.metric strong.good {
  color: var(--green);
}

.metric strong.warn {
  color: var(--rose);
}

.metric strong.info {
  color: var(--teal);
}

.ops-layout {
  grid-template-columns: 220px 1fr;
  align-items: start;
}

.side-panel {
  position: sticky;
  top: 12px;
  padding: 14px;
}

.nav-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.nav-list button {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  width: 100%;
  background: var(--panel);
}

.nav-list button.active {
  background: var(--yellow);
}

.badge {
  min-width: 28px;
  border-radius: 999px;
  color: white;
  background: var(--ink);
  padding: 3px 7px;
  text-align: center;
  font-size: 12px;
}

.workbench {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.panel {
  padding: 14px;
}

.panel-head {
  grid-template-columns: 1fr auto;
  align-items: center;
  margin-bottom: 12px;
}

select {
  min-height: 36px;
  min-width: 180px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 8px;
  background: var(--paper);
  padding: 0 10px;
}

.health-grid,
.sync-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.health-item,
.sync-item {
  min-height: 92px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
}

.health-item strong,
.sync-item strong {
  display: block;
  margin-bottom: 5px;
  font-size: 24px;
}

.health-item p,
.sync-item p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.45;
}

.sync-table {
  margin-top: 10px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  background: var(--paper);
}

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #344054;
  background: #f7f0df;
  font-size: 12px;
}

td strong {
  display: block;
  margin-bottom: 2px;
}

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

.priority {
  display: inline-flex;
  min-width: 38px;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: white;
  background: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.priority.p1 {
  background: var(--rose);
}

.priority.p2 {
  background: #c77b16;
}

.two-column {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
}

.rank-list,
.mini-table {
  display: grid;
  gap: 8px;
}

.rank-row,
.dist-row {
  display: grid;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 8px;
  background: var(--panel);
  padding: 9px 10px;
}

.rank-row {
  grid-template-columns: 34px 1fr auto;
}

.dist-row {
  grid-template-columns: 1fr auto auto;
}

.rank-index {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--ink);
  background: var(--yellow);
  font-weight: 900;
}

.rank-title strong,
.dist-row strong {
  display: block;
}

.rank-title span,
.dist-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.money {
  color: var(--teal);
  font-weight: 900;
}

.empty {
  min-height: 120px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed rgba(17, 24, 39, 0.18);
  border-radius: 8px;
  font-weight: 900;
}

@media (max-width: 900px) {
  .admin-topbar,
  .ops-layout,
  .two-column,
  .status-strip,
  .health-grid,
  .sync-grid {
    grid-template-columns: 1fr;
  }

  .top-actions {
    justify-content: stretch;
  }

  .top-actions a,
  .top-actions button {
    flex: 1 1 auto;
  }

  .side-panel {
    position: static;
  }
}
