:root {
  --bg: #f5f1e8;
  --panel: rgba(255, 252, 246, 0.8);
  --panel-strong: #fff9ef;
  --ink: #1f1a17;
  --muted: #6d625c;
  --accent: #a63d2f;
  --accent-2: #1d5c63;
  --line: rgba(31, 26, 23, 0.12);
  --shadow: 0 24px 60px rgba(60, 32, 18, 0.14);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  background:
    radial-gradient(circle at top left, rgba(166, 61, 47, 0.16), transparent 35%),
    radial-gradient(circle at bottom right, rgba(29, 92, 99, 0.16), transparent 25%),
    linear-gradient(180deg, #efe7da 0%, var(--bg) 100%);
  color: var(--ink);
  min-height: 100vh;
}

.shell-nav {
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  padding: 32px 24px;
  background: rgba(31, 26, 23, 0.92);
  color: #f6efe7;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.shell-nav nav { display: grid; gap: 10px; }
.shell-nav a { color: #f6efe7; text-decoration: none; opacity: 0.88; }
.shell-nav a:hover { opacity: 1; }
.logout-link { margin-top: auto; }
.brand-mark { margin: 0; font-size: 2rem; line-height: 1; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.72rem; color: var(--muted); margin: 0 0 10px; }
.shell-content { margin-left: 260px; padding: 36px; }
.auth-shell { display: grid; min-height: 100vh; place-items: center; padding: 24px; }

.auth-card, .panel, .hero-card, .metric-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.auth-card, .panel { padding: 28px; }
.hero-card {
  padding: 28px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
  margin: 22px 0;
}
.metric-card { padding: 22px; }
.metric-card span { display: block; color: var(--muted); font-size: 0.85rem; margin-bottom: 8px; }
.metric-card strong { font-size: 1.4rem; }

.two-up {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.panel.inset { background: var(--panel-strong); }
.stack { display: grid; gap: 14px; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.form-actions { grid-column: 1 / -1; }
label { display: grid; gap: 8px; font-size: 0.96rem; }
.check { display: flex; align-items: center; gap: 10px; }
input, textarea, select, button {
  font: inherit;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 12px 14px;
}
button {
  background: var(--ink);
  color: #fff9ef;
  cursor: pointer;
  border: none;
}
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  background: transparent;
}
button.secondary {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}
.action-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.pill-row { display: flex; flex-wrap: wrap; gap: 10px; }
.pill {
  border: 1px solid rgba(166, 61, 47, 0.22);
  background: rgba(166, 61, 47, 0.08);
  color: var(--ink);
  padding: 9px 12px;
  border-radius: 999px;
}
.subtle { color: var(--muted); }
.banner.danger {
  margin-bottom: 12px;
  border: 1px solid rgba(166, 61, 47, 0.22);
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(166, 61, 47, 0.08);
}
.list { display: grid; gap: 10px; }
.list-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.preview {
  white-space: pre-wrap;
  background: #f9f3e8;
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--line);
}

@media (max-width: 960px) {
  .shell-nav {
    position: static;
    width: auto;
  }
  .shell-content {
    margin-left: 0;
    padding: 20px;
  }
  .hero-card { flex-direction: column; }
}
