/* ============ RESET & BASE ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f5f5f5;
    color: #1a1a1a;
    line-height: 1.5;
}

/* =============================================================================
   LOGIN PAGES - Matches email design EXACTLY
   ============================================================================= */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    padding: 20px;
}

.login-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 24px;
}

.login-heading {
    font-size: 24px;
    font-weight: 400;
    color: #000000;
    margin: 0 0 24px 0;
    /* NO italic - font-style: normal is default */
}

.login-form {
    margin-bottom: 16px;
}

.login-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    margin-top: 12px;
    margin-bottom: 40px;
    box-sizing: border-box;
}

.login-input:focus {
    outline: none;
    border-color: #0066CC;
}

.login-button {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 500;
    color: #ffffff;
    background: #0066CC;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.login-button:hover {
    background: #0055aa;
}

.login-helper {
    font-size: 14px;
    color: #6b7280;
    margin: 36px;
}

.login-divider {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 24px 0;
}

.login-footer {
    font-size: 13px;
    color: #9ca3af;
    line-height: 1.5;
}

.login-footer a {
    color: #0066CC;
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* Sent page specific */
.login-email-display {
    font-weight: 600;
    color: #000000;
    margin: 8px 0 16px 0;
}

/* Mobile */
@media (max-width: 480px) {
    .login-card {
        padding: 32px 24px;
    }
}

/* Dev warning - yellow box */
.login-dev-warning {
    background: #FEF3C7;
    border: 1px solid #F59E0B;
    border-radius: 8px;
    padding: 12px 16px;
    color: #92400E;
    font-size: 13px;
    margin: 16px 0;
}

.error-message {
    background: #FEE2E2;
    border: 1px solid #FECACA;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #DC2626;
}

/* ============ DASHBOARD LAYOUT ============ */
.dashboard {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.dashboard-header {
    background: white;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
}

.header-logo {
    font-size: 20px;
    font-weight: 700;
    color: #0066CC;
}

.logout-link {
    color: #666;
    text-decoration: none;
    font-size: 14px;
}

.logout-link:hover {
    color: #0066CC;
}

.dashboard-layout {
    display: flex;
    flex: 1;
}

/* ============ SIDEBAR ============ */
.sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
}

.sidebar-header h2 {
    font-size: 16px;
    font-weight: 600;
}

.add-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: #0066CC;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-btn:hover {
    background: #0052a3;
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    padding: 8px;
    gap: 4px;
    border-bottom: 1px solid #e0e0e0;
}

.filter-tab {
    flex: 1;
    padding: 8px 4px;
    font-size: 12px;
    border: none;
    background: transparent;
    color: #666;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.filter-tab:hover {
    background: #f0f0f0;
}

.filter-tab.active {
    background: #e8f0fe;
    color: #0066CC;
    font-weight: 600;
}

.filter-tab span {
    display: inline-block;
    min-width: 18px;
}

/* Vehicle List */
.vehicle-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.vehicle-card {
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 4px;
    transition: background 0.2s;
    border: 2px solid transparent;
}

.vehicle-card:hover {
    background: #f5f5f5;
}

.vehicle-card.selected {
    background: #e8f0fe;
    border-color: #0066CC;
}

.vehicle-card.eliminated {
    opacity: 0.6;
}

