/* =========================================================
   css/style.css
   Estilos Corporativos Premium Oficiales - Clínica ImplantArte
   ========================================================= */

/* 1. VARIABLES DE COLOR (Manual de Marca) */
:root {
    /* Pantone Oficial */
    --brand-verde: #c0e03d;
    --brand-verde-claro: #d9ec8b;
    --brand-gris: #919191;

    /* Acentos y Auxiliares para usabilidad */
    --brand-verde-hover: #b1d428;
    /* Verde un poco más intenso para botones */
    --brand-gris-oscuro: #333333;
    /* Para títulos principales */
    --brand-gris-texto: #5a5a5a;
    /* Para párrafos, garantizando lectura ideal */
    --brand-fondo: #fbfbfb;
    /* Fondo principal extremadamente limpio */
    --brand-blanco: #ffffff;
    
    /* Bootstrap Overrides */
    --bs-primary: #c0e03d;
    --bs-primary-rgb: 192, 224, 61;
    --bs-link-color: #c0e03d;
    --bs-link-hover-color: #b1d428;
    --bs-focus-ring-color: rgba(192, 224, 61, 0.25);
}

/* 2. TIPOGRAFÍA GLOBAL */
body {
    /* Priorizamos Helvetica Regular estricto */
    font-family: 'Helvetica', 'Helvetica Neue', Arial, sans-serif;
    color: var(--brand-gris-texto);
    background-color: var(--brand-fondo);
    font-weight: 400;
    /* Regular */
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    /* Suaviza la fuente en Mac/iOS */
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6,
.fw-bold {
    font-weight: 700 !important;
    /* Helvetica Bold */
    color: var(--brand-gris-oscuro);
}

/* 3. CLASES DE UTILIDAD BOOTSTRAP OVERRIDES */

/* Textos primarios y secundarios */
.text-primary {
    color: var(--brand-verde) !important;
}

.text-muted {
    color: var(--brand-gris) !important;
}

/* Fondos */
.bg-primary {
    background-color: var(--brand-verde) !important;
    color: var(--brand-gris-oscuro) !important;
}

/* Bordes */
.border-primary {
    border-color: var(--brand-verde) !important;
}

/* Nav Tabs */
.nav-tabs .nav-link.active {
    color: var(--brand-verde) !important;
    border-color: #dee2e6 #dee2e6 #fff !important;
    border-bottom: 2px solid var(--brand-verde) !important;
}
.nav-pills .nav-link.active {
    background-color: var(--brand-verde) !important;
    color: var(--brand-gris-oscuro) !important;
}

/* 4. BOTONES PREMIUM */
.btn-primary {
    background: linear-gradient(135deg, var(--brand-verde) 0%, #dcfc50 100%);
    border: none !important;
    color: var(--brand-gris-oscuro);
    font-weight: 800;
    --bs-btn-padding-y: 0.85rem;
    --bs-btn-padding-x: 1.7rem;
    border-radius: 50px;
    /* Pill shape */
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 10px rgba(192, 224, 61, 0.3);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, #b1d428 0%, #c0e03d 100%);
    color: var(--brand-gris-oscuro);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 20px rgba(192, 224, 61, 0.5);
    /* Resplandor verde corporativo aumentado */
}

/* Botones Outline */
.btn-outline-primary {
    color: var(--brand-gris-oscuro);
    border-color: var(--brand-verde);
    font-weight: 700;
    --bs-btn-padding-y: 0.75rem;
    --bs-btn-padding-x: 1.5rem;
    border-radius: 8px;
    background-color: transparent;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background-color: var(--brand-verde);
    color: var(--brand-gris-oscuro);
    border-color: var(--brand-verde);
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(192, 224, 61, 0.4);
}

/* 5. NAVEGACIÓN (GLASSMORPHISM) */
.navbar {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(12px);
    /* Efecto cristal */
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 2px solid var(--brand-verde-claro);
    transition: all 0.3s ease;
}

.nav-link {
    color: var(--brand-gris) !important;
    font-weight: 700;
    transition: color 0.3s;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.nav-link:hover {
    color: var(--brand-verde) !important;
}

/* Formularios Focus */
.form-control:focus, .form-select:focus {
    border-color: var(--brand-verde-hover) !important;
    box-shadow: 0 0 0 0.25rem rgba(192, 224, 61, 0.25) !important;
}

/* 6. TARJETAS DE SERVICIOS (MODERNAS) */
.card {
    border-radius: 1.5rem !important;
    /* Más curvas (24px) */
    border: none !important;
    /* Nos deshacemos del borde duro */
    background-color: var(--brand-blanco);

    /* Regla Ambient Luminosity (Sombra gigante, difusa y apenas visible) */
    box-shadow: 0 20px 60px -10px rgba(45, 47, 47, 0.05) !important;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    /* Removido overflow: hidden para evitar congelamiento de scroll del touch en iOS de .table-responsive */
    padding: 0.5rem;
    /* Oxigenación extra interna general */
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px -12px rgba(45, 47, 47, 0.1) !important;
}

/* El card interactivo verde claro */
.card-verde {
    background-color: var(--brand-verde-claro) !important;
}

/* 7. FORMULARIOS E INPUTS (The Clinical Sanctuary Flow) */
.form-control,
.form-select {
    border-radius: 1.5rem;
    /* Bordes suaves premium */
    border: 1px solid transparent;
    /* Sin borde de contraste duro por defecto */
    padding: 0.8rem 1.2rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    background-color: #f6f3f2;
    /* Gris levísimo (surface-highest) */
    color: var(--brand-gris-oscuro);
}

.form-control:focus,
.form-select:focus {
    background-color: var(--brand-blanco);
    border-color: rgba(192, 224, 61, 0.8);
    /* Outer glow tenue corporativo (Aura de foco) */
    box-shadow: 0 0 15px rgba(192, 224, 61, 0.35) !important;
    outline: none;
}

/* Tipografía "Signature Overline" para Etiquetas de Data */
.form-label,
.overline-label {
    text-transform: uppercase !important;
    font-size: 0.73rem !important;
    letter-spacing: 0.12rem !important;
    color: #767963 !important;
    /* Gris Ocre sutil */
    font-weight: 800;
    margin-bottom: 0.4rem;
}

/* Vitality Badges (Emblemas Tipo Flúor Médico) */
.badge.bg-primary {
    border-radius: 50rem !important;
    /* Pastilla impecable */
    background-color: rgba(192, 224, 61, 0.15) !important;
    /* Tintado base no-sólido */
    color: #3e4c00 !important;
    /* Letra oscura para máximo contraste */
    border: 1px solid rgba(192, 224, 61, 0.4);
    /* Resplandor exterior suave e interior brillante para textura */
    box-shadow: 0 0 6px rgba(192, 224, 61, 0.4), inset 0 0 8px rgba(192, 224, 61, 0.6) !important;
    padding: 0.45rem 0.85rem;
    font-weight: 800;
    letter-spacing: 0.3px;
}

/* 8. FOOTER */
footer.bg-dark {
    background-color: var(--brand-gris) !important;
    /* Tu Gris Oficial */
    border-top: 5px solid var(--brand-verde);
    /* Borde superior con Verde Oficial */
}

/* 9. MODALES PREMIUM */
.modal-content {
    border-radius: 2rem;
    /* Súper round */
    border: none;
    box-shadow: 0 30px 80px -15px rgba(0, 0, 0, 0.2);
    background-color: var(--brand-blanco);
    /* overflow removido preventivamente */
}

.modal-header {
    background-color: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid #f0f0f0;
    padding: 1.5rem !important;
}

.modal-header .modal-title {
    color: var(--brand-gris-oscuro) !important;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.modal-body {
    padding: 2rem !important;
}

/* Botón cerrar sutil */
.btn-close {
    background-color: #f8f9fa;
    border-radius: 50%;
    padding: 0.6em;
    opacity: 0.8;
    transition: all 0.2s;
}

.btn-close:hover {
    background-color: var(--brand-verde-claro);
    opacity: 1;
    transform: rotate(90deg);
}

/* 10. ESTILOS ESPECÍFICOS DEL DASHBOARD (Estilo YouTube) */
/* Transiciones suaves para el Sidebar */
.sidebar {
    width: 260px;
    min-width: 260px;
    transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), min-width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow-x: hidden;
    z-index: 1;
    /* Menor que el z-3 (z-index 3) de la navbar superior */
    border-right: 1px solid #f0f0f0;
    /* Agrega una separación limpia */
    background-color: var(--brand-blanco);
}

/* Transición para ocultar texto progresivamente */
.sidebar .sidebar-text {
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.2s ease;
}

/* Hover de los links del sidebar estilo moderno (borde redondeado interno) */
.sidebar .nav-link {
    border-radius: 10px;
    margin: 4px 12px;
    padding: 10px 15px !important;
}

.sidebar .nav-link:hover {
    background-color: rgba(192, 224, 61, 0.15) !important;
}

.sidebar .nav-link.active {
    background-color: rgba(192, 224, 61, 0.2) !important;
}

/* Contenido Principal flex-grow */
.main-wrapper {
    flex-grow: 1;
    overflow-x: hidden;
    overflow-y: auto;
    width: auto;
    transition: margin-left 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Clase dinámica cuando el sidebar está oculto/plegado (YouTube Style) */
.sidebar-collapsed,
html.init-sidebar-collapsed body #sidebarMenu {
    width: 80px !important;
    min-width: 80px !important;
}

.sidebar-collapsed .sidebar-text,
html.init-sidebar-collapsed body #sidebarMenu .sidebar-text {
    opacity: 0;
    pointer-events: none;
    display: none;
}

.sidebar-collapsed .nav-link,
html.init-sidebar-collapsed body #sidebarMenu .nav-link {
    justify-content: center;
    margin: 4px 8px;
    /* Reducir margen lateral si está cerrado */
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.sidebar-collapsed .nav-link i,
html.init-sidebar-collapsed body #sidebarMenu .nav-link i {
    margin-right: 0 !important;
    font-size: 1.6rem !important;
    /* Íconos un poco más grandes cuando está cerrado */
    width: auto !important;
}

/* Botón de toggle transparente y limpio */
#btnToggleSidebar {
    background: transparent;
    color: var(--brand-gris-oscuro);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.icon-caja {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 11. Customización de FullCalendar 6 (Estética Premium ImplantArte) */
.fc {
    --fc-page-bg-color: transparent;
    --fc-border-color: #f0f0f0;
    --fc-button-text-color: var(--brand-gris-oscuro);
    --fc-button-bg-color: var(--brand-verde-claro);
    --fc-button-border-color: var(--brand-verde-claro);
    --fc-button-hover-bg-color: var(--brand-verde);
    --fc-button-hover-border-color: var(--brand-verde);
    --fc-button-active-bg-color: var(--brand-verde);
    --fc-button-active-border-color: var(--brand-verde);
    font-family: inherit;
    margin-top: 1.5rem;
}

/* Hacer las celdas del calendario más altas nativamente para que la 1h de evento abarque más píxeles y quepan 3 líneas */
.fc-timegrid-slot {
    height: 3em !important;
}

.fc-event-main {
    white-space: normal !important;
    /* Permite que el texto se acomode hacia abajo */
    overflow: hidden;
}

/* Oscurecer las líneas del calendario para mayor contraste */
.fc-theme-standard td,
.fc-theme-standard th,
.fc-theme-standard .fc-scrollgrid {
    border-color: #d0d0d0 !important;
}

/* Encabezado del Mes/Semana con Glassmorphism */
.fc-theme-standard th {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 12px 0;
    border-bottom: 2px solid var(--brand-verde-claro) !important;
}

/* 🌟 RESALTADO DEL DÍA ACTUAL (COLUMNA Y CASILLA) 🌟 */
.fc .fc-day-today {
    background-color: rgba(192, 224, 61, 0.25) !important;
    /* Verde más notorio y visible */
}

/* En la vista de Mes, el número del día actual */
.fc .fc-day-today .fc-daygrid-day-number {
    background-color: var(--brand-verde);
    color: var(--brand-gris-oscuro) !important;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 4px;
    font-weight: 800;
}


/* Estilos de Botones Nativos de FullCalendar */
.fc .fc-button-primary {
    color: var(--brand-gris-oscuro) !important;
    font-weight: 700;
    text-transform: capitalize;
    border-radius: 8px;
    padding: 0.5rem 1.2rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.fc .fc-button-primary:not(:disabled):active,
.fc .fc-button-primary:not(:disabled).fc-button-active {
    background-color: var(--brand-verde) !important;
    border-color: var(--brand-verde) !important;
    box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}

.fc .fc-button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(192, 224, 61, 0.3);
}

.fc .fc-button-primary:disabled {
    opacity: 0.5;
    transform: none;
    box-shadow: none;
}

.fc .fc-toolbar-title {
    font-weight: 800;
    color: var(--brand-gris-oscuro);
    font-size: 1.75rem !important;
    letter-spacing: -0.5px;
}

/* Quitar el color azul (enlaces) a los días de FullCalendar */
.fc a[data-navlink],
.fc-col-header-cell-cushion,
.fc-daygrid-day-number {
    color: var(--brand-gris-texto) !important;
    text-decoration: none !important;
    font-weight: 600;
}

.fc a[data-navlink]:hover,
.fc-col-header-cell-cushion:hover,
.fc-daygrid-day-number:hover {
    color: var(--brand-verde) !important;
    text-decoration: none !important;
}

/* Estilización Premium de las Citas (Eventos) */
.fc-event {
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    /* Sombra sutil */
    border-radius: 6px !important;
    border: none !important;
    /* Quitamos borde feo por defecto */
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin: 1px 2px;
}

.fc-event:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 10px rgba(192, 224, 61, 0.4);
    z-index: 5 !important;
}

.fc-v-event .fc-event-main {
    padding: 6px 8px;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
}

.fc-daygrid-event .fc-event-main {
    padding: 4px 6px;
    font-weight: 600;
}

#btnToggleSidebar:hover {
    background-color: rgba(0, 0, 0, 0.05);
    /* Circulo sutil al hacer hover tipo YouTube */
}

