﻿/* Arus2 — base y compatibilidad de pantallas todavía no migradas.
   theme.css es la autoridad de variables. Los nuevos controles optan al estándar
   mediante .arus-ui y design-system.css; no colocar .arus-ui en MainLayout aún.
   Mantener los selectores históricos hasta migrar y verificar sus consumidores. */

html {
    font-size: 16px;
}



body {
    background-color: var(--color-fondo);
    color: var(--color-texto);
    font-size: 0.875rem;
}

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: 0rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.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."
    }

.status-bar-safe-area {
    display: none;
}

@supports (-webkit-touch-callout: none) {
    .status-bar-safe-area {
        display: flex;
        position: sticky;
        top: 0;
        height: env(safe-area-inset-top);
        background-color: #f7f7f7;
        width: 100%;
        z-index: 1;
    }

    .flex-column, .navbar-brand {
        padding-left: env(safe-area-inset-left);
    }
}

.navbar-brand {
    margin-right: 0rem;
}

/*ARITUCLOS*/
/* --- Arus2 Design System --- */

h3 {
    color: var(--color-texto);
    font-weight: 600;
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
    letter-spacing: -0.02em;
}

h5 {
    color: var(--color-texto);
    font-weight: 600;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.card {
    background-color: var(--color-superficie);
    border: 1px solid var(--color-borde);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

label {
    color: var(--color-texto-secundario);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: block;
}

/* Inputs y Selects */
.form-control, .form-select {
    background-color: var(--input-bg);
    border: 1px solid var(--color-borde);
    color: var(--color-texto);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

    .form-control:focus, .form-select:focus {
        border-color: var(--color-acento);
        box-shadow: 0 0 0 4px var(--input-focus-ring);
        outline: none;
    }

/* Botones */
.btn {
    font-weight: 500;
    border-radius: 8px;
    padding: 0.6rem 1.2rem;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background-color: var(--color-acento);
    color: #ffffff;
}

    .btn-primary:hover {
        background-color: var(--color-acento-hover);
        transform: translateY(-1px);
    }

.btn-success {
    background-color: #10b981;
    color: white;
}
/* Verde tipo Arus */



/*** Buscador ****/

.search-container {
    position: relative;
}

/*.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 1050;
    max-height: 250px;
    overflow-y: auto;
    background: var(--color-superficie);
    border: 1px solid var(--color-borde);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}*/

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: white;
    border-radius: 8px;
    max-height: 250px;
    overflow-y: auto;
}

/* 4. Los items de la lista */
.search-item {
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #1e293b;
    transition: background 0.2s;
    display: flex;
    flex-direction: column; /* RFC arriba, Nombre abajo para mejor lectura */
    gap: 2px;
}

    .search-item:hover {
        background: #f1f5f9;
        color: var(--bs-primary);
    }

    .search-item .item-rfc {
        font-family: 'Monaco', 'Consolas', monospace;
        font-size: 0.7rem;
        font-weight: 700;
        color: #94a3b8;
    }

    .search-item:hover .item-rfc {
        color: var(--bs-primary);
    }
/*************/

/* Fix para los botones de búsqueda (bordes visibles siempre) */
.btn-outline-secondary {
    border: 1px solid var(--color-borde) !important;
    background-color: var(--color-superficie);
    color: var(--color-texto-secundario);
}

    .btn-outline-secondary:hover {
        border-color: var(--color-acento) !important;
        background-color: var(--input-focus-ring);
    }

/******************/

.btn-custom {
    border: 1px solid #dee2e6 !important; /* Gris claro */
    color: #adb5bd !important; /* Texto gris claro */
    border-radius: 0.375rem !important; /* Forzamos redondeado en todas las esquinas */
    background-color: transparent;
}

    /* Al pasar el mouse (hover) opcionalmente podemos dar un tono un poco más oscuro */
    .btn-custom:hover {
        border-color: #ced4da !important;
        color: #6c757d !important;
    }

/* Cuando el radio button está seleccionado (checked), activamos el color de Bootstrap */
.btn-check:checked + .btn-outline-warning {
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
    color: #000 !important;
}

.btn-check:checked + .btn-outline-info {
    background-color: #0dcaf0 !important;
    border-color: #0dcaf0 !important;
    color: #000 !important;
}

.btn-check:checked + .btn-outline-success {
    background-color: #198754 !important;
    border-color: #198754 !important;
    color: #fff !important;
}

/* Estilo base para los botones de filtro (no seleccionados) */
.btn-filter-custom {
    border: 1px solid #dee2e6 !important; /* Borde gris claro */
    color: #adb5bd !important; /* Texto gris claro */
    border-radius: 0.375rem !important; /* Forzamos bordes en todas las esquinas */
    background-color: transparent !important;
    transition: all 0.2s ease;
}

    .btn-filter-custom:hover {
        border-color: #ced4da !important;
        color: #6c757d !important;
    }

/* Estados Activos: Cuando Blazor añade la clase active-xxx */

.active-all {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #fff !important;
}

.active-warning {
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
    color: #000 !important;
}

.active-info {
    background-color: #0dcaf0 !important;
    border-color: #0dcaf0 !important;
    color: #000 !important;
}

.active-success {
    background-color: #198754 !important;
    border-color: #198754 !important;
    color: #fff !important;
}

/* Definición del color morado personalizado */
.btn-outline-purple {
    border-color: #6f42c1;
    color: #6f42c1;
}

/* Estado seleccionado para el botón de radio */
.btn-check:checked + .btn-outline-purple {
    background-color: #6f42c1 !important;
    border-color: #6f42c1 !important;
    color: #fff !important;
}

/* Clases de utilidad para el borde y texto del "cuadradito" lateral */
.border-purple {
    border-color: #6f42c1 !important;
}

.text-purple {
    color: #6f42c1 !important;
}

/* Si lo usas también en la barra de filtros */
.active-purple {
    background-color: #6f42c1 !important;
    border-color: #6f42c1 !important;
    color: #fff !important;
}

.bg-purple {
    background-color: #6f42c1 !important;
    color: #ffffff !important;
}

/* Badge más redondeado */
.badge {
    padding: 0.5em 0.8em;
    font-weight: 500;
}

/* Cuando el radio de moneda está seleccionado */
.btn-check:checked + .btn-outline-primary {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    color: #fff !important;
}

/* Cuando el radio de fecha está seleccionado */
.btn-check:checked + .btn-outline-secondary {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #fff !important;
}

/* Estilo específico para sección de administración */
.btn-admin-small {
    padding: 0.25rem 0.5rem; /* Ajuste manual de espacio interno */
    font-size: 0.8rem; /* Fuente un poco más pequeña */
    min-width: 80px; /* Opcional: para que todos tengan un ancho mínimo similar */
}

/* Estado deseleccionado (Por defecto) */
.btn-outline-muted {
    color: #6c757d; /* Gris estándar de Bootstrap */
    border: 1px solid #dee2e6; /* Borde delgado y clarito */
    background-color: white;
    transition: all 0.2s; /* Suaviza el cambio de color */
}

    /* Estado cuando el mouse pasa por encima (Hover) */
    .btn-outline-muted:hover {
        background-color: #f8f9fa;
        color: #495057;
        border-color: #ced4da;
    }

/* ESTADO SELECCIONADO: Cuando el radio está checkeado, 
   el label que sigue (+) se vuelve azul (primary) */
.btn-check:checked + .btn-outline-muted {
    color: #fff;
    background-color: #0d6efd; /* Azul Primary */
    border-color: #0d6efd;
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.2); /* Opcional: un poco de sombra */
}

/* Color Púrpura para Pedidos */
.bg-purple {
    background-color: #6f42c1 !important;
}

.btn-outline-purple {
    color: #6f42c1;
    border-color: #6f42c1;
}

    .btn-outline-purple:hover {
        background-color: #6f42c1;
        color: white;
    }

/* Opcional: Borde para el card de trazabilidad cuando es Pedido */
.border-purple {
    border-color: #6f42c1 !important;
}

.text-purple {
    color: #6f42c1 !important;
}

.custom-table td {
    transition: color 0.3s ease, background-color 0.3s ease;
}

/* Clase para forzar el borde de 1px */
.btn-price-adjust {
    border: 1px solid !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem 0.75rem; /* Ajuste estándar de Bootstrap */
    transition: all 0.2s ease-in-out;
    border-color: #dee2e6;
}

    /* Opcional: Un ligero cambio de color al pasar el mouse para que se sienta interactivo */
    .btn-price-adjust:hover {
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

.help-tooltip-container {
    position: relative;
    display: inline-block;
    cursor: help;
}

.help-popover-content {
    display: none;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    color: #333;
    padding: 12px;
    border-radius: 8px;
    width: 200px;
    z-index: 1000;
}

    /* Triángulo del popover */
    .help-popover-content::after {
        content: "";
        position: absolute;
        top: 100%;
        left: 50%;
        margin-left: -5px;
        border-width: 5px;
        border-style: solid;
        border-color: white transparent transparent transparent;
    }

/* Mostrar al hacer hover */
.help-tooltip-container:hover .help-popover-content {
    display: block;
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* MODIFICADO: Estructura de la barra superior */
.top-bar-container {
    position: relative; /* ESTO ES VITAL */
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px; /* Asegúrate de que tenga un alto definido */
    padding: 0 1.5rem;
    background-color: var(--bg-topbar);
    z-index: 100; /* Para que esté por encima del contenido */
}

/* ALINEACIÓN HORIZONTAL DE LOS BLOQUES */
.top-bar-left, .top-bar-right, .context-info, .user-profile {
    display: flex; /* La clave para que no aparezcan en vertical */
    align-items: center;
}

.top-bar-center {
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    /* Estado contraído: Solo mostramos el icono como un botón */
    .search-wrapper {
        background: transparent !important;
        border: none;
        width: auto !important;
    }

    .search-icon {
        cursor: pointer;
        font-size: 1.2rem;
        padding: 8px;
        background: var(--bg-secondary); /* O el color de tus botones */
        border-radius: 50%;
    }

    /* Estado expandido: Se vuelve absoluto y cubre la barra */
    .top-bar-center.expanded {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%; /* Ahora medirá el 100% de los 64px del padre */
        background: var(--bg-topbar);
        display: flex;
        align-items: center;
        padding: 0 1rem;
        z-index: 101; /* Un nivel arriba de los otros elementos de la barra */
    }

        .top-bar-center.expanded .search-wrapper {
            width: 100% !important;
            background: var(--bg-input);
            border: 1px solid var(--border-color);
            display: flex;
            padding: 5px 15px;
            border-radius: 12px;
            margin: 0;
        }

    .search-input.visible {
        display: block !important;
        width: 100%;
    }
}

/* SECCIÓN IZQUIERDA: Toggle y Breadcrumbs 
.breadcrumbs {
    font-size: 0.9rem;
    color: var(--bs-gray-600);
}*/

.breadcrumbs {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
}

    .breadcrumbs a:hover {
        color: var(--bs-primary) !important;
        text-decoration: underline !important;
    }

    .breadcrumbs span.fw-bold {
        letter-spacing: -0.3px;
    }

/* SECCIÓN CENTRAL: Buscador */
.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(150, 150, 150, 0.1);
    border-radius: 8px;
    padding: 0.4rem 0.8rem;
    width: 350px;
    transition: all 0.2s;
}

.search-input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    margin-left: 8px;
    font-size: 0.9rem;
}

.search-wrapper:focus-within {
    background: rgba(150, 150, 150, 0.15);
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.2);
}




