:root {
    --bg-main: #0b0f19;
    --bg-surface: #111827;
    --bg-surface-elevated: #1f293d;
    --bg-glass: rgba(17, 24, 39, 0.75);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-focus: #6366f1;
    
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --accent-primary: #6366f1;
    --accent-primary-hover: #4f46e5;
    --accent-success: #10b981;
    --accent-success-hover: #059669;
    --accent-warning: #f59e0b;
    --accent-warning-hover: #d97706;
    --accent-danger: #ef4444;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.25);
    
    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

.app-container {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    padding: 16px 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
    gap: 16px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-icon {
    font-size: 28px;
    background: linear-gradient(135deg, #fbbf24, #d97706);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}

.brand-text h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.brand-text .badge {
    font-size: 11px;
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.12);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-weight: 500;
}

/* Auto-Bet Widget */
.auto-bet-widget {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.auto-bet-widget.active {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
}

.auto-bet-meta {
    display: flex;
    flex-direction: column;
}

.auto-bet-title {
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.auto-bet-sub {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Pulse Indicator Dot */
.pulse-dot {
    width: 8px;
    height: 8px;
    background: #6b7280;
    border-radius: 50%;
    display: inline-block;
    transition: background 0.3s ease;
}

.pulse-dot.active {
    background: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* iOS-Style Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #374151;
    transition: .3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent-success);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-main);
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

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

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669, #047857);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

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

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

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

/* Task Banner */
.task-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 14px 20px;
    border-radius: var(--radius-md);
    animation: fadeIn 0.3s ease;
    gap: 16px;
    flex-wrap: wrap;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.task-info {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1;
}

.spinner {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.task-texts {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.task-texts strong {
    font-size: 14px;
    color: #c7d2fe;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-texts span {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.task-progress-box {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
}

.progress-bar-bg {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #a855f7);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

.progress-bar-fill.progress-indeterminate {
    width: 100% !important;
    background: linear-gradient(90deg, #6366f1, #10b981, #6366f1);
    background-size: 200% 100%;
    animation: indeterminateMove 1.5s infinite linear;
}

@keyframes indeterminateMove {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

#task-percent {
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-mono);
    color: #c7d2fe;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-content h3 {
    font-size: 26px;
    font-weight: 700;
    margin: 2px 0;
    letter-spacing: -0.02em;
}

.stat-sub {
    font-size: 12px;
    color: var(--text-muted);
}

/* Main Content & Tabs */
.main-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-md);
}

.tabs-header {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 14px;
    margin-bottom: 20px;
    overflow-x: auto;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-main);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.tab-btn.active {
    color: #ffffff;
    background: var(--accent-primary);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.25s ease;
}

/* Toolbar */
.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 16px;
    flex-wrap: wrap;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 14px;
    gap: 10px;
    min-width: 280px;
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-main);
    width: 100%;
}

.toolbar-info {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Data Table */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.data-table th {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.05em;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background 0.15s ease;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.username-cell {
    font-family: var(--font-mono);
    font-weight: 600;
    color: #a5b4fc;
}

.coins-cell {
    font-weight: 700;
    color: #34d399;
}

.badge-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-status.active {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-status.bet-done {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-status.bet-pending {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.coupon-code {
    font-family: var(--font-mono);
    background: rgba(99, 102, 241, 0.12);
    color: #c7d2fe;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    letter-spacing: 0.05em;
    user-select: all;
    border: 1px solid rgba(99, 102, 241, 0.2);
    cursor: pointer;
}

.coupon-code.mini {
    font-size: 11px;
    padding: 2px 6px;
    display: inline-block;
    margin: 2px 0;
}

.coupon-code:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: #818cf8;
}

.clickable {
    cursor: pointer;
    text-decoration: underline dotted;
}

.clickable:hover {
    color: #c7d2fe !important;
}

.action-group {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

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

.py-4 {
    padding-top: 24px;
    padding-bottom: 24px;
}

/* Pagination Box */
.pagination-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

.pagination-info {
    font-size: 13px;
    color: var(--text-secondary);
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-indicator {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: var(--font-mono);
    font-weight: 600;
}

/* Logs Container */
.logs-container {
    background: #060911;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    height: 380px;
    overflow-y: auto;
    overflow-x: hidden;
    font-family: var(--font-mono);
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    word-break: break-all;
    overflow-wrap: anywhere;
    box-sizing: border-box;
}

.log-line {
    color: #94a3b8;
    line-height: 1.6;
    word-break: break-all;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    max-width: 100%;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 480px;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
}

.modal-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.number-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.btn-num {
    width: 44px;
    height: 38px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: #ffffff;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

.number-input-row input {
    flex: 1;
    height: 38px;
    text-align: center;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    font-family: var(--font-mono);
}

.presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.preset-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-chip:hover, .preset-chip.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--accent-primary);
    color: #ffffff;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 2000;
}

.toast {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    padding: 12px 18px;
    border-radius: var(--radius-md);
    color: #ffffff;
    font-size: 13px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideUp 0.3s ease;
}

.toast.success {
    border-left: 4px solid var(--accent-success);
}

.toast.error {
    border-left: 4px solid var(--accent-danger);
}

.hidden {
    display: none !important;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* --- Withdrawal Accounts & Coupon Deposit Styling --- */
.withdrawal-metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.w-metric-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.w-metric-val {
    font-size: 20px;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.w-metric-lbl {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.quota-box {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quota-bar-bg {
    width: 60px;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.quota-bar-fill {
    height: 100%;
    background: #38bdf8;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.quota-bar-fill.full {
    background: #ef4444;
}

.badge-cd {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font-mono);
}

.badge-cd.ready {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-cd.cooling {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-cd.limit {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* btn-info for Refresh Selected */
.btn-info {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.btn-info:hover {
    background: linear-gradient(135deg, #0891b2, #0e7490);
}

/* .badge-status additions */
.badge-status.status-active {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-status.status-pending {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-status.status-error {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ===================================================================
   MOBILE RESPONSIVE – PHONES & TABLETS (≤768px)
   =================================================================== */
@media (max-width: 768px) {

    /* --- Container & Layout --- */
    .app-container {
        padding: 12px 10px;
        gap: 14px;
    }

    /* --- Navbar --- */
    .navbar {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 14px;
        gap: 12px;
        border-radius: var(--radius-md);
    }

    .nav-brand {
        gap: 10px;
    }

    .logo-icon {
        width: 38px;
        height: 38px;
        font-size: 22px;
    }

    .brand-text h1 {
        font-size: 17px;
    }

    .brand-text .badge {
        font-size: 9px;
        display: none;
    }

    .auto-bet-widget {
        padding: 8px 12px;
        gap: 10px;
        flex-wrap: wrap;
    }

    .auto-bet-title {
        font-size: 12px;
    }

    .auto-bet-sub {
        font-size: 10px;
    }

    .nav-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: 100%;
    }

    .nav-actions .btn {
        font-size: 11px;
        padding: 8px 10px;
        justify-content: center;
        text-align: center;
        white-space: normal;
        line-height: 1.3;
    }

    .nav-actions .auto-create-badge-box {
        grid-column: 1 / -1;
        justify-content: center;
    }

    /* --- Task Banner --- */
    .task-banner {
        flex-direction: column;
        padding: 12px 14px;
        gap: 10px;
    }

    .task-progress-box {
        min-width: unset;
        width: 100%;
    }

    .task-texts strong,
    .task-texts span {
        white-space: normal;
        word-break: break-word;
    }

    /* --- Stats Grid --- */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card {
        padding: 14px 12px;
        gap: 10px;
        flex-direction: column;
        align-items: flex-start;
    }

    .stat-icon {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }

    .stat-content h3 {
        font-size: 20px;
    }

    .stat-label {
        font-size: 11px;
    }

    .stat-sub {
        font-size: 10px;
    }

    /* --- Main Content & Tabs --- */
    .main-content {
        padding: 14px 10px;
        border-radius: var(--radius-md);
    }

    .tabs-header {
        gap: 4px;
        padding-bottom: 10px;
        margin-bottom: 14px;
        -webkit-overflow-scrolling: touch;
    }

    .tab-btn {
        font-size: 12px;
        padding: 7px 10px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* --- Toolbar (Search + Buttons) --- */
    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .search-box {
        min-width: unset;
        width: 100%;
    }

    .search-box input {
        font-size: 13px;
    }

    .toolbar-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .toolbar-actions .btn {
        font-size: 11px;
        padding: 6px 10px;
    }

    .filter-group {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }

    .filter-group .btn {
        font-size: 10px;
        padding: 5px 8px;
    }

    .filter-group .form-select {
        font-size: 12px;
        width: 100%;
    }

    /* --- Data Tables --- */
    .data-table {
        font-size: 11px;
    }

    .data-table th {
        font-size: 9px;
        padding: 8px 6px;
        letter-spacing: 0.03em;
    }

    .data-table td {
        padding: 10px 6px;
        font-size: 11px;
    }

    .data-table td .btn {
        font-size: 10px;
        padding: 4px 6px;
    }

    .username-cell {
        font-size: 11px;
    }

    .coupon-code {
        font-size: 10px;
        padding: 3px 5px;
        letter-spacing: 0.03em;
    }

    .action-group {
        flex-wrap: wrap;
        gap: 4px;
    }

    /* --- Withdrawal Metrics Row --- */
    .withdrawal-metrics-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-bottom: 14px;
    }

    .w-metric-card {
        padding: 10px 12px;
    }

    .w-metric-val {
        font-size: 16px;
    }

    .w-metric-lbl {
        font-size: 9px;
    }

    /* --- Pagination --- */
    .pagination-box {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }

    /* --- Modals --- */
    .modal-card {
        width: 95%;
        max-width: none;
        padding: 18px 14px;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-header h3 {
        font-size: 15px;
    }

    .modal-desc {
        font-size: 12px;
    }

    .modal-footer {
        flex-wrap: wrap;
        gap: 8px;
    }

    .modal-footer .btn {
        font-size: 12px;
        padding: 8px 12px;
        flex: 1;
        justify-content: center;
        min-width: 0;
    }

    /* --- Logs --- */
    .logs-container {
        height: 240px;
        padding: 10px;
        font-size: 10px;
    }

    /* --- Toast Notifications --- */
    .toast-container {
        left: 10px;
        right: 10px;
        bottom: 14px;
    }

    .toast {
        font-size: 12px;
        padding: 10px 14px;
    }

    /* --- Coupon Tab Toolbar (multi-row) --- */
    #tab-coupons .table-toolbar > div {
        flex-direction: column;
        align-items: stretch !important;
        gap: 8px;
    }

    #tab-coupons .table-toolbar > div > div {
        flex-wrap: wrap;
    }

    /* --- Withdrawal Tab Toolbar --- */
    #tab-withdrawal .table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    /* --- Quota & Cooldown Badges --- */
    .quota-box {
        gap: 4px;
    }

    .quota-bar-bg {
        width: 40px;
    }

    .badge-cd {
        font-size: 10px;
        padding: 2px 6px;
    }

    /* --- Recent Deposit Logs (sub-table) --- */
    #tab-withdrawal .table-responsive {
        font-size: 10px;
    }

    /* --- Auto-Deposit Modal --- */
    #auto-deposit-modal .modal-card {
        max-width: none;
    }

    #auto-deposit-modal #auto-dep-logs-box {
        height: 120px !important;
        font-size: 10px !important;
    }

    /* --- Export Modal --- */
    #export-coupons-modal .modal-footer {
        flex-direction: column;
    }

    #export-coupons-modal .modal-footer .btn {
        width: 100%;
    }
}


/* ===================================================================
   EXTRA SMALL PHONES (≤480px)
   =================================================================== */
@media (max-width: 480px) {

    .app-container {
        padding: 8px 6px;
        gap: 10px;
    }

    .navbar {
        padding: 10px;
    }

    .brand-text h1 {
        font-size: 15px;
    }

    .nav-actions {
        grid-template-columns: 1fr;
    }

    /* --- Stats: stack 1 column --- */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .stat-card {
        flex-direction: row;
        align-items: center;
        padding: 12px;
    }

    .stat-content h3 {
        font-size: 18px;
    }

    /* --- Tabs: smaller --- */
    .tab-btn {
        font-size: 11px;
        padding: 6px 8px;
    }

    .main-content {
        padding: 10px 8px;
    }

    /* --- Withdrawal Metrics: single column --- */
    .withdrawal-metrics-row {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    /* --- Tables: even tighter --- */
    .data-table th {
        font-size: 8px;
        padding: 6px 4px;
    }

    .data-table td {
        padding: 8px 4px;
        font-size: 10px;
    }

    .data-table td .btn {
        font-size: 9px;
        padding: 3px 5px;
    }

    /* --- Modals --- */
    .modal-card {
        width: 98%;
        padding: 14px 10px;
    }

    .modal-header h3 {
        font-size: 14px;
    }

    /* --- Toasts --- */
    .toast {
        font-size: 11px;
        padding: 8px 10px;
    }
}

