:root {
    /* Colores Estructurales */
    --bs-primary-custom: #0000BC;
    --bs-green-logo: #92e237; /* Verde del logo Votorantim */
    --bs-lightgray: #F3F3F3;
    --bs-button-bg: #EEF1FF;
    --bs-softblue: #8FA3FF;
    --bs-positive: #2D7A3E;
    --bs-negative: #C62828;

    /* Colores GRÁFICOS (Pastel / Claros) */
    --chart-line-soft: #8FA3FF;
    --chart-fill-soft: rgba(238, 241, 255, 0.6);
    --chart-bar-real: #C5CFFF;
    --chart-bar-target: #E5E5E5;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f8f9fa;
    width: 100% !important;
    margin: 0;
    overflow-x: hidden;
    font-size: 0.85rem;
}

/* Utilidades de texto */
.text-xs {
    font-size: 0.8rem !important;
}

.text-xxs {
    font-size: 0.65rem !important;
}

.text-primary-custom {
    color: var(--bs-primary-custom) !important;
}

.text-positive {
    color: var(--bs-positive) !important;
}

.text-negative {
    color: var(--bs-negative) !important;
}

.bg-lightgray {
    background-color: var(--bs-lightgray) !important;
}

.fw-semibold {
    font-weight: 600 !important;
}

/* Botones */
.btn-custom-light {
    background-color: var(--bs-button-bg);
    color: #333;
    border: none;
    font-size: 0.75rem;
}

.btn-custom-light:hover {
    background-color: #dbe2ff;
}

/* Botón verde (submit/guardar) */
.btn-submit {
    background-color: var(--bs-green-logo);
    color: #1a1a1a;
    border: none;
    font-size: 0.75rem;
    font-weight: 600;
}

.btn-submit:hover {
    background-color: #7bc92e;
    color: #1a1a1a;
}

/* Botón Minimizar con rotación */
.btn-minimize {
    color: #999;
    background: transparent;
    border: none;
    padding: 5px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.btn-minimize:hover {
    background-color: #f0f0f0;
    color: #333;
}

.btn-minimize i {
    transition: transform 0.3s ease;
    transform: rotate(0deg);
}

.btn-minimize[aria-expanded="true"] i {
    transform: rotate(180deg);
}

/* TOGGLES (ESTILO AZUL CORRECTO) */
.toggle-container {
    display: inline-flex;
    gap: 4px;
}

.btn-toggle {
    border: none;
    background: transparent;
    font-size: 0.85rem;
    color: #999;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    transition: all 0.2s ease;
}

/* Estado ACTIVO: Fondo azul claro + Texto azul oscuro */
.btn-toggle.active {
    color: var(--bs-primary-custom);
}

.btn-toggle:hover:not(.active) {
    color: #555;
}

/* Cards */
.card {
    margin-bottom: 1.5rem !important;
    border: none !important;
    border-radius: 0px !important;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 3px 0px, rgba(0, 0, 0, 0.06) 0px 1px 2px 0px !important;
    overflow: visible;
}

.card-body {
    padding: 1.5rem !important;
}

.h6,
h6 {
    font-size: 1rem !important;
    font-weight: 700;
}

.h5,
h5 {
    font-size: 1.1rem !important;
    font-weight: 700;
}

/* Scrollbars */
.table-scroll-container {
    max-height: 400px;
    overflow-y: auto;
}

::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 2px;
}

/* Estilos Gráficos */
.kpi-sparkline {
    height: 25px;
    width: 100%;
    margin-top: 5px;
}

#budget-chart {
    height: 380px;
    width: 100%;
}

/* Filtros */
.form-select-sm-custom {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-color: #e0e0e0;
    background-color: white;
    border-radius: 4px;
}

