:root {
  --bg: #f4efe6;
  --surface: rgba(255, 252, 247, 0.88);
  --surface-strong: #fffdf8;
  --text: #1f2430;
  --muted: #637081;
  --line: rgba(31, 36, 48, 0.12);
  --primary: #166534;
  --primary-soft: rgba(22, 101, 52, 0.12);
  --accent: #b45309;
  --danger: #b91c1c;
  --blue: #1d4ed8;
  --gray: #64748b;
  --shadow: 0 20px 50px rgba(24, 30, 37, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Inter", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(22, 101, 52, 0.14), transparent 34%),
    radial-gradient(circle at top right, rgba(180, 83, 9, 0.16), transparent 28%),
    linear-gradient(180deg, #f7f3eb, #f1ebe0 55%, #ece5d7);
  min-height: 100vh;
}

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

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 112px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(14px);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), #0f3f23);
  color: white;
  font-weight: 800;
}

.brand strong,
.page h1,
.panel h2 {
  font-family: Georgia, "Times New Roman", serif;
}

.brand small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.topnav,
.mobile-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.topnav a,
.mobile-nav a {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
}

.topnav a.active,
.mobile-nav a.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}

.page {
  margin-top: 24px;
  display: grid;
  gap: 24px;
}

.hero,
.panel,
.table-card,
.empty-state,
.auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero {
  padding: 32px;
  display: grid;
  gap: 18px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 700;
}

.hero h1,
.page h1 {
  margin: 6px 0 8px;
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.lede,
.muted,
.meta,
.inline-meta,
.field span,
.checkbox span,
.panel-head a,
.text-link,
p {
  color: var(--muted);
}

.hero-actions,
.panel-head,
.inline-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

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

.panel,
.table-card,
.empty-state,
.auth-card {
  padding: 24px;
}

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

.card {
  padding: 18px;
  border-radius: 20px;
  background: var(--surface-strong);
  border: 1px solid rgba(31, 36, 48, 0.08);
}

.card.compact {
  padding: 14px 16px;
}

.card-highlight {
  border-color: rgba(29, 78, 216, 0.24);
  background: rgba(255, 255, 255, 0.96);
}

.card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.quick-links {
  display: grid;
  gap: 12px;
}

.quick-card {
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(22, 101, 52, 0.1), rgba(255, 255, 255, 0.92));
  border: 1px solid rgba(22, 101, 52, 0.1);
}

.quick-card span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

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

.facts div {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(31, 36, 48, 0.06);
}

.facts span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
  margin-bottom: 6px;
}

.button,
button,
input,
select,
textarea {
  font: inherit;
}

.button,
button {
  cursor: pointer;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
}

.button-primary {
  background: var(--primary);
  color: white;
}

.button-secondary {
  background: rgba(255, 255, 255, 0.84);
  border-color: rgba(31, 36, 48, 0.12);
}

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

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.badge-green { background: rgba(22, 101, 52, 0.13); color: var(--primary); }
.badge-blue { background: rgba(29, 78, 216, 0.12); color: var(--blue); }
.badge-red { background: rgba(185, 28, 28, 0.12); color: var(--danger); }
.badge-amber { background: rgba(180, 83, 9, 0.14); color: var(--accent); }
.badge-gray { background: rgba(100, 116, 139, 0.12); color: var(--gray); }

.filters,
.form-grid {
  display: grid;
  gap: 16px;
}

.filters {
  grid-template-columns: minmax(0, 1fr) 220px auto;
  align-items: center;
}

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

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(31, 36, 48, 0.14);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 16px;
  padding: 14px 16px;
  color: var(--text);
}

textarea {
  resize: vertical;
}

.checkbox {
  display: flex;
  gap: 10px;
  align-items: center;
}

.checkbox input {
  width: 18px;
  height: 18px;
}

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

.table-card table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid rgba(31, 36, 48, 0.08);
}

th {
  color: var(--muted);
  font-weight: 700;
}

.empty-state,
.auth-shell {
  display: grid;
  place-items: center;
}

.empty-state {
  text-align: center;
  gap: 10px;
  padding: 48px 24px;
}

.auth-shell {
  min-height: 72vh;
}

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

.auth-links {
  margin: 18px 0;
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.demo-note {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(31, 36, 48, 0.08);
}

.flash {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 18px;
  font-weight: 600;
}

.flash-success { background: rgba(22, 101, 52, 0.12); color: var(--primary); }
.flash-error { background: rgba(185, 28, 28, 0.12); color: var(--danger); }

.mobile-nav {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  width: min(720px, calc(100% - 24px));
  justify-content: space-around;
  padding: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 247, 0.92);
  backdrop-filter: blur(18px);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

@media (max-width: 820px) {
  .topbar,
  .page-head,
  .filters,
  .grid.two,
  .form-grid,
  .facts {
    grid-template-columns: 1fr;
    display: grid;
  }

  .topbar {
    justify-items: start;
  }

  .topnav {
    display: none;
  }

  .shell {
    width: min(100% - 20px, 1120px);
    padding-bottom: 108px;
  }

  .mobile-nav {
    gap: 0;
    font-size: 0.9rem;
  }
}
