/* Orion dark theme - final semantic layer loaded after module styles. */

body[data-theme="dark"] {
    --dark-bg-0: #07111f;
    --dark-bg-1: #0b1728;
    --dark-surface-1: #102036;
    --dark-surface-2: #152943;
    --dark-surface-3: #1b3553;
    --dark-text: #f3f7ff;
    --dark-text-soft: #c8d6e8;
    --dark-text-muted: #91a4bb;
    --dark-border: rgba(151, 177, 209, 0.2);
    --dark-border-strong: rgba(151, 177, 209, 0.34);
    --dark-accent: #79b9ff;
    --dark-accent-strong: #4d9cff;
    --dark-success: #54d39b;
    --dark-warning: #ffc56b;
    --dark-danger: #ff7f8f;
    --dark-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);

    --app-bg: var(--dark-bg-0);
    --app-panel: var(--dark-surface-1);
    --app-panel-strong: var(--dark-surface-2);
    --app-border: var(--dark-border);
    --app-text: var(--dark-text);
    --app-text-muted: var(--dark-text-muted);
}

body[data-theme="dark"],
body[data-theme="dark"] .os-window,
body[data-theme="dark"] .app-shell,
body[data-theme="dark"] .app-content,
body[data-theme="dark"] .view-section {
    color: var(--dark-text);
    background-color: var(--dark-bg-0);
}

body[data-theme="dark"] .os-window {
    background-image: linear-gradient(145deg, #09172a 0%, #07111f 68%, #0b1b31 100%);
}

body[data-theme="dark"] .app-header,
body[data-theme="dark"] .topbar,
body[data-theme="dark"] .module-toolbar,
body[data-theme="dark"] .view-toolbar,
body[data-theme="dark"] .section-toolbar {
    background: rgba(11, 23, 40, 0.94) !important;
    border-color: var(--dark-border) !important;
    color: var(--dark-text);
}

/* Shared surfaces used by module templates. */
body[data-theme="dark"] .panel,
body[data-theme="dark"] .panel-card,
body[data-theme="dark"] .section-card,
body[data-theme="dark"] .record-item,
body[data-theme="dark"] .document-card,
body[data-theme="dark"] .vehicle-card,
body[data-theme="dark"] .client-directory-card,
body[data-theme="dark"] .personal-directory-card,
body[data-theme="dark"] .kanban-card,
body[data-theme="dark"] .modal-content,
body[data-theme="dark"] .modal-card,
body[data-theme="dark"] .drawer-panel,
body[data-theme="dark"] .occ-side-drawer,
body[data-theme="dark"] .module-card {
    color: var(--dark-text);
    background: var(--dark-surface-1) !important;
    border-color: var(--dark-border) !important;
    box-shadow: var(--dark-shadow);
}

body[data-theme="dark"] .module-card:hover,
body[data-theme="dark"] .module-card:focus-visible,
body[data-theme="dark"] .document-card:hover,
body[data-theme="dark"] .record-item:hover {
    background: var(--dark-surface-2) !important;
    border-color: rgba(121, 185, 255, 0.46) !important;
}

body[data-theme="dark"] .module-card-top,
body[data-theme="dark"] .module-copy,
body[data-theme="dark"] .module-copy strong,
body[data-theme="dark"] .document-card h3,
body[data-theme="dark"] .document-card strong,
body[data-theme="dark"] .record-item strong {
    color: var(--dark-text);
}

body[data-theme="dark"] .module-copy span,
body[data-theme="dark"] .module-copy p,
body[data-theme="dark"] .module-launch,
body[data-theme="dark"] .document-card small,
body[data-theme="dark"] .record-item small,
body[data-theme="dark"] .text-muted,
body[data-theme="dark"] .muted {
    color: var(--dark-text-muted) !important;
}

body[data-theme="dark"] .module-mark {
    background: linear-gradient(145deg, #1c426c, #123052) !important;
    border-color: rgba(159, 204, 255, 0.32) !important;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

body[data-theme="dark"] .module-glyph path,
body[data-theme="dark"] .module-glyph circle {
    stroke: #f4f8ff !important;
}

/* Form controls and action hierarchy. */
body[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"]),
body[data-theme="dark"] select,
body[data-theme="dark"] textarea,
body[data-theme="dark"] .form-control,
body[data-theme="dark"] .erp-input,
body[data-theme="dark"] .erp-select {
    color: var(--dark-text) !important;
    background: #0b1a2e !important;
    border-color: var(--dark-border-strong) !important;
}

body[data-theme="dark"] input::placeholder,
body[data-theme="dark"] textarea::placeholder {
    color: #7188a2 !important;
}

body[data-theme="dark"] input:focus,
body[data-theme="dark"] select:focus,
body[data-theme="dark"] textarea:focus {
    border-color: var(--dark-accent) !important;
    box-shadow: 0 0 0 3px rgba(121, 185, 255, 0.16) !important;
}

body[data-theme="dark"] input[type="checkbox"],
body[data-theme="dark"] input[type="radio"] {
    accent-color: var(--dark-accent-strong);
}

body[data-theme="dark"] .btn.secondary,
body[data-theme="dark"] .btn.ghost,
body[data-theme="dark"] .btn.outline,
body[data-theme="dark"] .btn-erp-outline,
body[data-theme="dark"] .btn-erp-ghost,
body[data-theme="dark"] .btn-visual-erp,
body[data-theme="dark"] .btn-icon,
body[data-theme="dark"] .btn-back {
    color: var(--dark-text-soft) !important;
    background: #12263f !important;
    border-color: var(--dark-border-strong) !important;
}

body[data-theme="dark"] .btn.secondary:hover,
body[data-theme="dark"] .btn.ghost:hover,
body[data-theme="dark"] .btn.outline:hover,
body[data-theme="dark"] .btn-erp-outline:hover,
body[data-theme="dark"] .btn-erp-ghost:hover,
body[data-theme="dark"] .btn-visual-erp:hover,
body[data-theme="dark"] .btn-icon:hover,
body[data-theme="dark"] .btn-back:hover {
    color: #ffffff !important;
    background: #1d3b5e !important;
    border-color: var(--dark-accent) !important;
}

body[data-theme="dark"] .btn.primary,
body[data-theme="dark"] .btn-erp-primary,
body[data-theme="dark"] .btn-primary,
body[data-theme="dark"] .btn-success {
    color: #061426 !important;
    background: var(--dark-accent) !important;
    border-color: var(--dark-accent) !important;
}

body[data-theme="dark"] .btn.danger,
body[data-theme="dark"] .btn-danger {
    color: #dc2626 !important;
    background: #fff !important;
    border-color: #ef4444 !important;
}

body[data-theme="dark"] .btn:focus-visible,
body[data-theme="dark"] button:focus-visible,
body[data-theme="dark"] a:focus-visible {
    outline: 2px solid var(--dark-accent) !important;
    outline-offset: 2px;
}

/* Data-heavy views. */
body[data-theme="dark"] table,
body[data-theme="dark"] .data-table,
body[data-theme="dark"] .data-table-premium,
body[data-theme="dark"] .table-container {
    color: var(--dark-text-soft);
    border-color: var(--dark-border) !important;
}

body[data-theme="dark"] table thead th,
body[data-theme="dark"] .data-table thead th,
body[data-theme="dark"] .data-table-premium th {
    color: var(--dark-text-soft) !important;
    background: #12263f !important;
    border-color: var(--dark-border) !important;
}

body[data-theme="dark"] table td,
body[data-theme="dark"] .data-table td,
body[data-theme="dark"] .data-table-premium td {
    color: var(--dark-text-soft) !important;
    border-color: rgba(151, 177, 209, 0.14) !important;
}

body[data-theme="dark"] table tbody tr:hover,
body[data-theme="dark"] .data-table tbody tr:hover,
body[data-theme="dark"] .data-table-premium tbody tr:hover {
    background: rgba(121, 185, 255, 0.08) !important;
}

body[data-theme="dark"] .status-pill,
body[data-theme="dark"] .badge,
body[data-theme="dark"] .chip {
    border-color: var(--dark-border-strong);
}

/* Launcher and POS keep their own accent colors but use the same dark depth. */
body[data-theme="dark"] .home-dashboard,
body[data-theme="dark"] #view-inicio,
body[data-theme="dark"] #view-ventas,
body[data-theme="dark"] #view-inventario,
body[data-theme="dark"] #view-taller,
body[data-theme="dark"] #view-cuentas-pagar {
    color: var(--dark-text);
    background: var(--dark-bg-0) !important;
}

body[data-theme="dark"] #view-ventas .pos-catalog-panel,
body[data-theme="dark"] #view-ventas .pos-checkout-panel,
body[data-theme="dark"] #view-ventas .pos-product-card,
body[data-theme="dark"] #view-ventas .pos-cart-item,
body[data-theme="dark"] #view-ventas .pos-summary-card,
body[data-theme="dark"] #view-ventas .pos-customer-card,
body[data-theme="dark"] #view-ventas .pos-payment-modal,
body[data-theme="dark"] #view-ventas .pos-tab-content,
body[data-theme="dark"] #view-ventas .pos-select-options {
    color: var(--dark-text);
    background: var(--dark-surface-1) !important;
    border-color: var(--dark-border) !important;
}

body[data-theme="dark"] #view-ventas .pos-product-card:hover,
body[data-theme="dark"] #view-ventas .pos-cart-item:hover {
    background: var(--dark-surface-2) !important;
    border-color: rgba(121, 185, 255, 0.42) !important;
}

body[data-theme="dark"] #view-ventas .pos-catalog-header,
body[data-theme="dark"] #view-ventas .pos-checkout-header,
body[data-theme="dark"] #view-ventas .pos-checkout-tabs-header {
    background: linear-gradient(135deg, #102b49, #0e2037) !important;
    border-color: var(--dark-border) !important;
}

body[data-theme="dark"] #view-ventas .pos-product-card h3,
body[data-theme="dark"] #view-ventas .pos-product-card strong,
body[data-theme="dark"] #view-ventas .pos-cart-item strong,
body[data-theme="dark"] #view-ventas .pos-summary-card strong {
    color: var(--dark-text) !important;
}

