/*
|--------------------------------------------------------------------------
| Tema global TSGJ
|--------------------------------------------------------------------------
| Esta hoja se carga después del CSS de cada módulo. El modo claro conserva
| el diseño existente y el modo oscuro corrige también colores que antes
| estaban escritos directamente como blanco en componentes particulares.
*/

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.theme-switch {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    color: #526176;
    background: #ffffff;
    border: 1px solid #d9e3f0;
    border-radius: 11px;
    cursor: pointer;
    transition:
        color 0.2s ease,
        background-color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.theme-switch:hover {
    color: #1d4ed8;
    background: #f2f6ff;
    border-color: #aac1ef;
    transform: translateY(-1px);
}

.theme-switch:focus-visible {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.16);
}

.theme-switch i {
    font-size: 20px;
}

.theme-switch--header {
    margin-left: auto;
}

.theme-switch--floating {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 1200;
    box-shadow: 0 9px 25px rgba(23, 32, 51, 0.14);
}

html[data-app-shell="true"] body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

html[data-app-shell="true"] body > main {
    flex: 1 0 auto;
}

.app-footer,
.page-footer.app-footer {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    width: 100%;
    margin-top: auto;
    padding: 22px 20px 26px;
    color: #7c8798;
    font-size: 10px;
    line-height: 1.5;
    text-align: center;
}

.app-footer p {
    margin: 0;
}

html[data-theme="dark"] {
    color-scheme: dark;

    /* Variables utilizadas por los distintos módulos. */
    --background: #09111f;
    --bg: #09111f;
    --surface: #111c2e;
    --surface-soft: #162338;
    --text: #e7edf7;
    --dark: #e7edf7;
    --muted: #9aaac0;
    --border: #2a3a52;
    --line: #2a3a52;
    --shadow: 0 16px 38px rgba(0, 0, 0, 0.25);
    --shadow-sm: 0 8px 22px rgba(0, 0, 0, 0.22);
    --shadow-md: 0 18px 45px rgba(0, 0, 0, 0.3);

    /* Variables unificadas para Repuestos, Compras, Proveedores, Kardex y Combustible */
    --fuel-bg: #09111f;
    --fuel-card: #111c2e;
    --fuel-soft: #162338;
    --fuel-text: #e7edf7;
    --fuel-muted: #9aaac0;
    --fuel-line: #2a3a52;
    --fuel-blue: #3b82f6;
    --fuel-blue-soft: #172a48;
    --fuel-green: #10b981;
    --fuel-green-soft: #14342f;
    --fuel-orange: #f59e0b;
    --fuel-orange-soft: #302719;
    --fuel-red: #ef4444;
    --fuel-red-soft: #321c27;
    --fuel-purple: #8b5cf6;
    --fuel-purple-soft: #261a3d;
    --fuel-shadow: 0 16px 38px rgba(0, 0, 0, 0.25);

    /* Variables exclusivas de las pantallas de autenticación. */
    --auth-text: #e7edf7;
    --auth-muted: #9aaac0;
    --auth-border: #2a3a52;
    --auth-surface: #111c2e;
    --auth-background: #09111f;
    --auth-primary-soft: #172a48;
}

html[data-theme="dark"],
html[data-theme="dark"] body {
    background-color: #09111f;
}

html[data-theme="dark"] body {
    color: #e7edf7;
    background:
        radial-gradient(
            circle at 7% 8%,
            rgba(37, 99, 235, 0.14),
            transparent 29rem
        ),
        radial-gradient(
            circle at 92% 75%,
            rgba(8, 145, 178, 0.11),
            transparent 31rem
        ),
        #09111f;
}

html[data-theme="dark"] .background-grid,
html[data-theme="dark"] .auth-background__grid {
    opacity: 0.16;
}

/* Barras superiores y selector de tema. */
html[data-theme="dark"] :is(
    .app-topbar,
    .management-topbar,
    .topbar
) {
    color: #e7edf7;
    background: rgba(13, 23, 39, 0.96) !important;
    border-color: #293a52 !important;
    box-shadow: 0 7px 24px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] :is(
    .app-topbar__brand-text strong,
    .app-topbar__user-data strong,
    .management-brand strong,
    .brand strong
) {
    color: #edf3fc;
}

html[data-theme="dark"] :is(
    .app-topbar__brand-text span,
    .app-topbar__user-data span,
    .management-brand span,
    .brand span
) {
    color: #99aac1;
}

