/* ── Design tokens ───────────────────────── */
:root {
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --bg:            #f4f5f7;
  --surface:       #ffffff;
  --surface-raised:#ffffff;
  --border:        #e4e4e7;
  --border-strong: #d1d5db;

  --sidebar-bg:          #111318;
  --sidebar-text:        #9ca3af;
  --sidebar-hover-bg:    #1e2028;
  --sidebar-active-bg:   rgba(59,130,246,.12);
  --sidebar-active-text: #60a5fa;
  --sidebar-section:     #4b5563;

  --blue:        #2563eb;
  --blue-dark:   #1d4ed8;
  --blue-light:  #eff6ff;
  --blue-border: #bfdbfe;

  --green:       #16a34a;
  --green-bg:    #dcfce7;
  --green-text:  #166534;

  --amber:       #d97706;
  --amber-bg:    #fef3c7;
  --amber-text:  #92400e;

  --red:         #dc2626;
  --red-bg:      #fee2e2;
  --red-text:    #991b1b;

  --text:        #111318;
  --text-muted:  #6b7280;
  --text-subtle: #9ca3af;

  --radius-sm:   4px;
  --radius:      8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-pill: 9999px;

  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:    0 2px 8px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 24px rgba(0,0,0,.08), 0 4px 8px rgba(0,0,0,.04);

  --t: 150ms ease;
  --t-slow: 250ms ease;
}

/* ── Reset ───────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }

/* ── Layout ──────────────────────────────── */
body { display: flex; min-height: 100vh; }

/* ── Sidebar ─────────────────────────────── */
.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar__logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  margin-bottom: 8px;
}
.sidebar__logo a { display: block; }
.sidebar__logo img { width: 100%; max-width: 164px; height: auto; display: block; }
.sidebar__nav { list-style: none; flex: 1; padding: 4px 10px; }
.sidebar__nav li { margin-bottom: 1px; }
.sidebar__footer {
  padding: 12px 10px;
  border-top: 1px solid rgba(255,255,255,.06);
  margin-top: 8px;
}

