:root {
  --navy: #0f2747;
  --navy-2: #183b67;
  --burgundy: #772432;
  --gold: #f2b544;
  --gold-soft: #fff3d4;
  --cream: #f7f4ef;
  --surface: #ffffff;
  --surface-muted: #f4f6f8;
  --text: #172033;
  --text-muted: #697386;
  --border: #dce2e8;
  --success: #1c7c54;
  --danger: #b42318;
  --shadow: 0 14px 38px rgba(15, 39, 71, 0.08);
  --radius: 18px;
  --radius-small: 11px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.ai-review-list{display:grid;gap:18px}.ai-meeting-card{border:1px solid #dbe3ea;border-radius:18px;padding:20px;background:#fff;box-shadow:0 8px 22px rgba(21,38,58,.06)}.ai-meeting-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:16px}.ai-meeting-head h3{margin:0 0 4px}.ai-meeting-head p{margin:0;color:#64748b}.status-chip,.confidence-chip{border-radius:999px;padding:6px 10px;background:#e8f4ef;color:#176b52;font-weight:800;font-size:.78rem}.ai-proposal-list{display:grid;gap:10px}.ai-proposal{display:grid;grid-template-columns:auto auto 1fr auto;align-items:center;gap:12px;padding:14px;border:1px solid #e2e8f0;border-radius:14px;background:#f8fafc;cursor:pointer}.ai-proposal.needs-review{background:#fff9eb;border-color:#f4ce78}.ai-proposal-main{display:grid;gap:3px}.ai-proposal-main span,.ai-proposal-main small{color:#64748b}.ai-proposal-main small{font-style:italic}.ai-proposal input{width:19px;height:19px}.ai-notice{border-left-color:#6d4fc2}@media(max-width:700px){.ai-proposal{grid-template-columns:auto 1fr auto}.ai-proposal .activity-icon{display:none}.ai-meeting-head{display:grid}}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }

.sidebar {
  background: linear-gradient(180deg, var(--navy), #091b32);
  color: white;
  padding: 28px 20px 22px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px 28px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 13px;
  display: grid; place-items: center; font-weight: 900; letter-spacing: -0.04em;
  color: var(--navy); background: var(--gold);
  box-shadow: 0 8px 25px rgba(242,181,68,.24);
}
.brand strong { display: block; font-size: 1.05rem; }
.brand span { display: block; color: rgba(255,255,255,.64); font-size: .82rem; margin-top: 2px; }

.nav { display: grid; gap: 7px; }
.nav-link {
  border: 0; background: transparent; color: rgba(255,255,255,.75);
  text-align: left; padding: 12px 14px; border-radius: 10px; font-weight: 700;
}
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,.11); color: white; }
.nav-link.active { box-shadow: inset 3px 0 var(--gold); }

.sidebar-footer { margin-top: auto; padding: 18px 6px 0; color: rgba(255,255,255,.58); display: grid; gap: 10px; }
.season-pill { padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.08); color: white; font-size: .84rem; }

.main-content { min-width: 0; padding: 0 34px 40px; }
.topbar {
  min-height: 108px; display: flex; align-items: center; gap: 18px;
  position: sticky; top: 0; background: rgba(247,244,239,.93); backdrop-filter: blur(10px); z-index: 10;
}
.topbar h1 { margin: 0; font-size: clamp(1.55rem, 2.5vw, 2.1rem); letter-spacing: -0.035em; }
.topbar p { margin: 4px 0 0; color: var(--text-muted); }
.topbar .primary-button { margin-left: auto; }
.menu-button { display: none; border: 0; background: white; border-radius: 10px; width: 42px; height: 42px; box-shadow: var(--shadow); }

