/* ═══════════════════════════════════════════════════════════════════════
   Business Scanner - Premium Dark Theme with Glassmorphism
   ═══════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Tajawal:wght@300;400;500;700;800&display=swap');

/* ─── CSS Variables ────────────────────────────────────────────────── */
:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #111128;
    --bg-card: rgba(20, 20, 50, 0.6);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --bg-glass-hover: rgba(255, 255, 255, 0.08);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-active: rgba(120, 100, 255, 0.3);

    --text-primary: #e8e8f0;
    --text-secondary: #8888aa;
    --text-muted: #55557a;
    --text-bright: #ffffff;

    --accent-primary: #7c5cfc;
    --accent-secondary: #5c9cfc;
    --accent-gradient: linear-gradient(135deg, #7c5cfc 0%, #5c9cfc 50%, #5cfcb4 100%);
    --accent-gradient-subtle: linear-gradient(135deg, rgba(124, 92, 252, 0.15), rgba(92, 156, 252, 0.15));
    --accent-glow: 0 0 30px rgba(124, 92, 252, 0.3);

    --success: #4ceba0;
    --warning: #fcb85c;
    --danger: #fc5c7c;
    --info: #5cb8fc;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(124, 92, 252, 0.15);

    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset & Base ─────────────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Tajawal', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    direction: rtl;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ─── Background Effects ───────────────────────────────────────────── */
.bg-effects {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.bg-orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(124, 92, 252, 0.3), transparent 70%);
    top: -10%;
    right: -5%;
    animation-delay: 0s;
}

.bg-orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(92, 156, 252, 0.25), transparent 70%);
    bottom: -10%;
    left: -5%;
    animation-delay: -7s;
}

.bg-orb-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(92, 252, 180, 0.2), transparent 70%);
    top: 40%;
    left: 30%;
    animation-delay: -14s;
}

.bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* ─── Container ────────────────────────────────────────────────────── */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

/* ─── Header ───────────────────────────────────────────────────────── */
.header {
    padding: 32px 0 24px;
    text-align: center;
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: var(--accent-gradient-subtle);
    border: 1px solid var(--border-glass);
    border-radius: 100px;
    font-size: 0.8rem;
    color: var(--accent-secondary);
    margin-bottom: 16px;
    letter-spacing: 0.5px;
}

.header-badge .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.header h1 {
    font-size: 2.8rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ─── Glass Card ───────────────────────────────────────────────────── */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-md);
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.glass-card:hover {
    border-color: var(--border-glass-active);
}

/* ─── API Key Section ──────────────────────────────────────────────── */
.api-key-section {
    margin-bottom: 20px;
}

.api-key-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: rgba(252, 185, 92, 0.06);
    border: 1px solid rgba(252, 185, 92, 0.15);
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
}

.api-key-bar.connected {
    background: rgba(76, 235, 160, 0.06);
    border-color: rgba(76, 235, 160, 0.15);
}

.api-key-bar .icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.api-key-bar input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: 'Inter', monospace;
    font-size: 0.9rem;
    outline: none;
    letter-spacing: 0.5px;
}

.api-key-bar input::placeholder {
    color: var(--text-muted);
}

.api-key-bar .status-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.api-key-bar.connected .status-text {
    color: var(--success);
}

/* ─── Search Form ──────────────────────────────────────────────────── */
.search-section {
    margin-bottom: 24px;
}

.search-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 16px;
    align-items: end;
}

/* ─── Smart Crawler ─────────────────────────────────────────────────── */
.crawler-section {
    border: 1px solid rgba(124, 92, 252, 0.25);
}

.crawler-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
}

.crawler-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.crawler-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.crawler-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 16px;
}

.crawler-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.crawler-live {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--bg-glass-hover);
}

.crawler-stats {
    display: flex;
    gap: 28px;
}

.crawler-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.crawler-stat-num {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--accent-primary);
}

.crawler-stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.crawler-log {
    margin-top: 14px;
    max-height: 180px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.82rem;
}

.crawler-log-line {
    color: var(--text-muted);
    padding: 4px 8px;
    background: var(--bg-glass);
    border-radius: 6px;
}

.count-badge {
    display: inline-block;
    min-width: 20px;
    padding: 1px 7px;
    margin-right: 4px;
    border-radius: 10px;
    background: var(--accent-primary);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
}

@media (max-width: 768px) {
    .crawler-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-group label .label-icon {
    font-size: 0.9rem;
}

.form-input,
.form-select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    outline: none;
}

.form-input:focus,
.form-select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.1);
    background: rgba(255, 255, 255, 0.06);
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238888aa' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 16px center;
    padding-left: 36px;
}

