/* ═══════════════════════════════════════════════════════════
   RideSnapGo — Provider Dashboard
   Premium B2B SaaS styling
   ═══════════════════════════════════════════════════════════ */

:root {
    --rsg-dark: #0B0F1A;
    --rsg-navy: #111827;
    --rsg-slate: #1E293B;
    --rsg-card: #1A2332;
    --rsg-card-hover: #1E2A3A;
    --rsg-border: rgba(255, 255, 255, 0.08);
    --rsg-border-hover: rgba(255, 255, 255, 0.14);
    --rsg-blue: #3B82F6;
    --rsg-blue-dark: #2563EB;
    --rsg-cyan: #06B6D4;
    --rsg-amber: #F59E0B;
    --rsg-emerald: #10B981;
    --rsg-red: #EF4444;
    --rsg-orange: #F97316;
    --rsg-white: #FFFFFF;
    --rsg-text: #F8FAFC;
    --rsg-text-mid: #94A3B8;
    --rsg-text-dim: #64748B;
    --rsg-gradient: linear-gradient(135deg, var(--rsg-blue), var(--rsg-cyan));
    --rsg-glow: 0 0 60px rgba(59, 130, 246, 0.12);
    --rsg-card-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
    --rsg-card-shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px var(--rsg-border-hover);
    --radius: 12px;
    --radius-lg: 16px;
    --sidebar-width: 260px;
    --topbar-height: 56px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--rsg-text);
    background: var(--rsg-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

button { font-family: inherit; }

/* ─── Shared Logo ────────────────────────────────────── */
.rsg-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.rsg-logo-icon { display: flex; align-items: center; justify-content: center; }

.rsg-logo-text {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--rsg-white);
}

.rsg-logo-text .accent {
    background: var(--rsg-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ═══════════════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════════════ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--rsg-dark);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, rgba(6, 182, 212, 0.04) 40%, transparent 70%);
    pointer-events: none;
}

.login-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: var(--rsg-card);
    border: 1px solid var(--rsg-border);
    border-radius: 20px;
    padding: 48px 40px;
    box-shadow: var(--rsg-glow);
}

.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

.login-logo .rsg-logo-text {
    font-size: 28px;
}

.login-subtitle {
    text-align: center;
    color: var(--rsg-text-dim);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 36px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.form-group { margin-bottom: 20px; }

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

.form-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    font-family: inherit;
    color: var(--rsg-text);
    background: var(--rsg-dark);
    border: 1px solid var(--rsg-border);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input::placeholder { color: var(--rsg-text-dim); }

.form-input:focus {
    border-color: var(--rsg-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--rsg-text-mid);
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--rsg-blue);
    cursor: pointer;
}

.forgot-link {
    font-size: 14px;
    color: var(--rsg-blue);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.forgot-link:hover { color: var(--rsg-cyan); }

.btn-signin {
    display: block;
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-weight: 700;
    color: var(--rsg-white);
    background: var(--rsg-gradient);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
}

.btn-signin:hover { opacity: 0.92; transform: translateY(-1px); }
.btn-signin:active { transform: translateY(0); }
.btn-signin:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.login-error {
    display: none;
    margin-bottom: 20px;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #F87171;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 10px;
}

.login-error.show { display: block; }

/* ═══════════════════════════════════════════════════════════
   DASHBOARD PAGE
   ═══════════════════════════════════════════════════════════ */
.dashboard-page {
    min-height: 100vh;
    background: var(--rsg-dark);
    animation: page-fade-in 0.4s ease;
}

@keyframes page-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Sidebar ────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--rsg-navy);
    border-right: 1px solid var(--rsg-border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
}

.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); border-radius: 3px; }

.sidebar-header {
    padding: 20px 24px 18px;
    border-bottom: 1px solid var(--rsg-border);
}

.sidebar-nav {
    flex: 1;
    padding: 14px 12px;
}

.nav-section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--rsg-text-dim);
    padding: 12px 16px 8px;
}