/* Animación Cambio Título */
.fade-in-text {
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Modal */
/* Borde tipo "hoja" (Leaf shape) */
.modal-leaf-shape .modal-content {
    border-radius: 0;
    border-top-right-radius: 25px;
    border-bottom-left-radius: 25px;
    border: none;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    padding: 2.8rem 2rem;
}

/* Inputs limpios */
.form-control-clean,
.form-select-clean {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: #374151;
    transition: all 0.2s;
}

.form-control-clean:focus,
.form-select-clean:focus {
    border-color: var(--bs-primary-custom);
    box-shadow: 0 0 0 3px rgba(0, 0, 188, 0.1);
    outline: none;
}

/* Botón Guardar - Estilo SUAVE */
.btn-save-custom {
    background-color: #EEF1FF;
    /* Azul muy claro (Pastel) */
    color: var(--bs-primary-custom);
    /* Texto Azul Corporativo */
    border: 1px solid #EEF1FF;
    font-weight: 600;
    border-top-right-radius: 15px;
    border-bottom-left-radius: 15px;
    padding: 0.6rem 2rem;
    transition: all 0.2s ease-in-out;
}

/* Hover: Se pone grisáceo discreto */
.btn-save-custom:hover {
    background-color: #e2e6ea;
    /* Gris suave */
    color: #495057;
    /* Texto gris oscuro */
    border-color: #dae0e5;
}

/* Etiquetas alineadas */
.form-label-custom {
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    /* Gris medio */
    margin-bottom: 0;
    display: flex;
    align-items: center;
    height: 100%;
    /* Centrado vertical con el input */
}

button {
    border-radius: 0 !important;
    font-weight: bold !important;
}

.card-body.pt-0 {
    padding-top: 0px !important;
}

h3.text-xs {
    font-size: 0.9rem !important;
}

.table-sm .table-light>:not(caption)>*>* {
    padding: .4rem .3rem !important;
}

.mw-fit {
    min-width: fit-content;
}

@media(min-width:768px) {
    .container-main {
        padding: 20px;
    }
}

@media(max-width:767px) {
    .container-main {
        padding: 20px 12px;
    }
}

/* =========================================
   ESTILOS ESPECÍFICOS DEL DASHBOARD & HEADER
   ========================================= */

/* --- HEADER PRINCIPAL (Replicando diseño original) --- */
.app-header {
    background-color: white;
    position: sticky;
    top: 0;
    z-index: 10000;
    width: 100%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.header-inner {
    margin: 0 auto;
    padding-top: 0;
    padding-bottom: 0;
}

/* Quitar padding vertical del header-inner cuando tiene container-main */
.header-inner.container-main {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Fila Superior (Logo, Search, User) */
.header-top {
    height: 62px;
    border-bottom: 1px solid #e5e7eb; /* border-gray-200 */
    padding: 0 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: white;
    position: relative;
    z-index: 51;
}

.logo-container img {
    height: 37px; /* Altura específica de tu imagen */
    width: auto;
    object-fit: contain;
}

/* Botón Volver Atrás */
.btn-back-nav {
    color: #9ca3af;
    text-decoration: none;
}

.btn-back-nav:hover {
    color: #6b7280;
}

.btn-back-nav i {
    font-size: 0.7rem;
}

/* Buscador Central */
.search-wrapper {
    flex: 1;
    max-width: 42rem; /* max-w-2xl */
    margin: 0 2rem;
    position: relative;
    z-index: 52;
}

.search-container {
    display: flex;
    align-items: center;
    background-color: var(--bs-lightgray);
    border-radius: 4px; /* Opcional, match original */
    transition: all 0.2s ease;
}

/* Efecto Focus del Buscador (Tu requerimiento) */
.search-container.active {
    background-color: white;
    outline: 2px solid var(--bs-primary-custom);
    outline-offset: -2px;
}

.search-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border-right: 1px solid #d1d5db; /* Borde gris por defecto */
    cursor: pointer;
    font-size: 0.875rem;
    color: #4b5563;
    transition: border-color 0.2s ease; /* AÑADIDO: Para que el cambio de color sea suave */
}

/* --- NUEVA REGLA: Poner azul la línea separadora al hacer foco --- */
.search-container.active .search-dropdown-trigger {
    border-right-color: var(--bs-primary-custom);
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    outline: none;
    width: 100%;
}

/* Overlay oscuro al buscar */
#search-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 40; /* Debajo del header pero encima del contenido */
}
#search-overlay.active {
    display: block;
}