.nav-section {
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--sidebar-section);
  padding: 16px 10px 5px;
  margin-top: 2px;
}
.nav-link {
  display: flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: var(--radius);
  color: var(--sidebar-text);
  font-size: .875rem;
  font-weight: 450;
  transition: background var(--t), color var(--t);
  gap: 8px;
}
.nav-link:hover {
  background: var(--sidebar-hover-bg);
  color: #e5e7eb;
  text-decoration: none;
}
.nav-link--active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  font-weight: 600;
}
.nav-link--active:hover {
  background: rgba(59,130,246,.18);
  color: var(--sidebar-active-text);
}
.nav-link--camp { padding-top: 5px; padding-bottom: 5px; font-size: .84rem; }
.nav-link--muted { font-size: .82rem; color: #6b7280; }
.nav-link--muted:hover { color: #9ca3af; }

/* Sidebar camp sub-navigation (expanded when camp is active) */
.sidebar__subnav {
  list-style: none;
  padding: 2px 0 4px 18px;
  margin: 0;
}
.sidebar__sublink {
  display: block;
  padding: 5px 10px;
  border-radius: var(--radius);
  font-size: .8rem;
  color: #6b7280;
  transition: background var(--t), color var(--t);
  border-left: 2px solid rgba(255,255,255,.06);
  margin-left: -1px;
}
.sidebar__sublink:hover {
  background: var(--sidebar-hover-bg);
  color: #c4c9d4;
  text-decoration: none;
}
.sidebar__sublink--active {
  color: var(--sidebar-active-text);
  border-left-color: var(--sidebar-active-text);
  font-weight: 600;
}

/* Camp sub-nav (contextual tabs under a camp) */
.camp-subnav {
  display: flex;
  gap: 0;
  padding: 0 0 0;
  margin-top: -12px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.camp-subnav__item {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 0;
  font-size: .84rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--t), border-color var(--t);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  gap: 5px;
}
.camp-subnav__item:hover {
  color: var(--text);
  text-decoration: none;
  border-bottom-color: #d1d5db;
}
.camp-subnav__item--active {
  color: var(--blue);
  font-weight: 700;
  border-bottom-color: var(--blue);
  background: rgba(37,99,235,.06);
}
.camp-subnav__item--active:hover {
  color: var(--blue);
  border-bottom-color: var(--blue);
  background: rgba(37,99,235,.08);
}

/* ── Main content ────────────────────────── */
.main { flex: 1; overflow-y: auto; min-width: 0; }
.content { max-width: 1120px; padding: 32px 36px; margin: 0 auto; }

/* ── Auth ────────────────────────────────── */
.auth-body { display: block; background: var(--bg); }
.auth-box {
  max-width: 400px;
  margin: 80px auto;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}
.auth-box__title { font-size: 1.4rem; font-weight: 700; margin-bottom: 24px; text-align: center; }

/* ── Typography ──────────────────────────── */
.page-title { font-size: 1.55rem; font-weight: 700; margin-bottom: 20px; letter-spacing: -.015em; color: var(--text); line-height: 1.2; }
.section-title { font-size: 1rem; font-weight: 600; margin: 24px 0 12px; color: var(--text); letter-spacing: -.01em; }
.muted { color: var(--text-muted); font-size: .9rem; }

/* ── Page header ─────────────────────────── */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-header .page-title { margin-bottom: 0; }

/* ── Breadcrumb ──────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--text); text-decoration: none; }
.breadcrumb__sep { color: var(--border-strong); }

/* ── Flash messages ──────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: .9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
}
.alert--success {
  background: var(--green-bg);
  color: var(--green-text);
  border-color: #bbf7d0;
}
.alert--error {
  background: var(--red-bg);
  color: var(--red-text);
  border-color: #fecaca;
}

/* ── Buttons ─────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: background var(--t), border-color var(--t), box-shadow var(--t), color var(--t);
  white-space: nowrap;
  line-height: 1.4;
}
.btn:hover { background: var(--bg); border-color: #9ca3af; text-decoration: none; box-shadow: var(--shadow-xs); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn--primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); box-shadow: 0 2px 8px rgba(37,99,235,.3); }
.btn--danger  { background: var(--red); color: #fff; border-color: var(--red); }
.btn--danger:hover  { background: #b91c1c; border-color: #b91c1c; }
.btn--success { background: var(--green); color: #fff; border-color: var(--green); }
.btn--success:hover { background: #15803d; border-color: #15803d; }
.btn--ghost   { background: transparent; border-color: transparent; box-shadow: none; }
.btn--ghost:hover { background: var(--bg); border-color: var(--border); }
.btn--sm      { padding: 4px 10px; font-size: .8rem; border-radius: 6px; }
.btn--xs      { padding: 2px 8px; font-size: .75rem; border-radius: 5px; }
.btn--full    { display: flex; width: 100%; justify-content: center; }

/* ── Forms ───────────────────────────────── */
.form { max-width: 640px; }
.form-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  max-width: 640px;
  margin-bottom: 20px;
}
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: .84rem;
  font-weight: 600;
  margin-bottom: 5px;
  color: #374151;
}
.form-hint { font-size: .8rem; color: var(--text-muted); margin-top: 4px; line-height: 1.4; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { margin-top: 24px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.required { color: var(--red); }

.fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  padding: 16px 20px;
  margin-bottom: 20px;
  background: var(--surface);
}
.fieldset legend {
  display: block;
  /* pull to edges, compensating for the 16px/20px container padding */
  margin: -16px -20px 16px;
  width: calc(100% + 40px);
  padding: 10px 20px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: #f8f9fa;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--border);
}

/* Inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="date"],
input[type="datetime-local"],
input[type="file"],
textarea,
.input,
.select {
  display: block;
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: .9rem;
  font-family: var(--font);
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--t), box-shadow var(--t);
  line-height: 1.4;
}
input:focus, textarea:focus, .select:focus, .input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
textarea { resize: vertical; min-height: 80px; }
input[type="file"] { padding: 6px 11px; color: var(--text-muted); }
select.select { cursor: pointer; }

.inline-form { display: flex; gap: 8px; margin-bottom: 24px; }
.inline-form .input { max-width: 300px; }

/* Checkbox label */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .9rem;
  font-weight: 400;
  cursor: pointer;
  color: var(--text);
  margin-bottom: 4px;
}
.checkbox-label input[type="checkbox"],
.checkbox-label input[type="radio"] {
  display: inline-block;
  width: auto;
  accent-color: var(--blue);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

/* ── Tables ──────────────────────────────── */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.table th {
  text-align: left;
  padding: 10px 14px;
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  background: #f9fafb;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 11px 14px;
  border-bottom: 1px solid #f3f4f6;
  font-size: .9rem;
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background var(--t); }
.table tbody tr:hover td { background: #f9fafb; }
.table__empty { text-align: center; color: var(--text-muted); padding: 40px !important; font-size: .9rem; }
.table__actions { white-space: nowrap; text-align: right; }
.table-count { font-size: .85rem; color: var(--text-muted); margin-bottom: 12px; }

/* Sortable */
th.sortable { cursor: pointer; user-select: none; }
th.sortable::after { content: ' ⇅'; color: #d1d5db; font-size: .75em; }
th.sort-asc::after  { content: ' ↑'; color: var(--blue); }
th.sort-desc::after { content: ' ↓'; color: var(--blue); }

/* ── Badges ──────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  line-height: 1.5;
}
.badge--active      { background: var(--green-bg); color: var(--green-text); }
.badge--draft       { background: #f3f4f6; color: #374151; }
.badge--scheduled   { background: var(--amber-bg); color: var(--amber-text); }
.badge--sending     { background: #dbeafe; color: #1e40af; }
.badge--sent        { background: var(--green-bg); color: var(--green-text); }
.badge--cancelled   { background: var(--red-bg); color: var(--red-text); }
.badge--failed      { background: var(--red-bg); color: var(--red-text); }
.badge--unsubscribed{ background: #f3f4f6; color: #374151; }
.badge--bounced     { background: #fed7aa; color: #9a3412; }
.badge--complained  { background: var(--red-bg); color: var(--red-text); }
.badge--subscribed  { background: var(--green-bg); color: var(--green-text); }
.badge--pending     { background: var(--amber-bg); color: var(--amber-text); }

/* ── Stats ───────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: box-shadow var(--t), border-color var(--t);
}
.stat-card:hover { box-shadow: var(--shadow); border-color: #c7d2fe; }
.stat-card__value { font-size: 1.9rem; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.stat-card__rate  { font-size: .85rem; color: var(--blue); font-weight: 600; margin-top: 2px; }
.stat-card__label { font-size: .78rem; color: var(--text-muted); margin-top: 5px; font-weight: 500; }

.stat-row { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 24px; }
.stat { display: flex; flex-direction: column; }
.stat__value { font-size: 1.5rem; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.stat__value--warn { color: var(--amber); }
.stat__label { font-size: .72rem; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }

/* ── Progress bar ────────────────────────── */
.progress-bar { height: 6px; background: #e5e7eb; border-radius: var(--radius-pill); overflow: hidden; }
.progress-bar__fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--blue);
  transition: width .4s ease;
}

/* ── SVG Ring chart ──────────────────────── */
.ring-chart-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}
.ring-chart {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  transform: rotate(-90deg);
}
.ring-chart__bg {
  fill: none;
  stroke: #e5e7eb;
  stroke-width: 4;
}
.ring-chart__fill {
  fill: none;
  stroke-width: 4;
  stroke-linecap: butt;
  transition: stroke-dasharray .5s ease;
}
.ring-chart__fill--green  { stroke: var(--green); }
.ring-chart__fill--blue   { stroke: var(--blue); }
.ring-chart__fill--amber  { stroke: var(--amber); }
.ring-chart__fill--red    { stroke: var(--red); }

/* ── Search bar ──────────────────────────── */
.search-bar { display: flex; gap: 8px; margin-bottom: 16px; align-items: center; }
.search-bar__input { flex: 1; }

/* ── Pagination ──────────────────────────── */
.pagination { display: flex; gap: 4px; margin-top: 16px; }
.pagination__item {
  padding: 5px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: .84rem;
  color: var(--text);
  transition: background var(--t), border-color var(--t);
}
.pagination__item:hover { background: var(--bg); }
.pagination__item--active { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ── Detail list ─────────────────────────── */
.detail-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 7px 16px;
  margin-bottom: 20px;
  font-size: .9rem;
}
.detail-list dt { color: var(--text-muted); font-weight: 500; white-space: nowrap; padding-top: 1px; }
.detail-list dd { color: var(--text); }
.detail-list--inline { max-width: 520px; }

/* ── Tags / checkboxes ───────────────────── */
.tag-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tag-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: .875rem;
  transition: border-color var(--t), background var(--t);
}
.tag-checkbox:hover { border-color: var(--blue); background: var(--blue-light); }
.tag-checkbox input { margin: 0; accent-color: var(--blue); }

