/* ─── Tokens ─────────────────────────────────────────── */
:root {
  --bg:           #000;
  --surface:      rgba(10,10,10,0.82);
  --border:       rgba(255,255,255,0.08);
  --border-focus: rgba(21,101,192,0.8);
  --primary:      #1565C0;
  --primary-lt:   #1976D2;
  --primary-dim:  rgba(21,101,192,0.20);
  --accent:       #CCFF90;
  --gold:         #C9A84C;
  --text:         #F0F0F0;
  --text-muted:   rgba(240,240,240,0.50);
  --text-dim:     rgba(240,240,240,0.25);
  --mono:         'Berkeley Mono', 'JetBrains Mono', 'Fira Code', monospace;
  --sans:         -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --t:            180ms ease;

  /* True CSS bevel — matches Flutter BeveledRectangleBorder(bottomLeft:8, topRight:8) */
  --clip-lg:  polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  --clip-md:  polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 7px 100%, 0 calc(100% - 7px));
  --clip-sm:  polygon(0 0, calc(100% - 5px) 0, 100% 5px, 100% 100%, 5px 100%, 0 calc(100% - 5px));

  /* Kept for inputs only — clip-path breaks focus rings on form fields */
  --radius-input: 2px 7px 2px 7px;
}

/* ─── Reset ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 14px; line-height: 1.5; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; outline: none; background: none; font: inherit; color: inherit; }
input, select { font: inherit; color: var(--text); }

/* ─── Background canvas ───────────────────────────────── */
#sphere-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ─── All views sit above canvas ──────────────────────── */
#landing-view, #setup-view, #login-view, #success-view {
  position: relative;
  z-index: 1;
}

/* ─── Glass mixin ─────────────────────────────────────── */
.glass {
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
}

/* ─── Wordmark ────────────────────────────────────────── */
.wordmark {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--text);
}

/* ─── Top nav ─────────────────────────────────────────── */
.top-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 100;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-link {
  font-size: 13px;
  color: var(--text-muted);
  padding: 5px 12px;
  transition: color var(--t);
}
.nav-link:hover { color: var(--text); }

/* ─── Buttons — true bevel via clip-path ──────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 22px;
  clip-path: var(--clip-md);
  font-size: 13px;
  font-weight: 500;
  transition: background var(--t), color var(--t), opacity var(--t);
  letter-spacing: 0.01em;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-lt); }
.btn-ghost { color: var(--text-muted); background: rgba(255,255,255,0.05); }
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,0.09); }
.btn-sm { padding: 6px 16px; font-size: 12px; }
.btn-full { width: 100%; clip-path: var(--clip-md); }

/* OAuth buttons — full-width, outlined, matches mobile app style */
.btn-oauth {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 13px 20px;
  clip-path: var(--clip-md);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--t), border-color var(--t);
  letter-spacing: 0.01em;
}
.btn-oauth:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.4); }

/* "Continue with email" — subtle text link */
.email-link {
  display: block;
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  margin-top: 20px;
  transition: color var(--t);
}
.email-link:hover { color: rgba(255,255,255,0.8); }

/* Email form panel — hidden until expanded */
.email-panel { display: none; }
.email-panel.open { display: block; }

/* Sign in / Sign up tab strip */
.auth-tabs {
  display: flex;
  background: rgba(255,255,255,0.05);
  clip-path: var(--clip-md);
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1;
  padding: 9px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  transition: all var(--t);
  clip-path: var(--clip-md);
}
.auth-tab.active {
  background: rgba(255,255,255,0.88);
  color: #000;
}

/* Back link inside expanded email panel */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: 18px;
  transition: color var(--t);
}
.back-link:hover { color: var(--text); }

/* Banner shown in wizard steps 2–5 when OAuth was used */
.oauth-banner {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 20px;
  background: var(--primary-dim);
  clip-path: var(--clip-md);
  font-size: 11px;
  color: var(--text-muted);
}
.oauth-banner.visible { display: flex; }
.oauth-banner strong { color: var(--text); font-weight: 500; }

