/* ===== ROOT & THEMES ===== */
:root {
    --bg-primary: #0b1120;
    --bg-secondary: #111827;
    --bg-card: rgba(30, 41, 59, 0.7);
    --bg-sidebar: #0f172a;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: rgba(148, 163, 184, 0.12);
    --primary: #60a5fa;
    --primary-hover: #3b82f6;
    --primary-glow: rgba(96, 165, 250, 0.35);
    --success: #34d399;
    --danger: #f87171;
    --warning: #fbbf24;
    --gradient: linear-gradient(135deg, #60a5fa 0%, #a78bfa 50%, #f472b6 100%);
    --gradient-soft: linear-gradient(135deg, rgba(96,165,250,0.15), rgba(167,139,250,0.15));
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.4);
    --radius: 14px;
    --radius-sm: 10px;
    --sidebar-width: 270px;
    --header-height: 68px;
    --transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --bg-primary: #f1f5f9;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-sidebar: #0f172a;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: rgba(15, 23, 42, 0.08);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.1);
}

/* ===== 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-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding-left: var(--sidebar-width);
    transition: background 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, select { font-family: inherit; }
img { max-width: 100%; }

/* ===== LOADING ===== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 17, 32, 0.7);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.loading-overlay.show { display: flex; }
.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(96, 165, 250, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid rgba(255,255,255,0.06);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    overflow-y: auto;
}
.sidebar-brand {
    padding: 22px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    min-height: var(--header-height);
}
.logo-icon {
    width: 38px; height: 38px;
    background: var(--gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.logo-icon svg { width: 20px; height: 20px; }
.sidebar-brand h1 {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.3px;
}
.sidebar-brand h1 span {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav { flex: 1; padding: 16px 0; }
.nav-section {
    padding: 8px 20px 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #64748b;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 500;
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}
.nav-link:hover {
    background: rgba(255,255,255,0.04);
    color: #e2e8f0;
}
.nav-link.active {
    background: rgba(96, 165, 250, 0.1);
    color: #60a5fa;
    border-left-color: #60a5fa;
}
.nav-link .icon { font-size: 17px; width: 22px; text-align: center; }
.nav-link .badge {
    margin-left: auto;
    background: linear-gradient(135deg, #f87171, #ef4444);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 20px;
    min-width: 22px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 18px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}
.user-info:hover { background: rgba(255,255,255,0.05); }
.avatar {
    width: 40px; height: 40px;
    border-radius: 12px;
    background: var(--gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}
.user-details .name {
    font-size: 14px;
    font-weight: 600;
    color: #f1f5f9;
}
.user-details .balance {
    font-size: 12px;
    color: var(--success);
    font-weight: 500;
}
.btn-logout {
    width: 100%;
    margin-top: 10px;
    padding: 9px;
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.25);
    color: #f87171;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.btn-logout:hover {
    background: rgba(248, 113, 113, 0.22);
}

.sidebar-toggle {
    display: none;
    position: fixed;
    top: 14px; left: 14px;
    z-index: 1001;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
}
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 999;
    backdrop-filter: blur(3px);
}

/* ===== MAIN ===== */
.main-content {
    padding: 28px 36px 48px;
    max-width: 1280px;
    margin: 0 auto;
    min-height: 100vh;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    gap: 16px;
    flex-wrap: wrap;
}
.content-header h2 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.4px;
}
.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}
.theme-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 9px 13px;
    cursor: pointer;
    font-size: 18px;
    transition: var(--transition);
}
.theme-toggle:hover { border-color: var(--primary); transform: scale(1.05); }

/* ===== SECTIONS ===== */
.section-content {
    display: none;
    animation: fadeUp 0.35s ease;
}
.section-content.active { display: block; }
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== GLASS CARD ===== */
.glass {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card {
    padding: 24px;
    margin-bottom: 20px;
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}
.card-header h3 { font-size: 17px; font-weight: 700; }

/* ===== BUTTONS ===== */
.btn-primary, .btn-secondary, .btn-green, .btn-ghost, .btn-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    padding: 11px 20px;
}
.btn-primary {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 4px 16px var(--primary-glow);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--primary-glow);
}
.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.btn-green {
    background: linear-gradient(135deg, #34d399, #10b981);
    color: #0f172a;
    box-shadow: 0 4px 16px rgba(52, 211, 153, 0.3);
}
.btn-green:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(52, 211, 153, 0.4);
}
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}
.btn-ghost:hover { color: var(--primary); border-color: var(--primary); }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.w-full { width: 100%; }

/* ===== HERO ===== */
.hero {
    text-align: center;
    padding: 60px 20px 80px;
    position: relative;
}
.hero::before {
    content: '';
    position: absolute;
    top: -80px; left: 50%;
    transform: translateX(-50%);
    width: 600px; height: 400px;
    background: radial-gradient(ellipse, rgba(96,165,250,0.18) 0%, transparent 70%);
    pointer-events: none;
}
.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    background: var(--gradient-soft);
    border: 1px solid rgba(96,165,250,0.25);
    border-radius: 40px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 20px;
    letter-spacing: 0.3px;
}
.hero h1 {
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 900;
    letter-spacing: -1.2px;
    line-height: 1.15;
    margin-bottom: 16px;
}
.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.subtitle {
    font-size: 17px;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto 32px;
    line-height: 1.7;
}
.hero-buttons {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 48px;
}
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    flex-wrap: wrap;
}
.hero-stat {
    text-align: center;
}
.hero-stat strong {
    display: block;
    font-size: 28px;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-stat span {
    font-size: 13px;
    color: var(--text-muted);
}

/* ===== AUTH ===== */
.auth-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    max-width: 800px;
    margin: 0 auto;
}
.auth-card {
    padding: 28px;
}
.auth-card h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
}

