:root {
    --green-950: #052f25;
    --green-900: #074634;
    --green-800: #096044;
    --green-700: #0d7950;
    --green-600: #15945f;
    --green-100: #dff1e7;
    --green-50: #f2f8f4;
    --ink: #1b2c26;
    --muted: #6c7c75;
    --line: #dfe8e2;
    --paper: #f5f8f6;
    --white: #fff;
    --gold: #e4a72b;
    --red: #c95454;
    --blue: #3a82c4;
    --violet: #7b5fc5;
    --shadow: 0 12px 30px rgba(7, 70, 52, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "DM Sans", sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { width: 18px; height: 18px; stroke-width: 2; }
[hidden] { display: none !important; }

.sidebar { position: fixed; z-index: 40; inset: 0 auto 0 0; width: 230px; padding: 20px 14px 16px; display: flex; flex-direction: column; color: #fff; background: linear-gradient(180deg, #063f2f, #052f25 72%); box-shadow: 8px 0 28px rgba(5, 47, 37, .1); }
.brand { min-height: 62px; padding: 4px 10px 20px; display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; color: var(--green-900); background: #fff; border-radius: 50%; }
.brand-mark svg { width: 22px; height: 22px; }
.brand strong { display: block; font: 800 19px/1 Manrope, sans-serif; letter-spacing: 0; }
.brand small { display: block; margin-top: 3px; color: #a8d4bf; font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; }
.sidebar nav { min-height: 0; overflow-y: auto; display: grid; gap: 3px; scrollbar-width: thin; }
.nav-label { padding: 12px 11px 6px; color: #75ad96; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.3px; }
.secondary-label { margin-top: 8px; border-top: 1px solid rgba(255, 255, 255, .09); }
.sidebar nav a { min-height: 38px; padding: 0 11px; display: flex; align-items: center; gap: 11px; color: #c1d9cf; border-radius: 5px; font-size: 12px; font-weight: 600; transition: background .18s ease, color .18s ease, transform .18s ease; }
.sidebar nav a svg { width: 16px; height: 16px; }
.sidebar nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); transform: translateX(2px); }
.sidebar nav a.active { color: #fff; background: var(--green-600); box-shadow: 0 7px 18px rgba(0, 0, 0, .13); }
.sidebar-user { margin-top: auto; padding: 15px 8px 0; display: flex; align-items: center; gap: 9px; border-top: 1px solid rgba(255, 255, 255, .1); }
.sidebar-user > span:nth-child(2) { min-width: 0; flex: 1; }
.sidebar-user strong, .sidebar-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user strong { font-size: 10px; }
.sidebar-user small { margin-top: 2px; color: #9fc6b5; font-size: 8px; }
.avatar { width: 31px; height: 31px; flex: 0 0 auto; display: grid; place-items: center; color: var(--green-900); background: #dff1e7; border-radius: 50%; font-size: 11px; font-weight: 800; }

.main { min-height: 100vh; margin-left: 230px; }
.topbar { min-height: 78px; padding: 14px 28px; display: flex; align-items: center; gap: 18px; background: rgba(255, 255, 255, .95); border-bottom: 1px solid var(--line); }
.topbar > div:nth-child(2) { min-width: 0; }
.topbar h1 { margin: 2px 0 0; font: 800 21px/1.2 Manrope, sans-serif; }
.eyebrow { margin: 0; color: var(--green-700); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.1px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.global-search { width: min(260px, 22vw); min-height: 38px; padding: 0 11px; display: flex; align-items: center; gap: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; }
.global-search input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 11px; }
.date-chip, .status-chip { min-height: 36px; padding: 0 11px; display: inline-flex; align-items: center; gap: 7px; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 6px; font-size: 10px; white-space: nowrap; }
.status-chip { color: var(--green-700); background: var(--green-50); border-color: #bdddc9; font-weight: 700; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; color: var(--ink); background: transparent; border: 0; }
.menu-button { display: none; }
.content { padding: 26px clamp(18px, 3vw, 38px) 38px; }
.main > footer { padding: 22px 28px; color: #85938d; border-top: 1px solid var(--line); font-size: 9px; text-align: center; }

.page-intro { margin-bottom: 22px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.page-intro h2 { margin: 4px 0 5px; font: 800 22px/1.25 Manrope, sans-serif; }
.page-intro p:last-child { margin: 0; color: var(--muted); font-size: 11px; }
.stack { display: grid; gap: 20px; }
.stat-grid { margin-bottom: 20px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat-card, .metric-card { position: relative; min-width: 0; min-height: 124px; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 7px; box-shadow: 0 6px 20px rgba(7, 70, 52, .04); }
.metric-card { border-top: 3px solid var(--green-600); }
.metric-card.blue { border-top-color: var(--blue); }
.metric-card.violet { border-top-color: var(--violet); }
.metric-card.gold { border-top-color: var(--gold); }
.metric-card.red { border-top-color: var(--red); }
.metric-card p, .stat-card p { margin: 0; color: var(--muted); font-size: 10px; }
.metric-card strong, .stat-card strong { display: block; margin: 12px 0 5px; font: 800 clamp(18px, 2vw, 25px)/1.1 Manrope, sans-serif; overflow-wrap: anywhere; }
.metric-card small, .stat-card small { color: #819089; font-size: 9px; }
.metric-icon, .stat-icon { position: absolute; top: 15px; right: 15px; width: 32px; height: 32px; display: grid; place-items: center; color: var(--green-700); background: var(--green-100); border-radius: 50%; }
.metric-card.blue .metric-icon { color: var(--blue); background: #e3f0fb; }
.metric-card.violet .metric-icon { color: var(--violet); background: #eee9fb; }
.metric-card.gold .metric-icon { color: #a47411; background: #fbefd2; }
.metric-icon svg, .stat-icon svg { width: 16px; }

.panel { min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 7px; box-shadow: var(--shadow); overflow: hidden; }
.panel-head { min-height: 66px; padding: 15px 19px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid #edf2ef; }
.panel-head h3 { margin: 3px 0 0; font: 800 15px/1.25 Manrope, sans-serif; }
.panel-head > a { color: var(--green-700); font-size: 10px; font-weight: 800; }
.split-view { display: grid; grid-template-columns: minmax(310px, .75fr) minmax(0, 1.25fr); gap: 18px; align-items: start; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(270px, .55fr); gap: 18px; }
.dashboard-primary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dashboard-primary > .panel { min-height: 325px; }

.button { min-height: 38px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: #fff; background: var(--green-700); border: 1px solid var(--green-700); border-radius: 6px; font-size: 10px; font-weight: 800; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.button:hover { transform: translateY(-1px); background: var(--green-800); box-shadow: 0 8px 18px rgba(13, 121, 80, .18); }
.button.secondary { color: var(--green-800); background: #fff; border-color: #bcd2c7; }
.button.danger { color: #ad3f3f; background: #fff; border-color: #e7bebe; }
.button.compact { min-height: 31px; padding: 0 9px; font-size: 9px; }
.form-grid { padding: 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid label, .auth-card label { display: grid; gap: 6px; color: #52645c; font-size: 10px; font-weight: 700; }
.form-grid .full { grid-column: 1 / -1; }
input, select, textarea { width: 100%; min-height: 41px; padding: 9px 11px; color: var(--ink); background: #fff; border: 1px solid #d6e1db; border-radius: 5px; outline: 0; font-size: 11px; transition: border-color .18s ease, box-shadow .18s ease; }
textarea { min-height: 74px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--green-600); box-shadow: 0 0 0 3px rgba(21, 148, 95, .11); }
input:disabled { background: #f1f4f2; }
.form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
.search-row, .review-form { display: flex; align-items: center; gap: 7px; }
.search-row input { min-width: 170px; }
.review-form input, .review-form select { min-width: 105px; }
.homepage-editor-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 10px; }
th { padding: 10px 15px; color: #7b8b84; background: #f7faf8; border-bottom: 1px solid var(--line); font-size: 8px; text-align: left; text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; }
td { padding: 12px 15px; border-bottom: 1px solid #edf2ef; vertical-align: middle; }
tbody tr:hover { background: #f8fbf9; }
td strong, td small { display: block; }
td small { margin-top: 3px; color: #83918b; font-size: 8px; }
.money { font-weight: 800; white-space: nowrap; }
.badge { width: max-content; padding: 4px 8px; display: inline-flex; align-items: center; color: #56665f; background: #edf2ef; border-radius: 99px; font-size: 8px; font-weight: 800; text-transform: capitalize; }
.badge.active, .badge.approved, .badge.verified, .badge.deposit, .badge.successful { color: #087247; background: #ddf1e6; }
.badge.pending, .badge.pay-offline, .badge.initiated { color: #95670a; background: #fbefd1; }
.badge.rejected, .badge.failed, .badge.cancelled, .badge.inactive, .badge.disabled, .badge.withdrawal { color: #ac4040; background: #f8e2e2; }
.badge.suspended { color: #76520a; background: #f8e9bd; }
.alert { margin-bottom: 18px; padding: 12px 15px; color: #176444; background: #e2f2e9; border: 1px solid #badcc8; border-radius: 6px; font-size: 10px; }
.alert.error { color: #9e3c3c; background: #f9e5e5; border-color: #e9bcbc; }
.empty-state { min-height: 190px; padding: 30px 20px; display: grid; place-items: center; align-content: center; gap: 8px; color: var(--muted); text-align: center; }
.empty-state > svg { width: 30px; height: 30px; color: var(--green-600); }
.empty-state h3, .empty-state p { margin: 0; }
.empty-state h3 { color: var(--ink); font: 800 14px Manrope, sans-serif; }
.empty-state p { font-size: 10px; }

.activity-list { padding: 4px 18px 14px; }
.activity-list > div { min-height: 53px; display: grid; grid-template-columns: 31px 1fr auto; align-items: center; gap: 9px; border-bottom: 1px solid #edf2ef; }
.activity-icon { width: 28px; height: 28px; display: grid; place-items: center; color: var(--green-700); background: var(--green-100); border-radius: 50%; }
.activity-icon.out { color: var(--red); background: #f8e2e2; }
.activity-icon svg { width: 13px; }
.activity-list p, .activity-list b { margin: 0; }
.activity-list p strong, .activity-list p small, .activity-list b small { display: block; }
.activity-list p strong { font-size: 9px; }
.activity-list p small, .activity-list b small { margin-top: 2px; color: #87948e; font-size: 7px; }
.activity-list b { color: var(--green-700); font-size: 9px; text-align: right; }
.activity-list b.negative { color: var(--red); }
.loan-visual { min-height: 250px; padding: 22px; display: flex; align-items: center; gap: 22px; }
.donut { width: 120px; aspect-ratio: 1; flex: 0 0 auto; display: grid; place-content: center; text-align: center; background: radial-gradient(circle at center, #fff 0 48%, transparent 49%), conic-gradient(var(--gold) calc(var(--pending) * 1%), var(--green-100) 0); border-radius: 50%; }
.donut strong, .donut small { display: block; }
.donut strong { font: 800 24px Manrope, sans-serif; }
.donut small { color: var(--muted); font-size: 8px; }
.loan-copy strong { font: 800 13px Manrope, sans-serif; }
.loan-copy p { color: var(--muted); font-size: 9px; line-height: 1.55; }
.location-bars { padding: 18px; display: grid; gap: 14px; }
.location-bars > div { display: grid; grid-template-columns: 72px 1fr 24px; align-items: center; gap: 8px; font-size: 8px; }
.location-bars strong { text-align: right; }
.progress-track { height: 7px; overflow: hidden; background: #eaf0ec; border-radius: 99px; }
.progress-track i, .progress-track span { height: 100%; display: block; background: var(--green-600); border-radius: inherit; }

.auth-page { min-height: 100vh; background: var(--green-950); }
.auth-scene { min-height: 100vh; display: grid; grid-template-columns: 1.15fr .85fr; }
.auth-copy { position: relative; padding: clamp(45px, 8vw, 120px); display: flex; flex-direction: column; justify-content: center; color: #fff; background: linear-gradient(135deg, rgba(5, 47, 37, .96), rgba(9, 96, 68, .9)); overflow: hidden; }
.auth-copy::after { content: ""; position: absolute; width: 360px; height: 360px; right: -100px; bottom: -130px; border: 55px solid rgba(255, 255, 255, .05); border-radius: 50%; }
.auth-copy h1 { margin: 10px 0 20px; font: 800 clamp(44px, 5vw, 70px)/1.02 Manrope, sans-serif; }
.auth-copy > p:last-of-type { max-width: 520px; color: #c3dbd1; line-height: 1.7; }
.brand-mark.large { margin-bottom: 32px; }
.trust-row { display: flex; gap: 22px; margin-top: 28px; color: #b8d3c7; font-size: 10px; }
.auth-card { width: min(430px, calc(100% - 38px)); margin: auto; padding: 38px; background: #fff; border-radius: 8px; box-shadow: 0 24px 60px rgba(0, 0, 0, .22); }
.auth-card h2 { margin: 6px 0 8px; font: 800 24px Manrope, sans-serif; }
.auth-card > p:not(.eyebrow) { margin: 0 0 24px; color: var(--muted); font-size: 11px; }
.auth-card form { display: grid; gap: 14px; }
.auth-card .button { width: 100%; margin-top: 5px; }
.mobile-brand { margin-bottom: 25px; color: var(--green-800); font: 800 17px Manrope, sans-serif; }
.auth-note { display: block; margin-top: 18px; color: var(--muted); font-size: 9px; text-align: center; }

.portal-form { min-width: 210px; display: grid; gap: 6px; }
.toggle, .toggle-label { display: flex !important; align-items: center; gap: 7px; }
.toggle input, .toggle-label input { width: 16px; height: 16px; min-height: auto; accent-color: var(--green-700); }
.policy-list { padding: 8px 20px 20px; display: grid; }
.policy-list > div { min-height: 51px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #edf2ef; font-size: 10px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 1100px) {
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-primary { grid-template-columns: 1fr 1fr; }
    .dashboard-primary > .panel:last-child { grid-column: 1 / -1; }
    .split-view { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    .sidebar { transform: translateX(-105%); transition: transform .22s ease; }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; }
    .menu-button { display: grid; }
    .global-search { display: none; }
    .dashboard-grid, .dashboard-primary { grid-template-columns: 1fr; }
    .dashboard-primary > .panel:last-child { grid-column: auto; }
}
@media (max-width: 600px) {
    .topbar { min-height: 68px; padding: 10px 13px; }
    .topbar h1 { font-size: 17px; }
    .date-chip, .top-actions > .button { display: none; }
    .content { padding: 18px 12px 28px; }
    .page-intro { align-items: flex-start; flex-direction: column; }
    .stat-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
    .metric-card, .stat-card { min-height: 112px; padding: 14px; }
    .metric-card strong, .stat-card strong { font-size: 17px; }
    .form-grid, .homepage-editor-form { grid-template-columns: 1fr; padding: 15px; }
    .form-grid .full { grid-column: auto; }
    .panel-head { padding: 13px 15px; }
    .review-form { min-width: 420px; }
    .loan-visual { align-items: flex-start; flex-direction: column; }
    .auth-scene { grid-template-columns: 1fr; }
    .auth-copy { display: none; }
    .auth-card { padding: 28px 22px; }
}