.nav-divider {
    height: 1px;
    background: var(--rsg-border);
    margin: 12px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 2px;
    color: var(--rsg-text-dim);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.15s ease;
    cursor: pointer;
    position: relative;
}

.nav-item:hover {
    color: var(--rsg-text);
    background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
    color: var(--rsg-white);
    background: rgba(59, 130, 246, 0.12);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--rsg-gradient);
    border-radius: 0 3px 3px 0;
}

.nav-item.active .nav-icon { color: var(--rsg-blue); }

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon svg {
    width: 18px;
    height: 18px;
}

.nav-label {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-badge {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--rsg-cyan);
    background: rgba(6, 182, 212, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.nav-count {
    font-size: 11px;
    font-weight: 700;
    color: var(--rsg-white);
    background: var(--rsg-red);
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.nav-status-dots {
    display: inline-flex;
    gap: 3px;
    margin-left: 4px;
}

.nav-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--rsg-emerald);
    box-shadow: 0 0 4px rgba(16, 185, 129, 0.5);
}

.nav-status-dot.red {
    background: var(--rsg-red);
    box-shadow: 0 0 4px rgba(239, 68, 68, 0.5);
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--rsg-border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--rsg-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rsg-white);
    font-size: 13px;
    font-weight: 800;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--rsg-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-plan {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--rsg-cyan);
    background: rgba(6, 182, 212, 0.12);
    padding: 2px 7px;
    border-radius: 5px;
    margin-top: 4px;
}

/* ─── Top Bar ────────────────────────────────────────── */
.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background: rgba(11, 15, 26, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--rsg-border);
    z-index: 90;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 32px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.topbar-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--rsg-white);
    white-space: nowrap;
}

.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--rsg-text-dim);
}

.topbar-breadcrumb .sep { color: var(--rsg-text-dim); opacity: 0.5; }
.topbar-breadcrumb .current { color: var(--rsg-text-mid); }

.topbar-search {
    flex: 1;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
}

.topbar-search-input {
    width: 100%;
    padding: 8px 14px 8px 38px;
    font-size: 13.5px;
    font-family: inherit;
    color: var(--rsg-text);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--rsg-border);
    border-radius: 10px;
    outline: none;
    transition: all 0.2s;
}

.topbar-search-input::placeholder { color: var(--rsg-text-dim); }

.topbar-search-input:focus {
    border-color: rgba(59, 130, 246, 0.4);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.topbar-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--rsg-text-dim);
    width: 16px;
    height: 16px;
}

.topbar-search-kbd {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    font-weight: 600;
    color: var(--rsg-text-dim);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--rsg-border);
    padding: 2px 7px;
    border-radius: 5px;
    font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-primary-cta {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 700;
    color: var(--rsg-white);
    background: var(--rsg-gradient);
    border: none;
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.25);
}

.btn-primary-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-primary-cta:active { transform: translateY(0); }

.btn-primary-cta svg { width: 14px; height: 14px; }

.topbar-icon-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--rsg-border);
    border-radius: 10px;
    color: var(--rsg-text-mid);
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    text-decoration: none;
}

.topbar-icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--rsg-border-hover);
    color: var(--rsg-text);
}

.topbar-icon-btn svg { width: 16px; height: 16px; }

.topbar-notif-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--rsg-red);
    border-radius: 50%;
    border: 2px solid var(--rsg-dark);
    animation: pulse-dot 2s ease infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
}

.topbar-avatar-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--rsg-border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    color: inherit;
}

.topbar-avatar-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--rsg-border-hover);
}

.topbar-avatar {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: var(--rsg-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rsg-white);
    font-size: 11px;
    font-weight: 800;
}

.topbar-avatar-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--rsg-text);
}

.topbar-avatar-btn svg {
    width: 14px;
    height: 14px;
    color: var(--rsg-text-dim);
}

/* Avatar dropdown menu */
.avatar-menu-wrap { position: relative; }

