/* =============================================
   HILLS EDUCATIONAL CONSULT — Members Portal
   Shared styles (membership, login, dashboard,
   admin console)
   ============================================= */

/* --- Page shell --- */
.portal-page {
  background: var(--off-white);
  min-height: 100vh;
}

.portal-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: var(--white);
  padding: 150px 0 80px;
  position: relative;
  overflow: hidden;
}
.portal-hero::after {
  content: '';
  position: absolute;
  right: -120px; top: -120px;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,168,76,0.22), transparent 68%);
  pointer-events: none;
}
.portal-hero .section-label { color: var(--gold-light); }
.portal-hero h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 700;
  margin-bottom: 14px;
}
.portal-hero h1 span { color: var(--gold); }
.portal-hero p {
  max-width: 640px;
  color: rgba(255,255,255,0.72);
  font-size: 1.02rem;
}

/* --- Cards --- */
.p-card {
  background: var(--white);
  border: 1px solid var(--gray-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 32px;
}
.p-card + .p-card { margin-top: 24px; }

.p-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--gray-light);
}
.p-card-head h2,
.p-card-head h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--navy-dark);
}
.p-card-head p {
  font-size: 0.88rem;
  color: var(--gray);
  margin-top: 4px;
}

/* --- Auth cards --- */
.auth-wrap {
  padding: 130px 0 90px;
  display: flex;
  justify-content: center;
}
.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--white);
  border: 1px solid var(--gray-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 44px 40px;
}
.auth-card .auth-logo {
  width: 62px;
  margin: 0 auto 20px;
}
.auth-card h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--navy-dark);
  text-align: center;
  margin-bottom: 6px;
}
.auth-card > p.auth-sub {
  text-align: center;
  color: var(--gray);
  font-size: 0.9rem;
  margin-bottom: 32px;
}
.auth-foot {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--gray-light);
  text-align: center;
  font-size: 0.86rem;
  color: var(--gray);
}
.auth-foot a { color: var(--navy); font-weight: 700; }
.auth-foot a:hover { color: var(--gold); }

/* --- Alerts --- */
.p-alert {
  display: none;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 20px;
  line-height: 1.5;
}
.p-alert.show { display: flex; }
.p-alert-error   { background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; }
.p-alert-success { background: #F0FDF4; color: #15803D; border: 1px solid #BBF7D0; }
.p-alert-info    { background: #EFF6FF; color: #1D4ED8; border: 1px solid #BFDBFE; }
.p-alert-warn    { background: #FFFBEB; color: #B45309; border: 1px solid #FDE68A; }

/* --- Buttons (portal additions) --- */
.btn-ghost {
  background: transparent;
  color: var(--gray);
  border-color: var(--gray-light);
}
.btn-ghost:hover { background: var(--off-white); color: var(--navy-dark); }

.btn-sm { padding: 8px 16px; font-size: 0.78rem; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 30px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  white-space: nowrap;
}
.badge::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.badge-green  { background: #ECFDF5; color: #059669; }
.badge-amber  { background: #FFFBEB; color: #D97706; }
.badge-red    { background: #FEF2F2; color: #DC2626; }
.badge-blue   { background: #EFF6FF; color: #2563EB; }
.badge-gray   { background: #F3F4F6; color: #6B7280; }
.badge-navy   { background: rgba(27,42,74,0.08); color: var(--navy); }

/* --- Dashboard layout --- */
.dash {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  align-items: start;
  padding: 120px 0 90px;
}

.dash-side {
  background: var(--white);
  border: 1px solid var(--gray-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px 18px;
  position: sticky;
  top: 110px;
}
.dash-school {
  padding: 0 8px 20px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--gray-light);
}
.dash-school-name {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--navy-dark);
  line-height: 1.35;
}
.dash-school-id {
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--gray);
  letter-spacing: 0.5px;
}
.dash-school-id strong { color: var(--gold-text); font-weight: 700; }

.dash-nav { display: flex; flex-direction: column; gap: 4px; }
.dash-nav button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 14px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}
.dash-nav button:hover { background: var(--off-white); color: var(--navy-dark); }
.dash-nav button.active {
  background: var(--navy-dark);
  color: var(--white);
}
.dash-nav button.active .dash-nav-icon { filter: none; }
.dash-nav-icon { font-size: 1rem; }
.dash-nav .dash-nav-sep {
  height: 1px;
  background: var(--gray-light);
  margin: 12px 6px;
}

.dash-main { min-width: 0; }
.dash-panel { display: none; }
.dash-panel.active { display: block; animation: panelIn 0.28s ease; }
@keyframes panelIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.dash-panel-head { margin-bottom: 24px; }
.dash-panel-head h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy-dark);
}
.dash-panel-head p { color: var(--gray); font-size: 0.92rem; margin-top: 4px; }

/* --- Stat tiles --- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 18px;
  margin-bottom: 26px;
}
.stat-tile {
  background: var(--white);
  border: 1px solid var(--gray-light);
  border-left: 4px solid var(--gold);
  border-radius: 12px;
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}
.stat-tile-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--gray);
}
.stat-tile-value {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--navy-dark);
  margin-top: 8px;
  line-height: 1.1;
}
.stat-tile-note { font-size: 0.8rem; color: var(--gray); margin-top: 4px; }
.stat-tile.navy { border-left-color: var(--navy); }
.stat-tile.green { border-left-color: #059669; }
.stat-tile.blue { border-left-color: #2563EB; }

/* --- Mock cards --- */
.mock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 20px;
}
.mock-card {
  background: var(--white);
  border: 2px solid var(--gray-light);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
}
.mock-card.is-available { border-color: rgba(5,150,105,0.35); }
.mock-card.is-available:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.mock-card.is-closed { opacity: 0.78; }
.mock-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.mock-num {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--navy-dark);
  color: var(--gold-light);
  display: grid;
  place-items: center;
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.mock-card h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy-dark);
  margin-bottom: 14px;
  line-height: 1.35;
}
.mock-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--gray);
  margin-bottom: 18px;
}
.mock-meta div { display: flex; justify-content: space-between; gap: 12px; }
.mock-meta strong { color: var(--text-dark); font-weight: 700; text-align: right; }
.mock-price {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  color: var(--navy-dark);
  font-size: 0.95rem;
  padding: 12px 14px;
  background: var(--off-white);
  border-radius: 8px;
  margin-bottom: 16px;
  text-align: center;
}
.mock-price span { color: var(--gray); font-weight: 600; font-size: 0.78rem; display: block; }
.mock-card .btn { margin-top: auto; }