body[data-theme="dark"] #view-ventas .pos-product-card small,
body[data-theme="dark"] #view-ventas .pos-cart-item small,
body[data-theme="dark"] #view-ventas .pos-summary-card small,
body[data-theme="dark"] #view-ventas .pos-customer-card small {
    color: var(--dark-text-muted) !important;
}

body[data-theme="dark"] #view-ventas .pos-empty-state,
body[data-theme="dark"] #view-ventas .pos-cart-client {
    color: var(--dark-text-soft) !important;
    background: var(--dark-surface-1) !important;
    border-color: var(--dark-border) !important;
    box-shadow: none !important;
}

body[data-theme="dark"] #view-ventas .pos-empty-state i {
    color: #8aa4bf !important;
}

body[data-theme="dark"] #view-ventas .pos-empty-state h3 {
    color: var(--dark-text) !important;
}

body[data-theme="dark"] #view-ventas .pos-empty-state p {
    color: var(--dark-text-muted) !important;
}

body[data-theme="dark"] #view-ventas .pos-cart-client-heading,
body[data-theme="dark"] #view-ventas .pos-cart-client label {
    color: var(--dark-text-soft) !important;
}

body[data-theme="dark"] #view-ventas .pos-cart-client-heading small {
    color: var(--dark-text-muted) !important;
}

body[data-theme="dark"] #view-ventas .pos-tab-btn {
    color: var(--dark-text-soft) !important;
    background: #12263f !important;
    border-color: var(--dark-border) !important;
    box-shadow: none !important;
}

body[data-theme="dark"] #view-ventas .pos-tab-btn.active {
    color: #f7fbff !important;
    background: #24547f !important;
    border-color: #5e8db8 !important;
}

body[data-theme="dark"] #view-cuentas-pagar .cxp-module,
body[data-theme="dark"] #view-cuentas-pagar .cxp-card,
body[data-theme="dark"] #view-cuentas-pagar .cxp-table-wrap,
body[data-theme="dark"] #view-cuentas-pagar .cxp-payment-history,
body[data-theme="dark"] #view-cuentas-pagar .cxp-modal-content {
    color: var(--dark-text);
    background: var(--dark-surface-1) !important;
    border-color: var(--dark-border) !important;
}

body[data-theme="dark"] #view-cuentas-pagar .cxp-tab:hover,
body[data-theme="dark"] #view-cuentas-pagar .cxp-tab.active {
    color: #ffffff !important;
}

body[data-theme="dark"] #view-taller .workshop-module-hub,
body[data-theme="dark"] #view-taller .taller-document-workspace,
body[data-theme="dark"] #view-taller .taller-document-history,
body[data-theme="dark"] #view-taller .taller-document-history-row {
    color: var(--dark-text);
    background: var(--dark-surface-1) !important;
    border-color: var(--dark-border) !important;
}

body[data-theme="dark"] #view-taller .workshop-submodule-tab {
    background: #12263f !important;
    border-color: var(--dark-border) !important;
    color: var(--dark-text-soft) !important;
}

body[data-theme="dark"] #view-taller .workshop-submodule-tab:hover,
body[data-theme="dark"] #view-taller .workshop-submodule-tab:focus-visible {
    background: #1d3b5e !important;
    color: #ffffff !important;
}

body[data-theme="dark"] #view-taller .workshop-v2-layout,
body[data-theme="dark"] #view-taller .workshop-v2-container {
    color: var(--dark-text);
    background: var(--dark-bg-0) !important;
}

body[data-theme="dark"] #view-taller .workshop-v2-header-nav {
    color: var(--dark-text);
    background: #0e1c2d !important;
    border-color: var(--dark-border) !important;
}

body[data-theme="dark"] #view-taller .btn-back-circle {
    color: var(--dark-text-soft) !important;
    background: #12263f !important;
    border-color: var(--dark-border-strong) !important;
}

body[data-theme="dark"] #view-taller .workshop-nav-pills {
    background: #0b1a2e !important;
    border: 1px solid var(--dark-border) !important;
}

body[data-theme="dark"] #view-taller .nav-pill {
    color: var(--dark-text-muted) !important;
}

body[data-theme="dark"] #view-taller .nav-pill.active {
    color: #f7fbff !important;
    background: #24547f !important;
    box-shadow: none !important;
}

body[data-theme="dark"] #view-taller .brand h1,
body[data-theme="dark"] #view-taller .brand .accent {
    color: var(--dark-text) !important;
    background: none !important;
    -webkit-text-fill-color: currentColor !important;
    text-shadow: none !important;
}

body[data-theme="dark"] #view-taller .kanban-column {
    background: var(--dark-surface-1) !important;
    border-color: var(--dark-border) !important;
}

body[data-theme="dark"] #view-taller .kanban-card {
    color: var(--dark-text-soft);
    background: var(--dark-surface-2) !important;
    border-color: var(--dark-border) !important;
    box-shadow: none !important;
}

body[data-theme="dark"] #view-taller .card-body h4,
body[data-theme="dark"] #view-taller .column-title {
    color: var(--dark-text-soft) !important;
}

body[data-theme="dark"] #view-taller .plate-badge,
body[data-theme="dark"] #view-taller .count-badge,
body[data-theme="dark"] #view-taller .progress-track {
    color: var(--dark-text-soft) !important;
    background: #182d45 !important;
    border-color: var(--dark-border) !important;
}

body[data-theme="dark"] .premium-empty-icon-wrap {
    color: #a8c9eb !important;
    background: #18304a !important;
    box-shadow: none !important;
    transform: none !important;
}

body[data-theme="dark"] .premium-empty-card {
    color: var(--dark-text-soft) !important;
    background: var(--dark-surface-1) !important;
    border-color: var(--dark-border) !important;
    box-shadow: none !important;
}

body[data-theme="dark"] .premium-empty-info strong {
    color: var(--dark-text) !important;
}

body[data-theme="dark"] .premium-empty-info p {
    color: var(--dark-text-muted) !important;
}

