/* ========================================
   EarnoVax Mobile Admin - Premium CSS
   Mobile-First, Professional Design
   ======================================== */

:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --accent: #06b6d4;
    --accent-light: #22d3ee;
    --green: #10b981;
    --yellow: #f59e0b;
    --red: #ef4444;
    --bg-dark: #070711;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.07);
    --border: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(99, 102, 241, 0.3);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #475569;
    --glass: rgba(15, 15, 30, 0.8);
    --shadow: 0 25px 50px rgba(0,0,0,0.5);
    --tab-h: 70px;
    --header-h: 64px;
    --font: 'Inter', sans-serif;
    --font-alt: 'Space Grotesk', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }

body {
    font-family: var(--font);
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ========================================
   ANIMATED BACKGROUND
   ======================================== */
.bg-orbs {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.25;
    animation: float-orb 12s ease-in-out infinite;
}
.orb-1 { width: 400px; height: 400px; background: radial-gradient(circle, #6366f1, #4f46e5); top: -100px; right: -100px; }
.orb-2 { width: 300px; height: 300px; background: radial-gradient(circle, #06b6d4, #0891b2); bottom: 10%; left: -80px; animation-delay: -4s; animation-duration: 15s; }
.orb-3 { width: 250px; height: 250px; background: radial-gradient(circle, #10b981, #059669); bottom: 30%; right: 10%; animation-delay: -8s; animation-duration: 10s; }
@keyframes float-orb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(20px, -30px) scale(1.05); }
    66% { transform: translate(-10px, 20px) scale(0.95); }
}
.grid-overlay {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-image: linear-gradient(rgba(99,102,241,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(99,102,241,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

/* ========================================
   LOGIN PAGE
   ======================================== */
.login-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}
.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
}
.login-logo {
    text-align: center;
    margin-bottom: 32px;
}
.logo-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(6,182,212,0.2));
    border: 1px solid rgba(99,102,241,0.3);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 0 30px rgba(99,102,241,0.2), inset 0 1px 0 rgba(255,255,255,0.1);
}
.logo-title {
    font-family: var(--font-alt);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 6px;
    background: linear-gradient(135deg, #ffffff, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.logo-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    letter-spacing: 1px;
    margin-top: 6px;
}
.login-card {
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 28px;
    box-shadow: var(--shadow), 0 0 0 1px rgba(255,255,255,0.03) inset;
}
.login-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.status-dot {
    width: 8px; height: 8px;
    background: var(--green);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--green);
    animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.9); }
}

/* ========================================
   FORM STYLES
   ======================================== */
.form-group { margin-bottom: 18px; }
.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.input-wrapper { position: relative; }
.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}
.form-input {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 44px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: var(--font);
    transition: all 0.2s ease;
    outline: none;
    appearance: none;
}
.form-input:focus {
    border-color: var(--primary);
    background: rgba(99,102,241,0.08);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.form-input::placeholder { color: var(--text-muted); }
.toggle-pw {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}
.toggle-pw:hover { color: var(--text-secondary); }
.error-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #fca5a5;
}
.login-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), #4f46e5);
    border: none;
    border-radius: 14px;
    padding: 16px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(99,102,241,0.35);
    margin-top: 4px;
}
.login-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(99,102,241,0.5);
}
.login-btn:active:not(:disabled) { transform: translateY(0); }
.login-btn:disabled { opacity: 0.7; cursor: not-allowed; }
.btn-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.spinner {
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.login-footer { margin-top: 20px; text-align: center; }
.security-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
}
.security-badge svg { color: var(--green); }

/* ========================================
   DASHBOARD LAYOUT
   ======================================== */
.dashboard-page { background: var(--bg-dark); }
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--header-h);
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}
.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.header-logo {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, rgba(99,102,241,0.25), rgba(6,182,212,0.25));
    border: 1px solid rgba(99,102,241,0.3);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.header-title {
    font-family: var(--font-alt);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #fff, var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.header-right { display: flex; align-items: center; gap: 10px; }
.header-badge {
    background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(6,182,212,0.15));
    border: 1px solid rgba(99,102,241,0.25);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 11px;
    color: var(--primary-light);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}
.dot-live {
    width: 6px; height: 6px;
    background: var(--green);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--green);
    animation: pulse-dot 2s ease-in-out infinite;
}
.logout-btn {
    width: 36px; height: 36px;
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #f87171;
    transition: all 0.2s ease;
    text-decoration: none;
}
.logout-btn:hover { background: rgba(239,68,68,0.2); }

/* ========================================
   MAIN CONTENT AREA
   ======================================== */
.app-content {
    padding-top: var(--header-h);
    padding-bottom: calc(var(--tab-h) + 16px);
    min-height: 100vh;
    position: relative;
    z-index: 1;
}
.page-section {
    display: none;
    padding: 20px 16px;
    animation: fade-in 0.3s ease;
}
.page-section.active { display: block; }
@keyframes fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.section-header {
    margin-bottom: 20px;
}
.section-title {
    font-family: var(--font-alt);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}
