@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

:root {
  --bg: #f4efe6;
  --panel: rgba(255, 250, 242, 0.92);
  --line: rgba(16, 17, 18, 0.12);
  --text: #141414;
  --text-soft: #5e5b57;
  --text-invert: #f6f2eb;
  --accent: #b6552d;
  --success: #24634d;
  --warn: #9a5b17;
  --shadow: 0 24px 60px rgba(14, 18, 24, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'IBM Plex Sans', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(182, 85, 45, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(31, 107, 99, 0.12), transparent 24%),
    linear-gradient(135deg, #efe7d8, #f9f4ed 55%, #ebe2d4);
  min-height: 100vh;
}

.theme-ink {
  color: var(--text-invert);
  background:
    radial-gradient(circle at 10% 10%, rgba(182, 85, 45, 0.28), transparent 24%),
    radial-gradient(circle at 90% 10%, rgba(31, 107, 99, 0.24), transparent 18%),
    linear-gradient(160deg, #101318, #141820 42%, #0c0f14);
}

.page-shell, .admin-shell, .login-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.public-shell { padding-top: 42px; }

.hero-panel, .admin-header {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
}

.hero-panel {
  padding: 28px;
  background: linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 12px;
  color: rgba(255,255,255,0.64);
}

.theme-paper .eyebrow { color: rgba(20, 20, 20, 0.56); }

h1, h2, h3 {
  font-family: 'Fraunces', serif;
  margin: 0;
  line-height: 1.02;
}

h1 { font-size: clamp(42px, 7vw, 72px); }
h2 { font-size: 28px; margin-bottom: 18px; }

.hero-text {
  margin: 14px 0 0;
  line-height: 1.7;
  max-width: 52ch;
  opacity: 0.82;
}

.hero-notes {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.hero-notes span, .pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
}

.theme-paper .pill, .theme-paper .hero-notes span {
  border-color: rgba(20,20,20,0.08);
  background: rgba(255,255,255,0.76);
}

.pill-green { color: #dff8ef; background: rgba(36, 99, 77, 0.18); border-color: rgba(36, 99, 77, 0.4); }
.theme-paper .pill-green { color: var(--success); background: rgba(36, 99, 77, 0.12); }
.pill-amber { color: #ffe7bf; background: rgba(154, 91, 23, 0.16); border-color: rgba(154, 91, 23, 0.4); }
.theme-paper .pill-amber { color: var(--warn); background: rgba(154, 91, 23, 0.1); }
.pill-gray { color: rgba(255,255,255,0.78); background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.18); }
.theme-paper .pill-gray { color: #55524c; background: rgba(16,17,18,0.06); border-color: rgba(16,17,18,0.1); }

.hero-art { display: flex; justify-content: center; }
.badge-stack { position: relative; width: 280px; height: 220px; }
.badge-card {
  position: absolute;
  width: 180px;
  height: 120px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-family: 'Fraunces', serif;
  font-size: 38px;
  color: #121417;
  background: linear-gradient(145deg, #ffedd4, #ffffff);
  box-shadow: 0 30px 40px rgba(0, 0, 0, 0.18);
  transform: rotate(-8deg);
}
.badge-card.alt { right: 8px; top: 46px; background: linear-gradient(145deg, #d8fff5, #f6fff9); transform: rotate(10deg); }
.badge-card.thin { left: 64px; bottom: 8px; background: linear-gradient(145deg, #f7e3ff, #fff8ff); font-size: 26px; transform: rotate(-2deg); }

.card-grid, .admin-grid, .stats-grid { display: grid; gap: 18px; }
.card-grid { grid-template-columns: 1.2fr 0.8fr; }
.admin-grid { grid-template-columns: 0.95fr 1.05fr; margin: 20px 0; }
.stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 20px; }

.panel, .stat-card, .login-panel {
  background: var(--panel);
  border-radius: 24px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.panel, .login-panel { padding: 24px; }
.panel.large { min-height: 320px; }
.panel.side { display: flex; flex-direction: column; justify-content: space-between; }
.stat-card { padding: 18px 20px; }
.stat-card span { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-soft); margin-bottom: 14px; }
.stat-card strong { font-size: 38px; font-family: 'Fraunces', serif; }

.stack-form { display: grid; gap: 16px; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
label span { display: inline-block; margin-bottom: 8px; font-size: 13px; color: var(--text-soft); }
input, select, textarea, button { font: inherit; }
input, select, textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(14, 18, 24, 0.12);
  background: rgba(255,255,255,0.9);
  padding: 14px 16px;
  color: var(--text);
}
.theme-ink input, .theme-ink select, .theme-ink textarea {
  background: rgba(255,255,255,0.14);
  color: var(--text-invert);
  border-color: rgba(255,255,255,0.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
.theme-ink input::placeholder, .theme-ink textarea::placeholder {
  color: rgba(246, 242, 235, 0.7);
}
.theme-ink input:focus, .theme-ink select:focus, .theme-ink textarea:focus {
  outline: none;
  border-color: rgba(255,255,255,0.42);
  box-shadow: 0 0 0 4px rgba(214, 120, 80, 0.18);
}
.theme-ink .panel {
  color: var(--text);
}
.theme-ink .panel h2,
.theme-ink .panel label span,
.theme-ink .panel .plain-list,
.theme-ink .panel .plain-list li,
.theme-ink .panel .text-link {
  color: var(--text);
}
.theme-ink .panel input,
.theme-ink .panel select,
.theme-ink .panel textarea {
  background: rgba(255,255,255,0.9);
  color: var(--text);
  border-color: rgba(14, 18, 24, 0.12);
  box-shadow: none;
}
.theme-ink .panel input::placeholder,
.theme-ink .panel textarea::placeholder {
  color: rgba(20, 20, 20, 0.34);
}
.theme-ink .panel input:focus,
.theme-ink .panel select:focus,
.theme-ink .panel textarea:focus {
  border-color: rgba(182, 85, 45, 0.42);
  box-shadow: 0 0 0 4px rgba(182, 85, 45, 0.12);
}

textarea.code-export { min-height: 180px; resize: vertical; margin-bottom: 14px; }
.primary-btn, .ghost-btn, .table-btn {
  border: 0;
  cursor: pointer;
  border-radius: 16px;
  padding: 14px 18px;
  transition: transform 120ms ease;
}
.primary-btn:hover, .ghost-btn:hover, .table-btn:hover { transform: translateY(-1px); }
.primary-btn { background: linear-gradient(135deg, var(--accent), #d57850); color: #fff; box-shadow: 0 12px 24px rgba(182, 85, 45, 0.24); }
.ghost-btn, .table-btn { background: rgba(16,17,18,0.06); color: var(--text); }
.theme-ink .ghost-btn, .theme-ink .table-btn { background: rgba(255,255,255,0.08); color: var(--text-invert); }

.flash {
  margin-bottom: 18px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.8);
}
.theme-ink .flash { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1); }
.flash.success { border-color: rgba(36,99,77,0.28); }
.flash.error { border-color: rgba(154,91,23,0.32); }
.flash h3 { font-size: 22px; margin-bottom: 8px; }
.flash p, .plain-list, .plan-item p { margin: 0; line-height: 1.6; color: var(--text-soft); }
.theme-ink .flash.success {
  background: linear-gradient(135deg, rgba(36, 99, 77, 0.34), rgba(18, 64, 50, 0.72));
  border-color: rgba(129, 222, 184, 0.36);
}
.theme-ink .flash.success h3,
.theme-ink .flash.success p {
  color: #ecfff6;
}
.theme-ink .flash.error {
  background: linear-gradient(135deg, rgba(154, 91, 23, 0.28), rgba(88, 48, 12, 0.7));
  border-color: rgba(255, 205, 140, 0.32);
}
.theme-ink .flash.error h3,
.theme-ink .flash.error p {
  color: #fff4df;
}

.plain-list { padding-left: 18px; }
.text-link { color: var(--accent); font-weight: 600; text-decoration: none; }
.section-header, .filter-form, .plan-item, .inline-form { display: flex; align-items: center; }
.section-header { justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.filter-form { gap: 10px; }
.plan-list { display: grid; gap: 12px; }
.plan-item { justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid rgba(16,17,18,0.08); }
.plan-item:last-child { border-bottom: 0; }
.plan-meta { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 860px; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid rgba(16,17,18,0.08); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-soft); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; display: inline-block; padding: 6px 8px; border-radius: 10px; background: rgba(16,17,18,0.06); }
.theme-ink code { background: rgba(255,255,255,0.08); }
.inline-form { display: inline-flex; }
.table-muted { color: var(--text-soft); font-size: 13px; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding-top: 24px; }
.login-panel { width: min(520px, calc(100% - 24px)); }

@media (max-width: 900px) {
  .hero-panel, .admin-header, .card-grid, .admin-grid, .stats-grid, .two-col { grid-template-columns: 1fr; }
  .page-shell, .admin-shell, .login-shell { width: min(100%, calc(100% - 18px)); }
  .badge-stack { width: 100%; }
}