body[data-theme="dark"] .premium-empty-card:hover .premium-empty-icon-wrap {
    transform: none !important;
}

/* Menus, dialogs and generated suggestion lists. */
body[data-theme="dark"] .dropdown-menu,
body[data-theme="dark"] .context-menu,
body[data-theme="dark"] .profile-menu,
body[data-theme="dark"] .search-results,
body[data-theme="dark"] .lookup-suggestions,
body[data-theme="dark"] .suggestions-list,
body[data-theme="dark"] .theme-switch-menu,
body[data-theme="dark"] .autocomplete-list {
    color: var(--dark-text);
    background: #10243d !important;
    border-color: var(--dark-border-strong) !important;
    box-shadow: var(--dark-shadow);
}

body[data-theme="dark"] .dropdown-menu a:hover,
body[data-theme="dark"] .dropdown-menu button:hover,
body[data-theme="dark"] .context-menu button:hover,
body[data-theme="dark"] .search-results li:hover,
body[data-theme="dark"] .lookup-suggestions li:hover,
body[data-theme="dark"] .suggestions-list li:hover {
    color: #ffffff !important;
    background: #1d3b5e !important;
}

body[data-theme="dark"] .modal-overlay {
    background: rgba(1, 8, 18, 0.78) !important;
}

body[data-theme="dark"] .modal-header,
body[data-theme="dark"] .modal-footer {
    border-color: var(--dark-border) !important;
}

body[data-theme="dark"] hr,
body[data-theme="dark"] .divider {
    border-color: var(--dark-border) !important;
    background-color: var(--dark-border) !important;
}

/* Login is a public surface and keeps its light card regardless of saved app theme. */
body[data-theme="dark"] .login-shell {
    color: #152031 !important;
    background:
        radial-gradient(circle at top left, rgba(26, 82, 118, 0.36), transparent 34%),
        radial-gradient(circle at bottom right, rgba(191, 106, 26, 0.28), transparent 30%),
        linear-gradient(135deg, rgba(7, 14, 25, 0.96) 0%, rgba(12, 28, 44, 0.94) 52%, rgba(24, 33, 46, 0.96) 100%) !important;
}

body[data-theme="dark"] .login-shell .login-stage {
    background: rgba(10, 18, 31, 0.32) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

body[data-theme="dark"] .login-shell .login-card {
    color: #152031 !important;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 249, 252, 0.98) 100%) !important;
}

body[data-theme="dark"] .login-shell .brand-mark {
    color: #1e293b !important;
}

body[data-theme="dark"] .login-shell .login-field span {
    color: #64748b !important;
}

body[data-theme="dark"] .login-shell input,
body[data-theme="dark"] .login-shell input:focus {
    color: #1a1a2e !important;
    background: #f0f2f5 !important;
    border-color: #8b8fa3 !important;
    box-shadow: none;
}

body[data-theme="dark"] .login-shell input:focus {
    background: #ffffff !important;
    border-color: #007bff !important;
    box-shadow: inset 0 0 0 1px rgba(0, 123, 255, 0.16), 0 0 0 4px rgba(0, 123, 255, 0.12) !important;
}

body[data-theme="dark"] .login-shell input::placeholder {
    color: #64748b !important;
}

body[data-theme="dark"] .login-shell .password-toggle-icon {
    color: #64748b !important;
}

body[data-theme="dark"] .login-shell button,
body[data-theme="dark"] .login-shell button:hover,
body[data-theme="dark"] .login-shell button:disabled {
    color: #ffffff !important;
    background: #007bff !important;
    border-color: transparent !important;
}

body[data-theme="dark"] .login-shell button:hover {
    background: #0069d9 !important;
}

body[data-theme="dark"] .login-shell .error-copy {
    color: #f87171 !important;
    background: #1e293b !important;
    border-color: #ef4444 !important;
}

/* Home launcher: keep module icon colors while using dark card surfaces. */
body[data-theme="dark"] #view-home {
    background: #091522 !important;
}

body[data-theme="dark"] #view-home::before {
    display: none !important;
}

body[data-theme="dark"] #view-home .module-card {
    color: var(--dark-text) !important;
    background: #102136 !important;
    border: 1px solid #29415d !important;
    border-radius: 26px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2) !important;
}

body[data-theme="dark"] #view-home .module-card::before {
    display: none !important;
}

body[data-theme="dark"] #view-home .module-card:hover {
    background: #142a43 !important;
    border-color: #52779e !important;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.26) !important;
    transform: translateY(-2px);
}

body[data-theme="dark"] #view-home .module-card .module-mark {
    --glyph-color: #ffffff !important;
    background: linear-gradient(135deg, #334155, #1e293b) !important;
    border: 1px solid rgba(100, 116, 139, 0.34) !important;
    border-radius: 28px;
    box-shadow: 0 14px 24px rgba(100, 116, 139, 0.18) !important;
}

body[data-theme="dark"] #view-home .module-card .module-mark::after {
    display: none !important;
}

body[data-theme="dark"] #view-home .module-card .module-glyph {
    filter: none !important;
}

body[data-theme="dark"] #view-home .module-card .module-glyph path,
body[data-theme="dark"] #view-home .module-card .module-glyph circle {
    stroke: var(--glyph-color, #ffffff) !important;
}

body[data-theme="dark"] #view-home .module-card .module-copy strong {
    color: #e7eef7 !important;
    font-weight: 700;
}

body[data-theme="dark"] #view-home .module-cobranzas,
body[data-theme="dark"] #view-home .module-cuentas-pagar {
    border: none !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2) !important;
}

body[data-theme="dark"] #view-home .module-cobranzas:hover,
body[data-theme="dark"] #view-home .module-cuentas-pagar:hover {
    border: none !important;
}

body[data-theme="dark"] #view-home .module-cobranzas {
    background: #102136 !important;
}

body[data-theme="dark"] #view-home .module-cuentas-pagar {
    background: #102136 !important;
}

body[data-theme="dark"] #view-home .module-recepcion .module-mark {
    --glyph-color: #ffffff !important;
    background: linear-gradient(135deg, #2bb6f4 0%, #1198e2 46%, #0c6db6 100%) !important;
    border-color: rgba(2, 132, 199, 0.34) !important;
    box-shadow: 0 14px 24px rgba(14, 165, 233, 0.22) !important;
}

body[data-theme="dark"] #view-home .module-taller .module-mark {
    --glyph-color: #ffffff !important;
    background: linear-gradient(135deg, #f89a41 0%, #ef7b1a 48%, #c95a0f 100%) !important;
    border-color: rgba(249, 115, 22, 0.34) !important;
    box-shadow: 0 14px 24px rgba(249, 115, 22, 0.22) !important;
}

body[data-theme="dark"] #view-home .module-cotizaciones .module-mark {
    --glyph-color: #ffffff !important;
    background: linear-gradient(135deg, #31cf94 0%, #17b77f 48%, #0a8d60 100%) !important;
    border-color: rgba(16, 185, 129, 0.34) !important;
    box-shadow: 0 14px 24px rgba(16, 185, 129, 0.2) !important;
}

body[data-theme="dark"] #view-home .module-documentos .module-mark,
body[data-theme="dark"] #view-home .module-clientes .module-mark {
    --glyph-color: #ffffff !important;
    background: linear-gradient(135deg, #26ccb9 0%, #17b19f 48%, #118376 100%) !important;
    border-color: rgba(20, 184, 166, 0.34) !important;
    box-shadow: 0 14px 24px rgba(20, 184, 166, 0.2) !important;
}

body[data-theme="dark"] #view-home .module-ventas .module-mark,
body[data-theme="dark"] #view-home .module-vehiculos .module-mark {
    --glyph-color: #ffffff !important;
    background: linear-gradient(135deg, #29cdea 0%, #0fb1cb 48%, #0d8fa7 100%) !important;
    border-color: rgba(6, 182, 212, 0.34) !important;
    box-shadow: 0 14px 24px rgba(6, 182, 212, 0.2) !important;
}

