:root {
  --ink: #1c2738;
  --muted: #677181;
  --cream: #ece7db;
  --paper: #fffdf9;
  --orange: #e97c00;
  --orange-dark: #b85d00;
  --gold: #e8b547;
  --green: #149b4f;
  --red: #b63b38;
  --line: #dfd8cb;
  --shadow: 0 14px 32px rgba(34, 39, 48, .12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Poppins", system-ui, sans-serif;
  color: var(--ink);
  background: var(--cream);
}
.banner {
  min-height: 170px;
  padding: 28px clamp(24px, 5vw, 72px);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;
  background: linear-gradient(110deg, #efc34e, #db943d);
}
.logo { width: 145px; height: auto; display: block; }
nav {
  margin-top: 45px;
  padding: 10px 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  border-radius: 14px;
  background: rgba(255,255,255,.27);
}
nav a {
  padding: 9px 15px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  border-radius: 10px;
}
nav a:hover, nav a.active { background: rgba(255,255,255,.42); color: var(--orange-dark); }

.admin-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 38px auto 70px;
}
.intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 22px;
}
.eyebrow {
  margin: 0 0 4px;
  color: var(--orange-dark);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .78rem;
}
h1 { margin: 0 0 8px; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.08; }
h2 { margin: 0 0 4px; font-size: 1.35rem; }
.intro p:not(.eyebrow), .panel-heading p { margin: 0; color: var(--muted); max-width: 760px; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.stats article {
  background: var(--paper);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 18px;
  padding: 19px 20px;
  box-shadow: 0 8px 20px rgba(34,39,48,.07);
}
.stats strong { display: block; font-size: 1.8rem; line-height: 1; margin-bottom: 8px; }
.stats span { color: var(--muted); font-size: .9rem; }

.panel {
  background: var(--paper);
  border-radius: 20px;
  padding: 26px;
  box-shadow: var(--shadow);
  margin-top: 18px;
}
.panel-heading { margin-bottom: 20px; }
.list-heading {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: flex-end;
}
.add-form {
  display: grid;
  grid-template-columns: 1fr 1.25fr auto;
  gap: 14px;
  align-items: end;
}
label span { display: block; font-weight: 600; font-size: .85rem; margin: 0 0 6px; }
input, select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  min-height: 46px;
  padding: 10px 12px;
}
input:focus, select:focus { outline: 3px solid rgba(233,124,0,.15); border-color: var(--orange); }

button { font: inherit; font-weight: 700; cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
.primary-button {
  min-height: 46px;
  padding: 10px 19px;
  border: 0;
  border-radius: 999px;
  color: white;
  background: var(--orange);
  box-shadow: 0 7px 15px rgba(196,92,0,.22);
}
.primary-button:hover { background: var(--orange-dark); }
.secondary-button {
  min-height: 42px;
  padding: 8px 17px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.secondary-button:hover { border-color: var(--orange); }

.filters { display: flex; gap: 10px; min-width: min(100%, 440px); }
.filters label:first-child { width: 180px; }
.search-box { flex: 1; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 780px; }
th {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: .75rem;
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
}
td { padding: 15px 10px; border-bottom: 1px solid #eee9df; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.member-name { font-weight: 700; }
.member-email { display: block; margin-top: 3px; color: var(--muted); font-size: .85rem; }
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  background: #eee;
}
.badge.active { background: #e4f6ea; color: #087a3a; }
.badge.inactive { background: #fae8e6; color: #9e2e2a; }
.badge.physical { background: #fff0d6; color: #925000; }
.badge.six_month { background: #e8edf9; color: #415481; }
.badge.subscription { background: #ece6f7; color: #62498d; }
.action-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--ink);
  min-height: 36px;
  padding: 7px 13px;
}
.action-button.deactivate { color: var(--red); }
.action-button.activate { color: var(--green); }
.action-button:hover { border-color: currentColor; }
.actions-heading, td.actions { text-align: right; white-space: nowrap; }

.message { min-height: 1.3em; margin: 13px 0 0; font-size: .9rem; }
.message.success { color: var(--green); }
.message.error { color: var(--red); }
.state-box {
  padding: 30px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 14px;
}
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

@media (max-width: 850px) {
  .banner { min-height: 140px; align-items: center; }
  .logo { width: 105px; }
  nav { margin-top: 0; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .add-form { grid-template-columns: 1fr; }
  .list-heading { align-items: stretch; flex-direction: column; }
  .filters { min-width: 0; width: 100%; }
}
@media (max-width: 520px) {
  .banner { padding: 20px; flex-direction: column; align-items: flex-start; }
  nav { width: 100%; }
  .admin-shell { width: min(100% - 24px, 1180px); margin-top: 22px; }
  .intro { align-items: stretch; flex-direction: column; }
  .stats { grid-template-columns: 1fr 1fr; gap: 9px; }
  .panel { padding: 18px; }
  .filters { flex-direction: column; }
  .filters label:first-child { width: 100%; }
}
