/* ========================================
   RESULTS PAGE - COMPETITIVE INTELLIGENCE
   ======================================== */

.section-results {
    padding: var(--space-md);
    background: linear-gradient(135deg, var(--content-bg) 0%, #F5F0EB 100%);
    min-height: 100vh;
}

.section-results h1 {
    border-bottom: none;
    margin-bottom: var(--space-sm);
    padding-bottom: 0;
}

/* ========================================
   RESULTS LAYOUT - Sidebar + Main
   ======================================== */

.results-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: var(--space-lg);
    min-height: calc(100vh - 120px);
}

/* Results Sidebar */
.results-sidebar {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    padding: 0;
    position: sticky;
    top: var(--space-md);
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.results-sidebar-header {
    padding: var(--space-md) var(--space-md) var(--space-sm);
    border-bottom: 1px solid rgba(184, 115, 51, 0.1);
}

.results-sidebar-header h2 {
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--copper, #B87333);
    margin: 0;
}

/* Filter Sections */
.filter-section {
    border-bottom: 1px solid rgba(184, 115, 51, 0.08);
}

.filter-section:last-child {
    border-bottom: none;
}

.filter-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: linear-gradient(135deg, #FAFAF8 0%, #F5F0EB 100%);
}

.filter-section-header h3 {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-color);
    margin: 0;
}

.filter-select-all {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.6875rem;
    color: var(--text-muted);
    cursor: pointer;
}

.filter-select-all input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--copper, #B87333);
    cursor: pointer;
}

.filter-checkbox-list {
    padding: var(--space-sm) var(--space-md);
    max-height: 200px;
    overflow-y: auto;
}

.filter-checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s ease;
}

.filter-checkbox-item:hover {
    background: rgba(184, 115, 51, 0.05);
    margin: 0 -8px;
    padding-left: 8px;
    padding-right: 8px;
}

.filter-checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--copper, #B87333);
    cursor: pointer;
    flex-shrink: 0;
}

.filter-checkbox-label {
    font-size: 0.8125rem;
    color: var(--text-color);
    line-height: 1.4;
}

.filter-empty {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: var(--space-sm) 0;
}

/* Results Main Area */
.results-main {
    min-width: 0; /* Prevent overflow */
}

/* Results Header */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.results-title {
    flex: 1;
    min-width: 280px;
}

.results-title .accent-line {
    margin: var(--space-sm) 0 var(--space-md);
}

.results-title .lead {
    margin-bottom: 0;
    max-width: none;
}

.results-actions {
    display: flex;
    gap: var(--space-sm);
    align-items: flex-start;
    padding-top: var(--space-xs);
}

/* Responsive - Stack sidebar on smaller screens */
@media (max-width: 1024px) {
    .results-layout {
        grid-template-columns: 1fr;
    }

    .results-sidebar {
        position: static;
        max-height: none;
    }

    .filter-checkbox-list {
        max-height: 150px;
    }
}

