@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ===========================
   DESIGN SYSTEM - TOKENS (LIGHT DEFAULT)
   =========================== */
:root {
    /* Primary Palette */
    --primary: #6366f1;
    --primary-light: #6366f1;
    --primary-dark: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.18);
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);

    /* Surface Colors - Light Mode */
    --bg-body: #f4f6fb;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8f9fc;
    --bg-input: #f8f9fc;
    --bg-elevated: #f1f3f9;
    --bg-overlay: rgba(0, 0, 0, 0.35);

    /* Border & Dividers */
    --border: #e5e7eb;
    --border-light: #d1d5db;
    --border-focus: rgba(99, 102, 241, 0.5);

    /* Text */
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --text-inverse: #f1f5f9;

    /* Semantic */
    --success: #059669;
    --success-light: rgba(5, 150, 105, 0.08);
    --success-border: rgba(5, 150, 105, 0.2);
    --danger: #dc2626;
    --danger-light: rgba(220, 38, 38, 0.06);
    --danger-border: rgba(220, 38, 38, 0.18);
    --warning: #d97706;
    --warning-light: rgba(217, 119, 6, 0.06);
    --warning-border: rgba(217, 119, 6, 0.18);
    --info: #0891b2;
    --info-light: rgba(8, 145, 178, 0.06);
    --info-border: rgba(8, 145, 178, 0.18);
    --pending: #d97706;
    --pending-light: rgba(217, 119, 6, 0.06);

    /* Sidebar text for light */
    --sidebar-text: #4b5563;
    --sidebar-text-hover: #111827;
    --sidebar-section: #9ca3af;

    /* Radii */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 20px var(--primary-glow);

    /* Spacing */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 75px;
    --topbar-height: 64px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===========================
   DARK THEME OVERRIDE
   =========================== */
[data-theme="dark"] {
    --bg-body: #0b0f1a;
    --bg-sidebar: #0d1117;
    --bg-card: #111827;
    --bg-card-hover: #1a2332;
    --bg-input: #151d2b;
    --bg-elevated: #1e293b;
    --bg-overlay: rgba(0, 0, 0, 0.6);

    --border: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.1);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-inverse: #0f172a;

    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.12);
    --success-border: rgba(16, 185, 129, 0.25);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.12);
    --danger-border: rgba(239, 68, 68, 0.25);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.12);
    --warning-border: rgba(245, 158, 11, 0.25);
    --info: #06b6d4;
    --info-light: rgba(6, 182, 212, 0.12);
    --info-border: rgba(6, 182, 212, 0.25);

    --primary-light: #818cf8;
    --primary-glow: rgba(99, 102, 241, 0.3);

    --sidebar-text: #cbd5e1;
    --sidebar-text-hover: #fff;
    --sidebar-section: #64748b;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); }
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }


/* ===========================
   RESET & BASE
   =========================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    font-size: 13.5px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
table { width: 100%; border-collapse: collapse; }
input, select, textarea, button { font-family: inherit; }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.2); }


/* ===========================
   SIDEBAR NAVIGATION
   =========================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    transition: var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-logo {
    padding: 22px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar-logo img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.logo-dark { display: none; }
[data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-dark { display: block; }

.sidebar-logo .logo-icon {
    width: 38px;
    height: 38px;
    background: var(--primary-gradient);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    box-shadow: var(--shadow-glow);
    flex-shrink: 0;
}

.sidebar-logo .logo-text {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.3px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar nav {
    flex: 1;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
}

.nav-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--sidebar-section);
    padding: 16px 14px 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 2px;
    color: var(--sidebar-text);
    font-weight: 500;
    font-size: 13.5px;
    transition: var(--transition-fast);
    position: relative;
    white-space: nowrap;
}

.nav-link i {
    width: 22px;
    font-size: 15px;
    margin-right: 12px;
    text-align: center;
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.nav-link:hover {
    background: var(--bg-elevated);
    color: var(--sidebar-text-hover);
}

.nav-link.active {
    background: var(--primary-gradient);
    color: #fff;
    font-weight: 600;
    box-shadow: var(--shadow-glow);
}

.nav-link.active i { color: #fff; }

.nav-link.nav-danger {
    color: var(--danger);
    margin-top: auto;
}

.nav-link.nav-danger:hover {
    background: var(--danger-light);
    color: var(--danger);
}

/* Sidebar User Card */
.sidebar-user-card {
    padding: 16px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar-user-card .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-user-card .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-user-card .user-details {
    flex: 1;
    min-width: 0;
}

.sidebar-user-card .user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-card .user-role {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: capitalize;
}


/* ===========================
   MAIN CONTENT AREA
   =========================== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

/* Sidebar Collapsed State (Desktop) */
body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
    overflow: visible;
}