/* Mejoras de Contraste para las Tarjetas/Widgets del Dashboard */
.card.bg-primary {
    background-color: var(--brand-verde) !important;
    color: var(--brand-gris-oscuro) !important;
}

.card.bg-primary .text-white-50 {
    color: var(--brand-gris-texto) !important;
}

.card.bg-primary .text-white {
    color: var(--brand-gris-oscuro) !important;
}

/* La tarjeta oscura (Usuarios) */
.card.bg-dark,
.card.bg-dark h1,
.card.bg-dark h2,
.card.bg-dark h3,
.card.bg-dark h4,
.card.bg-dark h5,
.card.bg-dark h6,
.card.bg-dark .fw-bold {
    background-color: var(--brand-gris-oscuro) !important;
    color: var(--brand-blanco) !important;
}

.card.bg-dark .text-white-50 {
    color: #b0b0b0 !important;
}

/* =========================================================
   ESTILOS EXTRAÍDOS DEL CÓDIGO INLINE (REFACTORIZACIÓN)
   ========================================================= */

/* Utilidades de Texto y Color */
.text-brand-verde {
    color: var(--brand-verde) !important;
}

.text-brand-verde-claro {
    color: var(--brand-verde-claro) !important;
}

.text-brand-gris {
    color: var(--brand-gris-oscuro) !important;
}

