/*
.main-sidebar {
    margin-block-start: 0;
}
*/

/* Botón outline naranja personalizado */
.btn-outline-orange {
    background-color: transparent;
    border-color: #fc783e;
    color: #fc783e;
}

.btn-outline-orange:hover {
    background-color: #fc783e;
    border-color: #fc783e;
    color: #ffffff;
}

.btn-outline-orange:focus,
.btn-outline-orange:active {
    background-color: #fc783e;
    border-color: #fc783e;
    color: #ffffff;
    box-shadow: 0 0 0 0.2rem rgba(252, 120, 62, 0.25);
}

.form-check-input:checked {
  background-color: #fc783e;
  border-color: #fc783e;
}

/* Estilos para el botón de colapso del menú */
.pc-sidebar-collapse {
    margin-right: auto;
    padding: 10px;
}

/* RESET COMPLETO PARA MENU NORMAL Y COLAPSADO */
/* 1. Estilo base para el sidebar */
.pc-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1025;
    width: 260px;
    height: 100vh;
    transition: all 0.3s ease;
}

/* 2. Estilo para el sidebar colapsado - completamente oculto */
.pc-sidebar.pc-sidebar-hide {
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    overflow: hidden;
}

/* 3. Ocultar elementos cuando el sidebar está colapsado */
.pc-sidebar.pc-sidebar-hide .pc-caption,
.pc-sidebar.pc-sidebar-hide .pc-item span:not(.pc-micon) {
    display: none !important;
}

/* 4. RESET COMPLETO para el contenedor principal - Menu NORMAL */
body .pc-container {
    position: relative;
    margin-left: 260px;
    min-height: 100vh;
    padding: 0;
    transition: all 0.3s ease;
}

/* 5. RESET COMPLETO para el contenedor principal - Menu COLAPSADO - Ancho completo */
body .pc-sidebar.pc-sidebar-hide ~ .pc-container {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0 !important;
    flex: 0 0 100% !important;
}

/* FiltersMini Styles */
.mini-filter-btn {
    width: 56px;
    height: 48px;
    border-radius: 24px 0 0 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color .3s ease, transform .3s ease;
    background-color: var(--bs-primary);
    color: #fff;
    border: none;
    outline: none;
}

.filter-summary {
    position: absolute;
    right: 70px;
    bottom: 0;
    width: 450px;
    max-width: 80vw;
    background-color: rgba(0,0,0,0.6);
    border-radius: 8px;
    padding: 12px;
    color: white;
    font-size: 13px;
    transition: opacity 0.3s ease;
}

.filter-summary-item {
    margin-bottom: 3px;
    display: flex;
    align-items: center;
}

.filter-summary-item .badge {
    margin-right: 5px;
}

.filter-summary-toggle {
    position: absolute;
    top: 5px;
    right: 5px;
    color: white;
    cursor: pointer;
    font-size: 10px;
}

