/* ==========================================================================
   Verteron Commercial Calculator - Premium Stylesheet
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --brand-50: #fff6ed;
    --brand-100: #ffead4;
    --brand-200: #ffd0a8;
    --brand-300: #ffad70;
    --brand-400: #ff7d33;
    --brand-500: #ff4d00;
    --brand-600: #e64500;
    --brand-700: #cc3d00;
    --brand-800: #9e1c00;
    --brand-900: #7e1a04;
    
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    
    --emerald-50: #ecfdf5;
    --emerald-100: #d1fae5;
    --emerald-200: #a7f3d0;
    --emerald-500: #10b981;
    --emerald-600: #059669;
    --emerald-700: #047857;
    
    --red-50: #fef2f2;
    --red-100: #fee2e2;
    --red-200: #fecaca;
    --red-500: #ef4444;
    --red-600: #dc2626;
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-premium: 0 20px 25px -5px rgba(15, 23, 42, 0.04), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
}

/* Base resets & styles */
body {
    font-family: 'Inter', sans-serif;
    background-color: #f6f8fb;
    color: var(--slate-800);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--slate-100);
}
::-webkit-scrollbar-thumb {
    background: var(--slate-300);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--slate-400);
}

/* Sidebar compact scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 5px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

/* Premium Layout Elements */
.header-glow {
    background: linear-gradient(135deg, #ffffff 0%, #fffbf7 100%);
}

.brand-gradient-text {
    background: linear-gradient(135deg, var(--brand-500) 0%, #ff7d33 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.premium-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.premium-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-premium);
    border-color: rgba(255, 77, 0, 0.15);
}

/* Custom Segmented Controller for Terms (Image 4 Style) */
.term-slider-container {
    background: var(--slate-900);
    border-radius: 9999px;
    padding: 6px;
    display: flex;
    overflow-x: auto;
    position: relative;
    scroll-behavior: smooth;
    scrollbar-width: none; /* Firefox */
}
.term-slider-container::-webkit-scrollbar {
    display: none; /* Safari/Chrome */
}

.term-option {
    flex: 1;
    min-width: 140px;
    text-align: center;
    padding: 10px 14px;
    color: var(--slate-400);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 9999px;
    transition: all var(--transition-normal);
    position: relative;
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.term-option:hover {
    color: #ffffff;
}

.term-option.active {
    background: rgba(255, 77, 0, 0.15);
    color: #ffffff;
    border: 1px solid rgba(255, 77, 0, 0.4);
    box-shadow: inset 0 0 10px rgba(255, 77, 0, 0.2);
}

.term-badge {
    background: rgba(255, 77, 0, 0.25);
    color: #ff9d66;
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 700;
    margin-top: 2px;
    border: 1px solid rgba(255, 77, 0, 0.3);
}

/* Custom Operating System Cards (Image 5 Style) */
.os-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.os-card {
    border: 2px solid var(--slate-200);
    border-radius: 16px;
    padding: 16px;
    cursor: pointer;
    background: #ffffff;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.os-card:hover {
    border-color: var(--brand-300);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.os-card.active {
    border-color: var(--brand-500);
    background: var(--brand-50);
}

.os-icon {
    font-size: 1.75rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--slate-100);
    border-radius: 12px;
    color: var(--slate-600);
    transition: all var(--transition-normal);
}

.os-card.active .os-icon {
    background: #ffffff;
    color: var(--brand-500);
    box-shadow: var(--shadow-sm);
}

.os-details {
    display: flex;
    flex-direction: column;
}

.os-title {
    font-weight: 700;
    color: var(--slate-800);
    font-size: 0.95rem;
}

.os-price {
    font-size: 0.8rem;
    color: var(--brand-500);
    font-weight: 800;
    margin-top: 2px;
}

/* Custom Table / Cart Design */
.quote-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.quote-table th {
    color: var(--slate-500);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    border-bottom: 2px solid var(--slate-100);
}

.quote-table tr.quote-row {
    background: #ffffff;
    transition: all var(--transition-fast);
}

.quote-table tr.quote-row:hover {
    transform: scale(1.005);
    box-shadow: var(--shadow-sm);
}

.quote-table td {
    padding: 16px;
    border-top: 1px solid var(--slate-100);
    border-bottom: 1px solid var(--slate-100);
}

.quote-table td:first-child {
    border-left: 1px solid var(--slate-100);
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.quote-table td:last-child {
    border-right: 1px solid var(--slate-100);
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* Drag and Drop Cart Reordering */
.quote-table tr.quote-row.is-dragging {
    opacity: 0.35;
    background: var(--brand-50) !important;
}

.quote-table tr.quote-row.drag-over-top td {
    border-top: 2px solid var(--brand-500) !important;
}

.quote-table tr.quote-row.drag-over-bottom td {
    border-bottom: 2px solid var(--brand-500) !important;
}

body.is-reordering .quote-table tr.quote-row:hover {
    transform: none !important;
}

.drag-handle {
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.drag-handle:active,
.quote-row:active .drag-handle {
    cursor: grabbing;
}

/* Beautiful Switch Button */
.switch-container {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.switch-track {
    width: 48px;
    height: 26px;
    background: var(--slate-300);
    border-radius: 9999px;
    position: relative;
    transition: background-color var(--transition-normal);
}

.switch-thumb {
    width: 20px;
    height: 20px;
    background: #ffffff;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: transform var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.switch-track.active {
    background: var(--brand-500);
}

.switch-track.active .switch-thumb {
    transform: translateX(22px);
}

/* Animations */
.fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.pulse-glow {
    animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 77, 0, 0.4); }
    50% { box-shadow: 0 0 15px 4px rgba(255, 77, 0, 0.2); }
}

/* ==========================================================================
   Print / PDF Styles (Optimized for A4 Page Layout)
   ========================================================================== */
#pdf-wrapper {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 750px;
    z-index: -9999;
    background: #ffffff;
    margin: 0;
    padding: 0;
}

#pdf-template {
    background: #ffffff;
    color: #1e293b;
    font-family: 'Inter', sans-serif;
    padding: 0;
    margin: 0;
    line-height: 1.4;
    width: 750px;
    box-sizing: border-box;
}

.pdf-container {
    width: 750px;
    max-width: 750px;
    margin: 0;
    display: block;
    background: #ffffff;
    box-sizing: border-box;
    padding: 6px 16px 6px 14px;
}

.pdf-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 10px;
    margin-bottom: 12px;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
}

.pdf-logo {
    height: 32px;
    object-fit: contain;
}

.pdf-title-block {
    text-align: right;
}

.pdf-quote-id {
    font-size: 1.05rem;
    font-weight: 800;
    color: #ff4d00;
    margin-bottom: 3px;
    word-break: break-all;
}

.pdf-meta-text {
    font-size: 0.78rem;
    color: #64748b;
}

.pdf-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 12px;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
}

.pdf-section-title {
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #475569;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 4px;
    margin-bottom: 8px;
    page-break-after: avoid !important;
    break-after: avoid !important;
}

.pdf-info-row {
    display: flex;
    margin-bottom: 4px;
    font-size: 0.82rem;
}

.pdf-info-label {
    font-weight: 600;
    color: #64748b;
    width: 105px;
    flex-shrink: 0;
}

.pdf-info-value {
    color: #1e293b;
}

/* PDF Table Styles */
.pdf-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px;
    page-break-inside: auto !important;
    break-inside: auto !important;
}

