@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-base: #0B0E14;
    --bg-surface: rgba(20, 24, 34, 0.65);
    --bg-surface-elevated: rgba(30, 36, 50, 0.8);
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #8b5cf6;
    --secondary-hover: #7c3aed;
    --accent: #0ea5e9;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.12);
    --success-border: rgba(16, 185, 129, 0.25);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.12);
    --danger-border: rgba(239, 68, 68, 0.25);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.12);
    --warning-border: rgba(245, 158, 11, 0.25);
    --pending: #8b5cf6;
    --pending-bg: rgba(139, 92, 246, 0.12);
    --pending-border: rgba(139, 92, 246, 0.25);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.2);
}

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

body {
    background-color: var(--bg-base);
    background-image:
        radial-gradient(ellipse at 15% 0%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
        radial-gradient(ellipse at 85% 100%, rgba(139, 92, 246, 0.12) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 50%, rgba(14, 165, 233, 0.05) 0%, transparent 60%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
}

/* ===== Header ===== */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    position: relative;
}
header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 200px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), transparent);
}

h1 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    white-space: nowrap;
}
h1 .brand-text {
    background: linear-gradient(135deg, #fceabb, #f8b500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

/* Credits Pill */
.credits-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(20, 24, 34, 0.6);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 0.5rem 1.2rem;
    backdrop-filter: blur(10px);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}
.credits-label { font-size: 0.75rem; color: var(--text-dim); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.credits-value {
    font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums;
    background: linear-gradient(135deg, #6ee7b7, #10b981);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    min-width: 24px; text-align: center;
}

/* ===== Hero Action Buttons ===== */
.hero-actions {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 2rem;
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    border: 2px solid;
    background: transparent;
}
.hero-btn-buy {
    color: #f8b500;
    border-color: rgba(248, 181, 0, 0.4);
}
.hero-btn-buy:hover {
    background: rgba(248, 181, 0, 0.1);
    border-color: #f8b500;
    box-shadow: 0 0 20px rgba(248, 181, 0, 0.2);
}
.hero-btn-redeem {
    color: #67e8f9;
    border-color: rgba(6, 182, 212, 0.4);
}
.hero-btn-redeem:hover {
    background: rgba(6, 182, 212, 0.1);
    border-color: #06b6d4;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.2);
}
.hero-btn-import {
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.4);
}
.hero-btn-import:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: #6366f1;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

/* Action Nav */
.action-nav {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.4rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
}
.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    transition: var(--transition);
    color: var(--text-muted);
    cursor: pointer;
    border: none;
    background: transparent;
}
.nav-btn .icon { font-size: 1rem; }
.nav-btn:hover { color: var(--text-main); background: rgba(255, 255, 255, 0.08); }
.nav-btn.btn-redeem { background: rgba(6,182,212,0.15); color: #67e8f9; border: 1px solid rgba(6,182,212,0.3); }
.nav-btn.btn-redeem:hover { background: rgba(6,182,212,0.25); color: #fff; box-shadow: 0 4px 12px rgba(6,182,212,0.3); }
.nav-btn.btn-import { background: rgba(99, 102, 241, 0.15); color: #a5b4fc; border: 1px solid rgba(99, 102, 241, 0.3); }
.nav-btn.btn-import:hover { background: rgba(99, 102, 241, 0.25); color: #fff; box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3); }
.nav-btn.btn-export-success { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.3); }
.nav-btn.btn-export-success:hover { background: rgba(16, 185, 129, 0.25); color: #fff; }
.nav-btn.btn-export-failed { background: rgba(239, 68, 68, 0.15); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3); }
.nav-btn.btn-export-failed:hover { background: rgba(239, 68, 68, 0.25); color: #fff; }
.nav-btn.btn-buy { background: rgba(245, 158, 11, 0.15); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.3); }
.nav-btn.btn-buy:hover { background: rgba(245, 158, 11, 0.25); color: #fff; }
.nav-btn.btn-clear-data { background: rgba(239, 68, 68, 0.12); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.25); }
.nav-btn.btn-clear-data:hover { background: rgba(239, 68, 68, 0.25); color: #fff; }
.nav-btn.btn-back { background: rgba(255, 255, 255, 0.05); color: var(--text-muted); }
.nav-btn.btn-back:hover { background: rgba(255,255,255,0.1); color: #fff; }
.nav-divider { width: 1px; height: 20px; background: var(--border); margin: 0 0.2rem; }

/* ===== Notice ===== */
.notice-banner {
    position: relative;
    background: rgba(239, 68, 68, 0.1);
    border-left: 4px solid var(--danger);
    padding: 1.2rem 2.5rem 1.2rem 1.5rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}
.notice-banner .notice-body { color: #fca5a5; font-size: 0.9rem; line-height: 1.7; }
.notice-banner .notice-body p { margin: 0 0 0.4rem 0; font-weight: 600; }
.notice-banner ol { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 0.2rem; }
.notice-close {
    position: absolute; top: 10px; right: 15px; background: none; border: none;
    color: #fca5a5; font-size: 1.2rem; cursor: pointer; opacity: 0.7; transition: opacity .2s;
}
.notice-close:hover { opacity: 1; }

/* ===== Real-time Status Dots ===== */
.live-status-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.2rem 1.5rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(20px);
}
.live-status-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.live-status-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.95rem;
}
.live-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
    letter-spacing: 1px;
    text-transform: uppercase;
    animation: livePulse 2s ease-in-out infinite;
}
@keyframes livePulse { 0%,100%{opacity:1;} 50%{opacity:0.5;} }

.live-status-counters {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    font-weight: 600;
}
.live-counter { display: flex; align-items: center; gap: 6px; }
.live-dot-indicator { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

.dots-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 6px 0;
    min-height: 24px;
}
.status-dot {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    transition: all 0.3s;
}
.status-dot.success { background: #10b981; box-shadow: 0 0 6px rgba(16,185,129,0.5); }
.status-dot.failed { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,0.5); }
.status-dot.pending { background: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,0.4); }
.status-dot.running { background: #3b82f6; box-shadow: 0 0 6px rgba(59,130,246,0.5); animation: dotPulse 1.5s ease-in-out infinite; }
.status-dot.empty { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06); }
@keyframes dotPulse { 0%,100%{transform:scale(1);} 50%{transform:scale(1.15);} }

.live-status-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    padding: 1.8rem 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 140px;
}
.stat-card:hover { transform: translateY(-4px); border-color: var(--border-hover); box-shadow: var(--shadow-lg), var(--shadow-glow); }
.stat-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
    opacity: 0.5; transition: var(--transition);
}
.stat-card:hover::before { background: linear-gradient(90deg, var(--primary), var(--secondary)); opacity: 1; }
.stat-title { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 2px; margin-bottom: 0.8rem; font-weight: 600; }
.stat-value { font-size: 3rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); }
.val-total { color: #fff; }
.val-pending { background: linear-gradient(to right, var(--pending), #a78bfa); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.val-success { background: linear-gradient(to right, var(--success), #34d399); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.val-danger { background: linear-gradient(to right, var(--danger), #f87171); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* ===== Queue Card ===== */
.queue-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.2rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
}
.queue-left { display: flex; align-items: center; gap: 12px; }
.queue-icon { width: 48px; height: 48px; border-radius: 12px; background: rgba(99, 102, 241, 0.1); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.queue-title { color: var(--text-muted); font-size: 0.85rem; font-weight: 500; }
.queue-count { color: var(--text-main); font-size: 1rem; font-weight: 500; margin-top: 2px; }
.queue-count strong { color: var(--primary); font-size: 1.15rem; font-variant-numeric: tabular-nums; }

/* ===== Card / Tabs / Table ===== */
.card {
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}
.tabs {
    display: inline-flex;
    background: rgba(0, 0, 0, 0.25);
    padding: 6px;
    border-radius: var(--radius-md);
    gap: 6px;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    width: max-content;
    max-width: 100%;
}
.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.7rem 1.4rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    white-space: nowrap;
    font-family: inherit;
}
.tab-btn:hover { color: var(--text-main); }
.tab-btn.active {
    color: #fff;
    background: var(--bg-surface-elevated);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.15);
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 1.1rem 1.4rem; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--text-dim); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 1px; background: rgba(0, 0, 0, 0.2); position: sticky; top: 0; z-index: 5; }
tbody tr { transition: background-color 0.2s ease; }
tbody tr:hover { background-color: rgba(255, 255, 255, 0.03); }
tbody tr:last-child td { border-bottom: none; }