body[data-theme="dark"] #view-home .module-cobranzas .module-mark,
body[data-theme="dark"] #view-home .module-reportes .module-mark {
    --glyph-color: #ffffff !important;
    background: linear-gradient(135deg, #5d9ff6 0%, #367de8 48%, #215fd1 100%) !important;
    border-color: rgba(59, 130, 246, 0.34) !important;
    box-shadow: 0 14px 24px rgba(59, 130, 246, 0.2) !important;
}

body[data-theme="dark"] #view-home .module-cuentas-pagar .module-mark {
    --glyph-color: #ecfeff !important;
    background: radial-gradient(circle at top right, rgba(45, 212, 191, 0.56), transparent 58%), linear-gradient(180deg, rgba(15, 118, 110, 0.98), rgba(7, 44, 48, 0.98)) !important;
    border-color: rgba(45, 212, 191, 0.50) !important;
    box-shadow: 0 18px 32px rgba(20, 184, 166, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.10) !important;
}

body[data-theme="dark"] #view-home .module-inventario .module-mark {
    --glyph-color: #ffffff !important;
    background: linear-gradient(135deg, #f4bc2e 0%, #e59d12 48%, #c4760d 100%) !important;
    border-color: rgba(245, 158, 11, 0.34) !important;
    box-shadow: 0 14px 24px rgba(245, 158, 11, 0.2) !important;
}

body[data-theme="dark"] #view-home .module-colaboradores .module-mark {
    --glyph-color: #ffffff !important;
    background: linear-gradient(135deg, #bb80f5 0%, #9f57ec 48%, #7d2fd1 100%) !important;
    border-color: rgba(168, 85, 247, 0.34) !important;
    box-shadow: 0 14px 24px rgba(168, 85, 247, 0.2) !important;
}

body[data-theme="dark"] #view-home .module-asistencia .module-mark {
    --glyph-color: #ffffff !important;
    background: linear-gradient(135deg, #4ad777 0%, #28bf59 48%, #18913f 100%) !important;
    border-color: rgba(34, 197, 94, 0.34) !important;
    box-shadow: 0 14px 24px rgba(34, 197, 94, 0.2) !important;
}

body[data-theme="dark"] #view-home .module-agenda .module-mark {
    --glyph-color: #dc2626 !important;
    background: #fff !important;
    border-color: #ef4444 !important;
    box-shadow: none !important;
}

body[data-theme="dark"] #view-home .module-papelera .module-mark {
    --glyph-color: #ffffff !important;
    background: linear-gradient(135deg, #334155, #1e293b) !important;
    border-color: rgba(100, 116, 139, 0.34) !important;
    box-shadow: 0 14px 24px rgba(100, 116, 139, 0.18) !important;
}

body[data-theme="dark"] #view-home .module-config .module-mark {
    --glyph-color: #ffffff !important;
    background: linear-gradient(135deg, #b9c4d4 0%, #90a0b8 48%, #64748b 100%) !important;
    border-color: rgba(100, 116, 139, 0.34) !important;
    box-shadow: 0 14px 24px rgba(100, 116, 139, 0.18) !important;
}

body[data-theme="dark"] .report-center-eyebrow {
    color: #7ec1ff;
}

body[data-theme="dark"] .report-center-subtitle,
body[data-theme="dark"] .report-period-control,
body[data-theme="dark"] .report-custom-dates,
body[data-theme="dark"] .report-center-intro p {
    color: #91a4bd;
}

body[data-theme="dark"] .report-center-intro {
    border-color: #29415d;
    background: linear-gradient(125deg, #102136 0%, #0d1b2c 100%);
}

body[data-theme="dark"] .report-center-intro h2 {
    color: #e7eef7;
}

body[data-theme="dark"] .report-center-signal {
    border-color: rgba(126, 193, 255, 0.22);
    background: rgba(126, 193, 255, 0.08);
    color: #9bd0ff;
}

body[data-theme="dark"] .report-nav-tabs .tab-nav-btn small {
    color: #91a4bd;
}

body[data-theme="dark"] .report-loading-copy {
    border-color: #29415d;
    background: #102136;
    color: #91a4bd;
}

@media (max-width: 760px) {
    body[data-theme="dark"] .panel,
    body[data-theme="dark"] .panel-card,
    body[data-theme="dark"] .modal-content,
    body[data-theme="dark"] .modal-card {
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
    }

    body[data-theme="dark"] #view-ventas .pos-catalog-panel,
    body[data-theme="dark"] #view-ventas .pos-checkout-panel {
        border-radius: 14px;
    }
}

/* Final dark surfaces for dynamic workspaces. These selectors intentionally
   live at the end because the affected markup is rendered by feature modules
   with older, light-first component rules. */

/* Profile menu and profile editor. */
body[data-theme="dark"] .profile-menu {
    background: linear-gradient(160deg, #10243b 0%, #0d1b2d 100%) !important;
    border-color: rgba(148, 183, 220, 0.28) !important;
    box-shadow: 0 24px 52px rgba(0, 0, 0, 0.42) !important;
}

body[data-theme="dark"] .profile-menu-head {
    border-bottom-color: rgba(148, 183, 220, 0.24) !important;
}

body[data-theme="dark"] .profile-menu-copy strong,
body[data-theme="dark"] .profile-menu-action strong,
body[data-theme="dark"] .profile-form-copy strong {
    color: #f5f9ff !important;
}

body[data-theme="dark"] .profile-menu-copy span,
body[data-theme="dark"] .profile-menu-action span,
body[data-theme="dark"] .profile-form-copy span {
    color: #a9bdd5 !important;
}

body[data-theme="dark"] .profile-menu-action {
    border-color: rgba(148, 183, 220, 0.14) !important;
    background: rgba(22, 43, 68, 0.9) !important;
}

body[data-theme="dark"] .profile-menu-action:hover {
    border-color: rgba(121, 185, 255, 0.42) !important;
    background: #1b385b !important;
}

body[data-theme="dark"] .profile-menu-action.danger {
    border-color: #ef4444 !important;
    background: #fff !important;
}

body[data-theme="dark"] .profile-menu-action.danger strong {
    color: #dc2626 !important;
}

body[data-theme="dark"] .profile-menu-action.danger span {
    color: #64748b !important;
}

body[data-theme="dark"] .profile-menu-action.danger:hover {
    border-color: #dc2626 !important;
    background: #fff !important;
}

body[data-theme="dark"] .profile-form-preview,
body[data-theme="dark"] .profile-input {
    border-color: rgba(148, 183, 220, 0.22) !important;
    background: #0d1c30 !important;
}

body[data-theme="dark"] .profile-field-group label {
    color: #a9bdd5 !important;
}

/* POS catalog, prices and compact cart. */
body[data-theme="dark"] #view-ventas .pos-product-card,
body[data-theme="dark"] #view-ventas .pos-customer-card,
body[data-theme="dark"] #view-ventas .pos-summary-card,
body[data-theme="dark"] #view-ventas .pos-cart-list,
body[data-theme="dark"] #view-ventas .pos-cart-item {
    color: var(--dark-text) !important;
    border-color: rgba(139, 174, 211, 0.22) !important;
    background: linear-gradient(155deg, #122943 0%, #0e1d31 100%) !important;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24) !important;
}

body[data-theme="dark"] #view-ventas .pos-product-card:hover,
body[data-theme="dark"] #view-ventas .pos-cart-item:hover,
body[data-theme="dark"] #view-ventas .pos-cart-item:focus-within {
    border-color: rgba(121, 185, 255, 0.52) !important;
    background: linear-gradient(155deg, #173554 0%, #122640 100%) !important;
}

body[data-theme="dark"] #view-ventas .pos-product-thumb {
    border-color: rgba(121, 185, 255, 0.28) !important;
    background: linear-gradient(145deg, #1b3b5f, #122b47) !important;
    color: #c6e1ff !important;
}

body[data-theme="dark"] #view-ventas .pos-product-copy strong,
body[data-theme="dark"] #view-ventas .pos-product-prices strong,
body[data-theme="dark"] #view-ventas .pos-cart-item-copy strong,
body[data-theme="dark"] #view-ventas .pos-cart-line-total strong {
    color: #f5f9ff !important;
}

