:root {
  --bg: #fff6ef;
  --surface: rgba(255, 251, 247, 0.9);
  --surface-strong: #fff8f2;
  --surface-tint: #fff0e2;
  --text: #3d211e;
  --muted: #795a54;
  --line: rgba(109, 56, 40, 0.14);
  --brand: #f36b1c;
  --brand-strong: #ca4312;
  --brand-soft: #ffe3d1;
  --accent: #7b3045;
  --accent-soft: #f3dbe1;
  --highlight: #ffd877;
  --danger: #a53838;
  --shadow: 0 20px 45px rgba(105, 53, 38, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(243, 107, 28, 0.2), transparent 34%),
    radial-gradient(circle at top right, rgba(255, 216, 119, 0.2), transparent 28%),
    radial-gradient(circle at bottom right, rgba(123, 48, 69, 0.12), transparent 30%),
    linear-gradient(180deg, #fffaf5 0%, var(--bg) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.6) 0 3px, transparent 4px),
    radial-gradient(circle at 75% 35%, rgba(255, 255, 255, 0.45) 0 2px, transparent 3px),
    radial-gradient(circle at 50% 80%, rgba(255, 255, 255, 0.4) 0 3px, transparent 4px);
  background-size: 180px 180px, 220px 220px, 260px 260px;
  pointer-events: none;
  z-index: -1;
}

.shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 3rem;
}

.topbar {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255, 250, 245, 0.95), rgba(255, 239, 226, 0.88));
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.topbar::after {
  content: "";
  position: absolute;
  inset: auto -8rem -7rem auto;
  width: 18rem;
  height: 18rem;
  background: radial-gradient(circle, rgba(243, 107, 28, 0.18) 0%, rgba(243, 107, 28, 0) 72%);
  pointer-events: none;
}

.brand-block {
  display: grid;
  gap: 0.45rem;
  position: relative;
  z-index: 1;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  color: var(--text);
  text-decoration: none;
}

.brand-mark-shell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  border-radius: 28px;
  background: linear-gradient(145deg, #fff6ee, #ffd8bf);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 14px 28px rgba(126, 57, 32, 0.16);
}

.brand-mark {
  width: clamp(4rem, 7vw, 5.35rem);
  height: auto;
  display: block;
  border-radius: 22px;
  flex: 0 0 auto;
}

.brand-text {
  display: grid;
  gap: 0.2rem;
}

.brand-name {
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: clamp(1.45rem, 2vw, 2rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
}

.brand-name em {
  color: var(--brand-strong);
  font-style: normal;
}

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

.brand-copy {
  margin: 0;
  color: var(--muted);
  max-width: 34rem;
  line-height: 1.35;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  position: relative;
  z-index: 1;
}

.topnav a,
.link-button {
  border: 0;
  background: transparent;
  color: var(--accent);
  text-decoration: none;
  font: inherit;
  cursor: pointer;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.topnav a:hover,
.link-button:hover {
  background: var(--brand-soft);
  color: var(--brand-strong);
  transform: translateY(-1px);
}

.page-body {
  margin-top: 1.5rem;
}

.page-body > * + * {
  margin-top: 1.5rem;
}

.panel,
.stat,
.hero,
.form-card,
.table-card,
.note,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 252, 249, 0.97), rgba(255, 244, 234, 0.86));
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.hero,
.panel,
.form-card,
.table-card,
.note,
.empty-state {
  padding: 1.5rem;
}

.hero {
  display: grid;
  gap: 1rem;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(255, 216, 119, 0.24), transparent 24%),
    linear-gradient(180deg, rgba(255, 251, 247, 0.98), rgba(255, 239, 226, 0.9));
}

.hero::after {
  content: "";
  position: absolute;
  right: -2rem;
  bottom: -3rem;
  width: 13rem;
  height: 13rem;
  background: radial-gradient(circle, rgba(123, 48, 69, 0.12) 0%, rgba(123, 48, 69, 0) 72%);
  pointer-events: none;
}

.hero-grid,
.grid-two,
.grid-three,
.stats-grid,
.dashboard-grid,
.label-grid {
  display: grid;
  gap: 1rem;
}