.search-shortcut {
    border: 1px solid rgba(0,0,0,0.15);
    background: var(--bs-body-bg);
    border-radius: 4px;
    padding: 0 5px;
    font-size: 0.7rem;
    color: var(--bs-gray-500);
    font-weight: bold;
}

/* SECCIÓN DERECHA: Empresa, Sucursal y Usuario */
.context-info {
    font-size: 0.8rem;
    gap: 15px; /* Espacio entre empresa y sucursal */
}

.info-item {
    display: flex;
    align-items: center;
    color: var(--bs-gray-600);
}

.info-divider {
    width: 1px;
    height: 18px;
    background: rgba(150, 150, 150, 0.3);
}

/* PERFIL DE USUARIO */
.user-text {
    display: flex;
    flex-direction: column; /* Nombre arriba, Rol abajo */
    text-align: right;
    margin-right: 10px;
    line-height: 1.2;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.user-role {
    font-size: 0.75rem;
    color: var(--bs-gray-500);
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--color-acento);
    color: white;
    border-radius: 8px; /* Un toque más moderno que circular */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
}

/* BOTONES DE ICONO */
.btn-icon {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 8px;
    color: var(--bs-gray-700);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

    .btn-icon:hover {
        background: rgba(150, 150, 150, 0.1);
    }

.notification-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 7px;
    height: 7px;
    background: #dc3545;
    border-radius: 50%;
}