.badge {
    padding: 0.35rem 0.8rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.badge.pending { background-color: var(--pending-bg); color: #c4b5fd; border: 1px solid var(--pending-border); }
.badge.success { background-color: var(--success-bg); color: #6ee7b7; border: 1px solid var(--success-border); }
.badge.failed { background-color: var(--danger-bg); color: #fca5a5; border: 1px solid var(--danger-border); }
.badge.running { background-color: var(--warning-bg); color: #fcd34d; border: 1px solid var(--warning-border); animation: badgePulse 1.5s ease-in-out infinite; }
.badge.default { background-color: rgba(255, 255, 255, 0.05); color: var(--text-muted); border: 1px solid var(--border); }
@keyframes badgePulse { 0%,100%{opacity:1;} 50%{opacity:0.6;} }

/* Pagination */
.pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 2rem; padding-top: 1.5rem; }
.pagination-info { color: var(--text-dim); font-size: 0.9rem; font-weight: 500; }
.pagination-controls { display: inline-flex; gap: 0.4rem; background: rgba(0, 0, 0, 0.2); padding: 0.4rem; border-radius: var(--radius-md); border: 1px solid var(--border); }
.page-btn {
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm); background: transparent; border: none; color: var(--text-muted);
    cursor: pointer; transition: var(--transition); font-weight: 600; font-size: 0.9rem; font-family: inherit;
}
.page-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); color: var(--text-main); }
.page-btn.active { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4); }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* Action buttons in table */
.tbl-action-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.3rem 0.6rem; font-size: 0.8rem; border-radius: 6px; cursor: pointer;
    transition: all 0.2s; white-space: nowrap; border: 1px solid; font-family: inherit;
}
.tbl-action-btn.retry { background: rgba(99, 102, 241, 0.15); color: #a5b4fc; border-color: rgba(99, 102, 241, 0.3); }
.tbl-action-btn.retry:hover { background: rgba(99, 102, 241, 0.25); color: #fff; }
.tbl-action-btn.cancel { background: rgba(245, 158, 11, 0.15); color: #fcd34d; border-color: rgba(245, 158, 11, 0.3); }
.tbl-action-btn.cancel:hover { background: rgba(245, 158, 11, 0.25); color: #fff; }
.tbl-action-btn.delete { background: var(--danger-bg); color: #fca5a5; border-color: var(--danger-border); }
.tbl-action-btn.delete:hover { background: rgba(239, 68, 68, 0.25); color: #fff; }

/* Empty State */
.empty-state { text-align: center; padding: 3rem; color: var(--text-dim); font-size: 0.95rem; }

/* ===== Modal ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 1000;
    background: #0B0E14; justify-content: center; align-items: center;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    width: 600px;
    max-width: 90%;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}
.modal-box h3 { margin: 0 0 1.2rem 0; color: var(--text-main); font-size: 1.2rem; }
.modal-box p { color: var(--text-muted); margin-bottom: 1rem; font-size: 0.9rem; }
.modal-box code { font-family: 'Consolas', monospace; font-size: 0.8rem; background: rgba(0,0,0,0.2); padding: 2px 6px; border-radius: 4px; color: #a5b4fc; }
.modal-box textarea {
    width: 100%; height: 200px; padding: 1rem; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: rgba(0,0,0,0.25); color: var(--text-main);
    font-family: 'Consolas', monospace; font-size: 0.9rem; resize: vertical; box-sizing: border-box;
    line-height: 1.6; outline: none; transition: var(--transition);
}
.modal-box textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.2); }
.modal-box textarea::placeholder { color: var(--text-dim); }
.modal-footer { display: flex; gap: 0.8rem; justify-content: flex-end; margin-top: 1.2rem; }
.modal-footer button {
    padding: 0.5rem 1.2rem; border-radius: var(--radius-sm); cursor: pointer;
    font-size: 0.9rem; font-family: inherit; transition: var(--transition);
}
.modal-btn-cancel { border: 1px solid var(--border); background: transparent; color: var(--text-muted); }
.modal-btn-cancel:hover { background: rgba(255,255,255,0.05); }
.modal-btn-submit { border: none; background: linear-gradient(135deg, var(--success), #059669); color: #fff; font-weight: 600; }
.modal-btn-submit:hover { box-shadow: 0 4px 15px rgba(16,185,129,0.4); }

/* Redeem Modal Specifics */
.modal-close-x {
    position: absolute; top: 14px; right: 16px; background: none; border: none;
    color: var(--text-dim); font-size: 1.3rem; cursor: pointer; transition: var(--transition);
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
}
.modal-close-x:hover { background: rgba(255,255,255,0.08); color: #fff; }
.modal-box { position: relative; }
.redeem-icon-wrap {
    width: 72px; height: 72px; margin: 0 auto;
    background: linear-gradient(135deg, rgba(6,182,212,0.15), rgba(99,102,241,0.15));
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    border: 2px solid rgba(6,182,212,0.25);
}
.redeem-gift-icon {
    display: flex; align-items: center; justify-content: center;
}
.redeem-submit-btn {
    width: 100%; padding: 0.8rem 1.5rem; border-radius: var(--radius-sm); border: none;
    background: linear-gradient(135deg, #06b6d4, #0891b2); color: #fff;
    font-weight: 700; font-size: 1rem; cursor: pointer; font-family: inherit;
    transition: var(--transition); box-shadow: 0 4px 15px rgba(6,182,212,0.3);
}
.redeem-submit-btn:hover { box-shadow: 0 6px 20px rgba(6,182,212,0.5); }
.redeem-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== Toast ===== */
#toast-container {
    position: fixed; top: 20px; right: 20px; z-index: 9999;
    display: flex; flex-direction: column; gap: 10px;
}

/* ===== Loading Overlay ===== */
.loading-overlay {
    position: absolute; inset: 0;
    background: rgba(11, 14, 20, 0.7); backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    z-index: 100; opacity: 0; pointer-events: none;
    transition: opacity 0.4s ease; border-radius: var(--radius-lg);
}
.loading-overlay.active { opacity: 1; pointer-events: all; }
.spinner-lg {
    width: 48px; height: 48px;
    border: 4px solid rgba(99, 102, 241, 0.2); border-radius: 50%;
    border-top-color: var(--primary); border-left-color: var(--secondary);
    animation: spin 1s cubic-bezier(0.5, 0.1, 0.4, 0.9) infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

/* Reset Failed button */
.btn-reset-failed {
    display: inline-flex; align-items: center; padding: 0.3rem 0.8rem;
    font-size: 0.75rem; font-weight: 600; border-radius: 6px; border: 1px solid rgba(255,255,255,0.2);
    background: linear-gradient(135deg, var(--danger), #dc2626); color: #fff; cursor: pointer;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4); transition: var(--transition);
}
.btn-reset-failed:hover { box-shadow: 0 4px 20px rgba(239, 68, 68, 0.6); }

/* Responsive */
@media (max-width: 768px) {
    .container { padding: 1.5rem 1rem; }
    header { gap: 1rem; }
    h1 { font-size: 1.3rem; }
    .header-controls { gap: 0.8rem; }
    .action-nav { flex-wrap: wrap; border-radius: var(--radius-md); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
}