.pdf-table thead {
    display: table-header-group;
}

.pdf-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 8px 10px;
    border-bottom: 2px solid #e2e8f0;
    text-align: left;
}

.pdf-table tr {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
}

.pdf-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.82rem;
}

.pdf-table tr:last-child td {
    border-bottom: 2px solid #e2e8f0;
}

.pdf-item-title {
    font-weight: 700;
    color: #0f172a;
    font-size: 0.84rem;
}

.pdf-item-desc {
    font-size: 0.72rem;
    color: #64748b;
    margin-top: 1px;
}

.pdf-item-obs {
    font-size: 0.68rem;
    color: #92400e;
    background-color: #fef3c7;
    border-left: 2px solid #d97706;
    padding: 2px 6px;
    border-radius: 3px;
    margin-top: 3px;
    display: inline-block;
    max-width: 100%;
    word-break: break-word;
}

/* PDF Totals block */
.pdf-totals-section {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
}

.pdf-totals-table {
    width: 320px;
}

.pdf-total-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.82rem;
    border-bottom: 1px solid #f1f5f9;
}

.pdf-total-row.discount-row {
    color: #15803d;
    font-weight: 600;
}

.pdf-total-row.discount-row span:last-child {
    color: #16a34a;
    font-weight: 700;
}

.pdf-total-row.grand-total {
    font-size: 1.15rem;
    font-weight: 900;
    color: #0f172a;
    border-bottom: none;
    padding-top: 8px;
}

