/* =====================================================================
   style.css — Frenzon SACCO Member Portal
   Layout and components. Colours, radii and shadows live in theme.css.
   CSP-safe: no inline styles, no external fonts or images.
   Mobile first; desktop layout starts at 900px.
   ===================================================================== */


/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font: 400 1rem/1.5 var(--font);
  color: var(--text-main);
  background:
    radial-gradient(900px 380px at 100% -8%, rgba(31, 107, 74, .12), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { margin: 0; line-height: 1.25; }
p { margin: 0; }
button { font-family: inherit; }
:focus-visible { outline: 3px solid rgba(31, 107, 74, .55); outline-offset: 2px; }
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.mt-1 { margin-top: 8px; }   .mt-2 { margin-top: 16px; }
.icon { width: 22px; height: 22px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Sign-in ---------- */
.auth-wrapper {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(520px 320px at 85% 8%, rgba(224, 176, 74, .22), transparent 65%),
    radial-gradient(600px 400px at 0% 100%, rgba(82, 183, 136, .18), transparent 60%),
    linear-gradient(160deg, var(--primary-900), var(--primary) 55%, var(--primary-500));
}
.auth-card {
  width: 100%; max-width: 410px;
  padding: 30px 24px 22px;
  background: var(--surface);
  border-radius: 26px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5);
}
.auth-header { text-align: center; margin-bottom: 26px; }
.auth-logo { font-size: 1.4rem; font-weight: 750; letter-spacing: -.01em; color: var(--primary); }
.auth-logo::before, .sidebar-header::before {
  content: "F";
  display: grid; place-items: center;
  width: 58px; height: 58px; margin: 0 auto 14px;
  border-radius: 18px;
  font-size: 1.9rem; font-weight: 800; color: var(--accent);
  background: linear-gradient(145deg, var(--primary-500), var(--primary-900));
  box-shadow: 0 10px 20px -10px rgba(20, 67, 47, .8);
}
.auth-subtitle { margin-top: 2px; color: var(--text-muted); font-size: .92rem; }
.auth-notice { margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: var(--bg-subtle); color: var(--text-muted); font-size: .84rem; line-height: 1.5; }
.auth-footer { margin-top: 16px; text-align: center; color: var(--text-muted); font-size: .78rem; }

/* ---------- App shell ---------- */
.app-container { min-height: 100vh; min-height: 100dvh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 60;
  width: min(84vw, 300px);
  display: flex; flex-direction: column;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 14px 16px;
  color: #fff;
  background: linear-gradient(175deg, var(--primary-700), var(--primary-900));
  transform: translateX(-102%);
  transition: transform .26s cubic-bezier(.3, .8, .3, 1);
  overflow-y: auto;
}
.sidebar.open { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, .45); }
.sidebar-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(8, 34, 24, .55); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.sidebar.open + .sidebar-overlay, .sidebar-overlay.open { opacity: 1; pointer-events: auto; }
.sidebar-header { padding: 6px 8px 18px; }
.sidebar-header::before { width: 44px; height: 44px; margin: 0 0 12px; border-radius: 14px; font-size: 1.4rem; background: rgba(255, 255, 255, .1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }
.sidebar-brand { font-size: 1.15rem; font-weight: 750; letter-spacing: -.01em; }
.sidebar-subtitle { font-size: .82rem; color: rgba(255, 255, 255, .6); }
.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nav-section-title { margin: 16px 10px 6px; font-size: .78rem; font-weight: 600; color: rgba(255, 255, 255, .45); }
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 46px; padding: 0 12px;
  background: none; border: 0; border-radius: 12px;
  color: rgba(255, 255, 255, .74); font-size: .95rem; font-weight: 550; text-align: left; cursor: pointer;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-item.active { background: rgba(255, 255, 255, .13); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.nav-icon { display: grid; place-items: center; width: 24px; }
.sidebar :focus-visible { outline-color: var(--accent); }
.sidebar-footer { margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .12); }
.sidebar-user { margin: 0 4px 12px; }
.sidebar-user-name { font-weight: 650; overflow-wrap: anywhere; }
.sidebar-user-number { margin-top: 2px; color: var(--accent); font-size: .85rem; font-variant-numeric: tabular-nums; }
.sidebar .btn-outline { color: #fff; background: transparent; border-color: rgba(255, 255, 255, .28); box-shadow: none; }
.sidebar .btn-outline:hover { background: rgba(255, 255, 255, .1); }

.main-content { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 60px; padding: env(safe-area-inset-top, 0px) 14px 0;
  background: rgba(255, 255, 255, .86); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--border-color);
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-title { font-size: 1.05rem; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mobile-menu-button {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  background: var(--surface); border: 1px solid var(--border-color); border-radius: 14px;
  color: var(--text-main); cursor: pointer;
}
.topbar-actions { position: relative; display: flex; align-items: center; gap: 10px; }
.topbar-member { display: none; padding: 6px 12px; border-radius: 99px; background: var(--primary-light); color: var(--primary); font-size: .82rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.notification-badge {
  position: absolute; top: -5px; right: -5px;
  min-width: 20px; height: 20px; padding: 0 5px;
  display: grid; place-items: center;
  border-radius: 99px; border: 2px solid #fff;
  background: var(--danger); color: #fff; font-size: .68rem; font-weight: 700; line-height: 1;
}
.content-body { max-width: 1040px; margin: 0 auto; padding: 18px 16px calc(var(--nav-h) + 36px + var(--safe-b)); }
.route { display: none; }
.route.active { display: block; }

.bottom-nav {
  position: fixed; z-index: 30; left: 12px; right: 12px; bottom: calc(10px + var(--safe-b));
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px;
  height: var(--nav-h); padding: 6px;
  background: var(--surface); border: 1px solid var(--border-color); border-radius: 22px;
  box-shadow: 0 14px 34px -10px rgba(8, 34, 24, .38);
}
.bottom-nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: none; border: 0; border-radius: 16px;
  color: var(--text-muted); font-size: .7rem; font-weight: 600; cursor: pointer;
  transition: background .15s, color .15s;
}
.bottom-nav-item.active { background: var(--primary-light); color: var(--primary); }
.bottom-nav-icon { display: grid; place-items: center; }

/* ---------- Page headings ---------- */
.page-header { margin: 4px 0 18px; }
.page-title { font-size: 1.55rem; font-weight: 750; letter-spacing: -.02em; }
.page-subtitle { margin-top: 4px; color: var(--text-muted); font-size: .92rem; }

/* ---------- Home hero ---------- */
.home-hero {
  position: relative; overflow: hidden;
  margin-bottom: 14px; padding: 22px 20px 20px;
  border-radius: var(--radius-xl); color: #fff;
  background:
    radial-gradient(420px 220px at 100% 0, rgba(224, 176, 74, .3), transparent 65%),
    linear-gradient(155deg, var(--primary-500), var(--primary) 45%, var(--primary-900));
  box-shadow: 0 22px 40px -22px rgba(8, 34, 24, .7);
}
.home-hero::after {
  content: ""; position: absolute; right: -70px; bottom: -90px; width: 220px; height: 220px;
  border-radius: 50%; border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 0 0 28px rgba(255, 255, 255, .04), 0 0 0 56px rgba(255, 255, 255, .03);
  pointer-events: none;
}
.home-hero > * { position: relative; z-index: 1; }
.home-hero .page-title { font-size: 1.2rem; font-weight: 650; letter-spacing: -.01em; }
.home-hero .page-subtitle { color: rgba(255, 255, 255, .7); }
.hero-main { margin-top: 24px; }
.hero-main .stat-label { color: rgba(255, 255, 255, .75); font-size: .86rem; }
.hero-main .stat-value { margin-top: 4px; color: #fff; font-size: clamp(2rem, 9.5vw, 2.9rem); font-weight: 750; letter-spacing: -.025em; line-height: 1.1; }
.hero-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.hero-mini { padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14); }
.hero-mini .stat-label { color: rgba(255, 255, 255, .72); font-size: .76rem; }
.hero-mini .stat-value { margin-top: 2px; color: #fff; font-size: 1.08rem; font-weight: 700; }

/* ---------- Cards, stats ---------- */
.card { margin-bottom: 14px; padding: 18px; background: var(--surface); border: 1px solid var(--border-color); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-header > div { min-width: 0; }
.card-title { font-size: 1.05rem; font-weight: 700; letter-spacing: -.01em; }
.card-subtitle { margin-top: 2px; color: var(--text-muted); font-size: .85rem; line-height: 1.45; }
.grid-4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat-card { margin: 0; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border-color); border-radius: 16px; box-shadow: var(--shadow-sm); min-width: 0; }
.stat-label { color: var(--text-muted); font-size: .78rem; font-weight: 600; }
.stat-value { margin-top: 4px; font-size: clamp(1.05rem, 4.6vw, 1.35rem); font-weight: 750; letter-spacing: -.01em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-sub { margin-top: 4px; color: var(--text-muted); font-size: .8rem; }

.quick-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.quick-action {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 14px; text-align: left; cursor: pointer;
  background: var(--bg-subtle); border: 1px solid var(--border-color); border-radius: 16px;
  transition: border-color .15s, background .15s;
}
.quick-action:hover { background: var(--surface); border-color: var(--primary-500); }
.quick-action-icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 8px; border-radius: 12px; background: var(--primary-light); color: var(--primary); }
.quick-action-title { font-weight: 650; font-size: .95rem; color: var(--text-main); }
.quick-action-description { color: var(--text-muted); font-size: .78rem; line-height: 1.4; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px;
  border: 1px solid transparent; border-radius: 14px;
  font: 600 .95rem/1.2 var(--font); text-decoration: none; cursor: pointer;
  transition: background .15s, box-shadow .15s, transform .08s;
}
.btn:active { transform: scale(.98); }
.btn:disabled, .btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { color: #fff; background: linear-gradient(180deg, var(--primary-500), var(--primary)); box-shadow: 0 8px 16px -8px rgba(20, 67, 47, .7); }
.btn-primary:hover { background: linear-gradient(180deg, #247855, var(--primary-700)); }
.btn-outline { color: var(--primary); background: var(--surface); border-color: var(--border-dark); }
.btn-outline:hover { background: var(--primary-light); border-color: var(--primary-500); }
.btn-danger { color: var(--danger); background: var(--surface); border-color: #f1c2bd; }
.btn-danger:hover { background: var(--danger-light); }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: .85rem; border-radius: 12px; }
.btn-icon { width: 44px; min-height: 44px; padding: 0; border-radius: 14px; }
.btn-block { width: 100%; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr; column-gap: 16px; }
.form-label { display: block; margin-bottom: 6px; font-size: .88rem; font-weight: 600; }
.form-control {
  display: block; width: 100%; min-height: 48px; padding: 12px 14px;
  font: 400 1rem/1.3 var(--font); color: var(--text-main);
  background: var(--surface); border: 1px solid var(--border-dark); border-radius: 12px;
  transition: border-color .15s, box-shadow .15s;
}
.form-control::placeholder { color: #8a9a91; }
.form-control:focus { outline: 0; border-color: var(--primary-500); box-shadow: 0 0 0 4px rgba(31, 107, 74, .18); }
textarea.form-control { min-height: 96px; resize: vertical; line-height: 1.5; }
select.form-control {
  appearance: none; -webkit-appearance: none; padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%235b6c63' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 8 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.form-help { margin-top: 6px; color: var(--text-muted); font-size: .82rem; line-height: 1.5; }
.password-field { position: relative; }
.password-field .form-control { padding-right: 54px; }
.password-toggle { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); display: grid; place-items: center; width: 40px; height: 40px; background: none; border: 0; border-radius: 10px; color: var(--text-muted); cursor: pointer; }

/* ---------- Alerts, badges ---------- */
.alert, .notice {
  display: flex; gap: 10px; margin: 0 0 16px; padding: 12px 14px;
  border: 1px solid var(--border-color); border-radius: 12px;
  background: var(--bg-subtle); color: var(--text-main); font-size: .9rem; line-height: 1.5;
}
.alert-content { min-width: 0; overflow-wrap: anywhere; }
.alert-content strong { display: block; }
.alert-success, .notice-success { background: var(--success-light); border-color: #b5e2cb; color: #0e5a3a; }
.alert-danger, .alert-error, .notice-error { background: var(--danger-light); border-color: #f4c3be; color: #8a1a10; }
.alert-warning, .notice-warning { background: var(--warning-light); border-color: #f2d99b; color: #7a4504; }
.alert-info, .notice-info { background: var(--info-light); border-color: #bcd5f1; color: #174a85; }
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 99px; background: #e6ede9; color: #3d4f46; font-size: .74rem; font-weight: 650; white-space: nowrap; }
.badge-success { background: var(--success-light); color: #0e5a3a; }
.badge-warning { background: var(--warning-light); color: #7a4504; }
.badge-danger  { background: var(--danger-light); color: #8a1a10; }
.badge-info    { background: var(--info-light); color: #174a85; }
.badge-neutral { background: #e6ede9; color: #3d4f46; }

/* ---------- Tabs ---------- */
.tabs {
  display: flex; gap: 4px; margin: 0 0 18px; padding: 5px;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity;
  background: #e2eae6; border-radius: 16px;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-button {
  flex: 0 0 auto; min-height: 40px; padding: 0 16px; scroll-snap-align: start;
  background: none; border: 0; border-radius: 12px;
  color: var(--text-muted); font-size: .88rem; font-weight: 600; white-space: nowrap; cursor: pointer;
  transition: background .15s, color .15s;
}
.tab-button:hover { color: var(--text-main); }
.tab-button.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ---------- Tables, states ---------- */
.table-responsive { margin: 0 -4px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; }
.table th { padding: 10px 12px; background: var(--bg-subtle); color: var(--text-muted); font-size: .76rem; font-weight: 650; text-align: left; white-space: nowrap; }
.table th:first-child { border-radius: 10px 0 0 10px; } .table th:last-child { border-radius: 0 10px 10px 0; }
.table td { padding: 12px; border-bottom: 1px solid var(--border-color); font-variant-numeric: tabular-nums; vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.payment-reference { overflow-wrap: anywhere; color: var(--text-muted); }
.table-empty, .empty-state, .loading-state { padding: 28px 12px; text-align: center; color: var(--text-muted); font-size: .92rem; }
.table-empty { text-align: center; }
.loading-state { display: flex; align-items: center; justify-content: center; gap: 10px; }
.empty-state-title { margin-bottom: 4px; color: var(--text-main); font-weight: 650; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--border-dark); border-top-color: var(--primary-500); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Loans, guarantors, activity, notifications ---------- */
.loan-list { display: grid; gap: 12px; }
.loan-list .card, .loan-card { margin-bottom: 12px; }
.loan-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.loan-title { font-weight: 700; }
.loan-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }
.loan-summary-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--bg-subtle); min-width: 0; }
.loan-summary-label { color: var(--text-muted); font-size: .72rem; font-weight: 600; }
.loan-summary-value { font-weight: 650; font-size: .95rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.loan-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.eligibility-status { display: flex; align-items: flex-start; gap: 14px; padding: 16px; border-radius: 16px; background: var(--bg-subtle); }
.eligibility-icon { display: grid; place-items: center; flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-md); color: var(--primary); font-weight: 800; font-size: 1.1rem; }
.guarantor-list { display: grid; gap: 10px; }
.guarantor-item { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--border-color); border-radius: 14px; background: var(--bg-subtle); }
.guarantor-name { font-weight: 650; }
.guarantor-meta { margin-top: 2px; color: var(--text-muted); font-size: .82rem; }
.guarantor-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.activity-list, .notification-list { display: grid; }
.activity-item { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border-color); }
.activity-item:first-child { border-top: 0; padding-top: 0; }
.activity-icon { display: grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; background: var(--primary-light); color: var(--primary); font-size: .9rem; }
.activity-content { min-width: 0; }
.activity-title { font-weight: 600; font-size: .92rem; }
.activity-description { color: var(--text-muted); font-size: .85rem; }
.activity-time { margin-top: 2px; color: var(--text-muted); font-size: .76rem; }
.notification-list { gap: 8px; }
.notification-item { position: relative; display: flex; gap: 12px; padding: 12px 14px; border: 1px solid var(--border-color); border-radius: 14px; cursor: pointer; }
.notification-item.unread { background: #f1faf5; border-color: #bfe3cf; }
.notification-dot { flex: 0 0 auto; width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; background: var(--border-dark); }
.unread .notification-dot { background: var(--accent); box-shadow: 0 0 0 3px rgba(224, 176, 74, .25); }
.notification-title { font-weight: 650; font-size: .92rem; }
.notification-message { color: var(--text-muted); font-size: .86rem; }
.notification-time { margin-top: 2px; color: var(--text-muted); font-size: .76rem; }

/* ---------- Account ---------- */
.profile-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.profile-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 12px; background: var(--bg-subtle); min-width: 0; }
.profile-label { color: var(--text-muted); font-size: .75rem; font-weight: 600; }
.profile-value { font-weight: 600; overflow-wrap: anywhere; }
.financial-breakdown { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.financial-item { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 14px; background: var(--bg-subtle); min-width: 0; }
.financial-item-label { color: var(--text-muted); font-size: .78rem; font-weight: 600; }
.financial-item-value { font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.security-notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; background: var(--primary-light); color: var(--primary-900); font-size: .88rem; line-height: 1.5; }
.security-notice .icon { margin-top: 1px; color: var(--primary); }
.executive-access { border: 0; color: #fff; background: radial-gradient(300px 160px at 100% 0, rgba(224, 176, 74, .3), transparent 65%), linear-gradient(155deg, var(--primary), var(--primary-900)); }
.executive-access-header { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.executive-access-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--accent); color: var(--primary-900); }
.executive-access-title { font-size: 1.05rem; font-weight: 700; }
.executive-access-description { margin-bottom: 14px; color: rgba(255, 255, 255, .8); font-size: .88rem; }
.executive-access .btn-primary { background: var(--accent); color: #3b2a02; box-shadow: none; }

/* ---------- Modals (bottom sheet on phones) ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: flex-end; justify-content: center; background: rgba(8, 34, 24, .55); backdrop-filter: blur(3px); }
.modal.open, .modal.show, .modal.active, .modal.is-open, .modal[aria-hidden="false"] { display: flex; }
.modal-dialog { width: 100%; max-height: 92vh; max-height: 92dvh; overflow-y: auto; background: var(--surface); border-radius: 24px 24px 0 0; box-shadow: 0 -20px 50px -20px rgba(0, 0, 0, .5); animation: sheet-up .26s cubic-bezier(.3, .8, .3, 1); }
.modal-dialog::before { content: ""; display: block; width: 40px; height: 4px; margin: 8px auto 0; border-radius: 2px; background: var(--border-dark); }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; background: var(--surface); }
.modal-title { font-size: 1.1rem; font-weight: 700; }
.modal-close { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; background: var(--bg-subtle); border: 0; border-radius: 50%; color: var(--text-muted); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.modal-body { padding: 4px 20px 20px; }
.modal-footer { display: flex; gap: 10px; padding: 14px 20px calc(16px + var(--safe-b)); border-top: 1px solid var(--border-color); }
.modal-footer .btn { flex: 1; }

/* ---------- Small phones ---------- */
@media (max-width: 480px) {
  form > .btn-primary, form > .btn-outline:not(.btn-sm) { width: 100%; }
  .card { padding: 16px; }
}
@media (min-width: 480px) { .topbar-member { display: block; } }

/* ---------- Tablet and up ---------- */
@media (min-width: 640px) {
  .form-row { grid-template-columns: 1fr 1fr; }
  .profile-grid { grid-template-columns: repeat(2, 1fr); }
  .financial-breakdown { grid-template-columns: repeat(3, 1fr); }
  .guarantor-item { flex-direction: row; align-items: center; justify-content: space-between; }
  .modal { align-items: center; padding: 24px; }
  .modal-dialog { max-width: 520px; border-radius: 24px; box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .5); }
  .modal-dialog.modal-lg { max-width: 760px; }
  .modal-dialog::before { display: none; }
}

/* ---------- Desktop ---------- */
@media (min-width: 900px) {
  .sidebar { width: var(--sidebar-w); transform: none; box-shadow: none; }
  .sidebar-overlay, .bottom-nav, .mobile-menu-button { display: none; }
  .main-content { margin-left: var(--sidebar-w); }
  .topbar { padding: 0 32px; min-height: 68px; }
  .content-body { padding: 30px 32px 56px; }
  .home-hero { padding: 28px 30px 26px; }
  .hero-main { display: inline-block; margin-right: 40px; vertical-align: bottom; }
  .hero-pair { display: inline-grid; width: 460px; max-width: 100%; vertical-align: bottom; }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .quick-actions { grid-template-columns: repeat(4, 1fr); }
  .profile-grid { grid-template-columns: repeat(3, 1fr); }
  .card { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Carried over from the old style.css so it can be removed ---------- */
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.text-center { text-align: center; } .text-right { text-align: right; } .text-light { color: var(--text-light); }
.text-primary { color: var(--primary); } .text-success { color: var(--success); } .text-warning { color: var(--warning); } .text-danger { color: var(--danger); }
.w-full { width: 100%; } .mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; } .mt-3 { margin-top: 24px; } .mb-3 { margin-bottom: 24px; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 14px; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
.payment-card, .eligibility-card { border-left: 4px solid var(--primary-500); }
.card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.card-footer { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border-color); }
.stat-description { margin-top: 4px; color: var(--text-muted); font-size: .78rem; }
.empty-state-description { max-width: 420px; margin: 0 auto; font-size: .85rem; }
.empty-state-icon { margin-bottom: 8px; font-size: 2rem; color: var(--border-dark); }
.form-error { margin-top: 6px; color: var(--danger); font-size: .8rem; }
.required { color: var(--danger); }
.btn-accent { color: #3b2a02; background: var(--accent); }
.btn-success { color: #fff; background: var(--success); }
.btn-warning { color: #fff; background: var(--warning); }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 1rem; }
.progress-track { width: 100%; height: 10px; overflow: hidden; border-radius: 99px; background: #e2eae6; }
.progress-bar { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary-500), #3aa077); transition: width .3s ease; }
.progress-label { display: flex; justify-content: space-between; margin-bottom: 6px; color: var(--text-muted); font-size: .78rem; }
.alert-title { margin-bottom: 2px; font-weight: 700; }
.table tbody tr:hover { background: #f8fbf9; }
@media print {
  .sidebar, .topbar, .bottom-nav, .mobile-menu-button, .btn, .modal { display: none !important; }
  .main-content { margin-left: 0; } .content-body { max-width: none; padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* ---------- Tables become stacked cards on phones ---------- */
@media (max-width: 640px) {
  .table-responsive { margin: 0; overflow: visible; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table tbody tr { margin-bottom: 10px; padding: 4px 14px; background: var(--bg-subtle); border: 1px solid var(--border-color); border-radius: 14px; }
  .table tbody tr:hover { background: var(--bg-subtle); }
  .table td { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border-color); text-align: right; overflow-wrap: anywhere; }
  .table td:last-child { border-bottom: 0; }
  .table td::before { content: attr(data-label); flex: 0 0 auto; max-width: 45%; color: var(--text-muted); font-size: .76rem; font-weight: 650; text-align: left; }
  .table td:not([data-label])::before, .table td[data-label=""]::before { content: none; }
  .table td.table-empty { display: block; text-align: center; border: 0; }
}

/* ---------- Savings month picker ---------- */
.month-picker { display: grid; gap: 8px; margin-top: 8px; }
.month-year { margin-top: 6px; color: var(--text-muted); font-size: .8rem; font-weight: 650; }
.month-row { padding: 12px 14px; background: var(--surface); border: 1px solid var(--border-dark); border-radius: 14px; transition: border-color .15s, background .15s; }
.month-row.selected { border-color: var(--primary-500); background: #f1faf5; }
.month-check { display: flex; align-items: center; gap: 12px; min-height: 28px; cursor: pointer; }
.month-cb { flex: 0 0 auto; width: 22px; height: 22px; accent-color: var(--primary-500); }
.month-name { flex: 1; font-weight: 650; }
.month-hint { margin: 4px 0 0 34px; }
.month-amount { margin: 10px 0 0 34px; }
.month-amount .form-control { max-width: 260px; }
@media (min-width: 640px) { .month-picker { grid-template-columns: repeat(2, 1fr); } .month-year { grid-column: 1 / -1; } }

/* ---- Forgot / reset password ---- */
.auth-links { margin-top: 14px; text-align: center; }
.link-button { background: none; border: 0; padding: 4px 6px; color: var(--primary); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-button:hover, .link-button:focus-visible { color: var(--primary-dark, var(--primary)); }
.auth-form-title { margin-bottom: 8px; font-size: 1.1rem; font-weight: 700; color: var(--text, inherit); }

/* ---- Payment history filters / paging ---- */
.history-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.history-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; flex-wrap: wrap; }

/* ---- Notifications tools ---- */
.notification-tools { display: flex; justify-content: flex-end; margin: 4px 0 10px; }
.notification-tools:empty { display: none; }

/* ---- Offline banner ---- */
.offline-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 3000; padding: 9px 14px; background: #7a4504; color: #fff; text-align: center; font-size: .85rem; font-weight: 600; }

/* ---------- Logo ---------- */
.auth-logo-img { display: block; width: 150px; height: auto; margin: 0 auto 10px; }
.auth-logo::before, .sidebar-header::before { content: none; display: none; }
.sidebar-header { display: flex; align-items: center; gap: 12px; }
.sidebar-logo { width: 52px; height: 52px; flex: 0 0 auto; padding: 3px; border-radius: 14px; background: #fff; object-fit: contain; }
a.btn { text-decoration: none; }

/* ---------- Help & Support ---------- */
.support-list { display: grid; gap: 12px; }
.support-person { display: grid; gap: 8px; padding: 14px; border-radius: 14px; background: var(--bg-subtle); border: 1px solid var(--border-color); }
.support-person-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.support-person-name { font-size: 1rem; }
.support-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.support-inline { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 0 16px 16px; padding: 12px 14px; border-radius: 14px; background: var(--info-light); }
.support-inline-text { display: grid; gap: 2px; min-width: 0; }

/* ---------- Interest & profit summary ---------- */
.profit-summary { margin-bottom: 14px; }
.profit-grid { grid-template-columns: 1fr; margin-bottom: 0; }
@media (min-width: 700px) { .profit-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---- Help Centre (faq.js) ---- */
.faq-list { display: grid; gap: 8px; }
.faq-cat { margin: 14px 0 2px; font-family: inherit; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.faq-item { border: 1px solid var(--border-color); border-radius: 14px; background: var(--bg-subtle); }
.faq-item > summary { cursor: pointer; padding: 12px 14px; font-weight: 600; list-style: none; }
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::after { content: "+"; float: right; color: var(--text-muted); }
.faq-item[open] > summary::after { content: "\2212"; }
.faq-answer { padding: 0 14px 14px; line-height: 1.55; }
.faq-answer p { margin: 0 0 8px; }
.faq-fixed { font-size: .78rem; color: var(--text-muted); }
.faq-contact { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 10px 0 8px; padding: 10px 12px; border: 1px dashed var(--border-color); border-radius: 12px; font-size: .85rem; }
.faq-contact-footer { margin-top: 14px; }

/* ---- Help Centre groups ---- */
.faq-group { border: 1px solid var(--border-color); border-radius: 16px; background: var(--bg-card, transparent); overflow: hidden; }
.faq-group > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; padding: 14px 16px; font-weight: 700; list-style: none; }
.faq-group > summary::-webkit-details-marker { display: none; }
.faq-group > summary::after { content: "+"; color: var(--text-muted); margin-left: 4px; }
.faq-group[open] > summary::after { content: "\2212"; }
.faq-group > summary > span:first-child { flex: 1; }
.faq-count { font-size: .75rem; font-weight: 600; color: var(--text-muted); background: var(--bg-subtle); border-radius: 999px; padding: 2px 9px; }
.faq-group-body { display: grid; gap: 8px; padding: 0 12px 12px; }
.faq-group .faq-item { background: var(--bg-subtle); }
/* ---- Home obligations ---- */
.obl-list { display: grid; gap: 8px; }
.obl-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--border-color); border-radius: 14px; background: var(--bg-subtle); }
.obl-title { font-weight: 600; }
.obl-sub { font-size: .8rem; color: var(--text-muted); margin-top: 2px; }
.obl-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; flex: 0 0 auto; }
.obl-amount { font-weight: 700; }
.obl-more { margin-top: 10px; }
.stat-value.is-pending { font-size: .95rem; font-weight: 600; color: var(--text-muted); }

/* ---- Records (obligations / allocations) ---- */
.obl-item.obl-block { display: block; padding: 0; }
.obl-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; }
.rec-groups { display: grid; gap: 10px; }
.rec-group { border: 1px solid var(--border-color); border-radius: 16px; overflow: hidden; }
.rec-group > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; padding: 12px 16px; font-weight: 700; list-style: none; }
.rec-group > summary::-webkit-details-marker { display: none; }
.rec-group > summary > span:first-child { flex: 1; }
.rec-group > summary::after { content: "+"; color: var(--text-muted); }
.rec-group[open] > summary::after { content: "\2212"; }
.rec-group > .obl-list { padding: 0 10px 10px; }
.rec-details { border-top: 1px dashed var(--border-color); padding: 0 14px 10px; }
.rec-details > summary { cursor: pointer; padding: 8px 0; font-size: .82rem; color: var(--text-muted); }
.rec-kv { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; font-size: .85rem; }
.rec-kv > span:first-child { color: var(--text-muted); }
.rec-kv > span:last-child { text-align: right; }
/* ---- Savings month dropdown ---- */
.month-dropdown { border: 1px solid var(--border-dark, var(--border-color)); border-radius: 14px; margin-top: 8px; background: var(--surface, transparent); }
.month-dropdown > summary { cursor: pointer; padding: 12px 14px; font-weight: 600; list-style: none; }
.month-dropdown > summary::-webkit-details-marker { display: none; }
.month-dropdown > summary::after { content: "\25BE"; float: right; color: var(--text-muted); }
.month-dropdown[open] > summary::after { content: "\25B4"; }
.month-dropdown .month-picker { margin: 0; padding: 0 10px 10px; max-height: 60vh; overflow-y: auto; grid-template-columns: 1fr; }
/* ---- Idle warning, remember-me, record actions ---- */
.idle-banner { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 9999; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 14px; background: #7a1d1d; color: #fff; box-shadow: 0 6px 24px rgba(0,0,0,.3); font-size: .9rem; }
.remember-row { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; font-size: .9rem; color: var(--text-muted); cursor: pointer; }
.rec-actions { padding: 0 14px 12px; }

/* ---------- Loan progress (member) ---------- */
.loan-steps { display: flex; list-style: none; margin: 14px 0 6px; padding: 0; gap: 4px; }
.loan-steps li { flex: 1; position: relative; text-align: center; font-size: .72rem; color: var(--text-muted); min-width: 0; }
.loan-steps li::before { content: ''; position: absolute; top: 11px; left: -50%; width: 100%; height: 2px; background: #dde3ec; z-index: 0; }
.loan-steps li:first-child::before { display: none; }
.loan-steps li.done::before, .loan-steps li.current::before { background: #1c7c54; }
.loan-step-dot { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: #dde3ec; color: #5c6779; font-weight: 700; font-size: .75rem; }
.loan-steps li.done .loan-step-dot { background: #1c7c54; color: #fff; }
.loan-steps li.current .loan-step-dot { background: var(--primary-900, #0f1f3d); color: #fff; box-shadow: 0 0 0 4px rgba(37, 99, 184, .2); }
.loan-steps li.current { color: var(--text-main); font-weight: 700; }
.loan-step-name, .loan-step-sub { display: block; margin-top: 4px; overflow-wrap: anywhere; }
.loan-step-sub { font-weight: 600; color: #9a5a06; font-size: .68rem; }
.loan-next { margin: 8px 0 4px; padding: 10px 12px; border-radius: 12px; background: var(--info-light); color: #174a85; font-size: .88rem; }
.loan-next-warn { background: var(--warning-light); color: #7a4504; }

/* ---------- Member statement (mobile-money style) ---------- */
.ms-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.ms-chip { min-height: 36px; border: 1px solid var(--primary); background: var(--surface); color: var(--primary); border-radius: 99px; padding: 6px 14px; font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; }
.ms-chip.on { background: var(--primary); color: #fff; }
.ms-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ms-preview { margin-top: 14px; }
.ms-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.ms-total { border: 1px solid var(--border-color); border-left: 5px solid #9ca3af; border-radius: 12px; padding: 10px 12px; background: var(--surface); }
.ms-total.in { border-left-color: #1c7c54; } .ms-total.out { border-left-color: #b42318; }
.ms-total span { display: block; font-size: .74rem; font-weight: 700; color: var(--text-muted); }
.ms-total b { display: block; margin-top: 2px; font-size: 1.02rem; overflow-wrap: anywhere; }
.ms-total.in b { color: #1c7c54; } .ms-total.out b { color: #b42318; }
.ms-subhead { padding: 10px 14px; background: var(--primary); color: #fff; font-size: .8rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; border-radius: 12px 12px 0 0; }
.ms-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 10px 4px; font-size: .74rem; color: var(--text-muted); border-bottom: 1px solid var(--border-color); }
.ms-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; background: #9ca3af; }
.ms-legend i.mtn { background: #ffcc00; } .ms-legend i.airtel { background: #ff6a00; } .ms-legend i.bank { background: #6b7280; }
.ms-legend .in { color: #1c7c54; font-weight: 700; } .ms-legend .out { color: #b42318; font-weight: 700; }
.ms-row { display: flex; align-items: center; gap: 12px; padding: 12px 8px; border-bottom: 1px solid var(--border-color); border-left: 4px solid transparent; cursor: pointer; }
.ms-row.in { border-left-color: #1c7c54; } .ms-row.out { border-left-color: #b42318; }
.ms-row:focus-visible { outline: 2px solid var(--primary-500); outline-offset: -2px; }
.ms-ic { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #9ca3af; color: #fff; }
.ms-ic.mtn { background: #ffcc00; color: #111; } .ms-ic.airtel { background: #ff6a00; color: #fff; } .ms-ic.bank { background: #6b7280; color: #fff; }
.ms-ic svg { width: 20px; height: 20px; }
.ms-mid { flex: 1; min-width: 0; }
.ms-title { font-weight: 750; font-size: .92rem; }
.ms-sub { font-size: .78rem; color: var(--text-muted); overflow-wrap: anywhere; line-height: 1.45; }
.ms-right { flex: none; text-align: right; }
.ms-amt { font-weight: 800; font-size: .95rem; white-space: nowrap; }
.ms-amt.in { color: #1c7c54; } .ms-amt.out { color: #b42318; }
.ms-date { font-size: .72rem; color: var(--text-muted); margin-top: 2px; }
.ms-more { padding: 12px 4px; font-size: .82rem; color: var(--text-muted); }
.ms-over { position: fixed; inset: 0; z-index: 9999; background: rgba(7, 15, 32, .55); display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 600px) { .ms-over { align-items: center; padding: 16px; } }
.ms-card { width: min(460px, 100%); max-height: 92vh; overflow: auto; background: #fff; border-radius: 20px 20px 0 0; color: #10231b; box-shadow: 0 24px 60px -20px rgba(7, 15, 32, .6); }
@media (min-width: 600px) { .ms-card { border-radius: 20px; } }
.ms-top { background: #14432f; color: #fff; padding: 18px 18px 16px; text-align: center; }
.ms-top .ms-ic { width: 48px; height: 48px; margin: 0 auto 8px; }
.ms-kind { font-size: .85rem; color: #bfe3cf; font-weight: 700; }
.ms-bigamt { font-size: 1.7rem; font-weight: 800; margin-top: 2px; }
.ms-bigamt.in { color: #8fe3b4; } .ms-bigamt.out { color: #ffb4ab; }
.ms-flag { display: inline-block; margin-top: 6px; padding: 2px 10px; border-radius: 99px; font-size: .74rem; font-weight: 700; background: #fde9e7; color: #b42318; }
.ms-list { padding: 6px 18px; }
.ms-r { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid #e6ede9; font-size: .9rem; }
.ms-r:last-child { border-bottom: 0; }
.ms-r span:first-child { color: #5b6c63; flex: none; }
.ms-r span:last-child { font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.ms-r .ms-na { font-weight: 500; color: #9aa8a1; }
.ms-split { margin: 2px 18px 8px; background: #f4f7f5; border-radius: 12px; padding: 6px 14px; }
.ms-split .ms-r { padding: 8px 0; }
.ms-h { margin: 10px 18px 4px; font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #5b6c63; }
.ms-foot { padding: 14px 18px 18px; text-align: right; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- Account page: the passbook (Nov 2026) ----------
   Idea: a member's account should feel like their own passbook.
   - The top card is the passbook cover: woven cloth, gold stitching, member number.
   - "Your money" is a ledger: dotted leaders, a double rule, and what you owe in red.
   - Each thing to pay carries a coloured rail: red = late, amber = due.
   Scoped to #route-account so no other page changes. No inline styles (page policy). */
#route-account {
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --gold: #e0b04a;
}
#route-account .page-header { margin: 6px 0 20px; }
#route-account .page-title { font-family: var(--serif); font-size: 1.75rem; font-weight: 700; letter-spacing: -.01em; }
#route-account .page-subtitle { max-width: 34ch; }
#route-account .card { --cp: 20px; overflow: hidden; border-radius: 22px; padding: var(--cp); box-shadow: 0 1px 2px rgba(16, 35, 27, .05), 0 12px 30px -22px rgba(16, 35, 27, .35); }
/* Section header band, borrowed from the auditor screens: deep green strip, white title. */
#route-account .card:not(.acct-hero) > .card-header { align-items: center; margin: calc(var(--cp) * -1) calc(var(--cp) * -1) 16px; padding: 13px var(--cp); background: #14432f; }
#route-account .card:not(.acct-hero) > .card-header .card-title { font-size: 1rem; font-weight: 800; color: #fff; }
#route-account .card:not(.acct-hero) > .card-header .card-subtitle { margin-top: 1px; font-size: .78rem; color: #bfe3cf; }
#route-account .card:not(.acct-hero) > .card-header .btn-outline { color: #fff; background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .45); }
#route-account .card:not(.acct-hero) > .card-header .btn-outline:hover { background: rgba(255, 255, 255, .2); border-color: #fff; }

/* Passbook cover */
#route-account .card.acct-hero {
  position: relative; overflow: hidden; border: 0; color: #fff; padding: 26px 22px 22px;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .035) 0 2px, transparent 2px 6px),
    repeating-linear-gradient(-45deg, rgba(0, 0, 0, .06) 0 2px, transparent 2px 6px),
    linear-gradient(160deg, #1d6246, #0f3626 70%);
  box-shadow: 0 24px 40px -24px rgba(8, 34, 24, .85), inset 0 0 0 1px rgba(255, 255, 255, .06);
}
.acct-hero::after {
  content: ""; position: absolute; inset: 9px; border: 1.5px dashed rgba(224, 176, 74, .6);
  border-radius: 15px; pointer-events: none;
}
.acct-hero > * { position: relative; z-index: 1; }
.acct-hero-top { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.acct-avatar {
  display: grid; place-items: center; flex: 0 0 auto; width: 64px; height: 64px; border-radius: 50%;
  font-family: var(--serif, Georgia, serif); font-size: 1.45rem; font-weight: 700; letter-spacing: .02em;
  color: #3b2a02; background: radial-gradient(circle at 30% 25%, #f3d58b, #e0b04a 60%, #c99a38);
  box-shadow: 0 0 0 3px rgba(224, 176, 74, .28), 0 8px 16px -8px rgba(0, 0, 0, .6);
}
.acct-hero-text { min-width: 0; }
.acct-name { font-family: var(--serif, Georgia, serif); font-size: 1.5rem; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.acct-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-top: 6px; font-size: .9rem; color: rgba(255, 255, 255, .85); font-variant-numeric: tabular-nums; }
.acct-hero .badge { background: rgba(255, 255, 255, .16); color: #fff; }
.acct-hero .badge-success { background: rgba(143, 227, 180, .22); color: #c9f5dc; }
.acct-hero .alert { margin-bottom: 16px; border-radius: 14px; }
.acct-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.acct-hero .btn-primary { color: #3b2a02; background: linear-gradient(180deg, #f0cd7c, #e0b04a); box-shadow: 0 8px 16px -10px rgba(0, 0, 0, .7); }
.acct-hero .btn-primary:hover { background: linear-gradient(180deg, #f5d78f, #e8ba58); }
.acct-hero .btn-outline { color: #fff; background: transparent; border-color: rgba(255, 255, 255, .5); }
.acct-hero .btn-outline:hover { background: rgba(255, 255, 255, .12); border-color: #fff; }

/* What you need to pay: rows like the auditor's transaction list.
   Coloured left edge + round icon. Red = late, amber = due, blue = part paid. */
.due-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; padding: 12px 14px; border-radius: 12px; background: #fff4dc; color: #8a5200; font-size: .9rem; font-weight: 700; line-height: 1.4; }
.due-summary strong { font-weight: 800; }
.due-summary .btn { flex: 0 0 auto; }
.due-group { margin-bottom: 16px; overflow: hidden; border: 1px solid var(--border-color); border-radius: 14px; }
.due-group-title { display: flex; align-items: center; gap: 8px; margin: 0; padding: 7px 14px; background: #eef3f0; color: #3d5247; font-size: .8rem; font-weight: 800; border-bottom: 1px solid var(--border-color); }
.due-list { display: grid; gap: 0; }
.due-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; background: var(--surface); border: 0; border-bottom: 1px solid var(--border-color); border-left: 4px solid #e0a43a; border-radius: 0; }
.due-list > .due-item:last-child { border-bottom: 0; }
.due-item.due-late { background: #fffafa; border-left-color: var(--danger); }
.due-item.due-part { border-left-color: var(--info); }
.due-ic { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #9ca3af; color: #fff; }
.due-ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ic-savings { background: #1c7c54; } .ic-fdf { background: #e0b04a; color: #3b2a02; } .ic-wd { background: #1f5fa8; }
.ic-renewal { background: #5b4b9a; } .ic-fine { background: #b42318; } .ic-loan { background: #14432f; }
.due-main { flex: 1; min-width: 0; }
.due-title { font-weight: 750; font-size: .92rem; line-height: 1.25; overflow-wrap: anywhere; }
.due-sub { margin-top: 2px; color: var(--text-muted); font-size: .76rem; line-height: 1.45; }
.due-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: 0 0 auto; text-align: right; }
.due-amount { font-weight: 800; font-size: .98rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.due-late .due-amount { color: var(--danger); }
.due-amount-label { margin-top: -3px; color: var(--text-muted); font-size: .7rem; }
.due-more { margin: 0; border: 0; border-radius: 0; border-top: 1px solid var(--border-color); }
.due-more > summary { padding: 10px 14px; font-size: .82rem; font-weight: 800; color: #14432f; }
.due-more > .due-list { padding: 0; }
.due-clear { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid #a9dcc0; border-radius: 14px; background: linear-gradient(160deg, #f4fcf7 0%, #c9ecd8 100%); color: #0e5a3a; }
.due-clear-icon { display: grid; place-items: center; flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; background: #1c7c54; color: #fff; font-weight: 800; }
.due-help { margin-top: 12px; border: 1px solid #cfe0f5; background: #f2f7fd; border-radius: 12px; padding: 2px 14px; }
.due-help > summary { cursor: pointer; padding: 10px 0; font-size: .84rem; color: #173a63; font-weight: 800; }
.due-help p { margin: 4px 0 8px; color: #173a63; font-size: .84rem; line-height: 1.5; max-width: 60ch; }

/* Your money: coloured tiles, like the auditor's money-movement tiles.
   Green = what you have, gold = profit you can withdraw, red = what you owe. */
#accountFinancialOverview.financial-breakdown { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
#accountFinancialOverview .financial-item { align-items: center; justify-content: center; gap: 3px; padding: 12px 8px 13px; text-align: center; border: 1px solid #a9dcc0; border-top: 4px solid #1c7c54; border-radius: 12px; background: linear-gradient(160deg, #f4fcf7 0%, #c9ecd8 100%); box-shadow: 0 1px 3px rgba(16, 35, 27, .10); }
#accountFinancialOverview .financial-item-label { font-size: .74rem; font-weight: 700; color: #1c7c54; line-height: 1.25; }
#accountFinancialOverview .financial-item-value { font-size: clamp(.98rem, 4.4vw, 1.18rem); font-weight: 800; color: #1c7c54; white-space: nowrap; font-variant-numeric: tabular-nums; }
#accountFinancialOverview .financial-item:nth-child(4) { border-color: #f0d68a; border-top-color: #e0b04a; background: linear-gradient(160deg, #fffdf2 0%, #fbe9ae 100%); }
#accountFinancialOverview .financial-item:nth-child(4) .financial-item-label, #accountFinancialOverview .financial-item:nth-child(4) .financial-item-value { color: #7a5200; }
#accountFinancialOverview .financial-item-owe { border-color: #efb3ac; border-top-color: #b42318; background: linear-gradient(160deg, #fff7f6 0%, #f8cfca 100%); }
#accountFinancialOverview .financial-item-owe .financial-item-label, #accountFinancialOverview .financial-item-owe .financial-item-value { color: #b42318; }

/* My details: a receipt, label left and value right. */
#profileDetails.profile-grid { display: grid; grid-template-columns: 1fr; gap: 0 28px; padding: 4px 14px; border-radius: 14px; background: #f4f7f5; }
#profileDetails .profile-item { flex-direction: row; align-items: baseline; justify-content: space-between; gap: 14px; padding: 11px 0; border-radius: 0; background: none; border-bottom: 1px solid #e6ede9; }
#profileDetails .profile-item:last-child { border-bottom: 0; }
#profileDetails .profile-label { flex: none; font-size: .86rem; font-weight: 500; color: #5b6c63; }
#profileDetails .profile-value { text-align: right; font-size: .92rem; font-weight: 700; }
#profileDetails .profile-item-id { align-items: center; margin: 4px -8px; padding: 10px 8px; border: 1px solid #bfe3cf; border-radius: 12px; background: var(--primary-light); }
#profileDetails .profile-item-id .profile-value { display: flex; }
.profile-id-row { display: flex; align-items: center; justify-content: flex-end; gap: 10px; font-variant-numeric: tabular-nums; letter-spacing: .06em; }
.form-required { color: var(--danger); font-weight: 600; font-size: .8rem; }

@media (min-width: 640px) {
  #accountFinancialOverview.financial-breakdown { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #profileDetails.profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .due-item { align-items: flex-start; flex-wrap: wrap; }
  .due-main { flex: 1 1 calc(100% - 60px); }
  .due-side { flex: 1 1 100%; flex-direction: row; align-items: center; justify-content: space-between; padding-left: 50px; text-align: left; }
  .due-amount-label { margin-top: 0; }
  .due-summary { flex-direction: column; align-items: stretch; }
  #route-account .card.acct-hero { padding: 24px 18px 20px; }
}
@media (min-width: 900px) {
  #route-account .card { --cp: 24px; }
  #route-account .card.acct-hero { padding: 30px 30px 26px; }
}