/* TOOLBAR PRINCIPAL */
.filter-toolbar {
    background: transparent;
    padding: 0.5rem 0;
    flex-wrap: wrap;
}

/*.filter-toolbar {
    display: flex;
    flex-wrap: wrap; /* Esencial para el salto de línea 
    align-items: center;
    gap: 10px; /* Espacio uniforme entre todos los elementos 
}*/

/* BOTÓN ESTILO DROPDOWN (FECHAS) */
.btn-filter-dropdown {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    color: #475569;
    font-weight: 500;
}

/* Grupo de filtros compactos del editor documental */
.pill-group {
    border: 1px solid #e2e8f0 !important;
}

.pill-item {
    border: none;
    background: transparent;
    padding: 0.3rem 0.8rem;
    font-size: 0.85rem;
    border-radius: 7px;
    color: #64748b;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

    .pill-item .badge {
        background: #e2e8f0;
        color: #64748b;
        font-size: 0.7rem;
        padding: 2px 6px;
    }

    .pill-item.active {
        background: white;
        color: #1e293b;
        font-weight: 600;
        /*box-shadow: 0 1px 3px rgba(0,0,0,0.1);*/
        box-shadow: 0 2px 4px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.1);
        transform: translateY(-1px);
    }

        .pill-item.active .badge {
            background: #f1f5f9;
            color: #1e293b;
        }

    /* Heredamos tu pill-group y pill-item y añadimos: */

    .pill-item:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        pointer-events: none;
    }

    .pill-item i {
        font-size: 1rem;
        opacity: 0.7;
    }

    .pill-item.active i {
        opacity: 1;
        color: var(--bs-primary); /* O el color que prefieras para resaltar */
    }

