/* ============================================================
   POST 132 OFFICER PORTAL — App Shell & Components
   ============================================================
   Mobile-first convention (all modules, going forward):
   - Base rules below target the phone layout. Use min-width
     media queries to layer on desktop enhancements, not the
     other way around.
   - Never give a container that spans the content width a fixed
     pixel min-width (min-width on a flex/grid child is the #1
     cause of horizontal-scroll bugs on phones). If content needs
     a floor, cap it with minmax(min(Npx, 100%), 1fr) or relax it
     under a breakpoint instead.
   - For any "list of records" UI (roster, votes, action items,
     etc.), use the shared .data-card-list / .data-card component
     below instead of a <table> or a one-off flex row — it stacks
     correctly on mobile automatically.
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 17px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text);
  background: var(--light-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 600; color: var(--navy-dark); line-height: 1.25; }
a { color: var(--navy); }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap;
}

/* ---------- Login screen ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-6);
  background: linear-gradient(160deg, var(--navy-dark), var(--navy) 60%, var(--navy-light));
}
.login-card {
  background: var(--white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-10) var(--sp-8);
  max-width: 420px;
  width: 100%;
}
.login-brand {
  display: flex; align-items: center; gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}
.login-brand .crest {
  width: 56px; height: 56px; border-radius: var(--r-full);
  object-fit: cover; box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.login-brand h1 { font-size: var(--text-xl); margin: 0; }
.login-brand p { font-size: var(--text-sm); color: var(--text-light); margin: 0; }

.field { margin-bottom: var(--sp-5); }
.field label {
  display: block; font-size: var(--text-sm); font-weight: 600;
  color: var(--text); margin-bottom: var(--sp-2);
}
.field input, .field select {
  width: 100%; padding: 0.75rem 1rem;
  border: 1.5px solid var(--border); border-radius: var(--r);
  font-size: var(--text-base); background: var(--off-white);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--navy-light);
  box-shadow: 0 0 0 3px rgba(42,82,152,0.15); background: var(--white);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: 0.8rem 1.5rem; border-radius: var(--r); border: none;
  font-size: var(--text-base); font-weight: 600; cursor: pointer;
  transition: background var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-light); }
.btn-full { width: 100%; }
.btn-ghost { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: var(--off-white); }
.btn-sm { padding: 0.5rem 1rem; font-size: var(--text-sm); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.alert {
  padding: var(--sp-3) var(--sp-4); border-radius: var(--r);
  font-size: var(--text-sm); margin-bottom: var(--sp-4);
}
.alert-error { background: var(--danger-bg); color: var(--red-dark); }
.alert-info { background: var(--cream); color: var(--navy-dark); }

.login-help { margin-top: var(--sp-5); font-size: var(--text-sm); color: var(--text-muted); text-align: center; }

/* ---------- App shell (post-login) ---------- */
.topbar {
  height: var(--topbar-height);
  background: var(--navy-dark);
  color: var(--white);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--sp-6);
  position: sticky; top: 0; z-index: 20;
  box-shadow: var(--shadow-sm);
}
.topbar-left { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; flex: 1 1 auto; }
.topbar-brand { display: flex; align-items: center; gap: var(--sp-3); font-family: var(--font-heading); font-size: var(--text-lg); min-width: 0; }
.topbar-brand .crest { width: 34px; height: 34px; border-radius: var(--r-full); object-fit: cover; flex-shrink: 0; }
.topbar-brand-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: var(--sp-4); flex-shrink: 0; }
.hamburger-btn {
  display: none; background: none; border: none; color: var(--white);
  font-size: 1.5rem; line-height: 1; border-radius: var(--r);
  min-width: 44px; min-height: 44px;
}
.hamburger-btn:hover { background: rgba(255,255,255,0.12); }
.sidebar-close-btn { display: none; }
.sidebar-backdrop { display: none; }
.topbar-user {
  font-size: var(--text-sm); opacity: 0.85; background: none; border: none;
  color: inherit; font-family: inherit; cursor: pointer; padding: 0.3rem 0.5rem;
  border-radius: var(--r); text-decoration: underline dotted;
  max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar-user:hover { opacity: 1; background: rgba(255,255,255,0.1); }
.topbar-right .btn-ghost {
  color: var(--white);
  border-color: rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.08);
}
.topbar-right .btn-ghost:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.8);
}