.text-whatsapp {
    color: #25D366 !important;
    font-size: 1.2rem;
}

/* Truncamiento de celdas de tabla */
.table-text-truncate {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Círculos de Avatar de Usuario/Paciente */
.avatar-circle-sm {
    width: 40px;
    height: 40px;
    line-height: 40px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Logos */
.logo-login {
    max-height: 80px;
    opacity: 0.8;
}

.logo-navbar {
    max-height: 55px;
}

.logo-footer {
    max-height: 40px;
    opacity: 0.8;
}

/* Layout y Contenedores */
.bg-contacto-section {
    background-color: #f7f9fa;
    border-top: 1px solid #eaeaea;
}

.map-iframe {
    border: 0;
}

.textarea-resize-v {
    resize: vertical;
}

/* Sidebar del Dashboard */
.sidebar-wrapper {
    min-height: calc(100vh - 60px);
}

.sidebar-icon {
    width: 25px;
}

.sidebar-caption {
    font-size: 0.75rem;
}

/* Calendario y Dropdowns */
.dropdown-pacientes-search {
    z-index: 1050;
    max-height: 200px;
    overflow-y: auto;
}

.fc-event-time-custom {
    font-size: 0.75rem;
    opacity: 0.8;
}

.fc-event-title-custom {
    font-size: 0.85rem;
}

.fc-event-doc-custom {
    font-size: 0.75rem;
}

/* =========================================================
   12. ODONTOGRAMA INTERACTIVO Y PERFIL MEDICO
   ========================================================= */
.odontograma-container {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #eaeaea;
}

.diente-wrapper {
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    border: 1px solid #f0f0f0;
}

.diente-wrapper:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.cara-diente {
    transition: fill 0.2s ease, stroke 0.2s ease;
}

.cara-diente:hover {
    stroke: var(--brand-verde-hover);
    stroke-width: 2;
}

/* Fix para oscurecer el fondo cuando se abre un segundo Modal encima de otro */
.modal-backdrop ~ .modal-backdrop {
    z-index: 1059 !important;
}

/* =========================================================
   13. PERIODONTOGRAMA DIGITAL INTERACTIVO
   ========================================================= */

/* Ocultar flechas de inputs numéricos */
.val-perio::-webkit-outer-spin-button,
.val-perio::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

.val-perio {
    -moz-appearance: textfield;
    /* Firefox */
    appearance: textfield;
    border-radius: 50% !important;
    /* Círculos perfectos */
    border: 1px solid #ced4da;
    font-weight: bold;
    font-family: 'Helvetica', 'Helvetica Neue', Arial, sans-serif !important;
}

.val-perio:focus {
    outline: none;
    border-color: var(--brand-verde);
    box-shadow: 0 0 0 0.25rem rgba(192, 224, 61, 0.25);
    /* Sombra verde pantone */
}

.tooth-col-perio {
    width: 120px;
    display: inline-block;
    text-align: center;
    vertical-align: top;
    border-right: 1px solid #e9ecef;
}

.tooth-col-perio .bg-dark {
    background-color: var(--brand-gris-oscuro) !important;
}

/* =========================================================
   14. ESTILIZACIÓN STITCH: "SANCTUARY TABLES" ESPACIADAS
   ========================================================= */
.table {
    --bs-table-bg: transparent;
    margin-bottom: 0;
}

.table th {
    font-weight: 800;
    color: var(--brand-gris-oscuro);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    padding: 1.5rem 1rem !important;
    /* Oxígeno extra */
    border-bottom: 2px solid rgba(0, 0, 0, 0.05) !important;
    background-color: var(--brand-fondo) !important;
}

.table td {
    padding: 1.25rem 1rem !important;
    /* Respiro vertical masivo */
    vertical-align: middle;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03) !important;
    /* "Ghost Border" */
}

/* Hover súper sútil en filas */
.table-hover>tbody>tr:hover>* {
    --bs-table-bg-state: rgba(192, 224, 61, 0.05);
    /* Verde levísimo */
    transition: background-color 0.3s ease;
}

/* Ajustes a labels e inputs para coherencia "Glassmórfica" */
.shadow-sm {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03) !important;
}

