* { box-sizing: border-box; }
body {
  margin: 0;
  background: #f5f7fb;
  color: #172033;
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: #2456c7; }
.shell { width: min(1120px, calc(100% - 32px)); margin: 28px auto; }
.hero {
  padding: 26px 0 18px;
  border-bottom: 1px solid #dde4f0;
  margin-bottom: 18px;
}
.hero.compact { padding-top: 12px; }
h1 { margin: 0 0 8px; font-size: 30px; line-height: 1.2; }
h2 { margin: 0 0 14px; font-size: 18px; }
h3 { margin: 22px 0 10px; font-size: 15px; }
p { margin: 0 0 10px; }
.panel {
  background: #fff;
  border: 1px solid #dde4f0;
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(26, 37, 64, .06);
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.row, .toolbar, .actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.toolbar { justify-content: space-between; }
label {
  display: block;
  color: #5b667a;
  font-size: 12px;
  margin: 10px 0 4px;
}
input, select {
  width: 100%;
  height: 38px;
  border: 1px solid #ccd5e3;
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  color: #172033;
}
textarea.codeBox {
  width: 100%;
  min-height: 120px;
  margin-top: 12px;
  border: 1px solid #ccd5e3;
  border-radius: 6px;
  padding: 10px;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace;
  resize: vertical;
}
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  background: #2456c7;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
}
button.secondary { background: #e9edf5; color: #344054; }
button.danger { background: #c73535; }
button.warn { background: #a96b00; }
.actions { margin-top: 14px; flex-wrap: wrap; }
.adminEntry { margin-top: 26px; }
.hint { color: #6d7788; font-size: 12px; }
.hidden { display: none; }
.tableWrap { overflow: auto; border: 1px solid #e5eaf2; border-radius: 8px; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 9px 10px; border-bottom: 1px solid #edf1f7; text-align: left; white-space: nowrap; }
th { background: #f8fafd; color: #5b667a; font-size: 12px; }
td.actions { display: flex; gap: 8px; }
code { background: #eef2f8; padding: 2px 5px; border-radius: 4px; }

.adminBody {
  background: #eef2f7;
  color: #172033;
}
.loginShell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.loginBox {
  width: min(440px, 100%);
  background: #fff;
  border: 1px solid #d9e1ec;
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 18px 42px rgba(27, 39, 64, .12);
}
.eyebrow {
  margin: 0 0 6px;
  color: #1b6f5a;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.muted {
  color: #667085;
}
.formStack {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}
.errText {
  color: #bd2d2d;
}
.adminApp {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}
.adminSidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 16px;
  background: #fff;
  border-right: 1px solid #d9e1ec;
}
.brandBlock {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 14px;
  border-bottom: 1px solid #edf1f7;
}
.brandBlock strong,
.brandBlock small {
  display: block;
}
.brandBlock small {
  color: #667085;
  font-size: 12px;
}
.brandMark {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: #1f6f5b;
  color: #fff;
  font-weight: 800;
}
.adminNav {
  display: grid;
  gap: 6px;
}
.navItem,
.sidebarLogout {
  width: 100%;
  min-height: 38px;
  justify-content: flex-start;
  background: transparent;
  color: #344054;
  border: 1px solid transparent;
}
.navItem.active {
  background: #eaf3f0;
  border-color: #c8ded6;
  color: #185c4a;
  font-weight: 700;
}
.sidebarLogout {
  margin-top: auto;
  background: #f4f6fa;
}
.adminMain {
  min-width: 0;
  padding: 24px;
}
.adminTopbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  margin-bottom: 18px;
}
.adminTopbar h1 {
  font-size: 24px;
}
.adminTopbar p {
  color: #667085;
}
.topbarActions {
  display: flex;
  gap: 10px;
}
.adminView {
  display: grid;
  gap: 16px;
}
.statsGrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.statCard {
  min-height: 112px;
  background: #fff;
  border: 1px solid #d9e1ec;
  border-radius: 8px;
  padding: 16px;
}
.statCard span {
  display: block;
  color: #667085;
  font-size: 12px;
}
.statCard strong {
  display: block;
  margin-top: 12px;
  color: #172033;
  font-size: 30px;
  line-height: 1;
}
.sectionBlock {
  background: #fff;
  border: 1px solid #d9e1ec;
  border-radius: 8px;
  padding: 18px;
}
.sectionHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.sectionHeader h2 {
  margin-bottom: 2px;
}
.sectionHeader p {
  color: #667085;
  font-size: 13px;
}
.headerSearch {
  width: min(280px, 100%);
}
.splitLayout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.sideForm {
  display: grid;
  gap: 8px;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid #e3e9f2;
  border-radius: 8px;
}
.sideForm h3 {
  margin-top: 0;
}
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.pill.on {
  background: #e6f4ee;
  color: #17704f;
}
.pill.off {
  background: #f2f4f7;
  color: #667085;
}
.compactBtn {
  min-height: 30px;
  padding: 0 10px;
}
.emptyCell {
  height: 76px;
  color: #667085;
  text-align: center;
}
td small {
  display: block;
  margin-top: 2px;
  color: #667085;
}
.loginShell.hidden,
.adminApp.hidden,
.adminView.hidden {
  display: none;
}
@media (max-width: 760px) {
  .grid { grid-template-columns: 1fr; }
  .row { flex-direction: column; align-items: stretch; }
  .adminApp {
    grid-template-columns: 1fr;
  }
  .adminSidebar {
    position: static;
    height: auto;
  }
  .adminNav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .adminMain {
    padding: 16px;
  }
  .adminTopbar,
  .sectionHeader {
    align-items: stretch;
    flex-direction: column;
  }
  .statsGrid,
  .splitLayout {
    grid-template-columns: 1fr;
  }
}
