:root {
    --primary: #1a56db;
    --primary-dark: #1e40af;
    --primary-light: #dbeafe;
    --success: #0e9f6e;
    --danger: #f05252;
    --warning: #ff5a1f;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --sidebar-w: 260px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* Glassmorphism card */
.glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
}

.card {
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-w);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: linear-gradient(180deg, #1e3a8a 0%, #1a56db 100%);
    color: white;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    padding: 24px 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-brand .brand-name {
    font-size: 20px;
    font-weight: 800;
    background: linear-gradient(135deg, #fff, #93c5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-brand .brand-sub {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-nav {
    padding: 12px 12px;
    flex: 1;
}

.sidebar-nav .nav-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 8px 8px 4px;
    margin-top: 8px;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-bottom: 2px;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.sidebar-nav .nav-link i {
    font-size: 18px;
    width: 22px;
}

.sidebar-user {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-user .user-name {
    font-size: 13px;
    font-weight: 600;
}

.sidebar-user .user-id {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

/* Main content */
.main-content {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 0 28px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.page-content {
    padding: 28px;
    flex: 1;
}

/* Stats cards */
.stat-card {
    background: white;
    border-radius: 14px;
    padding: 20px 22px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.stat-card .icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-card .label {
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
}

.stat-card .value {
    font-size: 26px;
    font-weight: 700;
    margin-top: 4px;
}

.stat-card .accent-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
}

/* Balance card */
.balance-card {
    background: linear-gradient(135deg, #1e3a8a 0%, #1a56db 60%, #3b82f6 100%);
    border-radius: 20px;
    padding: 28px;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(26, 86, 219, 0.3);
}

.balance-card::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 180px;
    height: 180px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
}

.balance-card::after {
    content: '';
    position: absolute;
    bottom: -60px;
    right: 20px;
    width: 220px;
    height: 220px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50%;
}

.balance-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.balance-amount {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -1px;
    margin: 6px 0;
}

.balance-currency {
    font-size: 18px;
    font-weight: 600;
    opacity: 0.8;
}

/* Buttons */
.btn-primary-custom {
    background: linear-gradient(135deg, #1a56db, #3b82f6);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary-custom:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(26, 86, 219, 0.35);
    color: white;
}

/* Badge */
.status-badge {
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

/* Table */
.table-custom thead th {
    background: #f8fafc;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
}

.table-custom tbody td {
    padding: 14px 16px;
    font-size: 13px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.table-custom tbody tr:hover {
    background: #f8fafc;
}

/* Form */
.form-control,
.form-select {
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    padding: 10px 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.12);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.4s ease forwards;
}

/* Alert */
.alert {
    border-radius: 10px;
    border: none;
    font-size: 13px;
}

/* Mobile sidebar */
.sidebar-overlay {
    display: none;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }

    .sidebar-overlay.show {
        display: block;
    }
}

/* Loading spinner */
.spinner-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
}

.spinner-overlay.show {
    display: flex;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}