html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

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,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) 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;
}

/* Estilo personalizado para elementos seleccionados en conciliación */
.list-group-item.reconciliation-selected {
    background-color: #e6f3ff !important;
    border-color: #b8daff !important;
    color: #0c5460 !important;
}

/* === Estilos para el Nuevo Panel de Filtros === */
.filter-container {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-bar {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-box {
    flex-grow: 1;
}

.filter-icon.active {
    background-color: var(--accent-fill-rest);
    color: white;
}

.filter-icon .fluent-icon {
    font-size: 18px; /* Ajusta el tamaño del ícono si es necesario */
}

.filter-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1040; /* Debajo del panel pero encima del resto */
}

.filter-panel {
    position: absolute;
    top: calc(100% + 5px); /* Un poco debajo de la barra de búsqueda */
    left: 0;
    width: 100%;
    background-color: var(--neutral-layer-1);
    border: 1px solid var(--neutral-stroke-rest);
    border-radius: var(--control-corner-radius);
    padding: 16px;
    box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.14);
    z-index: 1050;
    animation: fadeIn 0.2s ease-out;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    align-items: end;
}

    .filter-grid label {
        font-size: 0.875rem;
        margin-bottom: 4px;
        display: block;
    }

.switch-container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-bottom: 8px; /* Alinear con los otros inputs */
}

.filter-panel-footer {
    border-top: 1px solid var(--neutral-stroke-divider-rest);
    margin-top: 16px;
    padding-top: 16px;
    text-align: right;
}

