html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

/* Marivent template — forzar paleta Mud (evitar morado / fondos oscuros) */
:root {
    --mud-palette-primary: #00bfa5;
    --mud-palette-primary-rgb: 0, 191, 165;
    --mud-palette-primary-text: #ffffff;
    --mud-palette-primary-darken: #0f766e;
    --mud-palette-primary-lighten: #5eead4;
    --mud-palette-secondary: #0f766e;
    --mud-palette-secondary-rgb: 15, 118, 110;
    --mud-palette-secondary-text: #ffffff;
    --mud-palette-tertiary: #14b8a6;
    --mud-palette-tertiary-text: #ffffff;
    --mud-palette-success: #00bfa5;
    --mud-palette-info: #38bdf8;
    --mud-palette-warning: #f59e0b;
    --mud-palette-error: #ef4444;
    --mud-palette-dark: #1f2a37;
    --mud-palette-dark-text: #ffffff;
    --mud-palette-action-default: #0f766e;
    --mud-palette-text-primary: #1f2a37;
    --mud-palette-text-secondary: #6b7280;
    --mud-palette-background: #f7f8f9;
    --mud-palette-surface: #ffffff;
    --mud-palette-drawer-icon: #0f766e;
    --mud-palette-lines-inputs: #d1d5db;
    --mud-palette-divider: #e5e7eb;
    --mud-palette-table-lines: #e5e7eb;
    --mud-palette-table-striped: #f8fafb;
    --mud-palette-table-hover: #f0fdfa;
    --mud-palette-overlay-dark: rgba(15, 39, 68, 0.45);
}

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,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaG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yNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #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;
}

/* Listas Mud solo en popovers (autocomplete / select) — no tocar tablas */
.mud-popover .mud-list {
    background: #ffffff !important;
    color: #1f2a37 !important;
}

.mud-popover .mud-list-item {
    color: #1f2a37 !important;
    background: transparent !important;
}

.mud-popover .mud-list-item:hover,
.mud-popover .mud-list-item.mud-selected-item {
    background: #ecfdf5 !important;
    color: #0f766e !important;
}

/* Tablas Mud siempre claras */
.mud-table,
.mud-table-container,
.mud-table-root,
.mud-table .mud-table-body,
.mud-table .mud-table-row,
.mud-table .mud-table-cell,
.mud-table .mud-table-empty-row,
.mud-table tbody,
.mud-table td,
.mud-table th {
    background-color: #ffffff !important;
    color: #1f2a37 !important;
}

.mud-table .mud-table-head .mud-table-cell,
.mud-table thead .mud-table-cell {
    background-color: #fafbfc !important;
    color: #6b7280 !important;
}

.mud-table-hover .mud-table-body .mud-table-row:hover,
.mud-table-hover .mud-table-body .mud-table-row:hover > .mud-table-cell {
    background-color: #f0fdfa !important;
}

.mud-button-outlined-primary {
    color: #0f766e !important;
    border-color: #00bfa5 !important;
}

.mud-button-text-primary {
    color: #0f766e !important;
}

.mud-button-filled-primary {
    background-color: #00bfa5 !important;
    color: #ffffff !important;
}

.mud-chip.mud-chip-color-primary.mud-chip-filled {
    background-color: #00bfa5 !important;
    color: #ffffff !important;
}

.mud-input-control > .mud-input-control-input-container > div.mud-input.mud-input-outlined:focus-within .mud-input-outlined-border,
.mud-input.mud-input-outlined:not(.mud-disabled):hover .mud-input-outlined-border,
.mud-input.mud-input-outlined:focus-within .mud-input-outlined-border {
    border-color: #00bfa5 !important;
}

/* —— Formularios (.mv-form): labels arriba + inputs/selects redondeados —— */
.mv-form,
.inv-dialog-form {
    --mv-input-radius: 0.65rem;
    --mv-input-border: #e5e7eb;
    --mv-input-border-hover: #cbd5e1;
    --mv-label: #374151;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding-top: 0.2rem;
}

.mv-form-row,
.inv-dialog-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    align-items: start;
}

.mv-form-row:has(> :nth-child(3)),
.inv-dialog-row:has(> :nth-child(3)) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mv-form .mud-input-control,
.inv-dialog-form .mud-input-control {
    margin: 0 !important;
}

/* Label siempre arriba (estilo referencia) */
.mv-form .mud-input-control > .mud-input-control-input-container,
.inv-dialog-form .mud-input-control > .mud-input-control-input-container {
    position: relative;
    padding-top: 1.4rem;
    margin-top: 0;
}

.mv-form .mud-input-label.mud-input-label-inputcontrol,
.inv-dialog-form .mud-input-label.mud-input-label-inputcontrol,
.mv-form .mud-input-label.mud-input-label-outlined,
.inv-dialog-form .mud-input-label.mud-input-label-outlined {
    color: var(--mv-label) !important;
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    letter-spacing: 0;
    line-height: 1.2;
    transform: none !important;
    top: 0 !important;
    left: 0 !important;
    right: auto !important;
    padding: 0 !important;
    max-width: 100% !important;
    background: transparent !important;
    pointer-events: none;
    z-index: 1;
}

.mv-form .mud-input-label.mud-input-label-inputcontrol.mud-input-label-inputfocused,
.inv-dialog-form .mud-input-label.mud-input-label-inputcontrol.mud-input-label-inputfocused,
.mv-form .mud-input-label.mud-input-label-outlined.mud-input-label-inputfocused,
.inv-dialog-form .mud-input-label.mud-input-label-outlined.mud-input-label-inputfocused,
.mv-form .mud-input-label.mud-shrink,
.inv-dialog-form .mud-input-label.mud-shrink {
    color: var(--mv-label) !important;
    transform: none !important;
    top: 0 !important;
}