/* BOTONES SECUNDARIOS */
.btn-filter-secondary {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    color: #64748b;
}

.btn-filter-add {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    color: #64748b;
    border-radius: 10px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .btn-filter-add:hover {
        background: #f1f5f9;
        border-color: #94a3b8;
    }

/* BUSCADOR INTEGRADO */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.4rem 0.8rem;
    width: 250px;
}

    .search-box i {
        color: #94a3b8;
        font-size: 0.9rem;
    }

    .search-box input {
        border: none;
        outline: none;
        background: transparent;
        margin-left: 8px;
        font-size: 0.85rem;
        width: 100%;
    }

/* EL CONTENEDOR DE CHIPS DEBE SER FLEXIBLE */
.filter-chip-wrapper {
    position: relative; /* Para que el popover se posicione respecto al chip */
    display: flex;
}

.filter-chip {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
    white-space: nowrap; /* El chip en sí no se rompe, pero el contenedor sí */
}

    .filter-chip:hover {
        border-color: #cbd5e1;
    }

.chip-label {
    color: #64748b;
    margin-right: 4px;
}

.chip-value {
    color: #0f172a;
    font-weight: 600;
}

.chip-remove {
    background: none;
    border: none;
    color: #94a3b8;
    margin-left: 6px;
    padding: 0;
    display: flex;
    align-items: center;
    border-radius: 4px;
}

    .chip-remove:hover {
        color: #ef4444;
        background: #fee2e2;
    }