html[data-theme="dark"] :is(
    .theme-switch,
    .app-topbar__theme-button,
    .app-topbar__notifications-button,
    .app-topbar__logout-button,
    .back-button
) {
    color: #c7d3e4;
    background: #132036 !important;
    border-color: #30425d !important;
}

html[data-theme="dark"] :is(
    .theme-switch,
    .app-topbar__theme-button,
    .app-topbar__notifications-button
):hover {
    color: #9bbcff;
    background: #1a2c47 !important;
    border-color: #48658f !important;
}

html[data-theme="dark"] .app-topbar__user-data:hover,
html[data-theme="dark"] .app-topbar__user-data:focus-visible {
    background: #16243a;
}

/* Superficies generales. */
html[data-theme="dark"] :is(
    .summary-card,
    .module-card,
    .content-card,
    .vehicle-form-card,
    .detail-card,
    .profile-hero,
    .detail-hero,
    .detail-summary-card,
    .data-panel,
    .form-card,
    .management-card,
    .selected-account,
    .account-state,
    .password-security,
    .alerts-panel,
    .documents-panel,
    .document-summary,
    .edit-card,
    .vehicle-summary,
    .access-card,
    .permissions-card,
    .session-summary,
    .empty-state,
    .detail-empty,
    .compact-empty
) {
    color: #e7edf7;
    background: #111c2e !important;
    border-color: #2a3a52 !important;
    box-shadow: 0 15px 38px rgba(0, 0, 0, 0.22);
}

html[data-theme="dark"] :is(
    .selected-user,
    .selected-vehicle,
    .access-card__notice,
    .modal__notice,
    .form-notice
) {
    color: #f5c77c;
    background: #302719 !important;
    border-color: #6f532c !important;
}

html[data-theme="dark"] :is(
    h1,
    h2,
    h3,
    h4,
    .summary-card strong,
    .module-card strong,
    .detail-summary-card strong,
    .selected-account strong,
    .account-state strong,
    .info-item strong,
    .detail-item strong,
    .information-list dd,
    .timeline-content strong,
    .history-item__content strong,
    .export-menu__panel a strong
) {
    color: #edf3fc;
}

html[data-theme="dark"] :is(
    .breadcrumb,
    .breadcrumbs,
    .management-breadcrumb,
    .page-heading p,
    .management-heading p,
    .card-heading p,
    .panel-heading p,
    .summary-card span,
    .summary-card small,
    .module-card__content p,
    .selected-account small,
    .selected-account span,
    .account-state small,
    .info-item small,
    .detail-item small,
    .information-list dt,
    .timeline-content small,
    .history-item__content small,
    .field-hint,
    .field-help,
    .export-menu__panel a small
) {
    color: #9aaac0;
}

/* Campos: normales, de solo lectura y deshabilitados. */
html[data-theme="dark"] :is(
    input,
    select,
    textarea,
    .search-control,
    .select-control,
    .field-control,
    .input-control,
    .locked-value
) {
    color: #e7edf7;
    border-color: #30425d;
}

html[data-theme="dark"] :is(
    .search-control input,
    .filters select,
    .field-control input,
    .field-control select,
    .input-control input,
    .form-group input,
    .form-group select,
    .form-group textarea,
    .locked-value
) {
    color: #e7edf7 !important;
    background: #162338 !important;
    border-color: #30425d !important;
}

html[data-theme="dark"] :is(
    input:disabled,
    select:disabled,
    textarea:disabled,
    input[readonly],
    textarea[readonly]
) {
    color: #cbd7e7 !important;
    background: #131f31 !important;
    opacity: 1;
}

html[data-theme="dark"] :is(input, textarea)::placeholder {
    color: #7487a2;
}

html[data-theme="dark"] :is(input, select, textarea):focus {
    border-color: #6390f0 !important;
    box-shadow: 0 0 0 4px rgba(99, 144, 240, 0.15) !important;
}

html[data-theme="dark"] select option {
    color: #e7edf7;
    background: #162338;
}

/* Tablas de todos los módulos. */
html[data-theme="dark"] :is(
    .vehicles-table,
    .users-table,
    .data-table,
    .detail-table,
    .audit-table,
    .permissions-table
) {
    color: #dce6f3;
    background: #111c2e;
}

html[data-theme="dark"] :is(
    .vehicles-table th,
    .users-table th,
    .data-table th,
    .detail-table th,
    .audit-table th,
    .permissions-table th
) {
    color: #b9c9dc !important;
    background: #17253a !important;
    border-color: #2a3a52 !important;
}