/* Hack definitivo para forzar Scroll Nativo en Modales iOS/Android */
.modal {
    -webkit-overflow-scrolling: touch !important;
}


/* BOOTSTRAP 5 BUG FIX: Desactivar modal-dialog-centered en MOVILES si el contenido es mas grande que la pantalla. El centering por flexbox bloquea los Touch Events en iOS */
@media (max-width: 991.98px) {
    .modal-dialog-centered {
        align-items: flex-start !important;
        min-height: auto !important;
        margin-top: 2rem !important;
    }
}

/* =========================================================
   15. ESTILOS DE IMPRESIÓN PARA FORMATOS Y RÉCIPES
   ========================================================= */
@media print {

    /* Ocultar absolutamente todo en el DOM */
    body * {
        visibility: hidden !important;
    }

    /* Mostrar únicamente la hoja membretada y sus descendientes */
    .hoja-membretada,
    .hoja-membretada * {
        visibility: visible !important;
    }

    /* Posicionar la hoja membretada de forma absoluta cubriendo toda la página */
    .hoja-membretada {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        border: none !important;
        box-shadow: none !important;
        padding: 1.5cm !important;
        margin: 0 !important;
        background-color: white !important;
        color: black !important;
    }

    /* Ocultar barras de scroll de fondo durante la impresión */
    body {
        background-color: white !important;
        overflow: visible !important;
    }
}

