/* ── Reset & Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sidebar-width: 260px;
  --brand: #0f172a;
  --brand-dk: #020617;
  --accent: #60a5fa;
  --accent-2: #2563eb;
  --danger: #b91c1c;
  --success: #166534;
  --warn: #1d4ed8;
  --bg: #eef2ff;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --border: #d7deea;
  --text: #172033;
  --muted: #5b6780;
  --radius: 14px;
  --shadow: 0 24px 60px rgba(15, 23, 42, .14);
}

body {
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(96, 165, 250, .14), transparent 28%),
    radial-gradient(circle at top right, rgba(37, 99, 235, .10), transparent 24%),
    linear-gradient(180deg, #f6f8fc 0%, #eef2ff 100%);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

body.app-shell {
  padding-left: var(--sidebar-width);
  transition: padding-left .22s ease;
}
body.app-shell.nav-collapsed { padding-left: 0; }
body.public-shell { padding-left: 0; }

a { color: inherit; }

/* ── Navbar ──────────────────────────────────────────────────────── */
.navbar {
  display: flex;
  color: #fff;
  gap: 1rem;
  z-index: 100;
}

body.app-shell .navbar {
  background: linear-gradient(180deg, #0f172a 0%, #111c34 100%);
  flex-direction: column;
  align-items: stretch;
  padding: 1.35rem 1rem;
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  box-shadow: 0 18px 40px rgba(2, 6, 23, .35);
  overflow-y: auto;
  transition: transform .22s ease, box-shadow .22s ease;
}

body.app-shell.nav-collapsed .navbar {
  transform: translateX(calc(-1 * var(--sidebar-width)));
  box-shadow: none;
}

body.public-shell .navbar {
  width: min(1160px, calc(100% - 2rem));
  margin: 1rem auto 0;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: rgba(15, 23, 42, .94);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px;
  backdrop-filter: blur(16px);
  box-shadow: 0 14px 40px rgba(15, 23, 42, .25);
}

.nav-brand {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.nav-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.nav-brand-logo {
  width: 188px;
  max-width: 100%;
  height: auto;
  display: block;
}

.build-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .35rem .6rem;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  color: #fff;
  border: 1px solid rgba(255,255,255,.24);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.app-shell-toggle,
.nav-sidebar-toggle {
  appearance: none;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(15, 23, 42, .92);
  color: #fff;
  cursor: pointer;
}

.app-shell-toggle {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 170;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: none;
  align-items: center;
  justify-content: center;
  gap: .22rem;
  flex-direction: column;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .22);
}

.app-shell-toggle span {
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: #fff;
  display: block;
}

body.app-shell.nav-collapsed .app-shell-toggle {
  display: inline-flex;
}

.nav-sidebar-toggle {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: rgba(255,255,255,.08);
}

.nav-sidebar-toggle:hover,
.app-shell-toggle:hover {
  background: rgba(37, 99, 235, .75);
}

.nav-overlay {
  display: none;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 0.35rem;
}

body.app-shell .nav-links {
  flex-direction: column;
}

body.public-shell .nav-links {
  flex-direction: row;
  align-items: center;
}

.nav-links a {
  color: rgba(255,255,255,.85);
  text-decoration: none;
  display: block;
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  transition: background .15s, color .15s;
}

.nav-links a:hover,
.nav-links a.active {
  background: rgba(255,255,255,.16);
  color: #fff;
}

.nav-logout {
  margin-top: auto;
}

body.public-shell .nav-logout {
  margin-top: 0;
}

.nav-logout .btn {
  width: 100%;
  border-color: rgba(255,255,255,.35);
  color: #fff;
}

body.public-shell .nav-logout .btn {
  width: auto;
}

.nav-logout .btn:hover {
  background: rgba(255,255,255,.18);
}

/* ── Container ───────────────────────────────────────────────────── */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
  transition: padding .22s ease;
}

body.app-shell.nav-collapsed .container {
  padding-top: 4.75rem;
}

body.public-shell .container {
  padding-top: 3rem;
}

/* ── Alerts ──────────────────────────────────────────────────────── */
.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: .9rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