.pdf-total-row.grand-total span:last-child {
    color: #ff4d00;
}

/* PDF Inclusions / Standard Terms */
.pdf-terms {
    background: #f8fafc;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.75rem;
    color: #475569;
    margin-bottom: 12px;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
}

.pdf-terms-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 24px;
    margin-top: 8px;
}

.pdf-term-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pdf-term-bullet {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #ff4d00;
}

/* PDF Custom Observations Section */
.pdf-obs-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 3px solid #ff4d00;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 12px;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
}

.pdf-obs-content {
    font-size: 0.75rem;
    color: #334155;
    line-height: 1.55;
    word-break: break-word;
}

.pdf-obs-content p,
.pdf-obs-content div {
    margin: 0 0 3px 0;
}

.pdf-obs-content ul {
    list-style-type: disc !important;
    padding-left: 18px !important;
    margin: 3px 0 !important;
}

.pdf-obs-content ol {
    list-style-type: decimal !important;
    padding-left: 18px !important;
    margin: 3px 0 !important;
}

.pdf-obs-content li {
    margin-bottom: 2px;
}

.pdf-obs-content strong,
.pdf-obs-content b {
    font-weight: 700;
    color: #0f172a;
}

.pdf-obs-content em,
.pdf-obs-content i {
    font-style: italic;
}

.pdf-obs-content u {
    text-decoration: underline;
}

/* Rich Text Mini Editor for Proposal Observations */
.rich-obs-editor {
    min-height: 88px;
    max-height: 240px;
    overflow-y: auto;
    line-height: 1.55;
    word-break: break-word;
}

.rich-obs-editor:empty:before {
    content: attr(data-placeholder);
    color: #94a3b8;
    pointer-events: none;
    display: block;
}

.rich-obs-editor ul {
    list-style-type: disc !important;
    padding-left: 1.35rem !important;
    margin: 0.25rem 0 !important;
}

.rich-obs-editor ol {
    list-style-type: decimal !important;
    padding-left: 1.35rem !important;
    margin: 0.25rem 0 !important;
}

.rich-obs-editor li {
    margin-bottom: 0.15rem;
}

.rich-obs-editor strong,
.rich-obs-editor b {
    font-weight: 700;
    color: #0f172a;
}

.rich-obs-editor em,
.rich-obs-editor i {
    font-style: italic;
}

.rich-obs-editor u {
    text-decoration: underline;
}

/* Espaçador dinâmico e Quebra Forçada */
.html2pdf__page-break {
    page-break-before: always !important;
    break-before: always !important;
}

/* PDF Closing Group (Assinaturas e Rodapé Coesos) */
.pdf-closing-group {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    width: 100%;
}

