:root {
  --admin-bg: #0b1425;
  --admin-rail: rgba(255, 255, 255, 0.06);
  --admin-rail-strong: rgba(255, 255, 255, 0.1);
  --admin-text: rgba(248, 247, 241, 0.92);
  --admin-text-soft: rgba(248, 247, 241, 0.7);
  --admin-shadow: 0 22px 54px rgba(4, 9, 18, 0.46);
}

body {
  padding: 0;
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 125, 69, 0.22), transparent 38%),
    radial-gradient(circle at 78% 8%, rgba(40, 181, 164, 0.18), transparent 34%),
    linear-gradient(165deg, #060d19 0%, #0b1425 40%, #121f36 100%);
  color: var(--admin-text);
}

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

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 18px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(4, 9, 18, 0.48);
  backdrop-filter: blur(18px);
}

.brand-block {
  border-radius: 26px;
  padding: 18px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.brand-kicker {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 177, 131, 0.82);
}

.brand-block h1 {
  margin: 10px 0 0;
  font-family: "Iowan Old Style", "Baskerville", "Songti SC", serif;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: rgba(252, 250, 244, 0.96);
}

.brand-block p {
  margin: 12px 0 0;
  line-height: 1.7;
  color: var(--admin-text-soft);
  font-size: 14px;
}

.side-nav {
  display: grid;
  gap: 10px;
  align-content: start;
}

.side-nav a {
  text-decoration: none;
  color: rgba(248, 247, 241, 0.86);
  border-radius: 18px;
  padding: 12px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.side-nav a:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 177, 131, 0.32);
  background: rgba(255, 125, 69, 0.08);
}

.side-foot {
  display: grid;
  gap: 10px;
}

.side-link {
  text-decoration: none;
  text-align: center;
  border-radius: 18px;
  padding: 12px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(248, 247, 241, 0.9);
}

.admin-main {
  padding: 22px 22px 94px;
  display: grid;
  gap: 18px;
}

.hero-panel {
  border-radius: 30px;
  padding: 22px;
  background:
    radial-gradient(circle at top right, rgba(255, 125, 69, 0.18), transparent 34%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--admin-shadow);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
}

.hero-kicker {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 177, 131, 0.82);
}

.hero-panel h2 {
  margin: 10px 0 0;
  font-family: "Iowan Old Style", "Baskerville", "Songti SC", serif;
  letter-spacing: -0.02em;
  font-size: 34px;
  line-height: 1.06;
  color: rgba(252, 250, 244, 0.96);
}

.hero-copy {
  margin: 12px 0 0;
  line-height: 1.7;
  color: rgba(248, 247, 241, 0.72);
  font-size: 14px;
  max-width: 66ch;
}

.hero-actions {
  display: grid;
  gap: 10px;
  align-content: end;
  min-width: 160px;
}