/* Filters (legacy - keeping for compatibility) */
.results-filters {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-label {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.filter-select {
    appearance: none;
    background: white;
    border: 1px solid var(--border-color, #E0D6CC);
    border-radius: 4px;
    padding: 10px 36px 10px 14px;
    font-family: var(--font-primary);
    font-size: 0.8125rem;
    color: var(--text-color);
    cursor: pointer;
    min-width: 160px;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%236B635C' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-select:hover {
    border-color: var(--copper, #B87333);
}

.filter-select:focus {
    outline: none;
    border-color: var(--copper, #B87333);
    box-shadow: 0 0 0 3px rgba(184, 115, 51, 0.1);
}

/* ========================================
   INCENTIVES TABLE
   ======================================== */

.incentives-table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.incentives-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid rgba(184, 115, 51, 0.1);
    background: linear-gradient(135deg, #FAFAF8 0%, #F5F0EB 100%);
}

.incentives-table-header h2 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    margin: 0;
    color: var(--text-color);
}

.incentives-table-actions {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: white;
    border: 1px solid var(--border-color, #E0D6CC);
    border-radius: 4px;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    border-color: var(--copper, #B87333);
    color: var(--copper, #B87333);
}

.incentives-table-wrapper {
    overflow-x: auto;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.incentives-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    white-space: nowrap;
}

.incentives-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.incentives-table th {
    background: #2C2826;
    color: white;
    font-weight: 500;
    padding: 8px 10px;
    text-align: center;
    border: 1px solid #3D3835;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.incentives-table th.col-group {
    background: #1A1817;
    border-bottom: none;
}

.incentives-table th.col-year,
.incentives-table th.col-make,
.incentives-table th.col-model {
    text-align: left;
}

.incentives-table td {
    padding: 8px 10px;
    border: 1px solid #E8E4E0;
    text-align: center;
    vertical-align: middle;
}

.incentives-table td.col-year,
.incentives-table td.col-make,
.incentives-table td.col-model {
    text-align: left;
}

/* Genesis Model Header Row */
.incentives-table tr.genesis-header {
    background: #D4C4B0;
}

.incentives-table tr.genesis-header td {
    font-weight: 600;
    color: #2C2826;
    padding: 10px;
    border-color: #C4B4A0;
}

.incentives-table tr.genesis-header td:first-child {
    text-align: left;
    padding-left: 16px;
}

/* Genesis Trim Rows (shown above competitors, no scraped data) */
.incentives-table tr.genesis-trim-row {
    background: #E8DED4;
}

.incentives-table tr.genesis-trim-row td {
    color: #5A524A;
    font-weight: 500;
}

.incentives-table tr.genesis-trim-row .col-make {
    font-weight: 600;
    color: #B87333;
}

.incentives-table tr.genesis-trim-row:hover {
    background: #E0D4C8;
}

/* Competitor Data Rows */
.incentives-table tr.competitor-row {
    background: #FAF8F6;
}

.incentives-table tr.competitor-row:nth-child(even) {
    background: #F5F2EF;
}

.incentives-table tr.competitor-row:hover {
    background: #EFE8E2;
}

/* Cell value styling */
.incentives-table .cell-currency {
    font-family: var(--font-mono, 'SF Mono', Monaco, monospace);
    text-align: right;
}

.incentives-table .cell-apr {
    font-family: var(--font-mono, 'SF Mono', Monaco, monospace);
}

.incentives-table .cell-empty {
    color: #B0A8A0;
}

/* Highlight cells */
.incentives-table .highlight-best {
    background: #C8E6C9;
    color: #2E7D32;
    font-weight: 600;
}

.incentives-table .highlight-good {
    background: #DCEDC8;
    color: #558B2F;
}

.incentives-table .highlight-warning {
    background: #FFE0B2;
    color: #E65100;
}

.incentives-table .highlight-bad {
    background: #FFCDD2;
    color: #C62828;
}

/* Comment column */
.incentives-table .col-comment {
    max-width: 150px;
    white-space: normal;
    font-size: 0.65rem;
    text-align: left;
    line-height: 1.3;
}

/* Empty state */
.incentives-table .empty-state td {
    padding: var(--space-xl);
    background: #FAFAF8;
}

.table-empty {
    text-align: center;
    color: var(--text-muted);
}

.table-empty p {
    margin: 4px 0;
}

.table-empty .text-muted {
    font-size: 0.7rem;
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 1200px) {
    .incentives-table-wrapper {
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    .incentives-table-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .incentives-table {
        font-size: 0.65rem;
    }

    .incentives-table th,
    .incentives-table td {
        padding: 6px 8px;
    }
}

/* Results Container */
.results-container {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

/* Map Container - Leaflet */
.map-container {
    position: relative;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    min-height: 450px;
    overflow: hidden;
}

#leafletMap {
    width: 100%;
    height: 450px;
    border-radius: 8px;
    z-index: 1;
}

/* Custom Leaflet Marker Styles */
.custom-marker {
    background: transparent;
    border: none;
}

.marker-pin {
    width: 20px;
    height: 20px;
    background: var(--copper, #B87333);
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
    position: relative;
}

.marker-pin::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: rgba(184, 115, 51, 0.25);
    border-radius: 50%;
    animation: pulse-ring 2s ease-out infinite;
    z-index: -1;
}

.marker-pin:hover {
    transform: scale(1.2);
    background: var(--copper-dark, #96592A);
}

.marker-pin.active {
    transform: scale(1.3);
    background: var(--copper-dark, #96592A);
}

@keyframes pulse-ring {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

/* Leaflet Popup Customization */
.leaflet-popup-content-wrapper {
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    padding: 0;
}

.leaflet-popup-content {
    margin: 0;
    min-width: 200px;
}

.leaflet-popup-tip {
    background: white;
}

.popup-content {
    padding: 16px;
}

.popup-title {
    font-family: var(--font-display, Georgia, serif);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    margin: 0 0 4px;
    color: var(--text-color, #1a1a1a);
}

.popup-subtitle {
    font-size: 0.6875rem;
    color: var(--text-muted, #6b6b6b);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin: 0 0 12px;
}

.popup-stats {
    display: flex;
    gap: 16px;
}

.popup-stat {
    text-align: center;
}

.popup-stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--copper, #B87333);
    display: block;
}

.popup-stat-label {
    font-size: 0.625rem;
    color: var(--text-muted, #6b6b6b);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.popup-btn {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 10px;
    background: var(--copper, #B87333);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-align: center;
    text-decoration: none;
}

.popup-btn:hover {
    background: var(--copper-dark, #96592A);
}

/* Hide default Leaflet attribution styling */
.leaflet-control-attribution {
    font-size: 9px;
    background: rgba(255,255,255,0.8) !important;
}

/* Custom map tiles styling overlay */
.leaflet-tile-pane {
    filter: saturate(0.3) brightness(1.1);
}

/* Insights Panel */
.insights-panel {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: var(--space-md);
    border-bottom: 1px solid rgba(184, 115, 51, 0.1);
}

.panel-title {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    margin: 0 0 4px;
    color: var(--text-color);
}

.panel-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}

.panel-content {
    flex: 1;
    padding: var(--space-md);
    overflow-y: auto;
    max-height: 400px;
}

.panel-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    text-align: center;
    color: var(--text-muted);
    gap: var(--space-md);
}

.panel-placeholder svg {
    opacity: 0.3;
}

.panel-placeholder p {
    font-size: 0.875rem;
    max-width: 200px;
    margin: 0;
}

/* Brand Cards in Panel */
.brand-card {
    background: #FAFAF8;
    border-radius: 6px;
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-sm);
    border-left: 3px solid var(--brand-color, var(--copper));
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.brand-card:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.brand-card:last-child {
    margin-bottom: 0;
}

.brand-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.brand-name {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-color);
}

.brand-badge {
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 3px;
    background: rgba(184, 115, 51, 0.1);
    color: var(--copper, #B87333);
}

.brand-badge.hot {
    background: rgba(239, 83, 80, 0.1);
    color: #EF5350;
}

.brand-badge.new {
    background: rgba(76, 175, 80, 0.1);
    color: #66BB6A;
}

.incentive-highlight {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--text-color);
    margin-bottom: 4px;
}

.incentive-details {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.incentive-model {
    font-weight: 500;
    color: var(--text-color);
}

/* Brand Colors */
.brand-card[data-brand="bmw"] { --brand-color: #0066B1; }
.brand-card[data-brand="audi"] { --brand-color: #BB0A30; }
.brand-card[data-brand="mercedes"] { --brand-color: #00ADEF; }
.brand-card[data-brand="lexus"] { --brand-color: #1A1A1A; }
.brand-card[data-brand="acura"] { --brand-color: #E31837; }

/* Charts Section */
.charts-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.chart-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    padding: var(--space-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chart-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid rgba(184, 115, 51, 0.1);
}

.chart-header h3 {
    font-family: var(--font-display, Georgia, serif);
    font-size: 0.9375rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    margin: 0;
    color: var(--text-color, #1a1a1a);
}

.chart-subtitle {
    font-size: 0.6875rem;
    color: var(--text-muted, #6b6b6b);
    letter-spacing: 0.03em;
}

/* ApexCharts Customization */
.apexcharts-tooltip {
    background: white !important;
    border: 1px solid rgba(184, 115, 51, 0.2) !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1) !important;
}

.apexcharts-tooltip-title {
    background: rgba(184, 115, 51, 0.05) !important;
    border-bottom: 1px solid rgba(184, 115, 51, 0.1) !important;
    font-weight: 500 !important;
}

.apexcharts-legend-text {
    font-family: var(--font-primary) !important;
    font-size: 11px !important;
}

/* Summary Grid */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
}

.summary-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    padding: var(--space-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.summary-content {
    display: flex;
    flex-direction: column;
}

.summary-value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-color);
    line-height: 1.2;
}

.summary-value.highlight-up {
    color: #4CAF50;
}

.summary-value.highlight-down {
    color: #EF5350;
}

.summary-label {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.sparkline {
    width: 80px;
    height: 40px;
}

/* Responsive */
@media (max-width: 1200px) {
    .results-container {
        grid-template-columns: 1fr;
    }

    .insights-panel {
        order: -1;
    }

    .panel-content {
        max-height: 300px;
    }

    .charts-section {
        grid-template-columns: 1fr;
    }

    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .section-results {
        padding: var(--space-md);
    }

    .results-header {
        flex-direction: column;
    }

    .results-filters {
        width: 100%;
    }

    .filter-group {
        flex: 1;
    }

    .filter-select {
        width: 100%;
    }

    .charts-section {
        grid-template-columns: 1fr;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .map-container {
        min-height: 300px;
    }

    #leafletMap {
        height: 300px;
    }
}

/* Detail Modal */
.detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(4px);
}

.detail-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s ease;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
}

.detail-modal.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid rgba(184, 115, 51, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-color);
}

.modal-body {
    padding: var(--space-lg);
    overflow-y: auto;
    max-height: calc(80vh - 80px);
}

.detail-section {
    margin-bottom: var(--space-lg);
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section h3 {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
}

.detail-item {
    padding: var(--space-sm);
    background: #FAFAF8;
    border-radius: 6px;
}

.detail-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.detail-value {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color);
}

.detail-value.highlight {
    color: var(--copper, #B87333);
}

/* ========================================
   SETTINGS PAGE
   ======================================== */

.settings-container {
    max-width: 600px;
    margin-top: var(--space-lg);
}

.settings-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    margin-bottom: var(--space-lg);
    overflow: hidden;
}

.settings-card-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid rgba(184, 115, 51, 0.1);
}

.settings-card-header h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    margin: 0 0 4px;
    color: var(--text-color);
}

.settings-card-header p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}

.settings-card-body {
    padding: var(--space-lg);
}

.setting-field {
    margin-bottom: var(--space-lg);
}

.setting-field:last-child {
    margin-bottom: 0;
}

.setting-field label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.setting-input-group {
    display: flex;
    gap: 8px;
}

.setting-input-group input {
    flex: 1;
    padding: 12px 16px;
    font-family: var(--font-primary);
    font-size: 0.875rem;
    border: 1px solid var(--border-color, #E0D6CC);
    border-radius: 4px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.setting-input-group input:focus {
    outline: none;
    border-color: var(--copper, #B87333);
    box-shadow: 0 0 0 3px rgba(184, 115, 51, 0.1);
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(184, 115, 51, 0.1);
    border: 1px solid var(--border-color, #E0D6CC);
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-muted);
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-icon:hover {
    background: rgba(184, 115, 51, 0.2);
    border-color: var(--copper, #B87333);
    color: var(--copper, #B87333);
}

.setting-hint {
    display: block;
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.setting-hint a {
    color: var(--copper, #B87333);
    text-decoration: none;
}

.setting-hint a:hover {
    text-decoration: underline;
}

.setting-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid rgba(184, 115, 51, 0.1);
}

.save-status {
    font-size: 0.75rem;
    transition: color 0.2s ease;
}

.save-status.success {
    color: #4CAF50;
}

.save-status.error {
    color: #EF5350;
}

/* Footer nav link (Settings) */
.footer-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8125rem;
    transition: color 0.2s ease, background-color 0.2s ease;
    border-radius: 4px;
    margin-bottom: 8px;
}

.footer-nav-link:hover {
    color: var(--copper, #B87333);
    background: rgba(184, 115, 51, 0.05);
}

.footer-nav-link.active {
    color: var(--copper, #B87333);
    background: rgba(184, 115, 51, 0.1);
}

.sidebar.collapsed .footer-nav-link .nav-text {
    display: none;
}

.sidebar.collapsed .footer-nav-link {
    justify-content: center;
    padding: 10px;
}

/* ========================================
   SCRAPER CONTROLS - STEP 2 GATHERING
   ======================================== */

.scraper-controls {
    margin-top: var(--space-lg);
    max-width: 800px;
}

.scraper-config {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
}

/* API Key Status Indicator */
.api-key-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #FAFAF8;
    border-radius: 6px;
    margin-bottom: var(--space-md);
}

.api-key-status .status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.api-key-status .status-indicator.pending {
    background: #FFA726;
}

.api-key-status .status-indicator.configured {
    background: #4CAF50;
}

.api-key-status .status-text {
    font-size: 0.8125rem;
    color: var(--text-color);
    flex: 1;
}

.api-key-status .status-link {
    font-size: 0.75rem;
    color: var(--copper, #B87333);
    text-decoration: none;
}

.api-key-status .status-link:hover {
    text-decoration: underline;
}

.config-field {
    margin-bottom: var(--space-md);
}

.config-field label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.config-field input[type="password"],
.config-field input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    font-family: var(--font-primary);
    font-size: 0.875rem;
    border: 1px solid var(--border-color, #E0D6CC);
    border-radius: 4px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.config-field input:focus {
    outline: none;
    border-color: var(--copper, #B87333);
    box-shadow: 0 0 0 3px rgba(184, 115, 51, 0.1);
}

.config-actions {
    display: flex;
    gap: var(--space-sm);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: var(--font-primary);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: var(--copper, #B87333);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--copper-dark, #96592A);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(184, 115, 51, 0.1);
    color: var(--copper, #B87333);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(184, 115, 51, 0.2);
}

/* Scraper Progress */
.scraper-progress {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.progress-status {
    font-weight: 500;
    color: var(--text-color);
}

.progress-detail {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.progress-section {
    margin-bottom: var(--space-md);
}

.progress-section:last-of-type {
    margin-bottom: var(--space-lg);
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.progress-bar-container {
    background: rgba(184, 115, 51, 0.1);
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--copper, #B87333);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-bar-secondary {
    background: var(--copper-light, #CFA06A);
}

/* Brand Status Grid */
.brand-status-grid {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.brand-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #FAFAF8;
    border-radius: 4px;
    font-size: 0.75rem;
}

.brand-status-name {
    font-weight: 500;
    color: var(--text-color);
}

.brand-status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-color, #E0D6CC);
}

.brand-status-indicator.pending {
    background: var(--border-color, #E0D6CC);
}

.brand-status-indicator.active {
    background: var(--copper, #B87333);
    animation: pulse 1.5s ease-in-out infinite;
}

.brand-status-indicator.complete {
    background: #4CAF50;
}

.brand-status-indicator.error {
    background: #EF5350;
}

/* Gathering no-analysis state */
.gathering-no-analysis {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    text-align: center;
    color: var(--text-muted);
    gap: 8px;
    width: 100%;
}

.gathering-no-analysis p {
    margin: 0;
    font-size: 0.875rem;
}

.gathering-link {
    color: var(--copper, #B87333);
    text-decoration: none;
    font-size: 0.8125rem;
}

.gathering-link:hover {
    text-decoration: underline;
}

.no-brands {
    color: var(--text-muted);
    font-size: 0.875rem;
    padding: var(--space-md);
}

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

/* Database Stats */
.db-stats {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    padding: var(--space-lg);
}

.db-stats h3 {
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    margin: 0 0 var(--space-md);
    color: var(--text-color);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid rgba(184, 115, 51, 0.1);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--copper, #B87333);
    display: block;
}

.stat-label {
    font-size: 0.625rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.last-sync {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    padding-top: var(--space-sm);
    border-top: 1px solid rgba(184, 115, 51, 0.1);
}

/* Responsive adjustments for scraper */
@media (max-width: 768px) {
    .config-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

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

    .brand-status-grid {
        flex-direction: column;
    }

    .brand-status {
        justify-content: space-between;
    }
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */

.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    min-width: 300px;
    pointer-events: auto;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.hiding {
    transform: translateX(120%);
    opacity: 0;
}

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-icon svg {
    width: 14px;
    height: 14px;
}

.toast.toast-success .toast-icon {
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
}

.toast.toast-error .toast-icon {
    background: rgba(239, 83, 80, 0.15);
    color: #EF5350;
}

.toast.toast-warning .toast-icon {
    background: rgba(255, 167, 38, 0.15);
    color: #FFA726;
}

.toast.toast-info .toast-icon {
    background: rgba(184, 115, 51, 0.15);
    color: var(--copper, #B87333);
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color, #1a1a1a);
    margin: 0 0 4px;
}

.toast-message {
    font-size: 0.8125rem;
    color: var(--text-muted, #6b6b6b);
    margin: 0;
    line-height: 1.4;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-muted, #6b6b6b);
    cursor: pointer;
    padding: 4px;
    margin: -4px -4px -4px 0;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-color, #1a1a1a);
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--copper, #B87333);
    border-radius: 0 0 8px 8px;
    transition: width linear;
}

.toast.toast-success .toast-progress {
    background: #4CAF50;
}

.toast.toast-error .toast-progress {
    background: #EF5350;
}

.toast.toast-warning .toast-progress {
    background: #FFA726;
}

@media (max-width: 768px) {
    .toast-container {
        top: auto;
        bottom: 24px;
        left: 16px;
        right: 16px;
    }

    .toast {
        min-width: 0;
        max-width: none;
    }
}

/* ========================================
   OUR TRIMS - TREE UI
   ======================================== */

.trims-container {
    max-width: 700px;
    margin-top: var(--space-lg);
}

.trims-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.trims-header h2 {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    margin: 0;
    color: var(--text-color);
}

.trims-header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn-import-excel {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 4px;
    font-family: var(--font-primary);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.btn-import-excel:hover {
    background: rgba(76, 175, 80, 0.2);
    border-color: rgba(76, 175, 80, 0.5);
    transform: translateY(-1px);
}

.btn-import-excel:active {
    transform: translateY(0);
}

.btn-add-model {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--copper, #B87333);
    color: white;
    border: none;
    border-radius: 4px;
    font-family: var(--font-primary);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.btn-add-model:hover {
    background: var(--copper-dark, #96592A);
    transform: translateY(-1px);
}

.btn-add-model:active {
    transform: translateY(0);
}

/* Empty State */
.trims-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl) var(--space-lg);
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    text-align: center;
}

.trims-empty-state svg {
    color: var(--text-muted);
    opacity: 0.4;
    margin-bottom: var(--space-md);
}

.trims-empty-state h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    margin: 0 0 8px;
    color: var(--text-color);
}

.trims-empty-state p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
    max-width: 280px;
}

/* Models List Container */
.models-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

/* Tree Model Item */
.tree-model {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.tree-model:hover {
    box-shadow: 0 6px 32px rgba(0, 0, 0, 0.1);
}

.tree-model-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #FAFAF8 0%, #F5F0EB 100%);
    border-bottom: 1px solid rgba(184, 115, 51, 0.1);
}

/* Expand/Collapse Button */
.tree-expand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.tree-expand-btn:hover {
    background: rgba(184, 115, 51, 0.1);
    color: var(--copper, #B87333);
}

.tree-expand-btn svg {
    transition: transform 0.2s ease;
    transform: rotate(0deg);
}

.tree-expand-btn[aria-expanded="false"] svg {
    transform: rotate(-90deg);
}

.tree-expand-btn.hidden,
.tree-expand-placeholder.hidden {
    display: none;
}

.tree-expand-placeholder {
    width: 24px;
    flex-shrink: 0;
}

/* Model Name */
.tree-model-name {
    flex: 1;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: var(--text-color);
    cursor: pointer;
    padding: 4px 8px;
    margin: -4px -8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.tree-model-name:hover {
    background: rgba(184, 115, 51, 0.08);
}

/* Model Count Badge */
.tree-model-count {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: rgba(184, 115, 51, 0.1);
    padding: 4px 10px;
    border-radius: 12px;
    flex-shrink: 0;
}

/* Tree Actions */
.tree-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.tree-model-header:hover .tree-actions,
.tree-trim:hover .tree-actions {
    opacity: 1;
}

.tree-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.tree-action-btn:hover {
    background: rgba(184, 115, 51, 0.1);
    color: var(--copper, #B87333);
}

.tree-action-btn.tree-action-delete:hover {
    background: rgba(239, 83, 80, 0.1);
    color: #EF5350;
}

/* Tree Input (for editing) */
.tree-input {
    font-family: var(--font-primary);
    font-size: 0.9375rem;
    padding: 6px 12px;
    border: 1px solid var(--copper, #B87333);
    border-radius: 4px;
    background: white;
    color: var(--text-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(184, 115, 51, 0.15);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tree-input:focus {
    border-color: var(--copper, #B87333);
    box-shadow: 0 0 0 3px rgba(184, 115, 51, 0.25);
}

.tree-model-input {
    flex: 1;
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 0.02em;
}

/* Trims Container */
.tree-trims {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.tree-trims.expanded {
    max-height: 2000px;
}

/* Individual Trim */
.tree-trim {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px 12px 32px;
    border-bottom: 1px solid rgba(184, 115, 51, 0.06);
    transition: background-color 0.2s ease;
}

.tree-trim:last-child {
    border-bottom: none;
}

.tree-trim:hover {
    background: rgba(184, 115, 51, 0.03);
}

/* Trim Connector Line */
.tree-trim-connector {
    width: 20px;
    height: 1px;
    background: rgba(184, 115, 51, 0.2);
    flex-shrink: 0;
    position: relative;
}

.tree-trim-connector::before {
    content: '';
    position: absolute;
    left: 0;
    top: -12px;
    width: 1px;
    height: 24px;
    background: rgba(184, 115, 51, 0.2);
}

/* Trim Text Display */
.tree-trim-text {
    flex: 1;
    display: flex;
    align-items: baseline;
    gap: 8px;
    cursor: pointer;
    padding: 4px 8px;
    margin: -4px -8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.tree-trim-text:hover {
    background: rgba(184, 115, 51, 0.08);
}

.tree-trim-year-display {
    font-family: var(--font-primary);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--copper, #B87333);
    min-width: 45px;
}

.tree-trim-name-display {
    font-family: var(--font-primary);
    font-size: 0.875rem;
    color: var(--text-color);
}

/* Trim Edit Mode */
.tree-trim-edit {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tree-trim-year {
    width: 80px;
    text-align: center;
    font-weight: 600;
}

.tree-trim-separator {
    color: var(--text-muted);
    font-weight: 500;
}

.tree-trim-name-input {
    flex: 1;
}

/* ========================================
   COMPETITORS SECTION
   ======================================== */

.competitors-container {
    max-width: 800px;
    margin-top: var(--space-lg);
}

.competitors-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.competitors-header h2 {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    margin: 0;
    color: var(--text-color);
}

.competitors-header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.competitors-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl) var(--space-lg);
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    text-align: center;
}

.competitors-empty-state svg {
    color: var(--text-muted);
    opacity: 0.4;
    margin-bottom: var(--space-md);
}

.competitors-empty-state h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    margin: 0 0 8px;
    color: var(--text-color);
}

.competitors-empty-state p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
    max-width: 300px;
}

.competitors-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

/* Readonly model name (not editable) */
.tree-model-name-readonly {
    cursor: default;
}

.tree-model-name-readonly:hover {
    background: transparent;
}

/* ========================================
   REGIONS SECTION
   ======================================== */

.regions-container {
    margin-top: var(--space-lg);
}

.regions-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: var(--space-lg);
    align-items: start;
}

/* Table Container */
.regions-table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.regions-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid rgba(184, 115, 51, 0.1);
}

.regions-table-header h2 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    margin: 0;
    color: var(--text-color);
}

.regions-header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.regions-io-btns {
    display: flex;
    gap: 4px;
}

.regions-io-btns .btn-icon {
    width: 32px;
    height: 32px;
    opacity: 0.6;
}

.regions-io-btns .btn-icon:hover {
    opacity: 1;
}

/* Empty State */
.regions-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl) var(--space-lg);
    text-align: center;
}

.regions-empty-state svg {
    color: var(--text-muted);
    opacity: 0.4;
    margin-bottom: var(--space-md);
}

.regions-empty-state h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    margin: 0 0 8px;
    color: var(--text-color);
}

.regions-empty-state p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
    max-width: 260px;
}

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

.regions-table thead th {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-align: left;
    padding: 12px var(--space-lg);
    border-bottom: 1px solid rgba(184, 115, 51, 0.1);
    background: #FAFAF8;
}

.regions-table thead th:last-child {
    text-align: right;
    width: 100px;
}

.regions-table tbody tr {
    transition: background-color 0.2s ease;
}

.regions-table tbody tr:hover {
    background: rgba(184, 115, 51, 0.03);
}

.regions-table tbody tr.editing {
    background: rgba(184, 115, 51, 0.05);
}

.regions-table tbody td {
    padding: 12px var(--space-lg);
    border-bottom: 1px solid rgba(184, 115, 51, 0.06);
    font-size: 0.875rem;
    color: var(--text-color);
}

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

.region-name-cell,
.region-zip-cell {
    cursor: pointer;
}

.region-name-cell:hover,
.region-zip-cell:hover {
    color: var(--copper, #B87333);
}

.region-name {
    font-weight: 500;
}

.region-zip {
    font-family: 'Monaco', 'Consolas', monospace;
    color: var(--copper, #B87333);
}

/* Region Input */
.region-input {
    font-family: var(--font-primary);
    font-size: 0.875rem;
    padding: 8px 12px;
    border: 1px solid var(--copper, #B87333);
    border-radius: 4px;
    background: white;
    color: var(--text-color);
    outline: none;
    width: 100%;
    box-shadow: 0 0 0 3px rgba(184, 115, 51, 0.15);
}

.region-input:focus {
    border-color: var(--copper, #B87333);
    box-shadow: 0 0 0 3px rgba(184, 115, 51, 0.25);
}

.region-zip-input {
    width: 100px;
    text-align: center;
    font-family: 'Monaco', 'Consolas', monospace;
}

/* Region Actions */
.region-actions {
    text-align: right;
    white-space: nowrap;
}

.region-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.region-action-btn:hover {
    background: rgba(184, 115, 51, 0.1);
    color: var(--copper, #B87333);
}

.region-delete-btn:hover {
    background: rgba(239, 83, 80, 0.1);
    color: #EF5350;
}

.region-save-btn:hover {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
}

.region-cancel-btn:hover {
    background: rgba(239, 83, 80, 0.1);
    color: #EF5350;
}

/* Map Container */
.regions-map-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.regions-map-container h2 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    margin: 0;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid rgba(184, 115, 51, 0.1);
    color: var(--text-color);
}

.regions-map {
    height: 350px;
    background: #f5f5f5;
}

/* Leaflet customization for regions map */
.regions-map .leaflet-tile-pane {
    filter: saturate(0.3) brightness(1.1);
}

/* Responsive */
@media (max-width: 1024px) {
    .regions-content {
        grid-template-columns: 1fr;
    }

    .regions-map-container {
        order: -1;
    }

    .regions-map {
        height: 250px;
    }
}

@media (max-width: 768px) {
    .regions-table-header {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-md);
    }

    .regions-header-actions {
        flex-direction: row;
        justify-content: space-between;
    }

    .regions-header-actions .btn-add-model {
        flex: 1;
        justify-content: center;
    }

    .regions-table thead th,
    .regions-table tbody td {
        padding: 10px var(--space-md);
    }

    .region-zip-input {
        width: 80px;
    }
}

/* Competitor Item Styles */
.competitor-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.competitor-edit {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.competitor-year {
    width: 80px;
    text-align: center;
}

.competitor-brand {
    width: 140px;
}

.competitor-trim {
    flex: 1;
    min-width: 120px;
}

.competitor-display {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.competitor-year-display {
    font-family: var(--font-primary);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--copper, #B87333);
    min-width: 45px;
}

.competitor-brand-display {
    font-family: var(--font-primary);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color);
    min-width: 100px;
}

.competitor-trim-display {
    font-family: var(--font-primary);
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Select styling for competitors */
.tree-select {
    font-family: var(--font-primary);
    font-size: 0.875rem;
    padding: 6px 12px;
    border: 1px solid var(--copper, #B87333);
    border-radius: 4px;
    background: white;
    color: var(--text-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(184, 115, 51, 0.15);
    cursor: pointer;
}

.tree-select:focus {
    border-color: var(--copper, #B87333);
    box-shadow: 0 0 0 3px rgba(184, 115, 51, 0.25);
}

/* Responsive */
@media (max-width: 768px) {
    .competitors-header {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-md);
    }

    .competitors-header-actions {
        flex-direction: column;
        width: 100%;
    }

    .competitor-edit {
        flex-wrap: wrap;
    }

    .competitor-year {
        width: 70px;
    }

    .competitor-brand {
        flex: 1;
        min-width: 120px;
    }

    .competitor-trim {
        width: 100%;
    }

    .competitor-display {
        flex-wrap: wrap;
        gap: 8px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .trims-header {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-md);
    }

    .trims-header-actions {
        flex-direction: column;
        width: 100%;
    }

    .btn-add-model,
    .btn-import-excel {
        width: 100%;
        justify-content: center;
    }

    .tree-model-header {
        padding: 14px 16px;
        flex-wrap: wrap;
    }

    .tree-actions {
        opacity: 1;
    }

    .tree-trim {
        padding-left: 24px;
    }

    .tree-trim-edit {
        flex-wrap: wrap;
    }

    .tree-trim-year {
        width: 70px;
    }
}

/* ========================================
   OEM TRIM VALIDATION
   ======================================== */

/* Validated checkmark indicator */
.oem-validated {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: rgba(76, 175, 80, 0.15);
    border-radius: 50%;
    color: #4CAF50;
    flex-shrink: 0;
    margin-left: 8px;
}

.oem-validated svg {
    width: 12px;
    height: 12px;
}

/* Sync OEM button */
.btn-sync-oem {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(184, 115, 51, 0.1);
    border: 1px solid rgba(184, 115, 51, 0.3);
    border-radius: 4px;
    font-family: var(--font-primary);
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--copper, #B87333);
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    margin-left: 8px;
    flex-shrink: 0;
}

.btn-sync-oem:hover {
    background: rgba(184, 115, 51, 0.2);
    border-color: var(--copper, #B87333);
}

.btn-sync-oem:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-sync-oem svg {
    width: 12px;
    height: 12px;
}

.btn-sync-oem.syncing svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* OEM Match Modal */
.oem-match-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(4px);
}

.oem-match-modal.active {
    opacity: 1;
    visibility: visible;
}

.oem-match-modal .modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s ease;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
}

.oem-match-modal.active .modal-content {
    transform: translateY(0) scale(1);
}

.oem-match-modal .modal-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid rgba(184, 115, 51, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.oem-match-modal .modal-header h2 {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    margin: 0;
}

.oem-match-modal .modal-body {
    padding: var(--space-lg);
    overflow-y: auto;
    max-height: calc(80vh - 140px);
}

/* Loading state */
.oem-match-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    text-align: center;
    gap: var(--space-md);
}

.oem-match-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(184, 115, 51, 0.2);
    border-top-color: var(--copper, #B87333);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.oem-match-loading p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
}

/* Match list */
.oem-match-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.oem-match-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #FAFAF8;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.oem-match-item:hover {
    background: rgba(184, 115, 51, 0.05);
    border-color: rgba(184, 115, 51, 0.2);
}

.oem-match-item.selected {
    background: rgba(184, 115, 51, 0.1);
    border-color: var(--copper, #B87333);
}

.oem-match-item input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--copper, #B87333);
    flex-shrink: 0;
}

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

.oem-match-name {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 2px;
}

.oem-match-details {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.oem-match-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    background: rgba(184, 115, 51, 0.1);
    border-radius: 12px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--copper, #B87333);
    flex-shrink: 0;
}

.oem-match-score.high {
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
}

.oem-match-score.medium {
    background: rgba(255, 167, 38, 0.15);
    color: #FFA726;
}

/* No matches message */
.oem-no-matches {
    text-align: center;
    padding: var(--space-lg);
    color: var(--text-muted);
}

.oem-no-matches svg {
    width: 48px;
    height: 48px;
    opacity: 0.4;
    margin-bottom: var(--space-sm);
}

.oem-no-matches p {
    font-size: 0.875rem;
    margin: 0;
}

/* Modal footer */
.oem-match-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid rgba(184, 115, 51, 0.1);
    background: #FAFAF8;
}

.oem-match-footer .btn {
    padding: 10px 20px;
}

/* Search input in modal */
.oem-match-search {
    margin-bottom: var(--space-md);
}

.oem-match-search-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.oem-match-search-input {
    width: 100%;
    padding: 10px 14px;
    font-family: var(--font-primary);
    font-size: 0.875rem;
    border: 1px solid var(--border-color, #E0D6CC);
    border-radius: 4px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.oem-match-search-input:focus {
    outline: none;
    border-color: var(--copper, #B87333);
    box-shadow: 0 0 0 3px rgba(184, 115, 51, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .oem-match-modal .modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .oem-match-modal .modal-body {
        max-height: calc(90vh - 140px);
    }

    .oem-match-footer {
        flex-direction: column;
    }

    .oem-match-footer .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   SCOPE PAGE - STEP 1
   ======================================== */

.scope-container {
    margin-top: var(--space-lg);
}

/* Three-column panels layout */
.scope-panels {
    display: grid;
    grid-template-columns: 240px 1fr 200px;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

/* Individual panel cards */
.scope-panel {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.scope-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid rgba(184, 115, 51, 0.1);
    background: linear-gradient(135deg, #FAFAF8 0%, #F5F0EB 100%);
}

.scope-panel-header h3 {
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    margin: 0;
    color: var(--text-color);
}

.scope-select-all {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    cursor: pointer;
}

.scope-select-all input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--copper, #B87333);
}

.scope-panel-body {
    flex: 1;
    overflow-y: auto;
    max-height: 350px;
    padding: var(--space-sm);
}

/* Filter input */
.scope-filter {
    position: relative;
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid rgba(184, 115, 51, 0.06);
}

.scope-filter-icon {
    position: absolute;
    left: calc(var(--space-md) + 10px);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.scope-filter-input {
    width: 100%;
    padding: 8px 30px 8px 32px;
    font-family: var(--font-primary);
    font-size: 0.8125rem;
    border: 1px solid var(--border-color, #E0D6CC);
    border-radius: 4px;
    background: white;
    color: var(--text-color);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.scope-filter-input:focus {
    outline: none;
    border-color: var(--copper, #B87333);
    box-shadow: 0 0 0 3px rgba(184, 115, 51, 0.1);
}

.scope-filter-input::placeholder {
    color: var(--text-muted);
}

.scope-filter-clear {
    position: absolute;
    right: calc(var(--space-md) + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.scope-filter-clear.visible {
    display: flex;
}

.scope-filter-clear:hover {
    background: rgba(184, 115, 51, 0.1);
    color: var(--copper, #B87333);
}

/* Checkbox list */
.scope-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.scope-checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.scope-checkbox-item:hover {
    background: rgba(184, 115, 51, 0.05);
}

.scope-checkbox-item.filtered {
    display: none;
}

.scope-checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--copper, #B87333);
    flex-shrink: 0;
}

.scope-checkbox-mark {
    display: none;
}

.scope-checkbox-label {
    flex: 1;
    font-size: 0.8125rem;
    color: var(--text-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.scope-region-name {
    font-weight: 500;
}

.scope-region-zip {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.75rem;
    color: var(--copper, #B87333);
}

/* Brand/Trim hierarchical tree */
.scope-brand-group {
    border-radius: 4px;
    margin-bottom: 2px;
}

.scope-brand-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.scope-brand-header:hover {
    background: rgba(184, 115, 51, 0.05);
}

.scope-brand-expand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: transform 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.scope-brand-expand:hover {
    color: var(--copper, #B87333);
}

.scope-brand-expand[aria-expanded="true"] {
    transform: rotate(0deg);
}

.scope-brand-expand[aria-expanded="false"] {
    transform: rotate(-90deg);
}

.scope-brand-checkbox {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.scope-brand-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--copper, #B87333);
}

.scope-brand-name {
    flex: 1;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-color);
}

.scope-brand-count {
    font-size: 0.6875rem;
    color: var(--text-muted);
    font-family: 'Monaco', 'Consolas', monospace;
    padding: 2px 6px;
    background: var(--bg-secondary);
    border-radius: 10px;
}

.scope-brand-trims {
    display: none;
    padding-left: 26px;
    border-left: 2px solid var(--border-color);
    margin-left: 19px;
    margin-bottom: 4px;
}

.scope-brand-trims.expanded {
    display: block;
}

.scope-trim-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.scope-trim-item:hover {
    background: rgba(184, 115, 51, 0.05);
}

.scope-trim-item input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--copper, #B87333);
    flex-shrink: 0;
}

.scope-trim-name {
    font-size: 0.75rem;
    color: var(--text-color);
}

/* Unvalidated trim warning */
.scope-trim-unvalidated {
    background: rgba(255, 167, 38, 0.08);
}

.scope-trim-warning {
    display: inline-flex;
    align-items: center;
    margin-left: auto;
    color: #FFA726;
    cursor: help;
    flex-shrink: 0;
    position: relative;
}

.scope-trim-warning svg {
    width: 14px;
    height: 14px;
}

/* Tooltip rendered via JS to escape overflow containers */
.scope-trim-warning-tooltip {
    position: fixed;
    width: 220px;
    padding: 10px 12px;
    background: #333;
    color: #fff;
    font-size: 0.7rem;
    line-height: 1.4;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.scope-trim-warning-tooltip.visible {
    opacity: 1;
}

.scope-trim-warning-tooltip::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: #333;
}

/* Brands empty state */
.scope-brands-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    text-align: center;
    color: var(--text-muted);
    gap: 8px;
}

.scope-brands-empty p {
    margin: 0;
    font-size: 0.8125rem;
}

.scope-brands-empty .scope-link {
    color: var(--copper, #B87333);
    text-decoration: none;
    font-size: 0.8125rem;
}

.scope-brands-empty .scope-link:hover {
    text-decoration: underline;
}

/* No matches message */
.scope-no-matches {
    padding: var(--space-md);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

/* Empty state */
.scope-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    text-align: center;
    color: var(--text-muted);
}

.scope-empty-state svg {
    opacity: 0.4;
    margin-bottom: var(--space-sm);
}

.scope-empty-state p {
    font-size: 0.8125rem;
    margin: 0 0 var(--space-sm);
}

.scope-empty-link {
    font-size: 0.75rem;
    color: var(--copper, #B87333);
    text-decoration: none;
}

.scope-empty-link:hover {
    text-decoration: underline;
}

/* Map panel */
.scope-map-panel {
    min-height: 400px;
}

.scope-map {
    flex: 1;
    min-height: 350px;
    background: #f5f5f5;
}

.scope-map .leaflet-tile-pane {
    filter: saturate(0.3) brightness(1.1);
}

/* Map markers */
.scope-marker {
    background: transparent;
    border: none;
}

.scope-marker-pin {
    width: 18px;
    height: 18px;
    background: #9E9E9E;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.scope-marker-pin:hover {
    transform: scale(1.2);
}

.scope-marker-pin.selected {
    background: var(--copper, #B87333);
    border-color: white;
    animation: scope-marker-pulse 0.3s ease-out;
}

@keyframes scope-marker-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Map popup */
.scope-popup {
    padding: 4px 0;
    text-align: center;
}

.scope-popup strong {
    display: block;
    font-size: 0.875rem;
    color: var(--text-color, #1a1a1a);
}

.scope-popup-zip {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.75rem;
    color: var(--copper, #B87333);
}

/* Summary panel */
.scope-summary {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.scope-summary h3 {
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    margin: 0;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid rgba(184, 115, 51, 0.1);
    color: var(--text-color);
    background: linear-gradient(135deg, #FAFAF8 0%, #F5F0EB 100%);
}

.scope-summary-content {
    padding: var(--space-lg);
}

/* Visual equation */
.scope-units {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.scope-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: #FAFAF8;
    border-radius: 8px;
    min-width: 80px;
}

.scope-unit-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 400;
    color: var(--text-color);
    line-height: 1;
}

.scope-unit-label {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 4px;
}

.scope-unit-result {
    background: rgba(184, 115, 51, 0.1);
}

.scope-unit-result .scope-unit-value {
    color: var(--copper, #B87333);
}

.scope-unit-operator {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--text-muted);
}

/* Pipeline visualization */
.scope-pipeline {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.scope-pipeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 140px;
    padding: var(--space-sm);
}

.scope-pipeline-number {
    width: 28px;
    height: 28px;
    background: var(--copper, #B87333);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.scope-pipeline-title {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 4px;
}

.scope-pipeline-detail {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.scope-pipeline-connector {
    width: 40px;
    height: 2px;
    background: rgba(184, 115, 51, 0.3);
    margin-top: 13px;
    flex-shrink: 0;
}

/* Validation messages */
.scope-validation {
    margin-bottom: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: #FAFAF8;
    border-radius: 6px;
}

.scope-validation-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 0.8125rem;
}

.scope-validation-item svg {
    flex-shrink: 0;
}

.scope-validation-success {
    color: #4CAF50;
}

.scope-validation-warning {
    color: #FFA726;
}

.scope-validation-error {
    color: #EF5350;
}

.scope-validation-link {
    color: var(--copper, #B87333);
    text-decoration: none;
    margin-left: 4px;
}

.scope-validation-link:hover {
    text-decoration: underline;
}

/* Actions bar */
.scope-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-md);
    border-top: 1px solid rgba(184, 115, 51, 0.1);
}

.scope-status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.scope-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-color, #E0D6CC);
}

.scope-status-pending .scope-status-dot {
    background: #FFA726;
}

.scope-status-ready .scope-status-dot {
    background: #4CAF50;
}

.scope-status-ready {
    color: #4CAF50;
}

/* Responsive: Tablet */
@media (max-width: 1200px) {
    .scope-panels {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .scope-map-panel {
        order: -1;
        min-height: 300px;
    }

    .scope-map {
        min-height: 250px;
    }

    .scope-regions-panel,
    .scope-brands-panel {
        max-width: none;
    }

    .scope-panel-body {
        max-height: 250px;
    }
}

/* Responsive: Tablet landscape - side by side panels below map */
@media (min-width: 769px) and (max-width: 1200px) {
    .scope-panels {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: var(--space-md);
    }

    .scope-map-panel {
        grid-column: 1 / -1;
        order: -1;
    }

    .scope-regions-panel {
        grid-column: 1;
    }

    .scope-brands-panel {
        grid-column: 2;
    }
}

/* Responsive: Mobile */
@media (max-width: 768px) {
    .scope-panels {
        grid-template-columns: 1fr;
    }

    .scope-map-panel {
        min-height: 250px;
    }

    .scope-map {
        min-height: 200px;
    }

    .scope-panel-body {
        max-height: 200px;
    }

    .scope-units {
        gap: var(--space-sm);
    }

    .scope-unit {
        min-width: 60px;
        padding: var(--space-xs) var(--space-sm);
    }

    .scope-unit-value {
        font-size: 1.5rem;
    }

    .scope-unit-operator {
        font-size: 1.25rem;
    }

    .scope-pipeline {
        flex-direction: column;
        align-items: center;
    }

    .scope-pipeline-connector {
        width: 2px;
        height: 20px;
        margin: 0;
    }

    .scope-actions {
        flex-direction: column;
        gap: var(--space-md);
    }

    .scope-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   CLEAR DATA PAGE
   ======================================== */

.clear-data-container {
    max-width: 600px;
    margin-top: var(--space-lg);
}

.clear-data-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.clear-data-card-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid rgba(184, 115, 51, 0.1);
}

.clear-data-card-header h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    margin: 0 0 4px;
    color: var(--text-color);
}

.clear-data-card-header p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}

.clear-data-card-body {
    padding: var(--space-lg);
}

.clear-data-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.clear-data-option {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: #FAFAF8;
    border: 1px solid var(--border-color, #E0D6CC);
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.clear-data-option:hover {
    border-color: var(--copper, #B87333);
    background: rgba(184, 115, 51, 0.03);
}

.clear-data-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--copper, #B87333);
    cursor: pointer;
}

.clear-data-option-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.clear-data-option-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color);
}

.clear-data-option-desc {
    font-size: 0.6875rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.clear-data-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid rgba(184, 115, 51, 0.1);
}

/* Danger button style */
.btn-danger {
    background: #EF5350;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #D32F2F;
    transform: translateY(-1px);
}

/* Responsive: Mobile */
@media (max-width: 768px) {
    .clear-data-container {
        max-width: none;
    }

    .clear-data-actions {
        flex-direction: column;
    }

    .clear-data-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Clear Data Confirmation Modal */
.clear-confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(4px);
}

.clear-confirm-modal.active {
    opacity: 1;
    visibility: visible;
}

.clear-confirm-modal .modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 480px;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s ease;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
}

.clear-confirm-modal.active .modal-content {
    transform: translateY(0) scale(1);
}

.clear-confirm-modal .modal-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid rgba(239, 83, 80, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(239, 83, 80, 0.05);
}

.clear-confirm-modal .modal-header h2 {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #D32F2F;
}

.clear-confirm-modal .modal-header h2 svg {
    color: #EF5350;
}

.clear-confirm-modal .modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text-muted);
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.clear-confirm-modal .modal-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-color);
}

.clear-confirm-modal .modal-body {
    padding: var(--space-lg);
}

.clear-confirm-warning {
    font-size: 0.875rem;
    color: var(--text-color);
    margin: 0 0 var(--space-md);
    line-height: 1.6;
}

.clear-confirm-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.clear-confirm-list li {
    font-size: 0.8125rem;
    color: var(--text-muted);
    padding: 12px 16px;
    background: #FAFAF8;
    border-radius: 6px;
    border-left: 3px solid #EF5350;
    line-height: 1.5;
}

.clear-confirm-list li strong {
    color: var(--text-color);
    font-weight: 500;
}

.clear-confirm-modal .modal-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid rgba(184, 115, 51, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    background: #FAFAF8;
}

/* Responsive: Mobile */
@media (max-width: 768px) {
    .clear-confirm-modal .modal-content {
        width: 95%;
        margin: var(--space-md);
    }

    .clear-confirm-modal .modal-footer {
        flex-direction: column;
    }

    .clear-confirm-modal .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   HISTORY PAGE
   ======================================== */

.history-container {
    max-width: 800px;
    margin-top: var(--space-lg);
}

.history-empty-state {
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.history-empty-state svg {
    color: var(--copper, #B87333);
    opacity: 0.4;
    margin-bottom: var(--space-md);
}

.history-empty-state h3 {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    margin: 0 0 8px;
    color: var(--text-color);
}

.history-empty-state p {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0 0 var(--space-lg);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.history-start-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.history-item {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.history-item:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid rgba(184, 115, 51, 0.1);
    background: linear-gradient(135deg, #FAFAF8 0%, #F5F0EB 100%);
}

.history-item-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.history-item-id {
    font-family: var(--font-mono, 'SF Mono', Monaco, monospace);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color);
    letter-spacing: 0.02em;
}

.history-item-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.history-item-status.status-completed,
.history-item-status.status-aggregated {
    background: #C8E6C9;
    color: #2E7D32;
}

.history-item-status.status-gathering,
.history-item-status.status-aggregating,
.history-item-status.status-analyzing {
    background: #FFF3E0;
    color: #E65100;
}

.history-item-status.status-pending {
    background: #E3F2FD;
    color: #1565C0;
}

.history-item-status.status-failed {
    background: #FFCDD2;
    color: #C62828;
}

.history-item-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.history-item-status.status-gathering .history-item-status-dot,
.history-item-status.status-aggregating .history-item-status-dot,
.history-item-status.status-analyzing .history-item-status-dot {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.history-item-body {
    padding: var(--space-md) var(--space-lg);
}

.history-item-summary {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-lg);
    margin-bottom: var(--space-md);
}

.history-summary-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-summary-label {
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.history-summary-value {
    font-size: 0.875rem;
    color: var(--text-color);
}

.history-item-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.history-item-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg) var(--space-md);
}

.history-btn-view {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--copper, #B87333);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    text-decoration: none;
}

.history-btn-view:visited,
.history-btn-view:link,
.history-btn-view:active {
    color: white;
}

.history-btn-view svg {
    stroke: white;
}

.history-btn-view:hover {
    background: #A06228;
    transform: translateY(-1px);
    color: white;
}

.history-btn-delete {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color, #E0D6CC);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.history-btn-delete:hover {
    border-color: #EF5350;
    color: #EF5350;
    background: rgba(239, 83, 80, 0.05);
}

/* History Delete Confirmation Modal */
.history-delete-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(4px);
}

.history-delete-modal.active {
    opacity: 1;
    visibility: visible;
}

.history-delete-modal .modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 420px;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s ease;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
}

.history-delete-modal.active .modal-content {
    transform: translateY(0) scale(1);
}

.history-delete-modal .modal-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid rgba(239, 83, 80, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(239, 83, 80, 0.05);
}

.history-delete-modal .modal-header h2 {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #D32F2F;
}

.history-delete-modal .modal-header h2 svg {
    color: #EF5350;
}

.history-delete-modal .modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text-muted);
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.history-delete-modal .modal-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-color);
}

.history-delete-modal .modal-body {
    padding: var(--space-lg);
}

.history-delete-modal .modal-body p {
    font-size: 0.875rem;
    color: var(--text-color);
    margin: 0 0 var(--space-sm);
    line-height: 1.6;
}

.history-delete-modal .modal-body .analysis-id-display {
    font-family: var(--font-mono, 'SF Mono', Monaco, monospace);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--copper, #B87333);
    padding: 10px 14px;
    background: #FAFAF8;
    border-radius: 6px;
    margin-top: var(--space-md);
}

.history-delete-modal .modal-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid rgba(184, 115, 51, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    background: #FAFAF8;
}

/* Responsive: Mobile */
@media (max-width: 768px) {
    .history-container {
        max-width: none;
    }

    .history-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }

    .history-item-summary {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .history-item-footer {
        flex-direction: column;
    }

    .history-item-footer .history-btn-view,
    .history-item-footer .history-btn-delete {
        width: 100%;
        justify-content: center;
    }

    .history-delete-modal .modal-content {
        width: 95%;
        margin: var(--space-md);
    }

    .history-delete-modal .modal-footer {
        flex-direction: column;
    }

    .history-delete-modal .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   ACQUIRING PAGE - TASK LIST STYLES
   ======================================== */

/* Empty state */
.acquiring-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl) var(--space-lg);
    text-align: center;
}

.acquiring-empty-state svg {
    color: var(--text-muted);
    opacity: 0.4;
    margin-bottom: var(--space-md);
}

.acquiring-empty-state h3 {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    margin: 0 0 8px;
    color: var(--text-color);
}

.acquiring-empty-state p {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0 0 var(--space-lg);
    max-width: 400px;
}

.acquiring-empty-actions {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    justify-content: center;
}

.acquiring-empty-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.acquiring-start-btn,
.acquiring-results-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

/* Task list container */
.acquiring-task-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: var(--space-sm) 0;
}

/* Individual task item */
.acquiring-task-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #FAFAF8;
    border-radius: 6px;
    font-size: 0.8125rem;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    border: 1px solid transparent;
}

/* Task pending state */
.acquiring-task-item.task-pending {
    color: var(--text-muted);
}

.acquiring-task-item.task-pending .task-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-color, #E0D6CC);
    flex-shrink: 0;
}

/* Task active state */
.acquiring-task-item.task-active {
    background: rgba(184, 115, 51, 0.08);
    border-color: var(--copper, #B87333);
    color: var(--text-color);
}

/* Task completed state */
.acquiring-task-item.task-completed {
    opacity: 0.6;
}

.acquiring-task-item.task-completed .task-brand,
.acquiring-task-item.task-completed .task-region {
    text-decoration: line-through;
    color: var(--text-muted);
}

.acquiring-task-item.task-completed svg {
    color: #4CAF50;
    flex-shrink: 0;
}

/* Task text */
.task-brand {
    font-weight: 500;
    color: var(--text-color);
}

.task-separator {
    color: var(--text-muted);
    margin: 0 2px;
}

.task-region {
    color: var(--text-color);
}

/* Spinner animation */
.acquiring-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(184, 115, 51, 0.2);
    border-top-color: var(--copper, #B87333);
    border-radius: 50%;
    animation: acquiring-spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes acquiring-spin {
    to {
        transform: rotate(360deg);
    }
}

/* "And X more" indicator */
.acquiring-task-more {
    padding: 8px 14px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
}

/* Summary line */
.acquiring-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: var(--space-md) 0;
    margin-top: var(--space-sm);
    border-top: 1px solid rgba(184, 115, 51, 0.1);
    font-size: 0.8125rem;
}

.summary-completed {
    color: #4CAF50;
    font-weight: 500;
}

.summary-separator {
    color: var(--text-muted);
}

.summary-remaining {
    color: var(--text-muted);
}

/* Progress actions (cancel button) */
.progress-actions {
    display: flex;
    justify-content: center;
    padding: var(--space-md) 0;
    margin-top: var(--space-sm);
    border-top: 1px solid rgba(184, 115, 51, 0.1);
}

/* Responsive: Mobile */
@media (max-width: 768px) {
    .acquiring-empty-state {
        padding: var(--space-xl) var(--space-md);
    }

    .acquiring-task-item {
        padding: 8px 12px;
        font-size: 0.75rem;
    }
}

/* ========================================
   BROWSER SIMULATION - STEP 2 ACQUIRING
   ======================================== */

/* Two-column layout for acquiring page */
.acquiring-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    margin-top: var(--space-lg);
    align-items: start;
}

/* When browser sim is hidden, progress takes full width */
.acquiring-layout:not(:has(.browser-sim-container.active)) {
    grid-template-columns: 1fr;
}

/* Fallback for browsers without :has() support */
@supports not selector(:has(*)) {
    .acquiring-layout {
        grid-template-columns: 1fr;
    }
    .acquiring-layout.has-browser-sim {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 1024px) {
    .acquiring-layout {
        grid-template-columns: 1fr;
    }
}

/* Browser Simulation Container */
.browser-sim-container {
    display: none; /* Hidden by default, shown during active gathering */
    order: 1; /* Show on left */
}

.browser-sim-container.active {
    display: block;
}

.scraper-controls {
    order: 2; /* Show on right */
}

.browser-sim {
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    position: relative;
}

/* Browser Chrome - Top Bar */
.browser-chrome {
    background: linear-gradient(180deg, #3d3d3d 0%, #2d2d2d 100%);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #1a1a1a;
}

.browser-controls {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.browser-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.browser-dot.red {
    background: #ff5f56;
    box-shadow: inset 0 -1px 2px rgba(0,0,0,0.2);
}

.browser-dot.yellow {
    background: #ffbd2e;
    box-shadow: inset 0 -1px 2px rgba(0,0,0,0.2);
}

.browser-dot.green {
    background: #27c93f;
    box-shadow: inset 0 -1px 2px rgba(0,0,0,0.2);
}

.browser-address-bar {
    flex: 1;
    background: #1a1a1a;
    border-radius: 6px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.browser-lock-icon {
    color: #27c93f;
    flex-shrink: 0;
}

.browser-url {
    color: #a0a0a0;
    font-size: 0.75rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.browser-nav-buttons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.browser-nav-buttons svg {
    color: #666;
    cursor: default;
}

/* Browser Content Area */
.browser-content {
    position: relative;
    height: 320px;
    background: #f5f5f5;
    overflow: hidden;
}

.browser-screenshot-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.browser-screenshot {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    object-fit: cover;
    object-position: top;
}

.browser-screenshot.active {
    opacity: 1;
}

.browser-screenshot.scrolling {
    animation: browser-scroll 8s ease-in-out forwards;
}

@keyframes browser-scroll {
    0% {
        transform: translateY(0);
    }
    20% {
        transform: translateY(0);
    }
    80% {
        transform: translateY(calc(-100% + 320px));
    }
    100% {
        transform: translateY(calc(-100% + 320px));
    }
}

/* Animated Cursor */
.browser-cursor {
    position: absolute;
    pointer-events: none;
    z-index: 10;
    transform: translate(-2px, -2px);
    transition: all 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    opacity: 0;
    filter: drop-shadow(1px 2px 2px rgba(0, 0, 0, 0.3));
}

.browser-cursor.visible {
    opacity: 1;
}

.browser-cursor.clicking {
    transform: translate(-2px, -2px) scale(0.85);
}

/* Click Ripple Effect */
.cursor-click-ripple {
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(184, 115, 51, 0.4);
    transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
    z-index: 9;
    opacity: 0;
}

.cursor-click-ripple.active {
    animation: cursor-ripple 0.6s ease-out forwards;
}

@keyframes cursor-ripple {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* Loading Bar */
.browser-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s;
}

.browser-loading.active {
    opacity: 1;
}

.browser-loading-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--copper, #B87333), #d4956b, var(--copper, #B87333));
    background-size: 200% 100%;
    width: 30%;
    animation: browser-loading-progress 1.5s ease-in-out infinite;
}

@keyframes browser-loading-progress {
    0% {
        transform: translateX(-100%);
        background-position: 0% 0%;
    }
    50% {
        background-position: 100% 0%;
    }
    100% {
        transform: translateX(400%);
        background-position: 0% 0%;
    }
}

/* Caption below browser */
.browser-sim-caption {
    margin-top: var(--space-sm);
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Page transition effect */
.browser-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
}

.browser-content.page-transition::after {
    animation: page-flash 0.4s ease-out forwards;
}

@keyframes page-flash {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .browser-content {
        height: 240px;
    }

    .browser-screenshot.scrolling {
        animation: browser-scroll-mobile 8s ease-in-out forwards;
    }

    @keyframes browser-scroll-mobile {
        0% {
            transform: translateY(0);
        }
        20% {
            transform: translateY(0);
        }
        80% {
            transform: translateY(calc(-100% + 240px));
        }
        100% {
            transform: translateY(calc(-100% + 240px));
        }
    }
}
