:root {
  --side-bg: #0f1117;
  --side-surface: #1e2335;
  --side-border: #2a2f45;
  --gold: #d4a843;
  --gold-dim: #a07828;
  --green: #1fa971;
  --red: #d64545;
  --page-bg: #f4f5f8;
  --text: #1d2130;
  --muted: #6b7280;
}

body { background: var(--page-bg); color: var(--text); font-size: 14px; }
.layout { display: flex; min-height: 100vh; }

/* SIDEBAR */
.sidebar { width: 236px; background: var(--side-bg); color: #9ca3af; display: flex; flex-direction: column; flex-shrink: 0; position: sticky; top: 0; height: 100vh; z-index: 1030; }
.logo { padding: 18px 18px 14px; border-bottom: 1px solid var(--side-border); }
.sidebar-logo { max-height: 46px; max-width: 160px; display: block; margin-bottom: 6px; background: #fff; border-radius: 6px; padding: 3px; }
.logo-name { font-size: 18px; font-weight: 700; color: var(--gold); letter-spacing: -.3px; }
.logo-sub { font-size: 10px; text-transform: uppercase; letter-spacing: 1.2px; color: #6b7280; }
.nav-scroll { overflow-y: auto; flex: 1; padding-bottom: 12px; }
.nav-section { padding: 14px 18px 4px; font-size: 10px; text-transform: uppercase; letter-spacing: 1.2px; color: #6b7280; font-weight: 600; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 7px 12px; margin: 1px 8px; border-radius: 6px; color: #b4bac6; text-decoration: none; font-size: 13px; }
.nav-item i { width: 18px; text-align: center; font-size: 15px; }
.nav-item:hover { background: var(--side-surface); color: #fff; }
.nav-item.active { background: rgba(212,168,67,.15); color: var(--gold); }
.sidebar-footer { padding: 10px 18px; border-top: 1px solid var(--side-border); font-size: 11px; color: #6b7280; }

/* MAIN */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 24px; background: #fff; border-bottom: 1px solid #e5e7eb; position: sticky; top: 0; z-index: 1020; }
.page-title { font-size: 18px; font-weight: 600; margin: 0; }
.content { padding: 22px 24px; }

.currency-toggle { display: flex; border: 1px solid #d1d5db; border-radius: 8px; overflow: hidden; }
.cur-btn { padding: 4px 12px; font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: none; }
.cur-btn.active { background: var(--gold); color: #0f1117; }

.btn-gold { background: var(--gold); border-color: var(--gold); color: #0f1117; font-weight: 600; }
.btn-gold:hover { background: var(--gold-dim); border-color: var(--gold-dim); color: #fff; }

/* CARDS */
.card { border: 1px solid #e5e7eb; border-radius: 12px; box-shadow: none; }
.card-header { background: #fff; border-bottom: 1px solid #eef0f3; font-weight: 600; border-radius: 12px 12px 0 0 !important; }
.stat-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 16px 18px; height: 100%; }
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.stat-value { font-size: 22px; font-weight: 700; line-height: 1.1; }
.stat-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.text-income { color: var(--green) !important; }
.text-expense { color: var(--red) !important; }
.text-profit { color: var(--gold-dim) !important; }

/* TABLES */
.table { margin-bottom: 0; }
.table thead th { background: #f8f9fb; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.table td, .table th { vertical-align: middle; }
.table .num, .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td, .table tr.total-row td { background: #f3f4f6; font-weight: 700; }
.table-matrix td, .table-matrix th { font-size: 12px; padding: 6px 8px; }
.biz-dot { display: inline-flex; width: 28px; height: 28px; border-radius: 7px; align-items: center; justify-content: center; font-size: 14px; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.pill-profit { background: rgba(31,169,113,.12); color: var(--green); }
.pill-loss { background: rgba(214,69,69,.12); color: var(--red); }
.row-link { cursor: pointer; }

/* DUE CARD */
.due-card td { text-align: center; font-size: 12px; }
.due-card td.paid { background: rgba(31,169,113,.14); color: #146c48; font-weight: 600; }
.due-card td.partial { background: rgba(212,168,67,.2); }
.due-card td.none { color: #c0c4cc; }

/* DISBURSEMENT indicators */
.ind-full { background: rgba(31,169,113,.10) !important; }
.ind-half-credit { background: rgba(74,140,255,.10) !important; }
.ind-half { background: rgba(212,168,67,.14) !important; }
.ind-none { background: rgba(214,69,69,.10) !important; }
.legend-box { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: middle; margin-right: 4px; border: 1px solid #ddd; }

/* LOGIN */
.login-page { background: var(--side-bg); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-box { background: #fff; border-radius: 14px; padding: 32px; width: 100%; max-width: 380px; margin: 16px; }
.login-logo { font-size: 38px; color: var(--gold); }

.print-header { display: none; }

@media (max-width: 991.98px) {
  .sidebar { position: fixed; left: -250px; transition: left .2s; }
  .sidebar.open { left: 0; box-shadow: 0 0 30px rgba(0,0,0,.4); }
  .content { padding: 16px; }
  .topbar { padding: 10px 16px; }
}

@media print {
  .sidebar, .topbar, .no-print, .btn, form.filter-form, .alert { display: none !important; }
  .content { padding: 0; }
  body { background: #fff; font-size: 11px; }
  .card { border: none; }
  .print-header { display: block; text-align: center; margin-bottom: 10px; }
  .tab-content > .tab-pane { display: block !important; opacity: 1 !important; margin-bottom: 12px; }
  .table-responsive { overflow: visible !important; }
}