.primary-button,
.ghost-button {
  appearance: none;
  border: 0;
  cursor: pointer;
  border-radius: 18px;
  min-height: 50px;
  padding: 12px 14px;
  font-weight: 700;
  transition: transform 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fffaf6;
  box-shadow: 0 18px 34px rgba(255, 125, 69, 0.22);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(248, 247, 241, 0.92);
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled,
.ghost-button:disabled {
  opacity: 0.46;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.admin-section {
  border-radius: 30px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(4, 9, 18, 0.24);
  box-shadow: var(--admin-shadow);
}

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

.section-kicker {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 177, 131, 0.82);
}

.admin-section h3 {
  margin: 10px 0 0;
  font-family: "Iowan Old Style", "Baskerville", "Songti SC", serif;
  letter-spacing: -0.02em;
  font-size: 28px;
  line-height: 1.06;
}

.section-note {
  margin: 0;
  color: rgba(248, 247, 241, 0.64);
  max-width: 46ch;
  line-height: 1.6;
  font-size: 13px;
  text-align: right;
}

.panel-surface {
  margin-top: 16px;
  border-radius: 26px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.metrics-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  border-radius: 22px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.metric-card span {
  display: block;
  font-size: 12px;
  color: rgba(248, 247, 241, 0.64);
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  font-size: 24px;
  line-height: 1.05;
  font-family: "Iowan Old Style", "Baskerville", "Songti SC", serif;
}

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

.status-card {
  border-radius: 22px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
}

.status-card h4 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: rgba(252, 250, 244, 0.92);
}

.status-card p {
  margin: 10px 0 0;
  line-height: 1.7;
  color: rgba(248, 247, 241, 0.72);
  font-size: 13px;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-form.compact-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 13px;
  color: rgba(248, 247, 241, 0.72);
}

.field input,
.field select {
  width: 100%;
  border-radius: 16px;
  padding: 14px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(4, 9, 18, 0.28);
  color: rgba(252, 250, 244, 0.94);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.field input:focus,
.field select:focus {
  border-color: rgba(40, 181, 164, 0.46);
  box-shadow: 0 0 0 4px rgba(40, 181, 164, 0.12);
  transform: translateY(-1px);
}

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

.toggle-field {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 12px;
  align-items: start;
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  line-height: 1.7;
  color: rgba(248, 247, 241, 0.72);
  font-size: 13px;
}

.toggle-field input {
  margin-top: 4px;
}

.toolbar {
  margin-top: 16px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar.compact {
  margin-top: 12px;
}

.inline-status {
  margin: 12px 0 0;
  color: rgba(248, 247, 241, 0.66);
  line-height: 1.6;
  font-size: 13px;
}

.provider-card {
  grid-column: 1 / -1;
  border-radius: 22px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top right, rgba(40, 181, 164, 0.12), transparent 46%),
    rgba(255, 255, 255, 0.03);
}

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

.provider-kicker {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(40, 181, 164, 0.84);
}

.provider-head h4 {
  margin: 8px 0 0;
  font-family: "Iowan Old Style", "Baskerville", "Songti SC", serif;
  font-size: 20px;
  line-height: 1.1;
  color: rgba(252, 250, 244, 0.96);
}

.provider-badge {
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(248, 247, 241, 0.74);
  flex-shrink: 0;
}

.provider-badge.is-on {
  background: rgba(40, 181, 164, 0.16);
  color: rgba(196, 252, 238, 0.92);
  border-color: rgba(40, 181, 164, 0.22);
}

.provider-badge.is-off {
  background: rgba(170, 63, 63, 0.14);
  color: rgba(255, 218, 218, 0.92);
  border-color: rgba(170, 63, 63, 0.24);
}

.provider-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.draft-card {
  border-radius: 22px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(248, 247, 241, 0.76);
  line-height: 1.7;
}

.draft-card dl {
  margin: 0;
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 10px 14px;
}

.draft-card dt {
  color: rgba(248, 247, 241, 0.62);
}

.draft-card dd {
  margin: 0;
  color: rgba(252, 250, 244, 0.92);
}

.filter-bar {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 14px;
}

.records-list {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.record-card {
  border-radius: 22px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.record-card.empty {
  text-align: center;
  color: rgba(248, 247, 241, 0.66);
  line-height: 1.7;
}

.record-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.record-title {
  display: grid;
  gap: 6px;
}

.record-title strong {
  font-size: 18px;
  line-height: 1.25;
  color: rgba(252, 250, 244, 0.96);
}

.record-title span {
  font-size: 13px;
  color: rgba(248, 247, 241, 0.68);
  line-height: 1.6;
}

.record-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.chip {
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(248, 247, 241, 0.74);
}

.chip.is-accent {
  border-color: rgba(255, 125, 69, 0.22);
  background: rgba(255, 125, 69, 0.12);
  color: rgba(255, 219, 200, 0.92);
}

.chip.is-mint {
  border-color: rgba(40, 181, 164, 0.22);
  background: rgba(40, 181, 164, 0.14);
  color: rgba(196, 252, 238, 0.92);
}

.record-details {
  margin-top: 14px;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
  padding-top: 14px;
  display: grid;
  gap: 12px;
}

.record-details dl {
  margin: 0;
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 10px 14px;
}

.record-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.danger-button {
  appearance: none;
  border: 1px solid rgba(255, 158, 158, 0.26);
  background: rgba(170, 63, 63, 0.18);
  color: rgba(255, 222, 222, 0.94);
  border-radius: 18px;
  padding: 12px 14px;
  min-height: 50px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.danger-button:hover {
  transform: translateY(-1px);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  z-index: 24;
  border-radius: 999px;
  padding: 10px 16px;
  background: rgba(10, 16, 28, 0.96);
  color: rgba(248, 247, 241, 0.92);
  font-size: 13px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 980px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: relative;
    height: auto;
    grid-template-rows: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

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

@media (max-width: 640px) {
  .admin-main {
    padding: 16px 12px 84px;
  }

  .hero-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions {
    min-width: unset;
    grid-template-columns: 1fr;
  }

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

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

  .admin-form,
  .admin-form.compact-form,
  .provider-grid,
  .filter-bar {
    grid-template-columns: 1fr;
  }
}

