:root {
  --bg:          #0a0f1e;
  --bg2:         #0f1729;
  --glass:       rgba(255,255,255,0.04);
  --glass-b:     rgba(255,255,255,0.08);
  --accent:      #6366f1;
  --accent-h:    #4f46e5;
  --success:     #10b981;
  --danger:      #ef4444;
  --warning:     #f59e0b;
  --info:        #06b6d4;
  --text:        #e2e8f0;
  --muted:       #94a3b8;
  --sidebar-w:   260px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-b);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* Layout */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background-color: var(--bg2);
    border-right: 1px solid var(--glass-b);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 2rem 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text);
    border-bottom: 1px solid var(--glass-b);
}

.sidebar-brand i {
    color: var(--accent);
    font-size: 1.8rem;
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 12px;
    color: var(--muted);
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.nav-link:hover, .nav-link.active {
    background: var(--glass);
    color: var(--text);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.1);
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(99,102,241,0.2) 0%, rgba(99,102,241,0.05) 100%);
    border-left: 4px solid var(--accent);
}

.nav-link.active i {
    color: var(--accent);
    text-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

.sidebar-user {
    padding: 1.5rem;
    border-top: 1px solid var(--glass-b);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--info));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: 2rem;
    min-height: 100vh;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    animation: fadeIn 0.5s ease;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
}

.breadcrumb {
    color: var(--muted);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Dashboard Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeIn 0.6s ease both;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.stat-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent);
    border-radius: 4px 0 0 4px;
}

.stat-card.success::before { background: var(--success); }
.stat-card.warning::before { background: var(--warning); }
.stat-card.info::before { background: var(--info); }
.stat-card.danger::before { background: var(--danger); }

.stat-title {
    color: var(--muted);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text);
}

.stat-icon {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 2.5rem;
    color: var(--glass-b);
    transition: color 0.3s ease;
}

.stat-card:hover .stat-icon {
    color: rgba(255,255,255,0.15);
}

/* DataTables Styling Overrides */
.table-container {
    padding: 1.5rem;
    margin-bottom: 2rem;
    animation: fadeIn 0.7s ease both;
}

table.dataTable {
    width: 100% !important;
    border-collapse: collapse !important;
    color: var(--text) !important;
}

table.dataTable thead th {
    border-bottom: 1px solid var(--glass-b) !important;
    color: var(--muted) !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 1rem !important;
}

table.dataTable tbody td {
    padding: 1rem !important;
    border-bottom: 1px solid var(--glass) !important;
    vertical-align: middle;
}

table.dataTable.stripe tbody tr.odd, table.dataTable.display tbody tr.odd {
    background-color: rgba(255,255,255,0.02) !important;
}

table.dataTable.hover tbody tr:hover, table.dataTable.display tbody tr:hover {
    background-color: rgba(255,255,255,0.05) !important;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_processing,
.dataTables_wrapper .dataTables_paginate {
    color: var(--muted) !important;
    margin-bottom: 1rem;
}

.dataTables_wrapper .dataTables_filter input {
    background: var(--bg2);
    border: 1px solid var(--glass-b);
    border-radius: 8px;
    color: var(--text);
    padding: 0.5rem 1rem;
    margin-left: 0.5rem;
    outline: none;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--accent);
}

.dataTables_wrapper .dataTables_length select {
    background: var(--bg2);
    border: 1px solid var(--glass-b);
    border-radius: 8px;
    color: var(--text);
    padding: 0.25rem 0.5rem;
    outline: none;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    color: var(--text) !important;
    background: transparent !important;
    border: 1px solid var(--glass-b) !important;
    border-radius: 8px !important;
    margin: 0 0.25rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current, 
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: white !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--glass) !important;
    border-color: var(--glass-b) !important;
}

/* Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.badge.status-CLAIMED { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge.status-UNCLAIMED { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge.status-FORWARDED { background: rgba(6, 182, 212, 0.15); color: #22d3ee; border: 1px solid rgba(6, 182, 212, 0.3); }
.badge.status-PENDING { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge.status-MATCHED { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge.status-EXPIRED { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge.status-active { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge.status-inactive { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }

.badge.gateway-bkash { background: rgba(226, 19, 110, 0.15); color: #f472b6; border: 1px solid rgba(226, 19, 110, 0.3); }
.badge.gateway-nagad { background: rgba(249, 115, 22, 0.15); color: #fb923c; border: 1px solid rgba(249, 115, 22, 0.3); }
.badge.gateway-rocket { background: rgba(139, 92, 246, 0.15); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.3); }
.badge.gateway-unknown { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.3); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-h));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 6px;
}

.btn-action {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 8px;
    background: var(--glass);
    border: 1px solid var(--glass-b);
    color: var(--text);
}

.btn-action:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 15, 30, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--bg2);
    border: 1px solid var(--glass-b);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--glass-b);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: var(--text);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--glass-b);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--muted);
    font-size: 0.875rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border: 1px solid var(--glass-b);
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top left, var(--bg2) 0%, var(--bg) 100%);
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    text-align: center;
    animation: fadeIn 0.6s ease;
}

.login-logo {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--muted);
    margin-bottom: 2rem;
    font-size: 0.875rem;
}

.login-btn {
    width: 100%;
    padding: 0.875rem;
    font-size: 1rem;
    margin-top: 1rem;
}

/* Alerts / Toasts */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.toast {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    background: var(--bg2);
    border-left: 4px solid var(--info);
    color: var(--text);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 300px;
    animation: slideInRight 0.3s ease forwards;
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

.toast.hiding {
    animation: slideOutRight 0.3s ease forwards;
}

/* Utilities */
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--muted); }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.text-center { text-align: center; }

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutRight {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100%); }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
}