.alert-success { background: #ecfdf5; color: var(--success); border: 1px solid #a7f3d0; }
.alert-error   { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.alert-warning { background: #fffbeb; color: var(--warn); border: 1px solid #fde68a; }
.alert-info    { background: #eff6ff; color: #1e3a8a; border: 1px solid #bfdbfe; }
.demo-banner { background: linear-gradient(90deg, #eff6ff 0%, #eef2ff 100%); }

/* ── Page Header ─────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.page-header h1 { font-size: 1.65rem; font-weight: 700; }
.page-subtitle { color: var(--muted); font-size: .95rem; margin-top: .25rem; }
.header-actions { display: flex; gap: .5rem; }

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .48rem 1rem;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: transform .15s, filter .15s;
  white-space: nowrap;
}

.btn:hover {
  filter: brightness(.98);
  transform: translateY(-1px);
}

.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.btn-secondary { background: #e2e8f0; color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--brand); border: 1px solid var(--border); }
.btn-sm { padding: .3rem .7rem; font-size: .8rem; }

/* ── Search ──────────────────────────────────────────────────────── */
.search-form {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.25rem;
  align-items: center;
}

.search-input {
  flex: 1;
  max-width: 420px;
  padding: .55rem .8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
  outline: none;
  background: var(--surface);
}

.search-input:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: rgba(37, 99, 235, .45);
  box-shadow: 0 0 0 4px rgba(96, 165, 250, .16);
}

.toggle-inline {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: var(--muted);
  font-size: .9rem;
}

/* ── Tables ──────────────────────────────────────────────────────── */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.table th, .table td {
  padding: .7rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: .875rem;
}

.table th {
  background: #f8fafc;
  font-weight: 700;
  color: var(--muted);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #f8fafc; }
.table td a:not(.btn) { color: #2563eb; text-decoration: none; font-weight: 600; }
.table td a:not(.btn):hover { text-decoration: underline; }
.table-count { color: var(--muted); font-size: .85rem; margin-top: .75rem; }
.empty-state { color: var(--muted); text-align: center; padding: 2rem; }

.actions,
td.actions {
  width: 1%;
  white-space: nowrap;
  vertical-align: middle;
}

td.actions > * { display: inline-block; vertical-align: middle; }
td.actions > * + * { margin-left: .4rem; }
td.actions form { margin: 0; padding: 0; }

th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]:hover { color: var(--text); }
th.sort-asc::after  { content: ' ↑'; font-size: .7em; }
th.sort-desc::after { content: ' ↓'; font-size: .7em; }

/* ── Badges ──────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: capitalize;
}

.badge-admin { background: #ede9fe; color: #5b21b6; }
.badge-president { background: #fef3c7; color: #92400e; }
.badge-officer { background: #dbeafe; color: #1e40af; }
.badge-member { background: #d1fae5; color: #065f46; }
.badge-active { background: #dcfce7; color: #166534; }
.badge-inactive { background: #f1f5f9; color: #475569; }
.badge-suspended { background: #fee2e2; color: #991b1b; }
.badge-status-upcoming { background: #eff6ff; color: #1e40af; }
.badge-status-in_progress { background: #fffbeb; color: #92400e; }
.badge-status-completed { background: #f0fdf4; color: #166534; }
.badge-event-meeting { background: #f0fdf4; color: #166534; }
.badge-event-workshop { background: #eff6ff; color: #1e40af; }
.badge-event-competition { background: #fdf4ff; color: #7e22ce; }
.badge-event-other { background: #eff6ff; color: #1d4ed8; }
.badge-series { background: #e0f2fe; color: #0f5173; }
.badge-other { background: #f1f5f9; color: #475569; }
.badge-dues-paid { background: #dcfce7; color: #166534; }
.badge-dues-due-soon { background: #fef3c7; color: #92400e; }
.badge-dues-expired { background: #fee2e2; color: #991b1b; }
.badge-dues-unpaid { background: #e2e8f0; color: #475569; }

/* ── Cards & Detail ─────────────────────────────────────────────── */
.detail-card,
.form-card {
  background: rgba(255,255,255,.95);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  box-shadow: var(--shadow);
}

.detail-card { margin-bottom: 1.25rem; }
.section-title { font-size: 1.05rem; font-weight: 700; margin-bottom: .85rem; }

.detail-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: .6rem 1rem;
  align-items: start;
}

.detail-grid dt { font-weight: 700; color: var(--muted); font-size: .85rem; }
.detail-grid dd { font-size: .95rem; }

/* ── Forms ───────────────────────────────────────────────────────── */
.form-card { max-width: 640px; }
.auth-shell { max-width: 460px; margin: 2rem auto 0; }
.auth-card { max-width: none; }
.auth-brand-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 1.25rem;
}

.auth-brand-logo {
  width: 240px;
  max-width: 100%;
  height: auto;
}

.auth-brand-subtitle {
  margin-top: .35rem;
}

.auth-shell-wide {
  max-width: 1120px;
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 1.5rem;
  align-items: stretch;
}

.auth-hero,
.auth-login-card {
  min-height: 100%;
}

.auth-hero {
  background: linear-gradient(145deg, rgba(15, 23, 42, .98), rgba(30, 41, 59, .94));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 28px;
  color: #f8fafc;
  padding: 2.4rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.auth-hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -30% auto;
  width: 280px;
  height: 280px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(96, 165, 250, .28), transparent 65%);
}

.auth-hero-mark img,
.error-logo {
  width: 260px;
  max-width: 100%;
  height: auto;
}

.auth-kicker {
  display: inline-flex;
  padding: .32rem .7rem;
  border-radius: 999px;
  background: rgba(96, 165, 250, .14);
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, .25);
  font-size: .77rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 700;
  margin: 1rem 0;
}

.auth-hero h1 {
  font-size: 2.4rem;
  line-height: 1.05;
  margin-bottom: 1rem;
}

.auth-hero p {
  color: rgba(248, 250, 252, .82);
  max-width: 42rem;
}

.auth-feature-list {
  display: grid;
  gap: .9rem;
  margin-top: 1.4rem;
}

.auth-feature {
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.05);
  border-radius: 16px;
  padding: .9rem 1rem;
}

.auth-login-card {
  border-radius: 28px;
  padding: 2.15rem;
}

.auth-login-card h2 {
  font-size: 1.8rem;
  margin-bottom: .25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
}

.form-group label {
  font-size: .85rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: .35rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: .55rem .8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .92rem;
  outline: none;
  background: var(--surface);
  color: var(--text);
}

.email-domain-field {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.email-domain-field:focus-within {
  border-color: rgba(37, 99, 235, .45);
  box-shadow: 0 0 0 4px rgba(96, 165, 250, .16);
}

.email-domain-field input {
  border: none;
  border-radius: 0;
  box-shadow: none;
  flex: 1;
  min-width: 0;
}

.email-domain-field input:focus {
  box-shadow: none;
  border-color: transparent;
}

.email-domain-field span {
  display: inline-flex;
  align-items: center;
  padding: 0 .8rem;
  background: #eff6ff;
  color: #1d4ed8;
  border-left: 1px solid var(--border);
  font-size: .9rem;
  font-weight: 700;
  white-space: nowrap;
}

.auth-login-note {
  line-height: 1.45;
}

.form-actions { display: flex; gap: .75rem; margin-top: .5rem; flex-wrap: wrap; }
.auth-actions .btn { width: 100%; }
.auth-inline-note { margin-top: 1rem; }
.form-hint { color: var(--muted); font-size: .85rem; margin-bottom: .75rem; }

/* ── Stats & Dashboard ──────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  background: linear-gradient(160deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.stat-label {
  color: var(--muted);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.stat-value {
  font-size: 2rem;
  line-height: 1.1;
  font-weight: 700;
  margin-top: .4rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
  margin-bottom: 1.25rem;
}

.dashboard-section {
  margin-bottom: 1.75rem;
}

.dashboard-hero-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.15fr) minmax(280px, .85fr);
  gap: 1rem;
  align-items: stretch;
  margin-bottom: 1.25rem;
}

.dashboard-lower-grid {
  display: grid;
  grid-template-columns: minmax(320px, .95fr) minmax(320px, 1.05fr);
  gap: 1rem;
  align-items: start;
}

.dashboard-column-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dashboard-summary-card,
.dashboard-trend-card {
  height: 100%;
}

.dashboard-summary-card {
  display: flex;
  flex-direction: column;
}

.dashboard-priority-stats {
  margin-bottom: 1rem;
}

.compact-card {
  margin-bottom: 0;
}

.dashboard-kicker {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  padding: .28rem .72rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(96, 165, 250, .14), rgba(37, 99, 235, .1));
  color: var(--accent-2);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: .85rem;
}

.dashboard-summary-card h2 {
  font-size: 1.45rem;
  margin-bottom: .3rem;
}

.dashboard-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 1rem 0 1.1rem;
}

.dashboard-next-card {
  padding: 1rem 1.05rem;
  border-radius: 18px;
  border: 1px solid rgba(37, 99, 235, .12);
  background: linear-gradient(160deg, rgba(239, 246, 255, .9) 0%, rgba(248, 250, 252, .98) 100%);
  margin-top: auto;
}

.dashboard-next-title {
  display: inline-block;
  margin-top: .2rem;
  color: var(--text);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
}

.dashboard-next-title:hover {
  color: var(--accent-2);
}

.dashboard-next-meta {
  color: var(--text);
  font-size: .9rem;
  margin-top: .25rem;
}

.trend-chart-shell {
  margin: .5rem 0 .85rem;
}

.trend-legend {
  display: flex;
  gap: .5rem;
  margin-bottom: .75rem;
}

.trend-legend-chip {
  display: inline-flex;
  align-items: center;
  padding: .28rem .6rem;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 700;
}

.trend-legend-chip.attended {
  background: rgba(37, 99, 235, .12);
  color: var(--accent-2);
}

.trend-legend-chip.missed {
  background: #e2e8f0;
  color: #475569;
}

.trend-chart {
  min-height: 210px;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: .75rem;
  align-items: end;
}

.trend-bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .45rem;
  text-decoration: none;
}

.trend-bar-group.is-placeholder {
  opacity: .72;
}

.trend-bar-status {
  font-size: .72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

.trend-bar-track {
  height: 150px;
  width: 100%;
  max-width: 42px;
  border-radius: 999px;
  background: linear-gradient(180deg, #e2e8f0 0%, #cbd5e1 100%);
  padding: .28rem;
  display: flex;
  align-items: flex-end;
  transition: transform .15s ease;
}

.trend-bar-group:hover .trend-bar-track {
  transform: translateY(-2px);
}

.trend-bar-fill {
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, #93c5fd 0%, #3b82f6 55%, #1d4ed8 100%);
  box-shadow: inset 0 -6px 14px rgba(15, 23, 42, .18);
}

.trend-bar-fill.is-missed {
  background: linear-gradient(180deg, #cbd5e1 0%, #94a3b8 100%);
  box-shadow: none;
}

.trend-bar-fill.is-placeholder {
  background: linear-gradient(180deg, #e2e8f0 0%, #cbd5e1 100%);
  box-shadow: none;
}

.trend-bar-label {
  font-size: .74rem;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--muted);
}

.progress-card {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 1.2rem;
  align-items: center;
}

.progress-ring {
  --progress: 0%;
  width: 136px;
  height: 136px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #ffffff 0 54%, transparent 55%),
    conic-gradient(var(--accent-2) 0 var(--progress), #dbe7f6 var(--progress) 100%);
  display: grid;
  place-items: center;
  margin: 0 auto;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .08);
}

.progress-ring-inner {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid rgba(37, 99, 235, .08);
  display: grid;
  place-items: center;
  color: var(--accent-2);
}

.progress-ring-inner strong {
  font-size: 1.25rem;
}

.progress-copy {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.compact-table th,
.compact-table td {
  padding-top: .6rem;
  padding-bottom: .6rem;
}

.empty-state-compact {
  padding: 1.2rem .6rem;
}

.dashboard-ops-grid {
  align-items: start;
}

.queue-list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(160deg, #ffffff 0%, #f8fbff 100%);
  text-decoration: none;
}

.queue-item:hover {
  border-color: #bfd0ee;
  box-shadow: 0 14px 28px rgba(15, 23, 42, .08);
}

.queue-count {
  min-width: 42px;
  height: 42px;
  padding: 0 .75rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.queue-count.has-work {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}

.compact-stats-grid {
  margin-bottom: 0;
}

.dues-summary-grid {
  margin-bottom: 1.4rem;
}

.dues-filter-card {
  margin-bottom: 1.4rem;
}

.health-stack {
  display: flex;
  flex-direction: column;
  gap: .85rem;
}

.health-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) 32px;
  align-items: center;
  gap: .75rem;
}

.health-label,
.health-value {
  font-weight: 700;
}

.health-bar {
  height: 12px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.health-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.fill-active {
  background: linear-gradient(135deg, #4ade80, #16a34a);
}

.fill-inactive {
  background: linear-gradient(135deg, #cbd5e1, #94a3b8);
}

.fill-suspended {
  background: linear-gradient(135deg, #fda4af, #e11d48);
}

.stack-list { display: flex; flex-direction: column; gap: .75rem; }
.stack-item { padding-bottom: .75rem; border-bottom: 1px solid var(--border); }
.stack-item:last-child { padding-bottom: 0; border-bottom: none; }
.section-block { margin-bottom: 1.5rem; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.subtle-meta { color: var(--muted); font-size: .8rem; margin-top: .3rem; }
.dues-filter-form { flex-wrap: wrap; }
.dues-select { flex: 0 0 210px; max-width: 210px; }
.table-scroll-shell {
  width: 100%;
  overflow-x: auto;
}
.dues-table {
  min-width: 980px;
}
.dues-table td {
  vertical-align: top;
}
.dues-table th,
.dues-table td {
  padding-left: .75rem;
  padding-right: .75rem;
}
.dues-member-cell {
  min-width: 190px;
}
.dues-member-cell a {
  display: inline-block;
  margin-bottom: .15rem;
}
.dues-date-cell,
.dues-amount-cell {
  white-space: nowrap;
}
.dues-message-cell {
  min-width: 140px;
  color: var(--text);
}
.dues-action-cell {
  min-width: 160px;
}
.dues-inline-form {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: .45rem;
  min-width: 150px;
}
.dues-inline-form input {
  width: 92px;
  padding: .45rem .65rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: .85rem;
}
.dues-inline-form input:focus {
  border-color: rgba(37, 99, 235, .45);
  box-shadow: 0 0 0 4px rgba(96, 165, 250, .16);
  outline: none;
}
.dues-inline-form .btn {
  white-space: nowrap;
  flex: 0 0 auto;
}
.dues-locked-label {
  white-space: nowrap;
}

/* ── Pickers & Accordions ───────────────────────────────────────── */
.series-scope-card {
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  background: #f8fbff;
}

.scope-option {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .65rem;
  font-size: .92rem;
}

.scope-option:last-of-type { margin-bottom: .35rem; }
.weekday-picker { display: flex; flex-wrap: wrap; gap: .6rem; }

.weekday-chip {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem .75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f8fafc;
  cursor: pointer;
  user-select: none;
}

.weekday-chip input { margin: 0; }
.event-shortcut { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.series-accordion-list { display: flex; flex-direction: column; gap: .85rem; }

.series-accordion {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  overflow: hidden;
}

.series-accordion summary { list-style: none; }
.series-accordion summary::-webkit-details-marker { display: none; }

.series-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  cursor: pointer;
  background: linear-gradient(160deg, #ffffff 0%, #f8fbff 100%);
}

.series-summary-main { min-width: 0; }
.series-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }

.series-title-link {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.series-title-link:hover { color: #2563eb; }

.series-summary-side {
  color: var(--muted);
  font-size: .85rem;
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  justify-content: flex-end;
}

.series-body { padding: 0 1rem 1rem; }
.standalone-accordion .series-body { padding-top: 1rem; }
.series-table { box-shadow: none; border: 1px solid var(--border); }
.series-footer-actions { margin-top: .75rem; display: flex; justify-content: flex-end; }
.attendance-picker-shell { max-width: 100%; }
.picker-help { color: var(--muted); font-size: .85rem; margin-top: .2rem; }
.event-picker-list { margin-bottom: 1rem; }

.event-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem;
}

.event-choice-card {
  display: block;
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f8fafc;
  padding: .9rem 1rem;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.event-choice-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.event-choice-card:hover {
  border-color: #b6c5e3;
  background: #ffffff;
}

.event-choice-card.is-selected {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, .15);
}

.event-choice-top {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
  margin-bottom: .35rem;
}

.event-choice-name { font-weight: 700; margin-bottom: .25rem; }

/* ── Reports ─────────────────────────────────────────────────────── */
.reports-workspace {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  margin-bottom: 1.5rem;
}

.reports-sticky-card {
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 100px);
  overflow: auto;
}

.reports-filter-form { flex-wrap: wrap; }
.reports-scope-select { flex: 0 0 180px; }
.reports-picker-list { margin-bottom: 0; }
.reports-picker-grid { grid-template-columns: 1fr; }
.report-result-card { min-height: 420px; }

.report-selected-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(160deg, #ffffff 0%, #f8fbff 100%);
  margin-bottom: 1rem;
}

.aggregate-details { padding: 1rem 1.25rem; }
.aggregate-summary { cursor: pointer; list-style: none; }
.aggregate-summary::-webkit-details-marker { display: none; }
.logs-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.logs-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  align-items: end;
}

.logs-filter-actions {
  margin-top: 0;
  align-self: end;
}

.audit-log-list td:first-child { min-width: 160px; }
.audit-log-list td code {
  white-space: nowrap;
  font-size: .8rem;
}

/* ── Error Pages ────────────────────────────────────────────────── */
.error-shell {
  max-width: 760px;
  margin: 3.5rem auto;
  text-align: center;
  background: rgba(255,255,255,.92);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 2.8rem 2rem;
}

.error-shell h1 {
  font-size: 2.2rem;
  margin: 1rem 0 .5rem;
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 960px) {
  body.app-shell,
  body.public-shell {
    padding-left: 0;
  }

  body.app-shell .container {
    padding-top: 4.75rem;
  }

  body.app-shell.nav-open {
    overflow: hidden;
  }

  body.app-shell .navbar {
    width: min(320px, calc(100vw - 2rem));
    height: calc(100vh - 1rem);
    top: .5rem;
    left: .5rem;
    bottom: .5rem;
    margin: 0;
    border-radius: 24px;
    padding: 1rem;
    transform: translateX(calc(-100% - 1rem));
    z-index: 180;
  }

  body.app-shell.nav-open .navbar {
    transform: translateX(0);
    box-shadow: 0 24px 60px rgba(2, 6, 23, .38);
  }

  body.public-shell .navbar {
    width: 100%;
    height: auto;
    position: static;
    margin: 0;
    border-radius: 0 0 24px 24px;
    padding: .9rem 1rem;
  }

  .app-shell-toggle {
    display: inline-flex;
  }

  body.app-shell.nav-open .nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .46);
    z-index: 150;
  }

  .nav-sidebar-toggle {
    display: inline-flex;
  }

  .nav-links { flex-direction: column; flex-wrap: nowrap; }
  .nav-logout { margin-top: 0; }
  .nav-logout .btn { width: 100%; }
  .stats-grid,
  .dashboard-grid,
  .dashboard-hero-grid,
  .dashboard-lower-grid,
  .event-picker-grid,
  .auth-shell-wide,
  .reports-workspace,
  .logs-summary-grid,
  .logs-filter-grid {
    grid-template-columns: 1fr;
  }

  .page-header,
  .event-shortcut,
  .series-summary {
    flex-direction: column;
    align-items: flex-start;
  }

  .series-summary-side { justify-content: flex-start; }
  .reports-sticky-card { position: static; max-height: none; overflow: visible; }
}

@media (max-width: 640px) {
  .container { padding: 4.75rem .9rem 1.25rem; }
  .form-row,
  .detail-grid,
  .progress-card { grid-template-columns: 1fr; }
  .table th, .table td { padding: .55rem .75rem; }
  .dues-table {
    min-width: 860px;
  }
  .dues-select,
  .dues-inline-form input {
    max-width: none;
  }
  .dues-inline-form {
    flex-direction: column;
    align-items: stretch;
  }
  .dues-inline-form input,
  .dues-inline-form .btn {
    width: 100%;
  }
  .auth-hero,
  .auth-login-card,
  .error-shell {
    padding: 1.5rem;
    border-radius: 22px;
  }
  .auth-hero h1 { font-size: 1.9rem; }
  .trend-chart {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .trend-bar-track {
    max-width: 38px;
  }
  .health-row {
    grid-template-columns: 1fr;
    gap: .35rem;
  }
  .nav-brand-logo {
    width: 156px;
  }
}