.section-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ========================================
   BOTTOM TAB BAR
   ======================================== */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--tab-h);
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: stretch;
    padding: 0 4px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
    position: relative;
    padding: 8px 2px;
    border-radius: 0;
    min-width: 0;
    text-decoration: none;
}
.tab-item .tab-icon {
    width: 22px; height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: all 0.2s ease;
}
.tab-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tab-item.active { color: var(--primary-light); }
.tab-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 25%;
    right: 25%;
    height: 2px;
    background: var(--primary);
    border-radius: 0 0 4px 4px;
}
.tab-item.active .tab-icon { filter: drop-shadow(0 0 6px var(--primary)); }
.tab-badge {
    position: absolute;
    top: 6px;
    right: calc(50% - 18px);
    background: var(--red);
    color: white;
    font-size: 9px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--bg-dark);
}

/* ========================================
   STAT CARDS
   ======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
}
.stat-card.indigo::before { background: linear-gradient(90deg, var(--primary), var(--primary-light)); }
.stat-card.cyan::before { background: linear-gradient(90deg, var(--accent), var(--accent-light)); }
.stat-card.green::before { background: linear-gradient(90deg, #10b981, #34d399); }
.stat-card.yellow::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.stat-icon {
    width: 40px; height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}
.stat-icon.indigo { background: rgba(99,102,241,0.15); color: var(--primary-light); }
.stat-icon.cyan { background: rgba(6,182,212,0.15); color: var(--accent); }
.stat-icon.green { background: rgba(16,185,129,0.15); color: #34d399; }
.stat-icon.yellow { background: rgba(245,158,11,0.15); color: #fbbf24; }
.stat-value {
    font-family: var(--font-alt);
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}
.stat-label { font-size: 11px; color: var(--text-muted); font-weight: 500; letter-spacing: 0.3px; }

/* ========================================
   CARDS
   ======================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 16px;
}
.card-header {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-title {
    font-family: var(--font-alt);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-body { padding: 18px; }

/* ========================================
   MOBILE LIST ITEMS (instead of tables)
   ======================================== */
.list-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: all 0.2s ease;
}
.list-item:last-child { margin-bottom: 0; }
.list-item:active { background: rgba(99,102,241,0.05); }
.item-thumb {
    width: 48px; height: 48px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255,255,255,0.05);
}
.item-body { flex: 1; min-width: 0; }
.item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.item-meta {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.item-end { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }

/* ========================================
   BADGES & PILLS
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.badge-indigo { background: rgba(99,102,241,0.15); color: var(--primary-light); border: 1px solid rgba(99,102,241,0.25); }
.badge-cyan { background: rgba(6,182,212,0.15); color: var(--accent-light); border: 1px solid rgba(6,182,212,0.25); }
.badge-green { background: rgba(16,185,129,0.15); color: #34d399; border: 1px solid rgba(16,185,129,0.25); }
.badge-yellow { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.25); }
.badge-red { background: rgba(239,68,68,0.15); color: #fca5a5; border: 1px solid rgba(239,68,68,0.25); }
.badge-gray { background: rgba(100,116,139,0.15); color: #94a3b8; border: 1px solid rgba(100,116,139,0.2); }

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: none;
    border-radius: 12px;
    padding: 12px 18px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    min-height: 44px;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), #4f46e5);
    color: white;
    box-shadow: 0 4px 15px rgba(99,102,241,0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99,102,241,0.4); }
.btn-secondary { background: rgba(255,255,255,0.06); color: var(--text-secondary); border: 1px solid var(--border); }
.btn-danger { background: rgba(239,68,68,0.15); color: #fca5a5; border: 1px solid rgba(239,68,68,0.25); }
.btn-success { background: rgba(16,185,129,0.15); color: #34d399; border: 1px solid rgba(16,185,129,0.25); }
.btn-sm { padding: 8px 14px; font-size: 12px; border-radius: 10px; min-height: 36px; }
.btn-full { width: 100%; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: 10px; }

/* ========================================
   SEARCH & FILTER BAR
   ======================================== */
.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}
.search-input-wrapper { position: relative; flex: 1; }
.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}
.search-input {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 11px 12px 11px 38px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font);
    outline: none;
    transition: all 0.2s ease;
}
.search-input:focus { border-color: var(--primary); background: rgba(99,102,241,0.05); }
.search-input::placeholder { color: var(--text-muted); }
.filter-select {
    background: #131320;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 11px 36px 11px 12px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font);
    outline: none;
    min-width: 110px;
    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' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}
.filter-select:focus { border-color: var(--primary); }

/* Force dark dropdown options across all browsers */
select, select option {
    background-color: #131320 !important;
    color: var(--text-primary) !important;
}
select:focus { outline: none; }

/* ========================================
   CHART AREA
   ======================================== */
.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 16px;
}
.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.chart-title { font-family: var(--font-alt); font-size: 14px; font-weight: 600; color: var(--text-primary); }
.chart-wrapper { position: relative; height: 180px; }