.shell { display: flex; min-height: calc(100vh - var(--topbar-height)); }

.sidebar {
  width: var(--sidebar-width); background: var(--white);
  border-right: 1px solid var(--border); flex-shrink: 0;
  padding: var(--sp-6) var(--sp-4);
}
.sidebar nav a {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 0.85rem 1rem; border-radius: var(--r);
  color: var(--text); text-decoration: none; font-weight: 500;
  margin-bottom: var(--sp-1); font-size: var(--text-base);
}
.sidebar nav a:hover { background: var(--light-bg); }
.sidebar nav a.active { background: var(--navy); color: var(--white); }
.sidebar nav .icon { font-size: 1.2rem; width: 1.5rem; text-align: center; }

.main { flex: 1; padding: var(--sp-8); max-width: calc(var(--max-width) - var(--sidebar-width)); }

.subtab-bar { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-6); border-bottom: 1px solid var(--border); }
.subtab-bar a {
  padding: 0.75rem 1.25rem; font-weight: 600; color: var(--text-light);
  text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.subtab-bar a.active { color: var(--navy); border-bottom-color: var(--navy); }
.subtab-bar a:hover { color: var(--navy-light); }

.kpi-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); gap: var(--sp-4); margin-bottom: var(--sp-6); }
.kpi-tile { background: var(--white); border-radius: var(--r-md); box-shadow: var(--shadow-sm); border: 1px solid var(--border-light); padding: var(--sp-5); }
.kpi-tile .kpi-value { font-family: var(--font-heading); font-size: var(--text-2xl); color: var(--navy-dark); line-height: 1.1; }
.kpi-tile .kpi-label { font-size: var(--text-sm); color: var(--text-light); margin-top: var(--sp-1); }

.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: var(--sp-5); }
.chart-card { background: var(--white); border-radius: var(--r-md); box-shadow: var(--shadow-sm); border: 1px solid var(--border-light); padding: var(--sp-5); }
.chart-card h3 { font-size: var(--text-md); margin-bottom: var(--sp-4); }
.chart-card.wide { grid-column: 1 / -1; }
.chart-card-canvas-wrap { position: relative; height: 240px; }
.chart-card.wide .chart-card-canvas-wrap { height: 280px; }

/* ---------- Renewal tracking ---------- */
.kpi-tile-clickable { text-align: left; font: inherit; cursor: pointer; transition: box-shadow var(--t-fast), transform var(--t-fast); }
.kpi-tile-clickable:hover { box-shadow: var(--shadow-md, var(--shadow-sm)); transform: translateY(-1px); }
.kpi-tile-clickable.selected { outline: 2px solid var(--navy); outline-offset: 2px; }

.renewal-progress-card { padding: var(--sp-5); margin-bottom: var(--sp-5); }
.renewal-progress-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-3); }
.renewal-progress-title { color: var(--text-light); }
.renewal-progress-title strong { color: var(--navy-dark); }
.renewal-progress-pct { font-family: var(--font-heading); font-size: var(--text-2xl); color: var(--navy-dark); line-height: 1; }
.renewal-progress-track { display: flex; height: 2.25rem; border-radius: var(--r-full); overflow: hidden; background: var(--border-light); gap: 2px; }
.renewal-progress-seg {
  border: none; color: #fff; font-size: var(--text-xs); font-weight: 600; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 var(--sp-2); min-width: 0;
  text-shadow: 0 1px 1px rgba(0,0,0,0.25);
}
.renewal-progress-seg:hover { filter: brightness(1.08); }