/* Fila Inferior (Navegación Secundaria) */
.header-bottom {
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    position: relative;
    background-color: white; /* Asegurar fondo blanco */
}

/* Menú Scrollable */
.nav-scroll-container {
    display: flex;
    align-items: center;
    gap: 2rem;
    overflow-x: auto;
    margin: 0 3rem;
    height: 100%;
    scrollbar-width: none;
    padding-right: 100px; 
    padding-left: 10px;
}
.nav-scroll-container::-webkit-scrollbar { display: none; }

.nav-item-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    height: 100%;
    display: flex;
    align-items: center;
    border-bottom: none; 
    position: relative; 
    margin-bottom:2px;
}

.nav-item-link:hover {
    color: var(--bs-primary-custom);
}

/* Estado Activo */
.nav-item-link.active {
    color: var(--bs-primary-custom);
}

/* CREAMOS LA LÍNEA CON ::after */
.nav-item-link.active::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px; /* Grosor de la línea */
    background-color: var(--bs-primary-custom);
    bottom: 9px; 
}

/* Botones Flecha Nav */
.nav-arrow {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4b5563;
    background: transparent;
    border: none;
    cursor: pointer;
    position: absolute;
    z-index: 10;
}
.nav-arrow:hover { background-color: var(--bs-lightgray); border-radius: 4px; }
.nav-arrow.left { left: 0.5rem; }
.nav-arrow.right { right: 0.5rem; }

/* --- Reducir padding en página de inicio (cuando hay nav horizontal) --- */
body.is-home main.container-main {
    padding-top: 0.5rem !important;
}
@media (min-width: 768px) {
    body.is-home main.container-main {
        padding-top: 0.75rem !important;
    }
}

/* --- TARJETAS DASHBOARD (Efecto Hover y Estilo) --- */
/* ESTILOS DASHBOARD CARDS (Igualdad de altura y Hover Sutil) */
/* --- ESTILOS TARJETAS DASHBOARD (Altura Fija y Alineación) --- */

.card-dashboard {
    background: white;
    border: none !important;
    /* Bordes redondeados estilo "hoja" */
    border-top-right-radius: 25px !important;
    border-bottom-left-radius: 25px !important;
    border-top-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    padding: 1.5rem;
    height: 100%; 
    min-height: 210px; /* Opcional: Altura mínima para uniformidad visual */
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Icono arriba, textos/datos distribuidos */
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 3px 0px, rgba(0, 0, 0, 0.06) 0px 1px 2px 0px;
}

.card-dashboard:hover {
    transform: translateY(-1px); 
    /* Sombra Hover (shadow-xl original) */
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
}

/* Título del módulo */
.dashboard-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #212529; /* text-dark */
    margin-bottom: 0.35rem;
}

/* Icono - posicionado abajo, pequeño y claro */
.dashboard-icon {
    font-size: 1.25rem;
    color: #d1d5db; /* Gris muy claro */
    margin: 0;
}

/* Contenedor de Textos (Título + Descripción) */
.card-content-text {
    flex-grow: 1;
    margin-bottom: 0.75rem;
}

/* Datos Numéricos (Siempre abajo) */
.dashboard-stat {
    font-size: 2rem; /* 32px */
    color: var(--bs-primary-custom);
    line-height: 1;
}

/* Enlaces que envuelven tarjetas */
a.text-decoration-none {
    display: block;
    height: 100%; /* El enlace también debe ocupar toda la altura */
}
.dropdown-menu.shadow-lg {
    border: 1px solid #f0f0f0 !important;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 2px 0px !important;
}
.dropdown-item {
    font-size: 14px;
}
.bg-gris {
    background: rgba(229, 231, 235, 1) !important;
}
/* --- SUGERENCIAS DEL BUSCADOR --- */