.avatar-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: var(--rsg-card);
    border: 1px solid var(--rsg-border);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    z-index: 200;
    display: none;
}

.avatar-menu.open { display: block; }

.avatar-menu-header {
    padding: 10px 12px 12px;
    border-bottom: 1px solid var(--rsg-border);
    margin-bottom: 6px;
}

.avatar-menu-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--rsg-text);
}

.avatar-menu-email {
    font-size: 12px;
    color: var(--rsg-text-dim);
    margin-top: 2px;
    word-break: break-all;
}

.avatar-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--rsg-text-mid);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.15s;
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

.avatar-menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--rsg-text);
}

.avatar-menu-item.danger {
    color: #F87171;
}

.avatar-menu-item.danger:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #FCA5A5;
}

/* ─── Main Content ───────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-width);
    padding: calc(var(--topbar-height) + 24px) 32px 32px;
    min-height: 100vh;
}

.page-meta {
    margin-bottom: 22px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.page-date {
    font-size: 13px;
    color: var(--rsg-text-dim);
}

.page-date strong { color: var(--rsg-text-mid); font-weight: 600; }

/* ─── Hero Chart Card ────────────────────────────────── */
.hero-chart {
    position: relative;
    background:
        linear-gradient(var(--rsg-card), var(--rsg-card)) padding-box,
        linear-gradient(135deg, rgba(59, 130, 246, 0.35), rgba(6, 182, 212, 0.15), rgba(59, 130, 246, 0.05)) border-box;
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: 0 0 50px rgba(59, 130, 246, 0.08), var(--rsg-card-shadow);
    overflow: hidden;
}

.hero-chart::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 280px;
    height: 100%;
    background: radial-gradient(ellipse at right, rgba(6, 182, 212, 0.1), transparent 70%);
    pointer-events: none;
}

.hero-chart-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-chart-titles {
    display: flex;
    align-items: center;
    gap: 14px;
}

.hero-chart-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--rsg-text);
}

.hero-chart-switch {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--rsg-border);
    border-radius: 8px;
    padding: 2px;
}

.hero-chart-switch button {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    background: transparent;
    border: none;
    color: var(--rsg-text-dim);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.hero-chart-switch button.active {
    background: rgba(59, 130, 246, 0.15);
    color: var(--rsg-white);
}

.hero-chart-tabs {
    display: inline-flex;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--rsg-border);
    border-radius: 9px;
    padding: 3px;
}

.hero-chart-tab {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    background: transparent;
    border: none;
    color: var(--rsg-text-dim);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.hero-chart-tab:hover { color: var(--rsg-text-mid); }

.hero-chart-tab.active {
    background: var(--rsg-gradient);
    color: var(--rsg-white);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.hero-chart-body {
    display: grid;
    grid-template-columns: minmax(200px, 1fr) minmax(280px, 1.6fr);
    gap: 20px;
    align-items: center;
    position: relative;
}

.hero-chart-summary { min-width: 0; }

.hero-chart-value {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -1.5px;
    color: var(--rsg-white);
    line-height: 1.05;
    margin-bottom: 4px;
}

.hero-chart-value .unit {
    font-size: 18px;
    font-weight: 700;
    color: var(--rsg-text-mid);
    margin-left: 4px;
}

.hero-chart-label {
    font-size: 13px;
    color: var(--rsg-text-dim);
    margin-bottom: 10px;
}

.hero-chart-change {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 700;
    color: var(--rsg-emerald);
    background: rgba(16, 185, 129, 0.1);
    padding: 3px 9px;
    border-radius: 6px;
}

.hero-chart-change svg { width: 11px; height: 11px; }

.hero-chart-svg-wrap {
    position: relative;
    width: 100%;
    height: 120px;
}

.hero-chart-svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* ─── Failed Jobs Alert Banner ───────────────────────── */
.alert-amber {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.15);
    border-left: 3px solid var(--rsg-amber);
    border-radius: var(--radius);
    margin-bottom: 20px;
    animation: slide-fade-in 0.3s ease;
}

@keyframes slide-fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.alert-amber-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 8px;
    background: rgba(245, 158, 11, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rsg-amber);
}

