/* ==========================================================
   SACCO · Home and Member profile (matches the approved demo)
   ========================================================== */

.hm, .mp {
    --hm-border: #E6EBF5;
    --hm-ink: #0F172A;
    --hm-muted: #5B6B86;
    --hm-royal: #2563EB;
    --hm-cobalt: #1E40AF;
    --hm-action: #6D28D9;
    --hm-ok: #15803D;
    --hm-bad: #B91C1C;
    --hm-warn: #92400E;
    --hm-in: #2563EB;
    --hm-out: #EA580C;
    --hm-display: "Sora", "Manrope", ui-sans-serif, system-ui, sans-serif;
    max-width: none;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    color: var(--hm-ink);
}

.hm-muted { color: var(--hm-muted); font-size: 13px; }
.hm-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.hm-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.hm-btn {
    height: 44px; display: inline-flex; align-items: center; padding: 0 18px;
    border-radius: 13px; border: 1px solid var(--hm-border); background: #fff;
    color: var(--hm-ink); font-weight: 700; font-size: 14px; text-decoration: none;
}
.hm-btn.is-primary { border: 0; background: var(--hm-action); color: #fff; }
.hm-btn.is-light { border: 0; background: #fff; color: var(--hm-ink); font-weight: 800; }
.hm-btn.is-ghost { border: 1px solid #475569; background: transparent; color: #fff; }
.hm-btn:focus-visible { outline: 3px solid #F5B841; outline-offset: 2px; }

/* KPI tiles */
.hm-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.hm-kpi { background: #fff; border: 1px solid var(--hm-border); border-radius: 20px; padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.hm-kpi span { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--hm-muted); }
.hm-kpi b { font: 700 26px var(--hm-display); font-variant-numeric: tabular-nums; }
.hm-kpi small { font-size: 12.5px; color: var(--hm-muted); }

/* Cards */
.hm-row { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.hm-card { background: #fff; border: 1px solid var(--hm-border); border-radius: 22px; overflow: hidden; min-width: 0; }
.hm-grow { flex: 1 1 320px; }
.hm-wide { flex: 999 1 600px; }
.hm-pad { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.hm-title, .hm-card-head strong { font: 700 16px var(--hm-display); }
.hm-card-head { padding: 18px 22px; border-bottom: 1px solid var(--hm-border); display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; }
.hm-card-head a { font-size: 13px; font-weight: 700; color: var(--hm-royal); }
.hm-empty { margin: 0; padding: 18px 22px; color: var(--hm-muted); font-size: 13.5px; }

.hm-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 22px; border-bottom: 1px solid #EEF2F7; font-size: 13.5px; }
.hm-line:last-child { border-bottom: 0; }
.hm-line small { font-size: 12px; color: var(--hm-muted); }
.hm-right { text-align: right; font-variant-numeric: tabular-nums; }
.hm-up { color: var(--hm-ok); white-space: nowrap; font-variant-numeric: tabular-nums; }
.hm-down { color: var(--hm-bad); white-space: nowrap; font-variant-numeric: tabular-nums; }
.hm-struck { text-decoration: line-through; color: var(--hm-muted); }
small.hm-ok, .hm-ok { color: var(--hm-ok); font-weight: 700; }
small.hm-bad, .hm-bad { color: var(--hm-bad); font-weight: 700; }
small.hm-warn, .hm-warn { color: var(--hm-warn); font-weight: 700; }
.hm-chip { height: 38px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 11px; font-weight: 800; font-size: 13px; text-decoration: none; white-space: nowrap; }
.hm-chip.is-ok { background: #ECFDF3; color: var(--hm-ok); }

/* Needs you */
.hm-need { display: flex; gap: 12px; align-items: center; padding: 14px 22px; border-bottom: 1px solid #EEF2F7; text-decoration: none; color: var(--hm-ink); }
.hm-need:last-child { border-bottom: 0; }
.hm-need:hover { background: #F8FAFD; }
.hm-need-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.hm-need-text strong { font-size: 14px; }
.hm-need-text small { font-size: 12.5px; color: var(--hm-muted); }
.hm-link { color: var(--hm-royal); font-weight: 700; font-size: 13px; }
.hm-badge { min-width: 32px; height: 32px; padding: 0 6px; box-sizing: border-box; border-radius: 10px; display: grid; place-items: center; font-weight: 800; }
.hm-badge.is-warn { background: #FFF7E6; color: var(--hm-warn); }
.hm-badge.is-bad { background: #FEF2F2; color: var(--hm-bad); }
.hm-badge.is-info { background: #EEF4FF; color: var(--hm-cobalt); }

/* Chart */
.hm-chart { padding: 0 0 18px; }
.hm-legend { display: inline-flex; gap: 8px; align-items: center; font-size: 12.5px; color: #334155; }
.hm-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 8px; }
.hm-legend i.is-in { background: var(--hm-in); }
.hm-legend i.is-out { background: var(--hm-out); }
.hm-tip { margin: 14px 22px 8px; min-height: 20px; font-size: 13px; color: #334155; font-variant-numeric: tabular-nums; }
.hm-plot { display: flex; gap: 10px; padding: 0 22px; }
.hm-axis { display: flex; flex-direction: column; justify-content: space-between; height: 180px; font-size: 11px; color: var(--hm-muted); text-align: right; width: 34px; flex: none; }
.hm-bars-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.hm-bars {
    height: 180px; display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); align-items: end;
    border-bottom: 1px solid #CBD5E1;
    background: linear-gradient(#EEF2F7 1px, transparent 1px) 0 0 / 100% 90px;
}
.hm-day { height: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; border: 0; padding: 0 2px; background: transparent; cursor: pointer; border-radius: 6px 6px 0 0; }
.hm-day.is-on { background: rgba(37, 99, 235, .06); }
.hm-day span { display: block; width: 38%; max-width: 12px; border-radius: 4px 4px 0 0; }
.hm-day .is-in { background: var(--hm-in); }
.hm-day .is-out { background: var(--hm-out); }
.hm-day:focus-visible { outline: 3px solid #F5B841; outline-offset: 1px; }
.hm-days { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); font-size: 10.5px; color: var(--hm-muted); text-align: center; }

/* Payment mix */
.hm-mix { display: flex; flex-direction: column; gap: 6px; }
.hm-mix > div:first-child { display: flex; justify-content: space-between; font-size: 13.5px; }
.hm-mix b { font-variant-numeric: tabular-nums; }
.hm-track { height: 10px; border-radius: 999px; background: #EEF2F7; overflow: hidden; }
.hm-track div { height: 100%; border-radius: 999px; background: var(--hm-in); }

/* Teller till */
.hm-till { background: #0F172A; color: #fff; border-radius: 24px; padding: 24px 26px; display: flex; flex-direction: column; gap: 20px; }
.hm-till-top { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.hm-till-state { display: flex; align-items: center; gap: 12px; }
.hm-till-state strong { display: block; font: 700 18px var(--hm-display); }
.hm-till-state span:not(.hm-dot) { font-size: 13px; color: #CBD5E1; }
.hm-dot { width: 12px; height: 12px; border-radius: 50%; background: #22C55E; box-shadow: 0 0 0 5px rgba(34, 197, 94, .25); flex: none; }
.hm-till.is-closed .hm-dot { background: #F87171; box-shadow: 0 0 0 5px rgba(248, 113, 113, .25); }
.hm-till-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.hm-till-grid > div { background: rgba(255, 255, 255, .07); border-radius: 16px; padding: 14px 16px; }
.hm-till-grid > div.is-white { background: #fff; color: var(--hm-ink); }
.hm-till-grid span { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #CBD5E1; }
.hm-till-grid .is-white span { color: var(--hm-muted); }
.hm-till-grid b { font: 700 22px var(--hm-display); font-variant-numeric: tabular-nums; }
.hm-till .hm-up { color: #86EFAC; }
.hm-till .hm-down { color: #FCA5A5; }

/* ================= Member profile ================= */
.mp-hero { background: #fff; border: 1px solid var(--hm-border); border-radius: 24px; box-shadow: 0 14px 36px rgba(23, 37, 84, .08); padding: 22px 24px; display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.mp-avatar { width: 76px; height: 76px; border-radius: 22px; background: var(--hm-royal); color: #fff; display: grid; place-items: center; font: 700 26px var(--hm-display); overflow: hidden; flex: none; }
.mp-avatar img { width: 100%; height: 100%; object-fit: cover; }
.mp-who { flex: 1 1 280px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mp-who h2 { margin: 0; font: 700 24px var(--hm-display); }
.mp-who > span { font-size: 13.5px; color: var(--hm-muted); }
.mp-status { font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; }
.mp-status.is-active { background: #ECFDF3; color: var(--hm-ok); }
.mp-status.is-pending { background: #FFF7E6; color: var(--hm-warn); }
.mp-status.is-other { background: #F1F5F9; color: #475569; }
.mp-kyc { font-size: 12.5px; font-weight: 700; color: var(--hm-warn); }
.mp-kyc.is-ok { color: var(--hm-ok); }

.mp-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px; background: #EEF2F9; border-radius: 16px; align-self: flex-start; }
.mp-tabs button { min-height: 42px; padding: 0 16px; border: 0; border-radius: 12px; font-weight: 700; font-size: 13.5px; background: transparent; color: var(--hm-muted); cursor: pointer; }
.mp-tabs button.is-on { background: #fff; color: var(--hm-ink); box-shadow: 0 2px 8px rgba(23, 37, 84, .08); }

.mp-accounts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.mp-account { background: #fff; border: 1px solid var(--hm-border); border-radius: 20px; padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.mp-account span { font-size: 12.5px; font-weight: 700; color: var(--hm-muted); }
.mp-account b { font: 700 24px var(--hm-display); font-variant-numeric: tabular-nums; }
.mp-account small { font-size: 12.5px; color: var(--hm-muted); }
.mp-account a { font-size: 13px; font-weight: 700; color: var(--hm-royal); margin-top: 4px; }

.mp-details { padding: 18px 22px; display: flex; flex-direction: column; gap: 12px; font-size: 13.5px; }
.mp-details span { color: var(--hm-muted); }

.mp-table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 13.5px; }
.mp-table th { background: #F8FAFD; text-align: left; color: var(--hm-muted); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; padding: 14px 16px; }
.mp-table td { padding: 14px 16px; border-top: 1px solid #EEF2F7; }
.mp-scroll { overflow-x: auto; }

.mp-docs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.mp-doc { background: #fff; border: 1px solid var(--hm-border); border-radius: 20px; overflow: hidden; }
.mp-doc-box { height: 140px; display: grid; place-items: center; background: #F1F5F9; color: #475569; font-size: 12.5px; font-weight: 700; }
.mp-doc-box img { width: 100%; height: 100%; object-fit: cover; }
.mp-doc-box.is-missing { background: #FFF7E6; color: var(--hm-warn); }
.mp-doc-foot { padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; }
.mp-doc-foot a { font-size: 13px; font-weight: 700; color: var(--hm-royal); }

.mp-history { padding: 4px 22px; }
.mp-history .hm-line { padding-left: 0; padding-right: 0; justify-content: flex-start; align-items: flex-start; }
.mp-when { width: 130px; flex: none; color: var(--hm-muted); }

.mp-soon { background: #fff; border: 1px dashed #C5CFE2; border-radius: 22px; padding: 32px; text-align: center; color: var(--hm-muted); font-size: 14px; }

@media (max-width: 760px) {
    .hm-kpi b { font-size: 22px; }
    .hm-till { padding: 20px; }
    .hm-axis { width: 28px; }
    .mp-when { width: 96px; }
}

/* ================= Settings ================= */
.st { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; width: 100%; color: #0F172A; }
.st-nav { flex: 1 1 220px; max-width: 260px; min-width: 0; background: #fff; border: 1px solid #E6EBF5; border-radius: 22px; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.st-nav button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; min-height: 52px; padding: 10px 14px; border: 0; border-radius: 14px; background: transparent; color: #0F172A; text-align: left; font-weight: 700; font-size: 14px; cursor: pointer; }
.st-nav button small { font-weight: 600; font-size: 12px; color: #5B6B86; }
.st-nav button.is-on { background: #EEF4FF; color: #1E40AF; }
.st-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.st-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.st-card { background: #fff; border: 1px solid #E6EBF5; border-radius: 22px; padding: 22px 24px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.st-card h2 { margin: 0; font: 700 18px "Sora", "Manrope", sans-serif; }
.st-grow { flex: 999 1 380px; }
.st-label { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; font-weight: 700; }
.st-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.st-hint { font-weight: 500; font-size: 12.5px; color: #5B6B86; }
.st-error { font-weight: 600; font-size: 12.5px; color: #B91C1C; }
.st-label input:focus { outline: none; border-color: #2563EB !important; box-shadow: 0 0 0 4px rgba(37, 99, 235, .14); background: #fff !important; }

.st-logo { display: flex; gap: 14px; align-items: center; }
.st-logo-box { width: 72px; height: 72px; border-radius: 18px; background: #2563EB; color: #fff; display: grid; place-items: center; font: 700 26px "Sora", sans-serif; overflow: hidden; flex: none; }
.st-logo-box img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.st-logo-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.st-logo-text small { font-size: 12px; color: #5B6B86; }
.st-upload { position: relative; align-self: flex-start; height: 40px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 11px; border: 1px solid #E6EBF5; background: #fff; font-weight: 700; font-size: 13px; cursor: pointer; }
.st-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.st-upload:focus-within { outline: 3px solid #F5B841; outline-offset: 2px; }

.st-preview { flex: 1 1 260px; max-width: 320px; padding: 0; gap: 0; overflow: hidden; }
.st-preview-head { padding: 14px 18px; border-bottom: 1px solid #E6EBF5; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #5B6B86; }
.st-receipt { padding: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.st-receipt-top { text-align: center; padding-bottom: 10px; border-bottom: 1px dashed #C5CFE2; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.st-receipt-top img { max-height: 40px; max-width: 140px; }
.st-receipt-top strong { font: 700 14px "Sora", sans-serif; letter-spacing: .12em; }
.st-receipt-top span { color: #5B6B86; }
.st-receipt-line { display: flex; justify-content: space-between; }
.st-receipt p { margin: 6px 0 0; text-align: center; color: #5B6B86; font-size: 12px; }

.st-money { display: flex; align-items: center; gap: 10px; height: 48px; max-width: 320px; box-sizing: border-box; border: 1px solid #E6EBF5; border-radius: 13px; background: #F8FAFD; padding: 0 14px; }
.st-money b { color: #5B6B86; }
.st-money input { border: 0; background: transparent; font-weight: 700; font-size: 16px; color: #0F172A; outline: none; width: 100%; box-shadow: none; padding: 0; }
.st-money:focus-within { border-color: #2563EB; box-shadow: 0 0 0 4px rgba(37, 99, 235, .14); background: #fff; }

.st-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.st-pills button { min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid #D5DEEC; background: #fff; color: #0F172A; font-weight: 700; font-size: 14px; cursor: pointer; }
.st-pills button.is-on { border: 2px solid #2563EB; background: #EEF4FF; color: #1E40AF; }
.st-pills button:disabled { opacity: .55; cursor: not-allowed; }
.st-check { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 700; cursor: pointer; }
.st-check input { width: 20px; height: 20px; accent-color: #2563EB; }

.st-note { padding: 14px 16px; border-radius: 14px; background: #F8FAFD; border: 1px solid #E6EBF5; font-size: 13px; color: #334155; }
.st-warn { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: #FFF7E6; color: #92400E; font-size: 13px; font-weight: 600; }
.st-warn svg { flex: none; }
.st-soon { border-style: dashed; text-align: center; color: #5B6B86; font-size: 14px; align-items: center; }

.st-history { padding: 6px 22px; gap: 0; }
.st-history-row { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 13px 0; border-bottom: 1px solid #EEF2F7; font-size: 13.5px; }
.st-history-row:last-child { border-bottom: 0; }
.st-history-row small { font-size: 12.5px; color: #5B6B86; }
.st-when { width: 140px; color: #5B6B86; }
.st-empty { margin: 0; padding: 16px 0; color: #5B6B86; font-size: 13.5px; }

.st-save { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; padding: 14px 18px; border-radius: 18px; background: #fff; border: 1px solid #E6EBF5; }
.st-save > span { margin-right: auto; font-size: 13px; color: #5B6B86; }
.st-btn { height: 46px; padding: 0 20px; border-radius: 13px; border: 1px solid #E6EBF5; background: #fff; color: #0F172A; font-weight: 700; font-size: 14px; cursor: pointer; }
.st-btn.is-primary { border: 0; background: #6D28D9; color: #fff; }
.st-btn:disabled { opacity: .6; cursor: wait; }

@media (max-width: 760px) {
    .st-nav { max-width: none; flex-direction: row; overflow-x: auto; }
    .st-nav button { min-width: 150px; }
    .st-card { padding: 18px; }
    .st-preview { max-width: none; }
}