/* ─── Landing ─────────────────────────────────────────── */
#landing-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px 40px;
}
.hero { max-width: 580px; }
.hero-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 20px;
  display: block;
}
.hero-title {
  font-size: clamp(38px, 7vw, 68px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.hero-title .hl { color: var(--primary-lt); }
.hero-sub {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 420px;
  margin: 0 auto 36px;
}
.hero-ctas { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.hero-pills {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center; margin-top: 52px;
}
.pill {
  padding: 4px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ─── Auth shell ──────────────────────────────────────── */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 72px 24px 40px;
}

/* ─── Wizard layout ───────────────────────────────────── */
.wizard-shell {
  display: flex;
  width: 100%;
  max-width: 900px;
  clip-path: var(--clip-lg);
  overflow: hidden;       /* children inherit the bevel clip */
}

.wizard-rail {
  width: 200px;
  flex-shrink: 0;
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  background: rgba(6,6,6,0.92);
  border: 1px solid var(--border);
  border-right: none;
}
.rail-wordmark { margin-bottom: 28px; }
.rail-tagline {
  font-size: 10px; color: var(--text-dim);
  font-family: var(--mono); letter-spacing: 0.1em;
  text-transform: uppercase; margin-top: 2px;
}

.step-list { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.step-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 8px;
  clip-path: var(--clip-sm);
  transition: background var(--t);
}
.step-row.active { background: var(--primary-dim); }
.step-row.done { opacity: 0.45; }

.step-num {
  width: 22px; height: 22px;
  clip-path: var(--clip-sm);
  background: rgba(255,255,255,0.04);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 9px;
  color: var(--text-dim); flex-shrink: 0;
  transition: background var(--t), color var(--t);
}
.step-row.active .step-num { background: var(--primary); color: #fff; }
.step-row.done .step-num { background: rgba(204,255,144,0.12); color: var(--accent); }
.step-label { font-size: 12px; color: var(--text-muted); line-height: 1.3; }
.step-row.active .step-label { color: var(--text); font-weight: 500; }
.step-connector { width: 1px; height: 12px; background: var(--border); margin-left: 19px; }

.rail-footer {
  font-size: 11px; color: var(--text-dim);
  margin-top: 24px; line-height: 1.6;
}
.rail-footer a { color: var(--primary-lt); }

.wizard-body {
  flex: 1;
  padding: 36px 32px;
  background: rgba(8,8,8,0.90);
  border: 1px solid var(--border);
  border-left: none;
}

/* ─── Gradient accent line ────────────────────────────── */
.accent-line {
  height: 1.5px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--gold) 55%, transparent 100%);
  margin-bottom: 24px;
}

.page-title { font-size: 20px; font-weight: 600; margin-bottom: 6px; }
.page-sub { font-size: 12px; color: var(--text-muted); margin-bottom: 24px; }

/* ─── Step pages ──────────────────────────────────────── */
.step-page { display: none; }
.step-page.active { display: block; }

/* ─── Form ────────────────────────────────────────────── */
.fg { margin-bottom: 16px; }
.fl {
  display: block; font-size: 10px;
  font-family: var(--mono); letter-spacing: 0.10em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px;
}
/* Inputs keep border-radius — clip-path breaks browser focus rings */
.fi {
  width: 100%; padding: 9px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  color: var(--text); font-size: 13px; font-family: var(--sans);
  transition: border-color var(--t), box-shadow var(--t);
  appearance: none; -webkit-appearance: none;
}
.fi:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-dim);
  outline: none;
}
.fi::placeholder { color: var(--text-dim); }
.fi option { background: #111; }
.fr { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.btn-row {
  display: flex; gap: 10px;
  margin-top: 24px; justify-content: flex-end;
}

/* ─── Plan grid ────────────────────────────────────────── */
.plan-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 10px; margin-bottom: 18px;
}
.plan-card {
  position: relative;
  padding: 18px 14px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  clip-path: var(--clip-md);
  cursor: pointer;
  transition: background var(--t), border-color var(--t);
}
.plan-card:hover { background: var(--primary-dim); border-color: rgba(204,255,144,0.3); }
.plan-card.sel { background: var(--primary-dim); border-color: var(--primary); }
.plan-badge {
  position: absolute; top: -1px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #000;
  font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 2px 8px; clip-path: var(--clip-sm);
}
.plan-name { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.plan-price { font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 12px; }
.plan-period { font-size: 11px; font-weight: 400; color: var(--text-muted); }
.plan-features { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.plan-features li { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.plan-features li i { color: var(--primary); font-size: 12px; flex-shrink: 0; }
.plan-card.sel .plan-features li { color: var(--text); }

/* ─── Review card ─────────────────────────────────────── */
.rev-card {
  clip-path: var(--clip-md);
  overflow: hidden;
  margin-bottom: 12px;
}
.rev-head {
  padding: 7px 12px;
  background: rgba(255,255,255,0.06);
  border-bottom: 1px solid var(--border);
  font-size: 9px; font-family: var(--mono);
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted);
}
.rev-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  font-size: 12px;
}
.rev-row:last-child { border-bottom: none; }
.rev-key { color: var(--text-muted); }
/* ─── Or divider ──────────────────────────────────────── */
.or-div {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-dim); font-size: 11px; margin: 18px 0;
}
.or-div::before, .or-div::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ─── Login / Success cards ───────────────────────────── */
.auth-card {
  width: 100%; max-width: 420px;
  padding: 36px 32px;
  clip-path: var(--clip-lg);
  background: rgba(8,8,8,0.90);
  border: 1px solid var(--border);  /* visible on straight edges; bevel clips corners */
}

.success-icon {
  width: 52px; height: 52px;
  clip-path: var(--clip-md);
  background: rgba(204,255,144,0.08);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin: 0 auto 20px;
}

/* ─── Responsive ──────────────────────────────────────── */
@media (max-width: 600px) {
  .wizard-rail { display: none; }
  .wizard-body { border-left: 1px solid var(--border); }
  .fr { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: 1fr; }
}

/* ─── Dashboard shell ─────────────────────────────────── */
body.portal-dash { overflow: hidden; }
.dash-shell { position: fixed; inset: 48px 0 0 0; display: flex; z-index: 1; }
.dash-sidebar { width: 200px; flex-shrink: 0; display: flex; flex-direction: column; background: rgba(6,6,6,0.94); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-right: 1px solid var(--border); }
.sidebar-church { display: flex; align-items: center; gap: 10px; padding: 16px 14px 14px; border-bottom: 1px solid var(--border); }
.church-avatar { width: 32px; height: 32px; flex-shrink: 0; clip-path: var(--clip-sm); background: var(--primary-dim); border: 1px solid rgba(21,101,192,0.3); display: flex; align-items: center; justify-content: center; font-size: 14px; color: var(--primary-lt); overflow: hidden; }
.church-avatar img { width: 100%; height: 100%; object-fit: cover; }
.church-name { font-size: 11.5px; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.church-plan { font-size: 9px; font-family: var(--mono); letter-spacing: 0.10em; text-transform: uppercase; color: var(--gold); }
.sidebar-nav { flex: 1; padding: 8px 6px; overflow-y: auto; scrollbar-width: none; }
.sidebar-nav::-webkit-scrollbar { display: none; }
.nav-group-label { font-size: 9px; font-family: var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); padding: 10px 8px 5px; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 7px 10px; clip-path: var(--clip-sm); color: var(--text-muted); font-size: 12px; cursor: pointer; transition: background var(--t), color var(--t); margin-bottom: 1px; text-decoration: none; }
.nav-item:hover  { background: rgba(255,255,255,0.04); color: var(--text); }
.nav-item.active { background: var(--primary-dim); color: var(--text); }
.nav-item i { font-size: 14px; flex-shrink: 0; }
.nav-badge { margin-left: auto; padding: 1px 6px; background: var(--primary); color: #fff; font-size: 9px; font-family: var(--mono); border-radius: 20px; }
.sidebar-footer { padding: 10px 6px 14px; border-top: 1px solid var(--border); }
.dash-main { flex: 1; overflow-y: auto; display: flex; flex-direction: column; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent; }
.dash-main::-webkit-scrollbar { width: 3px; }
.dash-main::-webkit-scrollbar-track { background: transparent; }
.dash-main::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.dash-main::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
.dash-body { flex: 1; padding: 32px 32px 48px; width: 100%; }
.page-eyebrow { font-size: 9px; font-family: var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 6px; }
.page-greeting { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.page-sub { font-size: 12px; color: var(--text-muted); margin-bottom: 28px; }

/* ─── Top-bar extras (dash context) ──────────────────── */
.nav-avatar { width: 28px; height: 28px; clip-path: var(--clip-sm); background: var(--primary-dim); border: 1px solid rgba(21,101,192,0.4); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; color: var(--primary-lt); cursor: pointer; }
.nav-icon-btn { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 16px; cursor: pointer; transition: color var(--t); position: relative; }
.nav-icon-btn:hover { color: var(--text); }
.nav-notif-dot { position: absolute; top: 5px; right: 4px; width: 6px; height: 6px; background: var(--gold); border-radius: 50%; }
.nav-church-tag { font-size: 11px; font-family: var(--mono); letter-spacing: 0.06em; color: var(--text-muted); }

/* ─── Next-service strip ──────────────────────────────── */
.now-strip { flex-shrink: 0; display: flex; align-items: center; padding: 0 20px; height: 50px; background: rgba(8,8,8,0.92); backdrop-filter: blur(16px); border-bottom: 1px solid rgba(21,101,192,0.20); border-left: 3px solid var(--primary); }
.now-label { font-size: 9px; font-family: var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--primary-lt); padding-right: 16px; border-right: 1px solid var(--border); margin-right: 16px; }
.now-service-name { font-size: 13px; font-weight: 600; margin-right: 8px; }
.now-meta { font-size: 11px; color: var(--text-muted); margin-right: 16px; }
.now-chips { display: flex; gap: 6px; }
.now-chip { display: flex; align-items: center; gap: 5px; padding: 3px 8px; clip-path: var(--clip-sm); font-size: 10px; font-family: var(--mono); }
.now-chip i { font-size: 11px; }
.nc-ok   { background: rgba(204,255,144,0.08); color: var(--accent); }
.nc-warn { background: rgba(201,168,76,0.12); color: var(--gold); }
.nc-mute { background: rgba(255,255,255,0.04); color: var(--text-muted); }
.now-actions { margin-left: auto; display: flex; gap: 6px; }

/* ─── Workspace switcher ──────────────────────────────── */
.ws-trigger { cursor: pointer; user-select: none; }
.ws-trigger:hover { background: rgba(255,255,255,0.03); }
.ws-dropdown { display: none; border-bottom: 1px solid var(--border); background: rgba(6,6,6,0.98); }
.ws-row { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 14px; border: none; color: inherit; text-align: left; transition: background 0.12s; background: transparent; cursor: pointer; }
.ws-row:hover { background: rgba(255,255,255,0.04); }
.ws-row.active { background: rgba(21,101,192,0.10); cursor: default; }
.ws-initials { width: 26px; height: 26px; flex-shrink: 0; clip-path: var(--clip-sm); background: var(--primary-dim); border: 1px solid rgba(21,101,192,0.3); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: var(--primary-lt); }
.ws-label { flex: 1; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-label.active { color: var(--text); }
.ws-label.idle   { color: var(--text-muted); }
.ws-footer { padding: 8px 14px; border-top: 1px solid var(--border); display: flex; gap: 14px; }
.ws-footer a { font-size: 10px; color: var(--text-dim); text-decoration: none; font-family: var(--mono); letter-spacing: 0.08em; display: flex; align-items: center; gap: 4px; }
.ws-footer a:hover { color: var(--text-muted); }

/* ─── Data tables ─────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { font-size: 9px; font-family: var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim); padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.data-table td { padding: 10px 12px; font-size: 12px; color: var(--text-muted); border-bottom: 1px solid rgba(255,255,255,0.04); vertical-align: middle; }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }
.data-table .td-name { color: var(--text); font-weight: 500; }
.member-avatar { width: 30px; height: 30px; clip-path: var(--clip-sm); background: rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; color: #fff; flex-shrink: 0; overflow: hidden; }
.member-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Click-to-sort tables (see /portal/sortable.js) */
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; transition: color 0.1s; }
th.sortable:hover { color: var(--text); }
th.sortable.sorted { color: var(--accent); }
th.sortable .sort-ind { font-size: 9px; display: inline-block; }
th.sortable .sort-ind::before { content: '\2195'; color: var(--text-dim); opacity: 0.55; }
th.sortable:hover .sort-ind::before { opacity: 1; }
th.sortable.sorted .sort-ind::before { content: ''; }

/* ── Unified portal avatar ──────────────────────────
   .pa            base (clip-path bevel, flex center)
   .pa-xs  24px   nav / inline indicators
   .pa-sm  36px   lists, sidebar rows
   .pa-md  44px   thread headers, detail cards
   .pa-lg  64px   profile pages
   ──────────────────────────────────────────────── */
.pa {
  display: flex; align-items: center; justify-content: center;
  clip-path: var(--clip-sm);
  overflow: hidden; flex-shrink: 0;
  font-weight: 700; line-height: 1;
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.pa img { width: 100%; height: 100%; object-fit: cover; }
.pa-xs { width: 24px; height: 24px; font-size: 9px; }
.pa-sm { width: 36px; height: 36px; font-size: 12px; }
.pa-md { width: 44px; height: 44px; font-size: 15px; }
.pa-lg { width: 56px; height: 56px; font-size: 20px; clip-path: var(--clip-md); }
/* Muted variant for non-person entities — keeps same grey/white */
.pa-muted { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.5); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; clip-path: var(--clip-sm); font-size: 9px; font-family: var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }
.badge-admin  { background: rgba(201,168,76,0.12); color: var(--gold); }
.badge-member { background: rgba(204,255,144,0.08); color: var(--accent); }
.badge-visitor { background: rgba(255,255,255,0.05); color: var(--text-dim); }

/* ─── Search / filter bar ─────────────────────────────── */
.filter-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.search-wrap { display: flex; align-items: center; flex: 1; max-width: 320px; background: rgba(255,255,255,0.04); border: 1px solid var(--border); clip-path: var(--clip-sm); transition: border-color var(--t), background var(--t); }
.search-wrap:focus-within { border-color: rgba(21,101,192,0.5); background: rgba(21,101,192,0.05); }
.search-wrap .search-btn { flex-shrink: 0; padding: 0 8px 0 10px; background: none; border: none; outline: none; cursor: pointer; color: var(--text-dim); font-size: 14px; transition: color var(--t); line-height: 0; }
.search-wrap .search-btn:hover { color: var(--text); }
.search-input { flex: 1; padding: 7px 10px 7px 0; background: none; border: none; outline: none; color: var(--text); font-size: 12px; font-family: var(--sans); min-width: 0; }
.search-input::placeholder { color: var(--text-dim); }
.filter-tabs { display: flex; gap: 2px; }
.ftab { padding: 6px 12px; font-size: 11px; color: var(--text-muted); clip-path: var(--clip-sm); cursor: pointer; transition: background var(--t), color var(--t); background: rgba(255,255,255,0.03); border: 1px solid var(--border); text-decoration: none; }
.ftab:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.ftab.active { background: var(--primary-dim); color: var(--text); border-color: rgba(21,101,192,0.3); }
.result-count { font-size: 11px; color: var(--text-dim); font-family: var(--mono); margin-left: auto; }

@media (max-width: 760px) {
  .dash-sidebar { display: none; }
  .dash-body { padding: 20px 16px 40px; }
}

/* ─── Toggle switches ─────────────────────────────────── */
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.toggle-row:last-child { border-bottom: none; }
.toggle-label { font-size: 12px; font-weight: 500; color: var(--text); }
.toggle-sub { font-size: 10px; color: var(--text-dim); margin-top: 2px; }
.toggle-switch { position: relative; width: 38px; height: 22px; flex-shrink: 0; }
.toggle-switch input[type="checkbox"] { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track { position: absolute; inset: 0; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12); border-radius: 22px; cursor: pointer; transition: background 0.2s, border-color 0.2s; }
.toggle-track::after { content: ''; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; background: rgba(255,255,255,0.35); border-radius: 50%; transition: transform 0.2s, background 0.2s; }
.toggle-switch input[type="checkbox"]:checked + .toggle-track { background: rgba(204,255,144,0.15); border-color: rgba(204,255,144,0.5); }
.toggle-switch input[type="checkbox"]:checked + .toggle-track::after { transform: translateX(16px); background: var(--accent); }

/* ─── Renée briefing prose (shared: briefing page, reports overview, dashboard take) ─── */
.bf-card { clip-path: var(--clip-lg); border: 1px solid rgba(21,101,192,0.25); background: linear-gradient(160deg, rgba(21,101,192,0.10), rgba(21,101,192,0.03)); padding: 22px 26px; margin-bottom: 28px; }
.bf-lead { font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--primary-lt); margin-bottom: 20px; }
.bf-sec { margin-bottom: 22px; }
.bf-sec:last-child { margin-bottom: 0; }
.bf-sec-head { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; letter-spacing: 0.01em; color: var(--text); margin-bottom: 12px; padding-bottom: 9px; border-bottom: 1px solid var(--border); }
.bf-sec-head i { font-size: 16px; }
.bf-sec.celebrate .bf-sec-head i { color: var(--accent); }
.bf-sec.improve   .bf-sec-head i { color: var(--gold); }
.bf-sec.neutral   .bf-sec-head i { color: var(--primary-lt); }
.bf-bullet { display: flex; gap: 11px; align-items: flex-start; font-size: 13px; color: rgba(240,240,240,0.82); line-height: 1.65; padding: 5px 0; }
.bf-bullet .dot { flex-shrink: 0; margin-top: 7px; width: 5px; height: 5px; border-radius: 50%; background: var(--text-dim); }
.bf-sec.celebrate .bf-bullet .dot { background: var(--accent); }
.bf-sec.improve   .bf-bullet .dot { background: var(--gold); }
.bf-sec.neutral   .bf-bullet .dot { background: var(--primary-lt); }
.bf-p { font-size: 13px; color: rgba(240,240,240,0.82); line-height: 1.7; margin: 8px 0; }
.bf-prose strong { color: var(--text); font-weight: 600; }
/* Dashboard "Weekly Take": lay celebrate / improvement side by side to save vertical space */
.bf-cols .bf-prose { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 24px; align-items: start; }
.bf-cols .bf-prose .bf-lead { grid-column: 1 / -1; }
.bf-cols .bf-prose .bf-sec { margin-bottom: 0; }
@media (max-width: 640px) { .bf-cols .bf-prose { grid-template-columns: 1fr; } }

.bf-steps { clip-path: var(--clip-lg); border: 1px solid var(--border); background: rgba(10,10,10,0.6); padding: 16px 20px 18px; margin-top: 20px; }
.bf-steps-title { font-size: 9px; font-family: var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 6px; }
.bf-step { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid rgba(255,255,255,0.05); font-size: 13px; color: rgba(240,240,240,0.85); line-height: 1.6; }
.bf-step .num { flex-shrink: 0; width: 20px; height: 20px; clip-path: var(--clip-sm); display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 10px; color: var(--text-dim); background: rgba(255,255,255,0.04); border: 1px solid var(--border); }
.bf-step.start .num { color: #0a0a0a; background: var(--accent); border-color: var(--accent); }
.bf-step .body { flex: 1; }
.bf-step .badge { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; font-family: var(--mono); font-size: 8px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); border: 1px solid rgba(204,255,144,0.4); padding: 2px 6px; clip-path: var(--clip-sm); vertical-align: middle; }

/* Preview clamp (dashboard teaser) */
.bf-clamp { position: relative; max-height: 240px; overflow: hidden; }
.bf-clamp::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 90px; background: linear-gradient(transparent, #0a0a0a); pointer-events: none; }
.bf-more { display: inline-block; margin-top: 12px; font-size: 12px; font-family: var(--mono); color: var(--primary-lt); text-decoration: none; }

/* ─── Collapsible sections (dashboard & beyond) ─────────── */
.collapse-toggle { cursor: pointer; user-select: none; }
.collapse-toggle .sec-caret { font-size: 12px; flex-shrink: 0; transition: transform 0.2s ease; color: var(--text-dim); }
[data-collapse] > .collapse-toggle .sec-caret { opacity: 0.6; }
[data-collapse] > .collapse-toggle:hover .sec-caret { opacity: 1; }
.collapsed > .collapse-toggle .sec-caret { transform: rotate(-90deg); }
.collapse-body { animation: bf-reveal 0.18s ease; }
.collapsed > .collapse-body { display: none; }
@keyframes bf-reveal { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
/* section-head used as a toggle: keep title left, caret right */
.section-head.collapse-toggle { display: flex; align-items: center; justify-content: space-between; gap: 8px; transition: color 0.15s; }
.section-head.collapse-toggle:hover { color: var(--text-muted); }
/* a touch more breathing room when a section is collapsed to its header */
.dash-sec { margin-bottom: 0; }
.dash-sec.collapsed { margin-bottom: 20px; }

/* ─── Report visualizations ─────────────────────────────── */
.viz-card { clip-path: var(--clip-lg); background: rgba(10,10,10,0.88); border: 1px solid var(--border); padding: 18px 20px; margin-bottom: 16px; }
.viz-title { font-size: 9px; font-family: var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 16px; }

/* ranked horizontal bars */
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: block; text-decoration: none; }
.bar-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 5px; }
.bar-label { font-size: 12px; color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-sub { font-size: 10px; color: var(--text-dim); font-family: var(--mono); font-weight: 400; }
.bar-val { font-size: 12px; font-family: var(--mono); color: var(--text); flex-shrink: 0; }
.bar-track { height: 7px; background: rgba(255,255,255,0.05); clip-path: var(--clip-sm); overflow: hidden; }
.bar-fill { height: 100%; clip-path: var(--clip-sm); transition: width 0.45s ease; }
a.bar-row:hover .bar-label { color: var(--primary-lt); }
a.bar-row:hover .bar-fill { filter: brightness(1.15); }

/* assimilation funnel */
.funnel { display: flex; flex-direction: column; gap: 8px; }
.fn-stage { display: block; text-decoration: none; }
.fn-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; gap: 10px; }
.fn-label { font-size: 12px; color: var(--text); font-weight: 500; }
.fn-val { font-size: 13px; font-family: var(--mono); color: var(--text); flex-shrink: 0; }
.fn-drop { font-size: 9px; font-family: var(--mono); color: var(--text-dim); margin-left: 8px; }
.fn-bar { height: 28px; min-width: 2px; clip-path: var(--clip-sm); background: linear-gradient(90deg, rgba(21,101,192,0.55), rgba(21,101,192,0.22)); transition: width 0.45s ease; }
a.fn-stage:hover .fn-bar { background: linear-gradient(90deg, rgba(21,101,192,0.78), rgba(21,101,192,0.38)); }
a.fn-stage:hover .fn-label { color: var(--primary-lt); }

/* progress ring */
.ring-wrap { display: flex; align-items: center; gap: 18px; }

/* collapsible detail toggle used inside report sections */
.detail-toggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; font-size: 10px; font-family: var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 12px; }
.detail-toggle:hover { color: var(--text-muted); }
.detail-toggle .sec-caret { transition: transform 0.2s ease; font-size: 11px; }
.collapsed > .detail-toggle .sec-caret { transform: rotate(-90deg); }