.alert-amber-icon svg { width: 18px; height: 18px; }

.alert-amber-body {
    flex: 1;
    min-width: 0;
}

.alert-amber-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--rsg-text);
    margin-bottom: 2px;
}

.alert-amber-sub {
    font-size: 13px;
    color: var(--rsg-text-mid);
}

.alert-amber-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-amber {
    padding: 7px 14px;
    font-size: 12.5px;
    font-weight: 700;
    color: #0B0F1A;
    background: var(--rsg-amber);
    border: 1px solid var(--rsg-amber);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-amber:hover {
    background: #D97706;
    border-color: #D97706;
    transform: translateY(-1px);
}

.btn-amber-outline {
    padding: 7px 14px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--rsg-amber);
    background: transparent;
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-amber-outline:hover {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.55);
}

.alert-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--rsg-text-dim);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
    flex-shrink: 0;
}

.alert-close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--rsg-text);
}

.alert-close svg { width: 14px; height: 14px; }

/* ─── Stats Cards Row ────────────────────────────────── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--rsg-card);
    border: 1px solid var(--rsg-border);
    border-radius: var(--radius);
    padding: 18px 20px;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--rsg-border-hover);
    box-shadow: var(--rsg-card-shadow-hover);
}

.stat-card.hero-card {
    border: 1px solid transparent;
    background:
        linear-gradient(var(--rsg-card), var(--rsg-card)) padding-box,
        var(--rsg-gradient) border-box;
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.1);
}

.stat-card.hero-card:hover {
    box-shadow: 0 0 50px rgba(59, 130, 246, 0.18), 0 12px 40px rgba(0, 0, 0, 0.35);
}

.stat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--rsg-text-dim);
}

.stat-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.1);
    color: var(--rsg-blue);
    flex-shrink: 0;
}

.stat-icon.emerald { background: rgba(16, 185, 129, 0.1); color: var(--rsg-emerald); }
.stat-icon.cyan { background: rgba(6, 182, 212, 0.1); color: var(--rsg-cyan); }
.stat-icon.amber { background: rgba(245, 158, 11, 0.1); color: var(--rsg-amber); }

.stat-icon svg { width: 15px; height: 15px; }

.stat-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--rsg-white);
    letter-spacing: -0.8px;
    line-height: 1.1;
    margin-bottom: 4px;
}

.stat-value .unit {
    font-size: 14px;
    font-weight: 700;
    color: var(--rsg-text-mid);
    margin-left: 2px;
}

.stat-sub {
    font-size: 12.5px;
    color: var(--rsg-text-dim);
}

.stat-sub a {
    color: var(--rsg-blue);
    text-decoration: none;
    font-weight: 600;
}

.stat-sub a:hover { color: var(--rsg-cyan); }

.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 700;
    color: var(--rsg-emerald);
    margin-left: 4px;
}

.stat-trend svg { width: 10px; height: 10px; }

.progress-bar-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    margin-top: 12px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--rsg-gradient);
    transition: width 0.6s ease;
}

.progress-bar-fill.amber { background: linear-gradient(135deg, var(--rsg-amber), var(--rsg-orange)); }

/* ─── Content Grid (Activity + Sidebar panels) ───────── */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 20px;
    margin-bottom: 22px;
}

.card {
    background: var(--rsg-card);
    border: 1px solid var(--rsg-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card.hoverable:hover {
    transform: translateY(-2px);
    border-color: var(--rsg-border-hover);
    box-shadow: var(--rsg-card-shadow-hover);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    border-bottom: 1px solid var(--rsg-border);
    gap: 12px;
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--rsg-white);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title-count {
    font-size: 11px;
    font-weight: 700;
    color: var(--rsg-text-dim);
    background: rgba(255,255,255,0.05);
    padding: 2px 7px;
    border-radius: 5px;
}

.card-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--rsg-text-dim);
    background: rgba(255,255,255,0.04);
    padding: 4px 10px;
    border-radius: 6px;
}