/* ── Send options ────────────────────────── */
.send-options { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.send-option {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.send-option h2 { font-size: 1rem; margin-bottom: 8px; font-weight: 600; }
.send-option p { font-size: .9rem; color: #52525b; margin-bottom: 16px; line-height: 1.5; }

/* ── Editor header ───────────────────────── */
.editor-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.editor-header__info .page-title { margin-bottom: 0; }
.editor-header__actions { display: flex; align-items: center; gap: 10px; }
.save-status { font-size: .8rem; color: var(--text-muted); }

/* ── Import progress ─────────────────────── */
.import-progress {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

/* ── Role pills ──────────────────────────── */
.role-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.role-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: .875rem;
  color: #52525b;
  transition: border-color var(--t), background var(--t), color var(--t);
  user-select: none;
}
.role-pill:hover { border-color: #9ca3af; color: var(--text); }
.role-pill input[type="radio"] { display: none; }
.role-pill:has(input:checked) { border-color: var(--blue); background: var(--blue-light); color: var(--blue-dark); font-weight: 600; }

/* ── Role divider rows ───────────────────── */
.role-divider__cell {
  background: #f9fafb;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  padding: 6px 14px !important;
  border-bottom: 1px solid var(--border) !important;
  border-top: 1px solid var(--border) !important;
}

/* ── Divider ─────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

/* ── URL cell ────────────────────────────── */
.url-cell { word-break: break-all; max-width: 500px; font-size: .8rem; }

/* ── Capacity bar (camp signup progress) ─── */
.capacity-bar {
  background: #e5e7eb;
  border-radius: var(--radius-pill);
  height: 5px;
  overflow: hidden;
}
.capacity-bar__fill {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width .4s ease;
}
.capacity-bar__fill--low    { background: var(--red); }
.capacity-bar__fill--medium { background: var(--amber); }
.capacity-bar__fill--high   { background: var(--green); }

/* ── Camp cards (dashboard) ──────────────── */
.camp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color var(--t), box-shadow var(--t), transform var(--t-slow);
}
.camp-card:hover { border-color: var(--blue); box-shadow: var(--shadow-md); transform: translateY(-1px); text-decoration: none; }
.camp-card__photo { width: 100%; height: 110px; object-fit: cover; display: block; }
.camp-card__body { padding: 14px 16px; }
.camp-card__name { font-size: .95rem; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; margin-bottom: 4px; color: var(--text); }
.camp-card__meta { font-size: .78rem; color: var(--text-muted); margin-bottom: 10px; line-height: 1.4; }
.camp-card__stats { display: flex; gap: 10px; flex-wrap: wrap; font-size: .78rem; }

/* ── Inline badge for nav pending count ─── */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--red);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  margin-left: auto;
  line-height: 1;
}

/* ── Native dialog centering ─────────────────────────────────────────────── */
dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  max-height: 90vh;
  overflow-y: auto;
}
dialog::backdrop {
  background: rgba(0, 0, 0, .45);
}