.form-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Radius display */
.radius-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

.radius-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-primary);
    min-width: 50px;
    text-align: center;
}

.radius-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to left, var(--accent-primary), var(--bg-glass));
    outline: none;
    cursor: pointer;
}

.radius-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(124, 92, 252, 0.5);
    transition: transform var(--transition-fast);
}

.radius-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* ─── Buttons ──────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 40px rgba(124, 92, 252, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: var(--bg-glass);
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-glass-active);
}

.btn-success {
    background: linear-gradient(135deg, #2d8a5e, #4ceba0);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(76, 235, 160, 0.3);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-sm);
}

.btn .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ─── Stats Bar ────────────────────────────────────────────────────── */
.stats-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-glass);
}

.stats-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--bg-glass);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.stat-item .stat-number {
    font-weight: 700;
    color: var(--accent-primary);
    font-size: 1rem;
}

.stat-item .stat-label {
    color: var(--text-secondary);
}

.stats-right {
    display: flex;
    gap: 10px;
}

/* ─── Progress Bar ─────────────────────────────────────────────────── */
.progress-section {
    margin-bottom: 20px;
    display: none;
}

.progress-section.active {
    display: block;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.progress-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.progress-percentage {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-primary);
}

.progress-track {
    height: 6px;
    background: var(--bg-glass);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 3px;
    transition: width var(--transition-normal);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ─── Results Table ────────────────────────────────────────────────── */
.results-section {
    display: none;
}

.results-section.active {
    display: block;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.results-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

.results-table th {
    background: rgba(20, 20, 50, 0.95);
    padding: 14px 16px;
    text-align: right;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-glass-active);
    white-space: nowrap;
}

.results-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-glass);
    vertical-align: middle;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.results-table tbody tr {
    transition: background var(--transition-fast);
}

.results-table tbody tr:hover {
    background: var(--bg-glass-hover);
}

.results-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.015);
}

.results-table tbody tr:nth-child(even):hover {
    background: var(--bg-glass-hover);
}

/* Cell styles */
.cell-name {
    font-weight: 600;
    color: var(--text-bright);
}