body[data-theme="dark"] #view-ventas .pos-product-copy span,
body[data-theme="dark"] #view-ventas .pos-product-copy small,
body[data-theme="dark"] #view-ventas .pos-product-prices small,
body[data-theme="dark"] #view-ventas .pos-cart-item-copy span,
body[data-theme="dark"] #view-ventas .pos-cart-item-meta small,
body[data-theme="dark"] #view-ventas .pos-cart-field > span:first-child,
body[data-theme="dark"] #view-ventas .pos-cart-line-total > span:first-child {
    color: #9db2c9 !important;
}

body[data-theme="dark"] #view-ventas .pos-product-meta span,
body[data-theme="dark"] #view-ventas .pos-product-prices > span {
    border-color: rgba(121, 185, 255, 0.24) !important;
    background: rgba(24, 53, 84, 0.92) !important;
    color: #d6e9ff !important;
}

body[data-theme="dark"] #view-ventas .pos-product-prices > span strong {
    color: #dff1ff !important;
}

body[data-theme="dark"] #view-ventas .pos-cart-list {
    border-radius: 18px !important;
}

body[data-theme="dark"] #view-ventas .pos-cart-columns {
    border-bottom-color: rgba(139, 174, 211, 0.22) !important;
    background: #10243b !important;
    color: #9db2c9 !important;
}

body[data-theme="dark"] #view-ventas .pos-cart-item {
    border-bottom-color: rgba(139, 174, 211, 0.16) !important;
    box-shadow: none !important;
}

body[data-theme="dark"] #view-ventas .pos-cart-item-thumb,
body[data-theme="dark"] #view-ventas .pos-cart-item-thumb.is-placeholder {
    border-color: rgba(96, 211, 224, 0.32) !important;
    background: linear-gradient(145deg, #153e58, #123047) !important;
    color: #92e8f1 !important;
}

body[data-theme="dark"] #view-ventas .pos-cart-field input,
body[data-theme="dark"] #view-ventas .pos-cart-name-input,
body[data-theme="dark"] #view-ventas .pos-quantity-stepper {
    border-color: rgba(139, 174, 211, 0.26) !important;
    background: #0b1a2d !important;
    color: #f2f7ff !important;
}

body[data-theme="dark"] #view-ventas .pos-quantity-stepper button {
    color: #b8d7f6 !important;
    background: #163452 !important;
}

body[data-theme="dark"] #view-ventas .pos-cart-summary {
    border-color: rgba(145, 131, 255, 0.34) !important;
    background: linear-gradient(145deg, #162c4a 0%, #211f4b 100%) !important;
}

body[data-theme="dark"] #view-ventas .pos-summary-topline,
body[data-theme="dark"] #view-ventas .pos-breakdown-row,
body[data-theme="dark"] #view-ventas .pos-discount-field {
    color: #b8cce2 !important;
}

body[data-theme="dark"] #view-ventas .pos-cart-client {
    border-color: rgba(121, 185, 255, 0.28) !important;
    background: linear-gradient(150deg, #122b47 0%, #171f45 100%) !important;
    box-shadow: none !important;
}

body[data-theme="dark"] #view-ventas .pos-cart-client label,
body[data-theme="dark"] #view-ventas .pos-cart-client-heading,
body[data-theme="dark"] #view-ventas .pos-cart-client-heading strong {
    color: #d9eaff !important;
}

body[data-theme="dark"] #view-ventas #pos-content-billing .pos-customer-card,
body[data-theme="dark"] #view-ventas #pos-content-billing .pos-summary-card:not(.pos-cart-summary) {
    border-color: rgba(139, 174, 211, 0.24) !important;
    background: linear-gradient(155deg, #122943 0%, #0e1d31 100%) !important;
}

/* Reports and Caja Chica. */
body[data-theme="dark"] #view-reportes {
    background: var(--dark-bg-0) !important;
}

body[data-theme="dark"] #view-reportes .report-nav-tabs {
    border-color: rgba(139, 174, 211, 0.2) !important;
    background: #0c1a2d !important;
}

body[data-theme="dark"] #view-reportes .report-nav-tabs .tab-nav-btn {
    color: #9db2c9 !important;
    background: transparent !important;
}

body[data-theme="dark"] #view-reportes .report-nav-tabs .tab-nav-btn.active {
    color: #f5f9ff !important;
    background: linear-gradient(135deg, #1464b4, #174885) !important;
    box-shadow: 0 12px 24px rgba(8, 71, 126, 0.28) !important;
}

body[data-theme="dark"] #view-reportes .cash-dashboard,
body[data-theme="dark"] #view-reportes .cash-dashboard h2,
body[data-theme="dark"] #view-reportes .cash-dashboard h3 {
    color: var(--dark-text) !important;
}

body[data-theme="dark"] #view-reportes .cash-hero,
body[data-theme="dark"] #view-reportes .cash-action-form,
body[data-theme="dark"] #view-reportes .cash-movements-card,
body[data-theme="dark"] #view-reportes .cash-linked-operations,
body[data-theme="dark"] #view-reportes .cash-advanced,
body[data-theme="dark"] #view-reportes .cash-summary-card {
    border-color: rgba(139, 174, 211, 0.24) !important;
    background: linear-gradient(155deg, #122943 0%, #0d1c30 100%) !important;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22) !important;
}

body[data-theme="dark"] #view-reportes .cash-hero {
    background: linear-gradient(135deg, #10334a 0%, #102940 52%, #142542 100%) !important;
}

body[data-theme="dark"] #view-reportes .cash-eyebrow {
    color: #69dfb2 !important;
}

body[data-theme="dark"] #view-reportes .cash-summary-card span,
body[data-theme="dark"] #view-reportes .cash-summary-card small,
body[data-theme="dark"] #view-reportes .cash-movement-copy small,
body[data-theme="dark"] #view-reportes .cash-movement-amount small,
body[data-theme="dark"] #view-reportes .cash-section-head small,
body[data-theme="dark"] #view-reportes .cash-form-grid label,
body[data-theme="dark"] #view-reportes .cash-create-form label,
body[data-theme="dark"] #view-reportes .cash-advanced-card label {
    color: #9db2c9 !important;
}

body[data-theme="dark"] #view-reportes .cash-summary-card strong,
body[data-theme="dark"] #view-reportes .cash-movement-copy strong {
    color: #f1f7ff !important;
}

body[data-theme="dark"] #view-reportes .cash-summary-card.is-income strong,
body[data-theme="dark"] #view-reportes .cash-movement.is-income .cash-movement-amount strong {
    color: #72e2b1 !important;
}

body[data-theme="dark"] #view-reportes .cash-summary-card.is-expense strong,
body[data-theme="dark"] #view-reportes .cash-movement.is-expense .cash-movement-amount strong {
    color: #ff9eab !important;
}

body[data-theme="dark"] #view-reportes .cash-primary-actions {
    gap: 16px;
}

body[data-theme="dark"] #view-reportes .cash-primary-action.is-income {
    background: linear-gradient(135deg, #087f61, #159b79) !important;
}

body[data-theme="dark"] #view-reportes .cash-primary-action.is-expense {
    color: #f87171 !important;
    background: #10243b !important;
    border: 1px solid #dc2626 !important;
}

body[data-theme="dark"] #view-reportes .cash-advanced-card {
    border-color: rgba(139, 174, 211, 0.2) !important;
    background: #10243b !important;
}

body[data-theme="dark"] #view-reportes .cash-empty-state {
    width: 100%;
    max-width: none;
    margin: 0;
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: clamp(28px, 5vw, 54px);
    border-color: rgba(98, 220, 184, 0.28) !important;
    border-radius: 24px;
    color: var(--dark-text);
    background: radial-gradient(circle at top right, rgba(39, 174, 137, 0.12), transparent 32%), linear-gradient(155deg, #122d43 0%, #0e1f34 100%) !important;
    text-align: center;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.26) !important;
}

body[data-theme="dark"] #view-reportes .cash-empty-icon {
    width: 62px;
    height: 62px;
    margin: 0 0 6px;
    color: #75e4bb !important;
    background: rgba(42, 197, 153, 0.18) !important;
    box-shadow: 0 14px 28px rgba(10, 94, 72, 0.24);
}