.applied-filters {
    font-size: 0.8rem;
    color: var(--neutral-foreground-hint);
    margin-top: 8px;
    padding-left: 4px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.applied-filters-summary {
    /* Reduce el tamaño de la letra a la mitad */
    font-size: 50%;
    /* Define el color del texto como negro (0,0,0) con una opacidad del 70% (0.7) */
    color: rgba(0, 0, 0, 0.7);
    /* Añade un margen de 20 píxeles a la izquierda para mover el texto a la derecha */
    margin-left: 10px;
}

    .applied-filters-summary strong {
        /* Mantiene el texto sin negrita */
        font-weight: normal;
    }

.btn-action {
    color: #333; /* Color del icono (negro al 80% aprox.) */
    border: 1px solid #ddd; /* Un borde sutil */
    transition: background-color 0.2s ease-in-out; /* Transición suave para el hover */
}

/* Color específico para el botón EDITAR */
.btn-action-edit {
    background-color: #e3f2fd; /* Azul pastel claro */
}

    .btn-action-edit:hover {
        background-color: #bbdefb; /* Azul pastel un poco más oscuro */
    }

/* Color específico para el botón REGLA (varita mágica) */
.btn-action-rule {
    background-color: #e0f7fa; /* Cian pastel claro */
}

    .btn-action-rule:hover {
        background-color: #b2ebf2; /* Cian pastel un poco más oscuro */
    }

/* Color específico para el botón ELIMINAR */
.btn-action-delete {
    background-color: #ffebee; /* Rojo pastel claro */
}

    .btn-action-delete:hover {
        background-color: #ffcdd2; /* Rojo pastel un poco más oscuro */
    }

/* Color específico para botones de ADVERTENCIA (ej. Desvincular) */
.btn-action-warning {
    background-color: #fffde7; /* Amarillo pastel muy claro */
}

    .btn-action-warning:hover {
    background-color: #fff9c4; /* Amarillo pastel un poco más oscuro */
}

/* === Correccion para dropdown de categorias en modal === */
.modal .fluent-select-listbox,
.modal .fluent-listbox {
    z-index: 1060 !important; /* Mayor que el z-index del modal Bootstrap (1050) */
}

/* Correccion para FluentSelect popover */
.modal fluent-popover {
    z-index: 1060 !important;
}

/* Asegurar que los dropdowns de FluentUI aparezcan sobre modales */
.fluent-popover,
.fluent-listbox,
.fluent-select-listbox {
    z-index: 1060 !important;
}

/* Estilo especifico para categorias multiselect dropdown */
.modal .multiselect-dropdown {
    z-index: 1061 !important; /* Aun mayor para asegurar visibilidad */
}

/* === Ajustes Móviles (Mobile-First) === */
@media (max-width: 767.98px) {
    .content {
        padding-top: 0.5rem;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    /* Hacer que todas las tablas tengan scroll horizontal suave en movil */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
        margin-bottom: 1rem;
        border: 0;
    }

    /* Aumentar area táctil de botones en tablas */
    .btn-group .fluent-button {
        min-height: 40px;
        min-width: 40px;
    }

    h1 {
        font-size: 1.5rem;
    }
}

/* Cabecera pegajosa para formularios móviles */
.mobile-page-header {
    position: sticky;
    top: 3.5rem; /* Debajo del top-row */
    z-index: 1020;
    background-color: var(--neutral-layer-1);
    padding: 0.75rem 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--neutral-stroke-divider-rest);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-back-btn {
    font-size: 1.25rem;
    color: var(--neutral-foreground-rest);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== Utilidades para Responsivo: Ocultar Columnas en Móvil ===== */
@media (max-width: 767.98px) {
    .hide-on-mobile {
        display: none !important;
    }

    /* Ajustes para tarjetas (Cards) que reemplazan grillas en móvil */
    .mobile-card-list .card {
        margin-bottom: 0.75rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }

    /* Fijar botones de guardado al fondo en pantallas pequeñas */
    .mobile-sticky-bottom {
        position: fixed !important;
        bottom: 0;
        left: 0;
        right: 0;
        background-color: white;
        padding: 1rem;
        box-shadow: 0 -4px 10px rgba(0,0,0,0.1);
        z-index: 1030;
    }
}

/* En escritorio, el sticky-bottom se comporta como relative para no estorbar */
@media (min-width: 768px) {
    .mobile-sticky-bottom {
        position: relative !important;
        box-shadow: none;
        padding: 1rem 0 0 0;
        border-top: 1px solid var(--neutral-stroke-divider-rest);
        margin-top: 1rem;
    }
}

/* === 2.1 FluentDialog Full-Screen en móvil === */
@media (max-width: 767.98px) {
    fluent-dialog::part(dialog) {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }
}

/* === 4.3 Reducir padding en celdas de tablas en móvil === */
@media (max-width: 767.98px) {
    .table td, .table th {
        padding: 0.35rem 0.4rem;
    }

    .btn-group .fluent-button,
    .btn-group fluent-button {
        padding: 0.2rem;
        min-width: 32px;
        min-height: 32px;
    }

    /* Para FluentDataGrid */
    fluent-data-grid-cell {
        padding: 0.3rem 0.25rem !important;
    }
}

/* === 4.2 TransactionFilterPanel — Vista móvil === */
.filter-mobile {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.filter-mobile-row {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.filter-mobile-search {
    flex: 1;
    min-width: 0;
}

.filter-mobile-half {
    flex: 1;
    min-width: 0;
}

.filter-mobile-summary {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    color: var(--neutral-foreground-hint);
}

.filter-mobile-summary span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* === 1.0 Card list de transacciones (solo móvil) === */
.transaction-card-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.transaction-card {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--neutral-stroke-divider-rest);
    background-color: white;
}

.transaction-card.no-category {
    background-color: #fff5f5;
}

.transaction-card-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.15rem;
}

.transaction-card-date {
    font-size: 0.75rem;
    color: var(--neutral-foreground-hint);
}

.transaction-card-amount {
    font-weight: 600;
    font-size: 1rem;
}

.transaction-card-desc {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.transaction-card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.transaction-card-category {
    flex: 1;
}

.transaction-card-actions {
    display: flex;
    gap: 0;
}

.transaction-card-total {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0.75rem;
    font-weight: bold;
    border-top: 2px solid var(--neutral-stroke-divider-rest);
    background-color: #f9f9f9;
}