/* PDF Footer / Signatures */
.pdf-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
    margin-top: 14px;
    margin-bottom: 12px;
    text-align: center;
    font-size: 0.78rem;
    color: #64748b;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
}

.pdf-sig-line {
    border-top: 1px solid #cbd5e1;
    padding-top: 6px;
    margin-top: 18px;
    font-size: 0.8rem;
    color: #334155;
}

/* PDF Footer (address, phone, website) */
.pdf-footer {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 2px solid #e2e8f0;
    text-align: center;
    font-size: 0.72rem;
    color: #64748b;
    line-height: 1.5;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
}

.pdf-footer-label {
    font-weight: 700;
    color: #475569;
    text-decoration: underline;
}

/* Print CSS override for standard browser printing */
@media print {
    #pdf-wrapper {
        display: block !important;
    }
    body * {
        visibility: hidden;
    }
    #pdf-template, #pdf-template * {
        visibility: visible;
    }
    #pdf-template {
        display: block !important;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        padding: 0;
        background: white;
    }

    /* Print override specifically when printing Terms of Contract (#contract-printable-area) */
    body.printing-contract #pdf-wrapper,
    body.printing-contract #pdf-template,
    body.printing-contract #pdf-template * {
        display: none !important;
        visibility: hidden !important;
    }
    body.printing-contract {
        background: #ffffff !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    body.printing-contract #contract-printable-area,
    body.printing-contract #contract-printable-area * {
        visibility: visible !important;
    }
    body.printing-contract #contract-printable-area {
        display: block !important;
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
    }
    body.printing-contract .contract-no-print {
        display: none !important;
    }
    body.printing-contract .contract-sheet {
        box-shadow: none !important;
        margin: 0 auto !important;
        width: 100% !important;
        min-height: auto !important;
        padding: 10mm 12mm !important;
        page-break-inside: avoid;
    }
    body.printing-contract .contract-page-break {
        page-break-after: always !important;
        break-after: page !important;
    }
}

/* ==========================================================================
   Contract Document Rendering Styles (Termo de Adesão ao Contrato Padrão)
   Matches the official printed Verteron 2-page A4 document
   ========================================================================== */
.contract-sheet {
    width: 210mm;
    min-height: 297mm;
    padding: 14mm 15mm 12mm 15mm;
    margin: 0 auto;
    background: #ffffff;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    color: #111827;
    font-size: 11.5px;
    line-height: 1.42;
    position: relative;
    box-sizing: border-box;
}

.contract-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 9px;
    font-size: 11px;
}

.contract-table th.table-header {
    background-color: #0b0f19 !important;
    color: #ffffff !important;
    font-weight: 800;
    text-align: center;
    padding: 4.5px 8px;
    font-size: 10.5px;
    letter-spacing: 0.5px;
    border: 1px solid #0b0f19;
    text-transform: uppercase;
}

.contract-table td {
    border: 1px solid #d1d5db;
    padding: 3.5px 7px;
    vertical-align: middle;
}

.contract-table td.label-col {
    font-weight: 700;
    color: #1f2937;
    width: 26%;
    background-color: #ffffff;
}

.contract-table td.value-col {
    color: #111827;
}