/* AJUSTE AL BOTÓN DROP-DOWN DEL MENÚ */
.dropdown-menu {
    border-radius: 12px;
    min-width: 180px;
}

.dropdown-item {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    color: #475569;
}

    .dropdown-item:hover {
        background-color: #f1f5f9;
    }

/* BOTÓN DE VALOR (ESTILO LINK) */
.chip-value-btn {
    background: none;
    border: none;
    padding: 0 4px;
    color: #0d6efd;
    font-weight: 600;
    border-radius: 4px;
}

    .chip-value-btn:hover {
        background: rgba(13, 110, 253, 0.05);
    }

/* EL POPOVER PROFESIONAL */
.filter-popover {
    position: absolute;
    top: 110%;
    left: 0;
    z-index: 1050;
    background: white;
    min-width: 200px;
    border-radius: 12px;
    padding: 8px;
}

/* EL TELÓN INVISIBLE */
.popover-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1040; /* Justo debajo del popover que debe tener 1050 */
    background: transparent; /* No se ve, solo detecta el clic */
    cursor: default;
}

/*.popover-search {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    border-radius: 6px;
    padding: 4px 8px;
    margin-bottom: 8px;
}*/

.popover-search {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px 12px;
    margin-bottom: 8px;
    transition: border-color 0.2s;
}

    .popover-search input {
        border: none;
        background: transparent;
        outline: none;
        font-size: 0.85rem;
        width: 100%;
        margin-left: 8px;
    }

    .popover-search:focus-within {
        border-color: #0d6efd;
        background: white;
    }

/* Spinner pequeño */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

.popover-list {
    max-height: 200px;
    overflow-y: auto;
}

.popover-item {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 6px 10px;
    font-size: 0.85rem;
    border-radius: 6px;
    color: #475569;
}

    .popover-item:hover {
        background: #f8fafc;
        color: #0f172a;
    }


/*Date picker**/
.date-popover {
    position: absolute;
    top: 110%;
    left: 0;
    z-index: 1050;
    background: white;
    width: 380px; /* Un poco más ancho por el calendario doble */
    border-radius: 12px;
    overflow: hidden;
}

.list-group-item-action {
    border: none;
    font-size: 0.85rem;
    border-radius: 6px !important;
    margin-bottom: 2px;
}