/* --- Tables --- */
.p-table-wrap { overflow-x: auto; }
.p-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
  min-width: 640px;
}
.p-table th {
  text-align: left;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gray);
  padding: 12px 14px;
  border-bottom: 2px solid var(--gray-light);
  white-space: nowrap;
}
.p-table td {
  padding: 15px 14px;
  border-bottom: 1px solid var(--gray-light);
  color: var(--text-dark);
  vertical-align: middle;
}
.p-table tr:last-child td { border-bottom: none; }
.p-table tbody tr:hover { background: var(--off-white); }
.p-table .num { font-family: 'Montserrat', sans-serif; font-weight: 700; }
.p-table .muted { color: var(--gray); font-size: 0.82rem; }

/* The action buttons are the point of the row, so they must not be the first
   thing lost to a horizontal scroll. Pinning the last column keeps Edit and
   Reset PIN reachable at any width. */
.p-table th:last-child,
.p-table td:last-child {
  position: sticky;
  right: 0;
  background: var(--white);
  box-shadow: -6px 0 8px -6px rgba(27,42,74,0.15);
}
.p-table tbody tr:hover td:last-child { background: var(--off-white); }
.p-table th:last-child { background: var(--white); z-index: 1; }

/* --- Empty state --- */
.p-empty {
  text-align: center;
  padding: 56px 24px;
  color: var(--gray);
}
.p-empty-icon { margin-bottom: 12px; line-height: 0; }
.p-empty h4 {
  font-family: 'Montserrat', sans-serif;
  color: var(--navy-dark);
  font-size: 1rem;
  margin-bottom: 6px;
}
.p-empty p { font-size: 0.9rem; max-width: 380px; margin: 0 auto 18px; }

/* --- Credential reveal --- */
.cred-box {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  border-radius: 12px;
  padding: 28px;
  color: var(--white);
  text-align: center;
}
.cred-box h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: 18px;
}
.cred-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.cred-item {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  padding: 16px;
}
.cred-item span {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  margin-bottom: 8px;
}
.cred-item strong {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 1.5px;
}
.cred-warn {
  margin-top: 18px;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.7);
  line-height: 1.6;
}

/* --- Steps (marketing page) --- */
.step-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 22px;
}
.step-card {
  background: var(--white);
  border: 1px solid var(--gray-light);
  border-radius: 12px;
  padding: 26px 24px;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.step-num {
  position: absolute;
  top: -14px; left: 24px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy-dark);
  display: grid;
  place-items: center;
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 0.8rem;
}
.step-card h4 {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.95rem;
  color: var(--navy-dark);
  margin: 10px 0 8px;
}
.step-card p { font-size: 0.87rem; color: var(--gray); line-height: 1.65; }

/* --- Pricing list --- */
.price-list { display: flex; flex-direction: column; gap: 2px; }
.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1px dashed var(--gray-light);
}
.price-row:last-child { border-bottom: none; }
.price-row span { color: var(--text-dark); font-size: 0.92rem; }
.price-row strong {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  color: var(--navy-dark);
  white-space: nowrap;
}

/* --- Order summary --- */
.summary-box {
  background: var(--off-white);
  border: 1px solid var(--gray-light);
  border-radius: 10px;
  padding: 20px 22px;
  margin: 20px 0;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0;
  font-size: 0.9rem;
  color: var(--gray);
}
.summary-row strong { color: var(--text-dark); font-weight: 700; }
.summary-row.total {
  border-top: 2px solid var(--gray-light);
  margin-top: 10px;
  padding-top: 14px;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.05rem;
  color: var(--navy-dark);
  font-weight: 800;
}
.summary-row.total strong { color: var(--gold-text); font-size: 1.15rem; }

/* --- Modal --- */
.p-overlay,
.pay-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17,28,53,0.72);
  backdrop-filter: blur(3px);
  display: flex;
  justify-content: center;
  /* A modal taller than the screen must scroll rather than have its top cut
     off, so the overlay does the scrolling and `auto` margins centre a short
     one without `align-items: center` trapping the overflow. */
  align-items: flex-start;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px;
  z-index: 2000;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.p-modal,
.pay-modal {
  background: var(--white);
  border-radius: var(--radius);
  width: 100%;
  max-width: 460px;
  padding: 32px;
  box-shadow: var(--shadow-lg);
  /* Centred when it fits, pushed to the top and scrolled when it does not. */
  margin: auto;
  animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.p-modal.wide { max-width: 620px; }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
.p-modal h3,
.pay-modal h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--navy-dark);
  margin-bottom: 6px;
}
.p-modal > p,
.pay-modal-head p {
  font-size: 0.88rem;
  color: var(--gray);
  line-height: 1.6;
  margin-bottom: 22px;
}

/* The generic modal heading rule below would otherwise repaint this navy on navy. */
.p-modal .cred-box h3 {
  color: var(--gold-light);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.72rem;
}

.pay-demo-tag {
  display: inline-block;
  background: #FFFBEB;
  color: #B45309;
  border: 1px solid #FDE68A;
  border-radius: 30px;
  padding: 3px 12px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.pay-summary {
  background: var(--off-white);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 22px;
}
.pay-summary > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 0;
  font-size: 0.88rem;
  color: var(--gray);
}
.pay-summary strong { color: var(--text-dark); text-align: right; }
.pay-summary .pay-total {
  border-top: 2px solid var(--gray-light);
  margin-top: 8px;
  padding-top: 12px;
}
.pay-summary .pay-total strong {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--navy-dark);
}
.pay-method-label {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--navy-dark);
  margin-bottom: 10px;
}
.pay-methods { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; }
.pay-method {
  flex: 1 1 120px;
  padding: 12px 10px;
  border: 2px solid var(--gray-light);
  background: var(--white);
  border-radius: 8px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gray);
  cursor: pointer;
  transition: all 0.2s ease;
}
.pay-method.active {
  border-color: var(--navy-dark);
  background: var(--navy-dark);
  color: var(--white);
}
.pay-actions,
.p-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* --- Misc --- */
.p-inline-note {
  font-size: 0.82rem;
  color: var(--gray);
  line-height: 1.6;
  margin-top: 10px;
}
.p-checklist { display: flex; flex-direction: column; gap: 12px; }
.p-checklist li {
  display: flex;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-dark);
  line-height: 1.6;
}
.p-checklist li::before { content: '✓'; color: var(--gold-text); font-weight: 800; flex-shrink: 0; }