body[data-theme="dark"] #view-reportes .cash-empty-state h2 {
    color: #f4fbff !important;
}

body[data-theme="dark"] #view-reportes .cash-empty-state p {
    max-width: 650px;
    color: #a9bfd3 !important;
}

body[data-theme="dark"] #view-reportes .cash-create-form {
    width: min(980px, 100%);
    margin-top: 14px;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(150px, 0.7fr) auto;
    gap: 12px;
    align-items: end;
    text-align: left;
}

body[data-theme="dark"] #view-reportes .cash-create-form input,
body[data-theme="dark"] #view-reportes .cash-create-form select,
body[data-theme="dark"] #view-reportes .cash-form-grid input,
body[data-theme="dark"] #view-reportes .cash-form-grid select,
body[data-theme="dark"] #view-reportes .cash-advanced-card input,
body[data-theme="dark"] #view-reportes .cash-advanced-card select,
body[data-theme="dark"] #view-reportes .cash-linked-form input,
body[data-theme="dark"] #view-reportes .cash-linked-form select {
    color: #f4f8ff !important;
    background: #0a1b2f !important;
    border-color: rgba(139, 174, 211, 0.3) !important;
}

body[data-theme="dark"] #view-reportes .cash-movement {
    border-bottom-color: rgba(139, 174, 211, 0.16) !important;
}

body[data-theme="dark"] #view-reportes .cash-movement-icon {
    color: #76e7bc !important;
    background: rgba(42, 197, 153, 0.18) !important;
}

body[data-theme="dark"] #view-reportes .cash-movement.is-expense .cash-movement-icon {
    color: #f87171 !important;
    background: transparent !important;
    border: 1px solid #dc2626 !important;
}

/* Customer and vehicle detail workspaces. */
body[data-theme="dark"] #view-entity-profile .entity-profile-body,
body[data-theme="dark"] #view-entity-profile .entity-profile-main {
    color: var(--dark-text) !important;
    background: linear-gradient(180deg, #0b1728 0%, #091523 100%) !important;
}

body[data-theme="dark"] #view-entity-profile .entity-profile-section,
body[data-theme="dark"] #view-entity-profile .entity-kpi-card,
body[data-theme="dark"] #view-entity-profile .entity-stat,
body[data-theme="dark"] #view-entity-profile .entity-vehicle-pill,
body[data-theme="dark"] #view-entity-profile .entity-calendar-card,
body[data-theme="dark"] #view-entity-profile .entity-next-item,
body[data-theme="dark"] #view-entity-profile .entity-doc-item,
body[data-theme="dark"] #view-entity-profile .entity-timeline-item,
body[data-theme="dark"] #view-entity-profile .entity-modal-row {
    border-color: rgba(139, 174, 211, 0.22) !important;
    background: linear-gradient(155deg, #122943 0%, #0e1d31 100%) !important;
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.2) !important;
}

body[data-theme="dark"] #view-entity-profile .entity-profile-section-premium {
    background: radial-gradient(circle at top right, rgba(77, 156, 255, 0.14), transparent 32%), linear-gradient(155deg, #142f4c 0%, #0f2137 100%) !important;
}

body[data-theme="dark"] #view-entity-profile .entity-profile-section-head strong,
body[data-theme="dark"] #view-entity-profile .entity-stat strong,
body[data-theme="dark"] #view-entity-profile .entity-kpi-card strong,
body[data-theme="dark"] #view-entity-profile .entity-vehicle-pill strong,
body[data-theme="dark"] #view-entity-profile .entity-next-copy strong,
body[data-theme="dark"] #view-entity-profile .entity-doc-item strong,
body[data-theme="dark"] #view-entity-profile .entity-timeline-item strong {
    color: #f2f7ff !important;
}

body[data-theme="dark"] #view-entity-profile .entity-profile-section-head span,
body[data-theme="dark"] #view-entity-profile .entity-stat span,
body[data-theme="dark"] #view-entity-profile .entity-kpi-card span,
body[data-theme="dark"] #view-entity-profile .entity-kpi-card small,
body[data-theme="dark"] #view-entity-profile .entity-vehicle-pill span,
body[data-theme="dark"] #view-entity-profile .entity-next-copy span,
body[data-theme="dark"] #view-entity-profile .entity-doc-item span,
body[data-theme="dark"] #view-entity-profile .entity-doc-item small,
body[data-theme="dark"] #view-entity-profile .entity-timeline-item span,
body[data-theme="dark"] #view-entity-profile .entity-photo-empty {
    color: #9db2c9 !important;
}

body[data-theme="dark"] #view-entity-profile .entity-pill,
body[data-theme="dark"] #view-entity-profile .entity-profile-back span {
    border-color: rgba(121, 185, 255, 0.28) !important;
    color: #cae3ff !important;
    background: rgba(31, 72, 116, 0.72) !important;
}

body[data-theme="dark"] #view-entity-profile .entity-vehicle-photo-preview {
    border-color: rgba(139, 174, 211, 0.22) !important;
    background: linear-gradient(155deg, #122943, #0b1c30) !important;
}

/* Vehicle ficha galleries, compatible items and empty states. */
body[data-theme="dark"] .vehicle-profile-modern-card,
body[data-theme="dark"] .vehicle-profile-modern-kpi.is-white,
body[data-theme="dark"] .vehicle-profile-owner,
body[data-theme="dark"] .vehicle-profile-empty,
body[data-theme="dark"] .vehicle-profile-spec-grid .entity-stat,
body[data-theme="dark"] .vehicle-profile-spec-stat,
body[data-theme="dark"] .vehicle-profile-gallery-thumb,
body[data-theme="dark"] .vehicle-profile-gallery-empty,
body[data-theme="dark"] .edit-vehicle-gallery-wrap,
body[data-theme="dark"] .edit-vehicle-gallery-item,
body[data-theme="dark"] .vehicle-compatible-part,
body[data-theme="dark"] .vehicle-compatible-service,
body[data-theme="dark"] .vehicle-compatible-picker-item,
body[data-theme="dark"] .vehicle-compatible-empty-state,
body[data-theme="dark"] .vehicle-compatible-empty,
body[data-theme="dark"] .vehicle-compatible-loading {
    border-color: rgba(139, 174, 211, 0.22) !important;
    color: #e9f2ff !important;
    background: linear-gradient(155deg, #122943 0%, #0e1d31 100%) !important;
}

body[data-theme="dark"] .vehicle-profile-modern-section-head h3,
body[data-theme="dark"] .vehicle-profile-owner-copy strong,
body[data-theme="dark"] .vehicle-profile-spec-grid .entity-stat strong,
body[data-theme="dark"] .vehicle-profile-spec-stat strong,
body[data-theme="dark"] .vehicle-compatible-part strong,
body[data-theme="dark"] .vehicle-compatible-service strong,
body[data-theme="dark"] .vehicle-compatible-picker-item strong,
body[data-theme="dark"] .vehicle-compatible-empty-copy strong,
body[data-theme="dark"] .edit-vehicle-gallery-heading strong {
    color: #f1f7ff !important;
}

body[data-theme="dark"] .vehicle-profile-owner-copy span,
body[data-theme="dark"] .vehicle-profile-spec-grid .entity-stat span,
body[data-theme="dark"] .vehicle-profile-spec-stat span,
body[data-theme="dark"] .vehicle-profile-gallery-thumb-label,
body[data-theme="dark"] .vehicle-compatible-part-copy span,
body[data-theme="dark"] .vehicle-compatible-part small,
body[data-theme="dark"] .vehicle-compatible-service-copy span,
body[data-theme="dark"] .vehicle-compatible-picker-item small,
body[data-theme="dark"] .vehicle-compatible-picker-item em,
body[data-theme="dark"] .vehicle-compatible-empty-copy p,
body[data-theme="dark"] .edit-vehicle-gallery-heading span,
body[data-theme="dark"] .edit-vehicle-gallery-label {
    color: #9db2c9 !important;
}

body[data-theme="dark"] .vehicle-profile-gallery-thumb-media,
body[data-theme="dark"] .edit-vehicle-gallery-media,
body[data-theme="dark"] .vehicle-compatible-media,
body[data-theme="dark"] .vehicle-compatible-picker-thumb {
    background: #163451 !important;
}

body[data-theme="dark"] .vehicle-compatible-service-media {
    background: #2b2755 !important;
}

body[data-theme="dark"] .vehicle-profile-gallery-main iframe,
body[data-theme="dark"] .vehicle-profile-gallery-modal-media iframe {
    background: #0b1b2d !important;
}

body[data-theme="dark"] .vehicle-compatible-empty-icon {
    color: #7ce4d4 !important;
    background: rgba(42, 197, 153, 0.18) !important;
}

body[data-theme="dark"] .vehicle-compatible-empty-action {
    color: #061a29 !important;
    background: #73e3d2 !important;
}

body[data-theme="dark"] .vehicle-compatible-picker-search,
body[data-theme="dark"] .vehicle-compatible-picker-search input {
    color: #eaf4ff !important;
    background: #0b1b2d !important;
    border-color: rgba(139, 174, 211, 0.28) !important;
}

/* Configuration image cards and upload zones. */
body[data-theme="dark"] #view-config .photo-dropzone,
body[data-theme="dark"] #view-config .watermark-config-card,
body[data-theme="dark"] #view-config .watermark-preview,
body[data-theme="dark"] #view-config .watermark-preview-empty {
    border-color: rgba(139, 174, 211, 0.24) !important;
    color: #eaf3ff !important;
    background: linear-gradient(155deg, #122943 0%, #0e1d31 100%) !important;
}

/* Keep only the public login fields light when the saved app theme is dark. */
body[data-theme="dark"] #login-view #login-user,
body[data-theme="dark"] #login-view #login-pass {
    color: #122033 !important;
    background: #f1f5f9 !important;
    border-color: #8b8fa3 !important;
}