body.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .sidebar-logo {
    padding: 22px 0;
    justify-content: center;
}

body.sidebar-collapsed .nav-section-title,
body.sidebar-collapsed .sidebar-footer .footer-trust span,
body.sidebar-collapsed .sidebar-footer .version-tag {
    display: none;
}

body.sidebar-collapsed .sidebar-footer {
    padding: 24px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

body.sidebar-collapsed .footer-meta {
    justify-content: center;
}

body.sidebar-collapsed .nav-link {
    justify-content: center;
    padding: 12px 0;
}

body.sidebar-collapsed .nav-link i {
    margin-right: 0;
    font-size: 18px;
}

body.sidebar-collapsed .nav-link span {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    z-index: 1001;
    pointer-events: none;
}

body.sidebar-collapsed .nav-link:hover span {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(15px);
}

/* Mobile Sidebar Handling */
@media (max-width: 768px) {
    .sidebar {
        left: calc(-1 * var(--sidebar-width));
    }
    
    body.sidebar-open .sidebar {
        left: 0;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    body.sidebar-collapsed .sidebar {
        left: calc(-1 * var(--sidebar-width));
    }
}


/* ===========================
   TOP BAR
   =========================== */
.top-bar {
    background: var(--bg-card);
    padding: 0 24px;
    height: var(--topbar-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-shrink: 0;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.toggle-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: var(--transition-fast);
}

.toggle-btn:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
}

.page-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.page-title .role-tag {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    background: var(--primary-light);
    color: #fff;
    margin-left: 10px;
    vertical-align: middle;
}

/* Wallet Badge in Top Bar */
.wallet-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-elevated);
    padding: 8px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

.wallet-badge .wallet-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wallet-badge .wallet-amount {
    font-size: 15px;
    font-weight: 700;
    color: var(--success);
}

/* Profile Dropdown */
.profile-dropdown-wrapper {
    position: relative;
}

.profile-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius);
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

.profile-trigger:hover {
    background: rgba(255,255,255,0.04);
    border-color: var(--border);
}

.profile-trigger .avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

.profile-trigger .user-name-topbar {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.profile-trigger .chevron {
    font-size: 10px;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.profile-dropdown-wrapper.open .profile-trigger .chevron {
    transform: rotate(180deg);
}

.profile-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 220px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: var(--transition);
    z-index: 999;
    overflow: hidden;
}

.profile-dropdown-wrapper.open .profile-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-dropdown .dropdown-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.profile-dropdown .dropdown-header .dd-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.profile-dropdown .dropdown-header .dd-email {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.profile-dropdown .dropdown-item:hover {
    background: rgba(255,255,255,0.04);
    color: var(--text-primary);
}

.profile-dropdown .dropdown-item i {
    width: 18px;
    font-size: 14px;
    text-align: center;
}

.profile-dropdown .dropdown-item.danger {
    color: var(--danger);
    border-top: 1px solid var(--border);
}

.profile-dropdown .dropdown-item.danger:hover {
    background: var(--danger-light);
}


/* ===========================
   PAGE CONTENT WRAPPER
   =========================== */
.page-content {
    padding: 24px;
    flex: 1;
}


/* ===========================
   STAT/METRIC CARDS
   =========================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    background: var(--primary-light);
    color: #fff;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    color: var(--primary-light);
}

.stat-icon.success { background: var(--success-light); color: var(--success); }
.stat-icon.danger { background: var(--danger-light); color: var(--danger); }
.stat-icon.warning { background: var(--warning-light); color: var(--warning); }
.stat-icon.info { background: var(--info-light); color: var(--info); }

.stat-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.stat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.stat-value.text-success { color: var(--success) !important; }
.stat-value.text-danger { color: var(--danger) !important; }
.stat-value.text-info { color: var(--info) !important; }
.stat-value.text-warning { color: var(--warning) !important; }


/* ===========================
   CARDS
   =========================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    border-color: var(--border-light);
}

.card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title i {
    color: var(--primary-light);
    font-size: 16px;
}

.card-body {
    padding: 24px;
}


/* ===========================
   DATA TABLE
   =========================== */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
}

thead th {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-secondary);
    vertical-align: middle;
}

