:root {
  --bg: #f2eadf;
  --panel: rgba(255, 250, 242, 0.92);
  --panel-strong: #fffaf1;
  --ink: #162b2c;
  --muted: #5d6c69;
  --line: rgba(23, 52, 53, 0.12);
  --accent: #0f8b8d;
  --accent-strong: #12696a;
  --accent-soft: rgba(15, 139, 141, 0.13);
  --danger: #be4f3f;
  --warning: #c9871b;
  --success: #297257;
  --shadow: 0 24px 70px rgba(17, 35, 35, 0.11);
  --radius: 24px;
  --radius-sm: 16px;
  --mono: "IBM Plex Mono", "SFMono-Regular", monospace;
  --sans: "Avenir Next", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(15, 139, 141, 0.12), transparent 34%),
    radial-gradient(circle at top right, rgba(242, 95, 92, 0.16), transparent 28%),
    linear-gradient(180deg, #f8f1e6 0%, #efe4d5 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

.backdrop {
  position: fixed;
  inset: auto;
  border-radius: 999px;
  filter: blur(40px);
  pointer-events: none;
  opacity: 0.65;
}

.backdrop-one {
  width: 320px;
  height: 320px;
  top: 80px;
  right: -80px;
  background: rgba(15, 139, 141, 0.24);
}

.backdrop-two {
  width: 280px;
  height: 280px;
  bottom: -40px;
  left: -40px;
  background: rgba(242, 95, 92, 0.2);
}

.layout {
  width: min(1240px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
}

.brand-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.brand-note,
.muted,
.table-secondary,
.empty-state,
.field small,
.alert-inline {
  color: var(--muted);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.nav a {
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.7);
  border: 1px solid rgba(23, 52, 53, 0.08);
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.nav a:hover,
.nav a.active {
  background: var(--panel-strong);
  border-color: rgba(15, 139, 141, 0.3);
  transform: translateY(-1px);
}

.content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: rise 320ms ease-out;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.hero-panel,
.section-head,
.toolbar,
.details-grid,
.subscription-grid,
.settings-layout,
.pagination,
.actions,
.card-top {
  display: flex;
  gap: 16px;
}

.hero-panel,
.section-head,
.toolbar,
.pagination,
.card-top {
  justify-content: space-between;
  align-items: center;
}

.hero-metric,
.hero-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-metric {
  flex-direction: column;
  justify-content: center;
  min-width: 170px;
  border-radius: 22px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(15, 139, 141, 0.12), rgba(18, 105, 106, 0.22));
}

.hero-metric span {
  font-size: 2rem;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
}

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

h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
}

h2 {
  font-size: 1.4rem;
}

h3 {
  font-size: 1rem;
}

.flash-stack {
  display: grid;
  gap: 10px;
}

.flash {
  padding: 14px 18px;
  border-radius: 18px;
  border: 1px solid transparent;
}

.flash-success {
  background: rgba(41, 114, 87, 0.1);
  border-color: rgba(41, 114, 87, 0.18);
}

.flash-error {
  background: rgba(190, 79, 63, 0.1);
  border-color: rgba(190, 79, 63, 0.18);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
  background: var(--accent-strong);
}

.button-secondary {
  background: rgba(255, 250, 242, 0.7);
  color: var(--ink);
  border: 1px solid var(--line);
}

.button-secondary:hover {
  background: var(--panel-strong);
}

.button-danger {
  background: var(--danger);
}

.button-danger:hover {
  background: #a83d2d;
}

.toolbar {
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.search {
  min-width: min(520px, 100%);
}

.search span,
.field span,
.field small {
  display: block;
  margin-bottom: 8px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

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

th {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

tbody tr:hover {
  background: rgba(15, 139, 141, 0.045);
}

.table-primary {
  font-weight: 700;
}

.table-action a {
  color: var(--accent-strong);
  font-weight: 700;
}

.pagination {
  margin-top: 18px;
  flex-wrap: wrap;
}

.pagination-actions {
  display: flex;
  gap: 10px;
}

.details-grid {
  align-items: start;
}

.details-grid > * {
  flex: 1 1 0;
}

.info-grid,
.metric-list {
  display: grid;
  gap: 14px;
}

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

.info-grid div,
.metric-list div {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 250, 242, 0.8);
  border: 1px solid rgba(23, 52, 53, 0.06);
}

dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

dd {
  margin: 0;
  font-weight: 700;
}

.subscription-grid {
  flex-wrap: wrap;
}

.subscription-card {
  flex: 1 1 280px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 250, 242, 0.78);
  border: 1px solid rgba(23, 52, 53, 0.08);
}

.subscription-form,
.inline-form {
  margin-top: 16px;
}

.subscription-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.long-link {
  display: block;
  margin-top: 16px;
  word-break: break-all;
  color: var(--accent-strong);
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: lowercase;
}

.pill-success {
  background: rgba(41, 114, 87, 0.12);
  color: var(--success);
}

.pill-warning {
  background: rgba(201, 135, 27, 0.12);
  color: var(--warning);
}

.pill-danger {
  background: rgba(190, 79, 63, 0.12);
  color: var(--danger);
}

.editor-form,
.stack-form,
.stack,
.doc-list,
.section-menu {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.code-editor,
input[type="search"],
input[type="text"],
input[type="password"],
input[type="number"] {
  width: 100%;
  border: 1px solid rgba(23, 52, 53, 0.12);
  border-radius: 16px;
  background: rgba(255, 250, 242, 0.84);
  color: var(--ink);
  font: inherit;
  padding: 14px 16px;
  outline: none;
}

.code-editor {
  min-height: 360px;
  resize: vertical;
  font-family: var(--mono);
  line-height: 1.5;
}

.json-field {
  width: 100%;
  min-height: 160px;
  resize: vertical;
  border: 1px solid rgba(23, 52, 53, 0.12);
  border-radius: 16px;
  background: rgba(255, 250, 242, 0.84);
  color: var(--ink);
  font: inherit;
  font-family: var(--mono);
  padding: 14px 16px;
  outline: none;
  line-height: 1.5;
}

input:focus,
.code-editor:focus,
.json-field:focus {
  border-color: rgba(15, 139, 141, 0.4);
  box-shadow: 0 0 0 4px rgba(15, 139, 141, 0.08);
}

.mono {
  font-family: var(--mono);
}

.broadcast-error {
  max-width: 320px;
  word-break: break-word;
}

.settings-layout {
  align-items: start;
}

.side-panel {
  width: min(290px, 100%);
  position: sticky;
  top: 16px;
}

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

.menu-card {
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.menu-card:hover {
  transform: translateY(-3px);
  border-color: rgba(15, 139, 141, 0.26);
  background: rgba(255, 250, 242, 0.98);
}

.doc-link {
  display: block;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 250, 242, 0.7);
  border: 1px solid transparent;
}

.doc-link.active {
  border-color: rgba(15, 139, 141, 0.26);
  background: rgba(15, 139, 141, 0.09);
}

.settings-group {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 250, 242, 0.7);
  border: 1px solid rgba(23, 52, 53, 0.06);
}

.group-head {
  margin-bottom: 14px;
}

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

.field {
  display: block;
}

.field-checkbox {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(23, 52, 53, 0.08);
  background: rgba(255, 250, 242, 0.72);
}

.field-checkbox span {
  margin: 0;
}

.field-checkbox input {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
}

.field-readonly {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px dashed rgba(23, 52, 53, 0.18);
  background: rgba(255, 250, 242, 0.52);
}

.field-readonly code {
  display: block;
  margin-bottom: 8px;
  white-space: pre-wrap;
  font-family: var(--mono);
}

.login-panel {
  width: min(560px, 100%);
  margin: 8vh auto 0;
}

.empty-state {
  padding: 20px;
  text-align: center;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .header,
  .hero-panel,
  .details-grid,
  .settings-layout {
    flex-direction: column;
  }

  .side-panel {
    width: 100%;
    position: static;
  }
}

@media (max-width: 720px) {
  .layout {
    width: min(100vw - 18px, 1240px);
    padding-top: 18px;
  }

  .panel {
    padding: 18px;
    border-radius: 20px;
  }

  .info-grid,
  .form-grid,
  .section-menu,
  .broadcast-form {
    grid-template-columns: 1fr;
  }

  .nav {
    width: 100%;
  }
}