.p-toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 20px;
}
.p-toolbar .form-control { max-width: 260px; margin: 0; }
.p-toolbar .spacer { flex: 1; }

.p-two-col {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 26px;
  align-items: start;
}

.p-loading {
  padding: 50px;
  text-align: center;
  color: var(--gray);
  font-size: 0.9rem;
}

/* --- Responsive --- */
@media (max-width: 980px) {
  .dash {
    grid-template-columns: 1fr;
    padding-top: 100px;
  }
  .dash-side { position: static; }
  .dash-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
  }
  .dash-nav button { width: 100%; }
  .dash-nav .dash-nav-sep { display: none; }
  .p-two-col { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .portal-hero { padding: 120px 0 60px; }
  .p-card { padding: 24px 20px; }
  .auth-card { padding: 34px 24px; }
  .cred-pair { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .pay-actions, .p-modal-actions { justify-content: stretch; }
  .pay-actions .btn, .p-modal-actions .btn { flex: 1; justify-content: center; }
}

/* --- Announcements --- */
.p-hint { margin: 6px 0 0; font-size: 0.82rem; color: var(--gray); }
.p-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 20px;
  font-size: 0.9rem;
  cursor: pointer;
}
.p-check input { width: 16px; height: 16px; accent-color: var(--navy); }
.p-note {
  background: var(--off-white);
  border: 1px solid var(--gray-light);
  border-left: 3px solid var(--navy);
  border-radius: 6px;
  padding: 12px 16px;
  margin: 0 0 18px;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-dark);
}
.p-note strong { color: var(--navy-dark); }

/* --- Wide tables become stacked cards on phones ---
   Below 700px a six-column table is a sideways scroll, which hides the one
   thing a school is looking for. Each row becomes a card, with the column
   heading shown beside its value (stamped on by js/responsive-tables.js). */
@media (max-width: 700px) {
  .p-table-wrap { overflow-x: visible; }

  .p-table,
  .p-table tbody,
  .p-table tr,
  .p-table td { display: block; width: auto; }

  .p-table { min-width: 0; font-size: 0.9rem; }

  /* The headings are repeated inside each card, so the header row is redundant. */
  .p-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

  .p-table tbody tr {
    background: var(--white);
    border: 1px solid var(--gray-light);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    padding: 6px 16px;
    margin-bottom: 14px;
  }
  .p-table tbody tr:hover { background: var(--white); }
  .p-table tr:last-child { margin-bottom: 0; }

  /* Label above value, not beside it. A cell here can hold several stacked
     lines — a customer's phone, email and town — and a side-by-side layout
     pushes those off the edge of the screen, which is the problem being fixed. */
  .p-table td {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid var(--off-white);
    text-align: left;
    /* An email address has no space to break at, so let it break anywhere
       rather than push the card off the side of the screen. */
    overflow-wrap: anywhere;
    white-space: normal;
  }
  .p-table tr td:last-child { border-bottom: none; }

  .p-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--gray);
  }
  /* A cell with no heading (an actions column) has nothing to label. */
  .p-table td.cell-actions::before { content: none; }
  .p-table td.cell-actions > div { justify-content: flex-start !important; }
  /* Controls inside a card should use the width they have. */
  .p-table td .form-control { width: 100% !important; max-width: none; }

  /* A row number earns its own line on a wide table, but not inside a card
     where it sits above the name it was only ever numbering. */
  .p-table td[data-label="#"] { display: none; }

  /* A "no rows yet" cell spans the table and has no label to show. */
  .p-table td[colspan] { display: block; text-align: center; }
  .p-table td[colspan]::before { content: none; }
}

/* --- Reassurance at the point of payment --- */
.pay-trust {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--gray-light);
  text-align: center;
}
.pay-trust-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.pay-trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--off-white);
  border: 1px solid var(--gray-light);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dark);
}
.pay-trust p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.65;
  color: var(--gray);
}
.pay-trust a { color: var(--navy); font-weight: 600; }

/* --- Icons in the portal --- */
.dash-nav-icon .icon { width: 17px; height: 17px; }
.p-empty-icon .icon { width: 34px; height: 34px; stroke-width: 1.5; color: var(--gray); }
.p-alert .icon { width: 17px; height: 17px; margin-top: 1px; }
.pay-trust-badge .icon { width: 14px; height: 14px; color: var(--navy); }
.delivery-icon .icon { width: 22px; height: 22px; color: var(--navy); }
.btn .icon { width: 16px; height: 16px; margin-right: 6px; vertical-align: -0.18em; }

/* --- Choosing subjects when buying a mock --- */
.subject-picker {
  border: 1px solid var(--gray-light);
  border-radius: 10px;
  margin: 0 0 18px;
  max-height: 320px;
  overflow-y: auto;
}
.subject-picker-head {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--gray-light);
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 1;
}

.subject-row {
  display: grid;
  grid-template-columns: 18px 1fr 92px 76px;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--off-white);
  cursor: pointer;
}
.subject-row:last-child { border-bottom: none; }
.subject-row:hover { background: var(--off-white); }
.subject-row.is-picked { background: #FBFAF5; }

.subject-row input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--navy);
  cursor: pointer;
}
.subject-name { font-size: 0.9rem; color: var(--text-dark); }
.subject-row.is-picked .subject-name { font-weight: 600; }

.subject-qty {
  margin: 0;
  padding: 7px 10px;
  font-size: 0.85rem;
  text-align: center;
}
.subject-qty:disabled { background: var(--off-white); color: var(--gray-light); }

.subject-line {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--navy-dark);
  text-align: right;
}
.subject-row:not(.is-picked) .subject-line { color: var(--gray-light); font-weight: 500; }

