body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background-color: #F8F9FA;
  margin: 0; padding: 0;
  color: #1A1A2E;
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
}
.page { display: none; padding: 40px; flex: 1; }
.page.active { display: block; }

nav {
  background-color: #1A1A2E;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.nav-inner {
  padding: 10px 40px;
  display: flex; gap: 24px; align-items: center;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav-logo-text {
  font-size: 13px;
  font-weight: 600;
  color: white;
  line-height: 1.3;
}

.nav-logo-text span {
  color: #D95F02;
  display: block;
}

.nav-divider {
  width: 1px;
  height: 24px;
  background: rgba(255,255,255,0.2);
  margin-right: 8px;
}

/* ── FOOTER ── */
footer {
  background: #1A1A2E;
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  margin-top: 60px;
}
.footer-inner {
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

footer a {
  color: #D95F02;
  text-decoration: none;
}

footer a:hover { text-decoration: underline; }

nav button {
  color: rgba(255,255,255,0.8); font-weight: 600;
  background: none; border: none;
  font-size: 14px; font-family: inherit;
  cursor: pointer; padding: 0;
}

nav button:hover { color: white; text-decoration: underline; }
nav button.active { color: white; border-bottom: 2px solid #D95F02; padding-bottom: 2px; }

.page.active { display: block; }

h1 { color: #D95F02; margin-bottom: 4px; }
h2 { color: #D95F02; }

/* ── Dashboard redesign ─────────────────────────── */
.dash-page-header { margin-bottom: 28px; }
.dash-title   { font-size: 22px; font-weight: 700; color: #1A1A2E; margin: 0; }
.dash-subtitle { font-size: 13px; color: #aaa; margin: 4px 0 0; }

.dash-section-label {
  display: flex; align-items: center; gap: 12px;
  font-size: 11px; font-weight: 700; color: #bbb;
  text-transform: uppercase; letter-spacing: 1.2px;
  margin-bottom: 14px;
}
.dash-section-label::after {
  content: ''; flex: 1; height: 1px; background: #efefef;
}

.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}
.dash-kpi-grid--4 { grid-template-columns: repeat(4, 1fr); }

.dash-kpi-card {
  background: white; border-radius: 12px;
  padding: 18px 20px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
}

.dash-kpi-icon {
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.dash-kpi-icon--orange { background: #FEF0E6; color: #D95F02; }
.dash-kpi-icon--navy   { background: #ECEDF5; color: #1A1A2E; }
.dash-kpi-icon--amber  { background: #FEF6E6; color: #B45309; }
.dash-kpi-icon--green  { background: #EAF4EB; color: #2E7D32; }

.dash-kpi-number {
  font-size: 26px; font-weight: 700; color: #1A1A2E; line-height: 1;
}
.dash-kpi-number--amber { color: #B45309; }
.dash-kpi-number--navy  { color: #1A1A2E; }
.dash-kpi-number--green { color: #2E7D32; }
.dash-kpi-label { font-size: 12px; color: #999; margin-top: 5px; }

.dash-chart-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.dash-card {
  background: white; border-radius: 12px; padding: 20px 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
}
.dash-card-title {
  font-size: 11px; font-weight: 700; color: #bbb;
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 16px;
}
.dash-chart-body {
  display: flex; align-items: center; gap: 20px;
}
.dash-chart-legend {
  display: flex; flex-direction: column; gap: 6px; flex: 1;
}
.legend-item {
  display: flex; align-items: center; gap: 6px; font-size: 12px; color: #444;
}
.legend-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}

/* kept for any non-dashboard usage */
.dashboard { display: flex; gap: 16px; margin-top: 16px; flex-wrap: wrap; }
.stat-card {
  background: white; border-radius: 10px; padding: 16px 24px; text-align: center;
  border-top: 4px solid #D95F02; box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  flex: 1; min-width: 150px;
}
.stat-card .number { font-size: 32px; font-weight: bold; color: #D95F02; }
.stat-card .label  { font-size: 13px; color: #888; margin-top: 4px; }

.filter-bar {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; margin-top: 16px;
}
.filter-label {
  font-size: 12px; color: #aaa; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.filter-btn {
  background: white; border: 1px solid #e0e0e0;
  color: #888; font-size: 13px; padding: 5px 14px;
  border-radius: 20px; cursor: pointer;
  font-family: 'Segoe UI', Arial, sans-serif;
  transition: all 0.15s;
}
.filter-btn:hover { border-color: #D95F02; color: #D95F02; }
.filter-btn.active { background: #D95F02; color: white; border-color: #D95F02; }

#searchBar {
  padding: 5px 12px; font-size: 13px;
  border: 1px solid #ddd; border-radius: 20px;
  box-sizing: border-box; outline: none;
  background: white; width: 200px;
  font-family: 'Segoe UI', Arial, sans-serif;
  transition: border-color 0.15s;
}
#searchBar:focus { border-color: #D95F02; }

table {
  width: 100%; border-collapse: collapse; margin-top: 24px;
  background: white; border-radius: 10px;
  overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  table-layout: fixed;
}

th {
  background-color: #1A1A2E; color: white;
  text-align: left; padding: 12px 16px;
  font-weight: 600; letter-spacing: 0.4px;
}

td { padding: 12px 16px; border-bottom: 1px solid #F0F0F0; color: #2D2D2D; }
tr:last-child td { border-bottom: none; }
tr:hover td { background-color: #FFF5F0; }

td select {
  border: none; background: transparent;
  font-size: 14px; font-family: 'Segoe UI', Arial, sans-serif;
  cursor: pointer; outline: none; width: 100%;
}

.active   { color: #2E7D32; }
.inactive { color: #888; }
.pending  { color: #B45309; font-style: italic; }

.notes-row td { padding: 0; background: #FFFAF7; }
.notes-content { display: none; padding: 12px 16px; border-top: 1px solid #F0F0F0; }
.notes-content.active { display: block; }

.notes-content textarea {
  width: 100%; border: 1px solid #e0e0e0; border-radius: 6px;
  padding: 10px; font-size: 13px;
  font-family: 'Segoe UI', Arial, sans-serif;
  color: #444; resize: vertical; box-sizing: border-box;
  outline: none; min-height: 80px;
}

.notes-content textarea:focus { border-color: #D95F02; }

.fee-mandats-input {
  width: 100%; border: 1px solid transparent; border-radius: 4px;
  padding: 4px 6px; font-size: 13px;
  font-family: 'Segoe UI', Arial, sans-serif;
  color: #444; box-sizing: border-box; outline: none;
  background: transparent;
}
.fee-mandats-input:hover { border-color: #e0e0e0; background: #fff; }
.fee-mandats-input:focus { border-color: #D95F02; background: #fff; }

.btn-add {
  background: #D95F02; color: white; border: none;
  padding: 10px 24px; border-radius: 6px;
  font-size: 14px; cursor: pointer; font-weight: 600;
}
.btn-add:hover { background: #B34D00; }

.btn-export {
  background: white; color: #D95F02; border: 2px solid #D95F02;
  padding: 10px 24px; border-radius: 6px;
  font-size: 14px; cursor: pointer; font-weight: 600; margin-left: 12px;
}
.btn-export:hover { background: #FFF5F0; }

.btn-edit, .btn-notes, .btn-delete, .btn-fee {
  width: 30px; height: 30px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; cursor: pointer; border: 1px solid #e0e0e0;
  background: transparent; margin-right: 2px; transition: all 0.15s;
}
.btn-edit   { color: #D95F02; border-color: #D95F02; }
.btn-fee    { color: #2E7D32; border-color: #2E7D32; }
.btn-notes  { color: #888;    border-color: #e0e0e0; }
.btn-delete { color: #B34D00; border-color: #B34D00; margin-right: 0; }
.btn-edit:hover   { background: #D95F02; color: white; }
.btn-fee:hover    { background: #2E7D32; color: white; }
.btn-notes:hover  { border-color: #D95F02; color: #D95F02; }
.btn-delete:hover { background: #B34D00; color: white; }
.btn-edit svg, .btn-notes svg, .btn-delete svg, .btn-fee svg { width: 14px; height: 14px; }

.form-section {
  margin-top: 32px; background: white;
  padding: 24px; border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}
.form-section h3 { margin-top: 0; color: #D95F02; }

.form-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; align-items: flex-start; }

.form-row input, .form-row select {
  flex: 1; padding: 10px 12px; border: 1px solid #ccc;
  border-radius: 6px; font-size: 14px; outline: none; box-sizing: border-box;
}

.form-field {
  display: flex; flex-direction: column; gap: 4px; flex: 1;
}
.form-field input, .form-field select, .form-field textarea {
  flex: none; width: 100%; box-sizing: border-box;
}
.form-label {
  font-size: 11px; color: #aaa; text-transform: uppercase; letter-spacing: 0.5px;
}

.modal-overlay {
  display: none; position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.4); z-index: 1000;
  justify-content: center; align-items: center;
}
.modal-overlay.active { display: flex; }

.modal-box {
  background: white; border-radius: 12px; padding: 32px;
  max-width: 380px; width: 90%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2); text-align: center;
}
.modal-box h3 { color: #1A1A2E; margin-bottom: 8px; }
.modal-box p  { color: #888; font-size: 14px; margin-bottom: 24px; }

.modal-actions { display: flex; gap: 12px; justify-content: center; }

.btn-cancel {
  background: white; color: #888; border: 1px solid #ccc;
  padding: 10px 24px; border-radius: 6px;
  font-size: 14px; cursor: pointer; font-weight: 600;
}
.btn-cancel:hover { background: #f4f4f4; }

.btn-primary {
  background: #1A1A2E; color: white; border: none;
  padding: 8px 20px; border-radius: 6px;
  font-size: 13px; cursor: pointer; font-weight: 600;
  transition: background 0.15s;
}
.btn-primary:hover { background: #2d2d4e; }

.btn-confirm {
  background: #B34D00; color: white; border: none;
  padding: 10px 24px; border-radius: 6px;
  font-size: 14px; cursor: pointer; font-weight: 600;
}
.btn-confirm:hover { background: #8c3c00; }

/* ── Back button ── */
.btn-back {
  background: transparent; color: #D95F02; border: none;
  font-size: 14px; font-weight: 600; cursor: pointer; padding: 0;
}
.btn-back:hover { text-decoration: underline; }

/* ── Profile Page ── */
.pp-header {
  display: flex; align-items: center; gap: 20px;
  margin-bottom: 32px; flex-wrap: wrap;
}
.pp-identity { flex: 1; }
.pp-identity h1 { margin: 0 0 10px 0; color: #1A1A2E; }
.pp-badges { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Name + status on same line */
.pp-name-row {
  display: flex; align-items: center; gap: 12px; margin-bottom: 6px;
}
.pp-name-row h1 { margin: 0; }

.pp-membership-label {
  font-size: 15px; font-weight: 600; color: #555;
}

/* Sortable table headers */
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { background: #bf5300; }
.sort-arrow { font-size: 11px; margin-left: 4px; opacity: 0.45; }
th.sort-asc  .sort-arrow,
th.sort-desc .sort-arrow { opacity: 1; }
.pp-status-badge {
  display: inline-block; padding: 3px 11px; border-radius: 20px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}
.pp-status-badge.active   { background: #E8F5E9; color: #2E7D32; }
.pp-status-badge.inactive { background: #F5F5F5; color: #777; }
.pp-status-badge.pending  { background: #FFF3E0; color: #E65100; }
.pp-actions { display: flex; gap: 8px; align-items: center; }

.pp-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
.pp-card {
  background: #fff; border: 1px solid #e0e0e0;
  border-radius: 12px; padding: 24px 28px;
}
.pp-card-full { grid-column: 1 / -1; }
.pp-card-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: #888; margin-bottom: 16px;
}
.pp-card-title + .pp-card-title { margin-top: 24px; }

/* Each label+value row inside a card */
.pf-row {
  display: flex; align-items: baseline; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid #f5f5f5;
}
.pf-row:last-child { border-bottom: none; }
.pf-label {
  font-size: 13px; color: #888; min-width: 130px; flex-shrink: 0;
}
.pf-value {
  font-size: 14px; color: #1A1A2E; font-weight: 500; flex: 1;
}
.pf-value.empty { color: #ccc; font-style: italic; font-weight: 400; }

/* Inputs hidden in read mode, shown in edit mode */
.pf-input {
  display: none; flex: 1; font-size: 14px; padding: 6px 10px;
  border: 1px solid #ddd; border-radius: 6px;
  font-family: inherit; color: #1A1A2E; background: #fff;
  box-sizing: border-box; width: 100%;
}
.pf-input:focus { outline: none; border-color: #D95F02; }
#page-profile.edit-mode .pf-value { display: none; }
#page-profile.edit-mode .pf-input { display: block; }

/* Always-editable inputs (skills, languages, notes) — visible in both modes */
.pf-always-input {
  flex: 1; font-size: 14px; padding: 6px 10px;
  border: 1px solid #eee; border-radius: 6px;
  font-family: inherit; color: #1A1A2E; background: #fafafa;
  box-sizing: border-box; width: 100%;
}
.pf-always-input:hover  { border-color: #ddd; }
.pf-always-input:focus  { outline: none; border-color: #D95F02; background: #fff; }

.pp-notes-textarea {
  width: 100%; min-height: 120px; font-size: 14px;
  padding: 12px; border: 1px solid #eee; border-radius: 8px;
  font-family: inherit; color: #1A1A2E; resize: vertical;
  box-sizing: border-box; background: #fafafa;
}
.pp-notes-textarea:hover  { border-color: #ddd; }
.pp-notes-textarea:focus  { outline: none; border-color: #D95F02; background: #fff; }

/* Viewer role: hide all editing controls in the profile */
body.role-viewer #ppReadActions           { display: none !important; }
body.role-viewer .pf-always-input,
body.role-viewer .pp-notes-textarea {
  pointer-events: none;
  background: transparent;
  border-color: transparent;
  color: #1A1A2E;
  cursor: default;
}

.event-card {
  background: white; border-radius: 10px;
  padding: 16px 20px; margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  display: flex; align-items: center; gap: 16px;
}

.event-date-box {
  background: #D95F02; color: white;
  border-radius: 8px; padding: 8px 12px;
  text-align: center; min-width: 52px; flex-shrink: 0;
}

.event-date-box .day   { font-size: 22px; font-weight: bold; line-height: 1; }
.event-date-box .month { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }

.event-info  { flex: 1; }
.event-title { font-weight: 600; color: #1A1A2E; font-size: 15px; }
.event-meta  { font-size: 12px; color: #aaa; margin-top: 2px; }

.event-card.past .event-date-box { background: #aaa; }
.event-card.past { opacity: 0.6; }

.event-type-badge {
  font-size: 11px; padding: 3px 8px; border-radius: 10px;
  font-weight: 600; background: #FFF5F0; color: #D95F02;
}
.event-type-badge.birthday { background: #F3E5F5; color: #7B1FA2; }
.event-type-badge.meeting  { background: #E8F5E9; color: #2E7D32; }
.event-type-badge.deadline { background: #FFF3E0; color: #E65100; }

.help-section {
  background: white; border-radius: 10px; padding: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07); margin-bottom: 20px;
}
.help-section h3 { color: #D95F02; margin-top: 0; }
.help-section p, .help-section li { color: #555; font-size: 14px; line-height: 1.7; }
.help-section ul { padding-left: 20px; }
.help-badge {
  display: inline-block; background: #FFF5F0; color: #D95F02;
  border: 1px solid #D95F02; border-radius: 4px;
  font-size: 11px; font-weight: 700; padding: 2px 7px;
  font-family: monospace; margin: 0 2px;
}
.fee-paid    { color: #2E7D32; font-weight: bold; }
.fee-pending { color: #B45309; font-style: italic; }

/* Fee History (in profile) */
.pp-fee-form {
  background: #fafafa; border: 1px solid #eee; border-radius: 8px;
  padding: 16px; margin-bottom: 16px; display: flex;
  gap: 12px; flex-wrap: wrap; align-items: flex-end;
}
.pp-fee-form .form-field { flex: 1; min-width: 120px; margin: 0; }
.pp-fee-form label { font-size: 12px; font-weight: 600; color: #555;
  display: block; margin-bottom: 4px; }
.pp-fee-form input, .pp-fee-form select {
  width: 100%; padding: 7px 10px; border: 1px solid #ddd;
  border-radius: 6px; font-size: 14px; box-sizing: border-box; outline: none;
}
.pp-fee-form input:focus, .pp-fee-form select:focus { border-color: #D95F02; }
.btn-record-fee {
  background: #D95F02; color: white; border: none; border-radius: 6px;
  padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
  white-space: nowrap;
}
.btn-record-fee:hover { background: #bf5300; }
.btn-add-small {
  background: none; border: 1px solid #D95F02; color: #D95F02;
  border-radius: 6px; padding: 4px 12px; font-size: 12px;
  font-weight: 600; cursor: pointer;
}
.btn-add-small:hover { background: #D95F02; color: white; }
/* Fee quick-row (inline form below a member row) */
.fee-quick-row td { padding: 0; background: #F1FBF3; }
.fee-quick-content { display: none; padding: 10px 16px; border-top: 1px solid #C8E6C9; }
.fee-quick-content.active { display: block; }
/* Donation quick-row (inline receipt form below a transaction row) */
.tx-donation-quick-row td { padding: 0; background: #EEF3FB; }
.tx-donation-quick-content { display: none; padding: 10px 16px; border-top: 2px solid #BBDEFB; }
.tx-donation-quick-content.active { display: block; }
.tx-donation-quick-content .fq-field input:focus { border-color: #1565C0; }
.tx-donation-quick-content .btn-record-fee { background: #1565C0; }
.fq-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.fq-field { display: flex; flex-direction: column; min-width: 110px; }
.fq-field label { font-size: 11px; font-weight: 600; color: #555; margin-bottom: 3px; }
.fq-field input, .fq-field select {
  padding: 6px 9px; border: 1px solid #c8e6c9; border-radius: 5px;
  font-size: 13px; outline: none; background: white;
}
.fq-field input:focus, .fq-field select:focus { border-color: #2E7D32; }
.fq-actions { display: flex; gap: 6px; align-items: flex-end; padding-bottom: 1px; }

.fees-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 12px; }
.fees-table th { padding: 8px 10px; font-size: 11px;
  font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.fees-table td { padding: 9px 10px; border-bottom: 1px solid #f0f0f0; color: #1A1A2E; }
.fees-table tr:last-child td { border-bottom: none; }
.fee-period-badge {
  display: inline-block; background: #FFF3E0; color: #D95F02;
  border-radius: 4px; padding: 2px 8px; font-size: 12px; font-weight: 700;
}
body.role-viewer #ppFeeAddBtn { display: none; }
body.role-viewer #addMemberBtn { display: none; }
body.role-viewer #donationAddBtn { display: none; }
body.role-viewer .btn-delete-fee { display: none; }
body.role-viewer .btn-delete-donation { display: none; }
body.role-viewer .btn-delete-fee-log { display: none; }
body.role-viewer .btn-fee { display: none; }

/* Overdue members section */
.overdue-section {
  background: #FFFBF5; border: 1px solid #F5C07A;
  border-radius: 10px; padding: 20px 24px; margin-bottom: 32px;
}
.overdue-section h2 { color: #B45309; margin: 0 0 4px 0; font-size: 17px; }
.overdue-section .overdue-sub { color: #888; font-size: 13px; margin-bottom: 16px; }
.overdue-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.overdue-table th { background: #1A1A2E; color: white; padding: 8px 12px;
  text-align: left; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; }
.overdue-table td { padding: 9px 12px; border-bottom: 1px solid #FDEAC0; color: #1A1A2E; }
.overdue-table tr:last-child td { border-bottom: none; }
tr.overdue-extra { display: none; }
.overdue-form-row td { background: #FFF8EC; padding: 10px 16px !important; }
.overdue-form-row .fq-field input,
.overdue-form-row .fq-field select { border-color: #F5C07A; }
.overdue-form-row .fq-field input:focus,
.overdue-form-row .fq-field select:focus { border-color: #B45309; }

/* Finance page — summary cards */
.fin-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 36px;
}
.fin-stat-card {
  background: white;
  border-radius: 10px;
  padding: 20px 22px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07), 0 0 0 1px rgba(0,0,0,0.04);
  border-left: 4px solid #D95F02;
  display: flex;
  flex-direction: column;
}
.fin-stat-card.accent-navy  { border-left-color: #1A1A2E; }
.fin-stat-card.accent-blue  { border-left-color: #1565C0; }
.fin-stat-card.accent-green { border-left-color: #2E7D32; }
.fin-stat-card.accent-amber { border-left-color: #B45309; }
.fin-stat-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.6px; color: #999; margin-bottom: 10px;
}
.fin-stat-value {
  font-size: 30px; font-weight: 700; color: #1A1A2E;
  line-height: 1; margin-bottom: 5px;
}
.fin-stat-sub  { font-size: 12px; color: #aaa; flex: 1; margin-bottom: 14px; }
.fin-stat-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.fin-set-btn {
  background: none; border: 1px solid #e0e0e0; color: #888;
  font-size: 11px; padding: 4px 10px; border-radius: 4px; cursor: pointer;
}
.fin-set-btn:hover { border-color: #D95F02; color: #D95F02; }

/* ── Admin section read/edit mode ─────────────────── */
.admin-section-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 16px;
}
.admin-section-header h2 { margin: 0 0 4px 0; }
.admin-section-subtitle { color: #888; font-size: 13px; margin: 0; }
.admin-field-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 20px;
}
.admin-field-grid.two-col { grid-template-columns: 1fr 1fr; }
.admin-field-grid .full { grid-column: 1 / -1; }
.admin-field-wrap { margin-bottom: 16px; }
.admin-field-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: #aaa; margin-bottom: 4px; display: block;
}
.admin-field-input {
  width: 100%; padding: 7px 10px;
  border: 1px solid transparent; border-radius: 6px;
  font-size: 14px; color: #1A1A2E; font-weight: 500;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: transparent; box-sizing: border-box; outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.admin-field-input[readonly], .admin-field-input:disabled {
  cursor: default; pointer-events: none;
}
.admin-editing .admin-field-input {
  border-color: #ddd; background: white; cursor: text; pointer-events: auto;
}
.admin-editing .admin-field-input:focus { border-color: #D95F02; }
.admin-section-edit-btn {
  width: auto; height: auto; padding: 7px 16px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
}
.admin-section-save-actions { display: none; align-items: center; gap: 8px; }
.admin-editing .admin-section-edit-btn { display: none !important; }
.admin-editing .admin-section-save-actions { display: flex !important; }
.admin-logo-upload { display: none; margin-top: 8px; }
.admin-editing .admin-logo-upload { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

/* ── In-page subtab navigation ───────────────────── */
.page-subtabs {
  display: flex; gap: 10px; flex-wrap: wrap;
  align-items: center;
  padding: 12px 4px 16px 4px;
  margin-bottom: 20px;
  position: sticky; top: 0; z-index: 20;
  background: #F8F9FA;
  border-bottom: 2px solid #D95F02;
}
.page-subtab {
  display: inline-block;
  padding: 7px 20px;
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #888;
  background: #EFEFEF;
  border: none;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
}
.page-subtab:hover {
  background: #D95F02; color: white;
}
/* scroll-margin so sticky subtab bar doesn't cover the target */
.subtab-anchor { scroll-margin-top: 68px; }

.fin-fee-overview {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px;
}
.fin-member-chip {
  background: white; border-radius: 8px; padding: 10px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08); font-size: 13px;
  display: flex; flex-direction: column; gap: 2px; min-width: 160px;
}
.fin-member-chip .chip-name  { font-weight: 600; color: #1A1A2E; margin-bottom: 6px; }
.chip-quarter {
  font-size: 12px; padding: 5px 8px; border-radius: 6px;
  margin-bottom: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.chip-q-paid { background: #F1F8F1; color: #2E7D32; }
.chip-q-due  { background: #FFF8F0; color: #B45309; }
.chip-pay-btn {
  margin-left: auto; background: #2E7D32; color: white;
  border: none; border-radius: 4px; font-size: 11px;
  padding: 3px 8px; cursor: pointer; font-weight: 600;
  white-space: nowrap;
}
.chip-pay-btn:hover { background: #1B5E20; }

.tx-income  { color: #2E7D32; font-weight: bold; }
.tx-outcome { color: #B34D00; font-weight: bold; }
.tx-tag {
  display: inline-block; font-size: 11px; padding: 2px 8px;
  border-radius: 10px; background: #F0F0F0; color: #555;
}
.tx-tag.membership_fee      { background: #E8F5E9; color: #2E7D32; }
.tx-tag.recurring_donation  { background: #E3F2FD; color: #1565C0; }
.tx-tag.onetime_donation    { background: #EDE7F6; color: #512DA8; }
.tx-tag.expense             { background: #FBE9E7; color: #BF360C; }

  /* ── Login page ── */
#page-login {
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#page-login.active {
  display: flex;
}

#page-force-password {
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#page-force-password.active {
  display: flex;
}

.login-card {
  background: white;
  border-radius: 12px;
  padding: 40px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  border-top: 4px solid #D95F02;
}

.login-card h2 {
  margin: 0 0 8px;
  color: #D95F02;
}

.login-subtitle {
  color: #888;
  font-size: 13px;
  margin-bottom: 24px;
}

.login-card label {
  display: block;
  font-size: 11px;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 4px;
  margin-top: 16px;
}

.login-card input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  box-sizing: border-box;
  outline: none;
}

.login-card input:focus { border-color: #D95F02; }

.login-card button {
  width: 100%;
  padding: 12px;
  margin-top: 24px;
  background: #D95F02;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.login-card button:hover { background: #B34D00; }

.login-error {
  margin-top: 16px;
  padding: 10px;
  background: #FBE9E7;
  color: #BF360C;
  border-radius: 6px;
  font-size: 13px;
  display: none;
}

.login-error.active { display: block; }

.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: #aaa;
  font-size: 13px;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e0e0e0;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  border: 1px solid #dadce0;
  border-radius: 6px;
  background: white;
  color: #3c4043;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
  transition: background 0.15s, box-shadow 0.15s;
}
.btn-google:hover {
  background: #f8f9fa;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

/* ── User indicator in nav ── */
.nav-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255,255,255,0.7);
  font-size: 13px;
}

.nav-user .nav-user-name { font-weight: 600; color: white; }

.nav-user .nav-account-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.25);
  color: white;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-user .nav-account-btn:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.5); }

.nav-user .nav-logout-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.7);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}

.nav-user .nav-logout-btn:hover { color: white; border-color: white; }

/* Hide the whole app shell when not logged in */
body.logged-out nav,
body.logged-out footer,
body.logged-out .page:not(#page-login):not(#page-force-password) {
  display: none !important;
}

/* Spinner */
#spinner {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.6);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}
#spinner.show { display: flex; }
.spinner-circle {
  width: 40px;
  height: 40px;
  border: 4px solid #eee;
  border-top-color: #D95F02;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Required field asterisk */
.req-star { color: #c0392b; font-weight: bold; }

/* Form validation error */
.form-error {
  color: #c0392b;
  font-size: 13px;
  margin-top: 8px;
  display: none;
}
.form-error.show { display: block; }

/* Toast notification */
#toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  background: #1A1A2E;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 9999;
}
#toast.show { opacity: 1; }

/* Scroll-to-top button */
#scrollTopBtn {
  position: fixed;
  bottom: 90px;
  right: 32px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #D95F02;
  color: white;
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 9998;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
#scrollTopBtn.visible { opacity: 1; pointer-events: auto; }
#scrollTopBtn:hover { background: #bf5300; }

/* ── Admin Console ── */
.admin-section {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 28px 32px;
  margin-bottom: 28px;
}
.admin-section h2 {
  font-size: 16px;
  font-weight: 700;
  color: #1A1A2E;
  margin: 0 0 20px 0;
}

#usersTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
#usersTable th {
  padding: 10px 12px;
}
#usersTable td {
  padding: 12px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}
#usersTable tr:last-child td { border-bottom: none; }
#usersTable tr:hover td { background: #fafafa; }

@media (max-width: 900px) {
  .dash-kpi-grid       { grid-template-columns: repeat(2, 1fr); }
  .dash-kpi-grid--4    { grid-template-columns: repeat(2, 1fr); }
  .dash-chart-grid     { grid-template-columns: 1fr; }
}

.role-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.role-badge.admin   { background: #1A1A2E; color: #fff; }
.role-badge.manager { background: #D95F02; color: #fff; }
.role-badge.viewer  { background: #e8e8e8; color: #555; }

.user-role-select {
  font-size: 13px;
  padding: 4px 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.finance-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #555;
}
.finance-toggle input[type=checkbox] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #D95F02;
}
.finance-toggle.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.you-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  background: #D95F02;
  color: #fff;
  vertical-align: middle;
}

/* Inline-editable inputs inside the users table */
.editable-cell {
  border: 1px solid transparent;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  color: inherit;
  padding: 4px 6px;
  border-radius: 6px;
  width: 100%;
  box-sizing: border-box;
}
.editable-cell:hover  { border-color: #ddd; background: #fafafa; }
.editable-cell:focus  { outline: none; border-color: #D95F02; background: #fff; }

.admin-add-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.admin-add-form .form-field.full { grid-column: 1 / -1; }
.admin-form-footer {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

/* ── Shared table cell utilities ────────────────── */
.tbl-cell     { padding: 9px 10px; border-bottom: 1px solid #f0f0f0; }
.tbl-cell-amt { padding: 9px 10px; border-bottom: 1px solid #f0f0f0; font-weight: 600; color: #2E7D32; }
.tbl-cell-act { padding: 9px 10px; border-bottom: 1px solid #f0f0f0; white-space: nowrap; }

/* ── Shared text utilities ──────────────────────── */
.amt-positive { font-weight: 600; color: #2E7D32; }
.amt-blue     { font-weight: 600; color: #1565C0; }
.fw-bold      { font-weight: 600; }