/* =========================================================================
   RECIPE PREVIEW COMPONENT
   ========================================================================= */
.recipe-preview-rp-container {
    font-family: 'Montserrat', sans-serif;
    margin-bottom: 15px;
}

.recipe-preview-rp-text {
    font-size: 20px;
    color: var(--brand-verde);
    font-weight: 800;
    display: block;
    margin-bottom: 10px;
}

.recipe-preview-empty {
    color: #95a5a6;
    font-style: italic;
    font-size: 13px;
    text-align: center;
    padding: 20px 0;
}

.recipe-preview-list {
    margin: 0;
    padding-left: 0;
    font-size: 13px;
    color: #2c3e50;
}

.recipe-preview-item {
    margin-bottom: 4px;
    line-height: 1.1;
}

.recipe-preview-farmaco {
    font-weight: 600;
    color: #2c3e50;
}

.recipe-preview-dosis {
    color: #555;
    font-style: italic;
}

.recipe-preview-hr {
    border-top: 1px dashed #ccc;
    margin: 15px 0;
}

.recipe-preview-indicaciones-container {
    font-size: 12px;
    color: #34495e;
}

.recipe-preview-indicaciones-title {
    color: var(--brand-verde);
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    font-size: 11px;
    display: block;
    margin-bottom: 4px;
}