html[data-theme="dark"] :is(
    .vehicles-table td,
    .users-table td,
    .data-table td,
    .detail-table td,
    .audit-table td,
    .permissions-table td
) {
    color: #dce6f3;
    background: #111c2e !important;
    border-color: #2a3a52 !important;
}

html[data-theme="dark"] :is(
    .vehicles-table tbody tr:hover td,
    .users-table tbody tr:hover td,
    .data-table tbody tr:hover td,
    .detail-table tbody tr:hover td,
    .audit-table tbody tr:hover td
) {
    background: #17263c !important;
}

html[data-theme="dark"] :is(
    .table-responsive,
    .detail-table-responsive,
    .audit-table-wrapper,
    .permissions-table-wrapper
) {
    border-color: #2a3a52;
}

/* Botones secundarios, acciones y menús. */
html[data-theme="dark"] :is(
    .btn--ghost,
    .button--secondary,
    .secondary-button,
    .clear-button,
    .filter-reset,
    .icon-button,
    .action-button,
    .pagination__button,
    .document-action,
    .current-file__actions a,
    .file-remove,
    .modal-close,
    .modal__close
) {
    color: #c7d3e4;
    background: #132036 !important;
    border-color: #30425d !important;
}

html[data-theme="dark"] :is(
    .alert-count,
    .issue-badge,
    .status-badge--inactivo,
    .state-badge--inactivo
) {
    color: #cbd7e7;
    background: #243249 !important;
    border-color: #3a4d69 !important;
}

html[data-theme="dark"] :is(
    .alert-count--ok,
    .issue-badge--vigente,
    .status-badge--operativo,
    .status-badge--activo,
    .state-badge--activo
) {
    color: #6ee7b7;
    background: #14342f !important;
    border-color: #27675b !important;
}

html[data-theme="dark"] :is(
    .fuel-badge,
    .status-badge--mantenimiento,
    .status-badge--vacaciones,
    .module-status--pending,
    .file-status--missing,
    .document-alert--por_vencer
) {
    color: #fcd38d;
    background: #322719 !important;
    border-color: #74522b !important;
}

html[data-theme="dark"] :is(
    .status-badge--no_operativo,
    .status-badge--vendido,
    .inline-alert--error
) {
    color: #fca5a5;
    background: #321c27 !important;
    border-color: #7f3544 !important;
}

html[data-theme="dark"] :is(
    .document-card--sin-archivo,
    .phase-badge
) {
    color: #c4b5fd;
    background: #281f41 !important;
    border-color: #554078 !important;
}

html[data-theme="dark"] :is(
    .section-icon,
    .card-icon,
    .summary-icon,
    .birthday-icon,
    .modal__icon,
    .selected-account__icon
) {
    background: #1a2b43 !important;
    border-color: #3a5274 !important;
}

html[data-theme="dark"] :is(
    .issue-badge--vence_hoy,
    .issue-badge--vencido,
    .status-badge--suspendido,
    .state-badge--suspendido,
    .status-badge--bloqueado,
    .state-badge--bloqueado
) {
    color: #fca5a5;
    background: #321c27 !important;
    border-color: #7f3544 !important;
}

html[data-theme="dark"] :is(
    .pagination__button--disabled,
    .text-button--missing
) {
    color: #71839d;
    background: #111b2b !important;
    border-color: #27364d !important;
}

html[data-theme="dark"] :is(
    .btn--ghost,
    .button--secondary,
    .secondary-button,
    .clear-button,
    .filter-reset,
    .icon-button,
    .action-button,
    .pagination__button,
    .document-action,
    .current-file__actions a,
    .file-remove,
    .modal-close,
    .modal__close
):hover {
    color: #9bbcff;
    background: #1a2c47 !important;
    border-color: #48658f !important;
}

html[data-theme="dark"] .export-menu__panel {
    color: #e7edf7;
    background: #132036 !important;
    border-color: #30425d !important;
    box-shadow: 0 24px 55px rgba(0, 0, 0, 0.38);
}

html[data-theme="dark"] .export-menu__panel a {
    color: #e7edf7 !important;
    background: transparent !important;
}

html[data-theme="dark"] .export-menu__panel a:hover {
    background: #1a2c47 !important;
    border-color: #48658f !important;
}

html[data-theme="dark"] .export-menu[open] > summary {
    color: #9bbcff;
    background: #172b4b !important;
    border-color: #496a9f !important;
}

