/* Aloval Credit — staff & portal styles (Bootstrap 5.3 base) */
:root {
  --brand: #0f6b5c; --brand-dark: #0b4d43; --brand-ink: #0e2a27; --side-bg: #10231f; --side-ink: #b9cbc6;
  --surface: #f5f7f6; --line: #e3e8e6;
  --bs-primary: #0f6b5c; --bs-primary-rgb: 15,107,92; --bs-link-color: #0f6b5c; --bs-link-color-rgb: 15,107,92; --bs-link-hover-color: #0b4d43;
  --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark); --bs-btn-active-bg: var(--brand-dark); --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); --bs-btn-active-bg: var(--brand-dark); }
.text-bg-primary { background-color: var(--brand) !important; }
.form-control:focus, .form-select:focus { border-color: #5fa898; box-shadow: 0 0 0 .2rem rgba(15,107,92,.15); }
body { background: var(--surface); color: #1d2b29; font-size: .925rem; }
.num, td.num, th.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 236px; flex: 0 0 236px; background: var(--side-bg); color: var(--side-ink); position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 14px 10px 24px; }
.brand { display: flex; gap: 10px; align-items: center; color: #fff; text-decoration: none; padding: 4px 8px 16px; }
.brand small { display: block; color: var(--side-ink); font-size: .72rem; }
.brand strong { font-size: .9rem; line-height: 1.15; display: block; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #1aa38a, #0f6b5c); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.sidebar .nav-link { color: var(--side-ink); border-radius: 7px; padding: .42rem .65rem; display: flex; align-items: center; gap: .6rem; font-size: .88rem; }
.sidebar .nav-link i { font-size: 1rem; opacity: .85; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar .nav-link.active { background: rgba(26,163,138,.18); color: #fff; }
.sidebar .nav-link.sub { padding-left: 2.2rem; font-size: .84rem; }
.nav-section { text-transform: uppercase; font-size: .68rem; letter-spacing: .08em; color: #6f8a84; padding: 16px 10px 4px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 56px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 20px; position: sticky; top: 0; z-index: 20; }
.topsearch { align-items: center; gap: 6px; background: var(--surface); border-radius: 8px; padding: 0 8px; width: 340px; }
.topsearch input { border: 0; background: transparent; box-shadow: none !important; }
.content { padding: 22px 26px 60px; max-width: 1400px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 1.35rem; margin: 0; font-weight: 650; }
.page-head .sub { color: #6b7b78; font-size: .85rem; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.card { border: 1px solid var(--line); border-radius: 10px; box-shadow: none; }
.card-header { background: #fff; border-bottom: 1px solid var(--line); font-weight: 600; font-size: .9rem; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; height: 100%; }
.kpi .label { color: #6b7b78; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.kpi .value { font-size: 1.45rem; font-weight: 650; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpi .hint { font-size: .78rem; color: #6b7b78; }
.kpi.warn .value { color: #b45309; } .kpi.bad .value { color: #b42318; } .kpi.good .value { color: var(--brand); }
.table { --bs-table-bg: transparent; font-size: .87rem; }
.table thead th { color: #5b6b68; font-weight: 600; font-size: .76rem; text-transform: uppercase; letter-spacing: .03em; border-bottom-color: var(--line); white-space: nowrap; }
.table-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }
.table-card .table { margin: 0; }
.table-card .table td, .table-card .table th { padding: .55rem .75rem; }
.dl-grid { display: grid; grid-template-columns: 160px 1fr; gap: 6px 14px; font-size: .88rem; }
.dl-grid dt { color: #6b7b78; font-weight: 500; }
.dl-grid dd { margin: 0; }
.rule-ok { color: var(--brand); } .rule-bad { color: #b42318; }
.timeline { list-style: none; padding-left: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 12px 18px; border-left: 2px solid var(--line); margin-left: 6px; font-size: .84rem; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.bar { height: 8px; background: #e6ece9; border-radius: 4px; overflow: hidden; } .bar > span { display: block; height: 100%; background: var(--brand); }
.nav-tabs .nav-link { color: #5b6b68; } .nav-tabs .nav-link.active { color: var(--brand-ink); font-weight: 600; }
.badge { font-weight: 600; letter-spacing: .01em; }
.empty { text-align: center; color: #7b8a87; padding: 28px 10px; }
.auth-page { background: radial-gradient(1200px 600px at 10% -10%, #d9efe9, transparent), var(--surface); }
.auth-wrap { max-width: 420px; margin: 7vh auto; padding: 0 16px; }
.auth-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 28px; box-shadow: 0 10px 30px rgba(16,35,31,.06); }
.auth-brand { display: flex; gap: 10px; align-items: center; margin-bottom: 20px; }
.auth-brand small { display: block; color: #6b7b78; }
.print-page { background: #fff; }
@media print { .no-print { display: none !important; } body { font-size: 11pt; } }
@media (max-width: 991px) {
  .sidebar { position: fixed; z-index: 50; left: -250px; transition: left .2s; }
  .sidebar.open { left: 0; }
  .content { padding: 16px; }
  .dl-grid { grid-template-columns: 120px 1fr; }
}
/* portal */
.portal { background: var(--surface); }
.portal-top { background: var(--side-bg); color: #fff; }
.portal-top a { color: #fff; text-decoration: none; }
.portal .container { max-width: 880px; }
.loan-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.big-amount { font-size: 1.8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (min-width: 992px) { body.staff { background: linear-gradient(to right, var(--side-bg) 236px, var(--surface) 236px); } .main { background: var(--surface); } }
@media print { .sidebar, .topbar, .page-head .actions, .no-print, form.no-print { display: none !important; } body.staff { background: #fff; } .content { padding: 0; } }

/* ---------- customer portal ---------- */
.portal-page { background: var(--surface); }
.portal-nav { background: #fff; border-bottom: 1px solid var(--line); }
.portal-nav .nav-link.active { color: var(--brand, #0f6b5c); font-weight: 600; }
.loan-card { border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 20px; }
.loan-card .big { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; }
.loan-card .lbl { font-size: .78rem; color: #6b7b78; text-transform: uppercase; letter-spacing: .04em; }
.due-pill { display: inline-block; padding: 4px 10px; border-radius: 999px; background: #e7f4f0; color: #0f6b5c; font-size: .85rem; font-weight: 600; }
.due-pill.late { background: #fde8e8; color: #b42318; }
@media (max-width: 576px) { .loan-card .big { font-size: 1.4rem; } }

/* ---------- platform console (Aloval) ---------- */
body.platform { --side-bg: #1d2340; }
body.platform .sidebar .brand-mark { background: linear-gradient(135deg, #6c7ae0, #3b47a8); }
body.platform .sidebar .nav-link.active { background: rgba(255,255,255,.12); }
.usage-bar { height: 6px; border-radius: 3px; background: #e9ecef; overflow: hidden; }
.usage-bar > span { display: block; height: 100%; background: #0f6b5c; }
.usage-bar.warn > span { background: #d97706; }
.usage-bar.full > span { background: #b42318; }
.cred-box { font-family: var(--bs-font-monospace); background: #fff8e1; border: 1px dashed #d97706; border-radius: 8px; padding: 12px 14px; }