/* Below the school's candidate count — the server will refuse this. */
.subject-row.is-short .subject-qty {
  border-color: #DC2626;
  background: #FEF2F2;
  color: #B91C1C;
}

@media (max-width: 540px) {
  .subject-row {
    grid-template-columns: 18px 1fr 84px;
    grid-template-areas: 'check name qty' '. line line';
    row-gap: 4px;
  }
  .subject-row input[type="checkbox"] { grid-area: check; }
  .subject-name { grid-area: name; }
  .subject-qty  { grid-area: qty; }
  .subject-line { grid-area: line; text-align: left; font-size: 0.78rem; }
}

/* What a school actually ordered — the list the printer works from. */
.order-lines {
  margin-top: 6px;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--text-dark);
}
.order-lines strong { font-family: 'Montserrat', sans-serif; }


/* A phone's address bar eats into 100vh, so a modal sized in vh can still be
   clipped. Where dvh is supported it tracks the space actually visible. */
@media (max-width: 640px) {
  .p-overlay,
  .pay-overlay { padding: 16px; }
  .p-modal,
  .pay-modal { padding: 24px 20px; }
}

/* --- Enquiries --- */
.badge-gold { background: var(--gold-pale); color: var(--gold-text); }

.msg-list { display: flex; flex-direction: column; gap: 14px; }
.msg {
  border: 1px solid var(--gray-light);
  border-radius: 10px;
  padding: 18px 20px;
  background: var(--white);
}
.msg.is-new { border-left: 3px solid var(--gold); background: #FEFDF8; }

.msg-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.msg-head strong { margin-right: 8px; }
.msg-head .badge { margin-right: 6px; }

.msg-meta { font-size: 0.8rem; color: var(--gray); margin-bottom: 12px; }
.msg-meta a { color: var(--navy); }

.msg-body {
  margin: 0 0 14px;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-dark);
  white-space: pre-wrap;
}
.msg-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* --- Confirming a school can be reached --- */
.verify-row {
  border: 1px solid var(--gray-light);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 14px;
}
.verify-row.is-done   { border-color: #BBF7D0; background: #F0FDF4; }
.verify-row.is-failed { border-color: #FECACA; background: #FEF2F2; }

.verify-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}
.verify-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gray);
  display: block;
}
.verify-head strong { font-size: 0.9rem; color: var(--navy-dark); word-break: break-all; }

.verify-state {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--gray);
  white-space: nowrap;
}
.is-done   .verify-state { color: #15803D; }
.is-failed .verify-state { color: #B91C1C; }

.verify-entry { display: flex; gap: 8px; flex-wrap: wrap; }
.verify-entry .form-control {
  margin: 0;
  width: 150px;
  letter-spacing: 4px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  text-align: center;
}
.verify-entry .form-control:disabled { background: transparent; border-style: dashed; }

.link-button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--navy);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

@media (max-width: 540px) {
  .verify-entry .form-control { width: 100%; }
  .verify-entry .btn { flex: 1; }
}

/* --- One code, sent two ways --- */
.verify-sent {
  display: grid;
  gap: 10px;
  background: var(--off-white);
  border: 1px solid var(--gray-light);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 20px;
}
.verify-sent > div { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.verify-sent strong { font-size: 0.88rem; color: var(--navy-dark); word-break: break-all; }
.verify-sent .verify-state { font-size: 0.74rem; color: #15803D; font-weight: 700; }
.verify-sent .verify-state.is-bad { color: #B45309; }
.verify-sent .verify-label { min-width: 96px; }

.code-input {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 10px;
  text-align: center;
  max-width: 240px;
}
.code-input.is-invalid { border-color: #DC2626; background: #FEF2F2; }

.verify-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }

/* Ticking a subject no longer sets a quantity, so the row is simpler. */
.subject-row.is-pick-only { grid-template-columns: 18px 1fr auto; }

/* ── Order cards ──────────────────────────────
   An order has a customer, two contacts, an address, a list of titles, three
   figures and an action. That is a paragraph in three of a table's columns, so
   it scrolled sideways on a normal screen. Each order gets a card instead. */
.order-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: 16px;
}

.order-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--gray-light);
  border-left: 3px solid var(--gray-light);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
/* The left edge carries the status, so the queue is readable at a glance. */
.order-card.status-paid       { border-left-color: #2563EB; }
.order-card.status-processing { border-left-color: var(--gold); }
.order-card.status-dispatched { border-left-color: #7C3AED; }
.order-card.status-delivered  { border-left-color: #15803D; }
.order-card.status-pending    { border-left-color: var(--gray-light); background: var(--off-white); }
.order-card.status-cancelled  { opacity: 0.6; }

.order-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.order-card-head h4 {
  margin: 2px 0 0;
  font-size: 1rem;
  color: var(--navy-dark);
  line-height: 1.3;
}
.order-ref {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--gray);
}

.order-card-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 0.8rem;
  margin-bottom: 10px;
}
.order-card-contact a { color: var(--navy); text-decoration: none; }
.order-card-contact a:hover { text-decoration: underline; }

.order-card-where {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 0.82rem;
  color: var(--text-dark);
  line-height: 1.5;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--off-white);
  margin-bottom: 12px;
}
.order-card-where .icon { width: 16px; height: 16px; color: var(--gray); margin-top: 2px; }
.order-card-where strong { font-weight: 600; }

/* The picking list. */
.order-card-items { list-style: none; margin: 0 0 14px; padding: 0; }
.order-card-items li {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: baseline;
  gap: 10px;
  padding: 4px 0;
  font-size: 0.86rem;
}
.order-card-items .qty {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 0.82rem;
  color: var(--navy-dark);
  text-align: right;
}
.order-card-items .title { color: var(--text-dark); }
.order-card-items .series {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--gray);
}

.order-card-money {
  background: var(--off-white);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 0.82rem;
}
.order-card-money > div { display: flex; justify-content: space-between; padding: 2px 0; }
.order-card-money span { color: var(--gray); }
.order-card-money strong { font-family: 'Montserrat', sans-serif; color: var(--text-dark); }
.order-card-money .total {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--gray-light);
}
.order-card-money .total span { color: var(--navy-dark); font-weight: 600; }
.order-card-money .total strong { color: var(--navy-dark); font-size: 0.95rem; }

