:root {
  --bg: #f5efe4;
  --surface: rgba(255, 252, 247, 0.84);
  --surface-strong: #fffdf8;
  --line: rgba(102, 75, 32, 0.14);
  --ink: #1d1a16;
  --muted: #6b6257;
  --brand: #b5512d;
  --brand-deep: #8c3414;
  --accent: #1e5f52;
  --danger: #ba3f3f;
  --success: #1f7a53;
  --shadow: 0 24px 64px rgba(64, 42, 16, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(210, 126, 88, 0.22), transparent 30%),
    radial-gradient(circle at top right, rgba(53, 128, 110, 0.18), transparent 28%),
    linear-gradient(180deg, #f8f1e6 0%, #f2e8d8 100%);
  position: relative;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

code {
  font-family: "Courier New", monospace;
  font-size: 13px;
}

.page-glow {
  position: fixed;
  width: 340px;
  height: 340px;
  border-radius: 999px;
  filter: blur(12px);
  opacity: 0.5;
  pointer-events: none;
}

.page-glow-left {
  top: -120px;
  left: -80px;
  background: rgba(205, 112, 71, 0.3);
}

.page-glow-right {
  top: 160px;
  right: -120px;
  background: rgba(63, 122, 109, 0.22);
}

.shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
  display: grid;
  gap: 22px;
  position: relative;
  z-index: 1;
}

.hero,
.panel,
.table-card,
.alert {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
  gap: 22px;
  padding: 28px;
  border-radius: 32px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 249, 239, 0.88)),
    linear-gradient(120deg, rgba(181, 81, 45, 0.08), rgba(30, 95, 82, 0.08));
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand-deep);
}

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

h1 {
  margin-bottom: 14px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

h2 {
  margin-bottom: 8px;
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.03em;
}

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

.hero-text {
  max-width: 680px;
  font-size: 18px;
  line-height: 1.6;
}

.hero-stats {
  display: grid;
  gap: 16px;
}

.stat-card {
  padding: 20px;
  border-radius: 24px;
  background: rgba(255, 250, 244, 0.94);
  border: 1px solid rgba(99, 77, 45, 0.1);
  display: grid;
  gap: 8px;
}

.stat-label,
.info-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.stat-value {
  font-size: 28px;
  line-height: 1.1;
}

.stat-note {
  color: var(--muted);
  font-size: 14px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 22px;
}

.panel,
.table-card {
  border-radius: 28px;
  background: var(--surface);
}

.panel {
  padding: 24px;
}

.panel-soft {
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.96), rgba(255, 248, 239, 0.88));
}

.panel-strong {
  background:
    linear-gradient(160deg, rgba(255, 251, 244, 0.96), rgba(246, 236, 219, 0.92));
}

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

.info-stack {
  display: grid;
  gap: 14px;
}

.info-card {
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(107, 98, 87, 0.14);
  background: rgba(255, 255, 255, 0.72);
  display: grid;
  gap: 10px;
}

.copy-field,
.cell-copy {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.copy-field code,
.cell-copy code {
  display: inline-block;
  max-width: none;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(35, 31, 28, 0.06);
  color: #2d241c;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

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

label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid rgba(98, 81, 58, 0.18);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  outline: none;
}

input:focus {
  border-color: rgba(181, 81, 45, 0.5);
  box-shadow: 0 0 0 4px rgba(181, 81, 45, 0.1);
}

button {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: #fffaf5;
  font-weight: 700;
  transition: transform 160ms ease, opacity 160ms ease;
}

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

.ghost-button,
.secondary {
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  border: 1px solid rgba(98, 81, 58, 0.14);
}

.secondary {
  color: var(--danger);
}

.copy-button {
  min-height: 36px;
  padding: 0 14px;
  white-space: nowrap;
}

.form-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-start;
}

.alert {
  padding: 15px 18px;
  border-radius: 18px;
  font-weight: 700;
}

.alert.success {
  background: rgba(236, 251, 242, 0.9);
  color: var(--success);
}

.alert.error {
  background: rgba(255, 240, 240, 0.92);
  color: var(--danger);
}

.table-card {
  padding: 22px;
  overflow: hidden;
}

.section-note {
  margin: 0;
  padding-top: 6px;
}

.table-shell {
  margin-top: 18px;
  border: 1px solid rgba(98, 81, 58, 0.12);
  border-radius: 24px;
  background: rgba(255, 253, 248, 0.82);
  overflow: hidden;
}

.table-scroll-note {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(98, 81, 58, 0.1);
  background: linear-gradient(180deg, rgba(255, 250, 242, 0.96), rgba(251, 245, 234, 0.92));
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable both-edges;
  overscroll-behavior-x: contain;
}

table {
  width: 100%;
  min-width: 1380px;
  border-collapse: collapse;
  table-layout: auto;
  background: rgba(255, 253, 248, 0.6);
}

th,
td {
  padding: 16px 14px;
  border-bottom: 1px solid rgba(98, 81, 58, 0.12);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(247, 239, 225, 0.96);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

td {
  background: rgba(255, 252, 247, 0.74);
}

tbody tr:hover td {
  background: rgba(255, 248, 239, 0.96);
}

th:nth-child(1),
td:nth-child(1) {
  min-width: 190px;
}

th:nth-child(2),
td:nth-child(2) {
  min-width: 230px;
}

th:nth-child(3),
td:nth-child(3) {
  min-width: 230px;
}

th:nth-child(4),
td:nth-child(4) {
  min-width: 230px;
}

th:nth-child(5),
td:nth-child(5) {
  min-width: 120px;
}

th:nth-child(6),
td:nth-child(6) {
  min-width: 170px;
}

th:nth-child(7),
td:nth-child(7) {
  min-width: 210px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge.active {
  background: rgba(31, 122, 83, 0.12);
  color: var(--success);
}

.badge.inactive {
  background: rgba(186, 63, 63, 0.12);
  color: var(--danger);
}

.inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
  min-width: 210px;
  align-items: center;
}

.inline-actions form {
  margin: 0;
}

.empty-state {
  padding: 22px 8px;
  color: var(--muted);
}

.copy-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  padding: 12px 16px;
  border-radius: 999px;
  background: #1d1a16;
  color: #fffaf5;
  box-shadow: 0 18px 38px rgba(29, 26, 22, 0.28);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 10;
}

.copy-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .hero,
  .content-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .panel-head,
  .section-head {
    flex-direction: column;
  }

  .table-card {
    padding: 18px;
  }

  .table-scroll-note {
    display: block;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 20px, 1240px);
    padding: 20px 0 36px;
  }

  .hero,
  .panel,
  .table-card {
    border-radius: 24px;
    padding: 18px;
  }

  h1 {
    font-size: 34px;
  }

  h2 {
    font-size: 24px;
  }

  .table-shell {
    border-radius: 20px;
  }

  .table-scroll-note {
    font-size: 12px;
  }

  .table-wrap {
    margin: 0;
  }

  table {
    min-width: 1220px;
  }

  th,
  td {
    padding: 14px 10px;
  }

  .cell-copy,
  .inline-actions {
    align-items: center;
    flex-direction: row;
  }
}