.cell-link {
    color: var(--accent-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.cell-link:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

.cell-rating {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stars {
    color: var(--warning);
    font-size: 0.85rem;
}

.rating-num {
    font-weight: 600;
    color: var(--warning);
}

.rating-count {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.cell-social {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.social-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: var(--bg-glass);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.social-badge:hover {
    border-color: var(--border-glass-active);
    color: var(--text-primary);
    background: var(--bg-glass-hover);
}

.social-badge.facebook { color: #5b8def; }
.social-badge.instagram { color: #e1306c; }
.social-badge.twitter { color: #1da1f2; }
.social-badge.linkedin { color: #0077b5; }
.social-badge.youtube { color: #ff0000; }
.social-badge.tiktok { color: #69c9d0; }

.cell-email {
    color: var(--success);
    font-size: 0.82rem;
}

.cell-whatsapp {
    color: #25D366;
    font-size: 0.82rem;
    font-weight: 600;
}

.cell-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.loading {
    background: var(--warning);
    animation: pulse-dot 1s ease-in-out infinite;
}

.status-dot.done {
    background: var(--success);
}

.status-dot.error {
    background: var(--danger);
}

/* ─── Empty State ──────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ─── Load More Button ─────────────────────────────────────────────── */
.load-more-section {
    text-align: center;
    padding: 24px 0;
    display: none;
}

.load-more-section.active {
    display: block;
}

/* ─── Toast Notifications ──────────────────────────────────────────── */
.toast-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 0.9rem;
    animation: slideIn 0.3s ease-out;
    min-width: 300px;
}

.toast.success { border-color: rgba(76, 235, 160, 0.3); }
.toast.error { border-color: rgba(252, 92, 124, 0.3); }
.toast.info { border-color: rgba(92, 184, 252, 0.3); }

@keyframes slideIn {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(-100%); opacity: 0; }
}

/* ─── Keyword Input ────────────────────────────────────────────────── */
.keyword-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ─── Detail Row (expanded) ────────────────────────────────────────── */
.detail-row td {
    padding: 0 !important;
    border: none !important;
}

.detail-content {
    padding: 16px 24px;
    background: rgba(124, 92, 252, 0.03);
    border-bottom: 1px solid var(--border-glass);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
}

.detail-item {
    display: flex;
    align-items: start;
    gap: 8px;
    font-size: 0.85rem;
}

.detail-item .detail-label {
    color: var(--text-muted);
    min-width: 80px;
    flex-shrink: 0;
}

.detail-item .detail-value {
    color: var(--text-primary);
    word-break: break-all;
}

/* ─── Scrollbar ────────────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-glass);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ─── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .search-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .search-grid {
        grid-template-columns: 1fr;
    }

    .stats-bar {
        flex-direction: column;
        gap: 12px;
    }

    .stats-left {
        flex-wrap: wrap;
        justify-content: center;
    }

    .stats-right {
        width: 100%;
        justify-content: center;
    }

    .glass-card {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.6rem;
    }

    .header p {
        font-size: 0.9rem;
    }

    .btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
}

/* ─── Animations ───────────────────────────────────────────────────── */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-up {
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Row animation */
.results-table tbody tr {
    animation: rowSlide 0.3s ease-out;
}

@keyframes rowSlide {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ─── Footer ───────────────────────────────────────────────────────── */
.footer {
    text-align: center;
    padding: 32px 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ─── Navbar ─────────────────────────────────────────────────────────── */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 28px;
    margin: 16px auto;
    max-width: 1400px;
    background: var(--bg-glass);
    border: 1px solid var(--bg-glass-hover);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    position: relative;
    z-index: 10;
}
.nav-brand { font-weight: 800; font-size: 1.1rem; color: var(--accent-primary); }
.nav-links { display: flex; gap: 8px; }
.nav-link {
    color: var(--text-secondary, #aaa);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.nav-link:hover { background: var(--bg-glass-hover); }
.nav-link.active { background: var(--accent-primary); color: #fff; }
.nav-link.logout { color: #ff6b8a; }
.nav-user { display: flex; align-items: center; gap: 12px; }
.nav-username { font-size: 0.85rem; color: var(--text-muted); }

/* ─── Auth ───────────────────────────────────────────────────────────── */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 5;
}
.auth-card { width: 100%; max-width: 400px; padding: 36px 32px; }
.auth-header { text-align: center; margin-bottom: 24px; }
.auth-header h1 { margin: 0 0 6px; font-size: 1.5rem; }
.auth-header p { color: var(--text-muted); font-size: 0.9rem; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-switch { text-align: center; margin-top: 20px; font-size: 0.88rem; color: var(--text-muted); }
.auth-switch a { color: var(--accent-primary); text-decoration: none; font-weight: 600; }
.auth-alert {
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 0.85rem;
    text-align: center;
}
.auth-alert.error { background: rgba(255, 107, 138, 0.15); color: #ff6b8a; }
.auth-alert.success { background: rgba(76, 235, 160, 0.15); color: var(--success); }

/* ─── Stat cards ─────────────────────────────────────────────────────── */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}
.stat-card {
    background: var(--bg-glass);
    border: 1px solid var(--bg-glass-hover);
    border-radius: 14px;
    padding: 18px;
    text-align: center;
    backdrop-filter: blur(10px);
}
.stat-card-num { display: block; font-size: 1.9rem; font-weight: 800; color: var(--accent-primary); }
.stat-card-label { font-size: 0.8rem; color: var(--text-muted); }

/* ─── Jobs ───────────────────────────────────────────────────────────── */
.jobs-section { margin-top: 18px; }
.jobs-list { display: flex; flex-direction: column; gap: 12px; }
.jobs-empty { color: var(--text-muted); text-align: center; padding: 20px; }
.job-card {
    background: var(--bg-glass);
    border: 1px solid var(--bg-glass-hover);
    border-radius: 12px;
    padding: 14px 16px;
}
.job-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.job-title { font-weight: 700; }
.job-status { font-size: 0.75rem; padding: 3px 10px; border-radius: 10px; font-weight: 700; }
.job-status.running { background: rgba(124, 92, 252, 0.2); color: var(--accent-primary); }
.job-status.done { background: rgba(76, 235, 160, 0.2); color: var(--success); }
.job-status.stopped { background: rgba(255, 184, 76, 0.2); color: #ffb84c; }
.job-status.error { background: rgba(255, 107, 138, 0.2); color: #ff6b8a; }
.job-metrics { display: flex; flex-wrap: wrap; gap: 16px; font-size: 0.82rem; color: var(--text-muted); margin-bottom: 10px; }
.job-metrics b { color: var(--text-primary, #fff); }
.job-log { margin-top: 8px; font-size: 0.78rem; color: var(--text-muted); }
.job-log.error { color: #ff6b8a; }
.job-actions { margin-top: 10px; }
.btn-sm { padding: 5px 12px; font-size: 0.8rem; }

/* ─── Data toolbar ───────────────────────────────────────────────────── */
.data-toolbar { margin: 14px 0; }
.data-toolbar .form-input { max-width: 420px; }