body[data-theme="dark"] #login-view #login-user:focus,
body[data-theme="dark"] #login-view #login-pass:focus {
    background: #ffffff !important;
    border-color: #007bff !important;
}

body[data-theme="dark"] #login-view #login-user::placeholder,
body[data-theme="dark"] #login-view #login-pass::placeholder {
    color: #64748b !important;
}

body[data-theme="dark"] #view-config .photo-dropzone:hover,
body[data-theme="dark"] #view-config .photo-dropzone.dragging {
    border-color: rgba(121, 185, 255, 0.62) !important;
    background: #173554 !important;
}

body[data-theme="dark"] #view-config .photo-drop-copy strong,
body[data-theme="dark"] #view-config .watermark-config-copy strong {
    color: #f4f8ff !important;
}

body[data-theme="dark"] #view-config .photo-drop-copy span,
body[data-theme="dark"] #view-config .watermark-config-copy span,
body[data-theme="dark"] #view-config .watermark-preview-empty {
    color: #9db2c9 !important;
}

body[data-theme="dark"] #view-config .watermark-preview img {
    background: #081727;
}

@media (max-width: 760px) {
    body[data-theme="dark"] #view-reportes .cash-create-form {
        grid-template-columns: 1fr;
    }

    body[data-theme="dark"] #view-reportes .cash-create-form button {
        width: 100%;
    }
}

/* Inventory: keep the product controls aligned with the catalog and readable in dark mode. */
body[data-theme="dark"] #view-inventario .app-tabs {
    border-color: rgba(151, 177, 209, 0.2) !important;
    background: linear-gradient(180deg, rgba(17, 25, 39, 0.98), rgba(13, 20, 33, 0.96)) !important;
}

body[data-theme="dark"] #view-inventario .inventory-products-toolbar {
    color: #e8effb !important;
    border-color: rgba(151, 177, 209, 0.2) !important;
    background: linear-gradient(145deg, #122238, #0f1c2e) !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2) !important;
}

body[data-theme="dark"] #view-inventario .inventory-products-toolbar-title {
    color: #f3f7ff !important;
}

body[data-theme="dark"] #view-inventario .inventory-products-toolbar .inventory-result-count {
    color: #c7d2fe !important;
    background: rgba(99, 102, 241, 0.18) !important;
}

body[data-theme="dark"] #view-inventario .inventory-products-toolbar .inventory-products-create {
    color: #ffffff !important;
    border-color: #625bf6 !important;
    background: linear-gradient(135deg, #4f46e5, #625bf6) !important;
}

body[data-theme="dark"] #view-inventario .inventory-products-toolbar .inventory-products-create:hover {
    background: linear-gradient(135deg, #4338ca, #5145e8) !important;
}

body[data-theme="dark"] #view-inventario .inventory-products-toolbar .inventory-products-inactive.active {
    color: #e0e7ff !important;
    border-color: rgba(129, 140, 248, 0.5) !important;
    background: rgba(79, 70, 229, 0.28) !important;
}

@media (max-width: 640px) {
    body[data-theme="dark"] #view-inventario .app-tabs {
        background: linear-gradient(180deg, rgba(17, 25, 39, 0.98), rgba(13, 20, 33, 0.96)) !important;
    }
}

/* Dark mode audit: invoice import cards and product-link dialogs had inline light surfaces. */
body[data-theme="dark"] .pdf-invoice-card {
    color: #e8effb !important;
    border-top-color: rgba(151, 177, 209, 0.2) !important;
    border-right-color: rgba(151, 177, 209, 0.2) !important;
    border-bottom-color: rgba(151, 177, 209, 0.2) !important;
    background: linear-gradient(145deg, #14253b, #102035) !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24) !important;
}

body[data-theme="dark"] .pdf-invoice-banner {
    color: #e8effb !important;
    border-bottom-color: rgba(151, 177, 209, 0.2) !important;
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.18), #172a43) !important;
}

body[data-theme="dark"] .pdf-invoice-banner > span:last-child {
    color: #b5c6dc !important;
}

body[data-theme="dark"] .pdf-invoice-file-row {
    border-bottom-color: rgba(151, 177, 209, 0.18) !important;
}

body[data-theme="dark"] .pdf-invoice-card .pdf-filename,
body[data-theme="dark"] .pdf-invoice-card .pdf-invoice-fields label,
body[data-theme="dark"] .pdf-invoice-card .pdf-invoice-fields label span,
body[data-theme="dark"] .pdf-invoice-card .pdf-items-toggle span,
body[data-theme="dark"] .pdf-invoice-card .pdf-items-toggle span strong {
    color: #dce8f7 !important;
}

body[data-theme="dark"] .pdf-invoice-card .pdf-filesize,
body[data-theme="dark"] .pdf-invoice-card .pdf-invoice-fields small,
body[data-theme="dark"] .pdf-invoice-card .pdf-chevron {
    color: #9db2c9 !important;
}

body[data-theme="dark"] .pdf-invoice-items-accordion {
    border-color: rgba(151, 177, 209, 0.22) !important;
    background: #0d1c2e !important;
}

body[data-theme="dark"] .pdf-invoice-items-row {
    border-top-color: rgba(151, 177, 209, 0.2) !important;
    background: #13243a !important;
}

body[data-theme="dark"] .pdf-items-inner-table thead tr {
    background: #192d46 !important;
    border-bottom-color: rgba(151, 177, 209, 0.2) !important;
}

body[data-theme="dark"] #modal-pdf-item-linker .pdf-item-linker-header {
    color: #e8effb !important;
    border-bottom-color: rgba(151, 177, 209, 0.2) !important;
    background: #172a43 !important;
}

body[data-theme="dark"] #modal-pdf-item-linker .pdf-item-linker-header h3,
body[data-theme="dark"] #modal-pdf-item-linker .pdf-item-linker-source > div:last-child {
    color: #e8effb !important;
}

body[data-theme="dark"] #modal-pdf-item-linker .pdf-item-linker-source > div:first-child {
    color: #9db2c9 !important;
}

body[data-theme="dark"] #modal-pdf-item-linker .pdf-item-linker-source,
body[data-theme="dark"] #modal-pdf-item-linker .pdf-item-linker-suggestions {
    border-color: rgba(151, 177, 209, 0.2) !important;
    background: #13243a !important;
}