.card-link {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--rsg-blue);
    text-decoration: none;
    transition: color 0.2s;
}

.card-link:hover { color: var(--rsg-cyan); }

/* ─── Activity Table ─────────────────────────────────── */
.activity-table {
    width: 100%;
    border-collapse: collapse;
}

.activity-table th {
    text-align: left;
    padding: 10px 22px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--rsg-text-dim);
    background: rgba(255,255,255,0.015);
    border-bottom: 1px solid var(--rsg-border);
}

.activity-table td {
    padding: 12px 22px;
    font-size: 13.5px;
    color: var(--rsg-text-mid);
    border-bottom: 1px solid var(--rsg-border);
}

.activity-table tr:last-child td {
    border-bottom: none;
}

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

.activity-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.015);
}

.activity-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

.activity-table tbody tr .btn-retry {
    opacity: 0;
    transition: opacity 0.15s ease;
}

.activity-table tbody tr:hover .btn-retry {
    opacity: 1;
}

.filename {
    font-weight: 500;
    color: var(--rsg-text);
    font-family: ui-monospace, 'SFMono-Regular', 'Consolas', 'Liberation Mono', monospace;
    font-size: 12.5px;
}

.time-cell {
    font-size: 12.5px;
    color: var(--rsg-text-dim);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* ─── Status Badges ──────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.2px;
}

.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge-published { color: #34D399; background: rgba(16, 185, 129, 0.12); }
.badge-processing {
    color: #60A5FA;
    background: rgba(59, 130, 246, 0.12);
}
.badge-processing::before { animation: badge-pulse 1.4s ease-in-out infinite; }

@keyframes badge-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(96, 165, 250, 0.4); }
    50%      { opacity: 0.6; box-shadow: 0 0 0 4px rgba(96, 165, 250, 0); }
}

.badge-downloading { color: #67E8F9; background: rgba(6, 182, 212, 0.12); }
.badge-failed { color: #F87171; background: rgba(239, 68, 68, 0.12); }
.badge-detected { color: #94A3B8; background: rgba(255, 255, 255, 0.06); }
.badge-rejected { color: #FB923C; background: rgba(249, 115, 22, 0.12); }

.btn-retry {
    padding: 4px 10px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--rsg-red);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-retry:hover {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.35);
}

.btn-retry .kbd-hint {
    font-size: 9px;
    font-weight: 700;
    color: var(--rsg-text-dim);
    background: rgba(0, 0, 0, 0.3);
    padding: 1px 4px;
    border-radius: 3px;
    font-family: ui-monospace, monospace;
}

/* ─── Connection Status Card ─────────────────────────── */
.conn-list {
    padding: 6px 0;
}

.conn-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 22px;
    border-bottom: 1px solid var(--rsg-border);
    transition: background 0.15s ease;
}

.conn-item:last-child { border-bottom: none; }

.conn-item:hover { background: rgba(255, 255, 255, 0.02); }

.conn-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--rsg-border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--rsg-text-mid);
}

.conn-icon svg { width: 18px; height: 18px; }

.conn-body { flex: 1; min-width: 0; }

.conn-name {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    color: var(--rsg-text);
    margin-bottom: 2px;
}

.conn-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--rsg-emerald);
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
    flex-shrink: 0;
}

.conn-dot.red {
    background: var(--rsg-red);
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}

.conn-status-text {
    font-size: 11.5px;
    color: var(--rsg-text-dim);
}

.conn-status-text .mono {
    font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace;
    color: var(--rsg-text-mid);
}

/* ─── Processing Queue ───────────────────────────────── */
.queue-list {
    padding: 6px 0;
}

.queue-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 13px 22px;
    border-bottom: 1px solid var(--rsg-border);
    transition: background 0.15s;
}

