:root {
  --bg: #f2efe8;
  --panel: rgba(255, 252, 246, 0.88);
  --panel-strong: #fffaf1;
  --border: rgba(100, 77, 42, 0.14);
  --text: #2a2116;
  --muted: #7e6d57;
  --accent: #af5f2e;
  --accent-deep: #7c3418;
  --accent-soft: #efe0c7;
  --success: #1e7a58;
  --danger: #9f2f2f;
  --shadow: 0 22px 48px rgba(78, 48, 23, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "PingFang SC", "Noto Sans SC", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(220, 184, 125, 0.32), transparent 28%),
    radial-gradient(circle at bottom right, rgba(175, 95, 46, 0.12), transparent 32%),
    linear-gradient(180deg, #f7f0e3 0%, #efe8dd 100%);
}

.app-shell {
  display: grid;
  grid-template-columns: 290px 1fr;
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  padding: 28px 22px;
  background: rgba(60, 34, 18, 0.92);
  color: #fdf3df;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 26px;
}

.brand-mark {
  width: 18px;
  height: 54px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffca7a 0%, #af5f2e 100%);
}

.brand h1,
.hero h2,
.card-head h3 {
  font-family: Georgia, "Songti SC", serif;
  letter-spacing: 0.02em;
  margin: 0;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  color: rgba(255, 240, 212, 0.72);
  margin-bottom: 6px;
}

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

.nav-item {
  border: 0;
  border-radius: 16px;
  padding: 12px 14px;
  text-align: left;
  background: transparent;
  color: rgba(255, 243, 223, 0.88);
  font-size: 15px;
  cursor: pointer;
  transition: 140ms ease;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 212, 149, 0.16);
  color: #fff7ea;
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 24px;
  display: grid;
  gap: 10px;
}

.main {
  padding: 28px;
}

.hero {
  display: grid;
  grid-template-columns: 1.5fr 360px;
  gap: 20px;
  align-items: stretch;
  margin-bottom: 22px;
}

.status-card,
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.status-card {
  padding: 22px;
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px dashed rgba(87, 61, 34, 0.14);
}

.status-row:last-child {
  border-bottom: 0;
}

.status-error {
  margin-top: 12px;
  min-height: 20px;
  color: var(--danger);
  font-size: 13px;
}

.grid {
  display: grid;
  gap: 18px;
}

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

.card {
  padding: 20px;
  margin-bottom: 18px;
}

.card-head {
  margin-bottom: 16px;
}

.card-head p,
.hero p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

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

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid label,
.toggle {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.full-width {
  grid-column: 1 / -1;
}

.field-label {
  color: rgba(255, 240, 212, 0.72);
  font-size: 12px;
}

.input,
.textarea,
select.input {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(109, 73, 36, 0.18);
  background: var(--panel-strong);
  color: var(--text);
  padding: 11px 13px;
  font: inherit;
}

.textarea {
  min-height: 130px;
  resize: vertical;
}

.input:focus,
.textarea:focus {
  outline: 2px solid rgba(175, 95, 46, 0.2);
  border-color: rgba(175, 95, 46, 0.38);
}

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  grid-column: 1 / -1;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.button {
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff8ed;
  cursor: pointer;
  font-weight: 600;
}

.button-secondary {
  background: #eadbc1;
  color: #563923;
}

.button-danger {
  background: #f1d4d4;
  color: #7b1e1e;
}

.full {
  width: 100%;
}

.table-wrap {
  overflow: auto;
}

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

.table th,
.table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(93, 62, 33, 0.1);
  text-align: left;
  vertical-align: top;
}

.table th {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.table tbody tr {
  cursor: pointer;
}

.table tbody tr:hover {
  background: rgba(175, 95, 46, 0.05);
}

.code-block {
  margin: 14px 0 0;
  padding: 14px;
  border-radius: 18px;
  background: #2a2116;
  color: #f6ead8;
  min-height: 88px;
  white-space: pre-wrap;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.actions-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 12px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: rgba(42, 33, 22, 0.94);
  color: #fff7ea;
  padding: 12px 16px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

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

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

  .hero,
  .grid.two,
  .form-grid,
  .form-grid.three {
    grid-template-columns: 1fr;
  }
}
