:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --sidebar-width: 260px;
    --header-height: 70px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Login Page */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-header { text-align: center; margin-bottom: 30px; }
.login-header .logo {
    width: 70px; height: 70px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 32px; margin: 0 auto 20px;
}
.login-header h1 { font-size: 26px; margin-bottom: 8px; }
.login-header p { color: var(--text-secondary); }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; }
.form-control {
    width: 100%; padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: 12px; font-size: 15px;
    transition: all 0.3s;
}
.form-control:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 14px 28px; border: none; border-radius: 12px;
    font-size: 15px; font-weight: 600; cursor: pointer;
    transition: all 0.3s; text-decoration: none; gap: 8px;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white; width: 100%;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3); }
.btn-sm { padding: 8px 16px; font-size: 13px; width: auto; }

/* Dashboard Layout */
.dashboard-wrapper { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: #1e293b;
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}
.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex; align-items: center; gap: 12px;
}
.sidebar-header .logo {
    width: 45px; height: 45px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold; font-size: 20px;
}
.sidebar-menu { padding: 20px 0; }
.menu-category {
    padding: 12px 20px 8px;
    font-size: 11px; text-transform: uppercase;
    color: rgba(255,255,255,0.5); font-weight: 600;
}
.menu-item { margin: 4px 12px; }
.menu-link {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; color: rgba(255,255,255,0.8);
    text-decoration: none; border-radius: 10px;
    transition: all 0.3s;
}
.menu-link:hover, .menu-link.active {
    background: rgba(255,255,255,0.1); color: white;
}
.menu-link i { width: 20px; text-align: center; }

/* Main Content */
.main-content {
    flex: 1; margin-left: var(--sidebar-width);
}

/* Header */
.header {
    background: var(--bg-secondary);
    height: var(--header-height);
    padding: 0 32px;
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: sticky; top: 0; z-index: 100;
}
.header-left { display: flex; align-items: center; gap: 20px; }
.header-right { display: flex; align-items: center; gap: 20px; }

.user-menu {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 12px; border-radius: 10px;
    cursor: pointer; transition: all 0.3s;
}
.user-menu:hover { background: var(--bg-primary); }
.user-avatar {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 600;
}

/* Page Content */
.page-content { padding: 32px; }
.page-header { margin-bottom: 32px; }
.page-title { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.page-subtitle { color: var(--text-secondary); }

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px; margin-bottom: 32px;
}
.stat-card {
    background: var(--bg-secondary);
    border-radius: 16px; padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid var(--border);
    transition: all 0.3s;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
.stat-card::before {
    content: ''; position: absolute;
    top: 0; left: 0; width: 4px; height: 100%;
    background: var(--primary);
}
.stat-card.wallet::before { background: var(--primary); }
.stat-card.transactions::before { background: var(--success); }
.stat-card.pending::before { background: var(--warning); }
.stat-card.commission::before { background: var(--info); }

.stat-icon {
    width: 56px; height: 56px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; margin-bottom: 16px;
}
.stat-card.wallet .stat-icon { background: rgba(99, 102, 241, 0.1); color: var(--primary); }
.stat-card.transactions .stat-icon { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.stat-card.pending .stat-icon { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.stat-card.commission .stat-icon { background: rgba(59, 130, 246, 0.1); color: var(--info); }

.stat-value { font-size: 32px; font-weight: 700; margin-bottom: 4px; }
.stat-label { color: var(--text-secondary); font-size: 14px; }

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px; margin-bottom: 32px;
}
.service-card {
    background: var(--bg-secondary);
    border-radius: 16px; padding: 24px 20px;
    text-align: center; text-decoration: none;
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid var(--border);
    transition: all 0.3s;
}
.service-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-color: var(--primary);
}
.service-icon {
    width: 64px; height: 64px; margin: 0 auto 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 28px;
}
.service-name { font-weight: 600; font-size: 14px; }

/* Card & Table */
.card {
    background: var(--bg-secondary);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid var(--border);
    overflow: hidden; margin-bottom: 24px;
}
.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
}
.card-title { font-size: 18px; font-weight: 700; }
.card-body { padding: 24px; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table thead { background: var(--bg-primary); }
.data-table th {
    padding: 14px 16px; text-align: left;
    font-size: 12px; font-weight: 600;
    text-transform: uppercase; color: var(--text-secondary);
}
.data-table td {
    padding: 16px;
    border-top: 1px solid var(--border);
}
.data-table tbody tr:hover { background: var(--bg-primary); }

/* Badge */
.badge {
    display: inline-flex; align-items: center;
    padding: 6px 12px; border-radius: 20px;
    font-size: 12px; font-weight: 600;
}
.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.badge-info { background: rgba(59, 130, 246, 0.1); color: var(--info); }

/* Alert */
.alert {
    padding: 16px 20px; border-radius: 12px;
    margin-bottom: 20px; display: flex; align-items: center; gap: 12px;
}
.alert-success { background: rgba(16, 185, 129, 0.1); color: var(--success); border: 1px solid var(--success); }
.alert-error { background: rgba(239, 68, 68, 0.1); color: var(--danger); border: 1px solid var(--danger); }

/* Responsive */
@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .menu-toggle { display: block; }
}
@media (max-width: 768px) {
    .stats-grid { grid-template-columns: 1fr; }
    .services-grid { grid-template-columns: repeat(2, 1fr); }
    .page-content { padding: 16px; }
}

/* Utility */
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.hidden { display: none; }