/* Fondo de página: no depende de Tailwind dark: (SSR + islas WASM) */
html,
body {
    min-height: 100%;
    margin: 0;
}

html {
    background-color: #f9fafb;
}

html.dark {
    background-color: #1a1a27;
}

html.dark body {
    background-color: #1a1a27 !important;
}

body {
    background-color: inherit;
}

/* Shell del portal: mismo color que html en claro/oscuro (sobrescribe Mud si hace falta) */
.fd-app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f9fafb;
}

html.dark .fd-app-shell {
    background-color: #1a1a27;
}

.fd-app-main {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    background-color: #f9fafb;
}

html.dark .fd-app-main {
    background-color: #1a1a27;
}

/* MudBlazor en portal oscuro (tabs, tablas, expansion panels) */
html.dark .fd-portal-tabs .mud-tabs-tabbar {
    background-color: #1a1a27;
    border-bottom: 1px solid #374151;
}

html.dark .fd-portal-tabs .mud-tab.mud-tab-active {
    color: #ff5d00;
}

html.dark .fd-portal-tabs .mud-tab:not(.mud-tab-active) {
    color: #9ca3af;
}

html.dark .fd-portal-tabs .mud-tabs-panels {
    background-color: #232333;
}

html.dark .fd-portal-expansion .mud-expand-panel {
    background-color: #232333;
    color: #eceff1;
}

html.dark .fd-portal-expansion .mud-expand-panel-header {
    background-color: #1a1a27;
}

html.dark .fd-portal-expansion .mud-expand-panel-content {
    background-color: #232333;
}

html.dark .fd-portal-table .mud-table-root {
    color: #e5e7eb;
}

html.dark .fd-portal-table .mud-table-head .mud-table-cell {
    color: #cbd5e1;
}

html.dark .fd-portal-table .mud-table-body .mud-table-cell {
    color: #e5e7eb;
}

html.dark .fd-portal-tabs .mud-input-input,
html.dark .fd-portal-tabs .mud-input-slot input,
html.dark .fd-portal-tabs input.mud-input-slot,
html.dark .fd-portal-tabs .mud-input > input {
    color: #f3f4f6 !important;
    -webkit-text-fill-color: #f3f4f6 !important;
}

html.dark .fd-portal-tabs .mud-input-label {
    color: #d1d5db !important;
}

html.dark .fd-portal-tabs .mud-input-adornment {
    color: #94a3b8 !important;
}

html.dark .fd-portal-tabs .mud-input-input::placeholder,
html.dark .fd-portal-tabs .mud-input-slot input::placeholder,
html.dark .fd-portal-tabs .mud-input > input::placeholder {
    color: #94a3b8 !important;
    opacity: 1;
}

html.dark .fd-profile-page .mud-input-input,
html.dark .fd-profile-page .mud-input-slot input,
html.dark .fd-profile-page .mud-input > input,
html.dark .fd-dialog-form .mud-input-input,
html.dark .fd-dialog-form .mud-input-slot input,
html.dark .fd-dialog-form .mud-input > input {
    color: #f3f4f6 !important;
    -webkit-text-fill-color: #f3f4f6 !important;
}

html.dark .fd-profile-page .mud-input-label,
html.dark .fd-dialog-form .mud-input-label {
    color: #d1d5db !important;
}

html.dark .fd-profile-page .mud-input-adornment,
html.dark .fd-dialog-form .mud-input-adornment {
    color: #94a3b8 !important;
}

html.dark .fd-profile-page .mud-input-input::placeholder,
html.dark .fd-profile-page .mud-input-slot input::placeholder,
html.dark .fd-profile-page .mud-input > input::placeholder,
html.dark .fd-dialog-form .mud-input-input::placeholder,
html.dark .fd-dialog-form .mud-input-slot input::placeholder,
html.dark .fd-dialog-form .mud-input > input::placeholder {
    color: #94a3b8 !important;
    opacity: 1;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxsaW5rIiBvdmVyZmxvdz0iaGlkZGVuIj48ZGVmcz48Y2xpcFBhdGggaWQ9ImNsaXAwIj48cmVjdCB4PSIyMzUiIHk9IjUxIiB3aWR0aD0iNTYiIGhlaWdodD0iNDkiLz48L2NsaXJQYXRoPjwvZGVmcz48ZyBjbGlwLXBhdGg9InVybC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em, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

html.dark .mud-select-dark-mode .mud-input-base-input, /* Texto del MudSelect */
html.dark .mud-select-dark-mode .mud-input-label, /* Etiqueta del MudSelect */
html.dark .mud-select-dark-mode .mud-input-adornment.mud-input-adornment-end.mud-icon-button { /* Icono de flecha del MudSelect */
    color: #fff !important;
}

html.dark .mud-select-dark-mode .mud-input-slot,
html.dark .mud-select-dark-mode .mud-select-input,
html.dark .mud-select-dark-mode input {
    color: #f3f4f6 !important;
    -webkit-text-fill-color: #f3f4f6 !important;
}

html.dark .mud-select-dark-mode .mud-list.mud-list-dense.mud-list-padding { /* Fondo del dropdown del MudSelect */
    background-color: #1a1a27 !important;
}

html.dark .mud-select-dark-mode .mud-list-item-text, /* Texto de las opciones del dropdown */
html.dark .mud-select-dark-mode .mud-list-item.mud-selected .mud-list-item-text, /* Texto de la opción seleccionada */
html.dark .mud-select-dark-mode .mud-list-item.mud-hover:hover .mud-list-item-text { /* Texto de la opción al pasar el mouse */
    color: #fff !important;
}

html.dark .mud-select-dark-mode .mud-list-item.mud-selected { /* Fondo de la opción seleccionada */
    background-color: #374151 !important;
}

html.dark .mud-select-dark-mode .mud-list-item.mud-hover:hover { /* Fondo de la opción al pasar el mouse */
    background-color: #374151 !important;
}

html.dark .fd-perm-switch .mud-switch-label {
    color: #e5e7eb !important;
    opacity: 1 !important;
}

html.dark .fd-perm-switch .mud-switch-label .mud-typography {
    color: #e5e7eb !important;
}

html.dark .fd-perm-switch.mud-disabled .mud-switch-label {
    color: #9ca3af !important;
}

.fd-perm-switch-text {
    color: #374151;
    font-weight: 500;
}

html.dark .fd-perm-switch-text {
    color: #e5e7eb !important;
}