:root {
  --bg: #0b1220;
  --surface: #111827;
  --border: rgba(255,255,255,.08);
  --text: #e5e7eb;
  --muted: #9ca3af;
  --primary: #6366f1;
  --primary-2: #4f46e5;
  --accent: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --card-shadow: 0 10px 30px rgba(15,23,42,.08);
}
* { box-sizing: border-box; }
html, body { height:100%; }
body { margin:0; font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif; background: #eef2ff; color: #0f172a; -webkit-tap-highlight-color: transparent; }
.bg-app { min-height:100vh; background: radial-gradient(1200px 600px at 10% -10%, #312e81 0%, transparent 60%), radial-gradient(900px 500px at 100% 0%, #0ea5e9 0%, transparent 50%), #0b1220; }
.glass { background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.6); box-shadow: 0 20px 50px rgba(2,6,23,.25); border-radius: 20px; }
.brand-badge { display:inline-flex; align-items:center; gap:.6rem; font-weight:700; color:#111827; }
.brand-icon { width:40px; height:40px; border-radius:12px; display:inline-flex; align-items:center; justify-content:center; background: linear-gradient(135deg,#6366f1,#22c55e); color:#fff; box-shadow:0 10px 20px rgba(99,102,241,.35); flex:0 0 auto; }
.btn-primary { background: linear-gradient(135deg,var(--primary),#3b82f6); border:0; box-shadow:0 10px 20px rgba(79,70,229,.22); }
.btn-primary:hover,.btn-primary:focus { filter:brightness(1.05); }
.btn { border-radius:12px; }
.form-control, .form-select { border-radius:12px; padding:.72rem .95rem; border-color:#e5e7eb; }
.form-control:focus, .form-select:focus { border-color:#a5b4fc; box-shadow:0 0 0 .25rem rgba(99,102,241,.15); }
/* Layout */
.app-shell { display:flex; min-height:100vh; background: linear-gradient(180deg,#f8fafc 0%, #eef2ff 100%); }
.sidebar { width:280px; background: linear-gradient(180deg,#0b1220 0%, #111827 100%); color:#e5e7eb; padding:22px 16px; position:sticky; top:0; height:100vh; border-right:1px solid rgba(255,255,255,.04); }
.sidebar-scroll { overflow:auto; padding-right:2px; }
.sidebar .brand { display:flex; align-items:center; gap:12px; padding:4px 8px 18px; border-bottom:1px solid var(--border); margin-bottom:14px; }
.sidebar .brand-title { font-weight:800; font-size:1.05rem; line-height:1.2; letter-spacing:.2px; }
.sidebar .brand-sub { color:#9ca3af; font-size:.78rem; }
.nav-section { font-size:.7rem; text-transform:uppercase; letter-spacing:.09em; color:#94a3b8; padding:12px 10px 6px; font-weight:700; }
.side-link { display:flex; align-items:center; gap:10px; padding:10px 12px; color:#cbd5e1; text-decoration:none; border-radius:12px; margin-bottom:4px; font-weight:500; transition: all .18s ease; }
.side-link i { font-size:1.05rem; opacity:.95; }
.side-link:hover { background:rgba(255,255,255,.07); color:#fff; transform: translateX(2px); }
.side-link.active { background: linear-gradient(135deg, rgba(99,102,241,.95), rgba(59,130,246,.9)); color:#fff; box-shadow:0 8px 18px rgba(79,70,229,.35); }
.sidebar-footer { border-top:1px solid var(--border); }
.mini-user { display:flex; align-items:center; gap:10px; padding:8px; }
.min-w-0 { min-width:0; }
.main { flex:1; min-width:0; display:flex; flex-direction:column; }
.topbar { background:rgba(255,255,255,.85); backdrop-filter: blur(10px); border-bottom:1px solid #e5e7eb; padding:12px 22px; display:flex; align-items:center; justify-content:space-between; position:sticky; top:0; z-index:20; }
.menu-btn { width:40px; height:40px; display:inline-flex; align-items:center; justify-content:center; border-radius:12px; }
.page-title { font-weight:800; font-size:1.1rem; color:#0f172a; line-height:1.2; }
.page-subtitle { color:#64748b; font-size:.82rem; }
.page { padding:22px; padding-bottom:28px; }
.card { border:0; border-radius:18px; box-shadow: var(--card-shadow); background:#fff; overflow:hidden; }
.card-header { background:#fff; border-bottom:1px solid #eef2f7; padding:16px 18px; font-weight:700; color:#0f172a; }
.card-body { padding:18px; }
.stat-card { border-radius:18px; padding:18px; color:#fff; position:relative; overflow:hidden; min-height:104px; box-shadow:0 12px 28px rgba(15,23,42,.15); }
.stat-card .label { font-size:.84rem; opacity:.92; font-weight:500; }
.stat-card .value { font-size:1.75rem; font-weight:800; margin-top:4px; letter-spacing:-.02em; }
.stat-card .meta { font-size:.78rem; opacity:.85; margin-top:4px; }
.stat-card::after { content:""; position:absolute; right:-18px; top:-18px; width:95px; height:95px; background:rgba(255,255,255,.16); border-radius:50%; }
.stat-card::before { content:""; position:absolute; right:35px; bottom:-30px; width:80px; height:80px; background:rgba(255,255,255,.10); border-radius:50%; }
.bg-grad-1{background:linear-gradient(135deg,#6366f1,#3b82f6);} .bg-grad-2{background:linear-gradient(135deg,#10b981,#22c55e);} .bg-grad-3{background:linear-gradient(135deg,#f59e0b,#f97316);} .bg-grad-4{background:linear-gradient(135deg,#ec4899,#ef4444);} .bg-grad-5{background:linear-gradient(135deg,#0ea5e9,#6366f1);} 
.table { margin-bottom:0; }
.table thead th { color:#64748b; font-size:.75rem; text-transform:uppercase; letter-spacing:.05em; border-bottom:1px solid #e5e7eb; background:#f8fafc; white-space:nowrap; }
.table td { vertical-align: middle; border-color:#f1f5f9; }
.badge-soft { padding:.45em .7em; border-radius:999px; font-weight:600; font-size:.75rem; }
.badge-masuk{background:#dcfce7;color:#166534;} .badge-keluar{background:#e0e7ff;color:#3730a3;} .role-badge{background:#eef2ff;color:#4338ca;}
.avatar { width:36px; height:36px; border-radius:11px; background:linear-gradient(135deg,#e0e7ff,#c7d2fe); color:#3730a3; display:inline-flex; align-items:center; justify-content:center; font-weight:800; flex:0 0 auto; }
.saldo-chip { align-items:center; gap:.45rem; background:#ecfeff; color:#155e75; border:1px solid #cffafe; padding:.4rem .7rem; border-radius:999px; font-weight:700; font-size:.85rem; }
.mobile-sidebar { background: linear-gradient(180deg,#0b1220 0%, #111827 100%); color:#e5e7eb; max-width:86vw; }
.mobile-sidebar .offcanvas-body { background: transparent; }
.search-input { padding-left:2.4rem; background: #fff url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%2394a3b8" class="bi bi-search" viewBox="0 0 16 16"><path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001q.044.06.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0"/></svg>') no-repeat .85rem center; }
.table-responsive { -webkit-overflow-scrolling: touch; overflow-x: auto; }
.empty-state { padding: 2rem 1rem; text-align:center; color:#64748b; }
.kpi-icon { width:40px;height:40px;border-radius:12px;display:inline-flex;align-items:center;justify-content:center;background:rgba(255,255,255,.2); }
/* Mobile / WebView tweaks */
@media (max-width: 991.98px){
  .page{padding:14px; padding-bottom:24px;}
  .topbar{padding:10px 14px;}
  .page-title{font-size:1rem;}
  .card-header,.card-body{padding:14px;}
  .stat-card{min-height:96px; padding:16px;}
  .stat-card .value{font-size:1.5rem;}
  .table thead th, .table td { font-size:.92rem; }
}
@media (max-width: 575.98px){
  .page{padding:12px;}
  .btn { padding-top:.6rem; padding-bottom:.6rem; }
  .card { border-radius:16px; }
}
/* subtle animation */
.fade-in-up { animation: fadeInUp .35s ease both; }
@keyframes fadeInUp { from { opacity:0; transform: translateY(6px);} to { opacity:1; transform: translateY(0);} }