/* Asterisco requerido en teal */
.mv-form .mud-input-required:after,
.inv-dialog-form .mud-input-required:after,
.mv-form .mud-input-label-asterisk,
.inv-dialog-form .mud-input-label-asterisk {
    color: #00bfa5 !important;
}

/* Sin “notch” del outlined (label ya no va en el borde) */
.mv-form .mud-notched-outline-notch,
.inv-dialog-form .mud-notched-outline-notch {
    display: none !important;
}

.mv-form .mud-input-outlined .mud-notched-outline legend,
.inv-dialog-form .mud-input-outlined .mud-notched-outline legend {
    width: 0 !important;
    padding: 0 !important;
    max-width: 0 !important;
}

/* Caja del input / select / autocomplete */
.mv-form .mud-input.mud-input-outlined,
.inv-dialog-form .mud-input.mud-input-outlined {
    background: #fff;
}

.mv-form .mud-input.mud-input-outlined .mud-input-outlined-border,
.inv-dialog-form .mud-input.mud-input-outlined .mud-input-outlined-border {
    border-radius: var(--mv-input-radius) !important;
    border-width: 1px !important;
    border-color: var(--mv-input-border) !important;
}

.mv-form .mud-input.mud-input-outlined:not(.mud-disabled):hover .mud-input-outlined-border,
.inv-dialog-form .mud-input.mud-input-outlined:not(.mud-disabled):hover .mud-input-outlined-border {
    border-color: var(--mv-input-border-hover) !important;
}

.mv-form .mud-input.mud-input-outlined:focus-within .mud-input-outlined-border,
.inv-dialog-form .mud-input.mud-input-outlined:focus-within .mud-input-outlined-border {
    border-color: #00bfa5 !important;
}

.mv-form .mud-input.mud-input-outlined.mud-input-adorned-end,
.inv-dialog-form .mud-input.mud-input-outlined.mud-input-adorned-end {
    padding-inline-end: 0.35rem;
}

.mv-form .mud-input.mud-input-outlined .mud-input-slot,
.inv-dialog-form .mud-input.mud-input-outlined .mud-input-slot,
.mv-form .mud-input.mud-input-outlined input.mud-input-slot,
.inv-dialog-form .mud-input.mud-input-outlined input.mud-input-slot {
    padding: 0.7rem 0.9rem !important;
    min-height: 1.25rem;
    font-size: 0.9rem !important;
    color: #1f2a37;
}

.mv-form .mud-input.mud-input-outlined textarea.mud-input-slot,
.inv-dialog-form .mud-input.mud-input-outlined textarea.mud-input-slot {
    padding: 0.7rem 0.9rem !important;
    font-size: 0.9rem !important;
}

.mv-form .mud-input.mud-input-outlined .mud-input-slot::placeholder,
.inv-dialog-form .mud-input.mud-input-outlined .mud-input-slot::placeholder,
.mv-form .mud-input.mud-input-outlined input::placeholder,
.inv-dialog-form .mud-input.mud-input-outlined input::placeholder {
    color: #9ca3af !important;
    opacity: 1;
}

/* Selects / autocomplete: misma caja + chevron */
.mv-form .mud-select,
.inv-dialog-form .mud-select,
.mv-form .mud-autocomplete,
.inv-dialog-form .mud-autocomplete,
.mv-form .mud-picker,
.inv-dialog-form .mud-picker {
    margin: 0;
}

.mv-form .mud-select .mud-input-adornment,
.inv-dialog-form .mud-select .mud-input-adornment,
.mv-form .mud-autocomplete .mud-input-adornment,
.inv-dialog-form .mud-autocomplete .mud-input-adornment {
    color: #9ca3af;
}

.mv-form .mud-input.mud-disabled .mud-input-outlined-border,
.inv-dialog-form .mud-input.mud-disabled .mud-input-outlined-border,
.mv-form .mud-input.mud-input-readonly .mud-input-outlined-border,
.inv-dialog-form .mud-input.mud-input-readonly .mud-input-outlined-border {
    border-color: #e5e7eb !important;
    background: #f3f4f6;
}

.mv-form .mud-input.mud-disabled .mud-input-slot,
.inv-dialog-form .mud-input.mud-disabled .mud-input-slot,
.mv-form .mud-input.mud-input-readonly .mud-input-slot,
.inv-dialog-form .mud-input.mud-input-readonly .mud-input-slot,
.mv-form .mud-input.mud-disabled input.mud-input-slot,
.inv-dialog-form .mud-input.mud-disabled input.mud-input-slot,
.mv-form .mud-input.mud-input-readonly input.mud-input-slot,
.inv-dialog-form .mud-input.mud-input-readonly input.mud-input-slot {
    color: #1f2a37 !important;
    -webkit-text-fill-color: #1f2a37 !important;
    opacity: 1 !important;
    font-weight: 600;
}

.mv-form .mud-input-control-helper-container,
.inv-dialog-form .mud-input-control-helper-container {
    margin: 0.2rem 0.15rem 0;
}

.mv-form .mud-input-helper-text,
.inv-dialog-form .mud-input-helper-text {
    font-size: 0.72rem;
    line-height: 1.25;
    color: #6b7280;
}

.mv-field .mud-input-label,
.inv-field .mud-input-label {
    font-weight: 600;
}

.mv-hint {
    margin: -0.25rem 0 0;
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    line-height: 1.3;
}

@media (max-width: 640px) {
    .mv-form-row,
    .mv-form-row:has(> :nth-child(3)),
    .inv-dialog-row,
    .inv-dialog-row:has(> :nth-child(3)) {
        grid-template-columns: 1fr !important;
    }
}