.renewal-footnote { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); font-size: var(--text-sm); color: var(--text-muted); margin: calc(-1 * var(--sp-2)) 0 var(--sp-5); }
.renewal-review-link { background: none; border: none; padding: 0; color: var(--navy); font: inherit; text-decoration: underline; cursor: pointer; text-align: left; }

.renewal-countdown { color: var(--text-light); margin-bottom: var(--sp-5); }
.renewal-countdown strong { color: var(--navy-dark); }
.renewal-timeline-track { position: relative; height: 8px; background: var(--border-light); border-radius: var(--r-full); margin: var(--sp-6) 0.5rem var(--sp-5); }
.renewal-timeline-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--navy-light); border-radius: var(--r-full); }
.renewal-timeline-dot { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--white); border: 3px solid var(--border); }
.renewal-timeline-dot.passed { border-color: var(--navy-light); }
.renewal-timeline-today { position: absolute; top: -6px; bottom: -6px; width: 3px; margin-left: -1.5px; background: var(--navy-dark); border-radius: 2px; }
.renewal-timeline-today span { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font-size: var(--text-xs); font-weight: 700; color: var(--navy-dark); white-space: nowrap; margin-bottom: 2px; }
.renewal-milestones { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); }
.renewal-milestone { border-left: 3px solid var(--border); padding-left: var(--sp-3); }
.renewal-milestone.passed { border-left-color: var(--navy-light); opacity: 0.7; }
.renewal-milestone.next { border-left-color: var(--warning); }
.renewal-milestone .rm-date { font-size: var(--text-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.renewal-milestone .rm-title { font-weight: 700; color: var(--navy-dark); }
.renewal-milestone .rm-desc { font-size: var(--text-sm); color: var(--text-light); }
@media (max-width: 640px) {
  .renewal-milestones { grid-template-columns: 1fr 1fr; }
  .renewal-kpis { grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
  .renewal-kpis .kpi-tile { padding: var(--sp-4); }
  .renewal-progress-seg .seg-label { display: none; }
}

.renewal-list-bar { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.renewal-list-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.renewal-pii-note { font-size: var(--text-sm); color: var(--text-muted); padding: var(--sp-2) var(--sp-5) 0; }
.renewal-card { border-left: 4px solid transparent; }
.renewal-card.renewal-renewed { border-left-color: var(--success); }
.renewal-card.renewal-pending { border-left-color: var(--warning); }
.renewal-card.renewal-expired { border-left-color: var(--danger); }

.page-header { margin-bottom: var(--sp-6); }
.page-header h1 { font-size: var(--text-2xl); margin-bottom: var(--sp-2); }
.page-header p { color: var(--text-light); }

.data-banner {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  background: var(--cream); color: var(--navy-dark);
  padding: var(--sp-2) var(--sp-4); border-radius: var(--r-full);
  font-size: var(--text-sm); font-weight: 500; margin-bottom: var(--sp-5);
}

.card {
  background: var(--white); border-radius: var(--r-md);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border-light);
}

/* ---------- Roster controls ---------- */
.roster-controls {
  padding: var(--sp-5); border-bottom: 1px solid var(--border-light);
  display: flex; flex-wrap: wrap; gap: var(--sp-4); align-items: flex-end;
}
.control-group { display: flex; flex-direction: column; gap: var(--sp-2); }
.control-group label { font-size: var(--text-sm); font-weight: 600; color: var(--text-light); }
.control-group select, .control-group input {
  padding: 0.6rem 0.85rem; border: 1.5px solid var(--border); border-radius: var(--r);
  font-size: var(--text-sm); background: var(--off-white); min-width: 160px;
}
.search-group { flex: 1; min-width: 240px; }
.search-group input { width: 100%; font-size: var(--text-base); padding: 0.75rem 1rem; }
.checkbox-group { flex-direction: row; align-items: center; gap: var(--sp-2); }
.checkbox-group input { min-width: auto; width: 1.15rem; height: 1.15rem; }
.results-count { font-size: var(--text-sm); color: var(--text-muted); padding: 0 var(--sp-5); margin-top: var(--sp-4); }

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-8) var(--sp-5);
  text-align: center;
  background: var(--off-white);
  transition: background var(--t-fast), border-color var(--t-fast);
}
.dropzone.dropzone-active { border-color: var(--navy-light); background: var(--cream); }

table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted); padding: var(--sp-3) var(--sp-4); border-bottom: 2px solid var(--border);
  background: var(--off-white); white-space: nowrap;
}
tbody td { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border-light); font-size: var(--text-sm); }
tbody tr:hover { background: var(--cream); }