/* Vehículos y detalle documental. */
html[data-theme="dark"] :is(
    .detail-item,
    .history-item,
    .document-card,
    .document-card__actions,
    .document-file-missing,
    .document-file-reminder,
    .current-file,
    .module-lock,
    .selected-vehicle
) {
    color: #e7edf7;
    background: #162338 !important;
    border-color: #30425d !important;
}

html[data-theme="dark"] :is(
    .form-card-header > i,
    .document-card__icon,
    .document-file-reminder__icon,
    .module-lock__icon
) {
    background: #1a2b43 !important;
    border-color: #3a5274 !important;
}

html[data-theme="dark"] :is(
    .form-card-header,
    .form-actions
) {
    background: #132036 !important;
    border-color: #2a3a52 !important;
}

html[data-theme="dark"] :is(
    .detail-card__title,
    .form-section-title,
    .person-cell strong,
    .stacked-cell strong,
    .stacked-cell span
) {
    color: #edf3fc !important;
}

/* Conductores. */
html[data-theme="dark"] :is(
    .info-item,
    .timeline-content,
    .compact-empty,
    .document-fields
) {
    color: #e7edf7;
    background: #162338 !important;
    border-color: #30425d !important;
}

html[data-theme="dark"] .birthday-card {
    color: #e7edf7;
    background:
        radial-gradient(
            circle at 92% 90%,
            rgba(245, 158, 11, 0.14),
            transparent 9rem
        ),
        #171d2b !important;
    border-color: #4a3b27 !important;
}

html[data-theme="dark"] .summary-card__icon {
    background: color-mix(in srgb, currentColor 16%, #162338) !important;
}

/* Vencimientos: estados informativos con contraste semántico. */
html[data-theme="dark"] :is(
    .alert-row,
    .current-document,
    .file-control > label,
    .document-selector span,
    .vehicle-summary__details span
) {
    color: #dce6f3;
    background: #162338 !important;
    border-color: #30425d !important;
}

html[data-theme="dark"] :is(
    .current-document--expired,
    .document-alert--vence_hoy,
    .document-alert--vencido,
    .document-card--vencido,
    .document-card--faltante
) {
    color: #fca5a5;
    background: #321c27 !important;
    border-color: #7f3544 !important;
}

html[data-theme="dark"] :is(
    .document-card--por-vencer,
    .document-card--por_vencer,
    .document-card--vence-hoy
) {
    color: #fcd38d;
    background: #322719 !important;
    border-color: #74522b !important;
}

html[data-theme="dark"] :is(
    .document-card--vigente,
    .document-card.is-selected
) {
    background: #132a2b !important;
    border-color: #267469 !important;
}

/* Usuarios, cuenta personal y permisos. */
html[data-theme="dark"] :is(
    .information-list > div,
    .permission-card,
    .permission-tags span,
    .history-item__content,
    .permission-row,
    .permission-row.is-disabled,
    .permission-cell--na
) {
    color: #e7edf7;
    background: #162338 !important;
    border-color: #30425d !important;
}

html[data-theme="dark"] .permissions-screen .permissions-table tr,
html[data-theme="dark"] .permissions-screen .permissions-table td,
html[data-theme="dark"] .permissions-screen .permissions-table td:first-child {
    color: #dce6f3;
    background: #111c2e !important;
    border-color: #2a3a52 !important;
}

html[data-theme="dark"] .switch span::after {
    background: #dce6f3;
    border-color: #4c607c;
}

/*
 * Los checks necesitan tres lecturas distintas: disponible, seleccionado y
 * deshabilitado. Así el usuario reconoce de inmediato qué puede modificar.
 */
html[data-theme="dark"] .permission-check input:not(:disabled) + span {
    color: transparent;
    background: #162338 !important;
    border: 2px solid #607898 !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
}

html[data-theme="dark"] .permission-check input:not(:disabled) + span:hover {
    background: #1b2d48 !important;
    border-color: #8bb2ff !important;
}

html[data-theme="dark"] .permission-check input:checked + span {
    color: #ffffff !important;
    background: #2563eb !important;
    border-color: #75a1ff !important;
    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.2),
        0 6px 14px rgba(37, 99, 235, 0.23);
}

html[data-theme="dark"] .permission-check input:disabled + span {
    color: transparent;
    background: #263449 !important;
    border: 1px solid #40516a !important;
    opacity: 0.68;
}