.recipe-preview-indicaciones-text {
    white-space: pre-wrap;
    line-height: 1.4;
    padding-left: 10px;
}

.recipe-preview-falta-dosis {
    color: #e74c3c;
    font-style: italic;
}

/* Fix for signature alignment without overlaps */
.firma-container-flex {
    position: relative;
    margin-bottom: 8px;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
}

/* =========================================================
   16. FORMATOS Y RÉCIPES (HOJA MEMBRETADA)
   ========================================================= */
.hoja-membretada-container {
    background: #e9ecef;
}

.hoja-membretada {
    width: 100%;
    max-width: 595px;
    min-height: 750px;
    padding: 40px 45px;
    font-family: 'Helvetica', Arial, sans-serif;
    position: relative;
    display: flex;
    flex-direction: column;
}

.hoja-membretada-header {
    border-bottom-color: #dee2e6 !important;
}

.hoja-membretada-logo {
    filter: grayscale(100%);
    opacity: 0.8;
    max-height: 55px;
}

.hoja-membretada-header-text {
    max-width: 70%;
}

.hoja-membretada-title {
    color: #4a5568;
    font-size: 16px;
}

.hoja-membretada-subtitle {
    font-size: 11px;
}

.hoja-membretada-contact {
    font-size: 10px;
}

.hoja-membretada-info-box {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 20px;
    font-size: 12px;
}

.hoja-membretada-info-row {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 5px;
}

.hoja-membretada-info-motive {
    margin-top: 5px;
    color: #919191;
}

.hoja-membretada-body {
    flex-grow: 1;
    font-size: 13px;
    color: #2c3e50;
    line-height: 1.5;
}

.hoja-membretada-empty-state {
    color: #95a5a6;
    font-style: italic;
    font-size: 13px;
    text-align: center;
    padding: 40px 0;
}

.hoja-membretada-footer {
    margin-top: auto;
    padding-top: 30px;
    text-align: center;
    font-size: 11px;
}

.hoja-membretada-signature-img {
    max-height: 60px;
}

.hoja-membretada-credentials {
    font-size: 9px;
}

/* =========================================================
   17. MODAL INFORME LIBRE Y OTROS
   ========================================================= */
.modal-informe-libre-body {
    min-height: 500px;
}

.modal-informe-libre-historial {
    max-height: 450px;
    overflow-y: auto;
}

.table-historial-informe {
    font-size: 0.85rem;
}

.table-historial-informe thead {
    position: sticky;
    top: 0;
}

.textarea-informe-libre {
    resize: none;
    font-size: 1rem;
    line-height: 1.6;
    outline: none;
    box-shadow: none;
}

/* Fix para SweetAlert2 siempre encima de cualquier modal de Bootstrap */
.swal2-container {
    z-index: 9999 !important;
}

/* Forzar Botones de SweetAlert a usar la identidad corporativa */
.swal2-confirm {
    background: linear-gradient(135deg, var(--brand-verde) 0%, #dcfc50 100%) !important;
    color: var(--brand-gris-oscuro) !important;
    border: none !important;
    font-weight: 800 !important;
    border-radius: 50px !important;
    box-shadow: 0 4px 10px rgba(192, 224, 61, 0.3) !important;
    padding: 0.6rem 1.5rem !important;
}
.swal2-cancel {
    background: transparent !important;
    color: var(--brand-gris-oscuro) !important;
    border: 2px solid var(--brand-gris) !important;
    font-weight: 700 !important;
    border-radius: 50px !important;
    padding: 0.6rem 1.5rem !important;
}