.wv-theme-control { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid #d5e1ee; border-radius: 9px; background: #fff; color: #53657d; font-size: 13px; white-space: nowrap; margin: 0 12px 0 0; }
.wv-theme-control input { appearance: none; width: 34px; height: 20px; border-radius: 20px; background: #c5d2df; position: relative; cursor: pointer; margin: 0; }
.wv-theme-control input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; }
.wv-theme-control input:checked { background: #3b83c8; }
.wv-theme-control input:checked::after { transform: translateX(14px); }
.wv-theme-control input:focus-visible { outline: 3px solid #f7941e; outline-offset: 3px; }
[data-wv-theme="dark"] { color-scheme: dark; --global-text-color: #e0e8f2; --global-muted-color: #a6b6c8; --global-bg-color: #101b29; --bs-body-color: #e0e8f2; --bs-body-bg: #101b29; --bs-secondary-color: #a6b6c8; --bs-border-color: #33465b; --bs-primary-rgb: 115, 181, 244; --bs-primary: #73b5f4; }
[data-wv-theme="dark"] body { background: #101b29 !important; color: #e0e8f2 !important; }
[data-wv-theme="dark"] :is(.bg-white, .bg-light, .card, .modal-content, .dropdown-menu, .offcanvas, .wv-admin-topbar, .wv-admin-sidebar, .wv-corp-header, .wv-theme-control, [class$="-card"], [class*="-card "], [class$="-panel"], [class*="-panel "], [class$="-menu"], [class*="-menu "], [class$="-hero"], [class*="-hero "], .dashboard-metric-card) { background-color: #19283a !important; background-image: none !important; color: #e0e8f2 !important; border-color: #33465b !important; }
[data-wv-theme="dark"] :is(.text-secondary, .text-muted, small, [class*="-subtitle"], [class*="-foot"], [class*="-label"]) { color: #a6b6c8 !important; }
[data-wv-theme="dark"] :is(h1, h2, h3, h4, h5, .text-dark, [class*="-title"], .wv-admin-user-text strong, .wv-corp-user-meta strong) { color: #e0e8f2 !important; }
[data-wv-theme="dark"] :is(.text-primary, [class*="-value"], .relatorio-operacional-summary-card strong) { color: #8ac1f5 !important; }
[data-wv-theme="dark"] :is(.form-control, .form-select, .input-group-text, .ts-control, .ts-dropdown, .flatpickr-calendar) { background-color: #132234 !important; color: #e0e8f2 !important; border-color: #42566f !important; }
[data-wv-theme="dark"] input::placeholder { color: #91a5ba !important; }
[data-wv-theme="dark"] :is(.dropdown-item, .nav-link, .wv-admin-sidebar-link, .wv-admin-user .btn, .wv-admin-toggle, .wv-corp-user-toggle) { color: #c6d5e5 !important; }
[data-wv-theme="dark"] :is(.dropdown-item:hover, .wv-admin-sidebar-link:hover, .wv-admin-sidebar-link.active, .page-link) { background: #253d56 !important; color: #8ac1f5 !important; }
[data-wv-theme="dark"] .table { --bs-table-bg: #19283a; --bs-table-color: #e0e8f2; --bs-table-border-color: #33465b; --bs-table-hover-bg: #253d56; --bs-table-hover-color: #edf5ff; }
[data-wv-theme="dark"] .table :is(th, td) { background-color: #19283a !important; color: #e0e8f2 !important; border-color: #33465b !important; }
[data-wv-theme="dark"] .table thead th { background: #253d56 !important; }
[data-wv-theme="dark"] .btn-primary { --bs-btn-color: #fff; --bs-btn-bg: #0d59a1; --bs-btn-border-color: #0d59a1; }
[data-wv-theme="dark"] .btn-outline-primary { color: #8ac1f5; border-color: #5d92c7; }
[data-wv-theme="dark"] :is(.metric, .day) { background: #19283a !important; border-color: #33465b !important; color: #e0e8f2 !important; }
[data-wv-theme="dark"] .day.today { background: #203e5e !important; border-color: #73b5f4 !important; }
[data-wv-theme="dark"] :is(.status, .big-picture-page button, .big-picture-page a) { background: #20344b !important; color: #c6d5e5 !important; border-color: #42566f !important; }
[data-wv-theme="dark"] .big-picture-page :is(p, dt, footer, .day time) { color: #a6b6c8 !important; }
[data-wv-theme="dark"] .big-picture-page :is(dd, #clock, .brand, .metric-value) { color: #8ac1f5 !important; }
@media (max-width: 575px) { .wv-theme-control { padding: 6px; font-size: 11px; gap: 5px; margin-right: 4px; } }
@media (prefers-reduced-motion: reduce) { .wv-theme-control input::after { transition: none; } }
.wv-admin-topbar > .wv-theme-control { margin-left: auto; flex-shrink: 0; }
.wv-admin-topbar > .wv-theme-control + .wv-admin-user { margin-left: 0; }
[data-wv-theme="dark"] :is(.wv-admin-topbar-brand, .wv-corp-user-meta small, label, .relatorio-operacional-section-title) { color: #c6d5e5 !important; }
[data-wv-theme="dark"] :is([style*="background: white"], [style*="background:#fff"], [style*="background: #fff"], .loading > div) { background: #19283a !important; color: #e0e8f2 !important; }
/* Contraste dos controles e métricas do dashboard original. */
[data-wv-theme="dark"] .wv-admin-toggle { background: #253d56 !important; color: #e0e8f2 !important; }
[data-wv-theme="dark"] .wv-admin-toggle:hover,
[data-wv-theme="dark"] .wv-admin-toggle:focus { background: #0d59a1 !important; color: #fff !important; }
[data-wv-theme="dark"] .dashboard-metric-main,
[data-wv-theme="dark"] .dashboard-metric-main strong { color: #8ac1f5 !important; }
[data-wv-theme="dark"] .dashboard-metric-main span { color: #b7c7d9 !important; }
[data-wv-theme="dark"] .dashboard-metric-section + .dashboard-metric-section { border-color: #33465b; }
[data-wv-theme="dark"] .dashboard-metric-bar { background: #30455d; }
[data-wv-theme="dark"] .dashboard-metric-bar span { background: #5ba3e6; }
[data-wv-theme="dark"] .dashboard-metric-bar-orange span { background: #f7a63f; }
[data-wv-theme="dark"] #page-dashboard .text-success { color: #6ed49a !important; }
[data-wv-theme="dark"] #page-dashboard .text-danger { color: #ff8d99 !important; }
/* Identificação dos pedidos e clientes nas listagens. */
[data-wv-theme="dark"] :is(.pedido-id, .pedido-company, .relatorio-operacional-company) { color: #e0e8f2 !important; }
[data-wv-theme="dark"] :is(a.pedido-id, a.relatorio-operacional-link) { color: #8ac1f5 !important; }
[data-wv-theme="dark"] :is(a.pedido-id:hover, a.relatorio-operacional-link:hover) { color: #c1e1ff !important; }
[data-wv-theme="dark"] :is(.pedido-date, .pedido-meta, .pedido-subtitle) { color: #a6b6c8 !important; }

/* Superfícies e tipografia compartilhadas entre os módulos. */
[data-wv-theme="dark"] {
    --wv-surface: #19283a;
    --wv-surface-raised: #22364c;
    --wv-text: #e0e8f2;
    --wv-muted: #afbed0;
    --wv-accent: #8ac1f5;
    --wv-border: #33465b;
    --global-primary-color: #8ac1f5;
    --bs-emphasis-color: #edf5ff;
    --bs-emphasis-color-rgb: 237,245,255;
    --bs-tertiary-bg: #22364c;
    --bs-secondary-bg: #19283a;
    --bs-link-color: #8ac1f5;
    --bs-link-hover-color: #c1e1ff;
}
[data-wv-theme="dark"] :is(
    .empresa-search-bar, .empresa-edit-section, .empresa-profile-kpi,
    .admin-form-section, .admin-info-item, .usuario-form-section,
    .pedido-trip-section, .pedido-detail-section, .viacao-logo-frame,
    .wv-corp-shell, .wv-corp-desktop-rail, .wv-corp-footer,
    .wv-corp-report-kpi, .accordion-item, .accordion-button, .list-group-item
) { background: var(--wv-surface) !important; color: var(--wv-text) !important; border-color: var(--wv-border) !important; }
[data-wv-theme="dark"] :is(
    .empresa-search-input, .empresa-metric-row > div,
    .empresa-profile-data-grid div, .empresa-finance-grid div, .empresa-contact-card,
    .admin-info-item, .config-card-icon, .pedido-trip-total,
    .provider-detail-grid > div, .pedido-trip-meta, .usuario-profile-card,
    .accordion-button:not(.collapsed), .modal-header, .modal-footer,
    .empresa-status-modal .modal-header, .empresa-status-modal .modal-footer
) { background: var(--wv-surface-raised) !important; color: var(--wv-text) !important; border-color: var(--wv-border) !important; }
[data-wv-theme="dark"] :is(
    .empresa-info-list strong, .empresa-profile-data-grid strong,
    .empresa-finance-grid strong, .empresa-contact-card strong,
    .admin-info-item strong, .admin-user-info strong, .admin-date,
    .viacao-company-info strong, .fatura-id, .fatura-company, .fatura-due,
    .usuario-profile-name, .usuario-name, .usuario-company,
    .pedido-summary-text, .pedido-passenger-name, .pedido-trip-route,
    .config-card-title, .wv-corp-brand-copy, .wv-corp-offcanvas-user-copy strong
) { color: var(--wv-text) !important; }
[data-wv-theme="dark"] :is(
    .empresa-summary-card strong, .empresa-metric-row strong, .empresa-profile-kpi strong,
    .admin-summary-card strong, .config-summary-card strong, .fatura-summary-card strong,
    .pedido-summary-card strong, .pedidos-summary-card strong, .viacao-summary-card strong, .usuario-summary-card strong,
    .wv-corp-report-kpi strong, .empresa-profile-card-title, .empresa-search-input i,
    .admin-section-title, .config-section-title, .fatura-section-title, .pedidos-section-title
) { color: var(--wv-accent) !important; }
[data-wv-theme="dark"] :is(
    .empresa-summary-card span, .empresa-card-kicker, .empresa-card-meta,
    .empresa-info-list span, .empresa-metric-row span, .empresa-profile-meta,
    .empresa-profile-kpi span, .empresa-profile-data-grid span, .empresa-finance-grid span,
    .empresa-contact-card span, .empresa-profile-user-card p, .empresa-status-modal-text,
    .admin-kicker, .admin-hero-meta, .admin-summary-card span, .admin-info-item span,
    .config-kicker, .config-summary-card span, .config-card p, .config-hero p,
    .pedido-muted, .pedido-detail-meta, .pedido-detail-kicker, .pedido-trip-kicker,
    .pedido-summary-card span, .pedidos-summary-card span, .relatorio-operacional-summary-card span,
    .pedido-section-title, .pedido-trip-total span,
    .provider-detail-grid span, .fatura-muted, .fatura-period, .fatura-summary-card span,
    .viacao-summary-card span, .viacao-empty-state p, .usuario-profile-card p,
    .wv-corp-footer p, .wv-corp-footer a, .wv-corp-user-meta small, .form-text
) { color: var(--wv-muted) !important; }
[data-wv-theme="dark"] :is(
    .empresa-card-header, .empresa-card-actions, .empresa-status-modal .modal-header,
    .empresa-status-modal .modal-footer, .pedido-trip-section, hr, .border,
    .border-top, .border-bottom, .border-start, .border-end
) { border-color: var(--wv-border) !important; }
/* Busca sem Bootstrap, campos somente leitura e controles de terceiros. */
[data-wv-theme="dark"] .empresa-search-input input { background: transparent !important; color: var(--wv-text) !important; }
[data-wv-theme="dark"] :is(.form-control:disabled, .form-control[readonly], .form-select:disabled) { background: #223044 !important; color: var(--wv-muted) !important; opacity: 1; }
[data-wv-theme="dark"] :is(.form-control:focus, .form-select:focus, .empresa-search-input:focus-within) { border-color: #73b5f4 !important; box-shadow: 0 0 0 3px rgb(115 181 244 / 20%) !important; }
[data-wv-theme="dark"] :is(.ts-control input, .ts-dropdown .option, .flatpickr-day, .flatpickr-current-month input, .flatpickr-monthDropdown-months) { color: var(--wv-text) !important; }
[data-wv-theme="dark"] :is(.ts-dropdown .active, .flatpickr-day:hover) { background: #253d56 !important; }
[data-wv-theme="dark"] :is(.flatpickr-weekday, .flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay) { color: var(--wv-muted) !important; }
[data-wv-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(180%); }
[data-wv-theme="dark"] :is(.empresa-filter-close, .viacao-filter-close, .fatura-filter-close) { background: #253d56 !important; color: var(--wv-text) !important; }
[data-wv-theme="dark"] .page-item.disabled .page-link { color: #93a7bf !important; background: #19283a !important; }
[data-wv-theme="dark"] .page-item.active .page-link { color: #fff !important; background: #0d59a1 !important; }
/* Cores semânticas: pares de fundo/texto para manter o contraste. */
[data-wv-theme="dark"] :is(.text-success, .text-success-emphasis) { color: #78dfaa !important; }
[data-wv-theme="dark"] :is(.text-danger, .text-danger-emphasis) { color: #ff9da8 !important; }
[data-wv-theme="dark"] :is(.text-warning, .text-warning-emphasis) { color: #ffd38a !important; }
[data-wv-theme="dark"] :is(.bg-success-subtle, .alert-success, .empresa-status-1, .empresa-profile-status-1, .admin-status-1, .viacao-status-active) { background: #173c32 !important; color: #9ae6bd !important; border-color: #30634d !important; }
[data-wv-theme="dark"] :is(.bg-danger-subtle, .alert-danger, .empresa-status-3, .empresa-profile-status-3) { background: #482b37 !important; color: #ffb3bc !important; border-color: #744451 !important; }
[data-wv-theme="dark"] :is(.bg-warning-subtle, .alert-warning, .empresa-status-2, .empresa-profile-status-2) { background: #443820 !important; color: #ffda96 !important; border-color: #6c5934 !important; }
[data-wv-theme="dark"] :is(.bg-primary-subtle, .bg-info-subtle, .alert-info, .empresa-contact-card-primary) { background: #203e5e !important; color: #a3d2ff !important; border-color: #3d6185 !important; }
[data-wv-theme="dark"] :is(.empresa-status-0, .empresa-status-4, .empresa-profile-status-0, .empresa-profile-status-4) { background: #304155 !important; color: #d6e2ef !important; }
[data-wv-theme="dark"] .btn-success { color: #fff !important; }
[data-wv-theme="dark"] .btn-danger { color: #fff !important; }
[data-wv-theme="dark"] .btn-outline-secondary { color: #c6d5e5 !important; border-color: #73869d !important; }
[data-wv-theme="dark"] .btn-light { background: #253d56 !important; color: var(--wv-text) !important; border-color: var(--wv-border) !important; }
[data-wv-theme="dark"] .btn-link { color: var(--wv-accent) !important; }
[data-wv-theme="dark"] .table tbody tr:hover :is(td, th) { background: #22364c !important; }
[data-wv-theme="dark"] :is(.btn-primary, .btn-primary:active, .btn-outline-primary:active) { background: #0d59a1 !important; border-color: #438bd0 !important; color: #fff !important; }
[data-wv-theme="dark"] .btn-primary:hover { background: #084a87 !important; }
[data-wv-theme="dark"] .btn-outline-primary:hover { background: #0d59a1 !important; color: #fff !important; }
[data-wv-theme="dark"] .usuario-profile-card.is-selected { background: #203e5e !important; border-color: #73b5f4 !important; }
[data-wv-theme="dark"] .usuario-profile-card.is-selected .usuario-profile-name { color: #c1e1ff !important; }
[data-wv-theme="dark"] .wv-corp-header-actions :is(.wv-corp-notification, .wv-corp-user-toggle) { background: #22364c !important; color: #c6d5e5 !important; }
[data-wv-theme="dark"] .wv-corp-offcanvas-link-copy :is(strong, small),
[data-wv-theme="dark"] .wv-corp-notification-item-copy strong { color: var(--wv-text) !important; }
[data-wv-theme="dark"] :is(.nav-tabs .nav-link.active, #myTab .active) { background: #253d56 !important; color: var(--wv-accent) !important; border-color: var(--wv-border) !important; }
