:root {
    --sidebar-w: 255px;
    --brand: #4f46e5;
    --brand-dark: #1e1b4b;
    --bg: #f4f6fb;
}
body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: #1f2937; }

/* ---------- Sidebar ---------- */
.sidebar {
    background: linear-gradient(180deg, var(--brand-dark), #312e81);
    color: #c7d2fe;
}
@media (min-width: 992px) {
    .sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: var(--sidebar-w); overflow-y: auto; }
    .main { margin-left: var(--sidebar-w); }
}
@media (max-width: 991.98px) {
    .sidebar.offcanvas-lg { width: var(--sidebar-w); }
}
.sidebar-brand { display: flex; align-items: center; gap: .6rem; padding: 1.25rem 1.25rem .5rem; font-weight: 700; font-size: 1.15rem; color: #fff; }
.sidebar-brand i { font-size: 1.5rem; color: #a5b4fc; }
.sidebar-role { padding: 0 1.25rem 1rem; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: #818cf8; }
.sidebar .nav { padding: 0 .75rem 1.5rem; }
.sidebar .nav-link { display: flex; align-items: center; gap: .7rem; color: #c7d2fe; border-radius: .55rem; padding: .62rem .85rem; margin-bottom: 2px; font-size: .93rem; }
.sidebar .nav-link i { font-size: 1.1rem; width: 1.2rem; text-align: center; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar .nav-link.active { background: var(--brand); color: #fff; box-shadow: 0 4px 14px rgba(79,70,229,.45); }

/* ---------- Topbar ---------- */
.topbar { display: flex; align-items: center; gap: .75rem; background: #fff; padding: .8rem 1.5rem; border-bottom: 1px solid #e5e7eb; position: sticky; top: 0; z-index: 1020; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; }
.content { padding: 1.5rem; }
@media (max-width: 575.98px) { .content { padding: 1rem; } .topbar { padding: .7rem 1rem; } }

/* ---------- Cards ---------- */
.card { border: 0; border-radius: .9rem; box-shadow: 0 1px 3px rgba(16,24,40,.06), 0 1px 2px rgba(16,24,40,.04); }
.card-header { background: #fff; border-bottom: 1px solid #f0f1f5; font-weight: 600; padding: .9rem 1.25rem; border-radius: .9rem .9rem 0 0 !important; }
.stat-card .stat-icon { width: 48px; height: 48px; flex: 0 0 48px; border-radius: .75rem; display: flex; align-items: center; justify-content: center; font-size: 1.35rem; }
.min-w-0 { min-width: 0; }
.balance-hero { background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff; }
.balance-hero .small { color: #e0e7ff; }

/* ---------- Tables ---------- */
.table { margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .7rem .9rem; vertical-align: middle; }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; background: #f9fafb; white-space: nowrap; }
.thumb { width: 56px; height: 56px; object-fit: cover; border-radius: .4rem; border: 1px solid #e5e7eb; }
.chart-box { position: relative; height: 320px; }
.chart-box.sm { height: 260px; }

.btn-primary { background: var(--brand); border-color: var(--brand); }
.btn-primary:hover { background: #4338ca; border-color: #4338ca; }
.nav-pills .nav-link.active { background: var(--brand); }
.form-label { font-weight: 500; font-size: .9rem; }
.payment-info { white-space: pre-line; background: #eef2ff; border: 1px dashed #a5b4fc; border-radius: .6rem; padding: 1rem; }

/* ---------- Auth pages ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1e1b4b, #4f46e5); padding: 1rem; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .brand { font-size: 1.5rem; font-weight: 700; color: var(--brand-dark); }

@media print {
    .sidebar, .topbar, .no-print, footer { display: none !important; }
    .main { margin-left: 0 !important; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}