.vehicle-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vehicle-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.vehicle-status.green { background: #16A34A; }
.vehicle-status.yellow { background: #F59E0B; }
.vehicle-status.orange { background: #EA580C; }
.vehicle-status.red { background: #DC2626; }
.vehicle-status.gray { background: #9CA3AF; }

.vehicle-name {
    font-weight: 500;
    font-size: 14px;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vehicle-score {
    font-size: 12px;
    color: #666;
}

/* ============ MAIN CONTENT ============ */
.main-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.vehicle-detail {
    max-width: 800px;
    margin: 0 auto;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    color: #ccc;
}

.empty-state h2 {
    margin-bottom: 8px;
}

.empty-state p {
    color: #666;
    margin-bottom: 24px;
}

/* Detail Content */
.detail-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.detail-header {
    padding: 24px;
    border-bottom: 1px solid #e0e0e0;
}

.detail-header h1 {
    font-size: 24px;
    margin-bottom: 4px;
}

.detail-vin {
    color: #666;
    font-family: monospace;
    font-size: 14px;
}

.score-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    margin-top: 12px;
}

.score-badge.eliminate { background: #fee2e2; color: #DC2626; }
.score-badge.caution { background: #fef3c7; color: #D97706; }
.score-badge.investigate-thoroughly { background: #fef9c3; color: #CA8A04; }
.score-badge.investigate-fast { background: #dcfce7; color: #16A34A; }

.detail-actions {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    border-bottom: 1px solid #e0e0e0;
}

.detail-section {
    padding: 24px;
    border-bottom: 1px solid #e0e0e0;
}

.detail-section:last-child {
    border-bottom: none;
}

.detail-section h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Notes */
.notes-textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}

.notes-textarea:focus {
    outline: none;
    border-color: #0066CC;
}

.notes-status {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
    text-align: right;
}

/* ============ BUTTONS ============ */
.primary-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    background: #0066CC;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.primary-btn:hover {
    background: #0052a3;
}

.secondary-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.danger-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    background: #DC2626;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.danger-btn:hover {
    background: #b91c1c;
}

/* ============ MODAL ============ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 24px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
}

.modal-content h2 {
    margin-bottom: 16px;
}

.modal-content input,
.modal-content select {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 16px;
}

.modal-content label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ============ COMPARE FEATURE ============ */
.vehicle-card-checkbox {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    cursor: pointer;
}

.compare-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e0e0e0;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 100;
}

.compare-modal-content {
    max-width: 900px;
    width: 95%;
    max-height: 80vh;
    overflow-y: auto;
}

.compare-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.close-btn:hover {
    color: #333;
}

.compare-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.compare-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
}

.compare-card h3 {
    font-size: 16px;
    margin-bottom: 8px;
}

.compare-card .vin {
    font-family: monospace;
    font-size: 12px;
    color: #666;
    margin-bottom: 12px;
}

.compare-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.compare-row:last-child {
    border-bottom: none;
}

.compare-label {
    color: #666;
    font-size: 14px;
}

.compare-value {
    font-weight: 500;
    font-size: 14px;
}

.compare-value.good { color: #16A34A; }
.compare-value.warning { color: #F59E0B; }
.compare-value.bad { color: #DC2626; }

/* ============ v19: SEGMENTED FILTER CONTROL ============ */
.vehicle-filter-control {
    display: flex;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 4px;
    margin: 12px 16px;
    gap: 4px;
}

.filter-segment {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.filter-segment:hover {
    color: #334155;
}

.filter-segment.active {
    background: white;
    color: #0066CC;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.filter-count {
    font-weight: 400;
    opacity: 0.8;
    margin-left: 2px;
}

/* ============ v19: VEHICLE CARDS WITH ACTIONS ============ */
.vehicle-card {
    position: relative;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s ease;
    border-radius: 0;
    margin-bottom: 0;
    border: none;
}

.vehicle-card:hover {
    background: #f8fafc;
}

.vehicle-card.selected {
    background: #eff6ff;
    border-left: 3px solid #0066CC;
}

.vehicle-card.excluded {
    opacity: 0.7;
}

.vehicle-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    font-size: 11px;
    color: #64748b;
}

.vehicle-vin {
    font-family: monospace;
    font-size: 10px;
}

.vehicle-timestamp {
    font-size: 11px;
    cursor: help;
}

.vehicle-card-actions {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.vehicle-card:hover .vehicle-card-actions {
    opacity: 1;
}

.action-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.action-btn:hover {
    background: #e2e8f0;
    color: #334155;
}

.info-btn:hover {
    background: #dbeafe;
    color: #0066CC;
}

.exclude-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

.reactivate-btn:hover {
    background: #dcfce7;
    color: #16a34a;
}

/* ============ v19: TOAST NOTIFICATIONS ============ */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #1e293b;
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    animation: toastIn 0.3s ease;
}

.toast.hiding {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

.toast-icon {
    color: #22c55e;
}

.toast-message {
    flex: 1;
}

.toast-undo {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.toast-undo:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ============ v19: LIST ANIMATIONS ============ */
.vehicle-card.fade-out {
    opacity: 0;
    transform: translateX(-10px);
}

.vehicle-card.fade-in {
    animation: cardFadeIn 0.2s ease;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============ v19: EMPTY LIST STATE ============ */
.empty-list {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

.empty-list p {
    margin-bottom: 8px;
}

.empty-hint {
    font-size: 13px;
    opacity: 0.7;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .dashboard-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }

    .vehicle-list {
        max-height: 200px;
    }

    .main-content {
        padding: 16px;
    }

    .detail-actions {
        flex-wrap: wrap;
    }

    .detail-actions button {
        flex: 1;
        min-width: 45%;
    }

    .compare-bar {
        padding: 8px 16px;
        gap: 8px;
    }

    .compare-modal-content {
        padding: 16px;
    }

    .compare-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        padding: 16px;
    }

    .filter-tabs {
        flex-wrap: wrap;
    }

    .filter-tab {
        flex: 1 1 30%;
    }

    /* v19: Always show action buttons on mobile */
    .vehicle-card-actions {
        opacity: 1;
    }

    /* v19: Full-width segmented control */
    .vehicle-filter-control {
        margin: 8px 12px;
    }
}

@media (max-width: 480px) {
    .dashboard-header {
        padding: 8px 16px;
    }

    .header-logo {
        font-size: 16px;
    }

    .sidebar-header h2 {
        font-size: 14px;
    }

    .detail-header h1 {
        font-size: 18px;
    }

    .score-badge {
        font-size: 12px;
        padding: 6px 12px;
    }

    .detail-actions {
        flex-direction: column;
    }

    .detail-actions button {
        width: 100%;
    }
}