/* Dashboard Filters UI Styles */
/* Estilos para el nuevo diseño card-style */
.btn-card {
    border-radius: 12px !important;
    font-weight: 500;
    padding: 0.75rem;
    border: 1px solid #e9ecef;
    background: #ffffff;
    color: #6c757d;
    transition: all 0.3s ease;
    min-height: 60px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    position: relative;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.btn-card:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn-card.active,
.btn-card:active,
.btn-check:checked + .btn-card {
    background: #ffffff !important;
    border: 1px solid #e9ecef !important;
    color: #495057 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.btn-card-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.btn-card .btn-card-icon {
    background: #489ed8;
    color: #ffffff;
}

.btn-card:hover .btn-card-icon {
    background: #3a8bc4;
    color: #ffffff;
}

.btn-card.active .btn-card-icon,
.btn-card:active .btn-card-icon,
.btn-check:checked + .btn-card .btn-card-icon {
    background: #fc783e !important;
    color: #ffffff !important;
    transform: scale(1.05);
}

.btn-card-text {
    font-weight: 500;
    flex-grow: 1;
}

.btn-card-sm {
    border-radius: 8px !important;
    font-weight: 500;
    padding: 0.75rem;
    border: 1px solid #e9ecef;
    background: #ffffff;
    color: #6c757d;
    transition: all 0.3s ease;
    min-height: 60px;
    width: 180px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    flex-shrink: 0;
}

.btn-card-sm:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.btn-card-sm.active {
    background: #ffffff !important;
    border: 1px solid #e9ecef !important;
    color: #495057 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.btn-card-sm-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.btn-card-sm .btn-card-sm-icon {
    background: #489ed8;
    color: #ffffff;
}

.btn-card-sm:hover .btn-card-sm-icon {
    background: #3a8bc4;
    color: #ffffff;
}

.btn-card-sm.active .btn-card-sm-icon {
    background: #fc783e !important;
    color: #ffffff !important;
    transform: scale(1.05);
}

.btn-card-sm-text {
    font-weight: 500;
    line-height: 1.2;
}

/* Colores específicos para iconos - Todos azules cuando no están seleccionados */
.icon-export { background: #489ed8 !important; color: #ffffff !important; }
.icon-import { background: #489ed8 !important; color: #ffffff !important; }
.icon-weight { background: #489ed8 !important; color: #ffffff !important; }
.icon-money { background: #489ed8 !important; color: #ffffff !important; }
.icon-commodity { background: #489ed8 !important; color: #ffffff !important; }
.icon-time { background: #489ed8 !important; color: #ffffff !important; }

/* Override de bg-success para usar color naranja */
.bg-success {
    --bs-success-rgb: 252, 120, 62 !important;
    background-color: rgba(252, 120, 62, 1) !important;
}

.btn-card-secondary {
    background: #6c757d;
    color: #ffffff;
    border: 1px solid #6c757d;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-card-secondary:hover {
    background: #5a6268;
    border-color: #545b62;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Saved Queries Styles */
.cursor-pointer {
    cursor: pointer;
}

.dropdown-item-text:hover {
    background-color: #f8f9fa;
}

.saved-query-item {
    transition: background-color 0.2s ease;
    border-radius: 4px;
    padding: 8px;
    margin: 2px 0;
}

.saved-query-item:hover {
    background-color: #e9ecef;
}

.saved-query-name {
    font-weight: 600;
    color: #495057;
}

.saved-query-description {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 2px;
}

.saved-query-date {
    font-size: 0.75rem;
    color: #adb5bd;
    margin-top: 4px;
}

/* Estilos para botones de favorito en consultas guardadas */
.saved-query-item .btn-sm {
    padding: 0.25rem 0.4rem;
    font-size: 0.75rem;
    border-radius: 0.2rem;
}

.saved-query-item .btn-outline-warning {
    border-color: #ffc107;
    color: #ffc107;
}

.saved-query-item .btn-outline-warning:hover {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

.saved-query-item .btn-outline-secondary {
    border-color: #6c757d;
    color: #6c757d;
}

.saved-query-item .btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #fff;
}

/* Estrella de favorito en el nombre */
.saved-query-name .fa-star {
    font-size: 0.75rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
    100% {
        opacity: 1;
    }
}

/* Estilos para enlaces de consultas guardadas */
.saved-queries-links a,
.saved-queries-links button,
.saved-queries-links span {
    font-size: 0.875rem;
    transition: all 0.2s ease;
    padding: 2px 4px;
    border-radius: 3px;
}

.saved-queries-links a:hover,
.saved-queries-links button:hover,
.saved-queries-links span:hover {
    background-color: rgba(0, 123, 255, 0.1);
    transform: translateY(-1px);
}

.saved-queries-links a.text-success:hover,
.saved-queries-links button.text-success:hover,
.saved-queries-links span.text-success:hover {
    background-color: rgba(40, 167, 69, 0.1);
    color: #28a745 !important;
}

.saved-queries-links .dropdown-toggle::after {
    font-size: 0.75rem;
}

/* Botón guardar como enlace */
.saved-queries-links button.btn-link {
    text-decoration: none !important;
    box-shadow: none !important;
}

.saved-queries-links button.btn-link:focus {
    box-shadow: none !important;
    outline: none !important;
}

/* Asegurar que el botón de colapso sea visible en dispositivos móviles */
@media (max-width: 1024px) {
    .pc-header .pc-h-item.pc-sidebar-collapse {
        display: block !important;
    }
}

/* 6. RESET para el header */
body .pc-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 260px;
    z-index: 1024;
    transition: all 0.3s ease;
}

body .pc-sidebar.pc-sidebar-hide ~ .pc-header {
    left: 0 !important;
    width: 100% !important;
}

.desktop-rhin-logo {
    display: block;
    margin: auto;
    /* Se elimina vertical-align porque no funciona con display:block */
    border-style: none;
    max-width: 80%;
}
.required {
    color: red;
}

/* Aplicar fondo gris claro solo en modo claro */
body:not([data-pc-theme="dark"]) .pc-container .pc-content {
    background-color: #f2f8fe;
}

/* Estilos para encabezados */
h6, .h6, h5, .h5, h4, .h4, h3, .h3, h2, .h2, h1, .h1 {
    color: #27508d;
}

.skeleton {
    background-color: #e2e2e2;
    border-radius: 4px;
    height: 16px;
    width: 100%;
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0% { background-color: #e2e2e2; }
    50% { background-color: #cccccc; }
    100% { background-color: #e2e2e2; }
}

.skeleton-row:nth-child(1) .skeleton {
    animation-delay: 0s;
}

.skeleton-row:nth-child(2) .skeleton {
    animation-delay: 0.1s;
}

.skeleton-row:nth-child(3) .skeleton {
    animation-delay: 0.2s;
}

.skeleton-row:nth-child(4) .skeleton {
    animation-delay: 0.3s;
}

.form-skeleton:nth-child(1) .skeleton {
    animation-delay: 0s;
}

.form-skeleton:nth-child(2) .skeleton {
    animation-delay: 0.1s;
}

.form-skeleton:nth-child(3) .skeleton {
    animation-delay: 0.2s;
}

.form-skeleton:nth-child(4) .skeleton {
    animation-delay: 0.3s;
}

.form-skeleton:nth-child(5) .skeleton {
    animation-delay: 0.4s;
}

.form-skeleton:nth-child(6) .skeleton {
    animation-delay: 0.5s;
}

.skeleton-btn {
    display: inline-block;
    height: 20px; /* Altura aproximada de tu botón pequeño */
    width: 100px; /* Ancho aproximado de tu botón pequeño */
    background-color: #e0e0e0;
    border-radius: 4px;
    margin-right: 8px;
    animation: skeleton-loading 1.5s infinite linear;
}

@keyframes skeleton-loading {
    0% {
        background-color: #e0e0e0;
    }
    50% {
        background-color: #c0c0c0;
    }
    100% {
        background-color: #e0e0e0;
    }
}

.skeleton-btn {
    width: 100px;
    height: 30px;
}

.skeleton-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-badge {
    width: 60px;
    height: 20px;
}

.skeleton-icon {
    width: 20px;
    height: 20px;
}

.skeleton-row td {
    padding: 1rem;
}

.skeleton td div {
    height: 1rem;
}

.country-selector {
    width: 1rem;
    height: 1rem;
}
.rounded-circle {
    border-radius: 50% !important;
}
.img-fluid {
    max-width: 70%;
    height: auto;
}
.lang-icon{
    margin: 0 15px;
}

/* background transparente sweetalert */
body .swal2-container.swal2-noanimation,
body .swal2-container.swal2-backdrop-show {
    background: transparent !important;
}

div:where(.swal2-container).swal2-backdrop-show,
div:where(.swal2-container).swal2-noanimation {
    background: transparent !important;
}

.login-logo{
    height: 60px;
}

.pad-bot-20{
    padding-bottom: 20px;
}

.simplebar-offset {
    direction: inherit !important;
    box-sizing: inherit !important;
    resize: none !important;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    padding: 0;
    margin: 0;
    -webkit-overflow-scrolling: touch;
    width: 260px;
}

/* Estilos para el chat flotante */
.chat-toggle-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    z-index: 999;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.chat-toggle-btn:hover {
    transform: scale(1.05);
}

.floating-chat-container {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    height: 450px;
    background-color: #fff;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 998;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    pointer-events: none;
    transition: all 0.3s ease;
}

.floating-chat-container.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.chat-header {
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    position: relative;
    margin-bottom: 5px;
}

.system-message {
    align-self: flex-start;
    background-color: #f1f1f1;
    color: #333;
    border-bottom-left-radius: 5px;
}

.user-message {
    align-self: flex-end;
    background-color: var(--bs-primary);
    color: white;
    border-bottom-right-radius: 5px;
}

.message-content {
    word-break: break-word;
}

.message-time {
    display: block;
    font-size: 0.7rem;
    margin-top: 5px;
    opacity: 0.7;
    text-align: right;
}

.chat-header h5{
    color: white;
}

.chat-footer {
    padding: 15px;
    border-top: 1px solid #e9e9e9;
}

.chat-input-form {
    display: flex;
    align-items: center;
}

.chat-input-form .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.chat-input-form .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Modo oscuro */
body[data-pc-theme="dark"] .floating-chat-container {
    background-color: #2c3e50;
    border: 1px solid #34495e;
}

body[data-pc-theme="dark"] .system-message {
    background-color: #34495e;
    color: #ecf0f1;
}

body[data-pc-theme="dark"] .chat-footer {
    border-top: 1px solid #34495e;
}

body[data-pc-theme="dark"] .chat-input-form .form-control {
    background-color: #34495e;
    border-color: #2c3e50;
    color: #ecf0f1;
}

/* Animaciones para los mensajes */
@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message {
    animation: messageIn 0.3s ease forwards;
}

/* Estilos para los botones de opciones */
.chat-options {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
    width: 100%;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 90%;
}

.option-btn {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 18px;
    padding: 8px 15px;
    text-align: left;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    cursor: pointer;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
}

.option-btn:hover {
    background-color: #e9ecef;
    border-color: #ced4da;
    transform: translateY(-2px);
}

body[data-pc-theme="dark"] .option-btn {
    background-color: #34495e;
    border-color: #2c3e50;
    color: #ecf0f1;
}

body[data-pc-theme="dark"] .option-btn:hover {
    background-color: #2c3e50;
    border-color: #1a252f;
}

.top-bottom-padding{
    padding-top: 10px;
    padding-bottom: 10px;
}

.pct-offcanvas {
    --bs-offcanvas-width: 50%;
    --bs-offcanvas-zindex: 1079;
    transition: transform 0.45s cubic-bezier(0.37, 0.24, 0.53, 0.99);
    box-shadow: 8px 0 14px rgba(27, 46, 94, 0.4);
  }

/* Media queries para dispositivos móviles */
@media (max-width: 767px) {
    .chat-toggle-btn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
    
    .floating-chat-container {
        bottom: 80px;
        right: 10px;
        width: calc(100% - 20px);
        max-width: 350px;
        height: 60vh;
        max-height: 450px;
    }
    
    .chat-message {
        max-width: 85%;
    }
    
    .option-btn {
        font-size: 0.85rem;
        padding: 7px 12px;
    }
}

/* Para dispositivos muy pequeños */
@media (max-width: 375px) {
    .floating-chat-container {
        width: calc(100% - 20px);
        height: 70vh;
        right: 10px;
        left: 10px;
    }
    
    .chat-body {
        padding: 10px;
    }
    
    .chat-footer {
        padding: 10px;
    }
}

.dropdown-notification .simplebar-offset {
    direction: inherit !important;
    box-sizing: inherit !important;
    resize: none !important;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    padding: 0;
    margin: 0;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

/* ========================================
   Estilos personalizados para tablas
   ======================================== */

/* Color de fondo para filas striped en todas las tablas */
.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: #f2f9fc !important;
}

/* Filas expandidas (segundo nivel) en tablas del Lab */
.table .expanded-row > * {
    background-color: #f2f9fc !important;
}

/* ========================================
   FIX: ELIMINAR PARPADEO EN COMPONENTES
   Sobrescribir reglas problemáticas de dashboard-drag-drop.css
   ======================================== */

/* CRÍTICO: Deshabilitar animación pulse-glow que causa parpadeo */
@keyframes pulse-glow {
    0%, 100% { opacity: 1; }
    50% { opacity: 1; }
}

/* Deshabilitar TODAS las transiciones en componentes draggables */
.draggable-component,
.draggable-component *,
.draggable-component .component-preview-real,
.draggable-component .component-preview,
.draggable-component .mini-chart,
.draggable-component .component-header,
.draggable-component .component-title,
.draggable-component .element-delete-btn {
    transition: none !important;
    animation: none !important;
    -webkit-transition: none !important;
    -moz-transition: none !important;
    -o-transition: none !important;
}

/* Deshabilitar hover effects que causan repaints en componentes colocados */
.grid-slot .draggable-component:hover {
    transform: none !important;
    -webkit-transform: none !important;
    box-shadow: none !important;
}

/* Mantener hover solo en el catálogo (no en componentes colocados) 
   Las reglas de hover del catálogo se mantienen del archivo original */

/* Deshabilitar ::before y ::after que puedan causar parpadeo */
.draggable-component::before,
.draggable-component::after,
.draggable-component *::before,
.draggable-component *::after {
    transition: none !important;
    animation: none !important;
}

/* Forzar estabilidad en slots compatibles */
.compatible-slot,
.compatible-slot::after {
    animation: none !important;
}

/* Deshabilitar opacity transitions en remove-component */
.remove-component {
    opacity: 1 !important;
    transition: none !important;
}

.component-header:hover .remove-component {
    opacity: 1 !important;
}

/* Forzar visibilidad del botón eliminar */
.element-delete-btn {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    display: block !important;
    position: absolute !important;
    top: 5px !important;
    right: 5px !important;
    z-index: 100 !important;
    background: rgba(220, 53, 69, 0.9) !important;
    color: white !important;
    border: none !important;
    border-radius: 4px !important;
    width: 24px !important;
    height: 24px !important;
    cursor: pointer !important;
    font-size: 18px !important;
    line-height: 1 !important;
    padding: 0 !important;
}

.element-delete-btn:hover {
    background: rgba(220, 53, 69, 1) !important;
}

/* Asegurar que el título no bloquee el gráfico */
.component-title,
.component-header {
    pointer-events: none !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Asegurar que el gráfico sea visible y no se oculte */
.component-preview-real,
.component-preview,
.mini-chart,
.chart-preview {
    pointer-events: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* Prevenir que ApexCharts cree overlays problemáticos */
.apexcharts-tooltip,
.apexcharts-xaxistooltip,
.apexcharts-yaxistooltip {
    display: none !important;
    pointer-events: none !important;
}

/* Asegurar que el componente draggable sea estable */
.draggable-component {
    position: relative !important;
    will-change: auto !important;
    transform: translateZ(0) !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
    -webkit-font-smoothing: subpixel-antialiased !important;
}

/* Forzar aceleración por hardware en gráficos */
.mini-chart,
.component-preview-real,
.component-preview,
.apexcharts-canvas,
.apexcharts-svg {
    transform: translateZ(0) !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
    -webkit-transform: translateZ(0) !important;
}

/* Prevenir reflows en SVG de ApexCharts */
svg.apexcharts-svg {
    overflow: visible !important;
    transform: translateZ(0) !important;
}

/* Estabilizar el contenedor del gráfico */
.chart-preview {
    transform: translateZ(0) !important;
    backface-visibility: hidden !important;
}