
        @keyframes fadeIn {

            from {
                opacity: 0;
            }

            to {
                opacity: 1;
            }

        }

        /* @keyframes spin — already defined in critical CSS above */



        .preview-table {

            width: 100%;

            border-collapse: separate;

            border-spacing: 0;

            background: white;

            font-size: 0.9rem;

            box-shadow: 0 4px 25px rgba(0, 0, 0, 0.08);

            border-radius: 16px;

            overflow: hidden;

        }



        .preview-table th {

            background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);

            color: white;

            padding: 14px 12px;

            text-align: center;

            font-weight: 700;

            font-size: 0.85rem;

            white-space: nowrap;

            text-transform: uppercase;

            letter-spacing: 0.05em;

        }



        .preview-table td {

            padding: 12px;

            border-bottom: 1px solid #e2e8f0;

            vertical-align: middle;

            transition: all 0.2s ease;

        }



        .preview-table tbody tr:nth-child(even) {

            background: #f8fafc;

        }



        .preview-table tbody tr:hover td {

            background: linear-gradient(90deg, rgba(59, 130, 246, 0.08) 0%, rgba(139, 92, 246, 0.05) 100%);

        }



        .preview-table tbody tr:last-child td {

            border-bottom: none;

        }



        .preview-number {

            text-align: right;

            font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;

            font-weight: 500;

        }



        .preview-positive {

            color: #10b981;

            font-weight: 700;

        }



        .preview-negative {

            color: #ef4444;

            font-weight: 700;

        }



        .preview-section {

            margin-bottom: 28px;

        }



        .preview-section-title {

            font-size: 1.2rem;

            font-weight: 800;

            color: #1e3a5f;

            margin-bottom: 18px;

            padding: 12px 0;

            border-bottom: none;

            display: flex;

            align-items: center;

            gap: 12px;

            position: relative;

        }



        .preview-section-title::after {

            content: '';

            position: absolute;

            bottom: 0;

            left: 0;

            width: 60px;

            height: 4px;

            background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 100%);

            border-radius: 4px;

        }



        .preview-grid {

            display: grid;

            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));

            gap: 24px;

        }



        .preview-grid>* {

            animation: slideUp 0.4s ease forwards;

            opacity: 0;

        }



        .preview-grid>*:nth-child(1) {
            animation-delay: 0.1s;
        }

        .preview-grid>*:nth-child(2) {
            animation-delay: 0.15s;
        }

        .preview-grid>*:nth-child(3) {
            animation-delay: 0.2s;
        }

        .preview-grid>*:nth-child(4) {
            animation-delay: 0.25s;
        }



        @keyframes slideUp {

            from {

                opacity: 0;

                transform: translateY(20px);

            }

            to {

                opacity: 1;

                transform: translateY(0);

            }

        }



        .preview-card {

            background: white;

            border-radius: 16px;

            padding: 22px;

            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);

            border: 1px solid rgba(0, 0, 0, 0.04);

            transition: all 0.3s ease;

            position: relative;

            overflow: hidden;

        }



        .preview-card::before {

            content: '';

            position: absolute;

            top: 0;

            left: 0;

            width: 100%;

            height: 3px;

            background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 50%, #ec4899 100%);

        }



        .preview-card:hover {

            transform: translateY(-4px);

            box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);

        }



        .preview-card-title {

            font-size: 1rem;

            font-weight: 700;

            color: #374151;

            margin-bottom: 14px;

            padding-bottom: 8px;

            border-bottom: 1px solid #e5e7eb;

        }



        .preview-row {

            display: flex;

            justify-content: space-between;

            align-items: center;

            padding: 10px 8px;

            border-radius: 8px;

            transition: all 0.2s ease;

            margin: 2px 0;

        }



        .preview-row:hover {

            background: rgba(59, 130, 246, 0.05);

        }



        .preview-row:last-child {

            border-bottom: none;

        }



        .preview-row-label {

            color: #6b7280;

            font-size: 0.9rem;

        }



        .preview-row-value {

            font-weight: 700;

            color: #1f2937;

            font-size: 0.95rem;

            font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;

        }



        .preview-summary-row {

            background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);

            font-weight: 700;

        }



        .preview-profit-row {

            background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);

            font-weight: 700;

        }



        .preview-cost-row {

            background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);

        }


        /* ═══════════════════════════════════════════════════════════════════
           REPORT PREVIEW — Force Light Mode (immune to dark theme)
           Override global dark-mode table styles from ui-upgrade.css
           ═══════════════════════════════════════════════════════════════════ */

        /* Container: force dark text baseline */
        #reportPreviewContent,
        #reportPreviewContent * {
            color-scheme: light;
        }

        #reportPreviewContent {
            color: #1f2937;
        }

        /* Table cells: override global "table tbody td { color: #cbd5e1 }" */
        .preview-table tbody td {
            color: #334155;
            border-bottom: 1px solid #e2e8f0;
        }

        /* Table header: re-assert blue gradient over global dark "table thead th" */
        .preview-table thead th {
            background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
            color: #ffffff;
        }

        /* Even rows: override global dark "table tbody tr:nth-child(even) td" */
        .preview-table tbody tr:nth-child(even) td {
            background: #f8fafc;
            color: #334155;
        }

        /* Hover: override global dark hover */
        .preview-table tbody tr:hover td {
            background: linear-gradient(90deg, rgba(59, 130, 246, 0.08) 0%, rgba(139, 92, 246, 0.05) 100%);
            color: #1e293b;
        }

        /* Cards: explicit light mode */
        .preview-card {
            background: #ffffff;
            color: #1f2937;
        }

        .preview-card-title {
            color: #374151;
            border-bottom-color: #e5e7eb;
        }

        .preview-row-label {
            color: #6b7280;
        }

        .preview-row-value {
            color: #1f2937;
        }

        /* Section title: keep dark navy */
        .preview-section-title {
            color: #1e3a5f;
        }

        /* Special rows — dark text on light colored backgrounds */
        .preview-profit-row td {
            color: #065f46;
        }

        .preview-cost-row td {
            color: #991b1b;
        }

        .preview-summary-row td {
            color: #1e3a5f;
        }

        /* Positive/negative values: keep their accent colors */
        .preview-table .preview-positive,
        .preview-table td.preview-positive {
            color: #059669 !important;
        }

        .preview-table .preview-negative,
        .preview-table td.preview-negative {
            color: #dc2626 !important;
        }

        /* Preview stat indicators */
        .preview-card .preview-number {
            color: #1f2937;
        }

        /* Fix preview stats bar — explicit light text */
        #previewStats span {
            color: inherit;
        }

        /* ─── Preview AI Input & Footer ─── */
        #previewAgentInput {
            background: #ffffff !important;
            color: #1e293b !important;
            border: 1.5px solid #cbd5e1 !important;
            font-size: 0.95rem;
            caret-color: #3b82f6;
        }

        #previewAgentInput::placeholder {
            color: #94a3b8 !important;
            -webkit-text-fill-color: #94a3b8 !important;
            opacity: 1;
        }

        #previewAgentInput:focus {
            border-color: #3b82f6 !important;
            outline: none;
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
        }

        #previewAgentAnswer {
            background: #eff6ff !important;
            color: #1e3a5f !important;
            border-top-color: #bfdbfe !important;
        }

        /* Footer timestamp */
        #previewTimestamp {
            color: #64748b !important;
        }

        /* Vehicle select in preview */
        #previewVehicleSelect {
            background: #eff6ff !important;
            color: #1e40af !important;
            border-color: #3b82f6 !important;
        }

        #previewVehicleSelect option {
            background: #ffffff !important;
            color: #1e293b !important;
        }

        #previewVehicleCount {
            color: #64748b !important;
        }


        @media print {

            #reportPreviewModal>div>div:first-child,

            #reportPreviewModal>div>div:last-child,

            #reportPreviewModal>div>div:nth-last-child(2),

            #previewAgentAnswer {

                display: none !important;

            }

            #reportPreviewContent {

                overflow: visible !important;

                max-height: none !important;

            }

        }
    