html[data-theme="dark"] .permission-check input:checked:disabled + span {
    color: #a9b9cc !important;
    background: #35445a !important;
    border-color: #53657e !important;
    box-shadow: none;
}

html[data-theme="dark"] .permission-check input:focus-visible + span {
    outline-color: #8bb2ff;
}

/* Login, recuperación y creación de contraseña. */
html[data-theme="dark"] .auth-page {
    background:
        radial-gradient(
            circle at 8% 8%,
            rgba(37, 99, 235, 0.2),
            transparent 25rem
        ),
        radial-gradient(
            circle at 91% 85%,
            rgba(8, 145, 178, 0.14),
            transparent 26rem
        ),
        #09111f;
}

html[data-theme="dark"] :is(
    .auth-panel,
    .recovery-card,
    .security-note,
    .password-rules
) {
    color: #e7edf7;
    background: #111c2e !important;
    border-color: #2a3a52 !important;
}

html[data-theme="dark"] .auth-card {
    background: #111c2e;
    border-color: #2a3a52;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.32);
}

html[data-theme="dark"] .recovery-icon--success {
    color: #6ee7b7;
    background: #14342f;
    border-color: #27675b;
}

html[data-theme="dark"] .recovery-icon--danger {
    color: #fca5a5;
    background: #321c27;
    border-color: #7f3544;
}

html[data-theme="dark"] :is(
    .auth-header h1,
    .recovery-header h1,
    .form-field label,
    .security-note strong
) {
    color: #edf3fc;
}

html[data-theme="dark"] :is(
    .auth-header p,
    .recovery-header p,
    .field-help,
    .auth-copyright
) {
    color: #9aaac0;
}

html[data-theme="dark"] .mobile-brand {
    color: #edf3fc;
}

/* Modales y notificaciones. */
html[data-theme="dark"] :is(
    .app-modal,
    .modal,
    .modal__dialog,
    .modal-content,
    .app-confirm__dialog,
    .app-notification
) {
    color: #e7edf7;
    background: #111c2e !important;
    border-color: #30425d !important;
}

html[data-theme="dark"] .app-notification__close:hover {
    color: #fca5a5;
    background: #321c27;
}

html[data-theme="dark"] :is(
    .app-confirm__title,
    .app-notification__title,
    .modal__header h2
) {
    color: #edf3fc;
}

html[data-theme="dark"] :is(
    .app-confirm__message,
    .app-notification__message,
    .modal__notice
) {
    color: #aab8ca;
}

html[data-theme="dark"] .app-confirm__button--cancel {
    color: #c7d3e4;
    background: #162338 !important;
    border-color: #30425d !important;
}

html[data-theme="dark"] .app-footer {
    color: #7f91aa;
}

/* ==========================================================================
   Unificación de Modo Oscuro: Repuestos, Compras, Proveedores y Kardex / Tabs
   ========================================================================== */
html[data-theme="dark"] :is(.module-nav, .alert-scope-tabs) {
    background: #111c2e !important;
    border-color: #2a3a52 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25) !important;
}

html[data-theme="dark"] :is(.module-nav a, .alert-scope-tabs button) {
    color: #9aaac0 !important;
}

html[data-theme="dark"] :is(.module-nav a:hover, .alert-scope-tabs button:hover:not(.is-active)) {
    background: #162338 !important;
    color: #edf3fc !important;
}

html[data-theme="dark"] :is(.module-nav a.is-active, .alert-scope-tabs button.is-active) {
    background: #2563eb !important;
    color: #ffffff !important;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.35) !important;
}

html[data-theme="dark"] .alert-scope-tabs button:not(.is-active) span {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #9aaac0 !important;
}