/* ===== FORM ===== */
.form-group {
    margin-bottom: 14px;
}
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
input, select {
    width: 100%;
    padding: 12px 14px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
    outline: none;
}
[data-theme="light"] input,
[data-theme="light"] select {
    background: #f8fafc;
}
input:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
input[readonly] {
    opacity: 0.75;
    cursor: default;
}
.total-highlight {
    font-weight: 700;
    color: var(--success) !important;
}

.msg {
    margin-top: 14px;
    font-size: 14px;
    line-height: 1.5;
    min-height: 20px;
}

/* ===== FILTER & SERVICES ===== */
.filter-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}
.filter-btn {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 40px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}
.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active {
    background: var(--gradient);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 18px;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.service-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(96, 165, 250, 0.3);
}
.service-card .top {
    display: flex;
    align-items: center;
    gap: 12px;
}
.service-card .top .icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: var(--gradient-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}
.service-card .platform {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
}
.service-card .group {
    font-size: 11px;
    color: var(--text-muted);
}
.service-card .bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.service-card .name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
}
.service-card .price {
    font-size: 14px;
    font-weight: 700;
    color: var(--success);
}

/* ===== PLATFORMS ===== */
.platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.platform-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px 18px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}
.platform-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(96, 165, 250, 0.35);
}
.platform-card .icon {
    font-size: 36px;
    margin-bottom: 12px;
}
.platform-card .name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}
.platform-card .desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.platform-card .badge {
    display: inline-block;
    padding: 3px 10px;
    background: var(--gradient-soft);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
}

/* ===== DEPOSIT ===== */
.deposit-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.deposit-packages {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}
.pkg {
    padding: 10px 16px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.pkg:hover, .pkg.active {
    background: var(--gradient);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px var(--primary-glow);
}
.bank-info {
    background: rgba(96, 165, 250, 0.08);
    border: 1px solid rgba(96, 165, 250, 0.2);
    border-radius: 10px;
    padding: 14px 16px;
    margin: 16px 0;
    font-size: 13px;
    line-height: 1.8;
}
.bank-info strong { display: block; margin-bottom: 6px; color: var(--primary); }

/* ===== ORDERS LIST ===== */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.order-item {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px 16px;
    transition: var(--transition);
}
.order-item:hover { border-color: rgba(96,165,250,0.25); }
.order-item .row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

/* ===== TABLES ===== */
.table-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
}
table th {
    text-align: left;
    padding: 12px 14px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}
table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13.5px;
    vertical-align: middle;
}
table tr:hover td {
    background: rgba(96, 165, 250, 0.04);
}

.status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}
.status-pending { background: rgba(251,191,36,0.15); color: #fbbf24; }
.status-approved { background: rgba(52,211,153,0.15); color: #34d399; }
.status-completed { background: rgba(96,165,250,0.15); color: #60a5fa; }
.status-rejected, .status-cancelled { background: rgba(248,113,113,0.15); color: #f87171; }

.btn-action {
    padding: 5px 12px;
    border-radius: 6px;
    border: none;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    margin-right: 4px;
    transition: var(--transition);
}
.btn-action:hover { transform: scale(1.06); }
.btn-approve { background: rgba(52,211,153,0.2); color: #34d399; }
.btn-complete { background: rgba(96,165,250,0.2); color: #60a5fa; }
.btn-reject { background: rgba(248,113,113,0.2); color: #f87171; }

/* ===== SEARCH BAR ===== */
.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.search-bar input { flex: 1; min-width: 180px; }
.search-bar select { width: auto; min-width: 140px; }

/* ===== STATS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 22px;
    text-align: center;
    transition: var(--transition);
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}
.stat-card .number {
    font-size: 30px;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.stat-card .label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.modal-overlay.show {
    display: flex;
    opacity: 1;
}
.modal-content {
    width: 100%;
    max-width: 440px;
    padding: 28px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.modal-header h3 { font-size: 18px; font-weight: 700; }
.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: var(--transition);
}
.modal-close:hover { color: var(--danger); background: rgba(248,113,113,0.1); }

/* ===== PROFILE ===== */
.profile-info { text-align: center; }
.profile-avatar {
    width: 72px; height: 72px;
    border-radius: 20px;
    background: var(--gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    margin: 0 auto 20px;
}
.profile-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}
.profile-row span { color: var(--text-muted); }
.text-success { color: var(--success) !important; }

/* ===== TOAST ===== */
#toastContainer {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    max-width: 360px;
    backdrop-filter: blur(8px);
}
.toast-success { background: linear-gradient(135deg, #10b981, #059669); }
.toast-error { background: linear-gradient(135deg, #ef4444, #dc2626); }
.toast-info { background: linear-gradient(135deg, #3b82f6, #2563eb); }
@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.show { display: block; }
    .sidebar-toggle { display: block; }
    body { padding-left: 0; }
    .main-content { padding: 20px 16px 40px; }
    .deposit-layout { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .hero { padding: 40px 10px 50px; }
    .hero h1 { font-size: 32px; }
    .auth-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .service-grid { grid-template-columns: 1fr; }
    .content-header h2 { font-size: 20px; }
}