/* ─── Report KPI card (with delta) ─────────────────────── */
.rkpi { clip-path: var(--clip-lg); background: rgba(10,10,10,0.88); border: 1px solid var(--border); padding: 16px 18px; }
.rkpi-val { font-size: 28px; font-weight: 700; font-family: var(--mono); color: var(--text); line-height: 1; }
.rkpi-label { font-size: 9px; font-family: var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim); margin-top: 8px; }
.rkpi-delta { font-size: 11px; font-family: var(--mono); margin-top: 6px; }
.rkpi-delta.up { color: var(--accent); }
.rkpi-delta.down { color: #ff8a80; }
.rkpi-delta.flat { color: var(--text-dim); }
.rkpi-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }

/* ─── Diverging monthly trend columns ──────────────────── */
.tcols { display: flex; align-items: stretch; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.tcol { flex: 1; min-width: 22px; display: flex; flex-direction: column; align-items: center; }
.tc-up { height: 54px; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.tc-down { height: 54px; width: 100%; display: flex; align-items: flex-start; justify-content: center; }
.tc-bar { width: 62%; max-width: 22px; min-height: 0; clip-path: var(--clip-sm); transition: height 0.45s ease; }
.tc-up-bar { background: var(--accent); }
.tc-down-bar { background: #ff8a80; }
.tc-zero { height: 1px; width: 100%; background: var(--border); }
.tcol:hover .tc-bar { filter: brightness(1.2); }
.tc-label { font-size: 8px; font-family: var(--mono); color: var(--text-dim); margin-top: 6px; white-space: nowrap; }
.tc-legend { display: flex; gap: 18px; margin-top: 14px; font-size: 10px; color: var(--text-dim); font-family: var(--mono); }
.tc-key { display: inline-block; width: 8px; height: 8px; clip-path: var(--clip-sm); vertical-align: middle; margin-right: 5px; }