/* Ajuste para inputs de fecha */
input[type="date"].form-control-sm {
    font-size: 0.8rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

/* Verde Bandera de México para MXN */
.text-mxn {
    color: #006341 !important;
    font-weight: 700;
}

/* Azul Fintech Profesional para USD */
.text-usd {
    color: #00787a !important;
    font-weight: 700;
}

/* Opcional: Un efecto de sutil relieve para que resalten más en fondo blanco */
.text-mxn, .text-usd {
    letter-spacing: -0.2px;
}

.x-small-label {
    font-size: 0.65rem;
    font-weight: 800;
    color: #94a3b8;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
    text-transform: uppercase;
}


/* Contenedor principal */
.folder-tabs-container {
    display: flex;
    padding-left: 10px;
    align-items: flex-end;
    overflow: hidden;
}

/* Tab base */
.folder-tab {
    position: relative;
    border: none;
    outline: none;
    background: transparent;
    padding: 10px 40px;
    cursor: pointer;
    margin-right: 5px; /* controla el traslape */
    color: #6c757d;
    font-weight: 600;
    z-index: 1;
    transition: transform 0.2s ease;
}

    /* Fondo (la forma de la pestaña) */
    .folder-tab::before {
        content: "";
        position: absolute;
        inset: 0;
        background: #f6f6f6;
        border-radius: 12px 12px 0 0;
        /* efecto inclinación */
        transform: perspective(25px) rotateX(8deg);
        /* 👇 CLAVE */
        z-index: -1;
        /* sombra base */
        box-shadow: 0px 2px 3px 3px rgba(0,0,0,0.08);
        transition: all 0.25s ease;
    }

    /* Hover (tabs inactivas) */
    .folder-tab:hover:not(.active) {
        z-index: 2;
    }

        .folder-tab:hover:not(.active)::before {
            background: #cfcfcf;
        }

    /* Tab activa */
    .folder-tab.active {
        z-index: 10; /* 👈 siempre arriba */
        color: #212529;
    }

        .folder-tab.active::before {
            background: #ffffff;
            box-shadow: 0 4px 12px rgba(0,0,0,0.08);
        }

    /* Opcional: pequeño lift visual */
    .folder-tab.active {
        transform: translateY(2px);
    }

/* Card/contenido debajo */
.folder-card {
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 8px 8px 8px;
    margin-top: -1px;
    background: white;
    padding: 20px;
    z-index: 20;
}


/* Efecto hover para el botón de borrar cliente */
.hover-bg-danger-subtle:hover {
    background-color: #fee2e2;
    transition: background 0.2s;
}

/* Ajuste para que el select parezca texto plano pero con estilo */
.form-select-sm {
    padding-top: 0;
    padding-bottom: 0;
    cursor: pointer;
}

/* --- BUSCADOR LIMPIO --- */
.modern-search-box {
    position: relative; /* Esto es el 'ancla' para la lista */
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    height: 42px;
}

/* 3. La lista flotante */
.search-results-floating {
    position: absolute;
    top: calc(100% + 5px); /* Se pega justo abajo del buscador con 5px de gracia */
    left: 0;
    right: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    z-index: 9999; /* Valor altísimo para que pase por encima de otros cards/pills */
    max-height: 280px;
    overflow-y: auto;
    padding: 5px;
}

.modern-search-box:focus-within {
    border-color: var(--bs-primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.search-icon-left {
    padding: 0 12px;
    color: #94a3b8;
    font-size: 1.1rem;
}

.clean-input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    padding-right: 40px; /* Espacio para el botón de la derecha */
    color: #1e293b;
    font-size: 0.85rem;
}

.search-action-btn {
    position: absolute;
    right: 5px;
    border: none;
    background: white;
    color: var(--bs-primary);
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* --- FICHA DE ENTIDAD SELECCIONADA --- */
.selected-entity-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 10px;
}

.entity-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.entity-info {
    flex-grow: 1;
    overflow: hidden;
}

.entity-name {
    font-weight: 700;
    font-size: 0.85rem;
    display: block;
    max-width: 200px;
}

.entity-badge {
    background: white;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    border: 1px solid #e2e8f0;
}

.entity-subtext {
    font-size: 0.7rem;
    color: #64748b;
}

.remove-entity-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.2rem;
    padding: 0 5px;
}

    .remove-entity-btn:hover {
        color: #ef4444;
    }

/* --- SELECTOR ESTILO PILL --- */
.custom-select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.pill-select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    padding: 0.6rem 2.5rem 0.6rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 7px;
    cursor: pointer;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

    .pill-select:focus {
        background: white;
        border-color: var(--bs-primary);
        outline: none;
    }

.select-chevron {
    position: absolute;
    right: 10px;
    pointer-events: none;
    color: #64748b;
    font-size: 0.8rem;
}

/* Contenedor de la fecha a la derecha */
.date-pill-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 4px 12px;
    border-radius: 10px;
    height: 42px; /* Misma altura que tus pills de la izquierda */
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

/* Reloj en vivo */
.live-clock {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1e293b;
    font-size: 0.9rem;
}

.date-part {
    font-weight: 400;
    color: #64748b;
    font-size: 0.85rem;
}

.time-part {
    font-weight: 700;
    color: var(--bs-primary);
}

/* Punto de "Latido" para indicar que está vivo */
.live-dot {
    width: 6px;
    height: 6px;
    background-color: #10b981; /* Verde esmeralda */
    border-radius: 50%;
    display: inline-block;
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 5px rgba(16, 185, 129, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Inputs compactos para modo manual */
.compact-input {
    border: none !important;
    background: #f1f5f9 !important;
    font-size: 0.8rem !important;
    padding: 2px 5px !important;
    border-radius: 6px !important;
}

.custom-switch {
    width: 2.2em !important;
    height: 1.1em !important;
    cursor: pointer;
    /* Evitamos que el switch flote hacia arriba */
    margin-top: 0 !important;
}

.x-small-label-bold {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    /* Forzamos que el texto no tenga espacio extra arriba ni abajo */
    line-height: 1;
    margin: 0;
    padding: 0;
    /* Alineación óptica: a veces 1px abajo ayuda a que se vea centrado al ojo humano */
    /*transform: translateY(1px);*/
}

.separador {
    /* 1. Grosor de la línea */
    border: 0; /* Eliminamos el borde por defecto de Bootstrap */
    border-top: 2px solid; /* Definimos el grosor aquí (ej: 1px, 2px, 3px) */
    /* 2. Espacio Horizontal (Largo de la línea) */
    width: 98%; /* Si quieres que sea más corta, baja el % */
    margin-left: auto; /* Estos dos "auto" centran la línea horizontalmente */
    margin-right: auto;
    /* 3. Margen Vertical (Espacio arriba y abajo) */
    margin-top: 1rem; /* Espacio superior */
    margin-bottom: 1rem; /* Espacio inferior */
    /* 4. Opacidad */
    opacity: 0.1; /* 0.1 es muy sutil (acabado sutil), 1.0 es sólido */
    /* Opcional: Color para que combine con el texto muted */
    color: #64748b;
}


/*SECCION DE AGREGAR CONCEPTOS*/

/* Display de Precio con Botón de Ajuste */
.price-display-pill {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 2px 2px 2px 10px;
    height: 38px;
}

    .price-display-pill .currency-symbol {
        color: #94a3b8;
        font-size: 0.8rem;
        margin-right: 4px;
    }

    .price-display-pill .price-value {
        font-weight: 700;
        color: #1e293b;
        flex-grow: 1;
    }

.price-value-input {
    font-weight: 700;
    color: #1e293b;
    flex-grow: 1;
    border: none;
    background: transparent;
}



.adjust-btn {
    border: none;
    background: white;
    color: #64748b;
    border-radius: 6px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

    .adjust-btn:hover, .adjust-btn.active {
        background: var(--bs-primary);
        color: white;
    }

/* El Panel de Edición (Drawer) */
.price-editor-drawer {
    background: #f1f5f9;
    border-radius: 10px;
    padding: 12px 15px;
    border-left: 4px solid var(--bs-primary);
}

/* Input de cantidad más estético */
.pill-input {
    border-radius: 8px !important;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    height: 38px;
}

    .pill-input:focus {
        background: white;
        border-color: var(--bs-primary);
        box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
    }

/* Botón de Agregar */
.add-concept-btn {
    width: 45px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

/* Grupos de input modernos para el drawer */
.modern-group .input-group-text {
    background: white;
    border-color: #cbd5e1;
    color: #94a3b8;
    font-size: 0.75rem;
}

.modern-group .form-control {
    border-color: #cbd5e1;
}




/* Contenedor con scroll inteligente */
.table-container {
    width: 100% !important;
    overflow-x: auto !important; /* Habilitamos el scroll horizontal */
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch; /* Scroll suave en iPhone/iPad */
    border-radius: 10px;
    background-color: var(--color-superficie);
    border: 1px solid var(--color-borde);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

    /* Personalización del Scrollbar (Chrome, Safari, Edge) */
    .table-container::-webkit-scrollbar {
        height: 6px; /* Scroll horizontal muy fino */
    }

    .table-container::-webkit-scrollbar-track {
        background: #f1f5f9; /* Color de fondo del track */
        border-radius: 10px;
    }

    .table-container::-webkit-scrollbar-thumb {
        background: #cbd5e1; /* Color del scroll (gris suave como tus pills) */
        border-radius: 10px;
        transition: background 0.3s;
    }

        .table-container::-webkit-scrollbar-thumb:hover {
            background: #94a3b8; /* Un poco más oscuro al pasar el mouse */
        }

/* Evitar que el texto se amontone en celdas pequeñas */
.custom-table {
    min-width: 800px !important; /* IMPORTANTE: Esto obliga a la tabla a mantener un ancho mínimo en móviles */
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}


    .custom-table th {
        background-color: var(--table-header-bg);
        color: var(--color-texto-secundario);
        font-size: 0.75rem;
        text-transform: uppercase;
        padding: 0.5rem 1.25rem;
        border-bottom: 1px solid var(--color-borde);
        white-space: nowrap; /* Evita que las descripciones largas hagan la fila gigante hacia abajo */
    }

    .custom-table td {
        padding: 0.5rem 1.25rem;
        border-bottom: 1px solid var(--color-borde);
        color: var(--color-texto);
        white-space: nowrap; /* Evita que las descripciones largas hagan la fila gigante hacia abajo */
    }

    .custom-table tbody tr:hover {
        background-color: var(--table-row-hover);
    }



/******TOAST********/

/* El contenedor no debe bloquear el resto de la pantalla */
.toast-container {
    pointer-events: none; /* Los clics pasan a través del contenedor... */
}

.arus-toast {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-left: 5px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
    min-width: 300px;
    overflow: hidden;
    position: relative;
    pointer-events: auto;
    z-index: 10000;
}

.toast-content {
    display: flex;
    align-items: center;
    padding: 12px 15px;
}

.toast-text {
    font-size: 0.85rem;
    font-weight: 500;
    flex-grow: 1;
    color: #1e293b;
}

/* Colores por tipo */
.arus-toast.success {
    border-left-color: #10b981;
}

    .arus-toast.success i {
        color: #10b981;
    }

.arus-toast.danger {
    border-left-color: #ef4444;
}

    .arus-toast.danger i {
        color: #ef4444;
    }

/* Botón cerrar */
.btn-close-toast {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.1rem;
    position: relative;
    z-index: 10001; /* Aseguramos que el botón esté arriba de todo */
    cursor: pointer !important;
    padding: 5px; /* Área de clic más grande */
}

/* Barra de progreso exclusiva de los toasts.
   No reutilizar .progress-bar: Bootstrap usa esa clase para barras normales. */
.toast-progress {
    height: 3px;
    background: rgba(0,0,0,0.05);
    width: 100%;
}

.toast-progress-bar {
    height: 100%;
    background: currentColor;
    opacity: 0.3;
    animation: toast-shrink linear forwards;
}

@keyframes toast-shrink {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

/* --- CONFIGURACIÓN PARA MÓVIL (Menos de 768px) --- */
@media (max-width: 767.98px) {

    /* El contenedor del menú en móvil */
    .nav-container {
        position: fixed;
        top: 0;
        left: -100%; /* Escondido a la izquierda */
        width: 80%; /* El 80% que pediste */
        height: 100vh;
        z-index: 1100; /* Por encima de la TopBar */
        background-color: var(--bg-sidebar);
        transition: left 0.3s ease-in-out;
        box-shadow: 5px 0 15px rgba(0,0,0,0.3);
        display: flex;
        flex-direction: column;
    }

        /* Cuando el menú tiene la clase de mostrar */
        .nav-container.show-mobile {
            left: 0;
        }

    /* El fondo oscuro con Blur */
    .menu-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px); /* El efecto de desenfoque */
        -webkit-backdrop-filter: blur(4px);
        z-index: 1050; /* Entre el contenido y el menú */
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

        .menu-backdrop.show {
            opacity: 1;
            visibility: visible;
        }

    /* Ajustes visuales para que los links no se vean amontonados */
    .link-text {
        display: inline !important; /* Forzamos que se vea el texto en móvil */
    }


    .file-drop-zone {
        border-style: dashed !important;
        transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
        cursor: pointer; /* <--- Esta es la línea que hace aparecer la manita */
    }

        .file-drop-zone:hover {
            background-color: #f1f5f9 !important;
            border-color: #0d6efd !important;
        }

    .cursor-pointer {
        cursor: pointer !important;
    }

    .xs {
        font-size: 0.75rem;
    }
}