.badge {
  display: inline-block; padding: 0.25rem 0.7rem; border-radius: var(--r-full);
  font-size: var(--text-xs); font-weight: 600;
}
.badge-active { background: var(--success-bg); color: var(--success); }
.badge-expired { background: var(--danger-bg); color: var(--danger); }
.badge-other { background: var(--border-light); color: var(--text-light); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info { background: var(--cream); color: var(--navy-dark); }
.badge-notes { background: #E8F1FC; color: #1c5cab; }

/* Executive Board = blue, General Membership = green — matches the Post's own
   compiled vote log document's row-shading and legend colors, so the portal
   reads like the source record members already know. */
.meeting-type-dot {
  display: inline-block; width: 0.6em; height: 0.6em; border-radius: 50%; margin-right: 0.4em; flex-shrink: 0;
}
.meeting-type-dot.eboard { background: #1F4E79; }
.meeting-type-dot.general { background: #375623; }
.badge-eboard { background: rgba(31,78,121,0.12); color: #1F4E79; }
.badge-general { background: rgba(55,86,35,0.14); color: #375623; }
.meeting-type-dot.special { background: var(--gold-dark); }
.badge-special { background: rgba(168,138,61,0.16); color: var(--gold-dark); }

.data-card.vote-card-eboard { background: #DDEBF7; }
.data-card.vote-card-general { background: #E2EFDA; }
.data-card.vote-card-eboard:hover { background: #cfe0f0; }
.data-card.vote-card-general:hover { background: #d3e6ca; }
.data-card.data-card-static { cursor: default; }
.data-card.data-card-static:hover { background: none; }
.data-card.data-card-static.vote-card-eboard:hover { background: #DDEBF7; }
.data-card.data-card-static.vote-card-general:hover { background: #E2EFDA; }

/* Outcome stripe on Vote Log cards — a scannable "how did this go" signal
   independent of the eboard/general background tint, so results (the whole
   point of the log) don't require reading down to the bottom of the card. */
.data-card.vote-result-passed { border-left: 4px solid var(--success); }
.data-card.vote-result-failed { border-left: 4px solid var(--danger); }
.data-card.vote-result-tabled { border-left: 4px solid var(--warning); }
.data-card.vote-result-withdrawn { border-left: 4px solid var(--text-muted); }

.results-stats { font-size: var(--text-sm); color: var(--text-light); }

.category-group-heading {
  font-family: var(--font-heading); font-weight: 600; color: var(--navy-dark);
  font-size: var(--text-sm); text-transform: uppercase; letter-spacing: 0.04em;
  padding: var(--sp-4) var(--sp-5) var(--sp-2); display: flex; justify-content: space-between; align-items: baseline;
}
.category-group-heading .cg-count { color: var(--text-muted); text-transform: none; letter-spacing: normal; font-weight: 500; }
.category-group-wrap { margin-bottom: var(--sp-4); }
.category-group-wrap:last-child { margin-bottom: 0; }

.item-card-list { display: flex; flex-direction: column; }
.item-card { padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border-light); border-left: 4px solid transparent; cursor: pointer; transition: background var(--t-fast); }
.item-card:hover { background: var(--cream); }
.item-card-row1 { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: 0.3rem; }
.item-card-row1 .ic-desc { font-weight: 600; color: var(--navy-dark); }
.item-card-row2 { font-size: var(--text-sm); color: var(--text-light); display: flex; gap: var(--sp-4); flex-wrap: wrap; }
.item-card-row2 .ic-stale { color: var(--danger); font-weight: 600; }

/* Status stripe, same idea as the Vote Log outcome stripe. */
.item-card.status-open { border-left-color: var(--success); }
.item-card.status-silent { border-left-color: var(--danger); }
.item-card.status-upcoming { border-left-color: var(--warning); }
.item-card.status-closed { border-left-color: var(--border); }
.item-card.status-no_followup { border-left-color: var(--text-muted); }

.pii-btn {
  background: none; border: 1px solid var(--border); border-radius: var(--r);
  padding: 0.4rem 0.75rem; font-size: var(--text-xs); color: var(--navy);
}
.pii-btn:hover { background: var(--light-bg); }
.pii-reveal { font-size: var(--text-xs); color: var(--text-light); display: block; margin-top: 0.25rem; }

/* ---------- Shared data-card list ----------
   Generalized version of the roster/item card pattern below.
   Use this for any new "list of records" UI (Vote Log, future
   modules) instead of a <table> or a one-off flex row, so mobile
   stacking is automatic and consistent everywhere. */
.data-card-list { display: flex; flex-direction: column; }
.data-card {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background var(--t-fast);
}
.data-card:last-child { border-bottom: none; }
.data-card:hover { background: var(--cream); }

.data-card-row {
  display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap;
  margin-bottom: 0.3rem;
}
.data-card-row:last-child { margin-bottom: 0; }

.data-card-primary { font-weight: 700; color: var(--navy-dark); }
.data-card-secondary { font-weight: 600; color: var(--navy-dark); }
.data-card-meta { font-size: var(--text-sm); color: var(--text-light); }
.data-card-push-right { margin-left: auto; white-space: nowrap; }

@media (max-width: 640px) {
  .data-card-row { align-items: flex-start; }
  .data-card-push-right { margin-left: 0; }
}

/* ---------- Roster member cards ---------- */
.roster-card-list { display: flex; flex-direction: column; }
.roster-card {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background var(--t-fast);
}
.roster-card:hover { background: var(--cream); }
.roster-card.off-roster { opacity: 0.65; }
.roster-card-row1 {
  display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap;
  font-size: var(--text-base); margin-bottom: 0.3rem;
}
.roster-card-row1 .rc-name { font-weight: 700; color: var(--navy-dark); }
.roster-card-row1 .rc-paid { margin-left: auto; font-size: var(--text-sm); color: var(--text-light); white-space: nowrap; }
.roster-card-row2 {
  font-size: var(--text-sm); color: var(--text-light);
  display: flex; gap: var(--sp-4); flex-wrap: wrap; margin-bottom: 0.3rem;
}
.roster-card-row3 {
  font-size: var(--text-sm); display: flex; gap: var(--sp-4); flex-wrap: wrap;
}
.rc-email, .rc-phone {
  color: var(--navy); text-decoration: none; border-bottom: 1px dotted var(--navy-light);
}
.rc-email:hover { color: var(--navy-light); }
.rc-phone.not-tappable { color: var(--text-light); border-bottom-color: transparent; cursor: default; }
.copy-toast {
  position: fixed; bottom: var(--sp-6); left: 50%; transform: translateX(-50%);
  background: var(--navy-dark); color: var(--white); padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-full); font-size: var(--text-sm); box-shadow: var(--shadow-lg);
  z-index: 100; opacity: 0; transition: opacity var(--t);
}
.copy-toast.show { opacity: 1; }

.profile-section { margin-bottom: var(--sp-5); }
.profile-section h4 { font-size: var(--text-sm); text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: var(--sp-2); }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3) var(--sp-5); font-size: var(--text-sm); }
.profile-grid dt { color: var(--text-muted); }
.profile-grid dd { font-weight: 600; }

.pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-5); flex-wrap: wrap; gap: var(--sp-3);
  border-top: 1px solid var(--border-light);
}
.pagination-info { font-size: var(--text-sm); color: var(--text-muted); }
.pagination-buttons { display: flex; gap: var(--sp-3); }
/* Bigger than the default btn-sm: this sits right below a list of individually
   tappable cards, so it needs a real touch target (44px) and enough padding
   that a slightly-off tap lands on the button rather than the row above it. */
.pagination-buttons .btn { min-height: 44px; padding: 0.7rem 1.1rem; }

.empty-state { text-align: center; padding: var(--sp-16) var(--sp-6); color: var(--text-muted); }
.empty-state h3 { color: var(--text-light); margin-bottom: var(--sp-2); }

/* ---------- Shared modal/popup (used by any module) ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(16,37,69,0.55);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: var(--sp-5);
}
.modal-box { background: var(--white); border-radius: var(--r-md); padding: var(--sp-8); max-width: 440px; width: 100%; box-shadow: var(--shadow-lg); }

.loading-state { text-align: center; padding: var(--sp-16); color: var(--text-muted); }

/* ---------- Meeting Minutes ---------- */
.minutes-month-group { margin-bottom: var(--sp-6); }
.minutes-month-group:last-child { margin-bottom: 0; }
.minutes-month-heading {
  font-family: var(--font-heading); font-weight: 600; color: var(--navy-dark);
  font-size: var(--text-md); padding-bottom: var(--sp-2); margin-bottom: var(--sp-3);
  border-bottom: 2px solid var(--border-light);
}
.minutes-meeting-row {
  display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap;
  padding: var(--sp-4) var(--sp-3); border-bottom: 1px solid var(--border-light);
}
.minutes-meeting-row:last-child { border-bottom: none; }
.minutes-meeting-label { flex: 1 1 220px; min-width: 220px; font-weight: 600; color: var(--navy-dark); }
.minutes-meeting-label .mm-date { display: block; font-weight: 500; font-size: var(--text-sm); color: var(--text-muted); margin-top: 0.15rem; }
.minutes-doc-chips { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.minutes-doc-chip {
  border: 1.5px solid var(--border); border-radius: var(--r-full); background: var(--white);
  padding: 0.45rem 1rem; font-size: var(--text-sm); font-weight: 600; color: var(--navy);
  cursor: pointer; transition: background var(--t-fast), border-color var(--t-fast);
}
.minutes-doc-chip:hover { background: var(--cream); border-color: var(--navy-light); }
.minutes-doc-chip.unavailable { color: var(--text-muted); border-style: dashed; cursor: default; background: none; }
.minutes-doc-chip.unavailable:hover { background: none; border-color: var(--border); }
.mm-row-delete { margin-left: auto; color: var(--danger); }
.mm-row-delete:hover { background: var(--danger-bg, var(--off-white)); border-color: var(--danger); }

.minutes-reading-modal .modal-box { max-width: 780px; max-height: 88vh; display: flex; flex-direction: column; padding: 0; }
.minutes-reading-header { padding: var(--sp-6) var(--sp-8) var(--sp-4); border-bottom: 1px solid var(--border-light); flex-shrink: 0; }
.minutes-reading-header h3 { margin-bottom: 0.2rem; }
.minutes-reading-body { padding: var(--sp-6) var(--sp-8); overflow-y: auto; }
.minutes-reading-footer { padding: var(--sp-4) var(--sp-8); border-top: 1px solid var(--border-light); flex-shrink: 0; }

.minutes-prose { color: var(--text); line-height: 1.65; }
.minutes-prose h1, .minutes-prose h2, .minutes-prose h3, .minutes-prose h4 {
  font-family: var(--font-heading); font-weight: 600; color: var(--navy-dark);
  margin: 1.4em 0 0.5em; line-height: 1.3;
}
.minutes-prose h1:first-child, .minutes-prose h2:first-child, .minutes-prose h3:first-child { margin-top: 0; }
.minutes-prose h1 { font-size: var(--text-xl); border-bottom: 2px solid var(--gold-light); padding-bottom: 0.3em; }
.minutes-prose h2 { font-size: var(--text-lg); color: var(--navy); }
.minutes-prose h3 { font-size: var(--text-md); }
.minutes-prose p { margin: 0.75em 0; }
.minutes-prose ul, .minutes-prose ol { margin: 0.75em 0; padding-left: 1.5em; }
.minutes-prose li { margin: 0.3em 0; }
.minutes-prose strong { color: var(--navy-dark); }
.minutes-prose a { color: var(--navy); text-decoration: underline; }
.minutes-prose blockquote {
  margin: 1em 0; padding: 0.6em 1.2em; border-left: 3px solid var(--gold); background: var(--cream); color: var(--navy-dark);
}
.minutes-prose hr { border: none; border-top: 1px solid var(--border); margin: 1.5em 0; }
.minutes-prose code { background: var(--off-white); border: 1px solid var(--border-light); border-radius: var(--r-sm); padding: 0.1em 0.4em; font-size: 0.9em; }
.minutes-prose table { margin: 1em 0; width: auto; min-width: 60%; }
.minutes-prose th, .minutes-prose td { border: 1px solid var(--border-light); padding: var(--sp-2) var(--sp-3); }
.minutes-prose th { background: var(--off-white); }

@media (max-width: 860px) {
  .hamburger-btn { display: flex; align-items: center; justify-content: center; }

  .topbar { padding: 0 var(--sp-4); gap: var(--sp-2); }
  .topbar-right { gap: var(--sp-2); }
  .topbar-user { max-width: 120px; }

  .shell { flex-direction: column; position: relative; }

  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; width: min(280px, 82vw);
    z-index: 40; border-right: 1px solid var(--border);
    transform: translateX(-100%); transition: transform var(--t);
    box-shadow: var(--shadow-lg); overflow-y: auto;
  }
  .sidebar.open { transform: translateX(0); }

  .sidebar-close-btn {
    display: flex; align-items: center; justify-content: center; margin-left: auto;
    background: none; border: none; font-size: 1.6rem; line-height: 1; color: var(--text-light);
    min-width: 44px; min-height: 44px;
  }

  .sidebar-backdrop {
    display: block; position: fixed; inset: 0; background: rgba(16,37,69,0.5);
    z-index: 35; opacity: 0; pointer-events: none; transition: opacity var(--t);
  }
  .sidebar-backdrop.open { opacity: 1; pointer-events: auto; }

  .main { max-width: 100%; padding: var(--sp-5); }
}

@media (max-width: 640px) {
  .roster-controls { flex-direction: column; align-items: stretch; }
  .control-group select, .control-group input { min-width: 0; width: 100%; }
  .checkbox-group { flex-direction: row; }
  #results-count { flex-direction: column; align-items: flex-start !important; gap: var(--sp-2); }
  .roster-card-row1 { flex-direction: column; align-items: flex-start; gap: var(--sp-1); }
  .roster-card-row1 .rc-paid { margin-left: 0; }
  .profile-grid { grid-template-columns: 1fr; }
}

/* ---------- Password strength meter ---------- */
.pw-meter { margin-top: var(--sp-2); margin-bottom: var(--sp-1); }
.pw-meter-track {
  height: 6px; border-radius: var(--r-full); background: var(--border-light);
  overflow: hidden;
}
.pw-meter-fill {
  height: 100%; border-radius: var(--r-full);
  transition: width var(--t-fast), background var(--t-fast);
}
.pw-meter-label {
  display: block; margin-top: var(--sp-1); font-size: var(--text-xs); font-weight: 600;
}

/* ---------- Temp password reveal panel ---------- */
.temp-password-box {
  background: var(--cream); border: 1.5px solid var(--gold); border-radius: var(--r);
  padding: var(--sp-4); margin-bottom: var(--sp-4);
}
.temp-password-value {
  display: flex; align-items: center; gap: var(--sp-2); margin-top: var(--sp-2);
}
.temp-password-value code {
  flex: 1; font-size: var(--text-md); font-weight: 700; letter-spacing: 0.03em;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 0.5rem 0.75rem; overflow-x: auto; white-space: nowrap;
}

.pii-btn:disabled { opacity: 0.5; cursor: not-allowed; }
