/* ============================================================================
   Mercedes DFE Portal v2 - Global Styles
   Portal layout with sidebar navigation + existing extraction styles
   ============================================================================ */

/* CSS Custom Properties */
:root {
    --sidebar-bg: #1a1a2e;
    --sidebar-text: #e0e0e0;
    --sidebar-active: #0f3460;
    --header-bg: #ffffff;
    --content-bg: #f5f6fa;
    --primary: #0f3460;
    --accent: #e94560;
    --text: #2d3436;
    --text-light: #636e72;
    --border: #dfe6e9;
    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #d63031;
    --info: #0984e3;

    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Consolas', monospace;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.12);
    --transition: all 0.2s ease;
}

/* Reset & Base */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-family);
    background: var(--content-bg);
    min-height: 100vh;
    color: var(--text);
    line-height: 1.5;
}

/* ============================================================================
   Portal Layout (CSS Grid)
   ============================================================================ */

.portal-layout {
    min-height: 100vh;
}

/* ============================================================================
   Sidebar
   ============================================================================ */

.sidebar {
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 250px;
    z-index: 200;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header i {
    font-size: 1.4rem;
    color: var(--accent);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 10px 0;
    flex: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.sidebar-link.active {
    background: var(--sidebar-active);
    color: #ffffff;
    border-left-color: var(--accent);
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 0.95rem;
}

.sidebar-link--soon {
    opacity: 0.5;
}

.sidebar-link--soon:hover {
    opacity: 0.7;
}

.sidebar-badge-soon {
    margin-left: auto;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(233, 69, 96, 0.25);
    color: var(--accent);
    padding: 2px 6px;
    border-radius: 3px;
}

/* Sidebar Toggle (mobile) */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 300;
    background: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background: var(--sidebar-active);
}

/* Sidebar Overlay (mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
}

/* ============================================================================
   Main Content Area
   ============================================================================ */

.main-content {
    margin-left: 250px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================================================
   Header Bar
   ============================================================================ */

.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 60px;
}

.header-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Date Picker */
.date-picker {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    color: var(--text);
    background: #ffffff;
    cursor: pointer;
    transition: var(--transition);
}

.date-picker:hover { border-color: var(--primary); }
.date-picker:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15, 52, 96, 0.1); }

/* Notification Bell */
.notification-bell-wrapper {
    position: relative;
}

.notification-bell {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-light);
    font-size: 1.1rem;
    transition: var(--transition);
    position: relative;
}

.notification-bell:hover {
    background: var(--content-bg);
    color: var(--text);
    border-color: var(--primary);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

.notification-badge.hidden { display: none; }

/* Notification Dropdown */
.notification-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 380px;
    max-height: 450px;
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    border: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.notification-dropdown.hidden { display: none; }

.notification-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.95rem;
}

.mark-all-read {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.mark-all-read:hover { background: rgba(15, 52, 96, 0.08); }

.notification-list {
    overflow-y: auto;
    max-height: 380px;
    flex: 1;
}

.notification-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
}

.notification-item:hover { background: var(--content-bg); }

.notification-item.unread {
    font-weight: 600;
    border-left: 3px solid var(--primary);
}

.notification-item .type-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.notification-item .type-dot.info { background: var(--info); }
.notification-item .type-dot.warning { background: var(--warning); }
.notification-item .type-dot.error { background: var(--danger); }
.notification-item .type-dot.success { background: var(--success); }

.notification-item .notif-title {
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: 2px;
}

