:root {
  --fbla-blue: #003f87;
  --fbla-blue-dark: #002d63;
  --fbla-gold: #fdb913;
  --fbla-gold-dark: #d99a00;

  --bg: #f5f6f7;
  --surface: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #d1d5db;
  --border-soft: #e5e7eb;

  --success: #15803d;
  --success-bg: #dcfce7;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

.offline-banner {
  position: fixed;
  inset: 0 0 auto;
  z-index: 200;
  padding: 10px 18px;
  color: #4b3300;
  background: #fff1b8;
  border-bottom: 1px solid #e3c458;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
}
.sheets-backup-banner {
  position: fixed; z-index: 190; right: 18px; bottom: 18px; display: flex; max-width: 440px;
  align-items: center; gap: 14px; padding: 13px 15px; border: 1px solid #e5b84c; border-radius: 11px;
  color: #5f3d00; background: #fff7dc; box-shadow: 0 14px 34px rgba(65, 43, 0, .16); font-size: 12.5px;
}
.sheets-backup-banner button { flex: 0 0 auto; border: 0; color: #684500; background: transparent; text-decoration: underline; cursor: pointer; font: inherit; font-weight: 700; }
@media (max-width: 560px) { .sheets-backup-banner { right: 10px; bottom: 82px; left: 10px; } }

:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid #5da4ff;
  outline-offset: 2px;
}

/* ===== Login overlay ===== */
.overlay {
  position: fixed; inset: 0;
  background: rgba(17, 24, 39, 0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
}
.card {
  background: var(--surface);
  padding: 32px;
  border-radius: 4px;
  border: 1px solid var(--border);
  border-top: 4px solid var(--fbla-blue);
  width: 400px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
.card h1 {
  margin: 0 0 8px;
  color: var(--fbla-blue);
  font-size: 22px;
  font-weight: 700;
}
.card p { margin: 8px 0; color: var(--muted); }
.card > input {
  width: 100%; padding: 10px 12px; margin-top: 8px;
  border: 1px solid var(--border); border-radius: 4px; font: inherit;
}
.card > input:focus {
  outline: none; border-color: var(--fbla-blue);
}
.card > button {
  margin-top: 14px; width: 100%; padding: 10px;
  background: var(--fbla-blue); color: white; border: 0; border-radius: 4px;
  font-weight: 600; cursor: pointer; font-size: 14px;
}
.card > button:hover { background: var(--fbla-blue-dark); }
.hint { font-size: 12px; margin-top: 12px; color: var(--muted); }

/* ===== About Us: big button above the login card ===== */
.login-stack { display: flex; flex-direction: column; align-items: stretch; gap: 14px; width: 400px; max-width: 100%; }
.login-stack .login-card { width: 100%; }
.about-cta {
  display: flex; align-items: center; gap: 13px;
  width: 100%; padding: 15px 18px; cursor: pointer; text-align: left;
  background: var(--fbla-blue); color: #fff;
  border: 0; border-left: 5px solid var(--fbla-gold); border-radius: 6px;
  box-shadow: 0 8px 22px rgba(0, 45, 99, .28); font-family: inherit;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.about-cta:hover { background: var(--fbla-blue-dark); transform: translateY(-1px); box-shadow: 0 12px 28px rgba(0, 45, 99, .34); }
.about-cta-star {
  flex: 0 0 30px; color: var(--fbla-gold); font-size: 27px; line-height: 1; text-align: center;
}
.about-cta-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.about-cta-text strong { font-size: 15.5px; font-weight: 700; }
.about-cta-text small { font-size: 11.5px; color: rgba(255, 255, 255, .8); }
.about-cta-arrow { font-size: 26px; line-height: 1; color: rgba(255, 255, 255, .7); }

/* ===== About Us: full page ===== */
.about-overlay {
  position: fixed; inset: 0; z-index: 120;
  background: #fff; overflow-y: auto;
}
.about-topbar {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(6px); border-bottom: 1px solid var(--border-soft);
}
.about-back {
  background: transparent; border: 0; color: var(--fbla-blue);
  font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; padding: 6px 4px;
}
.about-back:hover { text-decoration: underline; }
.about-brand { display: flex; align-items: center; }
.about-brand-logo { width: 34px; height: 34px; object-fit: contain; }

.about-page { max-width: 1120px; margin: 0 auto; padding: 0 32px 72px; }

.about-kicker { margin: 0 0 10px; color: #8a6100; font-size: 13px; font-weight: 750; }
.about-hero {
  display: grid; grid-template-columns: minmax(300px, .86fr) minmax(460px, 1.14fr);
  gap: 56px; align-items: center; padding: 62px 0 68px;
}
.about-hero-copy { max-width: 500px; }
.about-hero h1 { margin: 0 0 22px; color: var(--fbla-blue); font-size: clamp(48px, 6vw, 72px); line-height: .98; font-weight: 800; letter-spacing: -.04em; }
.about-lead { margin: 0 0 28px; font-size: 17px; line-height: 1.68; color: #374151; }
.about-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.about-join-btn {
  background: var(--fbla-gold); color: #322500; border: 1px solid #e2a400; border-radius: 3px;
  padding: 12px 20px; font: inherit; font-weight: 800; font-size: 14.5px; cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.about-join-btn:hover { background: #ffc72c; border-color: #c89000; }
.about-text-link { color: var(--fbla-blue); font-weight: 700; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.about-video { min-width: 0; }
.about-video-frame { position: relative; aspect-ratio: 16 / 9; background: #0d2d5b; border-bottom: 5px solid var(--fbla-gold); }
.about-video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.about-video-caption { display: flex; justify-content: space-between; gap: 22px; padding-top: 13px; color: #4b5563; font-size: 13px; line-height: 1.45; }
.about-video-caption div { display: flex; flex-direction: column; gap: 2px; }
.about-video-caption strong { color: var(--text); font-size: 14px; }
.about-video-caption a { flex: 0 0 auto; color: var(--fbla-blue); font-weight: 700; }

.about-year {
  display: grid; grid-template-columns: 220px minmax(0, 1fr); column-gap: 58px;
  padding: 38px 0 42px; border-top: 1px solid #cfd5dc; border-bottom: 1px solid #cfd5dc;
}
.about-year .about-kicker { grid-column: 1; margin-bottom: 5px; }
.about-year h2 { grid-column: 1; margin: 0; color: var(--fbla-blue); font-size: 28px; line-height: 1.16; }
.about-year > p:last-child { grid-column: 2; grid-row: 1 / span 2; align-self: center; margin: 0; font-size: 20px; line-height: 1.62; color: #313943; }
.about-year strong { color: var(--fbla-blue); font-weight: 800; }

.about-copy-section {
  display: grid; grid-template-columns: 220px minmax(0, 1fr); column-gap: 58px;
  padding: 58px 0 66px;
}
.about-copy-section h2 { margin: 0; color: var(--fbla-blue); font-size: 29px; line-height: 1.18; }
.about-copy-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 38px; }
.about-copy-columns p { margin: 0; color: #374151; font-size: 15.5px; line-height: 1.72; }
.about-copy-section > .about-text-link { grid-column: 2; justify-self: start; margin-top: 22px; }

.about-photos { padding-top: 54px; border-top: 8px solid var(--fbla-blue); }
.about-photos-intro { max-width: 660px; margin-bottom: 50px; }
.about-photos-intro h2 { margin: 0 0 14px; color: var(--fbla-blue); font-size: clamp(34px, 5vw, 48px); line-height: 1.05; letter-spacing: -.025em; }
.about-photos-intro > p:last-child { margin: 0; color: #4b5563; font-size: 16px; line-height: 1.6; }
.about-photo-stop { margin-bottom: 62px; }
.about-photo-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid #d7dce2; }
.about-photo-heading h3 { margin: 0; color: #1f2937; font-size: 23px; }
.about-gallery-arrows { display: flex; gap: 8px; }
.about-gallery-arrow {
  width: 40px; height: 40px; padding: 0; border: 1px solid #aeb7c2; border-radius: 50%;
  display: grid; place-items: center; background: #fff; color: var(--fbla-blue); font: inherit; font-size: 20px; line-height: 1;
  cursor: pointer; transition: color .12s ease, background .12s ease, border-color .12s ease;
}
.about-gallery-arrow:hover:not(:disabled) { background: var(--fbla-blue); border-color: var(--fbla-blue); color: #fff; }
.about-gallery-arrow:disabled { opacity: .32; cursor: default; }
.about-photo-grid {
  display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
  scroll-behavior: smooth; overscroll-behavior-x: contain; scrollbar-width: none;
}
.about-photo-grid::-webkit-scrollbar { display: none; }
.about-photo-grid a {
  display: block; flex: 0 0 min(70%, 720px); aspect-ratio: 16 / 10;
  min-width: 0; background: #e8eaed; overflow: hidden; scroll-snap-align: start;
}
.about-photo-grid img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .2s ease; }
.about-photo-grid a:hover img { transform: scale(1.012); }

.about-after-school { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 58px; padding: 8px 0 56px; }
.about-after-school h2 { margin: 0; color: var(--fbla-blue); font-size: 28px; }
.about-after-school p { margin: 0; max-width: 650px; color: #374151; font-size: 16px; line-height: 1.7; }

.about-leadership-section { padding: 42px 0 50px; border-top: 1px solid #cfd5dc; border-bottom: 1px solid #cfd5dc; }
.about-leadership-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 26px; }
.about-leadership-heading h2 { margin: 0; color: var(--fbla-blue); font-size: 28px; }
.about-leadership-heading > p { margin: 0 0 3px; color: #4b5563; font-size: 14px; }
.about-leaders { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0 24px; }
.about-leader { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid var(--border-soft); }
.about-leader-avatar {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--fbla-blue); color: #fff; font-weight: 800; font-size: 14px;
}
.about-leader-text { display: flex; flex-direction: column; line-height: 1.3; }
.about-leader-text strong { font-size: 14.5px; color: var(--text); }
.about-leader-text small { font-size: 12px; color: var(--muted); }

.about-cta-band { max-width: 650px; margin: 0 auto; text-align: center; padding: 62px 0 4px; }
.about-cta-band h2 { margin: 0 0 11px; color: var(--fbla-blue); font-size: 30px; font-weight: 800; }
.about-cta-band p { margin: 0 0 21px; font-size: 15.5px; line-height: 1.6; color: #374151; }
.about-links { display: flex; justify-content: center; gap: 24px; margin-top: 22px; font-size: 14px; }
.about-links a { color: var(--fbla-blue); font-weight: 700; }

@media (max-width: 760px) {
  .about-cta { gap: 10px; padding: 14px; }
  .about-cta-star { flex-basis: 26px; font-size: 24px; }
  .about-cta-text small { line-height: 1.35; }
  .about-page { padding-left: 18px; padding-right: 18px; }
  .about-hero { grid-template-columns: 1fr; gap: 38px; padding: 42px 0 50px; }
  .about-hero h1 { font-size: 46px; }
  .about-lead { font-size: 15.5px; }
  .about-video-caption { display: block; }
  .about-video-caption a { display: inline-block; margin-top: 8px; }
  .about-year, .about-copy-section, .about-after-school { grid-template-columns: 1fr; gap: 18px; }
  .about-year { padding: 31px 0 35px; }
  .about-year .about-kicker, .about-year h2, .about-year > p:last-child { grid-column: 1; grid-row: auto; }
  .about-year > p:last-child { font-size: 17px; }
  .about-copy-section { padding: 44px 0 52px; }
  .about-copy-columns { grid-template-columns: 1fr; gap: 18px; }
  .about-copy-section > .about-text-link { grid-column: 1; }
  .about-photos { padding-top: 38px; }
  .about-photos-intro { margin-bottom: 38px; }
  .about-photos-intro h2 { font-size: 36px; }
  .about-photo-stop { margin-bottom: 48px; }
  .about-gallery-arrow { width: 38px; height: 38px; }
  .about-photo-grid { gap: 10px; margin-right: -18px; padding: 0 18px 8px 0; }
  .about-photo-grid a { flex-basis: calc(100% - 38px); aspect-ratio: 4 / 3; }
  .about-photo-grid a:hover img { transform: none; }
  .about-after-school { padding-bottom: 45px; }
  .about-leadership-heading { display: block; }
  .about-leadership-heading > p { margin-top: 10px; }
  .about-links { flex-direction: column; gap: 10px; }
}

@media (max-height: 700px) {
  .overlay { align-items: flex-start; overflow-y: auto; }
}

/* ===== App layout ===== */
.app { display: grid; grid-template-columns: 230px 1fr; height: 100vh; }

.sidebar {
  background: var(--fbla-blue);
  color: white;
  padding: 18px 12px;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--fbla-blue-dark);
}
.brand {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 24px; padding: 4px 6px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
.brand-logo {
  width: 42px; height: 42px;
  object-fit: contain;
  background: white;
  border-radius: 4px;
  padding: 3px;
}
.brand-text { line-height: 1.2; }
.brand-name { font-weight: 700; color: white; font-size: 14px; }
.brand-sub { font-size: 11px; color: rgba(255, 255, 255, 0.7); margin-top: 2px; }

nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.nav-btn {
  background: transparent; color: rgba(255, 255, 255, 0.85); border: 0;
  padding: 9px 14px; text-align: left; border-radius: 3px;
  cursor: pointer; font-size: 13.5px; font-family: inherit;
  border-left: 3px solid transparent;
}
.nav-btn:hover { background: rgba(255, 255, 255, 0.08); color: white; }
.nav-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: white;
  font-weight: 600;
  border-left-color: var(--fbla-gold);
}

/* Grouped navigation (collapsible sections of tabs). */
.nav-group { display: flex; flex-direction: column; }
.nav-group-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: transparent; color: rgba(255, 255, 255, 0.6); border: 0;
  padding: 9px 14px; margin-top: 4px; text-align: left; border-radius: 3px;
  cursor: pointer; font-size: 11px; font-family: inherit; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.nav-group-btn:hover { background: rgba(255, 255, 255, 0.06); color: rgba(255, 255, 255, 0.9); }
.nav-caret { transition: transform 0.15s ease; font-size: 10px; }
.nav-caret::before { content: '\25B8'; } /* ▸ */
.nav-group.open > .nav-group-btn .nav-caret { transform: rotate(90deg); }
/* A group with an unread/attention badge inside it while collapsed. */
.nav-group.has-alert > .nav-group-btn { color: var(--fbla-gold); }
.nav-group-items { display: none; flex-direction: column; gap: 1px; }
.nav-group.open > .nav-group-items { display: flex; }
.nav-group-items .nav-btn { padding-left: 26px; font-size: 13px; }

.user-box {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 14px; margin-top: 14px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.85);
}
.user-box strong { color: white; }
.user-box button {
  width: 100%; margin-top: 8px; padding: 7px;
  background: var(--fbla-gold); color: var(--fbla-blue-dark);
  border: 0; border-radius: 3px; font-weight: 700; cursor: pointer;
  font-family: inherit; font-size: 12.5px;
}
.user-box button:hover { background: var(--fbla-gold-dark); color: white; }
.user-box .text-btn {
  background: transparent; color: rgba(255, 255, 255, 0.65);
  font-weight: 400; padding: 5px;
  text-decoration: underline;
}
.user-box .text-btn:hover { color: white; background: transparent; }
.mode-view { color: var(--fbla-gold); margin: 6px 0 0; font-weight: 600; font-size: 11px; letter-spacing: 0.05em; }
.mode-edit { color: #86efac; margin: 6px 0 0; font-weight: 600; font-size: 11px; letter-spacing: 0.05em; }

.main { overflow: auto; padding: 28px 32px; background: var(--bg); }
.tab h2 {
  color: var(--text); margin: 0 0 18px;
  font-size: 24px; font-weight: 700;
}

.toolbar {
  display: flex; gap: 8px; align-items: center;
  margin-bottom: 18px; flex-wrap: wrap;
}
.toolbar input, .toolbar select {
  padding: 8px 11px; border: 1px solid var(--border);
  border-radius: 4px; font: inherit;
  background: white;
}
.toolbar input:focus, .toolbar select:focus {
  outline: none; border-color: var(--fbla-blue);
}
.toolbar input { min-width: 220px; }

.btn {
  padding: 8px 14px; border: 0; border-radius: 4px;
  cursor: pointer; font: inherit; font-weight: 600;
  background: var(--fbla-blue); color: white;
  font-size: 13px;
}
.btn:hover { background: var(--fbla-blue-dark); }
.btn.secondary {
  background: white; color: var(--text);
  border: 1px solid var(--border);
}
.btn.secondary:hover { border-color: var(--fbla-blue); color: var(--fbla-blue); }
.btn.gold {
  background: var(--fbla-gold); color: var(--fbla-blue-dark);
}
.btn.gold:hover { background: var(--fbla-gold-dark); color: white; }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #991b1b; }
.btn.small { padding: 5px 10px; font-size: 12px; font-weight: 500; margin-right: 4px; }
.btn[disabled] { background: #d1d5db; cursor: not-allowed; color: white; }
.btn.secondary[disabled] { background: white; color: #d1d5db; border-color: #e5e7eb; }

.panel {
  background: white; border-radius: 4px;
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--border-soft);
}
.panel h3 {
  margin: 0 0 14px; color: var(--text);
  font-size: 15px; font-weight: 600;
}

/* ===== KPIs ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px; margin-bottom: 22px;
}
.kpi {
  background: white; border-radius: 4px; padding: 16px;
  border: 1px solid var(--border-soft);
  border-top: 3px solid var(--fbla-blue);
}
.kpi.income { border-top-color: var(--success); }
.kpi.expense { border-top-color: var(--danger); }
.kpi.warn { border-top-color: var(--fbla-gold); }
.kpi-label {
  font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.05em;
  font-weight: 600;
}
.kpi-value {
  font-size: 24px; font-weight: 700;
  margin-top: 4px; color: var(--text);
}
.kpi.income .kpi-value { color: var(--success); }
.kpi.expense .kpi-value { color: var(--danger); }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ===== Chart grid ===== */
.chart-grid {
  display: grid; gap: 16px;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 16px;
}
@media (max-width: 1100px) {
  .chart-grid { grid-template-columns: 1fr; }
}
.chart-panel {
  background: white; border-radius: 4px;
  padding: 20px;
  border: 1px solid var(--border-soft);
  display: flex; flex-direction: column;
}
.chart-panel h3 {
  margin: 0 0 14px; color: var(--text);
  font-size: 14px; font-weight: 600;
}
.chart-canvas-wrap {
  position: relative;
  flex: 1; min-height: 240px;
}

/* ===== Tables ===== */
table {
  width: 100%; border-collapse: collapse;
  background: white; border-radius: 4px;
  border: 1px solid var(--border-soft);
  overflow: hidden;
}
th, td {
  padding: 10px 14px; text-align: left;
  border-bottom: 1px solid var(--border-soft); font-size: 13px;
}
th {
  background: #f9fafb; font-weight: 600;
  color: var(--muted); text-transform: uppercase;
  font-size: 11px; letter-spacing: 0.05em;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafafa; }
.amount-pos { color: var(--success); font-weight: 600; }
.amount-neg { color: var(--danger); font-weight: 600; }

.badge {
  display: inline-block; padding: 2px 9px;
  border-radius: 3px; font-size: 11px; font-weight: 600;
  letter-spacing: 0.02em;
}
.badge.paid, .badge.income { background: var(--success-bg); color: var(--success); }
.badge.unpaid, .badge.expense { background: var(--danger-bg); color: var(--danger); }
.badge.neutral { background: #eef2ff; color: var(--fbla-blue); }

/* ===== Modal ===== */
.modal-card {
  width: 960px;
  max-width: 95vw;
  max-height: 92vh;
  overflow-y: auto;
  padding: 32px;
  border-top: 4px solid var(--fbla-blue);
}
.modal-card h2 {
  margin: 0 0 16px; color: var(--text);
  font-size: 22px; font-weight: 700;
}
.form-row {
  display: grid; grid-template-columns: 180px 1fr;
  gap: 12px; align-items: center; margin-top: 14px;
}
.form-row label { color: var(--muted); font-weight: 500; font-size: 13px; }
.form-row input, .form-row select, .form-row textarea {
  padding: 8px 11px; border: 1px solid var(--border);
  border-radius: 4px; font: inherit; width: 100%;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none; border-color: var(--fbla-blue);
}
.modal-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
}
.text-btn {
  background: transparent; color: var(--muted); border: 0;
  cursor: pointer; padding: 7px 12px; font: inherit;
}
.text-btn:hover { color: var(--text); }

.empty {
  text-align: center; padding: 36px 20px;
  color: var(--muted); font-style: italic;
}
td.empty { background: white; }

.check-row, .po-item {
  display: grid; gap: 6px; margin-top: 6px;
}
.check-row { grid-template-columns: 110px 1fr 110px 30px; }
.po-item { grid-template-columns: 1fr 80px 100px 100px 30px; }
.check-row input, .po-item input {
  padding: 7px 9px; border: 1px solid var(--border); border-radius: 3px; font: inherit;
}
.check-row input:focus, .po-item input:focus {
  outline: none; border-color: var(--fbla-blue);
}
.po-item .i-line { background: #f9fafb; color: var(--muted); }

/* ===== Event card ===== */
.event-card {
  background: white; border-radius: 4px; padding: 18px;
  border: 1px solid var(--border-soft);
  border-left: 4px solid var(--fbla-blue);
  margin-bottom: 12px;
}
.event-card h3 { margin: 0 0 4px; color: var(--text); font-size: 16px; }
.event-header {
  display: flex; justify-content: space-between;
  align-items: flex-start; gap: 12px; flex-wrap: wrap;
}
.event-meta { color: var(--muted); font-size: 13px; margin: 4px 0; }
.progress-bar {
  height: 6px; background: #f1f5f9; border-radius: 3px;
  overflow: hidden; margin-top: 6px; max-width: 320px;
}
.progress-bar-fill {
  height: 100%; background: var(--fbla-blue);
}

/* ===== Settings ===== */
.settings-row {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.settings-row input {
  padding: 8px 11px; border: 1px solid var(--border);
  border-radius: 4px; width: 220px; font: inherit;
}
.settings-row input:focus {
  outline: none; border-color: var(--fbla-blue);
}
.backup-status-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.backup-status-grid > div { padding: 12px; border: 1px solid var(--border-soft); border-radius: 9px; background: #f8fafc; }
.backup-status-grid span, .backup-status-grid strong { display: block; }
.backup-status-grid span { margin-bottom: 4px; color: var(--muted); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.backup-status-grid strong { font-size: 13px; }
.backup-warning { padding: 10px 12px; border-radius: 8px; color: #92400e !important; background: #fff7dc; font-size: 12px; }
@media (max-width: 620px) { .backup-status-grid { grid-template-columns: 1fr; } }

/* ===== Sortable table ===== */
.sortable-table th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.sortable-table th.sortable:hover {
  background: #f1f5f9;
  color: var(--text);
}
.sort-ind {
  margin-left: 4px;
  opacity: 0.4;
  font-size: 10px;
}
.sort-ind.active {
  opacity: 1;
  color: var(--fbla-blue);
}
.rank-pill {
  display: inline-block;
  background: var(--fbla-blue);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
  margin-right: 4px;
  letter-spacing: 0.02em;
}

/* ===== Dues summary ===== */
.dues-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.dues-stat {
  background: #f9fafb;
  border-radius: 4px;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
}
.dues-stat-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.dues-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-top: 2px;
}
.dues-stat-value.paid { color: var(--success); }
.dues-stat-value.unpaid { color: var(--danger); }

/* ===== Event mini charts ===== */
.event-mini-charts {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.event-mini {
  width: 96px;
  text-align: center;
}
.event-mini-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  margin-bottom: 4px;
}
.event-mini-canvas-wrap {
  position: relative;
  width: 96px;
  height: 96px;
}

/* ===== Event modal charts ===== */
.event-modal-charts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 10px 0 16px;
  justify-items: center;
}
.event-modal-charts:has(> :nth-child(2)) {
  grid-template-columns: 1fr 1fr;
}
.event-modal-chart {
  background: #f9fafb;
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  padding: 12px 16px;
  width: 100%;
  max-width: 320px;
  text-align: center;
}
.event-modal-chart-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
}
.event-modal-chart .chart-canvas-wrap {
  position: relative;
  width: 100%;
  max-width: 220px;
  margin: 0 auto;
  min-height: 0 !important;
}

/* ===================================================================
   Login (role-aware)
   =================================================================== */
.login-card { width: 440px; padding: 28px 30px; max-width: 92vw; }
/* The registration form has more fields, so give it more room on desktop. */
@media (min-width: 640px) { .login-card-wide { width: 600px; } }
.login-header { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.login-logo { width: 56px; height: 56px; object-fit: contain; background: white; border-radius: 6px; padding: 4px; border: 1px solid var(--border-soft); }
.login-card h1 { margin: 0; font-size: 20px; }
.login-sub { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.role-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 8px 0 18px; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.role-tab {
  padding: 10px 8px; background: white; border: 0; cursor: pointer;
  font: inherit; font-weight: 600; color: var(--muted);
  border-right: 1px solid var(--border);
}
.role-tab:last-child { border-right: 0; }
.role-tab.active { background: var(--fbla-blue); color: white; }
.login-form label {
  display: block; margin-top: 12px; margin-bottom: 4px;
  font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
}
.login-form input {
  width: 100%; padding: 10px 12px; margin: 0;
  border: 1px solid var(--border); border-radius: 4px; font: inherit;
}
.login-form input:focus { outline: none; border-color: var(--fbla-blue); }
.login-form button {
  width: 100%; padding: 11px; margin-top: 16px;
  background: var(--fbla-blue); color: white; border: 0; border-radius: 4px;
  font: inherit; font-weight: 700; cursor: pointer; font-size: 14px;
}
.login-form button:hover { background: var(--fbla-blue-dark); }
.login-form select {
  width: 100%; padding: 10px 12px; margin: 0;
  border: 1px solid var(--border); border-radius: 4px; font: inherit; background: white;
}
.login-form select:focus { outline: none; border-color: var(--fbla-blue); }
.login-error { margin-top: 14px; padding: 10px 12px; background: var(--danger-bg); color: var(--danger); border-radius: 4px; font-size: 13px; }

/* Member self-registration form */
#register-form { max-height: 76vh; overflow-y: auto; }
.register-title { margin: 4px 0 0; font-size: 17px; }
.req { color: var(--danger); font-weight: 700; }
.register-optional {
  margin-top: 18px; padding: 12px 14px 4px;
  border: 1px dashed var(--border); border-radius: 6px; background: var(--panel-soft, #fafbfd);
}
.register-optional-head { font-size: 13px; font-weight: 700; color: var(--fbla-blue); }
.register-optional-head span { display: block; font-weight: 500; font-size: 11.5px; color: var(--muted); text-transform: none; letter-spacing: 0; margin-top: 2px; }

/* ===================================================================
   Member portal (reuses .app + .sidebar from officer view)
   =================================================================== */
.m-loading { color: var(--muted); padding: 24px; }

/* Hero */
.m-hero {
  background: linear-gradient(135deg, var(--fbla-blue) 0%, var(--fbla-blue-dark) 100%);
  color: white;
  border-radius: 8px;
  padding: 28px 32px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  border-left: 6px solid var(--fbla-gold);
}
.m-hero-eyebrow {
  text-transform: uppercase; letter-spacing: 0.1em;
  font-size: 11px; color: var(--fbla-gold); font-weight: 700;
  margin-bottom: 4px;
}
.m-hero-title { margin: 0 0 6px; font-size: 28px; font-weight: 700; }
.m-hero-sub { margin: 0; color: rgba(255,255,255,0.85); max-width: 540px; font-size: 14px; }
.m-hero-stats { display: flex; gap: 14px; }
.m-stat {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  padding: 14px 18px;
  min-width: 88px;
  text-align: center;
}
.m-stat-num { font-size: 24px; font-weight: 700; line-height: 1; }
.m-stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255,255,255,0.75); margin-top: 4px; }

/* Grid + cards */
.m-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.m-card {
  background: white;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 20px 22px;
  margin-bottom: 16px;
}
.m-card-wide { grid-column: 1 / -1; }
.m-card-title {
  margin: 0 0 12px;
  font-size: 14px; font-weight: 700;
  color: var(--fbla-blue);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.m-card-note { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.m-card-row { display: flex; gap: 8px; flex-wrap: wrap; }
.m-event-name { font-size: 20px; font-weight: 700; color: var(--text); }
.m-event-empty { font-size: 16px; color: var(--muted); font-style: italic; }

/* Pills */
.m-pill {
  display: inline-block; padding: 4px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 600;
}
.m-pill-paid { background: var(--success-bg); color: var(--success); }
.m-pill-due { background: #fef3c7; color: #92400e; }

/* Leaderboard */
.m-lead-list { list-style: none; padding: 0; margin: 0; }
.m-lead {
  display: grid; grid-template-columns: 48px 1fr auto;
  align-items: center; gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 14px;
}
.m-lead:last-child { border-bottom: 0; }
.m-lead.you { background: rgba(253, 185, 19, 0.12); border-radius: 4px; font-weight: 600; }
.m-lead-rank { color: var(--fbla-gold-dark); font-weight: 700; font-size: 13px; }
.m-lead-name { color: var(--text); }
.m-lead-pts { color: var(--fbla-blue); font-weight: 700; }

/* Conferences */
.m-conf-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.m-conf {
  padding: 14px 16px;
  border-left: 4px solid var(--fbla-blue);
}
.m-conf-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.m-conf-name { font-weight: 700; }
.m-conf-date { font-size: 12px; color: var(--muted); }
.m-conf-pills { display: flex; flex-wrap: wrap; gap: 6px; }
/* Breathing room between the tags/details and the action button or note below. */
.m-conf > .btn, .m-conf > .m-card-note { margin-top: 12px; }

/* Tasks */
.m-task-list { list-style: none; padding: 0; margin: 0; }
.m-task {
  border-bottom: 1px solid var(--border-soft);
  padding: 10px 0;
}
.m-task:last-child { border-bottom: 0; }
.m-task-row { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.m-task-row input[type=checkbox] { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--fbla-blue); }
.m-task-body { display: flex; flex-direction: column; gap: 2px; }
.m-task-title { font-weight: 600; }
.m-task-desc { color: var(--muted); font-size: 13px; }
.m-task-meta { display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.m-tag {
  background: var(--border-soft); color: var(--muted);
  padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.m-tag-you { background: var(--fbla-blue); color: white; }
.m-tag-date { font-size: 11px; color: var(--muted); }
.m-task.done .m-task-title { text-decoration: line-through; color: var(--muted); }

.m-empty { color: var(--muted); font-style: italic; margin: 4px 0 0; }
/* Event countdown banners at the top of the member hub. */
.m-countdowns { display: grid; gap: 10px; margin-bottom: 18px; }
.m-countdown {
  position: relative; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 46px 12px 16px;
  border-radius: 14px; color: #fff;
  background: linear-gradient(120deg, #12336d, #1f5fbf);
  box-shadow: 0 6px 18px rgba(19,45,91,.18);
}
.m-countdown-copy { display: grid; gap: 2px; line-height: 1.2; min-width: 130px; }
.m-countdown-copy strong { font-size: 15px; }
.m-countdown-copy .m-cd-when { font-size: 12.5px; color: #cfe0ff; }
.m-countdown-clock { display: flex; gap: 10px; margin-left: auto; }
.m-cd-unit { display: grid; justify-items: center; gap: 3px; min-width: 46px; padding: 6px 6px; border-radius: 10px; background: rgba(255,255,255,.14); }
.m-cd-n { font-size: 22px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.m-cd-l { font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: #cfe0ff; }
.m-cd-now { font-size: 17px; font-weight: 800; }
.m-countdown-x {
  position: absolute; top: 10px; right: 12px;
  width: 28px; height: 28px; border: 0; border-radius: 8px;
  background: rgba(255,255,255,.14); color: #fff; font-size: 19px; line-height: 1; cursor: pointer;
}
.m-countdown-x:hover { background: rgba(255,255,255,.28); }
@media (max-width: 780px) {
  .m-countdown-clock { margin-left: 0; width: 100%; justify-content: space-between; gap: 6px; }
  .m-cd-unit { flex: 1; min-width: 0; }
}
.m-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.m-chip { display: inline-block; padding: 5px 12px; border-radius: 999px; background: var(--m-accent-soft, #eef3ff); color: var(--m-accent, #1d4ed8); font-size: 13px; font-weight: 600; }

/* Slideshows / resources */
.m-res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.m-res-card {
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px;
  background: #fbfbfd;
}
.m-res-title { font-weight: 700; color: var(--text); }
.m-res-desc { color: var(--muted); font-size: 13px; }
.m-res-link {
  color: var(--fbla-blue); font-weight: 600; font-size: 13px;
  text-decoration: none; align-self: flex-start;
  margin-top: 4px;
}
.m-res-link:hover { text-decoration: underline; }

@media (max-width: 760px) {
  .m-grid { grid-template-columns: 1fr; }
  .m-hero { flex-direction: column; align-items: flex-start; }
  .m-hero-stats { flex-wrap: wrap; }
}

/* Panel head used by officer Slideshows tab */
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.muted { color: var(--muted); }

/* Member calendar */
.m-calendar-wrap {
  background: white;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 8px;
  overflow: hidden;
}
.m-calendar-wrap iframe {
  display: block;
  width: 100%;
  height: 720px;
  border: 0;
}

/* ===== Tier badges (percentile point tiers) ===== */
.tier-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: middle;
}
.tier-gold { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.tier-silver { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.tier-bronze { background: #fde8d7; color: #9a3412; border: 1px solid #fdba74; }
.tier-other { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

.tier-standings { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.tier-group { border: 1px solid var(--border-soft); border-radius: 6px; padding: 12px 14px; background: #fafbfc; }
.tier-group-head { margin-bottom: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tier-group ul { margin: 0; padding-left: 18px; font-size: 13px; }
.muted { color: var(--muted); }

/* ===== Sidebar inbox badge & contact button ===== */
.nav-badge {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  margin-left: 6px;
}
.contact-btn { width: 100%; margin-bottom: 10px; }

/* ===== Attendee picker (checkbox roster) ===== */
.att-picker { border: 1px solid var(--border); border-radius: 6px; padding: 12px 14px; margin: 10px 0 14px; background: #fafbfc; }
.att-picker-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.att-picker-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 4px 12px;
  max-height: 220px;
  overflow-y: auto;
  padding: 6px 2px;
}
.att-check { display: flex; align-items: center; gap: 7px; font-size: 13px; padding: 3px 4px; border-radius: 4px; cursor: pointer; }
.att-check:hover { background: #eef2f7; }
.att-check input { width: auto; margin: 0; }
.att-check.locked { color: var(--muted); cursor: default; }

/* ===== Calendar ===== */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.cal-title { font-size: 16px; font-weight: 700; color: var(--fbla-blue); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { margin-bottom: 4px; font-size: 10.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; text-align: center; }
.cal-cell {
  min-height: 84px;
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  padding: 4px 5px;
  background: var(--surface);
  font-size: 11.5px;
  overflow: hidden;
}
.cal-blank { background: transparent; border-color: transparent; }
.cal-today { border-color: var(--fbla-blue); box-shadow: inset 0 0 0 1px var(--fbla-blue); }
.cal-daynum { font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 3px; }
.cal-today .cal-daynum { color: var(--fbla-blue); }
.cal-item {
  position: relative;
  display: block;
  border-radius: 3px;
  padding: 2px 16px 2px 6px;
  margin-bottom: 2px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-legend { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.cal-legend .cal-item { display: inline-block; padding: 2px 8px; margin: 0; }
.cal-meeting { background: #dbeafe; color: #1e40af; }
.cal-event { background: #dcfce7; color: #166534; }
.cal-deadline { background: #fee2e2; color: #991b1b; }
.cal-other { background: #f3e8ff; color: #6b21a8; }
.cal-time { font-weight: 400; opacity: 0.8; }
.cal-del {
  position: absolute; right: 2px; top: 1px;
  border: none; background: none; cursor: pointer;
  font-size: 12px; line-height: 1; color: inherit; opacity: 0.55; padding: 1px 3px;
}
.cal-del:hover { opacity: 1; }

/* ===== Officer inbox ===== */
.inbox-msg { border: 1px solid var(--border-soft); border-radius: 6px; padding: 12px 14px; margin-bottom: 10px; background: var(--surface); }
.inbox-msg.unread { border-left: 3px solid var(--fbla-blue); background: #f8fafc; }
.inbox-msg-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.inbox-msg-subject { font-weight: 700; margin-bottom: 4px; }
.inbox-msg-body { font-size: 13.5px; white-space: pre-wrap; }

/* ===== Announcements ===== */
.badge.gold-badge { background: #fef3c7; color: #92400e; }
.m-pinned { border-left: 4px solid var(--fbla-gold); }
.m-ann { padding: 6px 0; }
.m-ann + .m-ann { border-top: 1px solid var(--border-soft); }
.m-ann-title { font-weight: 700; font-size: 15px; }
.m-ann-body { margin-top: 4px; font-size: 13.5px; white-space: pre-wrap; }
.m-ann-meta { margin-top: 6px; font-size: 11.5px; color: var(--muted); }

/* ===== Member points ===== */
.m-pill-pending { background: #fef3c7; color: #92400e; }
.m-sub-list { list-style: none; margin: 0; padding: 0; }
.m-sub { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 0; border-bottom: 1px solid var(--border-soft); }
.m-sub:last-child { border-bottom: none; }
.m-sub-activity { font-weight: 600; flex: 1; min-width: 160px; }
.m-sub-meta { color: var(--muted); font-size: 12.5px; }

/* ===== Member calendar list & resources ===== */
.m-cal-list { list-style: none; margin: 0; padding: 0; }
.m-cal-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--border-soft); }
.m-cal-list li:last-child { border-bottom: none; }
.m-cal-date { font-weight: 700; min-width: 130px; }
.m-cal-title { font-weight: 600; }
.m-cal-desc { color: var(--muted); font-size: 12.5px; width: 100%; padding-left: 140px; }
.m-res-event { font-size: 11px; font-weight: 700; color: var(--fbla-blue); text-transform: uppercase; letter-spacing: 0.04em; margin: 2px 0 4px; }

/* =====================================================================
   Member Hub redesign (Phase 1): navy sidebar, card dashboard, mobile nav
   ===================================================================== */
:root {
  --m-navy: #12336d;
  --m-blue: #1462d9;
  --m-blue-2: #e9f1ff;
  --m-ink: #17233a;
  --m-muted: #66738a;
  --m-line: #e3e9f2;
  --m-canvas: #f4f7fb;
  --m-card: #ffffff;
  --m-green: #167a52;
  --m-green-bg: #e8f7ef;
  --m-amber: #9b5c05;
  --m-amber-bg: #fff5df;
  --m-red: #ba3e4a;
  --m-purple: #6d4ac5;
  --m-radius: 16px;
  --m-shadow: 0 8px 30px rgba(19, 45, 91, 0.06);
}

body { font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }

.m-app { min-height: 100vh; display: grid; grid-template-columns: 254px minmax(0, 1fr); background: var(--m-canvas); color: var(--m-ink); }

/* --- Sidebar --- */
.m-sidebar {
  position: fixed; inset: 0 auto 0 0; width: 254px; z-index: 4;
  display: flex; flex-direction: column; padding: 24px 14px 16px;
  color: #eaf1ff; background: var(--m-navy);
  overflow-y: auto;
  scrollbar-width: none; -ms-overflow-style: none; /* hide the sidebar scrollbar */
}
.m-sidebar::-webkit-scrollbar { display: none; }
.m-brand { display: flex; gap: 11px; align-items: center; padding: 3px 10px 26px; }
.m-brand-logo { width: 38px; height: 38px; border-radius: 10px; background: #fff; object-fit: contain; padding: 3px; }
.m-brand-copy strong { display: block; letter-spacing: .05em; font-size: 14px; }
.m-brand-copy span { display: block; margin-top: 2px; font-size: 11px; color: #a9c5f5; }
.m-nav-label { margin: 14px 10px 7px; font-size: 10px; letter-spacing: .12em; color: #9ebce9; font-weight: 700; text-transform: uppercase; }
.m-nav { display: grid; gap: 3px; }
.m-nav-item {
  width: 100%; min-height: 42px; display: flex; align-items: center; gap: 12px;
  padding: 0 11px; border: 0; border-radius: 10px; color: #c9d9f4;
  background: transparent; text-align: left; font-weight: 550; font-size: 13.5px; cursor: pointer; font-family: inherit;
}
.m-nav-item:hover, .m-nav-item.active { color: #fff; background: rgba(255,255,255,.13); }
.m-nav-item svg { width: 18px; height: 18px; flex: 0 0 auto; stroke-width: 1.9; }
.m-sidebar-bottom { margin-top: auto; padding-top: 18px; }
.m-help-card { margin: 0 4px 16px; padding: 14px; border: 1px solid rgba(255,255,255,.14); border-radius: 13px; background: rgba(2, 21, 53, .23); }
.m-help-card strong { font-size: 13px; }
.m-help-card p { margin: 6px 0 10px; color: #b8cdeb; font-size: 12px; line-height: 1.45; }
.m-help-card a { color: #fff; font-size: 12px; text-decoration: none; font-weight: 700; }
.m-profile-mini { display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid rgba(255,255,255,.13); }
.m-avatar {
  display: grid; flex: 0 0 auto; width: 34px; height: 34px; place-items: center;
  border-radius: 50%; background: var(--fbla-gold); color: #4a3200; font-size: 12px; font-weight: 800;
}
/* Leadership Team grid (member portal). */
.m-officer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.m-officer-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--m-line); border-radius: 12px; background: #fff; }
.m-officer-avatar {
  display: grid; flex: 0 0 auto; width: 44px; height: 44px; place-items: center;
  border-radius: 50%; background: var(--fbla-gold); color: #4a3200; font-size: 15px; font-weight: 800;
}
.m-officer-info { min-width: 0; display: flex; flex-direction: column; }
.m-officer-info strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-officer-role { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.m-officer-email { display: block; margin-top: 3px; font-size: 12px; color: var(--fbla-blue); text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.m-officer-email:hover { text-decoration: underline; }

.m-profile-copy { min-width: 0; flex: 1; }
.m-profile-copy strong { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-profile-copy span { display: block; margin-top: 1px; color: #a9c5f5; font-size: 11px; }
.m-signout { border: 0; background: transparent; color: #a9c5f5; font-size: 11px; cursor: pointer; padding: 4px; font-family: inherit; }
.m-signout:hover { color: #fff; text-decoration: underline; }

/* --- Main column & topbar --- */
.m-main { grid-column: 2; min-width: 0; padding: 22px 32px 60px; position: relative; }
.m-topbar { min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.m-crumb { display: flex; align-items: center; gap: 7px; color: var(--m-muted); font-size: 13px; }
.m-crumb b { color: var(--m-ink); }
.m-crumb-home { color: var(--fbla-blue); font-weight: 700; text-decoration: none; }
.m-crumb-home:hover { text-decoration: underline; }
.m-top-actions { display: flex; align-items: center; gap: 10px; }
.m-search { position: relative; display: flex; align-items: center; width: min(285px, 26vw); }
.m-search svg { position: absolute; left: 12px; width: 17px; height: 17px; color: var(--m-muted); }
.m-search input { width: 100%; height: 38px; padding: 0 12px 0 38px; border: 1px solid var(--m-line); border-radius: 10px; outline: 0; color: var(--m-ink); background: #fff; font-family: inherit; font-size: 13px; }
.m-search input:focus { border-color: #7ca8f4; box-shadow: 0 0 0 3px rgba(20,98,217,.12); }
.m-search-results {
  position: absolute; top: 60px; right: 32px; z-index: 6; width: min(380px, 90%);
  border: 1px solid var(--m-line); border-radius: 12px; background: #fff; box-shadow: 0 18px 50px rgba(19,45,91,.14);
  overflow: hidden; padding: 6px;
}
.m-search-results button { display: flex; width: 100%; align-items: baseline; gap: 8px; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; text-align: left; cursor: pointer; font-family: inherit; }
.m-search-results button:hover { background: var(--m-blue-2); }
.m-search-kind { flex: 0 0 auto; font-size: 10px; font-weight: 800; color: var(--m-blue); text-transform: uppercase; letter-spacing: .04em; }
.m-search-title { font-size: 13px; font-weight: 600; color: var(--m-ink); }
.m-search-sub { margin-left: auto; font-size: 11px; color: var(--m-muted); }
.m-search-empty { padding: 12px; color: var(--m-muted); font-size: 13px; }

/* --- Page heading --- */
.m-page-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; margin-bottom: 20px; }
.m-page-heading h1 { margin: 0 0 5px; font-size: clamp(24px, 2.2vw, 32px); letter-spacing: -.03em; line-height: 1.1; }
.m-subhead { margin: 0; color: var(--m-muted); font-size: 13.5px; }
.m-date-chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid var(--m-line); border-radius: 9px; color: #526078; background: #fff; font-size: 12px; font-weight: 650; white-space: nowrap; }
.m-date-chip svg { width: 15px; height: 15px; }

/* --- Priority + points row --- */
.m-priority-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(250px, .85fr); gap: 16px; }
.m-priority-card {
  position: relative; overflow: hidden; min-height: 195px; padding: 24px 26px;
  color: #fff; background: linear-gradient(122deg, #113169 0%, #184eac 100%);
  border-radius: var(--m-radius); box-shadow: var(--m-shadow);
}
.m-eyebrow { display: flex; align-items: center; gap: 7px; margin-bottom: 13px; color: #cce0ff; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.m-live-dot { width: 7px; height: 7px; border-radius: 99px; background: #f5bd55; }
.m-priority-card h2 { max-width: 480px; margin: 0 0 8px; font-size: clamp(19px, 2vw, 25px); letter-spacing: -.02em; }
.m-priority-card p { max-width: 520px; margin: 0 0 17px; color: #d6e5ff; font-size: 13.5px; line-height: 1.45; }
.m-priority-meta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 18px; color: #e2edff; font-size: 12px; }
.m-btn-light { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 15px; border: 0; border-radius: 10px; background: #fff; color: #164486; font-size: 13px; font-weight: 750; cursor: pointer; font-family: inherit; }
.m-btn-light:hover { background: #e8f0ff; }
.m-points-summary { display: flex; flex-direction: column; padding: 20px; border: 1px solid var(--m-line); border-radius: var(--m-radius); background: var(--m-card); box-shadow: var(--m-shadow); }
.m-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.m-card-top h2 { margin: 0; font-size: 15px; }
.m-kicker { margin: 0 0 6px; color: var(--m-muted); font-size: 12px; font-weight: 700; }
.m-more-link { border: 0; padding: 2px 0; color: var(--m-blue); background: transparent; font-size: 12px; font-weight: 750; cursor: pointer; font-family: inherit; white-space: nowrap; }
.m-point-value { margin: 16px 0 4px; font-size: 37px; line-height: 1; letter-spacing: -.05em; font-weight: 800; }
.m-point-caption { color: var(--m-muted); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.m-progress { height: 7px; margin: 16px 0 7px; overflow: hidden; border-radius: 999px; background: #e8edf6; }
.m-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #1769df, #4b94ff); }
.m-progress-row { display: flex; justify-content: space-between; gap: 8px; color: var(--m-muted); font-size: 11px; }
.m-tier-note { margin-top: auto; padding-top: 14px; color: var(--m-amber); font-size: 12px; font-weight: 700; }

/* --- Metric cards --- */
.m-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-top: 16px; }
.m-metric {
  min-height: 116px; padding: 16px; border: 1px solid var(--m-line); border-radius: 14px;
  background: var(--m-card); box-shadow: var(--m-shadow); text-align: left; cursor: pointer; font-family: inherit;
  transition: transform .16s, box-shadow .16s;
}
.m-metric:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(19,45,91,.1); }
.m-metric-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.m-metric-icon { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 9px; }
.m-metric-icon svg { width: 17px; height: 17px; }
.m-metric-icon.blue { color: var(--m-blue); background: var(--m-blue-2); }
.m-metric-icon.green { color: var(--m-green); background: var(--m-green-bg); }
.m-metric-icon.amber { color: var(--m-amber); background: var(--m-amber-bg); }
.m-metric-icon.purple { color: var(--m-purple); background: #f0ebff; }
.m-mini-tag { padding: 4px 7px; border-radius: 5px; font-size: 10px; font-weight: 800; }
.m-mini-tag.good { color: var(--m-green); background: var(--m-green-bg); }
.m-mini-tag.notice { color: var(--m-amber); background: var(--m-amber-bg); }
.m-metric h3 { margin: 0 0 4px; font-size: 13.5px; }
.m-metric p { margin: 0; color: var(--m-muted); font-size: 11px; line-height: 1.4; }
.m-metric b { color: var(--m-ink); font-size: 12.5px; }

/* --- Section cards --- */
.m-content-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .9fr); gap: 16px; margin-top: 16px; }
.m-section-card { padding: 20px; border: 1px solid var(--m-line); border-radius: var(--m-radius); background: var(--m-card); box-shadow: var(--m-shadow); margin-top: 16px; }
.m-content-grid .m-section-card { margin-top: 0; }
.m-section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.m-section-head h2 { margin: 0 0 2px; font-size: 16px; }

/* --- Event rows --- */
.m-event-list { display: grid; }
.m-event-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--m-line); }
.m-event-row:first-child { border-top: 0; padding-top: 0; }
.m-event-date { display: grid; height: 42px; place-items: center; border-radius: 9px; background: #f0f5ff; color: var(--m-blue); text-align: center; }
.m-event-date b { display: block; margin-top: 5px; font-size: 13px; line-height: 1; }
.m-event-date span { display: block; margin-top: -4px; font-size: 9px; font-weight: 800; letter-spacing: .07em; }
.m-event-info { min-width: 0; }
.m-event-info strong { display: block; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.m-event-info span { display: block; color: var(--m-muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-event-type { padding: 5px 8px; border-radius: 6px; font-size: 10px; font-weight: 800; white-space: nowrap; }

/* --- Announcement previews (home) --- */
.m-ann-preview { padding: 12px 0; border-top: 1px solid var(--m-line); }
.m-ann-preview:first-of-type { border-top: 0; padding-top: 0; }
.m-ann-preview-top { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.m-ann-preview-top time { margin-left: auto; color: #909aab; font-size: 10px; }
.m-pin-mark { font-size: 11px; }
.m-ann-preview strong { display: block; margin-bottom: 3px; font-size: 12.5px; line-height: 1.32; }
.m-ann-preview p { margin: 0; display: -webkit-box; overflow: hidden; color: var(--m-muted); font-size: 11px; line-height: 1.45; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* --- Point ledger rows (home) --- */
.m-ledger { display: grid; }
.m-ledger-row { display: grid; grid-template-columns: 31px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--m-line); }
.m-ledger-row:first-child { border-top: 0; padding-top: 0; }
.m-ledger-bullet { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 8px; color: var(--m-green); background: var(--m-green-bg); font-size: 13px; font-weight: 800; }
.m-ledger-bullet.pending { color: var(--m-amber); background: var(--m-amber-bg); }
.m-ledger-bullet.declined { color: var(--m-red); background: #fff0f1; }
.m-ledger-main { min-width: 0; }
.m-ledger-main strong { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-ledger-main span { color: var(--m-muted); font-size: 10px; }
.m-ledger-points { color: var(--m-green); font-size: 12px; font-weight: 800; }
.m-ledger-points.pending { color: var(--m-amber); }
.m-ledger-points.declined { color: var(--m-red); text-decoration: line-through; }

/* --- Resource rows (home) --- */
.m-resource-list { display: grid; gap: 10px; }
.m-resource-row { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--m-line); border-radius: 11px; background: #fff; text-decoration: none; color: inherit; }
.m-resource-row:hover { border-color: #adc7f4; background: #fafcff; }
.m-resource-icon { display: grid; flex: 0 0 auto; width: 31px; height: 31px; place-items: center; border-radius: 8px; color: var(--m-purple); background: #f0ebff; }
.m-resource-icon svg { width: 16px; height: 16px; }
.m-resource-copy { min-width: 0; }
.m-resource-copy strong { display: block; margin-bottom: 2px; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-resource-copy span { color: var(--m-muted); font-size: 10px; }
.m-res-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.m-res-meta { color: var(--m-muted); font-size: 10.5px; }

/* --- Restyle legacy member components to new tokens --- */
.m-app .m-card, .m-app .m-conf { border: 1px solid var(--m-line); border-radius: var(--m-radius); background: var(--m-card); box-shadow: var(--m-shadow); }
.m-app .m-tab > h2 { margin-top: 0; }
.m-app .m-empty { color: var(--m-muted); font-size: 13px; margin: 0; }
.m-app .m-card-note { color: var(--m-muted); font-size: 13px; }
.m-app .cal-cell { min-height: 72px; }

/* --- Mobile nav, More menu, toast --- */
.m-mobile-nav { display: none; }
.m-more-menu {
  position: fixed; z-index: 7; right: 12px; bottom: 76px;
  display: grid; gap: 2px; min-width: 210px; padding: 8px;
  border: 1px solid var(--m-line); border-radius: 14px; background: #fff; box-shadow: 0 18px 50px rgba(19,45,91,.2);
}
.m-more-menu button { padding: 11px 12px; border: 0; border-radius: 9px; background: transparent; text-align: left; font-size: 13.5px; font-weight: 600; color: var(--m-ink); cursor: pointer; font-family: inherit; }
.m-more-menu button:hover { background: var(--m-blue-2); }
.m-toast {
  position: fixed; z-index: 30; right: 24px; bottom: 24px; max-width: 330px;
  padding: 13px 16px; border: 1px solid #bce6ce; border-radius: 12px;
  color: #145b3e; background: #f1fff7; box-shadow: 0 12px 35px rgba(19,45,91,.16);
  transform: translateY(140%); opacity: 0; transition: .3s ease; font-size: 13px; font-weight: 650;
}
.m-toast.show { transform: translateY(0); opacity: 1; }

@media (max-width: 1120px) {
  .m-metrics { grid-template-columns: repeat(2, 1fr); }
  .m-content-grid { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .m-app { display: block; }
  .m-sidebar { display: none; }
  .m-main { grid-column: auto; padding: 16px 14px 96px; }
  .m-topbar { margin-bottom: 18px; }
  /* On phones, drop the breadcrumb + top avatar and let search fill the bar. */
  .m-crumb { display: none; }
  #m-avatar-top { display: none; }
  .m-top-actions { flex: 1; }
  .m-search { display: flex; width: auto; flex: 1; }
  .m-search-results { left: 14px; right: 14px; width: auto; }
  .m-page-heading { align-items: flex-start; margin-bottom: 16px; }
  .m-page-heading .m-date-chip { display: none; }
  .m-priority-grid { grid-template-columns: 1fr; gap: 13px; }
  .m-priority-card { min-height: 0; padding: 20px; }
  .m-metrics { gap: 10px; margin-top: 13px; }
  .m-metric { min-height: 106px; padding: 13px; }
  .m-content-grid { gap: 13px; margin-top: 13px; }
  .m-section-card { padding: 16px; margin-top: 13px; }
  .m-mobile-nav {
    position: fixed; z-index: 6; left: 0; right: 0; bottom: 0;
    display: grid; grid-template-columns: repeat(5, 1fr);
    padding: 8px 7px max(8px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--m-line); background: rgba(255,255,255,.96); backdrop-filter: blur(16px);
  }
  .m-mobile-nav button { display: grid; justify-items: center; gap: 4px; min-height: 46px; padding: 4px 0; border: 0; color: #778298; background: transparent; font-size: 9px; font-weight: 700; cursor: pointer; font-family: inherit; }
  .m-mobile-nav button svg { width: 19px; height: 19px; }
  .m-mobile-nav button.active { color: var(--m-blue); }
  .m-mobile-nav button { position: relative; }
  .m-toast { right: 16px; bottom: 86px; left: 16px; max-width: none; }
}

/* ===== Phase 2: notifications, rubric, ledger ===== */
.m-icon-btn {
  position: relative; display: grid; width: 38px; height: 38px; place-items: center;
  border: 1px solid var(--m-line); border-radius: 10px; color: var(--m-ink); background: #fff; cursor: pointer;
}
.m-icon-btn:hover { background: #f9fbff; border-color: #b8c8e2; }
.m-icon-btn svg { width: 18px; height: 18px; }
.m-alert-dot { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border: 2px solid #fff; border-radius: 50%; background: #d55658; }
.m-nav-dot { width: 7px; height: 7px; margin-left: auto; border-radius: 999px; background: #80adff; }
/* Count badge on member nav tabs: a number inside a red pill. */
.m-nav-badge {
  margin-left: auto; min-width: 19px; height: 19px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: #e02424; color: #fff;
  font-size: 11px; font-weight: 800; line-height: 1; letter-spacing: 0;
}
/* Small count badge for the mobile bottom bar, pinned to the button corner. */
.m-mnav-badge {
  position: absolute; top: 1px; left: 50%; margin-left: 3px;
  min-width: 15px; height: 15px; padding: 0 4px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: #e02424; color: #fff;
  font-size: 9px; font-weight: 800; line-height: 1;
}
.m-more-menu button { display: flex; align-items: center; gap: 8px; }

/* Notifications popup (opened from the top-right bell). */
.m-notif-pop-actions { display: flex; justify-content: flex-end; margin-bottom: 6px; }
.m-notif-pop { max-height: 60vh; overflow-y: auto; margin: 0 -6px; }
.m-notif {
  display: flex; width: 100%; align-items: flex-start; gap: 11px;
  padding: 12px 10px; border: 0; border-top: 1px solid var(--m-line);
  background: transparent; text-align: left; cursor: pointer; font-family: inherit;
}
.m-notif:first-of-type { border-top: 0; }
.m-notif:hover { background: #fafcff; }
.m-notif.unread { background: #f6faff; }
.m-notif.unread:hover { background: #eef5ff; }
.m-notif-icon {
  display: grid; flex: 0 0 auto; width: 30px; height: 30px; place-items: center;
  border-radius: 9px; font-size: 14px; font-weight: 800;
}
.m-notif-icon.good { color: var(--m-green); background: var(--m-green-bg); }
.m-notif-icon.bad { color: var(--m-red); background: #fff0f1; }
.m-notif-icon.notice { color: var(--m-amber); background: var(--m-amber-bg); }
.m-notif-icon.info { color: var(--m-blue); background: var(--m-blue-2); }
.m-notif-copy { min-width: 0; flex: 1; }
.m-notif-copy strong { display: block; font-size: 13px; color: var(--m-ink); }
.m-notif-body { display: block; margin-top: 2px; color: var(--m-muted); font-size: 12px; line-height: 1.4; }
.m-notif-time { display: block; margin-top: 4px; color: #909aab; font-size: 10.5px; }
.m-notif-dot { flex: 0 0 auto; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--m-blue); }

.m-cat-bars { display: grid; gap: 9px; }
.m-cat-bar { display: grid; grid-template-columns: 130px minmax(0, 1fr) 44px; align-items: center; gap: 10px; }
.m-cat-name { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-cat-track { height: 9px; overflow: hidden; border-radius: 999px; background: #e8edf6; }
.m-cat-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #1769df, #4b94ff); }
.m-cat-val { font-size: 12px; font-weight: 800; color: var(--m-ink); text-align: right; }

.m-ledger-bullet.neg { color: var(--m-red); background: #fff0f1; }
.m-ledger-points.neg { color: var(--m-red); }

/* ===== Phase 3: attendance QR, profile, check-in ===== */
.m-metrics { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.qr-wrap { display: grid; justify-items: center; gap: 8px; padding: 6px 0; }
.qr-wrap canvas { border: 1px solid var(--border-soft); border-radius: 12px; padding: 8px; background: #fff; }
.qr-caption { margin: 4px 0 0; font-weight: 700; font-size: 14px; text-align: center; }
.qr-link { margin: 0; font-size: 11.5px; word-break: break-all; text-align: center; }

.m-checkin-result { padding: 14px; border-radius: 10px; text-align: center; font-size: 14px; }
.m-checkin-result.ok { background: var(--m-green-bg, #e8f7ef); color: var(--m-green, #167a52); }
.m-checkin-result.bad { background: #fff0f1; color: #ba3e4a; }
.m-checkin-result p { margin: 4px 0; }

.m-profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.m-profile-grid > div { display: grid; gap: 2px; }
.m-profile-label { font-size: 10.5px; font-weight: 800; color: var(--m-muted); text-transform: uppercase; letter-spacing: .05em; }
.m-profile-val { font-size: 13.5px; font-weight: 600; }

/* QR SVG sizing (qrcode-generator renders an inline SVG) */
#qr-holder svg { width: min(300px, 70vw); height: auto; border: 1px solid var(--border-soft); border-radius: 12px; background: #fff; }
.qr-link { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* ===== Member directory + sub-tabs + overdue (officer) ===== */
.subtabs { display: flex; gap: 6px; margin: 4px 0 18px; border-bottom: 1px solid var(--border); }
.subtab { border: 0; background: transparent; padding: 9px 14px; font: inherit; font-weight: 600; font-size: 13.5px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subtab:hover { color: var(--text); }
.subtab.active { color: var(--fbla-blue); border-bottom-color: var(--fbla-blue); }

.dir-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 16px; align-items: start; }
.dir-list { position: sticky; top: 16px; }
.dir-list input { width: 100%; margin-bottom: 10px; }
.dir-names { display: grid; gap: 3px; max-height: 70vh; overflow-y: auto; }
.dir-name { display: grid; gap: 2px; width: 100%; text-align: left; border: 0; background: transparent; padding: 9px 10px; border-radius: 8px; cursor: pointer; font: inherit; }
.dir-name:hover { background: #f1f5f9; }
.dir-name.active { background: var(--fbla-blue); color: #fff; }
.dir-name strong { font-size: 13.5px; }
.dir-name span { font-size: 11.5px; color: var(--muted); }
.dir-name.active span, .dir-name.active em { color: #dbe6ff; }
.dir-ok { color: var(--success); font-style: normal; font-weight: 700; }
.dir-due { color: var(--danger); font-style: normal; font-weight: 700; }
.dir-name.active .dir-ok, .dir-name.active .dir-due { color: #fff; }

.dir-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 14px; }
.dir-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.dir-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.dir-stat { display: grid; gap: 2px; padding: 11px 13px; border: 1px solid var(--border-soft); border-radius: 10px; background: #fafbfc; }
.dir-stat-label { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.dir-stat-val { font-size: 19px; font-weight: 800; }
.dir-stat-val.dir-ok { color: var(--success); }
.dir-stat-val.dir-due { color: var(--danger); }
.dir-stat-sub { font-size: 11px; color: var(--muted); }
.dir-tasks { list-style: none; margin: 0; padding: 0; }
.dir-tasks li { padding: 5px 0; font-size: 13px; border-bottom: 1px solid var(--border-soft); }
.dir-tasks li.done { color: var(--muted); text-decoration: line-through; }

/* Profile & Onboarding record in the directory detail */
.dir-info-group { margin-top: 14px; }
.dir-info-group:first-of-type { margin-top: 4px; }
.dir-info-head { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 8px; }
.dir-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 18px; }
.dir-info-item { display: flex; flex-direction: column; gap: 1px; padding: 7px 11px; border: 1px solid var(--border-soft); border-radius: 9px; background: #fafbfc; }
.dir-info-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.dir-info-val { font-size: 13.5px; font-weight: 600; word-break: break-word; }
.dir-info-val.muted { font-weight: 400; color: var(--muted); }
.dir-info-val.dir-info-missing { color: var(--danger); font-weight: 700; }
.dir-info-item:has(.dir-info-missing) { border-color: var(--danger); background: var(--danger-bg); }
.form-section-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 16px 0 6px; padding-top: 12px; border-top: 1px solid var(--border-soft); }

/* Overdue / due-soon badges (both portals) */
.badge.overdue { background: var(--danger-bg); color: var(--danger); }
.badge.due-soon { background: #fef3c7; color: #92400e; }
.overdue-text { color: var(--danger); font-weight: 700; }
.m-pill-overdue { background: #fde2e4; color: #a4283a; font-weight: 700; }

@media (max-width: 820px) {
  .dir-layout { grid-template-columns: 1fr; }
  .dir-list { position: static; }
  .dir-names { max-height: 240px; }
}

/* ===== Forms tab (member) + attendee gating ===== */
.m-forms-h { font-size: 15px; font-weight: 700; margin: 20px 0 4px; color: var(--m-ink, #17233a); }
.m-forms-h:first-of-type { margin-top: 6px; }
.att-check.gated { opacity: 0.6; }
.att-check.gated span { color: var(--muted); }
.fb-field-row .ff-label:focus, .fb-field-row .ff-options:focus { outline: 2px solid var(--fbla-blue); outline-offset: -1px; }

/* ===== Gaps 9/13/14: RSVP, attention queue ===== */
.attention-panel .attn-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.attn-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 1px solid var(--border-soft); border-radius: 8px; padding: 10px 12px; background: #fff; cursor: pointer; font: inherit; }
.attn-item:hover { background: #fafbff; border-color: #adc7f4; }
.attn-count { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: var(--danger-bg); color: var(--danger); font-weight: 800; font-size: 12px; }
.m-conf-actions { display: flex; gap: 12px; align-items: center; margin-top: 8px; }
.m-conf-link { font-size: 12px; font-weight: 600; color: var(--m-blue, #1462d9); text-decoration: none; }
.m-conf-link:hover { text-decoration: underline; }
.m-conf-cancel { border: 0; background: transparent; color: var(--danger); font-size: 12px; font-weight: 600; cursor: pointer; padding: 0; }
.m-conf-cancel:hover { text-decoration: underline; }

/* ===================================================================
   Officer portal visual polish (scoped to #app only, so the member
   portal, login, and modals are untouched). Pure refinement: softer
   cards, subtle depth, cleaner hierarchy. Same FBLA palette.
   =================================================================== */
#app {
  --oc-radius: 10px;
  --oc-radius-sm: 7px;
  --oc-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 6px rgba(16, 24, 40, .06);
  --oc-shadow-hover: 0 4px 12px rgba(16, 24, 40, .10);
}

/* Sidebar: a touch of depth and calmer spacing. */
#app .sidebar {
  background: linear-gradient(180deg, var(--fbla-blue) 0%, var(--fbla-blue-dark) 100%);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, .04);
  padding: 18px 14px;
}
#app nav { gap: 2px; }
#app .nav-btn { border-radius: var(--oc-radius-sm); transition: background .12s ease, color .12s ease; }
#app .nav-btn.active { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }

/* Content headings: clearer hierarchy with a subtle gold accent. */
#app .main { padding: 30px 34px; }
#app .tab h2 {
  position: relative;
  padding-bottom: 12px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border-soft);
}
#app .tab h2::after {
  content: ""; position: absolute; left: 0; bottom: -1px;
  width: 44px; height: 3px; border-radius: 3px; background: var(--fbla-gold);
}

/* Panels & card-like surfaces: rounder corners, soft shadow. */
#app .panel,
#app .chart-panel,
#app .event-card {
  border-radius: var(--oc-radius);
  border-color: var(--border-soft);
  box-shadow: var(--oc-shadow);
}
#app .panel { padding: 22px 24px; }
#app .panel h3 { font-size: 15.5px; letter-spacing: -.01em; }

/* KPI cards: soft shadow + a gentle hover lift. */
#app .kpi {
  border-radius: var(--oc-radius);
  box-shadow: var(--oc-shadow);
  transition: transform .14s ease, box-shadow .14s ease;
}
#app .kpi:hover { transform: translateY(-2px); box-shadow: var(--oc-shadow-hover); }
#app .kpi-value { letter-spacing: -.02em; }

/* Tables: rounded container, quieter grid, clearer header + hover. */
#app table {
  border-radius: var(--oc-radius);
  box-shadow: var(--oc-shadow);
  border-color: var(--border-soft);
}
#app th { background: #f7f8fa; color: #64748b; }
#app th, #app td { padding: 11px 16px; }
#app tbody tr { transition: background .1s ease; }
#app tbody tr:hover td { background: #f6f9ff; }

/* Buttons: slightly rounder, subtle depth, smooth states. */
#app .btn {
  border-radius: var(--oc-radius-sm);
  transition: background .12s ease, box-shadow .12s ease, transform .04s ease;
}
#app .btn:not(.secondary):not([disabled]) { box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }
#app .btn:not([disabled]):active { transform: translateY(1px); }
#app .btn.small { border-radius: 6px; }
#app .toolbar input, #app .toolbar select { border-radius: var(--oc-radius-sm); }

/* Badges: soft pill shape reads a bit more polished. */
#app .badge { border-radius: 999px; padding: 3px 10px; }

/* ===================================================================
   Collapsible sidebars (officer + member, desktop) and officer mobile
   layout. Toggle button lives in each portal's brand row.
   =================================================================== */
.nav-toggle {
  margin-left: auto; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0;
  border: 0; border-radius: 7px; cursor: pointer;
  background: rgba(255, 255, 255, .14); color: #fff;
  font-size: 15px; line-height: 1; font-family: inherit;
  transition: background .12s ease;
}
.nav-toggle:hover { background: rgba(255, 255, 255, .26); }

/* Smooth width animation for both layouts. */
.app { transition: grid-template-columns .26s ease; }
.app .sidebar { overflow: hidden; }
.app .sidebar nav { overflow-y: auto; }
.m-app { transition: grid-template-columns .26s ease; }
.m-app .m-sidebar { transition: width .26s ease; }

/* --- Desktop collapse (both portals) --- */
@media (min-width: 781px) {
  .app.nav-collapsed { grid-template-columns: 62px 1fr; }
  .app.nav-collapsed .brand-logo,
  .app.nav-collapsed .brand-text,
  .app.nav-collapsed nav,
  .app.nav-collapsed .user-box { display: none; }
  .app.nav-collapsed .brand { justify-content: center; margin-bottom: 0; border-bottom: 0; padding-bottom: 4px; }

  .m-app.nav-collapsed { grid-template-columns: 62px minmax(0, 1fr); }
  .m-app.nav-collapsed .m-sidebar { width: 62px; }
  .m-app.nav-collapsed .m-brand-logo,
  .m-app.nav-collapsed .m-brand-copy,
  .m-app.nav-collapsed .m-nav-label,
  .m-app.nav-collapsed .m-sidebar-bottom { display: none; }
  .m-app.nav-collapsed .m-brand { justify-content: center; padding-bottom: 0; }
  /* Collapsed member rail keeps each tab as an icon-only button, all evenly
     spaced. Flattening the nav groups (display:contents) lets one gap on the
     sidebar apply uniformly across every icon, ignoring group boundaries. */
  .m-app.nav-collapsed .m-sidebar { gap: 6px; padding: 20px 8px 16px; }
  .m-app.nav-collapsed .m-nav { display: contents; }
  .m-app.nav-collapsed .m-nav-item { justify-content: center; gap: 0; margin: 0; padding: 0; font-size: 0; }
  .m-app.nav-collapsed .m-nav-item svg { width: 20px; height: 20px; }
  .m-app.nav-collapsed .m-nav-badge { display: none; }
}

/* --- Officer portal on mobile: nav moves to the top --- */
@media (max-width: 780px) {
  .app { display: block; height: auto; min-height: 100vh; }
  .app .sidebar {
    flex-direction: column; height: auto; width: auto;
    padding: 12px 14px;
    position: sticky; top: 0; z-index: 30;
  }
  .app .brand { margin-bottom: 0; padding-bottom: 12px; }
  .app .sidebar nav { max-height: 60vh; }
  /* Keep content inside the viewport; wide bits scroll inside their own box. */
  .app .main { height: auto; overflow-x: hidden; padding: 20px 14px 40px; min-width: 0; }
  /* Collapsed on mobile = just the top bar (brand + toggle); tap to reveal tabs. */
  .app.nav-collapsed nav,
  .app.nav-collapsed .user-box { display: none; }
  .app.nav-collapsed .brand { padding-bottom: 0; border-bottom: 0; }

  /* Wide tables scroll horizontally within their panel instead of pushing the
     whole page off-screen. (display:block lets the table overflow-scroll.) */
  #app table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  #app .panel, #app .chart-panel, #app .event-card { overflow-x: auto; }
  /* Toolbars stack and fill the width instead of overflowing. */
  #app .toolbar { gap: 8px; }
  #app .toolbar input, #app .toolbar select { min-width: 0; width: 100%; flex: 1 1 100%; }
  #app .kpi-grid { grid-template-columns: 1fr 1fr; }
  /* Charts can render taller-than-wide on a phone; cap so they don't overflow. */
  #app .chart-canvas-wrap { min-height: 200px; }
}

/* ===================================================================
   Officer "preview member view" control + banner
   =================================================================== */
.preview-member-btn {
  width: 100%; margin-top: 10px; padding: 8px;
  background: rgba(255, 255, 255, .12); color: #fff;
  border: 1px solid rgba(255, 255, 255, .22); border-radius: 7px;
  font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: background .12s ease;
}
.preview-member-btn:hover { background: rgba(255, 255, 255, .22); }

.m-preview-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 16px; padding: 10px 14px;
  background: #fff7dc; border: 1px solid #e5b84c; border-radius: 10px;
  color: #5f3d00; font-size: 13px; font-weight: 600;
}
.m-preview-eye { font-size: 15px; }
.m-preview-banner select {
  padding: 5px 9px; border: 1px solid #d9b25a; border-radius: 6px;
  background: #fff; font: inherit; font-weight: 600; color: #5f3d00; max-width: 220px;
}
.m-preview-spacer { flex: 1; }
.m-preview-banner button {
  padding: 6px 13px; border: 0; border-radius: 6px; cursor: pointer;
  background: var(--fbla-blue); color: #fff; font: inherit; font-weight: 700; font-size: 12.5px;
}
.m-preview-banner button:hover { background: var(--fbla-blue-dark); }

/* On phones, stack the label/input form rows in the member portal so inputs
   (e.g. the date field) can't overflow their card. */
@media (max-width: 780px) {
  .m-app .form-row { grid-template-columns: 1fr; gap: 4px; align-items: stretch; }
  .m-app .form-row input,
  .m-app .form-row select,
  .m-app .form-row textarea { width: 100%; min-width: 0; max-width: 100%; }
}

/* ===================================================================
   Buddy system + Forum (both portals)
   =================================================================== */
.role-badge {
  display: inline-block; padding: 1px 7px; border-radius: 999px;
  background: var(--fbla-gold); color: #4a3200; font-size: 10.5px; font-weight: 800;
  letter-spacing: .02em; vertical-align: middle;
}
/* Chat */
.buddy-chat { max-height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 2px; }
.buddy-msg { max-width: 78%; align-self: flex-start; background: #f1f4f9; border-radius: 12px; padding: 7px 11px; }
.buddy-msg.me { align-self: flex-end; background: #e4efff; }
.buddy-msg-head { font-size: 11.5px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.buddy-msg-body { font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }
.buddy-chat-input { display: flex; gap: 8px; margin-top: 10px; }
.buddy-chat-input input { flex: 1; min-width: 0; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; font: inherit; }
.buddy-ann { border: 1px solid var(--border-soft); border-left: 3px solid var(--fbla-gold); border-radius: 8px; padding: 9px 11px; margin-bottom: 8px; }
.buddy-ann strong { display: block; font-size: 13px; }
.buddy-ann div { font-size: 13px; color: var(--text); margin-top: 2px; }
.m-app .m-buddy-ann { border: 1px solid var(--m-line); border-left: 3px solid var(--fbla-gold); border-radius: 12px; padding: 11px 13px; margin-top: 10px; }
.m-app .m-buddy-ann strong { display: block; }
.m-app .m-buddy-time { display: block; font-size: 11px; color: var(--m-muted); margin-top: 4px; }
/* Forum */
.forum-list { display: flex; flex-direction: column; gap: 10px; }
.forum-post { border: 1px solid var(--border-soft); border-radius: 10px; padding: 13px 15px; cursor: pointer; background: #fff; transition: box-shadow .12s ease, border-color .12s ease; }
.forum-post:hover { border-color: var(--fbla-blue); box-shadow: 0 2px 8px rgba(16,24,40,.07); }
.forum-post-title { font-weight: 700; font-size: 15px; }
.forum-post-meta { font-size: 12px; color: var(--muted); margin: 3px 0; }
.forum-post-preview { font-size: 13px; color: var(--text); }
.m-app .forum-post { border-color: var(--m-line); }
.forum-thread-post { border-bottom: 1px solid var(--border-soft); padding-bottom: 12px; }
.forum-replies { display: flex; flex-direction: column; gap: 10px; }
.forum-reply { border-left: 2px solid var(--border-soft); padding-left: 12px; }
.forum-reply a { color: var(--danger); }

/* ===== "Coming soon" overlay (member tabs not launched yet) ===== */
.coming-soon-wrap { position: relative; min-height: 380px; }
.coming-soon-blur {
  filter: blur(7px);
  opacity: .55;
  pointer-events: none;
  user-select: none;
}
.coming-soon-note {
  position: absolute;
  top: 110px; left: 50%;
  transform: translateX(-50%) rotate(-2.5deg);
  width: 250px;
  padding: 30px 24px 34px;
  background: linear-gradient(180deg, #fef9c3 0%, #fde68a 100%);
  box-shadow: 0 16px 34px rgba(64, 48, 0, .22), 0 2px 6px rgba(64, 48, 0, .12);
  display: flex; flex-direction: column; gap: 7px;
  text-align: center;
  border-radius: 2px;
}
/* strip of tape holding the note up */
.coming-soon-note::before {
  content: '';
  position: absolute;
  top: -13px; left: 50%;
  transform: translateX(-50%) rotate(1.5deg);
  width: 96px; height: 27px;
  background: rgba(255, 255, 255, .5);
  border: 1px solid rgba(0, 0, 0, .05);
  box-shadow: 0 2px 5px rgba(64, 48, 0, .08);
}
.coming-soon-note strong {
  font-size: 23px;
  font-weight: 800;
  color: #713f12;
  letter-spacing: -.01em;
}
.coming-soon-note span { font-size: 13px; line-height: 1.45; color: #854d0e; }
@media (max-width: 640px) {
  .coming-soon-note { top: 90px; width: 220px; }
}

/* ===== Calendar: spanning items + day popover ===== */
.cal-cell.cal-clickable { cursor: pointer; }
.cal-cell.cal-clickable:hover { background: #f0f4fa; }
.cal-item.cal-cont { opacity: .72; border-style: dashed; }
.cal-cont-arrow { font-weight: 800; opacity: .8; }

.cal-popover {
  position: fixed; z-index: 260;
  width: 300px; max-width: calc(100vw - 20px);
  max-height: 380px; overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--fbla-blue);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, .22);
  padding: 12px 14px 14px;
  font-size: 13px;
}
.cal-pop-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.cal-pop-head strong { font-size: 14px; color: var(--fbla-blue); }
.cal-pop-close { border: 0; background: transparent; font-size: 20px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 2px; }
.cal-pop-close:hover { color: var(--text); }
.cal-pop-item { padding: 9px 0; border-top: 1px solid var(--border-soft); }
.cal-pop-item:first-of-type { border-top: 0; }
.cal-pop-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-pop-line strong { font-size: 13.5px; }
.cal-pop-meta { margin-top: 3px; color: var(--muted); font-size: 12px; }
.cal-pop-range { font-weight: 700; color: #475569; }
.cal-pop-desc { margin-top: 4px; color: #374151; font-size: 12.5px; line-height: 1.45; white-space: pre-wrap; }
.cal-pop-src { margin-top: 4px; color: var(--muted); font-size: 11.5px; font-style: italic; }
.cal-pop-actions { display: flex; gap: 6px; margin-top: 7px; }
.cal-pop-empty { color: var(--muted); padding: 8px 0 4px; }

/* Sign up button in the About page header */
.about-join-top { padding: 8px 18px; font-size: 14px; box-shadow: 0 3px 10px rgba(253, 185, 19, .3); white-space: nowrap; }
@media (max-width: 560px) {
  .about-topbar { padding: 9px 12px; gap: 8px; }
  .about-back { font-size: 13px; padding: 6px 2px; }
  .about-join-top { padding: 7px 14px; font-size: 13px; }
  .about-brand-logo { width: 30px; height: 30px; }
}

/* Officer <-> student view switch card in member profile */
.m-officer-switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; border-left: 4px solid var(--fbla-gold); }
.m-officer-switch strong { display: block; font-size: 14.5px; }
.m-officer-switch span { font-size: 12.5px; color: var(--muted); }
