:root {
  --navy: #16233F;
  --navy-deep: #0E1830;
  --gold: #C9A24B;
  --gold-soft: #E8D9B5;
  --paper: #F6F5F1;
  --ink: #1E2230;
  --ink-soft: #5B6072;
  --line: #DFDCD2;
  --green: #2E7D50;
  --red: #B3413A;
  --radius: 10px;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0 0 0.4em; }

/* ---------- Top bar ---------- */
.topbar {
  background: var(--navy-deep);
  border-bottom: 3px solid var(--gold);
}
.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.brand-mark {
  width: 34px; height: 34px;
  background: var(--gold);
  color: var(--navy-deep);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
}
.brand-name { font-family: var(--font-display); font-size: 19px; font-weight: 600; letter-spacing: 0.2px; }

.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { color: #D9DCE6; font-size: 14.5px; font-weight: 500; }
.nav-links a:hover { color: #fff; }
.nav-cta {
  background: var(--gold);
  color: var(--navy-deep) !important;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600 !important;
}
.nav-cta:hover { background: var(--gold-soft); }

/* ---------- Flash messages ---------- */
.flash-container { max-width: 1120px; margin: 16px auto 0; padding: 0 24px; }
.flash {
  padding: 12px 16px; border-radius: var(--radius); margin-bottom: 10px;
  font-size: 14.5px; border: 1px solid var(--line);
}
.flash-success { background: #EAF5EE; border-color: #BEE0CB; color: #245C3A; }
.flash-error, .flash-danger { background: #FBEAE8; border-color: #EBC0BB; color: #8C2E27; }
.flash-info { background: #EAF1FB; border-color: #C2D6F2; color: #234878; }

/* ---------- Layout helpers ---------- */
.container { max-width: 1120px; margin: 0 auto; padding: 40px 24px 80px; }
.narrow { max-width: 460px; margin: 0 auto; padding: 60px 24px 100px; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #fff;
  padding: 64px 24px 56px;
}
.hero-inner { max-width: 1120px; margin: 0 auto; }
.hero-eyebrow {
  color: var(--gold-soft); text-transform: uppercase; letter-spacing: 1.5px;
  font-size: 12.5px; font-weight: 600; margin-bottom: 14px;
}
.hero h1 { font-size: 40px; max-width: 640px; color: #fff; }
.hero p { color: #C3C8D6; max-width: 560px; font-size: 16.5px; }

/* ---------- Hostel grid ---------- */
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 20px; }
.section-title h2 { font-size: 24px; }
.hostel-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px;
}
.hostel-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: transform .15s ease, box-shadow .15s ease;
}
.hostel-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(22,35,63,0.08); }
.hostel-card-img {
  height: 140px; background: linear-gradient(135deg, var(--navy), #2C3F66);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-soft); font-family: var(--font-display); font-size: 15px; letter-spacing: .5px;
}
.hostel-card-body { padding: 18px; }
.hostel-card-body h3 { font-size: 18px; margin-bottom: 4px; }
.hostel-meta { color: var(--ink-soft); font-size: 13.5px; margin-bottom: 10px; }
.badge {
  display: inline-block; font-size: 11.5px; font-weight: 600; padding: 3px 9px;
  border-radius: 999px; background: var(--gold-soft); color: #6B5320; text-transform: uppercase;
  letter-spacing: .4px;
}
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--ink-soft);
  border: 1px dashed var(--line); border-radius: var(--radius); background: #fff;
}

/* ---------- Room list ---------- */
.hostel-header { margin-bottom: 28px; }
.hostel-header h1 { font-size: 30px; }
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.room-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
}
.room-card h3 { font-size: 17px; margin-bottom: 2px; }
.room-price { font-family: var(--font-display); font-size: 22px; color: var(--navy); margin: 10px 0 4px; }
.room-price span { font-size: 13px; color: var(--ink-soft); font-family: var(--font-body); }
.room-slots { font-size: 13.5px; color: var(--ink-soft); margin-bottom: 14px; }
.slots-full { color: var(--red); font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--navy); color: #fff; border: none; border-radius: 8px;
  padding: 11px 20px; font-size: 14.5px; font-weight: 600; cursor: pointer;
  font-family: var(--font-body); transition: background .15s ease;
}
.btn:hover { background: var(--navy-deep); }
.btn:disabled { background: #B7BAC4; cursor: not-allowed; }
.btn-gold { background: var(--gold); color: var(--navy-deep); }
.btn-gold:hover { background: #B48F3C; }
.btn-outline { background: transparent; color: var(--navy); border: 1.5px solid var(--navy); }
.btn-outline:hover { background: var(--navy); color: #fff; }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #8C2E27; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 13px; font-size: 13px; }

/* ---------- Forms ---------- */
.form-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 32px;
}
.form-card h1 { font-size: 26px; margin-bottom: 6px; }
.form-sub { color: var(--ink-soft); font-size: 14.5px; margin-bottom: 24px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px;
  font-size: 14.5px; font-family: var(--font-body); background: #FCFBF9;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--navy); background: #fff;
}
.form-error { color: var(--red); font-size: 13.5px; margin-bottom: 14px; display: none; }
.form-foot { text-align: center; font-size: 14px; color: var(--ink-soft); margin-top: 18px; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 12px 14px; font-size: 14px; border-bottom: 1px solid var(--line); }
th { background: #F0EEE7; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; font-size: 11.5px; letter-spacing: .4px; }
tr:last-child td { border-bottom: none; }

.status-pill { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.status-confirmed { background: #EAF5EE; color: #245C3A; }
.status-pending_payment { background: #FDF2E0; color: #8A5A0B; }
.status-cancelled, .status-rejected { background: #FBEAE8; color: #8C2E27; }

/* ---------- Admin dashboard ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 34px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.stat-card .num { font-family: var(--font-display); font-size: 28px; color: var(--navy); }
.stat-card .label { font-size: 13px; color: var(--ink-soft); }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card + .card { margin-top: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }

.grid-2 { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }

.mini-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.mini-form .field.full { grid-column: 1 / -1; }

.footer-note { font-size: 13px; color: var(--ink-soft); }
.site-footer { text-align: center; padding: 26px; color: var(--ink-soft); font-size: 13px; border-top: 1px solid var(--line); }

.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14.5px;
}
.list-plain li:last-child { border-bottom: none; }

/* ================= Portal shell (sidebar layout) ================= */
:root {
  --portal-teal: #5EC1C6;
  --portal-teal-deep: #4AA9AE;
  --portal-green: #8CA83E;
  --portal-green-deep: #6E8A2E;
  --portal-blue: #2D9CDB;
  --portal-warn: #E2574C;
  --portal-ink: #33393F;
  --portal-ink-soft: #6B7178;
  --portal-bg: #F3F4F1;
  --portal-line: #E3E5DE;
}

.portal-shell { min-height: 100vh; display: flex; flex-direction: column; background: var(--portal-bg); }

.portal-topbar {
  background: var(--portal-teal);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 18px;
  height: 54px;
  position: sticky; top: 0; z-index: 20;
}
.portal-topbar .menu-toggle {
  background: none; border: none; color: #fff; font-size: 20px; cursor: pointer;
  display: none; margin-right: 12px;
}
.portal-topbar-title {
  flex: 1; text-align: center; font-family: var(--font-display); font-weight: 600; font-size: 19px;
}
.portal-topbar-title strong { font-weight: 700; }
.portal-topbar-right { display: flex; align-items: center; gap: 14px; font-size: 13px; }
.portal-avatar {
  width: 28px; height: 28px; border-radius: 50%; background: #fff; color: var(--portal-teal-deep);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px;
}

.portal-body { display: flex; flex: 1; min-height: 0; }

.portal-sidebar {
  width: 250px; flex-shrink: 0;
  background: linear-gradient(180deg, var(--portal-green) 0%, var(--portal-green-deep) 100%);
  color: #fff;
  padding-bottom: 30px;
}
.portal-user-card {
  padding: 20px 18px; display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.18);
}
.portal-user-avatar {
  width: 44px; height: 44px; border-radius: 50%; background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; color: var(--portal-green-deep); font-size: 16px;
}
.portal-user-name { font-weight: 700; font-size: 14.5px; line-height: 1.3; }
.portal-user-status { font-size: 12px; display: flex; align-items: center; gap: 5px; opacity: 0.9; }
.portal-user-status .dot { width: 7px; height: 7px; border-radius: 50%; background: #7CFC90; display: inline-block; }

.portal-nav-label {
  font-size: 11px; letter-spacing: 0.6px; text-transform: uppercase; opacity: 0.75;
  padding: 16px 18px 6px;
}
.portal-nav { list-style: none; margin: 0; padding: 0; }
.portal-nav a, .portal-nav .portal-nav-parent {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px; color: #fff; font-size: 14px; font-weight: 500;
  opacity: 0.92; cursor: pointer;
}
.portal-nav a:hover, .portal-nav .portal-nav-parent:hover { background: rgba(255,255,255,0.1); }
.portal-nav .active > a, .portal-nav a.active { background: rgba(255,255,255,0.16); opacity: 1; font-weight: 700; }
.portal-nav-icon { width: 18px; text-align: center; opacity: 0.9; }
.portal-subnav { list-style: none; margin: 0; padding: 0 0 6px 0; background: rgba(0,0,0,0.08); }
.portal-subnav a { padding-left: 46px; font-size: 13.5px; font-weight: 400; }

.portal-main { flex: 1; min-width: 0; padding: 26px 30px 60px; }
.portal-page-title { font-size: 26px; margin: 0 0 8px; font-family: var(--font-display); color: var(--portal-ink); }
.portal-breadcrumb {
  background: #E7E8E3; color: var(--portal-ink-soft); font-size: 13px;
  padding: 9px 14px; border-radius: 4px; margin-bottom: 20px;
}
.portal-breadcrumb .sep { margin: 0 6px; }
.portal-breadcrumb .current { color: var(--portal-ink-soft); }

.portal-card {
  background: #fff; border-radius: 4px; border-top: 3px solid var(--portal-blue);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.portal-card-head { padding: 16px 20px; font-size: 16.5px; font-weight: 600; border-bottom: 1px solid var(--portal-line); color: var(--portal-ink); }
.portal-card-body { padding: 20px; }

.pay-banner {
  position: relative;
  left: 100%;
  width: max-content;
  background: var(--portal-warn); color: #fff; font-weight: 700; font-size: 13.5px;
  letter-spacing: 0.3px; padding: 7px 13px; border-radius: 0 0 0 5px; text-transform: uppercase;
  white-space: nowrap;
  animation: pay-banner-marquee 11s linear infinite;
}

.pay-banner-marquee {
  width: 100%;
  margin-bottom: 20px;
  overflow: hidden;
}

@keyframes pay-banner-marquee {
  from { left: 100%; transform: translateX(0); }
  to { left: 0; transform: translateX(-100%); }
}

@media (prefers-reduced-motion: reduce) {
  .pay-banner {
    left: 50%;
    transform: translateX(-50%);
    animation: none;
  }
}

.portal-subheading { font-size: 17px; font-weight: 500; color: var(--portal-ink); margin: 4px 0 14px; }
.fee-row { font-size: 14.5px; color: var(--portal-ink); margin-bottom: 12px; }
.fee-row .fee-amount { color: var(--portal-warn); font-weight: 700; margin-left: 4px; }

.hostel-select {
  width: 220px; padding: 8px 10px; border: 1px solid #B9BDB2; border-radius: 3px;
  font-size: 14px; margin-bottom: 18px; background: #fff;
}

.spaces-heading { font-size: 15.5px; font-weight: 500; color: var(--portal-ink); padding-bottom: 10px; border-bottom: 1px solid var(--portal-line); margin-bottom: 16px; }

.space-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 20px 16px; }
.space-item { padding-bottom: 14px; border-bottom: 1px solid var(--portal-line); }
.space-item input[type="radio"] { width: 16px; height: 16px; margin-bottom: 10px; accent-color: var(--portal-blue); display: block; }
.space-label {
  margin-bottom: 3px;
  color: #008b00;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}
.space-detail {
  margin-bottom: 2px;
  color: #0000e8;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}
.space-detail b { color: #4169e1; font-weight: 700; }
.space-cost b { color: #008b00; font-weight: 700; }

.no-vacancy { color: var(--portal-warn); font-weight: 600; font-size: 14.5px; margin: 10px 0 20px; }

.book-space-btn {
  border: 1.5px solid var(--portal-blue); color: #1E8449; background: #fff;
  font-weight: 600; padding: 9px 26px; border-radius: 3px; cursor: pointer; font-size: 14.5px;
  margin-top: 6px;
}
.book-space-btn:hover { background: #F3FAF6; }
.book-space-btn:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 880px) {
  .portal-sidebar { position: fixed; left: -260px; top: 54px; bottom: 0; z-index: 30; transition: left .2s ease; overflow-y: auto; }
  .portal-sidebar.open { left: 0; }
  .portal-topbar .menu-toggle { display: inline-block; }
  .portal-main { padding: 18px 16px 50px; }
}

/* Fee-payment step shown after a student selects a hostel space. */
.payment-card { border-top-color: #e34b3d; }
.payment-form-body { padding: 16px 38px 36px; }
.payment-form-body form { max-width: 930px; margin: 0 auto; }
.payment-form-row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: center;
  gap: 22px;
  margin-bottom: 22px;
}
.payment-form-row label { font-weight: 700; text-align: right; }
.payment-form-row input {
  width: 100%;
  height: 42px;
  padding: 8px 14px;
  border: 1px solid #ccd3dc;
  background: #fff;
  color: #333;
  font: inherit;
}
.payment-form-row input[readonly] { background: #eee; }
.payment-pay-btn {
  display: block;
  margin: 30px 0 0 205px;
  padding: 9px 18px;
  border: 0;
  background: #3b9b73;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}
.payment-pay-btn:disabled { opacity: .65; cursor: wait; }
.payment-form-error { display: none; margin: 0 auto 18px; max-width: 930px; }

/* Standalone provider-style payment-mode screen. */
.checkout-page {
  min-height: 100vh;
  margin: 0;
  background: #f7f9fc;
  color: #102342;
  font-family: Arial, Helvetica, sans-serif;
}
.pesaflow-checkout { width: min(1020px, calc(100% - 40px)); margin: 0 auto; padding: 70px 0 35px; }
.checkout-topline { display: flex; align-items: center; justify-content: space-between; margin: 0 12px 18px; }
.pesaflow-brand { display: flex; align-items: center; gap: 12px; font-size: 27px; letter-spacing: -.5px; }
.pesaflow-mark { position: relative; width: 39px; height: 17px; display: inline-block; transform: skewY(-24deg); }
.pesaflow-mark::before,
.pesaflow-mark::after { content: ''; position: absolute; width: 23px; height: 10px; border-radius: 2px; }
.pesaflow-mark::before { left: 0; top: 0; background: #102342; }
.pesaflow-mark::after { right: 0; bottom: 0; background: linear-gradient(90deg, #ffbf16, #fa6538); }
.checkout-user { font-size: 16px; }
.checkout-summary {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  padding: 26px 24px;
  border: 1px solid #edf0f5;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(16, 35, 66, .04);
}
.checkout-summary small,
.checkout-summary strong { display: block; }
.checkout-summary small { margin-bottom: 7px; font-size: 12px; }
.checkout-summary strong { font-size: 19px; }
.checkout-total { text-align: right; }
.pesaflow-checkout > h1 { margin: 46px 5px 25px; padding-bottom: 12px; border-bottom: 1px solid #dfe5ed; font-size: 14px; font-weight: 400; }
.checkout-error { display: none; margin: 0 5px 18px; padding: 11px 14px; border-radius: 4px; background: #fde5e2; color: #a83228; }
.payment-mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 24px; padding: 0 12px; }
.payment-mode {
  min-height: 52px;
  padding: 12px 19px;
  border: 1px solid #e0e6ee;
  border-radius: 8px;
  background: #fff;
  color: #183154;
  font: inherit;
  font-size: 16px;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.payment-mode:hover,
.payment-mode:focus { border-color: #315a93; box-shadow: 0 4px 12px rgba(16, 35, 66, .08); transform: translateY(-1px); outline: 0; }
.payment-mode-disabled { color: #65728a; }
.mpesa-panel {
  position: fixed;
  inset: 0;
  z-index: 1000;
  width: min(650px, calc(100% - 30px));
  height: fit-content;
  max-height: calc(100vh - 30px);
  margin: auto;
  overflow-y: auto;
  padding: 25px 4px 4px;
  background: #f8fafc;
  box-shadow: 0 0 0 100vmax rgba(8, 20, 40, .62), 0 18px 45px rgba(8, 20, 40, .25);
}
.mpesa-panel[hidden] { display: none; }
.mpesa-brand { margin: 0 0 20px; font-size: 30px; }
.mpesa-card { overflow: hidden; border: 1px solid #dce4ef; border-radius: 8px; background: #fff; }
.mpesa-card-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 28px; border-bottom: 1px solid #dce4ef; }
.mpesa-card-head h2 { margin: 0; color: #102342; font-size: 16px; font-weight: 500; }
.mpesa-card-head > strong { font-size: 20px; font-weight: 500; }
.mpesa-card-body { min-height: 290px; padding: 25px 52px 22px; }
.mpesa-step { margin: 0 0 28px; font-size: 15px; }
#mpesa-menu-link { padding: 0; border: 0; background: none; color: #2468c9; font: inherit; cursor: pointer; }
.mpesa-phone-field { width: min(430px, 100%); margin: 0 auto 38px; }
.mpesa-phone-field label { display: block; margin-bottom: 10px; font-size: 15px; }
.mpesa-phone-field label span { color: #f1302d; }
.mpesa-phone-field input { width: 100%; box-sizing: border-box; padding: 12px 13px; border: 1px solid #cbd8ea; border-radius: 6px; color: #102342; font: inherit; font-size: 15px; }
.mpesa-phone-field input::placeholder { color: #afc0d9; }
.mpesa-initiate-button { margin-top: 20px; padding: 12px 14px; border: 0; border-radius: 7px; background: #3568f4; color: #fff; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.mpesa-initiate-button[hidden] { display: none; }
.mpesa-initiate-button:disabled { opacity: .65; cursor: wait; }
.mpesa-instructions p { margin: 4px 0; font-size: 15px; line-height: 1.35; }
.mpesa-progress { min-height: 18px; margin-top: 10px; color: #173457; font-size: 13px; font-weight: 700; line-height: 1.4; }
.mpesa-card-actions { display: flex; justify-content: space-between; align-items: center; padding: 20px 14px; border-top: 1px solid #dce4ef; }
.mpesa-card-actions button { padding: 12px 15px; border: 0; border-radius: 6px; font: inherit; font-size: 15px; cursor: pointer; }
.mpesa-fetch-button { background: #7189aa; color: #fff; }
.mpesa-cancel-button { background: transparent; color: #102342; }
.mpesa-complete-button { background: #3568f4; color: #fff; }
.mpesa-card-actions button:disabled { opacity: .65; cursor: wait; }
.policy-page { width: min(680px, calc(100% - 30px)); margin: 70px auto; padding: 30px; box-sizing: border-box; border-radius: 8px; background: #fff; box-shadow: 0 8px 25px rgba(16,35,66,.08); }
.policy-page p { line-height: 1.65; }
.policy-page button { padding: 9px 18px; border: 0; background: #315a93; color: #fff; cursor: pointer; }
.checkout-help { display: flex; justify-content: space-around; align-items: center; gap: 60px; margin-top: 85px; padding: 0 55px; }
.pesaflow-brand-large { font-size: 48px; }
.pesaflow-brand-large .pesaflow-mark { width: 70px; height: 29px; }
.pesaflow-brand-large .pesaflow-mark::before,
.pesaflow-brand-large .pesaflow-mark::after { width: 41px; height: 17px; }
.checkout-help p { color: #15284a; font-family: Georgia, serif; font-size: 27px; line-height: 1.35; }
.checkout-help p span,
.checkout-help p b { color: #fa6538; font-weight: 400; }
.support-clock { display: grid; place-items: center; width: 170px; height: 170px; border: 18px solid #102342; border-radius: 50%; background: #fa6538; color: #fff; font-size: 34px; transform: rotate(-8deg); }
.support-clock strong { transform: rotate(8deg); }

@media (max-width: 700px) {
  .payment-form-body { padding: 15px 12px 28px; }
  .payment-form-row { grid-template-columns: 1fr; gap: 6px; margin-bottom: 14px; }
  .payment-form-row label { text-align: left; }
  .payment-pay-btn { margin: 24px auto 0; min-width: 120px; }
  .pesaflow-checkout { width: min(100% - 24px, 520px); padding-top: 28px; }
  .checkout-topline { align-items: flex-start; gap: 20px; }
  .checkout-user { max-width: 45%; text-align: right; font-size: 13px; }
  .checkout-summary { padding: 19px 16px; }
  .checkout-summary strong { font-size: 15px; }
  .payment-mode-grid { grid-template-columns: 1fr; padding: 0; }
  .checkout-help { display: block; margin-top: 50px; padding: 0 12px; }
  .pesaflow-brand-large { font-size: 35px; }
  .checkout-help p { font-size: 21px; }
  .support-clock { display: none; }
}

/* ================= Maseno portal login ================= */
.portal-login-page {
  min-height: 100vh;
  background: #d3d7df;
  color: #222;
  font-family: Arial, Helvetica, sans-serif;
}

.portal-login-wrap {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 106px 20px 60px;
}

.portal-login-card {
  width: 430px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #c5cad2;
  border-radius: 3px;
}

.portal-login-header {
  position: relative;
  height: 120px;
  padding-top: 17px;
  background: #0fa8c8;
  color: #fff;
  text-align: center;
}

.portal-login-header h1 {
  margin: 0;
  color: #fff;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  font-size: 24px;
  font-weight: 300;
  line-height: 1.45;
}

.portal-login-logo {
  position: absolute;
  z-index: 1;
  top: 65px;
  left: 50%;
  width: 90px;
  height: 96px;
  object-fit: contain;
  transform: translateX(-50%);
}

.portal-login-body {
  min-height: 233px;
  padding: 39px 4px 29px;
  background: #fff;
}

.portal-login-error {
  display: none;
  margin: 0 10px 10px;
  padding: 7px 9px;
  border: 1px solid #efc4c0;
  background: #fbeae8;
  color: #8c2e27;
  font-size: 12px;
}

.portal-login-error.visible { display: block; }

.portal-login-field {
  display: grid;
  grid-template-columns: 75px 1fr;
  align-items: center;
  margin-bottom: 15px;
}

.portal-login-field label {
  padding-right: 8px;
  text-align: right;
  font-size: 13px;
  font-weight: 700;
}

.portal-login-field input {
  width: 100%;
  height: 35px;
  padding: 7px 12px;
  border: 1px solid #cbd0d8;
  border-radius: 0;
  background: #fff;
  color: #333;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
}

.portal-login-field input::placeholder { color: #a4a7ad; }

.portal-login-field input:focus {
  outline: 1px solid #0fa8c8;
  border-color: #0fa8c8;
}

.portal-login-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 15px;
  padding: 30px 10px 0;
  border-top: 1px solid #ececec;
}

.portal-login-actions button {
  border: 0;
  border-radius: 3px;
  padding: 9px 13px;
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 17px;
  cursor: pointer;
}

.portal-forgot-btn { background: #f39a05; }
.portal-forgot-btn:hover { background: #dc8900; }
.portal-signin-btn { background: #08add0; }
.portal-signin-btn:hover { background: #0798b7; }

@media (max-width: 520px) {
  .portal-login-wrap { padding: 54px 14px 30px; }
  .portal-login-card { width: 100%; max-width: 430px; }
  .portal-login-field { grid-template-columns: 76px 1fr; }
}

/* ================= MSU authenticated portal shell ================= */
.portal-shell { background: #edf1f7; }

.portal-topbar {
  height: 46px;
  padding: 0;
  background: #70c2cf;
  position: sticky;
  top: 0;
  z-index: 40;
}

.portal-brand {
  flex: 0 0 auto;
  padding-left: 7px;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
}

.portal-brand-suffix { font-weight: 400; }

.portal-topbar .menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 46px;
  margin: 0 0 0 14px;
  color: #fff;
  font-size: 19px;
}

.portal-topbar-spacer { flex: 1; }

.portal-topbar-right {
  padding: 0 8px 0 15px;
  gap: 10px;
  font-size: 12px;
  white-space: nowrap;
}

.portal-topbar-logo {
  width: 25px;
  height: 28px;
  object-fit: contain;
}

.portal-gear { font-size: 15px; }

.portal-body { align-items: stretch; }

.portal-sidebar {
  width: 228px;
  flex: 0 0 228px;
  min-height: calc(100vh - 46px);
  padding: 0 0 30px;
  background: #91b64d;
  color: #101510;
}

.portal-user-card {
  min-height: 66px;
  padding: 11px 13px;
  gap: 10px;
  border: 0;
  color: #fff;
}

.portal-user-logo {
  width: 45px;
  height: 45px;
  object-fit: contain;
}

.portal-user-name {
  max-width: 145px;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-user-status { margin-top: 4px; font-size: 11px; }
.portal-user-status .dot { background: #2d8b57; }

.portal-nav-label {
  padding: 10px 13px 8px;
  color: #57706f;
  font-size: 10px;
  opacity: 1;
}

.portal-nav button,
.portal-nav a {
  width: 100%;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: #0b120b;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  text-align: left;
}

.portal-nav .portal-nav-single,
.portal-nav .portal-nav-parent {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  color: #0b120b;
  cursor: default;
  opacity: 1;
}

.portal-nav .portal-nav-parent { cursor: pointer; }
.portal-nav .portal-nav-parent:hover,
.portal-nav .portal-nav-single:hover {
  background: #84c7ae;
  color: #fff;
}

.portal-nav .portal-nav-parent:hover .portal-nav-icon,
.portal-nav .portal-nav-parent:hover .portal-chevron,
.portal-nav .portal-nav-single:hover .portal-nav-icon { color: #fff; }

.portal-nav-icon {
  width: 17px;
  flex: 0 0 17px;
  font-weight: 700;
  text-align: center;
}

.icon-blue { color: #048bc3; }
.icon-red { color: #f05a54; }
.icon-green { color: #00a665; }
.icon-dark { color: #050805; }
.icon-orange { color: #ff9e00; }
.icon-cyan { color: #02aeca; }

.portal-chevron {
  margin-left: auto;
  color: #101510;
  font-size: 18px;
  line-height: 1;
}

.portal-menu-group.open > .portal-nav-parent {
  background: #84c7ae;
  color: #fff;
}

.portal-menu-group.open > .portal-nav-parent .portal-nav-icon,
.portal-menu-group.open > .portal-nav-parent .portal-chevron { color: #fff; }

.portal-subnav {
  display: none;
  padding: 0;
  background: #84c7ae;
}

.portal-menu-group.open > .portal-subnav { display: block; }

.portal-subnav li button,
.portal-subnav li a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 31px;
  padding: 5px 18px;
  color: #07100a;
  cursor: default;
}

.portal-subnav li a { cursor: pointer; }
.portal-subnav li a:hover { background: rgba(255, 255, 255, 0.12); }

.submenu-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border: 2px solid #07100a;
  border-radius: 50%;
}

.portal-logout {
  display: block;
  margin: 18px 13px 0;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 3px;
  color: #fff;
  font-size: 12px;
  text-align: center;
}

.portal-main {
  min-height: calc(100vh - 46px);
  padding: 14px 15px 60px;
  background: #edf1f7;
}

/* Desktop sidebar collapse: retain the navigation icons as a slim rail. */
.portal-sidebar,
.portal-main { transition: width .2s ease, flex-basis .2s ease, padding .2s ease; }

.portal-shell.sidebar-collapsed .portal-sidebar {
  width: 75px;
  flex-basis: 75px;
  overflow: visible;
  position: relative;
  z-index: 35;
}

.portal-shell.sidebar-collapsed .portal-brand-suffix { display: none; }

.portal-shell.sidebar-collapsed .portal-user-card {
  min-height: 78px;
  padding: 8px 5px;
  justify-content: center;
}

.portal-shell.sidebar-collapsed .portal-user-logo {
  width: 58px;
  height: 62px;
}

.portal-shell.sidebar-collapsed .portal-user-card > div,
.portal-shell.sidebar-collapsed .portal-nav-label,
.portal-shell.sidebar-collapsed .portal-nav-parent > span:not(.portal-nav-icon),
.portal-shell.sidebar-collapsed .portal-nav-text,
.portal-shell.sidebar-collapsed .portal-chevron,
.portal-shell.sidebar-collapsed .portal-subnav,
.portal-shell.sidebar-collapsed .portal-logout {
  display: none;
}

.portal-shell.sidebar-collapsed .portal-nav .portal-nav-single,
.portal-shell.sidebar-collapsed .portal-nav .portal-nav-parent {
  width: 75px;
  min-height: 44px;
  padding: 10px 0;
  justify-content: center;
  gap: 0;
  font-size: 0;
}

.portal-shell.sidebar-collapsed .portal-nav > li {
  position: relative;
  min-height: 44px;
}

.portal-shell.sidebar-collapsed .portal-nav > li:hover > .portal-nav-single,
.portal-shell.sidebar-collapsed .portal-menu-group:hover > .portal-nav-parent {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 52;
  width: 345px;
  padding: 10px 13px;
  justify-content: flex-start;
  gap: 8px;
  background: #84c7ae;
  color: #fff;
  font-size: 13px;
}

.portal-shell.sidebar-collapsed .portal-nav > li:hover > .portal-nav-single .portal-nav-text,
.portal-shell.sidebar-collapsed .portal-menu-group:hover > .portal-nav-parent > span {
  display: inline;
}

.portal-shell.sidebar-collapsed .portal-menu-group:hover > .portal-nav-parent .portal-chevron {
  display: inline;
  margin-left: auto;
  color: #fff;
}

.portal-shell.sidebar-collapsed .portal-menu-group.open:hover > .portal-subnav {
  display: block;
  position: absolute;
  top: 44px;
  left: 75px;
  z-index: 51;
  width: 270px;
  background: #9bd1be;
  box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.08);
}

.portal-shell.sidebar-collapsed .portal-nav-icon {
  width: 24px;
  flex-basis: 24px;
  margin: 0;
  font-size: 14px;
}

.portal-shell.sidebar-collapsed .portal-menu-group.open > .portal-nav-parent {
  background: transparent;
  color: #0b120b;
}

.portal-shell.sidebar-collapsed .portal-nav-icon.icon-blue { color: #048bc3; }
.portal-shell.sidebar-collapsed .portal-nav-icon.icon-red { color: #f05a54; }
.portal-shell.sidebar-collapsed .portal-nav-icon.icon-green { color: #00a665; }
.portal-shell.sidebar-collapsed .portal-nav-icon.icon-dark { color: #050805; }
.portal-shell.sidebar-collapsed .portal-nav-icon.icon-orange { color: #ff9e00; }
.portal-shell.sidebar-collapsed .portal-nav-icon.icon-cyan { color: #02aeca; }

.portal-page-title {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 23px;
  font-weight: 400;
}

.portal-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 10px;
}

.portal-heading-row .portal-page-title { margin: 0; }

.portal-heading-row .portal-breadcrumb {
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #6b7178;
  white-space: nowrap;
}

.portal-heading-row .portal-breadcrumb a { color: #34383d; }
.portal-heading-row .portal-breadcrumb i { margin-right: 4px; }

@media (max-width: 880px) {
  .portal-topbar {
    height: 103px;
    flex-wrap: wrap;
    align-content: flex-start;
  }

  .portal-brand {
    order: 1;
    width: 100%;
    height: 52px;
    padding: 11px 0 0;
    font-size: 19px;
    text-align: center;
  }

  .portal-shell.sidebar-collapsed .portal-brand-suffix { display: inline; }

  .portal-topbar .menu-toggle {
    order: 2;
    width: 43px;
    height: 51px;
    margin: 0;
  }

  .portal-shell:not(.sidebar-collapsed) .portal-topbar .menu-toggle {
    background: #328caf;
  }

  .portal-topbar-spacer {
    display: block;
    order: 3;
  }

  .portal-topbar-right {
    order: 4;
    height: 51px;
    padding-right: 14px;
  }

  .portal-topbar-right span:not(.portal-gear) { display: none; }

  .portal-sidebar {
    position: static;
    top: auto;
    bottom: auto;
    left: auto;
    z-index: auto;
    width: 228px;
    min-height: calc(100vh - 103px);
  }

  .portal-shell.sidebar-collapsed .portal-sidebar {
    width: 0;
    flex-basis: 0;
    left: auto;
    overflow: hidden;
  }

  .portal-shell.sidebar-collapsed .portal-sidebar > * { display: none; }

  .portal-main {
    min-height: calc(100vh - 103px);
    flex: 1 0 calc(100vw - 228px);
  }

  .portal-shell.sidebar-collapsed .portal-main { flex-basis: 100vw; }

  .portal-heading-row {
    display: block;
    margin-bottom: 15px;
  }

  .portal-heading-row .portal-page-title { margin-bottom: 8px; }

  .portal-heading-row .portal-breadcrumb {
    width: 100%;
    padding: 9px 12px;
    background: #d5d9e1;
  }
}