.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-top: none; /* Se une visualmente al input */
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 0.5rem 0;
    margin-top: -2px; /* Pequeño ajuste para solapar bordes */
}

.suggestion-group {
    padding: 0.5rem 0;
}

.suggestion-header {
    font-size: 14px !important;
    text-transform: uppercase;
    color: black; 
    font-weight: 600;
    padding: 0.5rem 1rem;
    margin-bottom: 0;
}

.suggestion-item {
    display: flex;
    align-items: center;
    padding: 0.6rem 1rem;
    text-decoration: none;
    color: #374151; /* Gris oscuro */
    font-size: 0.875rem;
    transition: background-color 0.15s ease;
    gap: 0.3rem;
}

.suggestion-item:hover {
    background-color: var(--bs-lightgray);
}

.suggestion-icon {
    color: #6b7280 !important; /* Iconos grises - sin colores */
    width: 24px;
    min-width: 24px;
    text-align: center;
    font-size: 0.95rem;
}

.suggestion-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.suggestion-title {
    font-size: 0.875rem;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-subtitle {
    font-size: 0.7rem;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

/* Negrita para el texto coincidente */
.suggestion-item span.fw-bold,
.suggestion-title span.fw-bold {
    color: #111827; /* Negro suave */
}
@media(min-width:879px) {
    .d-none-dsk {
        display: none !important;
    }
}
@media(max-width:878px) {
    .d-none-mvl {
        display: none !important;
    }
    .nav-arrow.left {
        margin-left: -7px !important;
    }
    .flechas {
        margin-right: 0 !important;
    }
}
.search-wrapper.d-none-dsk .search-container {
    margin: 10px 0 0px 0 !important;
}
.search-wrapper.d-none-dsk {
    margin: 0 !important;
}
@media(min-width:501px) {
    .logo-mvl {
        display: none !important;
    }
}
@media(max-width:500px) {
    .logo-desk {
        display: none !important;
    }
    .logo-mvl {
        max-width:30px;
    }
    .header-top .column-gap-5, .header-top > .gap-4{
        column-gap: 10px !important;
    }
    .header-inner.container-main {
        padding: 0px 10px !important;
    }
}
.search-wrapper.d-none-dsk {
    max-width: 100% !important;
}

/* =============================================
   LOGIN
   ============================================= */

/* Contenedor principal con fondo */
.cont-login {
    background-image: url('../img/fondo-abstracto.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Logo posicionado arriba a la izquierda */
.login-logo-top {
    max-height: 40px;
    width: auto;
    margin: 20px;
}

/* Card personalizada con forma de "hoja" */
.login-card-custom {
    background: white;
    border: none;
    border-top-right-radius: 25px !important;
    border-bottom-left-radius: 25px !important;
    border-top-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 3px 0px, rgba(0, 0, 0, 0.06) 0px 1px 2px 0px;
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 460px;
}

.login-title {
    color: var(--bs-primary-custom);
    font-weight: 700;
    letter-spacing: -1px;
    font-size: 2rem;
}

.form-label-custom {
    font-size: 0.875rem;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 0.5rem;
}

/* Inputs estilo login */
.login-card-custom .input-group-text {
    background-color: #f9fafb;
    border: 1px solid #dee2e6;
    border-right: none;
    color: #9ca3af;
}

.form-control-custom {
    background-color: #f9fafb;
    border: 1px solid #dee2e6;
    border-left: none;
    font-size: 0.9rem;
    padding: 0.55rem 1rem;
    border-radius: 0 3px 3px 0;
}

.form-control-custom:focus {
    background-color: #fff;
    border-color: #dee2e6;
    box-shadow: none;
    outline: none;
}

/* Botón Iniciar Sesión */
.btn-login {
    background-color: #EEF1FF;
    color: #3838a9;
    font-weight: 700 !important;
    padding: 0.8rem;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    border-radius: 0 !important;
    font-size: 15px;
    border: none;
}

.btn-login:hover {
    background-color: #dbe2ff;
    color: #3838a9;
}

.btn-login:disabled {
    background-color: #e5e7eb;
    color: #9ca3af;
}

.forgot-password {
    font-size: 0.85rem;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-password:hover {
    color: #3838a9;
}

/* Alertas en login */
.login-card-custom .alert {
    font-size: 0.85rem;
    border-radius: 4px;
}

/* Media queries para móviles */
@media (max-width: 576px) {
    .login-card-custom {
        margin: 1rem;
        padding: 2rem 1.5rem;
    }
    .login-logo-top {
        max-height: 35px;
        margin: 15px;
    }
}

@media (max-width: 680px) {
    .login-card-custom {
        padding: 2rem 1.5rem;
    }
}

/* =============================================
   LISTADO DE CLIENTES
   ============================================= */

/* Filtros Compactos */
.filter-card {
    transition: all 0.3s ease;
    border-radius: 4px !important;
}

/* Inputs estilo SAP/Compacto */
.form-control-compact, .form-select-compact {
    border: 1px solid #ced4da;
    border-radius: 3px;
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    background-color: #fff;
}

.form-control-compact:focus, .form-select-compact:focus {
    border-color: var(--bs-primary-custom);
    box-shadow: none;
    border-width: 1px;
}

.filter-label {
    font-size: 0.7rem;
    color: #6b7280;
    font-weight: 500;
    margin-bottom: 2px;
    display: block;
}

/* Botón Toggle Filtros - con línea horizontal */
.filter-toggle-container {
    position: relative;
    text-align: center;
    margin-top: 0;
}

/* Línea gris horizontal detrás del botón */
.filter-toggle-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #e0e0e0;
    transform: translateY(-50%);
    z-index: 0;
}

/* Botón toggle con fondo blanco para tapar la línea */
.filter-toggle-btn {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    border: 1px solid #e0e0e0;
    width: 30px;
    height: 22px;
    cursor: pointer;
    color: #6c757d;
}

.filter-toggle-btn i {
    font-size: 0.65rem;
    transition: transform 0.3s;
}

.filter-toggle-btn.collapsed i {
    transform: rotate(180deg);
}

#filtersCollapse.collapse.show {
    padding-top: 8px;
}

#filtersCollapse.collapse:not(.show) {
    padding-top: 0px !important;
}

/* Filas de Clientes */
.client-row {
    background-color: white;
    padding: 0.75rem 1rem;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
}

.client-row.active-row, 
.client-row:hover {
    border-left-color: var(--bs-primary-custom) !important;
    background-color: #fdfdfd;
}

.client-label {
    font-size: 0.75rem;
    color: #868e96;
    text-transform: uppercase;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 2px;
}

.client-value {
    font-size: 0.90rem;
    color: #212529;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.client-value-mono {
    font-family: monospace;
    font-size: 0.90rem;
    font-weight: 700;
}

/* Acciones (Ver Ficha / Editar / Visitar) */
.action-link {
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    color: #3838a9;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.6rem;
    border-radius: 0;
    transition: background 0.2s;
}

.action-link:hover {
    background-color: #EEF1FF;
    color: #3838a9;
}

/* Transiciones globales para botones */
.btn, button, a {
    transition: all .3s ease-in-out;
}

/* Hover gris claro para botones de texto */
.btn.text-secondary:hover {
    background-color: #f3f4f6;
}


/* Paginación Custom */
.pagination-custom .page-link {
    border: none;
    background: transparent;
    color: #4b5563;
    font-size: 0.85rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 2px;
    transition: all 0.2s ease;
}

.pagination-custom .page-link:hover {
    color: black;
    font-weight: 600;
}

.pagination-custom .page-item.active .page-link {
    color: black;
    font-weight: 600;
}

.pagination-custom .page-item.disabled .page-link {
    color: #d1d5db;
    background: transparent;
    cursor: default;
}

.page-item:first-child .page-link, 
.page-item:last-child .page-link {
    border-radius: 0 !important;
}

/* Selector "Elementos por página" */
.select-custom {
    border: 1px solid #e5e7eb;
    background-color: white;
    font-size: 0.8rem;
    color: #4b5563;
    padding-top: 4px;
    padding-bottom: 4px;
    cursor: pointer;
    border-radius: 3px;
}

.select-custom:focus {
    border-color: var(--bs-primary-custom);
    box-shadow: none;
}

/* Fade in animation */
.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* =============================================
   FORMULARIO NUEVA VISITA
   ============================================= */

/* Inputs limpios estilo formulario */
.form-control-clean,
.form-select-clean {
    border: 1px solid #e5e7eb;
    border-radius: 3px;
    padding: 0.55rem 1rem;
    font-size: 0.875rem;
    color: #374151;
    transition: all 0.2s;
}

.form-control-clean:focus,
.form-select-clean:focus {
    border-color: var(--bs-primary-custom);
    box-shadow: 0 0 0 3px rgba(0, 0, 188, 0.1);
    outline: none;
}

/* Etiquetas alineadas */
.form-label-custom {
    font-size: 0.875rem;
    font-weight: 500 !important;
    color: #4b5563;
    margin-bottom: 0;
    display: flex;
    align-items: center;
}

/* Ancho 65% para el card del formulario */
@media (min-width: 1200px) {
    .w-65 {
        width: 65%;
    }
}

@media (max-width: 767px) {
    .form-label-custom {
        margin-bottom: 5px;
    }
}

/* Acordeón historial de visitas */
.accordion-button.collapsed {
    background-color: var(--bs-lightgray);
}

.accordion-button:not(.collapsed) {
    background-color: var(--bs-lightgray);
    color: inherit;
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: none;
    border-color: rgba(0,0,0,.125);
}

/* ============================================= */
/* LISTADOS CON CABECERA FIJA                    */
/* ============================================= */
.list-wrapper {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 220px);
    min-height: 400px;
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.list-header {
    display: flex;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    padding: 0.5rem 1rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.list-header .row {
    width: 100%;
    align-items: center;
}

.list-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.list-row {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.15s ease;
}

.list-row:hover {
    background-color: #f8f9fa;
}

.list-footer {
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    font-size: 0.75rem;
    color: #6c757d;
    flex-shrink: 0;
}

@media (max-width: 991px) {
    .list-wrapper {
        height: calc(100vh - 260px);
    }
    
    .list-header {
        font-size: 0.65rem;
        padding: 0.5rem 0.75rem;
    }
    
    .list-row {
        padding: 0.5rem 0.75rem;
    }
}

/* ============================================= */
/* INPUT CON BOTÓN DE LIMPIAR                    */
/* ============================================= */
.input-clearable-wrapper {
    position: relative;
    display: inline-block;
}

.input-clearable-wrapper input {
    padding-right: 30px;
}

.input-clearable-wrapper .btn-clear-input {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    color: #999;
    cursor: pointer;
    font-size: 0.75rem;
    display: none;
    line-height: 1;
}

.input-clearable-wrapper .btn-clear-input:hover {
    color: #333;
}

/* Solo mostrar la X cuando el input tiene la clase has-value */
.input-clearable-wrapper input.has-value ~ .btn-clear-input {
    display: block;
}

/* ============================================= */
/* FOOTER DISCRETO                               */
/* ============================================= */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    border-top: 1px solid #eee;
    padding: 0.25rem 0;
    z-index: 999;
}

.app-footer .footer-inner {
    padding: 0 1.5rem;
}

.app-footer .footer-date {
    font-size: 0.65rem;
    color: #aaa;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.app-footer .footer-date i {
    font-size: 0.55rem;
    color: #ccc;
}

/* Ajustar main para que no quede oculto por el footer */
.container-main {
    padding-bottom: 2rem !important;
}

@media (max-width: 767px) {
    .app-footer .footer-inner {
        padding: 0 1rem;
    }
}