.notification-item .notif-message {
    font-size: 0.8rem;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-item .time-ago {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 4px;
}

.notification-actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.notification-actions button {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-light);
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.notification-actions button:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.notification-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ============================================================================
   Content Area
   ============================================================================ */

.content-area {
    padding: 24px;
    flex: 1;
    max-width: 1600px;
}

/* Page Section */
.page-section {
    margin-bottom: 32px;
}

.page-section h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ============================================================================
   Buttons
   ============================================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.4;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #ffffff; }
.btn-primary:hover:not(:disabled) { background: #0b2a4a; }
.btn-secondary { background: var(--content-bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover:not(:disabled) { background: #eaeef2; }
.btn-danger { background: var(--danger); color: #ffffff; }
.btn-danger:hover:not(:disabled) { background: #c0392b; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-light); }
.btn-outline:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.btn-text { background: transparent; color: var(--text-light); padding: 4px 8px; }
.btn-text:hover { color: var(--primary); }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 10px; font-size: 0.8rem; }
.btn-warning { background: var(--warning); color: var(--text); }
.btn-warning:hover:not(:disabled) { background: #f0c040; }
.btn-success { background: var(--success); color: #ffffff; }
.btn-success:hover:not(:disabled) { background: #00a884; }

/* ============================================================================
   Form Elements
   ============================================================================ */

.form-select {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--text);
    background: #ffffff;
    cursor: pointer;
}

.form-select:focus { outline: none; border-color: var(--primary); }

/* ============================================================================
   Cards
   ============================================================================ */

.card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* ============================================================================
   Tables
   ============================================================================ */

.table-container { overflow-x: auto; }

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    background: #ffffff;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.history-table th {
    padding: 12px 16px;
    text-align: left;
    background: var(--content-bg);
    color: var(--text-light);
    font-weight: 600;
    white-space: nowrap;
    border-bottom: 2px solid var(--border);
}

.history-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.history-table tr:hover td { background: rgba(15, 52, 96, 0.02); }

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-success { background: rgba(0, 184, 148, 0.1); color: var(--success); }
.status-failed { background: rgba(214, 48, 49, 0.1); color: var(--danger); }
.status-running { background: rgba(9, 132, 227, 0.1); color: var(--info); }
.status-never { background: rgba(99, 110, 114, 0.1); color: var(--text-light); }

/* Pagination */
.pagination-controls {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 20px;
    align-items: center;
}

.pagination-btn {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #ffffff;
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.pagination-btn:hover { border-color: var(--primary); color: var(--primary); }
.pagination-btn.active { background: var(--primary); color: #ffffff; border-color: var(--primary); }
.pagination-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============================================================================
   Settings Page
   ============================================================================ */

.settings-section {
    margin-bottom: 28px;
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
}

.settings-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-section h3 i { color: var(--primary); }

.config-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.config-table th, .config-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.config-table th {
    font-weight: 600;
    color: var(--text-light);
    background: var(--content-bg);
}

.preset-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 8px;
}

/* ============================================================================
   Coming Soon Card
   ============================================================================ */

.coming-soon-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.coming-soon-card {
    text-align: center;
    max-width: 500px;
    padding: 48px 40px;
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.coming-soon-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.coming-soon-icon span {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
}

.coming-soon-card h2 {
    font-size: 1.5rem;
    color: var(--text);
    margin-bottom: 12px;
}

.coming-soon-badge {
    display: inline-block;
    padding: 4px 16px;
    background: var(--accent);
    color: #ffffff;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.coming-soon-description {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ============================================================================
   Loading & Empty States
   ============================================================================ */

.widget-loading {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    font-size: 0.9rem;
}

.widget-loading i { margin-right: 8px; }

.hidden { display: none !important; }

/* ============================================================================
   Toast Notifications
   ============================================================================ */

.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: toastSlideIn 0.3s ease;
    min-width: 300px;
    max-width: 400px;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.info { border-left: 4px solid var(--info); }

.toast-icon { font-size: 1.2rem; }
.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info .toast-icon { color: var(--info); }

.toast-content { flex: 1; }
.toast-title { font-weight: 600; font-size: 0.9rem; color: var(--text); margin-bottom: 2px; }
.toast-message { font-size: 0.8rem; color: var(--text-light); }

.toast-close {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px;
    transition: var(--transition);
}

.toast-close:hover { color: var(--text); }

@keyframes toastSlideIn { from { opacity: 0; transform: translateX(100px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastSlideOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(100px); } }
.toast.hiding { animation: toastSlideOut 0.3s ease forwards; }

/* ============================================================================
   Responsive — Mobile (< 768px)
   ============================================================================ */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    body.sidebar-open .sidebar-overlay {
        display: block;
    }

    .sidebar-toggle {
        display: flex;
    }

    .main-content {
        margin-left: 0;
    }

    .header-bar {
        padding-left: 60px;
    }

    .header-title {
        font-size: 1.1rem;
    }

    .notification-dropdown {
        width: 320px;
        right: -40px;
    }

    .content-area {
        padding: 16px;
    }
}

/* ============================================================================
   Responsive — Large Screens (1440px+)
   ============================================================================ */

@media (min-width: 1440px) {
    .content-area {
        padding: 28px 36px;
    }

    .extraction-grid {
        grid-template-columns: 320px 1fr 320px;
    }

    .downloads-summary {
        gap: 24px;
    }
}

@media (min-width: 1920px) {
    .content-area {
        padding: 32px 48px;
    }

    .extraction-grid {
        grid-template-columns: 350px 1fr 350px;
        gap: 24px;
    }

    .downloads-main {
        grid-template-columns: 1fr 450px;
        gap: 24px;
    }
}

/* ============================================================================
   Extraction Page Styles (from existing index.html)
   These are scoped to the extraction page layout
   ============================================================================ */

/* Extraction-specific light theme styles */
.extraction-login {
    max-width: 400px;
    margin: 60px auto;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text);
    box-shadow: var(--shadow-lg);
}

.extraction-login .panel-header {
    background: var(--content-bg);
    border-bottom: 1px solid var(--border);
    padding: 15px 20px;
}

.extraction-login .panel-header h2 {
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
}

.extraction-login .panel-body { padding: 20px; }
.extraction-login .form-group { margin-bottom: 20px; }
.extraction-login .form-group label { display: block; margin-bottom: 8px; color: var(--text-light); font-size: 0.9rem; }

.extraction-login .form-group input[type="text"],
.extraction-login .form-group input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #ffffff;
    color: var(--text);
    font-size: 1rem;
    transition: var(--transition);
}

.extraction-login .form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 52, 96, 0.1);
}

.extraction-login .btn-primary { background: var(--primary); color: #ffffff; }
.extraction-login .btn-primary:hover { background: #0b2a4a; }
.extraction-login .btn-secondary { background: var(--content-bg); color: var(--text); border: 1px solid var(--border); }
.extraction-login .btn-text { color: var(--text-light); }
.extraction-login .btn-text:hover { color: var(--primary); }

.extraction-login .error-message {
    margin-top: 15px;
    padding: 12px;
    background: rgba(214, 48, 49, 0.08);
    border: 1px solid var(--danger);
    border-radius: var(--radius-md);
    color: var(--danger);
    font-size: 0.9rem;
}

.extraction-login .saved-credentials {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.extraction-login .saved-credentials p { margin-bottom: 15px; color: var(--text-light); }

.extraction-login .checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--text);
    font-size: 0.9rem;
}

.extraction-login .checkbox-label input[type="checkbox"] { display: none; }

.extraction-login .checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.extraction-login .checkbox-label input:checked + .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

/* Extraction dashboard grid (dark theme) */
.extraction-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.extraction-nav .nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-light);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.extraction-nav .nav-btn:hover { color: var(--text); border-color: var(--primary); }
.extraction-nav .nav-btn.active { background: var(--primary); color: #ffffff; border-color: var(--primary); }

.extraction-nav .nav-badge {
    background: var(--accent);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.extraction-grid {
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    gap: 20px;
    min-height: calc(100vh - 200px);
}

@media (max-width: 1400px) {
    .extraction-grid { grid-template-columns: 280px 1fr; }
    .extraction-grid .history-sidebar { display: none; }
}

@media (max-width: 1000px) {
    .extraction-grid { grid-template-columns: 1fr; }
    .extraction-grid .config-sidebar { order: 1; }
    .extraction-grid .extraction-main { order: 0; }
}

.extraction-sidebar { display: flex; flex-direction: column; gap: 20px; }
.extraction-main { display: flex; flex-direction: column; gap: 20px; }

/* Extraction panels (light theme) */
.extraction-dashboard .panel {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    color: var(--text);
    box-shadow: var(--shadow);
}

.extraction-dashboard .panel-header {
    padding: 15px 20px;
    background: var(--content-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.extraction-dashboard .panel-header h3 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
}

.extraction-dashboard .panel-body { padding: 20px; }

/* Extraction-specific form elements in light theme */
.extraction-dashboard .config-step {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border);
}

.extraction-dashboard .config-step:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.extraction-dashboard .step-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.extraction-dashboard .step-number {
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.extraction-dashboard .step-title { flex: 1; font-weight: 500; color: var(--text); }

.extraction-dashboard .step-count {
    font-size: 0.8rem;
    color: var(--text-light);
    background: rgba(15, 52, 96, 0.08);
    padding: 3px 10px;
    border-radius: var(--radius-sm);
}

.extraction-dashboard .select-actions { display: flex; gap: 10px; margin-bottom: 10px; }

.extraction-dashboard .checkbox-list {
    max-height: 150px;
    overflow-y: auto;
    padding-right: 5px;
}

.extraction-dashboard .placeholder {
    color: var(--text-light);
    font-size: 0.85rem;
    padding: 10px;
    text-align: center;
}

.extraction-dashboard .loading {
    color: var(--text-light);
    font-size: 0.85rem;
    padding: 10px;
    text-align: center;
}

.extraction-dashboard .checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text);
    transition: var(--transition);
}

.extraction-dashboard .checkbox-label:hover { background: rgba(15, 52, 96, 0.04); }
.extraction-dashboard .checkbox-label input[type="checkbox"] { display: none; }

.extraction-dashboard .checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
}

.extraction-dashboard .checkbox-label input:checked + .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.extraction-dashboard .checkbox-label input:checked + .checkmark::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.7rem;
    color: #ffffff;
}

/* Group/National Type category headers */
.extraction-dashboard .group-category { margin-bottom: 4px; }
.extraction-dashboard .group-category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-size: 0.85rem;
    color: var(--text);
}
.extraction-dashboard .group-category-header:hover { background: rgba(15, 52, 96, 0.04); }
.extraction-dashboard .group-category-header .expand-icon { width: 16px; color: var(--text-light); font-size: 0.7rem; }
.extraction-dashboard .group-category-header .type-name { flex: 1; font-weight: 500; }
.extraction-dashboard .group-category-header .type-count { font-size: 0.75rem; color: var(--text-light); background: rgba(15, 52, 96, 0.06); padding: 2px 8px; border-radius: 10px; }
.extraction-dashboard .group-category-header .select-type-checkbox { margin-left: 4px; }
.extraction-dashboard .group-category-header .checkmark-small {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-radius: 3px;
    display: inline-block;
    vertical-align: middle;
    cursor: pointer;
}
.extraction-dashboard .group-category-items { padding-left: 24px; }

/* National types selector (legacy) */
.extraction-dashboard .national-types-selector { margin-top: 10px; }
.extraction-dashboard .national-types-list { max-height: 200px; overflow-y: auto; }

/* ---- Vehicle Data Tree Selector ---- */
.extraction-dashboard .vehicle-tree-selector {
    margin-top: 10px;
}

.extraction-dashboard .vehicle-tree-actions {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.extraction-dashboard .vehicle-tree-actions .btn {
    font-size: 0.75rem;
    padding: 4px 10px;
}

.extraction-dashboard .vehicle-tree-list {
    max-height: 350px;
    overflow-y: auto;
    padding-right: 4px;
}

/* Vehicle Type level (top) */
.extraction-dashboard .vt-type {
    margin-bottom: 2px;
}

.extraction-dashboard .vt-type-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-size: 0.85rem;
    color: var(--text);
}

.extraction-dashboard .vt-type-header:hover {
    background: rgba(15, 52, 96, 0.04);
}

.extraction-dashboard .vt-type-header .expand-icon {
    width: 16px;
    color: var(--text-light);
    font-size: 0.7rem;
    flex-shrink: 0;
}

.extraction-dashboard .vt-type-header .type-name {
    flex: 1;
    font-weight: 500;
}

.extraction-dashboard .vt-type-header .type-count {
    font-size: 0.75rem;
    color: var(--text-light);
    background: rgba(15, 52, 96, 0.06);
    padding: 2px 8px;
    border-radius: 10px;
}

.extraction-dashboard .vt-type-header .select-type-checkbox {
    margin-left: 4px;
}

.extraction-dashboard .vt-type-groups {
    padding-left: 16px;
}

/* Group level (mid) */
.extraction-dashboard .vt-group {
    margin-bottom: 1px;
}

.extraction-dashboard .vt-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-size: 0.85rem;
    color: var(--text);
}

.extraction-dashboard .vt-group-header:hover {
    background: rgba(15, 52, 96, 0.04);
}

.extraction-dashboard .vt-group-header .expand-icon {
    width: 14px;
    color: var(--text-light);
    font-size: 0.65rem;
    flex-shrink: 0;
}

.extraction-dashboard .vt-group-header .group-name {
    flex: 1;
    font-weight: 400;
}

.extraction-dashboard .vt-group-header .nt-count {
    font-size: 0.7rem;
    color: var(--text-light);
}

/* National Types level (leaf) */
.extraction-dashboard .vt-nt-list {
    padding-left: 30px;
    border-left: 2px solid var(--border);
    margin-left: 17px;
    margin-bottom: 4px;
}

.extraction-dashboard .vt-nt-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    font-size: 0.8rem;
    color: var(--text);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.extraction-dashboard .vt-nt-item:hover {
    background: rgba(15, 52, 96, 0.04);
}

.extraction-dashboard .vt-nt-item.all-toggle {
    font-weight: 500;
    color: var(--primary);
}

.extraction-dashboard .vt-nt-item input[type="checkbox"] { display: none; }

.extraction-dashboard .vt-nt-item .checkmark {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
}

.extraction-dashboard .vt-nt-item input:checked + .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.extraction-dashboard .vt-nt-item input:checked + .checkmark::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.55rem;
    color: #ffffff;
}

/* Radio options */
.extraction-dashboard .download-options { display: flex; flex-direction: column; gap: 10px; }

.extraction-dashboard .radio-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: var(--content-bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.extraction-dashboard .radio-option:hover { background: #eaeef2; border-color: rgba(15, 52, 96, 0.3); }
.extraction-dashboard .radio-option input { display: none; }

.extraction-dashboard .radio-mark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
    transition: var(--transition);
}

.extraction-dashboard .radio-option input:checked + .radio-mark { border-color: var(--primary); }
.extraction-dashboard .radio-option input:checked + .radio-mark::after { content: ''; width: 10px; height: 10px; background: var(--primary); border-radius: 50%; }
.extraction-dashboard .radio-content { display: flex; flex-direction: column; gap: 2px; }
.extraction-dashboard .radio-title { font-size: 0.9rem; font-weight: 500; color: var(--text); }
.extraction-dashboard .radio-desc { font-size: 0.75rem; color: var(--text-light); }

/* Extraction control buttons */
.extraction-dashboard .control-buttons { margin-top: 20px; }
.extraction-dashboard .btn-primary { background: var(--primary); color: #ffffff; }
.extraction-dashboard .btn-primary:hover:not(:disabled) { background: #0b2a4a; }
.extraction-dashboard .btn-danger { background: var(--danger); color: #ffffff; }
.extraction-dashboard .btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-light); }
.extraction-dashboard .btn-outline:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.extraction-dashboard .btn-sm { padding: 6px 12px; font-size: 0.8rem; }

/* Progress panel */
.extraction-dashboard .progress-panel .panel-body { padding: 25px; }
.extraction-dashboard .progress-overall { margin-bottom: 25px; }
.extraction-dashboard .progress-label { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 0.9rem; color: var(--text); }
.extraction-dashboard .progress-bar { height: 12px; background: var(--content-bg); border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.extraction-dashboard .progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--info)); border-radius: 6px; transition: width 0.3s ease; }

.extraction-dashboard .header-right { display: flex; align-items: center; gap: 10px; }

.extraction-dashboard .current-step { margin-bottom: 25px; padding: 15px; background: var(--content-bg); border-radius: var(--radius-md); }
.extraction-dashboard .step-indicator { display: flex; align-items: center; justify-content: center; gap: 0; margin-bottom: 10px; }
.extraction-dashboard .step-dot { width: 12px; height: 12px; background: var(--border); border-radius: 50%; transition: var(--transition); }
.extraction-dashboard .step-dot.active { background: var(--primary); box-shadow: 0 0 10px rgba(15, 52, 96, 0.4); }
.extraction-dashboard .step-dot.completed { background: var(--success); }
.extraction-dashboard .step-line { width: 60px; height: 2px; background: var(--border); }
.extraction-dashboard .step-labels { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--text-light); }

.extraction-dashboard .stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-bottom: 20px; }
.extraction-dashboard .stat-item { background: var(--content-bg); padding: 15px; border-radius: var(--radius-md); text-align: center; }
.extraction-dashboard .stat-item.stat-wide { grid-column: span 3; }
.extraction-dashboard .stat-item.highlight { background: rgba(15, 52, 96, 0.06); border: 1px solid rgba(15, 52, 96, 0.15); }
.extraction-dashboard .stat-value { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.extraction-dashboard .stat-label { font-size: 0.75rem; color: var(--text-light); margin-top: 5px; }

.extraction-dashboard .current-operation { background: var(--content-bg); padding: 12px 15px; border-radius: var(--radius-md); font-size: 0.85rem; display: flex; gap: 10px; }
.extraction-dashboard .operation-label { color: var(--text-light); }
.extraction-dashboard .operation-value { color: var(--primary); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* SSE Status */
.extraction-dashboard .sse-status { display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; padding: 4px 10px; border-radius: var(--radius-sm); }
.extraction-dashboard .sse-status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; }
.extraction-dashboard .sse-status.connecting { background: rgba(253, 203, 110, 0.15); color: #e5a100; }
.extraction-dashboard .sse-status.connecting::before { background: var(--warning); animation: pulse 1s infinite; }
.extraction-dashboard .sse-status.connected { background: rgba(0, 184, 148, 0.1); color: var(--success); }
.extraction-dashboard .sse-status.connected::before { background: var(--success); }
.extraction-dashboard .sse-status.disconnected { background: rgba(214, 48, 49, 0.1); color: var(--danger); }
.extraction-dashboard .sse-status.disconnected::before { background: var(--danger); }

/* Badges */
.badge { display: inline-block; padding: 4px 10px; border-radius: var(--radius-sm); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; }
.badge-idle { background: rgba(99, 110, 114, 0.1); color: var(--text-light); }
.badge-running { background: rgba(9, 132, 227, 0.15); color: var(--info); animation: pulse 2s infinite; }
.badge-completed { background: rgba(0, 184, 148, 0.15); color: var(--success); }
.badge-failed { background: rgba(214, 48, 49, 0.15); color: var(--danger); }
.badge-stopped { background: rgba(253, 203, 110, 0.15); color: #e5a100; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

/* Logs panel */
.extraction-dashboard .logs-panel { flex: 1; display: flex; flex-direction: column; min-height: 300px; }
.extraction-dashboard .logs-panel .panel-body { flex: 1; display: flex; flex-direction: column; padding: 0; }
.extraction-dashboard .log-controls { display: flex; align-items: center; gap: 15px; }
.extraction-dashboard .select-sm { padding: 5px 10px; background: #ffffff; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: 0.8rem; }
.extraction-dashboard .log-container { flex: 1; overflow-y: auto; padding: 15px; font-family: var(--font-mono); font-size: 0.8rem; background: #2d3436; max-height: 400px; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.extraction-dashboard .log-entry { padding: 4px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.extraction-dashboard .log-entry.log-info { color: #b2bec3; }
.extraction-dashboard .log-entry.log-warning { color: #fdcb6e; }
.extraction-dashboard .log-entry.log-error { color: #ff7675; }

/* History & Files sidebar */
.extraction-dashboard .history-list, .extraction-dashboard .files-list { max-height: 250px; overflow-y: auto; }

.extraction-dashboard .history-item, .extraction-dashboard .file-item {
    padding: 12px;
    background: var(--content-bg);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    transition: var(--transition);
}

.extraction-dashboard .history-item:hover, .extraction-dashboard .file-item:hover { background: #eaeef2; }
.extraction-dashboard .history-item .item-header, .extraction-dashboard .file-item .item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.extraction-dashboard .history-item .item-date, .extraction-dashboard .file-item .item-name { font-size: 0.85rem; font-weight: 500; color: var(--text); }
.extraction-dashboard .history-item .item-stats { display: flex; gap: 15px; font-size: 0.75rem; color: var(--text-light); }
.extraction-dashboard .file-item .item-size { font-size: 0.75rem; color: var(--text-light); }
.extraction-dashboard .file-item .item-actions { display: flex; gap: 5px; }
.extraction-dashboard .file-item .item-actions .btn { padding: 4px 8px; font-size: 0.7rem; }

.extraction-dashboard .api-link { text-align: center; }
.extraction-dashboard .help-text { font-size: 0.75rem; color: var(--text-light); margin-top: 10px; }
.extraction-dashboard .btn-secondary { background: var(--content-bg); color: var(--text); border: 1px solid var(--border); }
.extraction-dashboard .btn-secondary:hover { background: #eaeef2; }

/* Pending downloads */
.extraction-dashboard .pending-downloads-section { margin-top: 20px; background: var(--content-bg); border-radius: var(--radius-md); padding: 15px; border: 1px solid var(--border); }
.extraction-dashboard .pending-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.extraction-dashboard .pending-header h4 { font-size: 0.9rem; color: var(--primary); display: flex; align-items: center; gap: 8px; }
.extraction-dashboard .pending-list { max-height: 200px; overflow-y: auto; }
.extraction-dashboard .pending-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; background: #ffffff; border-radius: var(--radius-sm); margin-bottom: 8px; border: 1px solid var(--border); }
.extraction-dashboard .pending-item-info { flex: 1; min-width: 0; }
.extraction-dashboard .pending-item-name { font-size: 0.85rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.extraction-dashboard .pending-item-count { font-size: 0.75rem; color: var(--text-light); }
.extraction-dashboard .pending-item-actions { display: flex; gap: 8px; }

/* Downloads view (within extraction page) */
.downloads-view { display: flex; flex-direction: column; gap: 20px; }
.downloads-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 1200px) { .downloads-summary { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .downloads-summary { grid-template-columns: 1fr; } }

.summary-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.summary-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.summary-icon { width: 50px; height: 50px; background: rgba(15, 52, 96, 0.08); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; }
.summary-icon i { font-size: 1.5rem; color: var(--primary); }
.summary-info { flex: 1; }
.summary-value { font-size: 1.5rem; font-weight: 700; color: var(--text); }
.summary-label { font-size: 0.8rem; color: var(--text-light); margin-top: 2px; }

.downloads-main { display: grid; grid-template-columns: 1fr 400px; gap: 20px; }
@media (max-width: 1200px) { .downloads-main { grid-template-columns: 1fr; } }

/* Search box */
.search-box { position: relative; display: flex; align-items: center; }
.search-box i { position: absolute; left: 12px; color: var(--text-light); font-size: 0.85rem; }
.search-box input { padding: 8px 12px 8px 35px; background: #ffffff; border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text); font-size: 0.85rem; width: 200px; transition: var(--transition); }
.search-box input:focus { outline: none; border-color: var(--primary); }
.search-box input::placeholder { color: var(--text-light); }

.panel-header-actions { display: flex; align-items: center; gap: 10px; }

/* Batch actions */
.batch-actions { display: flex; align-items: center; gap: 10px; padding: 12px 20px; background: rgba(15, 52, 96, 0.05); border-bottom: 1px solid var(--border); }
.selected-count { font-size: 0.85rem; color: var(--text-light); margin-right: 10px; }
.selected-count span { color: var(--primary); font-weight: 600; }

/* Files grid */
.files-grid { padding: 20px; display: grid; gap: 10px; max-height: 500px; overflow-y: auto; }

.file-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #ffffff;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.file-card:hover { background: var(--content-bg); border-color: var(--border); }
.file-card.selected { background: rgba(15, 52, 96, 0.05); border-color: var(--primary); }
.file-card.active { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(15, 52, 96, 0.1); }

.file-checkbox { flex-shrink: 0; }
.file-checkbox input { display: none; }
.file-checkbox .checkmark { width: 20px; height: 20px; }

.file-icon { width: 40px; height: 40px; background: rgba(15, 52, 96, 0.08); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.file-icon i { font-size: 1.2rem; color: var(--primary); }

.file-info { flex: 1; min-width: 0; }
.file-name { font-size: 0.9rem; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { display: flex; gap: 15px; margin-top: 4px; font-size: 0.75rem; color: var(--text-light); }
.file-meta span { display: flex; align-items: center; gap: 5px; }
.file-meta i { font-size: 0.7rem; }

.file-actions { display: flex; gap: 8px; opacity: 0; transition: var(--transition); }
.file-card:hover .file-actions { opacity: 1; }

/* Preview panel */
.preview-panel { position: sticky; top: 80px; max-height: calc(100vh - 100px); display: flex; flex-direction: column; }
.preview-panel .panel-body { flex: 1; overflow: hidden; padding: 0; }
.preview-actions { display: flex; gap: 8px; }

.file-preview-container { height: 100%; overflow-y: auto; padding: 20px; }

.preview-placeholder-large { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 15px; height: 300px; color: var(--text-light); text-align: center; }
.preview-placeholder-large i { font-size: 4rem; opacity: 0.2; }
.preview-placeholder-large span { font-size: 1rem; font-weight: 500; }
.preview-placeholder-large p { font-size: 0.85rem; }

.file-preview-info { margin-bottom: 20px; padding: 15px; background: var(--content-bg); border-radius: var(--radius-md); }
.file-preview-name { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: 8px; word-break: break-all; }
.file-preview-meta { display: flex; flex-wrap: wrap; gap: 15px; font-size: 0.8rem; color: var(--text-light); }
.file-preview-meta span { display: flex; align-items: center; gap: 5px; }

.file-preview-content { background: #2d3436; border-radius: var(--radius-md); padding: 15px; font-family: var(--font-mono); font-size: 0.75rem; color: #dfe6e9; white-space: pre-wrap; word-break: break-all; max-height: 400px; overflow-y: auto; }

.json-key { color: #9cdcfe; }
.json-string { color: #ce9178; }
.json-number { color: #b5cea8; }
.json-boolean { color: #569cd6; }
.json-null { color: #569cd6; }

/* History panel full */
.history-panel-full { margin-top: 0; }
.history-table-container { overflow-x: auto; }
.history-actions { display: flex; gap: 5px; }
.history-actions .btn { padding: 4px 8px; font-size: 0.7rem; }

/* Empty state */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; color: var(--text-light); text-align: center; }
.empty-state i { font-size: 4rem; margin-bottom: 20px; opacity: 0.2; }
.empty-state h4 { font-size: 1.1rem; color: var(--text); margin-bottom: 8px; }
.empty-state p { font-size: 0.85rem; }

/* ============================================================================
   Data Tables
   ============================================================================ */

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table thead th {
    background: var(--content-bg);
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    color: var(--text);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.data-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.data-table tbody tr:hover {
    background: rgba(15, 52, 96, 0.03);
}

.table-container {
    overflow-x: auto;
}

/* ============================================================================
   Settings List
   ============================================================================ */

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--content-bg);
    border-radius: var(--radius-md);
}

.settings-item-info { flex: 1; min-width: 0; }

.settings-item-name {
    font-weight: 500;
    color: var(--text);
    font-size: 0.9rem;
}

.settings-item-detail {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 2px;
}

/* ============================================================================
   Scrollbar
   ============================================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.25); }

/* ============================================================================
   Accessibility
   ============================================================================ */

/* Skip navigation link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 9999;
    padding: 8px 16px;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-decoration: none;
    transition: top 0.2s ease;
}
.skip-link:focus {
    top: 8px;
}

/* Focus-visible outlines (keyboard users only) */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
/* Remove default outlines for mouse users */
:focus:not(:focus-visible) {
    outline: none;
}

/* Loading spinners — accessibility */
.widget-loading,
.explorer-loading,
.day-cards-loading {
    /* Elements using these classes should convey loading state */
}
[aria-busy="true"] { cursor: wait; }

/* ============================================================================
   Reduced Motion (E8)
   ============================================================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .fa-spin { animation: none !important; }
}

/* ============================================================================
   Print Styles (E9)
   ============================================================================ */
@media print {
    /* Hide non-content elements */
    .sidebar,
    .sidebar-toggle,
    .sidebar-overlay,
    .header-bar,
    .toast-container,
    .notification-dropdown,
    .skip-link,
    .refresh-btn,
    .explorer-search-btn,
    .explorer-csv-btn,
    .search-box,
    .date-range-picker,
    .wholesale-actions-right,
    .pagination-controls,
    .btn,
    .load-btn { display: none !important; }

    /* Expand main content to full width */
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    .content-area {
        padding: 0 !important;
    }

    /* Optimize tables for print */
    .data-table, .vehicles-table {
        font-size: 11px;
        width: 100%;
    }
    .data-table th, .data-table td,
    .vehicles-table th, .vehicles-table td {
        padding: 4px 6px;
        border: 1px solid #ccc;
    }

    /* Ensure backgrounds print */
    .metric-card, .wholesale-table-card, .wholesale-history-card,
    .explorer-panel, .page-section {
        box-shadow: none !important;
        border: 1px solid #ccc;
        break-inside: avoid;
    }

    body { background: #fff; color: #000; }
}