.nature-banner {
    background-color: #ea580c !important;
    color: #ffffff !important;
    font-weight: 800;
    padding: 4.5px 8px;
    margin-bottom: 9px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.contract-page-break {
    page-break-after: always;
    break-after: page;
}

/* ==========================================================================
   Dark Mode Theme (html.dark) — Strictly isolated from PDF & Contract sheets
   ========================================================================== */
html.dark {
    color-scheme: dark;
}

html.dark body {
    background-color: #0b0f19;
    color: #e2e8f0;
}

html.dark ::-webkit-scrollbar-track {
    background: #0f172a;
}

html.dark ::-webkit-scrollbar-thumb {
    background: #334155;
}

html.dark ::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

html.dark .custom-scrollbar::-webkit-scrollbar-thumb {
    background: #334155;
}

html.dark .custom-scrollbar {
    scrollbar-color: #334155 transparent;
}

html.dark #app-header,
html.dark .header-glow {
    background: linear-gradient(135deg, #0f172a 0%, #111827 100%) !important;
    border-color: #1e293b !important;
}

html.dark #app-header img[alt="Verteron Logo"] {
    background: rgba(255, 255, 255, 0.96);
    padding: 4px 10px;
    border-radius: 10px;
}

html.dark .premium-card {
    background: rgba(17, 24, 39, 0.92) !important;
    border-color: #1f2937 !important;
    color: #e2e8f0;
}

html.dark .premium-card:hover {
    border-color: rgba(255, 77, 0, 0.35) !important;
}

html.dark .bg-white:not(#pdf-wrapper):not(#pdf-template):not(#pdf-template *):not(#contract-printable-area):not(.contract-sheet):not(.contract-sheet *) {
    background-color: #111827 !important;
}

html.dark .bg-slate-50:not(#pdf-wrapper):not(#pdf-template):not(#pdf-template *):not(#contract-printable-area):not(.contract-sheet):not(.contract-sheet *),
html.dark .bg-slate-50\/50:not(#pdf-wrapper):not(#pdf-template):not(#pdf-template *):not(#contract-printable-area):not(.contract-sheet):not(.contract-sheet *) {
    background-color: #0f172a !important;
}

html.dark .bg-slate-100:not(#pdf-wrapper):not(#pdf-template):not(#pdf-template *):not(#contract-printable-area):not(.contract-sheet):not(.contract-sheet *) {
    background-color: #1e293b !important;
}

html.dark .bg-emerald-50:not(#pdf-wrapper):not(#pdf-template):not(#pdf-template *):not(#contract-printable-area):not(.contract-sheet):not(.contract-sheet *) {
    background-color: rgba(16, 185, 129, 0.14) !important;
}

html.dark .bg-amber-50:not(#pdf-wrapper):not(#pdf-template):not(#pdf-template *):not(#contract-printable-area):not(.contract-sheet):not(.contract-sheet *) {
    background-color: rgba(245, 158, 11, 0.14) !important;
}

html.dark .bg-red-50:not(#pdf-wrapper):not(#pdf-template):not(#pdf-template *):not(#contract-printable-area):not(.contract-sheet):not(.contract-sheet *) {
    background-color: rgba(239, 68, 68, 0.14) !important;
}

html.dark .bg-purple-50:not(#pdf-wrapper):not(#pdf-template):not(#pdf-template *):not(#contract-printable-area):not(.contract-sheet):not(.contract-sheet *) {
    background-color: rgba(168, 85, 247, 0.14) !important;
}

html.dark .bg-brand-50:not(#pdf-wrapper):not(#pdf-template):not(#pdf-template *):not(#contract-printable-area):not(.contract-sheet):not(.contract-sheet *) {
    background-color: rgba(255, 77, 0, 0.14) !important;
}

html.dark .border-slate-100:not(#pdf-template):not(#pdf-template *):not(.contract-sheet):not(.contract-sheet *),
html.dark .border-slate-200:not(#pdf-template):not(#pdf-template *):not(.contract-sheet):not(.contract-sheet *),
html.dark .border-slate-200\/80:not(#pdf-template):not(#pdf-template *):not(.contract-sheet):not(.contract-sheet *),
html.dark .border-slate-300:not(#pdf-template):not(#pdf-template *):not(.contract-sheet):not(.contract-sheet *) {
    border-color: #1f2937 !important;
}

html.dark .border-emerald-200:not(#pdf-template):not(#pdf-template *):not(.contract-sheet):not(.contract-sheet *),
html.dark .border-emerald-200\/80:not(#pdf-template):not(#pdf-template *):not(.contract-sheet):not(.contract-sheet *) {
    border-color: rgba(16, 185, 129, 0.3) !important;
}

html.dark .border-amber-200:not(#pdf-template):not(#pdf-template *):not(.contract-sheet):not(.contract-sheet *),
html.dark .border-amber-300:not(#pdf-template):not(#pdf-template *):not(.contract-sheet):not(.contract-sheet *) {
    border-color: rgba(245, 158, 11, 0.35) !important;
}

html.dark .text-slate-900:not(#pdf-template):not(#pdf-template *):not(.contract-sheet):not(.contract-sheet *),
html.dark .text-slate-800:not(#pdf-template):not(#pdf-template *):not(.contract-sheet):not(.contract-sheet *) {
    color: #f1f5f9 !important;
}

html.dark .text-slate-700:not(#pdf-template):not(#pdf-template *):not(.contract-sheet):not(.contract-sheet *) {
    color: #cbd5e1 !important;
}

html.dark .text-slate-600:not(#pdf-template):not(#pdf-template *):not(.contract-sheet):not(.contract-sheet *) {
    color: #94a3b8 !important;
}

html.dark .text-slate-500:not(#pdf-template):not(#pdf-template *):not(.contract-sheet):not(.contract-sheet *) {
    color: #94a3b8 !important;
}

html.dark .text-emerald-900:not(#pdf-template):not(#pdf-template *):not(.contract-sheet):not(.contract-sheet *),
html.dark .text-emerald-700:not(#pdf-template):not(#pdf-template *):not(.contract-sheet):not(.contract-sheet *) {
    color: #6ee7b7 !important;
}

html.dark .text-amber-950:not(#pdf-template):not(#pdf-template *):not(.contract-sheet):not(.contract-sheet *),
html.dark .text-amber-900:not(#pdf-template):not(#pdf-template *):not(.contract-sheet):not(.contract-sheet *),
html.dark .text-amber-800:not(#pdf-template):not(#pdf-template *):not(.contract-sheet):not(.contract-sheet *) {
    color: #fcd34d !important;
}

html.dark .text-purple-700:not(#pdf-template):not(#pdf-template *):not(.contract-sheet):not(.contract-sheet *) {
    color: #d8b4fe !important;
}

html.dark .text-brand-700:not(#pdf-template):not(#pdf-template *):not(.contract-sheet):not(.contract-sheet *) {
    color: #ff9d66 !important;
}

html.dark input:not([type="checkbox"]):not([type="radio"]):not(#pdf-template *):not(.contract-sheet *),
html.dark select:not(#pdf-template *):not(.contract-sheet *),
html.dark textarea:not(#pdf-template *):not(.contract-sheet *),
html.dark .rich-obs-editor:not(#pdf-template *):not(.contract-sheet *) {
    background-color: #0f172a !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

html.dark input:disabled:not(#pdf-template *):not(.contract-sheet *),
html.dark select:disabled:not(#pdf-template *):not(.contract-sheet *) {
    background-color: #090d16 !important;
    color: #64748b !important;
}

html.dark .rich-obs-editor strong,
html.dark .rich-obs-editor b {
    color: #f8fafc !important;
}

html.dark .quote-table th {
    color: #94a3b8;
    border-bottom-color: #1f2937;
}

html.dark .quote-table tr.quote-row {
    background: #172033;
}

html.dark .quote-table td {
    border-top-color: #263248;
    border-bottom-color: #263248;
}

html.dark .quote-table td:first-child {
    border-left-color: #263248;
}

html.dark .quote-table td:last-child {
    border-right-color: #263248;
}

html.dark .os-card {
    background: #111827;
    border-color: #334155;
}

html.dark .os-card.active {
    background: rgba(255, 77, 0, 0.14);
}

/* Keep PDF and Contract Sheets strictly light for printing */
html.dark #pdf-wrapper,
html.dark #pdf-template,
html.dark .pdf-container,
html.dark .contract-sheet {
    background: #ffffff !important;
    color: #1e293b !important;
}