.view { display: none; }
.view.active { display: block; animation: fadeIn .18s ease; }
@keyframes fadeIn { from { opacity: .4; transform: translateY(3px); } }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat-card, .panel {
  background: var(--surface); border: 1px solid rgba(15,39,71,.08); border-radius: var(--radius); box-shadow: var(--shadow);
}
.stat-card { padding: 20px; display: grid; gap: 7px; }
.stat-card span { color: var(--text-muted); font-weight: 700; font-size: .88rem; }
.stat-card strong { font-size: 2rem; letter-spacing: -0.04em; color: var(--navy); }
.stat-card small { color: var(--text-muted); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(340px, .8fr); gap: 18px; }
.panel { padding: 24px; }
.panel + .panel { margin-top: 0; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.panel-header h2 { margin: 3px 0 0; font-size: 1.25rem; letter-spacing: -0.02em; }
.eyebrow { color: var(--burgundy); font-weight: 900; text-transform: uppercase; font-size: .72rem; letter-spacing: .11em; }

.segmented-control { display: inline-flex; padding: 4px; background: var(--surface-muted); border-radius: 10px; }
.segment { border: 0; background: transparent; padding: 8px 11px; border-radius: 8px; color: var(--text-muted); font-size: .83rem; font-weight: 800; }
.segment.active { background: white; color: var(--navy); box-shadow: 0 3px 10px rgba(15,39,71,.08); }

.leaderboard { display: grid; gap: 10px; }
.leader-rank-group { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; align-items: stretch; }
.leader-rank-members { display: grid; gap: 7px; min-width: 0; }
.shared-rank {
  min-height: 64px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #f4f6f9; border: 1px solid #d6dde6; color: var(--navy); text-align: center; box-shadow: 0 6px 18px rgba(15,39,71,.07);
}
.shared-rank strong { font-size: 1.2rem; line-height: 1; letter-spacing: -.04em; }
.shared-rank .rank-award { margin: 0 0 8px; color: inherit; font-size: 1.65rem; line-height: 1; filter: drop-shadow(0 4px 5px rgba(15,39,71,.12)); }
.shared-rank .rank-place-label { margin-top: 5px; color: var(--text-muted); font-size: .63rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.shared-rank.top-1 { background: linear-gradient(180deg, #fff5cf, #f6df8d); border: 2px solid #e9bf42; }
.shared-rank.top-2 { background: linear-gradient(180deg, #ffffff, #e9eef5); border-color: #bcc8d6; }
.shared-rank.top-3 { background: linear-gradient(180deg, #fff8f0, #f4dcc5); border-color: #d9ad80; }
.leader-row {
  display: grid; grid-template-columns: 40px minmax(0,1fr) auto; gap: 12px; align-items: center;
  padding: 12px 14px; border-radius: 12px; background: #e4e8ee; border: 1px solid #d6dde6; transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.leader-row-grouped { grid-template-columns: minmax(0,1fr) auto; }
.leader-row:hover { transform: scale(1.018); box-shadow: 0 14px 28px rgba(15,39,71,.10); }
.leader-row.top-three { border: 1px solid #f5d98d; }
.leader-row:not(.top-1):not(.top-2):not(.top-3) { background: linear-gradient(180deg, #e7ebf0, #e1e6ec); border-color: #d1d8e2; }
.leader-row.top-1 {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #fff5cf, #f6df8d) padding-box,
              linear-gradient(90deg, #ff4d6d, #ffb703, #8ac926, #00c2ff, #7b2cbf, #ff4d6d) border-box;
  border: 2px solid transparent;
  background-size: 100% 100%, 300% 100%;
  animation: rainbowBorderShift 6s linear infinite;
  box-shadow: 0 10px 28px rgba(191, 147, 30, .14);
}
.leader-row.top-1::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -35%;
  width: 28%;
  background: linear-gradient(100deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.18) 35%, rgba(255,255,255,.72) 50%, rgba(255,255,255,.18) 65%, rgba(255,255,255,0) 100%);
  transform: skewX(-18deg);
  animation: leaderboardShine 8s ease-in-out infinite;
  pointer-events: none;
}
.leader-row.top-1 > * {
  position: relative;
  z-index: 1;
}
.leader-row.top-2 { background: linear-gradient(90deg, #f8fbff, #eef2f7); border: 1px solid #cfd8e3; }
.leader-row.top-3 { background: linear-gradient(90deg, #fff7ef, #fffdfb); border: 1px solid #e4c5a0; }
.rank { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: white; color: var(--navy); font-weight: 900; box-shadow: 0 6px 18px rgba(15,39,71,.08); }
.rank-symbol { font-size: 1.15rem; line-height: 1; }
.rank.top-1 .rank-symbol { animation: crownFloat 1.8s ease-in-out infinite; }
.rank.top-1 { box-shadow: 0 0 0 4px rgba(255,193,7,.14), 0 10px 22px rgba(15,39,71,.12); }
.rank.top-2 { background: linear-gradient(180deg, #ffffff, #eef2f7); }
.rank.top-3 { background: linear-gradient(180deg, #ffffff, #fff1e3); }
@keyframes leaderboardShine {
  0%, 78%, 100% { left: -35%; opacity: 0; }
  82% { opacity: .15; }
  88% { opacity: 1; }
  96% { left: 112%; opacity: 0; }
}
@keyframes rainbowBorderShift {
  0% { background-position: 0 0, 0% 50%; }
  100% { background-position: 0 0, 300% 50%; }
}
@keyframes crownFloat {
  0%, 100% { transform: translateY(0) scale(1); filter: drop-shadow(0 0 0 rgba(255,193,7,0)); }
  50% { transform: translateY(-2px) scale(1.08); filter: drop-shadow(0 4px 8px rgba(255,193,7,.45)); }
}
.leader-name { font-weight: 850; }
.leader-meta { color: var(--text-muted); font-size: .8rem; margin-top: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.leader-meta-sep { color: #9aa7b6; font-weight: 800; }
.leader-points { text-align: right; font-weight: 900; color: var(--navy); }
.leader-points span { display: block; font-size: .72rem; color: var(--text-muted); font-weight: 700; }

.member-link { color: inherit; text-decoration: none; border-bottom: 1px solid transparent; transition: color .16s ease, border-color .16s ease; }
.member-link:hover { color: var(--burgundy); border-bottom-color: currentColor; }
.member-link.inactive { color: var(--text-muted); }
.leaderboard-member-link { font-size: 1rem; }
.directory-member-link { display: inline; }

.level-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid currentColor;
  font-size: .78rem;
  line-height: 1;
  font-weight: 900;
  box-shadow: 0 4px 14px rgba(15,39,71,.08);
}
.level-badge.compact { padding: 5px 8px; font-size: .72rem; border-radius: 10px; }
.profile-level-badge { margin-bottom: 8px; }
.level-badge-square {
  width: 13px;
  height: 13px;
  background: currentColor;
  display: inline-block;
  flex: 0 0 13px;
  filter: drop-shadow(0 1px 1px rgba(15,39,71,.2));
}
/* Each Voice Quest rank has a distinct silhouette as well as its own color. */
.level-badge.level-theme-1 .level-badge-square { border-radius: 50%; }
.level-badge.level-theme-2 .level-badge-square { border-radius: 2px; transform: rotate(45deg) scale(.82); }
.level-badge.level-theme-3 .level-badge-square { clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%); }
.level-badge.level-theme-4 .level-badge-square { clip-path: polygon(8% 5%, 92% 5%, 92% 58%, 50% 100%, 8% 58%); }
.level-badge.level-theme-5 .level-badge-square { width: 15px; height: 15px; flex-basis: 15px; clip-path: polygon(50% 0, 61% 34%, 98% 35%, 68% 56%, 79% 93%, 50% 71%, 21% 93%, 32% 56%, 2% 35%, 39% 34%); }
.level-badge strong { color: inherit; font-weight: 900; }


.activity-list { display: grid; gap: 0; }
.achievement-date { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 14px 0 7px; border-bottom: 1px solid var(--border); }
.achievement-date:first-child { padding-top: 2px; }
.achievement-date span:first-child { color: var(--navy); font-weight: 900; font-size: .9rem; }
.achievement-date span:last-child { color: var(--text-muted); font-size: .68rem; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.achievement-item { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.achievement-item:last-child { border-bottom: 0; }
.achievement-main { min-width: 0; }
.achievement-main > strong { display: block; color: var(--navy); font-size: .96rem; }
.achievement-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.achievement-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 5px 8px; border-radius: 999px; background: #fff8e7; border: 1px solid #f1d99b; color: #654b13; font-size: .7rem; font-weight: 800; line-height: 1.2; }
.achievement-chip > span { font-size: .78rem; }
.achievement-points { color: var(--success); font-weight: 950; font-size: 1.05rem; text-align: right; white-space: nowrap; }
.achievement-points span { display: block; margin-top: 2px; color: var(--text-muted); font-size: .64rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.activity-item { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; gap: 11px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: 0; }
.activity-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--gold-soft); }
.activity-main strong { display: block; font-size: .92rem; }
.activity-main span { display: block; color: var(--text-muted); font-size: .78rem; margin-top: 2px; }
.activity-points { font-weight: 900; color: var(--success); }
.activity-label { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; color: var(--text); }
.activity-label.compact { gap: 7px; font-size: .84rem; }
.activity-label-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--gold-soft);
  border: 1px solid #f1d99b;
  font-size: .92rem;
  line-height: 1;
}
.activity-label.compact .activity-label-icon { width: 25px; height: 25px; border-radius: 8px; font-size: .84rem; }
.activity-quantity { color: var(--text-muted); font-size: .8rem; white-space: nowrap; }
.pathway-chip { display: inline-flex; align-items: center; margin: 5px 0 0 34px; padding: 4px 8px; border-radius: 999px; background: #eef7f5; border: 1px solid #c9e3dd; color: #176b5a; font-size: .72rem; font-weight: 800; line-height: 1.2; }
.rule-row .activity-label { font-weight: 800; }
.rule-row .activity-label-icon { background: #fff7df; }

.level-guide-panel { margin-top: 18px; }
.level-guide {
  display: grid;
  grid-template-columns: repeat(5, minmax(0,1fr));
  gap: 14px;
  position: relative;
}
.level-guide::before {
  content: '';
  position: absolute;
  left: 28px;
  right: 28px;
  top: 52px;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #c8d4e3, #b8d7f0, #bfe5d6, #f0d693, #dcc6f6);
  opacity: .8;
  z-index: 0;
}
.level-card {
  position: relative;
  z-index: 1;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 16px 16px;
  min-height: 178px;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(250,252,255,.98));
  box-shadow: 0 10px 26px rgba(15,39,71,.06);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.level-card:hover {
  transform: translateY(-7px);
  box-shadow: 0 18px 36px rgba(15,39,71,.14);
}
.level-card:hover .level-track-node {
  transform: var(--level-node-transform, none) scale(1.12);
}
.level-card::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 6px;
  background: currentColor;
  opacity: .9;
}
.level-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.level-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: 10px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(255,255,255,.65);
  font-size: .75rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.level-track-node {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: currentColor;
  border: 0;
  box-shadow: none;
  filter: drop-shadow(0 2px 2px rgba(15,39,71,.2));
  flex: 0 0 auto;
  transition: transform .2s ease;
  transform: var(--level-node-transform, none);
}
.level-card.level-theme-1 .level-track-node { border-radius: 50%; }
.level-card.level-theme-2 .level-track-node { --level-node-transform: rotate(45deg) scale(.78); border-radius: 2px; }
.level-card.level-theme-3 .level-track-node { border-radius: 0; clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%); }
.level-card.level-theme-4 .level-track-node { border-radius: 0; clip-path: polygon(8% 5%, 92% 5%, 92% 58%, 50% 100%, 8% 58%); }
.level-card.level-theme-5 .level-track-node { width: 22px; height: 22px; border-radius: 0; clip-path: polygon(50% 0, 61% 34%, 98% 35%, 68% 56%, 79% 93%, 50% 71%, 21% 93%, 32% 56%, 2% 35%, 39% 34%); }
.level-card strong {
  display: block;
  color: var(--navy);
  font-size: 1.05rem;
  line-height: 1.2;
}
.level-range {
  display: block;
  color: var(--text);
  font-size: .92rem;
  font-weight: 800;
  margin-top: 8px;
}
.level-description {
  margin: 12px 0 0;
  color: var(--text-muted);
  font-size: .82rem;
  line-height: 1.45;
}
.level-theme-1 { color: #6b7a90; background: linear-gradient(180deg, #f5f8fc, #edf2f8); border-color: #d5e0eb; }
.level-theme-2 { color: #1d6fd9; background: linear-gradient(180deg, #edf6ff, #e4f0ff); border-color: #c5ddfb; }
.level-theme-3 { color: #178e71; background: linear-gradient(180deg, #eefbf7, #e3f7f0); border-color: #c7eadf; }
.level-theme-4 { color: #b77911; background: linear-gradient(180deg, #fff8e8, #fff2d0); border-color: #efd596; }
.level-theme-5 { color: #7b3fc7; background: linear-gradient(180deg, #f6efff, #efe4ff); border-color: #dcc6f6; box-shadow: 0 14px 30px rgba(123,63,199,.12); }
.level-theme-5 .level-pill { background: rgba(255,255,255,.82); }

.notice { background: #fff9e8; border: 1px solid #f4d588; border-radius: 14px; padding: 14px 16px; display: flex; gap: 10px; margin-bottom: 18px; color: #684c0b; }
.notice span { color: #7a6534; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.meeting-header-grid { margin-bottom: 22px; }
label { display: grid; gap: 7px; font-weight: 800; font-size: .86rem; color: var(--text); }
input, select, textarea {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius-small); background: white;
  padding: 11px 12px; color: var(--text); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(24,59,103,.1); }
textarea { resize: vertical; }
.full-width { grid-column: 1 / -1; }
.hidden { display: none !important; }

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { color: var(--text-muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table-heading-icon { margin-right: 5px; font-size: .9rem; letter-spacing: 0; }
td { padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.meeting-table select, .meeting-table input[type="date"], .meeting-table input[type="number"] { min-width: 124px; padding: 8px; }
.meeting-table input[type="number"] { min-width: 68px; max-width: 76px; }
.meeting-table input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--burgundy); }
.member-cell { min-width: 150px; font-weight: 850; }
.row-preview { font-weight: 900; color: var(--navy); white-space: nowrap; }

.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 22px; }
.meeting-actions { border-top: 1px solid var(--border); padding-top: 18px; }
.meeting-preview { margin-right: auto; }
.meeting-preview span { display: block; color: var(--text-muted); font-size: .8rem; }
.meeting-preview strong { display: block; font-size: 1.7rem; color: var(--navy); }

.primary-button, .secondary-button, .danger-button, .file-button {
  border-radius: 10px; padding: 10px 14px; font-weight: 850; border: 1px solid transparent;
}
.primary-button { background: var(--burgundy); color: white; }
.primary-button:hover { background: #64202b; }
.secondary-button, .file-button { background: white; color: var(--navy); border-color: var(--border); }
.secondary-button:hover, .file-button:hover { background: var(--surface-muted); }
.danger-button { background: #fff1f0; color: var(--danger); border-color: #f5c4c0; }
.compact { padding: 9px 12px; font-size: .86rem; }
.text-button, .icon-button { border: 0; background: transparent; color: var(--burgundy); font-weight: 850; }
.icon-button { font-size: 1.7rem; color: var(--text-muted); }

.points-preview-card { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin-top: 20px; }
.points-preview-card > div { background: white; padding: 16px; }
.points-preview-card span { display: block; color: var(--text-muted); font-size: .78rem; }
.points-preview-card strong { display: block; margin-top: 4px; font-size: 1.35rem; color: var(--navy); }
.points-preview-card .total-preview { background: var(--gold-soft); }

.narrow-panel { max-width: 840px; }
.members-layout { display: grid; grid-template-columns: minmax(0,1fr); gap: 18px; }
.member-selector-panel { padding-bottom: 22px; }
.member-selector-panel .panel-header { margin-bottom: 14px; }
.member-picker-label { display: block; margin-bottom: 7px; color: var(--navy); font-size: .78rem; font-weight: 850; }
.member-filter-bar { display: grid; grid-template-columns: minmax(0,1fr) minmax(220px,.4fr); gap: 14px; align-items: end; }
.member-multiselect { position: relative; }
.member-filter-button { width: 100%; min-height: 52px; padding: 11px 46px 11px 15px; border: 1px solid var(--border); border-radius: 13px; background: white; color: var(--navy); font: inherit; font-weight: 800; text-align: left; cursor: pointer; }
.member-filter-button::after { content: '⌄'; position: absolute; right: 16px; color: var(--burgundy); font-size: 1.1rem; }
.member-filter-menu { position: absolute; z-index: 20; top: calc(100% + 7px); left: 0; width: min(420px, 100%); padding: 10px; border: 1px solid var(--border); border-radius: 14px; background: white; box-shadow: 0 18px 45px rgba(15,39,71,.18); }
.member-filter-menu > input { width: 100%; margin-bottom: 8px; }
.member-filter-options { display: grid; gap: 3px; max-height: 280px; overflow-y: auto; }
.member-filter-option { display: grid; grid-template-columns: 18px 30px minmax(0,1fr); align-items: center; gap: 9px; padding: 8px; border-radius: 9px; cursor: pointer; }
.member-filter-option:hover { background: var(--surface-muted); }
.member-filter-option input { width: 17px; height: 17px; accent-color: var(--burgundy); }
.member-filter-option .avatar { width: 30px; height: 30px; font-size: .68rem; }
.member-filter-option > span:last-child { font-size: .82rem; font-weight: 800; }
.member-filter-clear { width: 100%; padding: 9px 6px 3px; text-align: left; }
.member-activity-filter { display: grid; gap: 7px; color: var(--navy); font-size: .78rem; font-weight: 850; }
.member-activity-filter select { min-height: 52px; }
.selected-member-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.selected-member-chip { padding: 6px 9px; border: 1px solid #c5ddfb; border-radius: 999px; background: #edf6ff; color: #1d6fd9; font-size: .72rem; font-weight: 850; cursor: pointer; }
.selected-member-chip span { margin-left: 4px; }
.member-combobox { position: relative; display: flex; align-items: center; }
.member-combobox > span { position: absolute; left: 15px; color: var(--burgundy); font-size: 1.35rem; font-weight: 900; pointer-events: none; transform: translateY(-1px); }
.member-combobox input { width: 100%; min-height: 54px; padding: 12px 16px 12px 46px; border: 1px solid var(--border); border-radius: 14px; background: white; color: var(--navy); font-size: 1rem; font-weight: 750; box-shadow: 0 7px 20px rgba(15,39,71,.05); }
.member-combobox input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(242,183,5,.14), 0 10px 24px rgba(15,39,71,.08); }
.member-picker-help { margin: 8px 2px 0; color: var(--text-muted); font-size: .75rem; }
.member-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px,1fr)); gap: 12px; }
.member-card { border: 1px solid var(--border); border-radius: 14px; padding: 15px; background: white; text-align: left; cursor: pointer; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.member-card:hover, .member-card.selected { border-color: var(--gold); box-shadow: 0 8px 22px rgba(15,39,71,.08); transform: translateY(-1px); }
.member-card-top { display: flex; gap: 12px; align-items: center; }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: white; font-weight: 900; }
.member-card-top > div > strong { display: block; }
.member-card-top > div > span { display: block; color: var(--text-muted); font-size: .79rem; margin-top: 6px; }
.member-card .level-badge { margin-right: 6px; vertical-align: middle; }
.member-card-stats { display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid var(--border); margin-top: 13px; padding-top: 11px; }
.member-card-stats b { color: var(--navy); }
.member-card .level-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  font-weight: 900;
}
.member-card .level-badge strong {
  display: inline;
  color: inherit;
  font-weight: 900;
}
.member-card .level-badge.level-theme-1 { color: #6b7a90; background: linear-gradient(180deg, #f5f8fc, #edf2f8); border-color: #d5e0eb; }
.member-card .level-badge.level-theme-2 { color: #1d6fd9; background: linear-gradient(180deg, #edf6ff, #e4f0ff); border-color: #c5ddfb; }
.member-card .level-badge.level-theme-3 { color: #178e71; background: linear-gradient(180deg, #eefbf7, #e3f7f0); border-color: #c7eadf; }
.member-card .level-badge.level-theme-4 { color: #b77911; background: linear-gradient(180deg, #fff8e8, #fff2d0); border-color: #efd596; }
.member-card .level-badge.level-theme-5 { color: #7b3fc7; background: linear-gradient(180deg, #f6efff, #efe4ff); border-color: #dcc6f6; }
.member-detail-panel { min-height: 430px; }
.member-title-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 22px; }
.member-title-grid.single-title-grid { grid-template-columns: 1fr; }
.member-title-card { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 16px; padding: 20px; border: 1px solid var(--border); border-radius: 17px; background: linear-gradient(145deg, white, #fbfcfe); box-shadow: 0 8px 24px rgba(15,39,71,.05); }
.member-title-main { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.member-title-main .avatar { width: 58px; height: 58px; flex: 0 0 58px; }
.member-title-main h2 { margin: 5px 0 3px; color: var(--navy); font-size: 1.45rem; }
.member-title-main p { margin: 0; color: var(--text-muted); font-size: .83rem; }
.member-title-stats { display: grid; grid-template-columns: repeat(2, minmax(95px,1fr)); gap: 8px; }
.member-title-stats > div, .club-history-stats > div { padding: 11px 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-muted); }
.member-title-stats span, .club-history-stats span { display: block; color: var(--text-muted); font-size: .66rem; font-weight: 800; }
.member-title-stats strong, .club-history-stats strong { display: block; margin-top: 3px; color: var(--navy); font-size: 1.15rem; }
.member-title-progress, .member-title-badges, .member-title-card > .detail-actions { grid-column: 1 / -1; }
.member-title-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.club-history-title-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px; border-radius: 17px; color: white; background: linear-gradient(120deg, var(--navy), #183b67); box-shadow: 0 10px 28px rgba(15,39,71,.18); }
.club-history-title-card .eyebrow { color: var(--gold); }
.club-history-title-card h2 { margin: 4px 0 5px; color: white; }
.club-history-title-card p { margin: 0; color: #dce6f2; }
.club-history-stats { display: grid; grid-template-columns: repeat(2, minmax(110px,1fr)); gap: 9px; }
.club-history-stats > div { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.18); }
.club-history-stats span { color: #dce6f2; }
.club-history-stats strong { color: white; }
.history-summary-pills { display: flex; gap: 7px; }
.history-summary-pills span { padding: 6px 9px; border-radius: 999px; background: var(--surface-muted); color: var(--text-muted); font-size: .7rem; font-weight: 850; white-space: nowrap; }
.member-profile-layout { display: grid; grid-template-columns: minmax(280px, .42fr) minmax(0, 1fr); gap: 0; }
.member-profile-summary { padding: 4px 28px 4px 2px; border-right: 1px solid var(--border); }
.member-profile-history { min-width: 0; padding-left: 0; }
.member-history-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.member-history-heading h3 { margin: 3px 0 0; font-size: 1.35rem; color: var(--navy); }
.member-history-count { padding: 6px 9px; border-radius: 999px; background: var(--surface-muted); color: var(--text-muted); font-size: .7rem; font-weight: 850; white-space: nowrap; }
.empty-state { min-height: 330px; display: grid; place-content: center; text-align: center; color: var(--text-muted); gap: 6px; }
.member-detail-head { display: flex; align-items: flex-start; gap: 14px; }
.member-detail-head .avatar { width: 54px; height: 54px; }
.member-detail-head h2 { margin: 2px 0 4px; }
.member-detail-head p { margin: 0; color: var(--text-muted); }
.detail-actions { display: flex; gap: 8px; margin-top: 18px; }
.member-stat-pair { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; margin-top: 20px; }
.member-stat-pair > div { padding: 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-muted); }
.member-stat-pair span { display: block; color: var(--text-muted); font-size: .7rem; font-weight: 750; }
.member-stat-pair strong { display: block; margin-top: 4px; color: var(--navy); font-size: 1.25rem; }
.progress-wrap { margin: 22px 0; }
.progress-label { display: flex; justify-content: space-between; gap: 10px; color: var(--text-muted); font-size: .8rem; margin-bottom: 7px; }
.progress-bar { height: 10px; border-radius: 999px; background: var(--surface-muted); overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--burgundy), var(--gold)); }
.badge-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: .78rem;
  font-weight: 850;
  border: 1px solid transparent;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}
.badge:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 24px rgba(15,39,71,.2);
}
.badge-icon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 1.3rem;
  line-height: 1;
}
.badge-website-warrior { background: #e8f4ff; color: #0e5a9c; border-color: #b7daf7; }
.badge-profile-master { background: #f4eaff; color: #6f42c1; border-color: #d7c2f6; }
.badge-profile-master .badge-icon { font-size: 1.5rem; transform: translateY(-5px); }
.badge-first-speech { background: #ffe7f2; color: #b42362; border-color: #f5b4d3; }
.badge-role-rocket { background: #fff0e5; color: #b54708; border-color: #f7c49d; }
.badge-attendance-ace { background: #e9fbef; color: #1f7a45; border-color: #b7e6c8; }
.badge-guest-guru { background: #eaf8f7; color: #0f766e; border-color: #b5e4df; }
.badge-early-bird { background: #fff8db; color: #9a6700; border-color: #f3dd8d; }
.badge-hall-of-fame { background: linear-gradient(90deg, #fff2c4, #ffe2e2, #e8ddff); color: #5f3dc4; border-color: #e7c65f; }
.badge-hall-of-fame .badge-icon { animation: starPulse 2s ease-in-out infinite; }
.badge-default { background: #eef2f6; color: #41546d; border-color: #ccd6e0; }
.badge-large { padding: 13px 20px; gap: 11px; font-size: 1rem; }
.badge-large .badge-icon { width: 36px; height: 36px; font-size: 1.65rem; }
.badge-large.badge-profile-master .badge-icon { font-size: 1.8rem; transform: translateY(-5px); }
.static-badge { cursor: default; }
.static-badge:hover { transform: none; box-shadow: none; }
.badge-detail-page { max-width: 1040px; margin: 0 auto; }
.badge-detail-hero { text-align: center; max-width: 720px; margin: 0 auto; padding: 18px 10px 30px; }
.badge-detail-hero .badge { margin-bottom: 24px; }
.badge-detail-hero h2 { margin: 7px 0 10px; font-size: clamp(1.8rem, 4vw, 2.7rem); color: var(--navy); }
.badge-detail-hero p { margin: 0; color: var(--text-muted); font-size: 1.02rem; line-height: 1.65; }
.badge-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.badge-explanation-card { border: 1px solid var(--border); border-radius: 16px; padding: 22px; background: var(--surface-muted); }
.badge-explanation-card h3 { margin: 6px 0 9px; color: var(--navy); }
.badge-explanation-card p { margin: 0; color: var(--text-muted); line-height: 1.6; }
.badge-recipient-list { display: flex; flex-wrap: wrap; gap: 9px 14px; }
.badge-page-actions { display: flex; align-items: center; gap: 16px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border); }
@keyframes starPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(255,193,7,0)); }
  50% { transform: scale(1.12); filter: drop-shadow(0 0 5px rgba(255,193,7,.55)); }
}
.detail-section-title { margin: 22px 0 10px; font-size: .92rem; }
.member-history-table-wrap { margin-top: 6px; border: 1px solid var(--border); border-radius: 14px; }
.profile-history-table th, .profile-history-table td { font-size: .84rem; }
.profile-history-table tbody tr:hover { background: #fafbfd; }

.history-header { align-items: flex-end; }
.history-filters { display: flex; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.history-filters select, .history-filters input { width: auto; min-width: 150px; }
.history-table td { font-size: .86rem; }
.points-positive { color: var(--success); font-weight: 900; }
.notes-cell { max-width: 320px; color: var(--text-muted); }
.delete-entry { color: var(--danger); }

.level-thresholds-panel, .scoring-rules-panel, .rules-data-panel { margin-bottom: 18px; }
.level-editor { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 10px; }
.level-threshold-card { display: grid; align-content: space-between; min-height: 150px; padding: 15px; border: 1px solid var(--border); border-radius: 15px; background: linear-gradient(160deg, white, var(--surface-muted)); color: var(--navy); }
.level-threshold-card { position: relative; }
.level-threshold-card .level-badge-square { position: absolute; top: 17px; right: 16px; width: 24px; height: 24px; flex-basis: 24px; }
.level-threshold-card.level-theme-1 .level-badge-square { border-radius: 50%; background: #7b8ca3; }
.level-threshold-card.level-theme-2 .level-badge-square { border-radius: 2px; transform: rotate(45deg) scale(.82); background: #2878dc; }
.level-threshold-card.level-theme-3 .level-badge-square { clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%); background: #1b9b79; }
.level-threshold-card.level-theme-4 .level-badge-square { clip-path: polygon(8% 5%, 92% 5%, 92% 58%, 50% 100%, 8% 58%); background: #d09420; }
.level-threshold-card.level-theme-5 .level-badge-square { width: 28px; height: 28px; flex-basis: 28px; top: 14px; right: 14px; clip-path: polygon(50% 0, 61% 34%, 98% 35%, 68% 56%, 79% 93%, 50% 71%, 21% 93%, 32% 56%, 2% 35%, 39% 34%); background: #814dcc; }
.level-threshold-card.level-theme-1 { border-top: 4px solid #7b8ca3; }
.level-threshold-card.level-theme-2 { border-top: 4px solid #2878dc; }
.level-threshold-card.level-theme-3 { border-top: 4px solid #1b9b79; }
.level-threshold-card.level-theme-4 { border-top: 4px solid #d09420; }
.level-threshold-card.level-theme-5 { border-top: 4px solid #814dcc; }
.level-threshold-number { color: var(--text-muted); font-size: .67rem; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.level-threshold-name { display: flex; align-items: center; gap: 8px; margin: 9px 0 13px; font-weight: 900; line-height: 1.2; }
.level-threshold-input input { width: 100%; padding: 9px; text-align: right; font-weight: 900; }
.level-threshold-input small { display: block; margin-top: 4px; color: var(--text-muted); font-size: .62rem; text-align: right; }
.rules-main-header { margin-bottom: 6px; }
.rules-search-wrap { position: relative; display: flex; align-items: center; margin: 15px 0 18px; }
.rules-search-wrap > span { position: absolute; left: 15px; color: var(--burgundy); font-size: 1.3rem; font-weight: 900; pointer-events: none; }
.rules-search-wrap input { width: 100%; min-height: 50px; padding: 11px 15px 11px 45px; border-radius: 13px; background: var(--surface-muted); }
.rules-editor { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; align-items: start; }
.rule-group { overflow: hidden; border: 1px solid var(--border); border-radius: 15px; background: white; }
.rule-group[open] { box-shadow: 0 8px 24px rgba(15,39,71,.06); }
.rule-group summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 16px; cursor: pointer; color: var(--navy); list-style: none; }
.rule-group summary::-webkit-details-marker { display: none; }
.rule-group summary > span:first-child { display: flex; align-items: center; gap: 9px; }
.rule-group summary::after { content: '＋'; color: var(--burgundy); font-weight: 900; }
.rule-group[open] summary::after { content: '−'; }
.rule-group-symbol { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 10px; background: var(--gold-soft); font-size: .95rem; }
.rule-count { margin-left: auto; color: var(--text-muted); font-size: .68rem; font-weight: 800; white-space: nowrap; }
.rule-group-body { padding: 0 16px 8px; border-top: 1px solid var(--border); }
.rule-group-note { margin: 12px 0 5px; color: var(--text-muted); font-size: .76rem; line-height: 1.45; }
.rule-row { display: grid; grid-template-columns: minmax(0,1fr) 110px; gap: 14px; align-items: center; border-top: 1px solid var(--border); padding: 10px 0; }
.rule-group-body > .rule-row:first-of-type { border-top: 0; }
.rule-row span { font-size: .88rem; }
.rule-row input { text-align: right; }
.data-actions { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.file-button { display: block; text-align: center; cursor: pointer; }
.file-button input { display: none; }

.checkbox-label { display: flex; grid-template-columns: none; align-items: center; gap: 9px; }
.checkbox-label input { width: 18px; height: 18px; }

dialog { border: 0; border-radius: 18px; width: min(520px, calc(100vw - 30px)); padding: 0; box-shadow: 0 24px 80px rgba(0,0,0,.24); }
dialog::backdrop { background: rgba(8,20,36,.58); backdrop-filter: blur(3px); }
.dialog-form { padding: 24px; display: grid; gap: 16px; }
.dialog-header { display: flex; justify-content: space-between; align-items: flex-start; }
.dialog-header h2 { margin: 3px 0 0; }

.toast { position: fixed; right: 24px; bottom: 24px; background: var(--navy); color: white; padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow); opacity: 0; transform: translateY(8px); pointer-events: none; transition: .2s; z-index: 50; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1120px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid, .members-layout, .rules-layout { grid-template-columns: 1fr; }
  .member-profile-layout { grid-template-columns: 1fr; }
  .member-profile-summary { padding: 2px 0 24px; border-right: 0; border-bottom: 1px solid var(--border); }
  .member-profile-history { padding: 24px 0 0; }
  .level-guide { grid-template-columns: repeat(3,1fr); }
  .level-editor { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .level-guide::before { left: 22px; right: 22px; }
}

@media (max-width: 800px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; transform: translateX(-105%); transition: .22s; width: 260px; box-shadow: 18px 0 50px rgba(0,0,0,.2); }
  .sidebar.open { transform: translateX(0); }
  .menu-button { display: inline-grid; place-items: center; }
  .main-content { padding: 0 18px 28px; }
  .topbar { min-height: 92px; }
  .topbar p { display: none; }
  .level-guide { grid-template-columns: repeat(2,1fr); }
  .level-guide::before { display: none; }
  .history-header { align-items: flex-start; flex-direction: column; }
  .history-filters { justify-content: flex-start; }
  .badge-detail-grid { grid-template-columns: 1fr; }
  .rules-editor { grid-template-columns: 1fr; }
  .data-actions { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .member-filter-bar { grid-template-columns: 1fr; }
  .member-filter-menu { width: 100%; }
  .member-title-card { grid-template-columns: 1fr; }
  .member-title-stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .club-history-title-card { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 560px) {
  .stats-grid, .form-grid, .points-preview-card { grid-template-columns: 1fr; }
  .level-guide { grid-template-columns: 1fr; }
  .panel { padding: 18px; }
  .topbar .primary-button { font-size: 0; width: 42px; height: 42px; padding: 0; border-radius: 50%; }
  .topbar .primary-button::after { content: "+"; font-size: 1.35rem; }
  .panel-header { align-items: flex-start; }
  .history-filters { width: 100%; }
  .history-filters select, .history-filters input { width: 100%; }
  .notice { flex-direction: column; }
  .member-combobox input { min-height: 50px; font-size: .93rem; }
  .member-history-heading { align-items: flex-start; flex-direction: column; }
  .member-stat-pair { grid-template-columns: 1fr; }
  .level-editor, .data-actions { grid-template-columns: 1fr; }
  .level-threshold-card { min-height: 126px; }
  .rule-row { grid-template-columns: minmax(0,1fr) 86px; gap: 9px; }
  .member-title-grid { grid-template-columns: 1fr; }
  .member-title-main { flex-direction: column; }
  .member-title-stats, .club-history-stats { grid-template-columns: 1fr; width: 100%; }
  .history-summary-pills { flex-wrap: wrap; }
}

/* Shared database connection */
#connectionStatus {
  display: block;
  position: relative;
  padding-left: 15px;
  line-height: 1.35;
}
#connectionStatus::before {
  content: '';
  position: absolute;
  left: 0;
  top: .42em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d9a514;
  box-shadow: 0 0 0 3px rgba(217,165,20,.16);
}
#connectionStatus[data-status="connected"]::before {
  background: #42b883;
  box-shadow: 0 0 0 3px rgba(66,184,131,.16);
}
#connectionStatus[data-status="error"]::before {
  background: #e25b52;
  box-shadow: 0 0 0 3px rgba(226,91,82,.16);
}
.database-error-panel {
  min-height: 100vh;
  padding: 32px;
  display: grid;
  place-items: center;
  background: var(--surface-muted);
}
.database-error-panel > div {
  width: min(620px, 100%);
  padding: 34px;
  border-radius: var(--radius);
  background: white;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.database-error-panel h1 { color: var(--navy); margin-bottom: 10px; }
.database-error-panel p { color: var(--text-muted); line-height: 1.65; }
.database-error-panel code { color: var(--burgundy); }

/* Public read-only / owner editing access */
.auth-hidden { display: none !important; }
.access-controls {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}
.topbar .access-controls + .primary-button { margin-left: 0; }
.access-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: white;
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 850;
  white-space: nowrap;
}
.access-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: #7b8798;
}
.access-badge[data-mode="admin"] { color: var(--success); border-color: #b9decf; background: #f0faf6; }
.access-badge[data-mode="admin"]::before { background: var(--success); }
.access-badge[data-mode="readonly"] { color: #795b0c; border-color: #ead28a; background: #fff9e8; }
.access-badge[data-mode="readonly"]::before { background: #c28a00; }
.access-controls a { text-decoration: none; white-space: nowrap; }

@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; padding: 14px 0; }
  .access-controls { order: 3; width: 100%; justify-content: flex-start; margin-left: 60px; }
}

@media (max-width: 560px) {
  .access-controls { margin-left: 0; gap: 7px; }
  .access-badge { max-width: 52vw; overflow: hidden; text-overflow: ellipsis; }
  .access-controls .secondary-button { padding: 8px 10px; }
  .achievement-date { align-items: flex-start; flex-direction: column; gap: 3px; }
  .achievement-item { align-items: flex-start; }
  .achievement-points { font-size: .95rem; }
}

/* Multiple roles per member in one meeting */
.meeting-table .tally-roles {
  min-width: 220px;
  min-height: 82px;
  padding: 6px;
}
.meeting-table .tally-roles option { padding: 5px 7px; }
.multi-role-help {
  display: block;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: .7rem;
  font-weight: 650;
  white-space: nowrap;
}

.read-only-note { margin: -6px 0 18px; color: var(--text-muted); font-size: .88rem; }
.read-only-group input:disabled, .level-editor input:disabled { background: var(--surface-muted); color: var(--navy); border-color: var(--border); opacity: 1; cursor: not-allowed; }


@media (prefers-reduced-motion: reduce) {
  .leader-row,
  .member-card,
  .level-card,
  .level-track-node,
  .badge {
    transition: none !important;
  }
  .leader-row:hover,
  .member-card:hover,
  .level-card:hover,
  .badge:hover {
    transform: none !important;
  }
  .leader-row.top-1,
  .leader-row.top-1::before,
  .rank.top-1 .rank-symbol {
    animation: none !important;
  }
}