.queue-item:last-child { border-bottom: none; }

.queue-item:hover { background: rgba(255,255,255,0.02); }

.queue-filename {
    flex: 1;
    min-width: 0;
}

.queue-filename .filename {
    display: block;
    margin-bottom: 2px;
}

.queue-filename .queue-step {
    font-size: 11.5px;
    color: var(--rsg-text-dim);
}

.queue-progress {
    width: 160px;
    flex-shrink: 0;
}

.queue-progress-bar {
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.queue-progress-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--rsg-gradient);
    transition: width 0.4s ease;
    position: relative;
    overflow: hidden;
}

.queue-progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: queue-shimmer 1.6s ease-in-out infinite;
}

@keyframes queue-shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.queue-pct {
    font-size: 12px;
    font-weight: 700;
    color: var(--rsg-text);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ─── Empty state ────────────────────────────────────── */
.empty-state {
    padding: 56px 24px;
    text-align: center;
}

.empty-illus {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 16px;
    background: rgba(59, 130, 246, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rsg-text-dim);
}

.empty-illus svg { width: 32px; height: 32px; }

.empty-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--rsg-text);
    margin-bottom: 6px;
}

.empty-sub {
    font-size: 13px;
    color: var(--rsg-text-dim);
    max-width: 280px;
    margin: 0 auto;
}

/* ─── Mobile Header ──────────────────────────────────── */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: rgba(11, 15, 26, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--rsg-border);
    z-index: 100;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    gap: 10px;
}

.mobile-menu-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--rsg-border);
    border-radius: 10px;
    color: var(--rsg-text-mid);
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-menu-btn:hover {
    border-color: var(--rsg-border-hover);
    color: var(--rsg-white);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1180px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

    .stats-row {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1024px) {
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-chart-body {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .hero-chart-svg-wrap {
        height: 100px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.open {
        display: block;
    }

    .topbar { display: none; }

    .mobile-header { display: flex; }

    .main-content {
        margin-left: 0;
        padding: calc(var(--topbar-height) + 20px) 16px 24px;
    }

    .stats-row {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .hero-chart { padding: 16px 18px; }

    .hero-chart-svg-wrap {
        height: 80px;
    }

    .hero-chart-value { font-size: 28px; }

    .alert-amber { flex-wrap: wrap; }

    .alert-amber-actions { width: 100%; margin-top: 4px; }

    .activity-table,
    .activity-table thead,
    .activity-table tbody,
    .activity-table tr,
    .activity-table td {
        display: block;
        width: 100%;
    }

    .activity-table thead { display: none; }

    .activity-table tbody tr {
        padding: 12px 16px;
        border-bottom: 1px solid var(--rsg-border);
    }

    .activity-table tbody tr:nth-child(even) {
        background: transparent;
    }

    .activity-table td {
        padding: 3px 0;
        border-bottom: none;
    }

    .activity-table td:first-child {
        display: inline-block;
        margin-right: 8px;
        color: var(--rsg-text-dim);
        font-size: 12px;
    }

    .activity-table td:nth-child(2) {
        display: inline-block;
        vertical-align: middle;
    }

    .activity-table td:nth-child(3),
    .activity-table td:nth-child(4) {
        display: inline-block;
        margin-top: 6px;
        margin-right: 8px;
    }

    .activity-table tbody tr .btn-retry { opacity: 1; }

    .queue-progress {
        width: 90px;
    }
}

@media (max-width: 640px) {
    .stats-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 36px 24px;
    }

    .main-content {
        padding: calc(var(--topbar-height) + 16px) 12px 20px;
    }
}

/* ─── Subtle top-level page fade ─── */
.content-fade { animation: page-fade-in 0.5s ease both; }
.content-fade.d1 { animation-delay: 0.05s; }
.content-fade.d2 { animation-delay: 0.1s; }
.content-fade.d3 { animation-delay: 0.15s; }
.content-fade.d4 { animation-delay: 0.2s; }