tbody tr {
    transition: var(--transition-fast);
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

tbody tr:last-child td {
    border-bottom: none;
}

tfoot td {
    padding: 14px 16px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 13px;
}


/* ===========================
   FORM ELEMENTS
   =========================== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.2px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 13.5px;
    transition: var(--transition-fast);
    outline: none;
}

.form-control:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: var(--bg-elevated);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

select.form-control option {
    background: var(--bg-card);
    color: var(--text-primary);
}

.form-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}


/* ===========================
   BUTTONS
   =========================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    border: none;
    transition: var(--transition-fast);
    white-space: nowrap;
    line-height: 1.4;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 2px 8px var(--primary-glow);
}

.btn-primary:hover {
    opacity: 0.9;
    box-shadow: 0 4px 16px var(--primary-glow);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    opacity: 0.9;
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    opacity: 0.9;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
}

.btn-block { width: 100%; }


/* ===========================
   BADGES
   =========================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.badge-danger, .badge-failed {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

.badge-warning, .badge-pending {
    background: var(--warning-light);
    color: var(--warning);
    border: 1px solid var(--warning-border);
}

.badge-info {
    background: var(--info-light);
    color: var(--info);
    border: 1px solid var(--info-border);
}

.badge-role {
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary-light);
    border: 1px solid rgba(99, 102, 241, 0.25);
}


/* ===========================
   ALERTS
   =========================== */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-weight: 500;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
}

.alert-success {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.alert-danger {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}


/* ===========================
   AUTH / LOGIN PAGE
   =========================== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-body);
    position: relative;
    overflow: hidden;
}

.auth-container::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    top: -150px;
    right: -150px;
    border-radius: 50%;
    pointer-events: none;
}

.auth-container::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    border-radius: 50%;
    pointer-events: none;
}

.auth-card {
    background: var(--bg-card);
    padding: 40px 36px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.5s ease;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    width: 56px;
    height: 56px;
    background: var(--primary-gradient);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 24px;
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.auth-header h1 {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 6px;
    font-weight: 500;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
}


/* ===========================
   PROFILE PAGE
   =========================== */
.profile-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
}

.profile-card-main {
    text-align: center;
    padding: 32px 24px;
}

.profile-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 800;
    color: #fff;
    margin: 0 auto 16px;
    box-shadow: var(--shadow-glow);
}

.profile-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.profile-role-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary-light);
    border: 1px solid rgba(99, 102, 241, 0.25);
    margin-top: 4px;
}

.profile-meta {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    text-align: left;
}

.profile-meta-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    font-size: 13px;
}

.profile-meta-item i {
    width: 20px;
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
}

.profile-meta-item span {
    color: var(--text-secondary);
}

.profile-detail-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}


/* ===========================
   INFO BOX / TIP BOX
   =========================== */
.info-box {
    padding: 18px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--warning-border);
    background: var(--warning-light);
    color: var(--warning);
}

.info-box h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-box ul {
    padding-left: 20px;
    font-size: 13px;
    line-height: 1.8;
}

.info-box.info {
    border-color: var(--info-border);
    background: var(--info-light);
    color: var(--info);
}

.payment-icons {
    display: flex;
    gap: 16px;
    font-size: 22px;
    color: var(--primary-light);
    padding: 12px 0;
}


/* ===========================
   SIDEBAR TOGGLE LOGIC
   =========================== */
body.sidebar-collapsed .sidebar {
    width: 0;
    padding: 0;
    overflow: hidden;
    opacity: 0;
    border-right: none;
}

body.sidebar-collapsed .main-content {
    margin-left: 0;
}


/* ===========================
   RETURN TO ADMIN BAR
   =========================== */
.admin-impersonate-bar {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: #fff;
    padding: 6px 16px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.admin-impersonate-bar a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    transition: var(--transition-fast);
}

.admin-impersonate-bar a:hover {
    background: rgba(255, 255, 255, 0.3);
}


/* ===========================
   ANIMATIONS
   =========================== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.animate-in-delay-1 { animation-delay: 0.05s; animation-fill-mode: both; }
.animate-in-delay-2 { animation-delay: 0.1s; animation-fill-mode: both; }
.animate-in-delay-3 { animation-delay: 0.15s; animation-fill-mode: both; }


/* ===========================
   EMPTY STATE
   =========================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 14px;
    font-weight: 500;
}


/* ===========================
   PASSWORD TOGGLE
   =========================== */
.password-wrapper {
    position: relative;
}

.password-wrapper .form-control {
    padding-right: 42px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    transition: var(--transition-fast);
}

.password-toggle:hover {
    color: var(--text-primary);
}


/* ===========================
   RESPONSIVE DESIGN
   =========================== */