.order-card-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.76rem;
}
.order-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.order-card-actions .form-control { margin: 0; flex: 1; min-width: 140px; padding: 8px 12px; font-size: 0.82rem; }
.order-card-actions .btn { white-space: nowrap; }
.order-card-actions .pay-tag { display: inline-flex; align-items: center; }

/* Says how an unpaid order intends to pay, so the office knows which ones
   are waiting on a courier and which on Paystack. */
.pay-tag {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.pay-tag.cash { background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E; }

.order-card-note {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--off-white);
  font-size: 0.76rem;
  color: var(--gray);
}

@media (max-width: 560px) {
  .order-cards { grid-template-columns: 1fr; }
  .order-card { padding: 16px; }
  .order-card-actions .btn { width: 100%; }
}

/* What the print room is being asked to produce. */
.order-card-print {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--navy);
  color: var(--white);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
}
.order-card-print-head { font-size: 0.84rem; font-weight: 600; }
.order-card-print strong {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.8rem;
  color: var(--gold-light);
  white-space: nowrap;
}

/* Wide tables that only just overflow: tighter cells buy back the difference
   so Orders and Schools stop scrolling sideways on a laptop. */
.p-table th, .p-table td { padding-left: 10px; padding-right: 10px; }
.p-table td .muted { line-height: 1.45; }

/* A heading was never allowed to wrap, so "Membership ID" claimed 128px to
   label an eight-character value and pushed the table past its container.
   Two short lines cost nothing and keep the full wording. */
.p-table th { white-space: normal; line-height: 1.35; }
.p-table th.nowrap { white-space: nowrap; }

/* Four actions on a school row (Orders, Edit, Reset PIN, Suspend) were laid out
   in one line and pushed the table wider than its container. Capped so they
   wrap onto a second line instead. */
#adSchools .p-table td:last-child > div { max-width: 186px; margin-left: auto; }

/* ── Mock cards ───────────────────────────────
   A name and four dates per mock is a form. As a table row it ran to 1251px
   inside a 794px panel, so every date had to be scrolled to. */
