/* VFlexBot - Neon Glass Dashboard */

:root {
    /* Base — near-black with a subtle purple tint */
    --bg-primary: #0a0a12;
    --bg-secondary: #0f0f1a;
    --bg-tertiary: #16162a;

    /* Glass surfaces */
    --glass: rgba(255, 255, 255, 0.045);
    --glass-strong: rgba(255, 255, 255, 0.07);
    --glass-border: rgba(139, 92, 246, 0.22);
    --blur: 20px;
    --card-radius: 20px;

    /* Text */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;

    /* Accents — purple → cyan neon */
    --accent: #8b5cf6;
    --accent-hover: #7c3aed;
    --accent-cyan: #22d3ee;
    --accent-grad: linear-gradient(135deg, #8b5cf6 0%, #22d3ee 100%);
    --accent-soft: rgba(139, 92, 246, 0.15);

    /* Status */
    --success: #34d399;
    --danger: #f43f5e;
    --warning: #fbbf24;
    --info: #38bdf8;

    /* Border alias (some markup references --border-color) */
    --border: rgba(139, 92, 246, 0.18);
    --border-color: rgba(139, 92, 246, 0.18);

    /* Glow shadows (colored) — intensified */
    --shadow: 0 8px 32px rgba(139, 92, 246, 0.25);
    --glow: 0 12px 48px rgba(139, 92, 246, 0.45);
    --glow-cyan: 0 8px 32px rgba(34, 211, 238, 0.40);
    --glow-sm: 0 4px 18px rgba(139, 92, 246, 0.30);

    --sidebar-width: 260px;
    --header-height: 56px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

/* Animated mesh gradient behind everything — gives the glass cards something to blur. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 15% 20%, rgba(139, 92, 246, 0.22), transparent 40%),
        radial-gradient(circle at 85% 15%, rgba(34, 211, 238, 0.18), transparent 38%),
        radial-gradient(circle at 50% 90%, rgba(236, 72, 153, 0.14), transparent 45%);
    background-size: 200% 200%;
    animation: mesh 22s ease-in-out infinite;
    pointer-events: none;
}

@keyframes mesh {
    0%, 100% { background-position: 0% 0%, 100% 0%, 50% 100%; }
    50%      { background-position: 30% 40%, 70% 30%, 60% 70%; }
}

@media (prefers-reduced-motion: reduce) {
    body::before { animation: none; }
}

/* Auth */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    padding: 20px;
}

.auth-card {
    background: var(--glass);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border-radius: var(--card-radius);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glow);
}

.logo { text-align: center; margin-bottom: 32px; }
.logo h1 {
    font-size: 30px;
    font-weight: 800;
    margin-top: 12px;
    background: var(--accent-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}
.logo p { color: var(--text-secondary); font-size: 14px; }

/* Auth tabs (Sign In / Sign Up) and shared auth widgets */
.tabs {
    display: flex;
    gap: 0;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
}

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

.tab-btn.active {
    background: var(--accent-grad);
    color: #fff;
    box-shadow: var(--glow-sm);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-secondary);
    font-size: 13px;
}

/* Status messages (billing/connect) */
.status-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 12px 0;
    font-size: 14px;
}
.status-message.success { background: rgba(34,197,94,0.1); color: var(--success); }
.status-message.error   { background: rgba(239,68,68,0.1); color: var(--danger); }
.status-message.info    { background: rgba(139,92,246,0.1); color: var(--accent); }
.status-message.warning { background: rgba(245,158,11,0.1); color: var(--warning); }

/* Instruction boxes (connect_amazon steps) */
.instruction-box {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin: 16px 0;
    text-align: left;
}
.instruction-box ol { margin: 0; padding-left: 20px; color: var(--text-secondary); }
.instruction-box li { margin: 10px 0; line-height: 1.5; }
.instruction-box li strong { color: var(--text-primary); }
.instruction-box code {
    background: rgba(139,92,246,0.15);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--accent);
    font-family: monospace;
    font-size: 12px;
}