.grid-two {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.grid-three,
.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.dashboard-grid {
  grid-template-columns: 2fr 1fr;
}

.label-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.stat {
  padding: 1rem 1.1rem;
  background: linear-gradient(180deg, rgba(255, 248, 242, 0.95), rgba(255, 236, 220, 0.9));
}

.stat strong,
.metric {
  display: block;
  font-size: 1.75rem;
  margin-top: 0.35rem;
}

h1,
h2,
h3 {
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  margin: 0 0 0.6rem;
  line-height: 1.15;
}

input,
select,
textarea,
button,
.button,
a.button {
  font-size: 0.98rem;
}

a {
  color: var(--brand-strong);
}

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

form {
  display: grid;
  gap: 0.9rem;
}

.field-row {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: start;
}

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
}

label > .muted {
  font-size: 0.9rem;
  line-height: 1.15;
  font-weight: 400;
}

input,
select,
textarea,
button,
.button,
a.button {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(119, 60, 44, 0.18);
  padding: 0.78rem 0.9rem;
  font: inherit;
  color: var(--text);
  background: rgba(255, 252, 249, 0.96);
}

input:focus,
select:focus,
textarea:focus,
button:focus,
a:focus {
  outline: 3px solid rgba(243, 107, 28, 0.18);
  outline-offset: 2px;
  border-color: rgba(243, 107, 28, 0.5);
}

input:not([type="checkbox"]):not([type="radio"]),
select {
  min-height: 3.1rem;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.checkbox-label input {
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--brand);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

button,
.button,
a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: auto;
  line-height: 1.2;
  text-decoration: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: white;
  cursor: pointer;
  border: 1px solid rgba(171, 58, 14, 0.18);
  box-shadow: 0 10px 20px rgba(202, 67, 18, 0.2);
  transition: transform 150ms ease, opacity 150ms ease, box-shadow 150ms ease;
}

button:hover,
.button:hover,
a.button:hover {
  transform: translateY(-1px);
  opacity: 0.95;
  box-shadow: 0 14px 26px rgba(202, 67, 18, 0.24);
}

.button.secondary,
button.secondary {
  background: linear-gradient(180deg, #fffaf6, #fff0e5);
  color: var(--accent);
  box-shadow: none;
}

.button.warning,
button.warning {
  background: linear-gradient(135deg, #8d324a, var(--accent));
}

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

.button-group,
.inline-actions,
.inline-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.action-panel {
  display: grid;
  gap: 1.1rem;
  align-content: start;
}

.action-panel > * {
  margin: 0;
}

.action-panel .button-group {
  align-items: stretch;
}

.action-panel .button-group form {
  display: flex;
  margin: 0;
}

.action-panel .button-group button {
  height: 100%;
}

.table-card {
  overflow-x: auto;
}

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

.table th,
.table td {
  text-align: left;
  padding: 0.9rem 0.75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.table th {
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff1c9, var(--brand-soft));
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
}

.message-list,
.validation-summary-errors ul {
  margin: 0;
  padding-left: 1.1rem;
}

.validation-summary-errors,
.alert,
.note.error {
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid rgba(165, 56, 56, 0.25);
  background: rgba(165, 56, 56, 0.08);
  color: #7a2222;
}

.note.success {
  border: 1px solid rgba(243, 107, 28, 0.26);
  background: rgba(243, 107, 28, 0.08);
  color: var(--brand-strong);
}

.radio-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.radio-option input {
  width: auto;
}

.qr-image {
  max-width: 220px;
  width: 100%;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: white;
  padding: 0.75rem;
}

.copy-field {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.copy-field input {
  flex: 1 1 280px;
}

.member-card,
.print-label {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-strong);
  padding: 1rem;
}

.print-label {
  break-inside: avoid;
}

.print-label img {
  width: 100%;
  max-width: 180px;
  display: block;
  margin: 0.75rem auto;
}

.footer-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-start;
  flex-wrap: wrap;
}

@media (max-width: 860px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 1rem, 100%);
  }

  .brand-link {
    gap: 0.75rem;
  }

  .brand-name {
    line-height: 1.05;
  }

  .topbar,
  .hero,
  .panel,
  .form-card,
  .table-card,
  .note,
  .empty-state {
    padding: 1.1rem;
    border-radius: 18px;
  }

  .table th,
  .table td {
    padding: 0.7rem 0.5rem;
  }
}

@media print {
  body {
    background: white;
  }

  .topbar,
  .button,
  button,
  .topnav {
    display: none !important;
  }

  .shell {
    width: 100%;
  }

  .print-label {
    box-shadow: none;
  }
}