/* ========================================
   MODAL
   ======================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-end;
    padding: 0;
    animation: fade-in 0.2s ease;
}
.modal-sheet {
    background: #111827;
    border: 1px solid var(--border);
    border-radius: 24px 24px 0 0;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 20px;
    animation: slide-up 0.3s ease;
}
@keyframes slide-up {
    from { transform: translateY(40px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.modal-handle {
    width: 40px; height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    margin: 0 auto 20px;
}
.modal-title {
    font-family: var(--font-alt);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.modal-close {
    position: absolute;
    top: 20px; right: 20px;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========================================
   FORM ELEMENTS (Dashboard)
   ======================================== */
.d-form-group { margin-bottom: 16px; }
.d-form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.d-form-input, .d-form-textarea {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font);
    outline: none;
    transition: all 0.2s ease;
    appearance: none;
}
.d-form-select {
    width: 100%;
    background: #131320;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 36px 12px 14px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font);
    outline: none;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}
.d-form-input:focus, .d-form-select:focus, .d-form-textarea:focus {
    border-color: var(--primary);
    background-color: rgba(99,102,241,0.06);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
.d-form-select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}
.d-form-textarea { resize: vertical; min-height: 80px; }
.d-form-input::placeholder, .d-form-textarea::placeholder { color: var(--text-muted); }

/* ========================================
   TOGGLE SWITCH
   ======================================== */
.toggle-wrapper { display: flex; align-items: center; gap: 12px; }
.toggle {
    position: relative;
    width: 48px; height: 26px;
    flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px; height: 18px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
}
input:checked + .toggle-slider { background: var(--primary); border-color: var(--primary); }
input:checked + .toggle-slider::before { left: calc(100% - 21px); }

/* ========================================
   LOADER / EMPTY STATE
   ======================================== */
.loading-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}
.loading-spinner {
    width: 36px; height: 36px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}
.empty-icon {
    width: 60px; height: 60px;
    background: rgba(255,255,255,0.04);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 28px;
}
.empty-title { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-text { font-size: 13px; color: var(--text-muted); }

/* ========================================
   TOAST NOTIFICATION
   ======================================== */
#toast-container {
    position: fixed;
    top: calc(var(--header-h) + 12px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: calc(100% - 32px);
    max-width: 400px;
}
.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 500;
    backdrop-filter: blur(10px);
    border: 1px solid;
    animation: slide-down 0.3s ease;
}
@keyframes slide-down {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.toast-success { background: rgba(16,185,129,0.15); border-color: rgba(16,185,129,0.3); color: #6ee7b7; }
.toast-error { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.3); color: #fca5a5; }
.toast-info { background: rgba(99,102,241,0.15); border-color: rgba(99,102,241,0.3); color: var(--primary-light); }

/* ========================================
   UTILITIES
   ======================================== */
.hidden { display: none !important; }
.text-primary { color: var(--primary-light); }
.text-accent { color: var(--accent); }
.text-green { color: #34d399; }
.text-yellow { color: #fbbf24; }
.text-red { color: #f87171; }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 700; }
.font-mono { font-family: 'Courier New', monospace; font-size: 0.9em; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: 8px; }
.mt-2 { margin-top: 8px; }
.mb-4 { margin-bottom: 16px; }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

/* ========================================
   USER/WITHDRAWAL/TICKET LIST STYLES
   ======================================== */
.user-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.user-avatar {
    width: 46px; height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(99,102,241,0.3), rgba(6,182,212,0.3));
    border: 1px solid rgba(99,102,241,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-light);
    flex-shrink: 0;
    text-transform: uppercase;
    overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.user-email { font-size: 11px; color: var(--text-muted); }
.user-balance { font-size: 15px; font-weight: 700; color: var(--accent); flex-shrink: 0; }

/* Image Previews & Uploads */
.img-preview {
    width: 100%;
    height: 140px;
    object-fit: contain;
    background: rgba(0,0,0,0.2);
    border: 1px dashed var(--border);
    border-radius: 12px;
    margin-top: 10px;
}

.img-preview-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 10px;
}
.img-preview-wrapper .img-preview {
    margin-top: 0;
}

/* Upload Overlay */
.img-upload-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.2s ease;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    color: white;
    backdrop-filter: blur(2px);
}

.img-preview-wrapper:hover .img-upload-overlay,
.img-preview-wrapper:active .img-upload-overlay {
    opacity: 1;
}

.img-upload-overlay.uploading {
    opacity: 1;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.6);
}

.img-upload-overlay.uploading span {
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    from { opacity: 0.5; }
    to { opacity: 1; }
}

.img-preview-wrapper.drag-over {
    border: 2px solid var(--accent);
    background: rgba(99, 102, 241, 0.1);
}
.img-preview-wrapper.drag-over .img-upload-overlay {
    opacity: 1;
}

/* Helper button */
.btn-upload-inline {
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: var(--accent);
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    width: fit-content;
    margin: 8px auto 0;
    display: flex;
    align-items: center;
    gap: 6px;
}
