:root {
  --primary: #1e3a8a;
  --secondary: #3b82f6;
  --accent: #10b981;
  --bg-main: #f1f5f9;
  --text-main: #334155;
  --sidebar-width: 260px;
}
body { font-family: 'Inter', sans-serif; background: var(--bg-main); color: var(--text-main); margin: 0; overflow-x: hidden; }
.fade-in { animation: fadeIn .3s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: linear-gradient(135deg, #0f172a 0%, var(--primary) 100%); }
.login-card { background: rgba(255,255,255,.97); border-radius: 1.25rem; box-shadow: 0 25px 50px -12px rgba(0,0,0,.25); padding: 2.25rem; width: 100%; max-width: 420px; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-width); min-width: var(--sidebar-width); background: #0f172a; color: #fff; display: flex; flex-direction: column; z-index: 1040; height: 100vh; position: sticky; top: 0; transition: left .25s; }
.sidebar-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,.06); text-align: center; }
.sidebar-menu { flex-grow: 1; overflow-y: auto; padding: .75rem 0 1.5rem; }
.menu-header { font-size: .7rem; text-transform: uppercase; color: #64748b; padding: .9rem 1.5rem .25rem; font-weight: 600; letter-spacing: .5px; }
.nav-item-custom { padding: .6rem 1.5rem; color: #94a3b8; text-decoration: none; display: flex; align-items: center; gap: 12px; cursor: pointer; border-left: 4px solid transparent; font-size: .93rem; }
.nav-item-custom:hover, .nav-item-custom.active { background: rgba(255,255,255,.05); color: #f8fafc; border-left-color: var(--secondary); }
.nav-item-custom .badge { margin-left: auto; }

.main-content { flex-grow: 1; display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }
.topbar { min-height: 64px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.05); display: flex; align-items: center; justify-content: space-between; padding: 0 1.25rem; position: sticky; top: 0; z-index: 1030; }
.avatar-btn { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--primary); color: #fff; font-weight: 700; font-size: 1.1rem; }
.app-page { padding: 1.5rem; flex-grow: 1; }

.card-stat { border: none; border-radius: 1rem; color: #fff; transition: transform .2s; cursor: default; }
.card-stat:hover { transform: translateY(-3px); }
.card-ui { border: none; border-radius: 1rem; box-shadow: 0 4px 6px -1px rgba(0,0,0,.05); margin-bottom: 1.5rem; }
.card-ui > .card-header { background: #fff; border-bottom: 1px solid #eef2f7; border-radius: 1rem 1rem 0 0; }
.img-preview { max-height: 40px; max-width: 100px; object-fit: contain; border-radius: 4px; background: #e2e8f0; }
.recap-badge { font-size: .7rem; margin-left: 3px; padding: 2px 6px; }
.table thead th { font-size: .82rem; white-space: nowrap; }
.table td { font-size: .9rem; }
.table-sticky thead th { position: sticky; top: 0; z-index: 2; }
.scroll-box { max-height: 60vh; overflow: auto; }
.nowrap { white-space: nowrap; }
.btn-xs { padding: .15rem .45rem; font-size: .78rem; }
.money { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.page-title { font-weight: 700; margin-bottom: .25rem; }
.page-sub { color: #64748b; font-size: .875rem; margin-bottom: 1.25rem; }
.nav-tabs .nav-link { font-weight: 600; font-size: .9rem; }
.picker { position: relative; }
.picker-list { position: absolute; z-index: 1060; left: 0; right: 0; top: 100%; max-height: 260px; overflow-y: auto; background: #fff; border: 1px solid #dee2e6; border-radius: .5rem; box-shadow: 0 10px 20px rgba(0,0,0,.08); }
.picker-list button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: .45rem .75rem; font-size: .9rem; }
.picker-list button:hover, .picker-list button:focus { background: #eff6ff; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.empty { padding: 2rem 1rem; text-align: center; color: #94a3b8; }
.radio-cell input { width: 1.15em; height: 1.15em; cursor: pointer; }
.tagihan-row.lunas { opacity: .55; }
.kpi-small { font-size: .78rem; color: #64748b; }
.portal-hero { background: linear-gradient(135deg, var(--primary), #2563eb); color: #fff; border-radius: 1rem; padding: 1.25rem 1.5rem; }

#fullPageLoader { position: fixed; inset: 0; background: rgba(255,255,255,.95); z-index: 9999; display: flex; align-items: center; justify-content: center; flex-direction: column; }

@media (max-width: 768px) {
  .sidebar { position: fixed; left: -100%; }
  .sidebar.show { left: 0; }
  .overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 1035; }
  .overlay.show { display: block; }
  .app-page { padding: 1rem; }
  .topbar { padding: 0 .75rem; }
}
@media print { .no-print { display: none !important; } }

/* kredit pengembang */
.dev-credit { color: #64748b; }
.dev-credit a { color: inherit; text-decoration: none !important; display: inline-flex; align-items: center; gap: 5px; vertical-align: middle; transition: color .2s; }
.dev-credit a:hover { color: var(--primary); }
.dev-credit img { border-radius: 4px; }
