/* =====================================================
   MOTORS365 - Garage Module Styles
   Beautiful, modern garage management UI
   ===================================================== */

/* =====================================================
   GARAGE NAV SECTION
   ===================================================== */

.garage-nav .nav-item .nav-icon {
    color: #10b981;
}

.garage-nav .nav-item.active .nav-icon {
    color: var(--primary);
}

.nav-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-section-title::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
}

/* =====================================================
   CUSTOMER DETAIL
   ===================================================== */

.customer-detail-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.customer-profile-card {
    position: sticky;
    top: 1rem;
}

.customer-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.customer-profile-name {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.customer-profile-lifecycle {
    text-align: center;
    margin-bottom: 1.25rem;
}

.customer-meta-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
}

.customer-meta-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.customer-meta-item svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.customer-meta-item span {
    color: var(--text-secondary);
}

.customer-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
}

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

.customer-stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.customer-stat-label {
    display: block;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-top: 0.125rem;
}

.customer-consent-badges {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.consent-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 500;
}

.consent-badge.granted {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.consent-badge.denied {
    background: rgba(100, 116, 139, 0.15);
    color: #64748b;
}

.customer-actions-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

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

/* Tab Navigation */
.tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.tab-btn {
    padding: 0.75rem 1.25rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

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

/* =====================================================
   VEHICLE DETAIL
   ===================================================== */

.vehicle-hero {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
}

.vehicle-reg-plate {
    background: #FFD700;
    color: #000;
    font-family: 'Inter', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    letter-spacing: 2px;
    border: 2px solid #333;
    text-transform: uppercase;
    flex-shrink: 0;
}

.vehicle-hero-info h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.vehicle-hero-meta {
    display: flex;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    flex-wrap: wrap;
}

.vehicle-hero-meta span {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

/* Component Health Grid */
.component-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}

.component-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: border-color 0.2s;
}

.component-card:hover {
    border-color: var(--border-light);
}

.component-condition {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.component-condition.G { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.component-condition.A { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.component-condition.N { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.component-condition.F { background: rgba(220, 38, 38, 0.2); color: #dc2626; }
.component-condition.R { background: rgba(34, 197, 94, 0.25); color: #16a34a; }

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

.component-name {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.125rem;
}

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

.component-prediction {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* MOT Timeline */
.mot-timeline {
    position: relative;
    padding-left: 2rem;
}

.mot-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.mot-timeline-item {
    position: relative;
    padding: 0.75rem 0 1.5rem;
}

.mot-timeline-dot {
    position: absolute;
    left: -2rem;
    top: 1rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid;
    background: var(--bg-primary);
    z-index: 1;
}

.mot-timeline-dot.pass { border-color: #22c55e; }
.mot-timeline-dot.fail { border-color: #ef4444; }

.mot-timeline-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.mot-timeline-date {
    font-weight: 600;
    font-size: 0.875rem;
}

.mot-timeline-result {
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
}

.mot-timeline-result.pass {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.mot-timeline-result.fail {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.mot-timeline-mileage {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-left: auto;
}

.mot-timeline-items {
    margin-top: 0.5rem;
}

.mot-timeline-items li {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    padding: 0.25rem 0;
    padding-left: 0.75rem;
    position: relative;
}

.mot-timeline-items li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6rem;
    width: 4px;
    height: 4px;
    border-radius: 50%;
}

.mot-advisory-item::before { background: #f59e0b; }
.mot-failure-item::before { background: #ef4444; }

/* =====================================================
   JOB CARD DETAIL
   ===================================================== */

.job-detail-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
    align-items: start;
}

.job-status-flow {
    display: flex;
    gap: 0;
    overflow-x: auto;
    padding: 0.5rem 0;
    margin-bottom: 1.5rem;
}

.job-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    background: var(--bg-primary);
    border: 1px solid var(--border);
}

.job-step.current {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--primary);
    color: var(--primary);
}

.job-step.done {
    background: rgba(34, 197, 94, 0.1);
    border-color: transparent;
    color: #22c55e;
}

.job-step-arrow {
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 0 0.25rem;
}

.job-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.job-item-row {
    display: grid;
    grid-template-columns: 1fr 80px 100px 80px;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    font-size: 0.875rem;
}

.job-item-desc {
    font-weight: 500;
}

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

.job-item-cost {
    font-weight: 600;
    text-align: right;
}

.job-summary-card .summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

.job-summary-card .summary-row:last-child {
    border-bottom: none;
}

.job-summary-card .summary-row.total {
    font-weight: 700;
    font-size: 1rem;
    padding-top: 0.75rem;
    border-top: 2px solid var(--border);
}

/* =====================================================
   VHC (Vehicle Health Check)
   ===================================================== */

.vhc-traffic-light-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.vhc-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    border-left: 4px solid;
}

.vhc-item.red { border-left-color: #ef4444; }
.vhc-item.amber { border-left-color: #f59e0b; }
.vhc-item.green { border-left-color: #22c55e; }

.vhc-light {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.875rem;
}

.vhc-light.red { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.vhc-light.amber { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.vhc-light.green { background: rgba(34, 197, 94, 0.2); color: #22c55e; }

.vhc-item-content {
    flex: 1;
}

.vhc-item-desc {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.vhc-item-action {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.vhc-item-cost {
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
}

.vhc-summary-bar {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.vhc-summary-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
}

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

.vhc-summary-dot.red { background: #ef4444; }
.vhc-summary-dot.amber { background: #f59e0b; }
.vhc-summary-dot.green { background: #22c55e; }

/* =====================================================
   CAMPAIGNS
   ===================================================== */

.campaign-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 0.75rem;
    transition: border-color 0.2s;
}

.campaign-card:hover {
    border-color: var(--border-light);
}

.campaign-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.campaign-name {
    font-weight: 600;
    font-size: 1rem;
}

.campaign-type {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.campaign-metrics {
    display: flex;
    gap: 1.5rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--border);
}

.campaign-metric {
    display: flex;
    flex-direction: column;
}

.campaign-metric-value {
    font-weight: 600;
    font-size: 1rem;
}

.campaign-metric-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* =====================================================
   ANALYTICS DASHBOARD
   ===================================================== */

.analytics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.analytics-grid .card canvas {
    max-height: 280px;
}

.kpi-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.kpi-card.blue::before { background: linear-gradient(90deg, #3b82f6, #6366f1); }
.kpi-card.green::before { background: linear-gradient(90deg, #22c55e, #10b981); }
.kpi-card.yellow::before { background: linear-gradient(90deg, #f59e0b, #eab308); }
.kpi-card.purple::before { background: linear-gradient(90deg, #8b5cf6, #a855f7); }
.kpi-card.red::before { background: linear-gradient(90deg, #ef4444, #f97316); }

.kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.kpi-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.kpi-change {
    font-size: 0.6875rem;
    font-weight: 600;
    margin-top: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
}

.kpi-change.up {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.kpi-change.down {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* =====================================================
   SETTINGS & ONBOARDING
   ===================================================== */

.onboarding-wizard {
    max-width: 700px;
    margin: 0 auto;
}

.wizard-steps {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
}

.wizard-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wizard-step-num {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    border: 2px solid var(--border);
    color: var(--text-muted);
    background: var(--bg-primary);
}

.wizard-step.active .wizard-step-num {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.wizard-step.done .wizard-step-num {
    border-color: #22c55e;
    background: #22c55e;
    color: white;
}

.wizard-step-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.wizard-step.active .wizard-step-label {
    color: var(--text-primary);
    font-weight: 500;
}

.wizard-connector {
    width: 40px;
    height: 2px;
    background: var(--border);
    margin: 0 0.5rem;
    align-self: center;
}

.wizard-connector.done {
    background: #22c55e;
}

.settings-section {
    margin-bottom: 2rem;
}

.settings-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--border);
}

.setting-row:last-child {
    border-bottom: none;
}

.setting-label {
    font-size: 0.875rem;
    font-weight: 500;
}

.setting-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.125rem;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--border);
    border-radius: 24px;
    transition: 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* =====================================================
   TIMELINE
   ===================================================== */

.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-bottom: 1.25rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -2rem;
    top: 0.25rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border);
    z-index: 1;
}

.timeline-dot.blue { border-color: #3b82f6; background: rgba(59, 130, 246, 0.2); }
.timeline-dot.green { border-color: #22c55e; background: rgba(34, 197, 94, 0.2); }
.timeline-dot.yellow { border-color: #f59e0b; background: rgba(245, 158, 11, 0.2); }
.timeline-dot.red { border-color: #ef4444; background: rgba(239, 68, 68, 0.2); }
.timeline-dot.purple { border-color: #8b5cf6; background: rgba(139, 92, 246, 0.2); }

.timeline-content {
    font-size: 0.875rem;
}

.timeline-title {
    font-weight: 500;
    margin-bottom: 0.125rem;
}

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

/* =====================================================
   DIARY IMPROVEMENTS
   ===================================================== */

.diary-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.diary-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.diary-nav-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.diary-date-label {
    font-weight: 600;
    font-size: 1rem;
    min-width: 200px;
    text-align: center;
}

.diary-slot {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    min-height: 60px;
}

.diary-time {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding-top: 0.25rem;
}

.diary-booking {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: var(--radius-md);
    padding: 0.625rem 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.diary-booking:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
}

.diary-booking-title {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.125rem;
}

.diary-booking-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* =====================================================
   RESPONSIVE OVERRIDES
   ===================================================== */

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

    .customer-profile-card {
        position: static;
    }

    .job-detail-layout {
        grid-template-columns: 1fr;
    }

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

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

    .csv-mapping-grid {
        grid-template-columns: 1fr;
    }
}

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

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

    .job-item-row {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .vhc-summary-bar {
        flex-wrap: wrap;
    }

    .campaign-metrics {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .job-status-flow {
        gap: 0.25rem;
    }

    /* Filters stack vertically on mobile */
    .filters {
        flex-direction: column;
        gap: 0.5rem;
    }

    .filters .filter-input,
    .filters .filter-select {
        width: 100%;
    }

    /* Page headers stack on mobile */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    /* Tables scroll horizontally */
    .data-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Diary slot collapses */
    .diary-slot {
        grid-template-columns: 60px 1fr;
        gap: 0.5rem;
    }

    /* Touch-friendly button sizing */
    .btn {
        min-height: 44px;
        min-width: 44px;
    }

    /* Modals full-width on mobile */
    .modal {
        width: calc(100vw - 2rem) !important;
        max-width: 100% !important;
        max-height: 90vh;
        overflow-y: auto;
    }

    .csv-drop-zone {
        padding: 2rem 1rem;
    }

    .csv-import-actions {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }

    .tab-nav {
        gap: 0;
    }

    .tab-btn {
        padding: 0.625rem 0.75rem;
        font-size: 0.8125rem;
    }

    .error-toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        max-width: none;
    }
}

@media (max-width: 640px) {
    .vehicle-hero {
        flex-direction: column;
        text-align: center;
    }

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

    .kpi-row {
        grid-template-columns: 1fr 1fr;
    }

    .csv-result-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .vhc-item {
        flex-direction: column;
    }

    .vhc-item-right {
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
    }

    .campaign-card {
        padding: 1rem;
    }
}

/* =====================================================
   CSV IMPORT
   ===================================================== */

.csv-drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-primary);
}

.csv-drop-zone:hover,
.csv-drop-zone.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.04);
}

.csv-drop-icon {
    color: var(--text-muted);
    margin-bottom: 1rem;
    transition: color 0.2s;
}

.csv-drop-zone:hover .csv-drop-icon,
.csv-drop-zone.dragover .csv-drop-icon {
    color: var(--primary);
}

.csv-drop-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.csv-drop-subtext {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.csv-drop-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    background: var(--bg-hover);
    border-radius: var(--radius-md);
    display: inline-block;
}

.csv-mapping-header {
    margin-bottom: 1rem;
}

.csv-mapping-header h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.csv-mapping-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.625rem;
    margin-bottom: 1.5rem;
}

.csv-map-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.csv-map-label {
    font-size: 0.8125rem;
    font-weight: 600;
    min-width: 80px;
    color: var(--text-secondary);
}

.csv-map-select {
    flex: 1;
    padding: 0.375rem 0.5rem;
    font-size: 0.8125rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
}

.csv-preview-section {
    margin-bottom: 1.25rem;
}

.csv-preview-section h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.csv-preview-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.csv-preview-table {
    font-size: 0.75rem;
}

.csv-import-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.csv-import-status {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.csv-result-icon {
    text-align: center;
    margin-bottom: 0.5rem;
}

.csv-result-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
}

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

.csv-stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
}

.csv-stat-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.csv-stat.imported .csv-stat-value { color: #22c55e; }
.csv-stat.skipped .csv-stat-value { color: #f59e0b; }
.csv-stat.errors .csv-stat-value { color: #ef4444; }

/* =====================================================
   VHC PHOTO UPLOAD
   ===================================================== */

.vhc-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    flex-shrink: 0;
}

.vhc-photo-upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    border: 1px dashed var(--border);
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    background: var(--bg-primary);
}

.vhc-photo-upload-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99, 102, 241, 0.06);
}

.vhc-item-photo {
    margin-top: 0.75rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
}

.vhc-item-photo img {
    display: block;
    width: 100%;
    max-height: 200px;
    object-fit: cover;
}

/* =====================================================
   SETTINGS GRID
   ===================================================== */

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

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

/* =====================================================
   GLOBAL ENHANCEMENTS
   ===================================================== */

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 0.5rem;
    transition: color 0.15s;
}

.back-link:hover {
    color: var(--primary);
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.loading-page {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    font-size: 0.9375rem;
}

.plan-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.current-plan {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.plan-badge {
    padding: 0.375rem 0.875rem;
    background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.15));
    color: var(--primary);
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 600;
}

.plan-status {
    font-size: 0.8125rem;
    color: #22c55e;
    font-weight: 500;
}

/* Error toast overlay for production */
.error-toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    max-width: 380px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid #ef4444;
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 10000;
    animation: slideInRight 0.3s ease-out;
    font-size: 0.875rem;
    color: #991b1b;
}

.error-toast-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    font-size: 1.125rem;
    line-height: 1;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