html[data-theme="dark"] .alert-scope-tabs button.is-active span {
    background: rgba(255, 255, 255, 0.22) !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .summary-card::after {
    opacity: 0.14 !important;
}

html[data-theme="dark"] :is(
    .inventory-form,
    .purchase-line,
    .purchase-lines,
    .table-wrap,
    .provider-metrics > div,
    .stock-list > div,
    .cost-summary > div,
    .image-upload,
    .image-upload__preview,
    .row-editor > form,
    .detail-list div
) {
    border-color: #2a3a52 !important;
}

html[data-theme="dark"] .purchase-line {
    background: #141f31 !important;
}

html[data-theme="dark"] .purchase-total {
    border-color: #2a3a52 !important;
    color: #9aaac0 !important;
}

html[data-theme="dark"] .purchase-total strong {
    color: #10b981 !important;
}

html[data-theme="dark"] :is(
    .provider-metrics > div,
    .stock-list > div,
    .cost-summary > div
) {
    background: #162338 !important;
}

html[data-theme="dark"] .image-upload {
    background: #141f31 !important;
}

html[data-theme="dark"] .image-upload__preview {
    background: #111c2e !important;
    border-color: #30425d !important;
    color: #9aaac0 !important;
}

html[data-theme="dark"] .row-editor > form {
    background: #111c2e !important;
}

html[data-theme="dark"] .kardex-filter-label {
    color: #9aaac0 !important;
}

html[data-theme="dark"] :is(
    .kardex-filter-item input,
    .kardex-filter-item select,
    .kardex-filter-actions .button--secondary
) {
    background: #162338 !important;
    border-color: #30425d !important;
    color: #e7edf7 !important;
}

html[data-theme="dark"] :is(
    .kardex-filter-item input:focus,
    .kardex-filter-item select:focus
) {
    border-color: #6390f0 !important;
    box-shadow: 0 0 0 3px rgba(99, 144, 240, 0.2) !important;
}

html[data-theme="dark"] .searchable-select__trigger {
    background: #162338 !important;
    border-color: #30425d !important;
    color: #9aaac0 !important;
}

html[data-theme="dark"] .searchable-select__trigger.has-value {
    color: #e7edf7 !important;
}

html[data-theme="dark"] .searchable-select__panel {
    background: #111c2e !important;
    border-color: #2a3a52 !important;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .searchable-select__search input {
    background: #162338 !important;
    border-color: #30425d !important;
    color: #e7edf7 !important;
}

html[data-theme="dark"] .searchable-select__option {
    color: #e7edf7 !important;
}

html[data-theme="dark"] .searchable-select__option:hover,
html[data-theme="dark"] .searchable-select__option[aria-selected="true"] {
    background: #172a48 !important;
    color: #60a5fa !important;
}

html[data-theme="dark"] .searchable-select__empty {
    color: #9aaac0 !important;
}

html[data-theme="dark"] :is(
    .entity > i,
    .part-cell__placeholder
) {
    background: #172a48 !important;
    color: #60a5fa !important;
}

html[data-theme="dark"] .part-cell__image {
    background: #162338 !important;
    border-color: #2a3a52 !important;
}

html[data-theme="dark"] :is(
    .quantity-chip,
    .secure-chip,
    .error-count,
    .fuel-chip,
    .unit-badge,
    .type-chip,
    .movement-badge
) {
    background: #172a48 !important;
    color: #60a5fa !important;
}

html[data-theme="dark"] :is(
    .movement-badge.is-entry,
    .status-badge--registrado,
    .status-badge--activo,
    .stock-state.is-ok
) {
    background: #14342f !important;
    color: #34d399 !important;
}

html[data-theme="dark"] :is(
    .movement-badge.is-exit,
    .status-badge--anulado,
    .status-badge--no_operativo,
    .status-badge--desincorporado,
    .status-badge--inactivo,
    .status-badge--bloqueado,
    .stock-state.is-short
) {
    background: #321c27 !important;
    color: #f87171 !important;
}

html[data-theme="dark"] .status-badge--mantenimiento {
    background: #302719 !important;
    color: #fbbf24 !important;
}

html[data-theme="dark"] .detail-list div {
    border-bottom-color: #2a3a52 !important;
}

html[data-theme="dark"] .detail-list dt {
    color: #9aaac0 !important;
}

html[data-theme="dark"] .detail-list dd {
    color: #e7edf7 !important;
}


@media screen and (max-width: 760px) {
    .theme-switch--floating {
        top: 12px;
        right: 12px;
    }
}

/* La impresión siempre usa una base clara para ahorrar tinta y conservar PDF. */
@media print {
    .theme-switch,
    .app-topbar__theme-button {
        display: none !important;
    }

    html[data-theme="dark"],
    html[data-theme="dark"] body {
        color: #172033 !important;
        background: #ffffff !important;
    }

    html[data-theme="dark"] :is(
        .content-card,
        .detail-card,
        .profile-hero,
        .detail-hero,
        .summary-card,
        .management-card,
        .info-item,
        .detail-item,
        .document-card,
        .information-list > div,
        table,
        th,
        td
    ) {
        color: #172033 !important;
        background: #ffffff !important;
        border-color: #dce5f0 !important;
        box-shadow: none !important;
    }
}