/* ── Modal component ──────────────────────────────────────────────────────── */
.modal {
  width: min(680px, calc(100vw - 24px));
  max-height: min(92vh, 860px);
  border: none;
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  overflow: hidden;
}
.modal[open] {
  display: flex;
  flex-direction: column;
}
.modal--lg { width: min(780px, calc(100vw - 24px)); }
.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: #fff;
}
.modal__title { font-weight: 600; font-size: .95rem; margin: 0; }
.modal__close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 1.1rem;
  padding: 4px 7px; line-height: 1; border-radius: 4px;
  transition: background .15s;
}
.modal__close:hover { background: var(--surface-hover, #f4f4f5); }
.modal__body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  background: #fff;
}
.modal__body .form-actions { margin-bottom: 0; }
@media (max-width: 768px) {
  .modal { width: calc(100vw - 16px); max-height: 96vh; }
}

/* ── Mobile hamburger button ─────────────── */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  background: var(--sidebar-bg);
  color: #e5e7eb;
  border: none;
  border-radius: var(--radius);
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 150;
}

/* ── Responsive breakpoints ──────────────── */
@media (max-width: 768px) {

  /* Show hamburger */
  .sidebar-toggle { display: flex; }

  /* Sidebar slides in as a drawer */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 160;
    transform: translateX(-100%);
    transition: transform 250ms ease;
    width: 260px;
  }
  .sidebar.is-open {
    transform: translateX(0);
  }
  .sidebar-overlay.is-open {
    display: block;
  }

  /* Main fills full width */
  .main { width: 100%; }
  .content { padding: 64px 16px 24px; }

  /* Camp subnav scrolls horizontally */
  .camp-subnav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
  }
  .camp-subnav::-webkit-scrollbar { display: none; }
  .camp-subnav__item { white-space: nowrap; }

  /* Page header stacks on small screens */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  /* Button groups inside page-header wrap */
  .page-header > div { display: flex; flex-wrap: wrap; gap: 8px; }
  .btn { white-space: normal; text-align: center; }

  /* Tables scroll horizontally */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; min-width: 500px; }

  /* Form rows collapse to single column */
  .form-row { grid-template-columns: 1fr; }

  /* Send options stack */
  .send-options { grid-template-columns: 1fr; }

  /* Stats wrap tighter */
  .stat-row { gap: 12px; }
  .stats-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }

  /* Detail list stacks on very small screens */
  .detail-list { grid-template-columns: 1fr; gap: 2px 0; }
  .detail-list dt { margin-top: 10px; }
  .detail-list dd { margin-bottom: 2px; }

  /* Form card full width */
  .form-card { max-width: 100%; }

  /* Auth box */
  .auth-box { margin: 40px 16px; padding: 24px; }
}