/* Layout */
.app-container { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: rgba(12, 12, 22, 0.55);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border-right: 1px solid var(--glass-border);
    padding: 24px 0;
    display: flex;
    flex-direction: column;
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.35);
}

.sidebar-header {
    padding: 0 24px 24px;
    border-bottom: 1px solid var(--glass-border);
}

.sidebar-header h2 {
    font-size: 22px;
    font-weight: 800;
    background: var(--accent-grad);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 6s linear infinite;
    filter: drop-shadow(0 0 12px rgba(139, 92, 246, 0.5));
}

@keyframes shimmer {
    to { background-position: 200% center; }
}

.nav-menu { padding: 16px 0; flex: 1; }

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    font-weight: 500;
}

.nav-item:hover, .nav-item.active {
    background: var(--accent-soft);
    color: var(--text-primary);
    border-left-color: transparent;
    position: relative;
}

.nav-item.active::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--accent-grad);
    box-shadow: 0 0 12px var(--accent);
}

.nav-item.active .nav-icon { filter: drop-shadow(0 0 6px var(--accent)); }

.nav-item i, .nav-icon { margin-right: 12px; font-size: 18px; }

/* SVG icons (Lucide-style, inherit currentColor) */
.nav-icon svg,
.btn-icon svg,
.menu-toggle svg,
.ic-sm {
    width: 20px;
    height: 20px;
    display: inline-block;
    vertical-align: middle;
}
.ic-sm { width: 16px; height: 16px; }
.nav-icon { display: inline-flex; align-items: center; justify-content: center; }
.menu-toggle svg { width: 22px; height: 22px; }
/* Nav icons glow when active */
.nav-item.active .nav-icon svg {
    color: var(--accent-cyan);
    filter: drop-shadow(0 0 6px var(--accent)); }
.nav-item:hover .nav-icon svg { color: var(--text-primary); }

.main-content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    gap: 16px;
    flex-wrap: wrap;
}

.header h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

/* Cards — the core glass surface */
.card {
    background: var(--glass);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border-radius: var(--card-radius);
    padding: 24px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow);
    border-color: rgba(139, 92, 246, 0.40);
}

.card h3 { font-size: 18px; margin-bottom: 16px; font-weight: 700; }

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

/* Two-column form grid (collapses to 1 col on mobile via media query) */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Plans grid */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--glass);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--glow);
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    margin: 8px 0;
    background: var(--accent-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 12px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
    gap: 8px;
    text-decoration: none;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--accent-grad);
    color: white;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.40);
}

.btn-primary:hover {
    filter: brightness(1.08);
    box-shadow: 0 6px 28px rgba(139, 92, 246, 0.55);
}

.btn-danger {
    background: linear-gradient(135deg, #f43f5e, #fb7185);
    color: white;
    box-shadow: 0 4px 18px rgba(244, 63, 94, 0.35);
}

.btn-danger:hover { filter: brightness(1.08); box-shadow: 0 6px 26px rgba(244, 63, 94, 0.5); }

.btn-secondary {
    background: var(--glass-strong);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    border-color: var(--accent);
    box-shadow: var(--glow-sm);
    background: rgba(255, 255, 255, 0.08);
}

.btn-large { padding: 14px 28px; font-size: 16px; border-radius: 14px; }

.btn-block { width: 100%; }

.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

/* Status */
.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.status-indicator.running { background: var(--success); box-shadow: 0 0 12px var(--success); animation: pulse 1.6s ease-in-out infinite; }
.status-indicator.stopped { background: var(--danger); box-shadow: 0 0 8px var(--danger); }

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.accepted { background: rgba(34,197,94,0.2); color: var(--success); }
.status-badge.expired { background: rgba(239,68,68,0.2); color: var(--danger); }
.status-badge.pending { background: rgba(245,158,11,0.2); color: var(--warning); }
.status-badge.available { background: rgba(59,130,246,0.2); color: var(--info); }

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--danger);
    display: inline-block;
    margin-right: 8px;
    box-shadow: 0 0 8px var(--danger);
}

.status-dot.active {
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
    animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 8px var(--success); }
    50% { box-shadow: 0 0 18px var(--success), 0 0 28px rgba(52, 211, 153, 0.5); }
}