@media (max-width: 1024px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
    .profile-detail-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 0;
        padding: 0;
        opacity: 0;
        pointer-events: none;
    }

    body.sidebar-open .sidebar {
        width: var(--sidebar-width);
        padding: 0;
        opacity: 1;
        pointer-events: auto;
    }

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

    .top-bar {
        padding: 0 16px;
    }

    .page-content {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .wallet-badge {
        display: none;
    }

    .page-title .role-tag {
        display: none;
    }

    .profile-trigger .user-name-topbar {
        display: none;
    }
}

/* Sidebar Overlay for mobile */
body.sidebar-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-overlay);
    z-index: 999;
}


/* ===========================
   UTILITY CLASSES
   =========================== */
.text-primary { color: var(--primary-light) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-info { color: var(--info) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }

.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
.fw-800 { font-weight: 800 !important; }

.capitalize { text-transform: capitalize; }
.uppercase { text-transform: uppercase; }

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }

.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.mx-auto { margin-left: auto; margin-right: auto; }

.w-full { width: 100%; }
.max-w-600 { max-width: 600px; }
.max-w-800 { max-width: 800px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

@media (max-width: 768px) {
    .grid-2 { grid-template-columns: 1fr; }
}

/* Layout helpers for split views */
.split-layout {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.split-layout .split-aside {
    flex: 1;
    min-width: 340px;
}

.split-layout .split-main {
    flex: 2;
    min-width: 460px;
}

@media (max-width: 768px) {
    .split-layout .split-aside,
    .split-layout .split-main {
        min-width: 100%;
    }
}


/* ===========================
   MODAL / DIALOG
   =========================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-overlay);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    padding: 20px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px) scale(0.97);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-header h2 i {
    color: var(--primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: var(--danger-light);
    color: var(--danger);
    border-color: var(--danger-border);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}


/* ===========================
   THEME TOGGLE BUTTON
   =========================== */
.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.theme-toggle .fa-moon { display: inline; }
.theme-toggle .fa-sun { display: none; }

[data-theme="dark"] .theme-toggle .fa-moon { display: none; }
[data-theme="dark"] .theme-toggle .fa-sun { display: inline; }


/* ===========================
   AUTH LIGHT THEME TWEAKS
   =========================== */
.auth-container {
    background: var(--bg-body);
}

.auth-container::before {
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
}

.auth-container::after {
    background: radial-gradient(circle, rgba(139, 92, 246, 0.05) 0%, transparent 70%);
}

[data-theme="dark"] .auth-container::before {
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
}

[data-theme="dark"] .auth-container::after {
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
}

/* ===========================
   SIDEBAR FOOTER STYLING
   =========================== */
.sidebar-footer {
    padding: 24px 20px;
    margin-top: auto;
    border-top: 1px solid var(--border);
    background: rgba(99, 102, 241, 0.02);
}

.footer-trust {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.footer-trust i {
    font-size: 14px;
    color: var(--success);
}

.footer-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.version-tag {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-elevated);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.status-indicator {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.status-indicator::after {
    content: "";
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    border: 1px solid #10b981;
    animation: status-ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes status-ping {
    75%, 100% { transform: scale(2.5); opacity: 0; }
}

/* ===========================
   PRIME GRID SYSTEM
   =========================== */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -12px;
    margin-left: -12px;
}

.row > [class*="col-"] {
    padding-right: 12px;
    padding-left: 12px;
    width: 100%;
}

.col-12 { flex: 0 0 100%; max-width: 100%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }

@media (min-width: 768px) {
    .col-md-12 { flex: 0 0 100%; max-width: 100%; }
    .col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-md-3 { flex: 0 0 25%; max-width: 25%; }
}

@media (min-width: 1024px) {
    .col-lg-12 { flex: 0 0 100%; max-width: 100%; }
    .col-lg-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-lg-6 { flex: 0 0 50%; max-width: 50%; }
    .col-lg-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-lg-3 { flex: 0 0 25%; max-width: 25%; }
}

/* ===========================
   UTILITIES
   =========================== */
.mt-10 { margin-top: 10px !important; }
.mt-20 { margin-top: 20px !important; }
.mt-30 { margin-top: 30px !important; }
.mt-40 { margin-top: 40px !important; }
.mb-10 { margin-bottom: 10px !important; }
.mb-20 { margin-bottom: 20px !important; }
.mb-30 { margin-bottom: 30px !important; }
.mb-40 { margin-bottom: 40px !important; }
.p-20 { padding: 20px !important; }
.p-30 { padding: 30px !important; }
.d-flex { display: flex !important; }
.align-items-center { align-items: center !important; }
.justify-content-between { justify-content: space-between !important; }
.text-center { text-align: center !important; }