body[data-theme="dark"] #modal-pdf-item-linker label,
body[data-theme="dark"] #modal-select-pdf-repuesto label {
    color: #c8d6e8 !important;
}

body[data-theme="dark"] #modal-pdf-item-linker #pdf-linker-selected-preview,
body[data-theme="dark"] #modal-select-pdf-repuesto #modal-sel-selected-preview {
    color: #a7f3d0 !important;
    border-color: rgba(52, 211, 153, 0.38) !important;
    background: rgba(6, 78, 59, 0.34) !important;
}

body[data-theme="dark"] #modal-select-pdf-repuesto #modal-sel-selected-preview span,
body[data-theme="dark"] #modal-select-pdf-repuesto #modal-sel-selected-name {
    color: #a7f3d0 !important;
}

body[data-theme="dark"] #modal-pdf-item-linker .pdf-linker-option,
body[data-theme="dark"] #modal-select-pdf-repuesto #modal-sel-suggestions > div {
    color: #dce8f7 !important;
    border-bottom-color: rgba(151, 177, 209, 0.14) !important;
    background: #13243a !important;
}

body[data-theme="dark"] #modal-pdf-item-linker .pdf-linker-option:hover,
body[data-theme="dark"] #modal-select-pdf-repuesto #modal-sel-suggestions > div:hover {
    background: #203752 !important;
}

body[data-theme="dark"] #modal-pdf-item-linker .pdf-linker-option > div,
body[data-theme="dark"] #modal-pdf-item-linker .pdf-linker-option > div > span:first-child,
body[data-theme="dark"] #modal-pdf-item-linker .pdf-linker-option > div > span:last-child,
body[data-theme="dark"] #modal-select-pdf-repuesto #modal-sel-suggestions > div {
    color: #b8cae0 !important;
}

body[data-theme="dark"] #modal-pdf-item-linker .pdf-linker-option > div > span:first-child {
    background: #203752 !important;
}

body[data-theme="dark"] #modal-pdf-item-linker .pdf-linker-option > div > span:last-child {
    color: #b9e5ff !important;
    background: #173752 !important;
}
/* Destructive icon controls use the requested white face in dark mode too. */
body[data-theme="dark"] .btn-card-danger,
body[data-theme="dark"] .backup-card-actions button.btn-backup-delete,
body[data-theme="dark"] button.btn.danger.icon,
body[data-theme="dark"] button.btn.danger.icon-only,
body[data-theme="dark"] button.btn.ghost.exp-delete-btn,
body[data-theme="dark"] button.diag-finding-remove,
body[data-theme="dark"] button.btn.secondary.diag-clear,
body[data-theme="dark"] button.btn-qm-tool.is-destructive,
body[data-theme="dark"] button.btn-qm-secondary.is-destructive,
body[data-theme="dark"] button.btn.bahia-delete-icon,
body[data-theme="dark"] button.bahia-purge-action,
body[data-theme="dark"] .taller-mini-actions button.btn.danger,
body[data-theme="dark"] button.btn-erp-danger:has(> i:only-child),
body[data-theme="dark"] button.btn-remove-spec,
body[data-theme="dark"] button.btn-pos-clear,
body[data-theme="dark"] .pos-cart-clear-btn,
body[data-theme="dark"] button.product-delete-btn,
body[data-theme="dark"] button.purchase-delete-btn,
body[data-theme="dark"] button.pdf-file-remove,
body[data-theme="dark"] button.purchase-payment-proof-delete,
body[data-theme="dark"] button.edit-vehicle-gallery-remove,
body[data-theme="dark"] button.photo-remove,
body[data-theme="dark"] .rep-image-thumb button.remove-btn,
body[data-theme="dark"] .occ-drawer-close:hover,
body[data-theme="dark"] button.btn-icon.danger,
body[data-theme="dark"] button.btn-icon-premium.btn-delete,
body[data-theme="dark"] .vehicle-directory-card .vehicle-directory-card-delete,
body[data-theme="dark"] button.vehicle-compatible-action.is-danger,
body[data-theme="dark"] button.line-action.line-action-delete,
body[data-theme="dark"] button.image-action-btn.delete,
body[data-theme="dark"] .orion-image-card-actions button.danger {
    background: #fff !important;
    border: 1px solid #ef4444 !important;
    color: #dc2626 !important;
}

body[data-theme="dark"] .btn-card-danger:hover,
body[data-theme="dark"] .backup-card-actions button.btn-backup-delete:hover,
body[data-theme="dark"] button.btn.danger.icon:hover,
body[data-theme="dark"] button.btn.danger.icon-only:hover,
body[data-theme="dark"] button.btn.ghost.exp-delete-btn:hover,
body[data-theme="dark"] button.diag-finding-remove:hover,
body[data-theme="dark"] button.btn.secondary.diag-clear:hover,
body[data-theme="dark"] button.btn-qm-tool.is-destructive:hover,
body[data-theme="dark"] button.btn-qm-secondary.is-destructive:hover,
body[data-theme="dark"] button.btn.bahia-delete-icon:hover,
body[data-theme="dark"] button.bahia-purge-action:hover,
body[data-theme="dark"] .taller-mini-actions button.btn.danger:hover,
body[data-theme="dark"] button.btn-erp-danger:has(> i:only-child):hover,
body[data-theme="dark"] button.btn-remove-spec:hover,
body[data-theme="dark"] button.btn-pos-clear:hover,
body[data-theme="dark"] .pos-cart-clear-btn:hover,
body[data-theme="dark"] button.product-delete-btn:hover,
body[data-theme="dark"] button.purchase-delete-btn:hover,
body[data-theme="dark"] button.pdf-file-remove:hover,
body[data-theme="dark"] button.purchase-payment-proof-delete:hover,
body[data-theme="dark"] button.purchase-payment-proof-delete:focus-visible,
body[data-theme="dark"] button.edit-vehicle-gallery-remove:hover,
body[data-theme="dark"] button.photo-remove:hover,
body[data-theme="dark"] .rep-image-thumb button.remove-btn:hover,
body[data-theme="dark"] .occ-drawer-close:hover,
body[data-theme="dark"] button.btn-icon.danger:hover,
body[data-theme="dark"] button.btn-icon-premium.btn-delete:hover,
body[data-theme="dark"] .vehicle-directory-card .vehicle-directory-card-delete:hover,
body[data-theme="dark"] button.vehicle-compatible-action.is-danger:hover,
body[data-theme="dark"] button.line-action.line-action-delete:hover,
body[data-theme="dark"] button.image-action-btn.delete:hover,
body[data-theme="dark"] .orion-image-card-actions button.danger:hover {
    background: #fff !important;
    border-color: #dc2626 !important;
    color: #b91c1c !important;
}

body[data-theme="dark"] .inv-docs-file-icon.is-pdf,
body[data-theme="dark"] .vehicle-compatible-empty-state.is-error .vehicle-compatible-empty-icon,
body[data-theme="dark"] .cash-movement.is-expense .cash-movement-icon,
body[data-theme="dark"] .cash-linked-icon.is-direct {
    background: #fff !important;
    border: 1px solid #ef4444 !important;
    color: #dc2626 !important;
}

body[data-theme="dark"] #view-taller button.btn.danger.icon,
body[data-theme="dark"] #view-taller button.btn.danger.icon-only,
body[data-theme="dark"] #view-taller button.btn.danger.icon:hover,
body[data-theme="dark"] #view-taller button.btn.danger.icon-only:hover {
    border-color: #ef4444 !important;
    background: #fff !important;
    background-image: none !important;
    color: #dc2626 !important;
    box-shadow: none !important;
}

body[data-theme="dark"] #view-taller button.btn.danger.icon:hover,
body[data-theme="dark"] #view-taller button.btn.danger.icon-only:hover {
    border-color: #dc2626 !important;
    color: #b91c1c !important;
}

body[data-theme="dark"] #view-reportes .cash-movement.is-expense .cash-movement-icon {
    background: #fff !important;
    border: 1px solid #ef4444 !important;
    color: #dc2626 !important;
}