/* Token Status */
.token-status-display {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

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

/* Forms */
.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: #64748b; }

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Validation Messages */
.validation-msg {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    margin-top: 10px;
}

.validation-msg.success { background: rgba(34,197,94,0.1); color: var(--success); }
.validation-msg.error { background: rgba(239,68,68,0.1); color: var(--danger); }
.validation-msg.warning { background: rgba(245,158,11,0.1); color: var(--warning); }
.validation-msg.info { background: rgba(59,130,246,0.1); color: var(--info); }

/* Setup Steps */
.setup-step {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-primary);
    border-radius: 8px;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.step-content h4 { margin-bottom: 4px; }
.step-content p { color: var(--text-secondary); font-size: 14px; }

/* Challenge Link */
.challenge-link {
    display: block;
    padding: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--accent);
    border-radius: 8px;
    color: var(--accent);
    font-size: 13px;
    word-break: break-all;
    margin: 8px 0;
    text-decoration: none;
}

.challenge-link:hover { background: rgba(139,92,246,0.1); }

/* Service Areas */
.service-areas-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.area-tag {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(139,92,246,0.15);
    color: var(--accent);
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
}

/* Help Text */
.help-text {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 4px;
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

/* Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
}

.data-table .empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 32px;
}

/* Section */
.section { display: none; }
.section.active {
    display: block;
    animation: sectionIn 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Stagger the cards inside an entering section for a polished reveal */
.section.active > .card,
.section.active > .stats-grid,
.section.active .stat-card,
.section.active .feed-stat,
.section.active .account-row,
.section.active .block-row,
.section.active .mode-detail-card {
    animation: cardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.section.active > .card:nth-child(2),
.section.active .stat-card:nth-child(2),
.section.active .stat-card:nth-child(4) { animation-delay: 0.06s; }
.section.active > .card:nth-child(3),
.section.active .stat-card:nth-child(3) { animation-delay: 0.12s; }
.section.active > .card:nth-child(4) { animation-delay: 0.18s; }

@keyframes sectionIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes cardIn {
    from { opacity: 0; transform: translateY(20px) scale(0.985); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .section.active, .section.active > * { animation: none !important; }
}

/* Toast */
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Plan Cards */
.plan-card {
    background: var(--glass);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.plan-card:hover { transform: translateY(-3px); box-shadow: var(--glow); }

.plan-price {
    font-size: 38px;
    font-weight: 800;
    margin: 12px 0;
    background: var(--accent-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.plan-features { list-style: none; margin: 16px 0; }
.plan-features li { padding: 6px 0; color: var(--text-secondary); }

/* Icon buttons (notification bell, etc.) */
.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 18px;
    background: var(--glass-strong);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    box-shadow: var(--glow-sm);
}

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

/* Notification badge (count over the bell) */
.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    z-index: 1001;
    box-shadow: 0 0 12px rgba(244, 63, 94, 0.7);
}

.nav-icon { margin-right: 12px; font-size: 18px; }

/* Generic form control (text search inputs outside .form-group) */
.form-control {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    padding: 10px 14px;
}

.checkbox-group {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 24px;
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    z-index: 9999;
    animation: slideIn 0.3s ease;
    box-shadow: var(--shadow);
}
.toast-success { background: var(--success); }
.toast-error   { background: var(--danger); }
.toast-info    { background: var(--accent); }
.toast-warning { background: var(--warning); }

/* Schedule items */
.schedule-item {
    padding: 12px;
    background: var(--bg-primary);
    border-radius: 8px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ============================================
   DASHBOARD FEATURES (LaFenice parity)
   ============================================ */

/* Capture-mode segmented selector (header) */
/* Capture-mode segmented selector (header) */
.capture-mode-selector {
    display: inline-flex;
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 3px;
    gap: 2px;
}

.mode-btn {
    padding: 6px 12px;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.mode-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.06); }
.mode-btn.active { color: #fff; }
.mode-btn.masacre.active { background: #e53935; box-shadow: 0 0 16px rgba(229,57,53,0.6); }
.mode-btn.money.active   { background: #43a047; box-shadow: 0 0 16px rgba(67,160,71,0.6); }
.mode-btn.discreet.active{ background: #1976d2; box-shadow: 0 0 16px rgba(25,118,210,0.6); }
.mode-btn.food.active    { background: #ff9800; box-shadow: 0 0 16px rgba(255,152,0,0.6); }

/* Risk chip */
.risk-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
}
.risk-chip.high   { background: rgba(229,57,53,0.18); color: #ef5350; }
.risk-chip.medium { background: rgba(245,158,11,0.18); color: var(--warning); }
.risk-chip.low    { background: rgba(34,197,94,0.18); color: var(--success); }

/* Pause banner (anti-ban) */
.pause-banner {
    background: rgba(245,158,11,0.12);
    border: 1px solid var(--warning);
    color: var(--warning);
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
}

/* Activity feed */
.window-toggle {
    display: inline-flex;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 3px;
    gap: 2px;
    margin-bottom: 16px;
}
.window-toggle button {
    padding: 6px 14px;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.window-toggle button.active { background: var(--accent); color: #fff; }

.sparkline-wrap { position: relative; height: 220px; margin: 12px 0; }

.feed-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.feed-stat {
    background: var(--glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 14px;
}
.feed-stat .v {
    font-size: 22px; font-weight: 800;
    background: var(--accent-grad);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.feed-stat .l { font-size: 11px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }

/* Notification prefs matrix */
.matrix-table { width: 100%; border-collapse: collapse; }
.matrix-table th, .matrix-table td {
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.matrix-table th { color: var(--text-secondary); font-weight: 500; }
.matrix-table td.event-name { text-align: left; color: var(--text-primary); text-transform: capitalize; }
.matrix-table input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }

/* Amazon accounts */
.account-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.account-row .acc-info { flex: 1; min-width: 180px; }
.account-row .acc-info strong { display: block; }
.account-row .acc-info small { color: var(--text-secondary); }
.account-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 6px;
}
.account-badge.primary { background: rgba(139,92,246,0.18); color: var(--accent); }
.account-badge.active { background: rgba(34,197,94,0.18); color: var(--success); }
.account-badge.inactive { background: rgba(148,163,184,0.15); color: var(--text-secondary); }

/* Upcoming blocks / forfeit */
.block-row {
    padding: 14px;
    background: var(--glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.countdown {
    font-weight: 800;
    font-size: 18px;
    background: var(--accent-grad);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.countdown.urgent {
    background: none;
    -webkit-text-fill-color: var(--warning);
    color: var(--warning);
    text-shadow: 0 0 12px rgba(251,191,36,0.6);
}
.forfeit-btn {
    padding: 6px 14px;
    background: rgba(239,68,68,0.15);
    color: var(--danger);
    border: 1px solid var(--danger);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.forfeit-btn:hover { background: var(--danger); color: #fff; }
.penalty-warning {
    background: rgba(239,68,68,0.1);
    color: var(--danger);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    margin-top: 8px;
}

/* Admin badge on nav item */
.admin-badge {
    margin-left: auto;
    padding: 1px 6px;
    background: rgba(245,158,11,0.2);
    color: var(--warning);
    border-radius: 8px;
    font-size: 9px;
    font-weight: 700;
}

/* Mode detail cards (Capture Mode section) */
.mode-detail-card {
    background: var(--glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.mode-detail-card.active-mode {
    border-color: var(--accent);
    box-shadow: var(--glow-sm), 0 0 0 1px var(--accent);
}
.mode-detail-card h4 { margin-bottom: 6px; }
.mode-spec {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}
.mode-spec span strong { color: var(--text-primary); }

/* Referral card */
.referral-code-box {
    background: var(--glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px dashed var(--accent);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    margin-bottom: 16px;
    box-shadow: var(--glow-sm);
}
.referral-code-box .code {
    font-size: 32px; font-weight: 800; letter-spacing: 3px;
    background: var(--accent-grad);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}


/* Mobile menu toggle (hidden on desktop) */
.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 20px;
    background: var(--glass-strong);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Backdrop for mobile sidebar drawer */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 90;
}

.sidebar-backdrop.visible { display: block; }

/* Make offer-status select look consistent */
.filter-bar select {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 14px;
}

/* Notification panel */
.notif-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 360px;
    max-height: 420px;
    background: rgba(15, 15, 26, 0.85);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glow);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.notif-header .btn-sm {
    padding: 6px 10px;
    font-size: 12px;
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.notif-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.notif-item {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    background: var(--bg-primary);
    cursor: pointer;
    transition: background 0.2s;
    border-left: 3px solid transparent;
}

.notif-item:hover { background: rgba(139,92,246,0.1); }
.notif-item.unread { border-left-color: var(--accent); background: rgba(139,92,246,0.08); }
.notif-item .notif-type { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--accent); margin-bottom: 4px; }
.notif-item .notif-message { font-size: 13px; line-height: 1.4; }
.notif-item .notif-time { font-size: 11px; color: var(--text-secondary); margin-top: 6px; }
.notif-empty { text-align: center; color: var(--text-secondary); padding: 24px; font-size: 13px; }

/* ============================================
   RESPONSIVE — Tablet (<=1024px)
   ============================================ */
@media (max-width: 1024px) {
    .sidebar { width: 220px; }
    .main-content { padding: 24px; }
    .header h1 { font-size: 22px; }
}

/* ============================================
   RESPONSIVE — Mobile drawer (<=768px)
   Sidebar collapses into a slide-in drawer toggled
   by the menu button. Never a full-height vertical bar.
   ============================================ */
@media (max-width: 768px) {
    .app-container { display: block; }

    /* Drawer: off-canvas by default, slides in with .open */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        max-width: 85vw;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        padding-top: 16px;
    }
    .sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,0.5); }

    .menu-toggle { display: inline-flex; }

    .main-content {
        width: 100%;
        padding: 72px 16px 32px;
    }

    /* Sticky header with the hamburger */
    .header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: var(--header-height);
        background: rgba(10, 10, 18, 0.75);
        backdrop-filter: blur(var(--blur));
        -webkit-backdrop-filter: blur(var(--blur));
        border-bottom: 1px solid var(--glass-border);
        padding: 8px 16px;
        margin: -56px -16px 24px; /* offset the main-content padding */
        z-index: 80;
        flex-wrap: wrap;
        gap: 8px;
    }
    .header h1 { font-size: 18px; flex: 1 1 auto; min-width: 0; }
    .header-actions { gap: 8px; }

    /* Stats: 2 columns on phones */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .stat-value { font-size: 26px; }

    .card { padding: 16px; }
    .card h3 { font-size: 16px; }

    /* Inline form grids collapse to a single column */
    .form-grid-2,
    .card > div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Tables scroll horizontally instead of overflowing the viewport */
    .data-table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
    .data-table thead, .data-table tbody { display: table; width: 100%; }

    /* Notification panel spans most of the viewport */
    .notif-panel { width: calc(100vw - 32px); max-width: 360px; }

    /* Toasts sit above the bottom safe area */
    .toast { left: 16px; right: 16px; bottom: 16px; }

    /* Plan grid: one column on narrow phones */
    .plans-grid { grid-template-columns: 1fr !important; }

    /* Buttons that read "Start Bot" etc. stay tappable */
    .header-actions .btn { padding: 8px 14px; font-size: 13px; }

    /* Capture-mode selector wraps under the title on mobile */
    .capture-mode-selector { width: 100%; }
    .mode-btn { flex: 1; padding: 6px 4px; font-size: 11px; }

    /* Notification matrix scrolls horizontally on very narrow screens */
    .matrix-table { display: block; overflow-x: auto; white-space: nowrap; }

    /* Activity stats stack */
    .feed-stats { grid-template-columns: repeat(2, 1fr); }
}

/* Very small phones (<=380px): stats stack to one column */
@media (max-width: 380px) {
    .stats-grid { grid-template-columns: 1fr; }
}
