:root {
  color-scheme: light;
  --bg: #f4f6f4;
  --surface: #ffffff;
  --surface-soft: #f7faf8;
  --text: #1d2321;
  --muted: #697371;
  --line: #dfe5e1;
  --accent: #176b5b;
  --accent-strong: #0f4d41;
  --blue: #2f5f91;
  --red: #b6473d;
  --amber: #b97519;
  --shadow: 0 16px 42px rgba(34, 45, 41, 0.08);
  --radius: 8px;
  --sidebar: 248px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "PingFang SC", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 18px;
  background: #fbfcfa;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}

.brand strong,
.brand span {
  display: block;
}

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

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 0 12px;
  font-weight: 800;
}

.nav-item.active,
.nav-item:hover {
  background: #e5f1ee;
  color: var(--accent-strong);
}

.access-note {
  margin-top: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.access-note span {
  display: block;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 6px;
}

.main {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.2;
}

h2 {
  margin-bottom: 0;
  font-size: 19px;
  line-height: 1.25;
}

h3 {
  margin-bottom: 5px;
  font-size: 15px;
  line-height: 1.35;
}

p {
  color: var(--muted);
  line-height: 1.6;
}

.topbar-actions,
.toolbar,
.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ghost-button,
.primary-button,
.row-actions button,
.data-table button,
.user-list button {
  min-height: 38px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
  font-weight: 800;
}

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

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

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

.metric {
  padding: 16px;
}

.metric span,
.metric em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.metric strong {
  display: block;
  margin: 8px 0 5px;
  font-size: 26px;
}

.ok {
  color: var(--accent);
}

.warn {
  color: var(--amber);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.panel {
  min-width: 0;
  padding: 18px;
}

.table-panel,
.user-panel {
  grid-column: span 1;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.panel-head.compact {
  margin-bottom: 12px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius);
  background: #eef1ee;
}

.segmented button {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  font-weight: 800;
}

.segmented button.active {
  background: var(--surface);
  color: var(--accent-strong);
}

.queue-list,
.health-list,
.user-list {
  display: grid;
  gap: 10px;
}

.queue-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #e8ece8;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.queue-item.danger {
  background: #fff6f2;
  border-color: #f1c9c2;
}

.badge {
  width: 34px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #ffe5df;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
}

.badge.medium {
  background: #fff0d8;
  color: var(--amber);
}

.badge.low {
  background: #e5f1ee;
  color: var(--accent);
}

.health-list div,
.user-list article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.health-list strong,
.health-list em,
.user-list strong,
.user-list em {
  display: block;
}

.health-list em,
.user-list em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
}

.dot.warn {
  background: var(--amber);
}

.toolbar input {
  width: min(260px, 100%);
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  outline: none;
}

.toolbar input:focus {
  border-color: var(--accent);
}

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

.table-row {
  min-width: 720px;
  display: grid;
  grid-template-columns: 90px minmax(220px, 1fr) 130px 110px 90px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.table-row:first-child {
  border-top: 0;
}

.table-head {
  background: #f1f5f2;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.status {
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 900;
}

.status.live {
  color: var(--accent);
  background: #e5f1ee;
}

.status.review {
  color: var(--amber);
  background: #fff0d8;
}

.status.draft {
  color: var(--blue);
  background: #e6eef7;
}

.avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #e5f1ee;
  color: var(--accent-strong);
  font-weight: 900;
}

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

@media (max-width: 860px) {
  .admin-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .nav-item {
    text-align: center;
  }

  .main {
    padding: 18px;
  }

  .topbar,
  .panel-head {
    display: grid;
  }

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

  .queue-item {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .row-actions {
    grid-column: 2;
  }
}

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

  .topbar-actions,
  .toolbar,
  .row-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .topbar-actions button,
  .toolbar input,
  .toolbar button {
    width: 100%;
  }
}