.mock-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.mock-card {
  background: var(--white);
  border: 1px solid var(--gray-light);
  border-left: 3px solid var(--gray-light);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.mock-card.status-available { border-left-color: #15803D; }
.mock-card.status-upcoming  { border-left-color: var(--gold); }
.mock-card.status-closed    { border-left-color: var(--gray-light); background: var(--off-white); }

.mock-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.mock-number {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--navy-dark);
}

.mock-field { display: block; margin-bottom: 16px; }
.mock-field > span,
.mock-dates-title {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 6px;
}
.mock-field .form-control { margin: 0; }

.mock-dates { display: grid; gap: 14px; margin-bottom: 16px; }
.mock-date-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mock-date-pair label { display: block; }
.mock-date-pair label > span {
  display: block;
  font-size: 0.7rem;
  color: var(--gray);
  margin-bottom: 3px;
}
.mock-date-pair .form-control {
  margin: 0;
  padding: 8px 10px;
  font-size: 0.82rem;
  width: 100%;
}

.mock-card-foot { display: flex; justify-content: flex-end; }

@media (max-width: 480px) {
  .mock-cards { grid-template-columns: 1fr; }
  .mock-date-pair { grid-template-columns: 1fr; }
}

/* --- Removing an unconfirmed school --- */
.btn-danger {
  background: #B91C1C;
  border-color: #B91C1C;
  color: var(--white);
}
.btn-danger:hover { background: #991B1B; border-color: #991B1B; color: var(--white); }
.btn-danger:disabled { opacity: 0.6; cursor: default; }

.btn-danger-ghost {
  background: transparent;
  border-color: #FECACA;
  color: #B91C1C;
}
.btn-danger-ghost:hover { background: #FEF2F2; border-color: #B91C1C; color: #991B1B; }

.remove-summary {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-left: 3px solid #B91C1C;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 0 0 14px;
  font-size: 0.84rem;
  color: var(--text-dark);
  word-break: break-word;
}
.remove-summary strong { font-size: 0.95rem; color: var(--navy-dark); }
.remove-summary span { color: var(--gray); }

/* Taking cash is not a deletion, so the same block is shown in green there —
   red would read as a warning about the money rather than a confirmation. */
.remove-summary.money { background: #F0FDF4; border-color: #BBF7D0; border-left-color: #15803D; }

/* --- Confirming an order status change --- */
.status-change {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 12px;
}
.status-arrow { color: var(--gray); font-size: 1.1rem; }

.status-note {
  font-size: 0.86rem;
  line-height: 1.6;
  padding: 10px 14px;
  border-radius: 8px;
  margin: 0 0 12px;
}
.status-note.sends  { background: #EFF6FF; color: #1E3A8A; border: 1px solid #BFDBFE; }
.status-note.silent { background: var(--off-white); color: var(--gray); border: 1px solid var(--gray-light); }
.status-note.warn   { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }

/* ═══ GALLERY (admin) ══════════════════════════════════════════════════════
   Albums of event photographs. Pictures are resized in the browser before
   they are uploaded, so this panel does the waiting, not the server. */
.gal-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}
.gal-admin-card {
  border: 1px solid #E5E8EE;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.gal-admin-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(22,35,61,0.14); border-color: #D6DBE4; }
.gal-admin-card.draft { border-style: dashed; }

.gal-admin-cover { position: relative; aspect-ratio: 4/3; background: #EEF0F4; }
.gal-admin-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gal-admin-cover-empty {
  display: grid; place-items: center; height: 100%;
  font-family: 'Montserrat', sans-serif; font-size: 0.8rem; color: #9CA3AF;
}
.gal-admin-status {
  position: absolute; top: 10px; right: 10px;
  padding: 4px 10px; border-radius: 999px;
  font-family: 'Montserrat', sans-serif; font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.gal-admin-status.published { background: #DCFCE7; color: #15803D; }
.gal-admin-status.draft { background: #F3F4F6; color: #6B7280; }

.gal-admin-body { padding: 12px 14px 14px; }
.gal-admin-body h4 { margin: 0 0 4px; font-size: 0.98rem; color: var(--navy-dark); line-height: 1.3; }
.gal-admin-meta { font-family: 'Montserrat', sans-serif; font-size: 0.76rem; color: var(--gray); }
.gal-admin-counts {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px;
  font-family: 'Montserrat', sans-serif; font-size: 0.72rem; color: #6B7280;
}
.gal-admin-cat { padding: 2px 8px; border-radius: 999px; background: var(--gold-pale); color: var(--gold-text); font-weight: 600; }

/* ── Editing one album ── */
.gal-edit-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 4px; }
.gal-edit-head h3 { margin: 0; }
.gal-edit-head p { margin: 4px 0 0; font-size: 0.84rem; color: var(--gray); }
.gal-edit-head .gal-admin-status { position: static; }

.gal-drop {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 26px 20px;
  margin: 16px 0 12px;
  border: 2px dashed #D6DBE4;
  border-radius: 14px;
  background: #FAFBFC;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
}
.gal-drop:hover, .gal-drop.over { border-color: var(--gold); background: #FFFDF7; }
.gal-drop:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.gal-drop .icon { width: 26px; height: 26px; color: var(--gold); }
.gal-drop strong { font-size: 0.92rem; color: var(--navy-dark); }
.gal-drop span { font-size: 0.78rem; color: var(--gray); max-width: 380px; line-height: 1.5; }

.gal-progress {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #EEF4FF;
  border: 1px solid #D8E4FF;
  font-family: 'Montserrat', sans-serif; font-size: 0.82rem; color: #1E3A8A;
}

.gal-video-add { display: flex; gap: 10px; margin-bottom: 16px; }
.gal-video-add .form-control { margin: 0; flex: 1; }
.gal-video-add .btn { white-space: nowrap; }

.gal-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  max-height: 46vh;
  overflow-y: auto;
  padding: 2px;
}
.gal-items-empty { grid-column: 1 / -1; text-align: center; color: var(--gray); font-size: 0.86rem; padding: 18px; }

.gal-item {
  position: relative;
  margin: 0;
  border: 1px solid #E5E8EE;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  cursor: grab;
}
.gal-item.dragging { opacity: 0.45; }
.gal-item img { width: 100%; height: 104px; object-fit: cover; display: block; }
.gal-item-video, .gal-item-cover {
  position: absolute; top: 8px;
  padding: 3px 8px; border-radius: 6px;
  font-family: 'Montserrat', sans-serif; font-size: 0.66rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.gal-item-video { left: 8px; background: rgba(12,19,35,0.78); color: #fff; }
.gal-item-cover { right: 8px; background: var(--gold); color: var(--navy-dark); }

.gal-item-caption {
  width: 100%;
  border: 0; border-top: 1px solid #EEF0F4;
  padding: 8px 10px;
  font-size: 0.78rem; color: var(--navy-dark);
  background: #fff;
}
.gal-item-caption:focus { outline: 0; background: #FFFDF7; }
.gal-item-caption.saved { background: #F0FDF4; }

.gal-item-tools { display: flex; border-top: 1px solid #EEF0F4; }
.gal-item-tools button {
  flex: 1;
  border: 0; background: none;
  padding: 7px 4px;
  font-family: 'Montserrat', sans-serif; font-size: 0.72rem; font-weight: 600;
  color: var(--gray); cursor: pointer;
}
.gal-item-tools button:hover { background: #F7F8FA; color: var(--navy-dark); }
.gal-item-tools button + button { border-left: 1px solid #EEF0F4; }
.gal-item-tools button[data-remove]:hover { color: #B91C1C; }

/* Publishing is gated on this, so it is a statement rather than a tick-box. */
.gal-permission {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0 4px;
  padding: 12px 14px;
  border: 1px solid #E6DCC0;
  border-radius: 10px;
  background: #FAF7EE;
  font-size: 0.85rem;
  color: var(--navy-dark);
  line-height: 1.5;
  cursor: pointer;
}
.gal-permission input { margin-top: 2px; width: 18px; height: 18px; flex: 0 0 18px; }

.gal-edit-actions { justify-content: flex-end; }
.gal-edit-actions .btn-danger-text { margin-right: auto; color: #B91C1C; }
.gal-edit-actions .btn-danger-text:hover { background: #FEF2F2; }

@media (max-width: 640px) {
  .gal-items { grid-template-columns: repeat(2, 1fr); max-height: 40vh; }
  .gal-video-add { flex-direction: column; }
  .gal-edit-actions { flex-wrap: wrap; }
  .gal-edit-actions .btn-danger-text { margin-right: 0; order: 3; width: 100%; }
}


/* ═══ FORGOT PIN ═══════════════════════════════════════════════════════════
   Three short steps inside the login card: which school, the code, the new
   PIN. The sign-in form steps aside while it is open. */
.forgot-link {
  display: block;
  margin: 14px auto 0;
  padding: 8px 4px;
  min-height: 40px;
}
.link-button {
  border: 0; background: none; padding: 4px 2px;
  color: var(--navy); font-size: 0.86rem; font-weight: 700;
  text-decoration: underline; cursor: pointer;
}
.link-button:hover { color: var(--gold-text, #8A6D1F); }
.link-button:disabled { color: #9CA3AF; cursor: default; text-decoration: none; }

.reset-steps {
  display: flex;
  gap: 6px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.reset-steps li {
  flex: 1;
  padding: 8px 6px;
  border-radius: 8px;
  background: #F3F4F6;
  color: #9CA3AF;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
  text-align: center;
  counter-increment: step;
}
.reset-steps li::before { content: counter(step) '. '; }
.reset-steps li.current { background: var(--navy); color: #fff; }
.reset-steps li.done { background: #DCFCE7; color: #15803D; }

.reset-step[hidden], #resetView[hidden], #signInView[hidden] { display: none !important; }
.reset-lead { margin: 0 0 16px; font-size: 0.88rem; line-height: 1.6; color: var(--gray); text-align: left; }
.reset-help { margin: 16px 0 0; font-size: 0.8rem; line-height: 1.7; color: var(--gray); text-align: left; }
.reset-help a { color: var(--navy); font-weight: 700; }
.reset-back { display: block; margin: 18px auto 0; }


/* ═══ SWITCHES ════════════════════════════════════════════════════════════
   How the site behaves, in the console rather than in the database. */
.switch-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #EEF0F4;
  cursor: pointer;
}
.switch-row:last-of-type { border-bottom: 0; }
.switch-row input { margin-top: 3px; width: 20px; height: 20px; flex: 0 0 20px; cursor: pointer; }
.switch-row strong { display: block; font-size: 0.95rem; color: var(--navy-dark); margin-bottom: 3px; }
.switch-row .muted { display: block; font-size: 0.82rem; line-height: 1.55; }

/* ═══ THE SHOP (admin) ═════════════════════════════════════════════════════
   Products as cards, because a cover is the fastest way to recognise one. */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.shop-card {
  border: 1px solid #E5E8EE;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.shop-card:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(22,35,61,0.13); border-color: #D6DBE4; }
.shop-card.off { opacity: 0.62; border-style: dashed; }

.shop-card-cover {
  position: relative;
  aspect-ratio: 4/3;
  background: #F4F6F9;
  display: grid;
  place-items: center;
}
.shop-card-cover img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.shop-card-nocover { font-family: 'Montserrat', sans-serif; font-size: 0.76rem; color: #9CA3AF; }
.shop-tag.off {
  position: absolute; top: 8px; right: 8px;
  padding: 3px 9px; border-radius: 999px;
  background: rgba(17,24,39,0.78); color: #fff;
  font-family: 'Montserrat', sans-serif; font-size: 0.66rem; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
}

.shop-card-body { padding: 10px 12px 12px; }
.shop-card-body h4 { margin: 0 0 4px; font-size: 0.9rem; line-height: 1.3; color: var(--navy-dark); }
.shop-card-price { font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 0.86rem; color: var(--navy); }
.shop-card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.shop-card-tags .badge { font-size: 0.64rem; }

/* Adding a picture or a file, in the product form. */
.shop-upload {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 2px dashed #D6DBE4;
  border-radius: 12px;
  background: #FAFBFC;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.shop-upload:hover { border-color: var(--gold); background: #FFFDF7; }
.shop-upload:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.shop-upload strong { display: block; font-size: 0.9rem; color: var(--navy-dark); }
.shop-upload span { display: block; font-size: 0.78rem; color: var(--gray); line-height: 1.5; }
.shop-upload-preview {
  width: 64px; height: 64px; flex: 0 0 64px;
  object-fit: contain; background: #fff;
  border: 1px solid #E5E8EE; border-radius: 8px;
}

.shop-progress {
  margin: 12px 0 0;
  padding: 9px 12px;
  border-radius: 8px;
  background: #EEF4FF;
  border: 1px solid #D8E4FF;
  font-family: 'Montserrat', sans-serif; font-size: 0.8rem; color: #1E3A8A;
}
.btn-danger-text { color: #B91C1C; }
.btn-danger-text:hover { background: #FEF2F2; }

/* --- Members' materials (portal) --- */
.material-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: 16px;
}
.material-card {
  display: flex;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--gray-light);
  border-radius: 12px;
  background: var(--white);
  transition: box-shadow 0.22s ease, transform 0.22s ease;
}
.material-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.material-cover {
  flex: 0 0 84px;
  width: 84px; height: 112px;
  border-radius: 8px; overflow: hidden;
  background: #F4F6FA;
  display: flex; align-items: center; justify-content: center;
}
.material-cover img { width: 100%; height: 100%; object-fit: cover; }
.material-nocover { color: #B6BECD; }
.material-nocover .icon { width: 30px; height: 30px; stroke-width: 1.4; }
.material-body {
  display: flex; flex-direction: column; gap: 6px;
  flex: 1; min-width: 0;
}
.material-kind {
  align-self: flex-start;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--navy); background: #EEF2FA;
  padding: 3px 8px; border-radius: 20px;
}
.material-body h3 { font-size: 0.95rem; margin: 0; color: var(--navy-dark); line-height: 1.35; }
.material-body p {
  margin: 0; font-size: 0.8rem; color: var(--gray); line-height: 1.5;
  /* Long blurbs are trimmed so a shelf of cards keeps one height. */
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.material-foot {
  margin-top: auto; padding-top: 10px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
}
.material-price { font-family: 'Montserrat', sans-serif; font-weight: 700; color: var(--navy-dark); font-size: 0.88rem; }
.material-note {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.72rem; color: #15803D;
}

/* ═══ SEGMENTED VIEWS ══════════════════════════════════════════════════════
   Two or three jobs that belong on one page but not on top of each other:
   school orders and book orders, or the shop's products, categories and
   prices. One switch, and only the chosen view is in the document flow. */
.p-segments {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  padding: 5px;
  background: var(--white);
  border: 1px solid var(--gray-light);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
.p-segments button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--gray);
  transition: background 0.18s ease, color 0.18s ease;
}
.p-segments button:hover { background: var(--off-white); color: var(--navy-dark); }
.p-segments button.active { background: var(--navy); color: #fff; }
.p-segments button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.p-segment-count {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--off-white);
  color: var(--gray);
}
.p-segments button.active .p-segment-count { background: rgba(255,255,255,0.18); color: #fff; }
.p-segments button:empty { display: none; }

.p-view { display: none; }
.p-view.active { display: block; }

/* ═══ DELIVERY QUEUE ═══════════════════════════════════════════════════════
   Grouped by what has to happen next, so the queue reads as a worklist. */
.delivery-stage + .delivery-stage { margin-top: 30px; }
.delivery-stage-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}
.delivery-stage-head h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--navy-dark);
}
.delivery-stage-head .count {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--gray);
  background: var(--white);
  border: 1px solid var(--gray-light);
  border-radius: 20px;
  padding: 2px 9px;
}
.delivery-stage-head .note { font-size: 0.8rem; color: var(--gray); }

/* Which side of the business an order came from. */
.order-source {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 20px;
}
.order-source.school { background: #EEF2FA; color: var(--navy); }
.order-source.books  { background: #FDF6E6; color: #8A6212; }
.order-card-head .order-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ═══ CORE PRICES ══════════════════════════════════════════════════════════ */
.price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}
.price-tile {
  border: 1px solid var(--gray-light);
  border-radius: 12px;
  padding: 18px 20px;
  background: var(--off-white);
}
.price-tile label {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 10px;
}
.price-tile-input { display: flex; align-items: center; gap: 8px; }
.price-tile-input .cedi {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  color: var(--navy-dark);
}
.price-tile-input .form-control {
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--navy-dark);
  padding: 10px 12px;
}
.price-tile .note { display: block; font-size: 0.78rem; color: var(--gray); margin-top: 10px; line-height: 1.5; }

/* ═══ CATEGORY ROWS ════════════════════════════════════════════════════════ */
.cat-rows { display: flex; flex-direction: column; gap: 12px; }
.cat-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) auto auto auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--gray-light);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--white);
}
.cat-row.off { background: var(--off-white); }
.cat-row .form-control { margin: 0; }
.cat-row-count {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gray);
  white-space: nowrap;
}
.cat-row-price { display: flex; align-items: center; gap: 6px; }
.cat-row-price .form-control { width: 96px; }
.cat-row-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ═══ PAYMENTS ═════════════════════════════════════════════════════════════ */
.pay-total-note { font-size: 0.78rem; color: var(--gray); margin-top: 4px; }
.p-table td .pay-ref {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.72rem;
  color: var(--gray);
  letter-spacing: 0.02em;
}
.p-table-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 16px;
  margin-top: 4px;
  border-top: 1px solid var(--gray-light);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.82rem;
  color: var(--gray);
}
.p-table-foot strong { color: var(--navy-dark); font-size: 1rem; }

@media (max-width: 720px) {
  .cat-row { grid-template-columns: 1fr; }
  .cat-row-actions { justify-content: flex-start; }
  .p-segments button { flex: 1; justify-content: center; padding: 10px 12px; }
}

/* Shelves inside the shop panel. */
.shop-shelf + .shop-shelf { margin-top: 26px; }
.shop-shelf-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}
.shop-shelf-head h4 {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--navy-dark);
}
.shop-shelf-head .count {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--gray);
  background: var(--off-white);
  border-radius: 20px;
  padding: 2px 9px;
}
.cat-row-shown .form-control { width: 120px; margin: 0; }

/* A table row should stay one line tall wherever it can. */
.p-table .num { white-space: nowrap; }
.p-table .cell-item { min-width: 240px; }
.p-table .cell-title { font-weight: 600; color: var(--navy-dark); }
.p-table .order-lines { color: var(--gray); }

/* --- The profile's own editable card --- */
.p-card-inset {
  padding: 24px;
  box-shadow: none;
  background: var(--off-white);
}
.p-card-inset .p-card-head { margin-bottom: 18px; padding-bottom: 14px; }
.form-help {
  display: block;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--gray);
  line-height: 1.5;
}

/* Where an order is going, shown while it is still being placed. */
.order-where {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0 4px;
  padding: 14px 16px;
  border: 1px solid var(--gray-light);
  border-radius: 10px;
  background: var(--off-white);
}
.order-where .icon { width: 20px; height: 20px; color: var(--navy); flex: 0 0 20px; }
.order-where > div { flex: 1; min-width: 180px; }
.order-where-label {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--gray);
}
.order-where strong { display: block; font-size: 0.9rem; color: var(--navy-dark); line-height: 1.4; }
.order-where .muted { font-size: 0.8rem; }

/* --- Take-up during a purchase window --- */
.take-up-bar {
  height: 10px;
  border-radius: 20px;
  background: var(--gray-light);
  overflow: hidden;
}
.take-up-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--navy), var(--gold));
  border-radius: 20px;
  transition: width 0.4s ease;
}
.take-up-count {
  margin-top: 10px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.86rem;
  color: var(--gray);
}
.take-up-count strong { color: var(--navy-dark); font-size: 1.05rem; }
.take-up-list { margin-top: 14px; }
.take-up-list summary {
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--navy);
  padding: 8px 0;
}
.take-up-list ul { list-style: none; margin: 8px 0 0; padding: 0; }
.take-up-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid var(--gray-light);
  border-radius: 10px;
  margin-bottom: 8px;
  font-size: 0.86rem;
}
.take-up-list li .title { font-weight: 600; color: var(--navy-dark); flex: 1; min-width: 160px; }
.take-up-list li a { color: var(--navy); text-decoration: none; }
.take-up-list li a:hover { text-decoration: underline; }

/* --- A receipt a school can print --- */
.receipt { font-family: 'Montserrat', sans-serif; color: var(--navy-dark); }
.receipt-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--navy);
  margin-bottom: 20px;
}
.receipt-head strong { display: block; font-size: 1.05rem; }
.receipt-head span { display: block; font-size: 0.78rem; color: var(--gray); margin-top: 4px; }
.receipt-stamp {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold-text);
  border: 2px solid var(--gold);
  border-radius: 6px;
  padding: 6px 12px;
}
.receipt-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px 20px;
  margin-bottom: 22px;
}
.receipt-meta span {
  display: block;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gray);
}
.receipt-meta strong { font-size: 0.9rem; }
.receipt-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.receipt-table th {
  text-align: left;
  font-size: 0.64rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gray);
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-light);
}
.receipt-table td { padding: 10px 0; border-bottom: 1px solid var(--off-white); }
.receipt-table .num { text-align: right; white-space: nowrap; }
.receipt-table .receipt-sub { padding-left: 16px; color: var(--gray); font-size: 0.82rem; }
.receipt-table tfoot th { font-size: 1rem; color: var(--navy-dark); border-top: 2px solid var(--navy); border-bottom: 0; padding-top: 14px; }
.receipt-note { margin-top: 20px; font-size: 0.78rem; color: var(--gray); line-height: 1.6; }

/* Printing a receipt prints the receipt, not the dashboard behind it. */
@media print {
  body * { visibility: hidden; }
  .receipt-overlay, .receipt-overlay * { visibility: visible; }
  .receipt-overlay {
    position: absolute;
    inset: 0;
    display: block;
    background: #fff;
    padding: 0;
  }
  .receipt-overlay .p-modal {
    box-shadow: none;
    border: 0;
    max-width: none;
    width: 100%;
    max-height: none;
    padding: 0;
  }
  .no-print { display: none !important; }
}

/* The receipt carries the mark, and prints it: a browser drops background
   images from a print by default, so it is an <img> rather than a background. */
.receipt-name { display: flex; align-items: center; gap: 14px; }
.receipt-logo { width: 54px; height: 54px; object-fit: contain; flex: 0 0 54px; }
@media print {
  .receipt-logo { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
