/* ==========================================================================
   WM-ModernCardTable.css
   Estilo modular moderno para tarjetas, tablas interactivas, badges y modales.
   Diseñado para cargarse DESPUÉS de Library.inc para sobrescribir limpiamente 
   estilos obsoletos sin afectar ninguna otra página a menos que se incluya.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* --- TIPOGRAFÍA GLOBAL HOMOLOGADA CON WINMEDADMIN --- */
html, body,
h1:not(.fa):not([class*="fa-"]),
h2:not(.fa):not([class*="fa-"]),
h3:not(.fa):not([class*="fa-"]),
h4:not(.fa):not([class*="fa-"]),
h5:not(.fa):not([class*="fa-"]),
h6:not(.fa):not([class*="fa-"]),
p,
span:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not([class*="fa-"]):not([class*="glyphicon"]):not(.fc-icon):not([class*="fc-icon"]),
a:not(.fa):not([class*="fa-"]):not(.fc-button),
button:not(.fa):not([class*="fa-"]):not(.fc-button),
input, select, textarea, label,
.btn, .form-control, .card, .table, .modal, .dropdown-menu,
.navbar, .navbar-brand, .nav-link,
#userInfo, #lblNmAdmUser, #lblUsPerfil, #lblUsEmailPerfil, #lblEmpresa,
.headings-font-family, .swal2-popup {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif !important;
}

/* --- PROTECCIÓN UNIVERSAL DE ICONOS FONTAWESOME Y GLYPHICONS --- */
i.fa, i.fas, i.far, i.fab, i.fal, i.fad, i.fa-solid, i.fa-regular, i.fa-brands,
span.fa, span.fas, span.far, span.fab, span.fal, span.fad, span.fa-solid, span.fa-regular, span.fa-brands,
.fa, .fas, .far, .fab, .fal, .fad, .fa-solid, .fa-regular, .fa-brands,
[class^="fa-"], [class*=" fa-"], [class^="icon-"], [class*=" icon-"],
.glyphicon, [class*="glyphicon-"] {
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", "FontAwesome", "Glyphicons Halflings" !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    line-height: 1 !important;
}

i.fa-brands, span.fa-brands, .fa-brands, [class*="fa-brands"] {
    font-family: "Font Awesome 6 Brands", "Font Awesome 5 Brands" !important;
}

i.fa-regular, span.fa-regular, .fa-regular, i.far, span.far, .far {
    font-weight: 400 !important;
}

i.fa-solid, span.fa-solid, .fa-solid, i.fas, span.fas, .fas {
    font-weight: 900 !important;
}

/* --- PROTECCIÓN DE ICONOS DE FULLCALENDAR (FCICONS) --- */
.fc-icon,
span.fc-icon,
i.fc-icon,
.fc .fc-icon,
[class^="fc-icon-"],
[class*=" fc-icon-"],
.fc-button .fc-icon {
    font-family: "fcicons" !important;
    font-style: normal !important;
    font-weight: normal !important;
    font-variant: normal !important;
    text-transform: none !important;
    line-height: 1 !important;
    display: inline-block !important;
    speak: none !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    width: 1em !important;
    height: 1em !important;
    text-align: center !important;
}

.fc .fc-button .fc-icon {
    vertical-align: middle !important;
    font-size: 1.25em !important;
}

/* --- CABECERA DE TÍTULO PRINCIPAL --- */
.vinc-title-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0.5rem;
}

.vinc-title-icon-box {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    box-shadow: 0 2px 5px rgba(37, 99, 235, 0.10);
    flex-shrink: 0;
}

.vinc-title-text {
    font-size: 1.20rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
    margin-bottom: 1px;
}

.vinc-title-subtext {
    font-size: 0.80rem;
    color: #64748b;
    margin-bottom: 0;
}

.vinc-title-sep {
    color: #94a3b8 !important;
    font-weight: 400 !important;
    margin: 0 6px !important;
    font-size: 0.95rem !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

.vinc-title-text a {
    color: #2563eb !important;
    text-decoration: none !important;
    font-weight: 700 !important;
    transition: color 0.15s ease-in-out !important;
}

.vinc-title-text a:hover {
    color: #1d4ed8 !important;
    text-decoration: underline !important;
}

/* Normalización de Breadcrumbs y Títulos clásicos del sistema */
nav[aria-label="breadcrumb"],
.breadcrumb,
ol.breadcrumb,
ul.breadcrumb {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 0 0.5rem 0 !important;
    margin-bottom: 0.5rem !important;
    border-radius: 0 !important;
}

.breadcrumb-item,
.breadcrumb-item.active {
    display: flex !important;
    align-items: center !important;
    color: inherit !important;
    padding-left: 0 !important;
}

.breadcrumb-item::before {
    display: none !important;
}

nav[aria-label="breadcrumb"] h4,
ol.breadcrumb h4,
ul.breadcrumb h4,
.breadcrumb h4,
.breadcrumb-item h4,
nav[aria-label="breadcrumb"] h3,
ol.breadcrumb h3,
.breadcrumb-item h3,
nav[aria-label="breadcrumb"] h5,
ol.breadcrumb h5,
.breadcrumb-item h5 {
    display: inline-flex !important;
    align-items: center !important;
    gap: 12px !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    letter-spacing: -0.02em !important;
    margin-bottom: 0 !important;
    line-height: 1.2 !important;
}

/* --- ICONOS DE TÍTULOS Y CABECERAS MODERNOS (AZUL MÉDICO) --- */
.WM-IconTitle,
.WM-IconTitle-tando,
.WM-IconTitle-msm,
i.tnd-primary-icon,
span.tnd-primary-icon,
.vinc-title-icon-box,
nav[aria-label="breadcrumb"] h1 > i,
nav[aria-label="breadcrumb"] h2 > i,
nav[aria-label="breadcrumb"] h3 > i,
nav[aria-label="breadcrumb"] h4 > i,
nav[aria-label="breadcrumb"] h5 > i,
nav[aria-label="breadcrumb"] h6 > i,
.breadcrumb h1 > i,
.breadcrumb h2 > i,
.breadcrumb h3 > i,
.breadcrumb h4 > i,
.breadcrumb h5 > i,
.breadcrumb h6 > i,
.breadcrumb-item h1 > i,
.breadcrumb-item h2 > i,
.breadcrumb-item h3 > i,
.breadcrumb-item h4 > i,
.breadcrumb-item h5 > i,
.breadcrumb-item h6 > i,
.page-holder h1 > i:first-child,
.page-holder h2 > i:first-child,
.page-holder h3 > i:first-child,
.page-holder h4 > i:first-child,
.page-holder h5 > i:first-child,
.page-holder h6 > i:first-child,
.modal-title > i:first-child,
.modal-header h4 > i,
.modal-header h5 > i,
.card-header h4 > i,
.card-header h5 > i,
.card-header h6 > i,
nav > ol > li > h4 > i,
nav > ol > li > h5 > i {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    max-width: 38px !important;
    max-height: 38px !important;
    border-radius: 8px !important;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%) !important;
    background-color: #eff6ff !important;
    border: 1px solid #bfdbfe !important;
    color: #2563eb !important;
    -webkit-text-fill-color: #2563eb !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.10rem !important;
    box-shadow: 0 2px 5px rgba(37, 99, 235, 0.10) !important;
    margin-right: 0.65rem !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    vertical-align: middle !important;
}

.text-primary-tando,
.tnd-primary-icon-color,
strong.tnd-primary-icon-color {
    color: #2563eb !important;
    -webkit-text-fill-color: #2563eb !important;
    font-weight: 600 !important;
    display: inline-block !important;
    width: auto !important;
    height: auto !important;
    min-width: auto !important;
    min-height: auto !important;
    max-width: none !important;
    max-height: none !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.tnd-primary-icon-color i,
strong.tnd-primary-icon-color i {
    color: #2563eb !important;
    -webkit-text-fill-color: #2563eb !important;
    margin-right: 4px !important;
    width: auto !important;
    height: auto !important;
    min-width: auto !important;
    min-height: auto !important;
    display: inline !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Tarjetas métricas Callout (p. ej. en Home.aspx y Dashboards) */
.bd-callout,
.bd-callout.border-left-primary {
    background-color: #ffffff !important;
    border-radius: 10px !important;
    border: 1px solid #e2e8f0 !important;
    border-left: 4px solid #2563eb !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    padding: 1rem 1.25rem !important;
    margin-top: 0.5rem !important;
    margin-bottom: 0.75rem !important;
    transition: all 0.2s ease-in-out !important;
}

.bd-callout:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07) !important;
    border-color: #cbd5e1 !important;
    border-left-color: #2563eb !important;
}

.bd-callout strong.text-xl {
    font-size: 0.85rem !important;
    color: #475569 !important;
    font-weight: 600 !important;
    display: block !important;
    margin-bottom: 0.25rem !important;
}

.bd-callout strong.text-primary.text-lg {
    font-size: 1.65rem !important;
    color: #2563eb !important;
    font-weight: 800 !important;
    line-height: 1.1 !important;
    display: inline-block !important;
}

/* --- TARJETA PRINCIPAL CONTENEDORA --- */
.vinc-card {
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 15px -3px rgba(0, 0, 0, 0.05), 0 2px 6px -2px rgba(0, 0, 0, 0.02);
    background-color: #ffffff;
    overflow: hidden;
    margin-bottom: 2rem;
}

/* --- BARRA SUPERIOR DE ACCIONES Y BÚSQUEDA --- */
.vinc-header-bar {
    padding: 0.75rem 1.25rem;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.vinc-search-box {
    position: relative;
    min-width: 260px;
    max-width: 420px;
    flex: 1;
}

.vinc-search-box input {
    border-radius: 6px;
    padding-left: 2.2rem;
    font-size: 0.82rem;
    border: 1px solid #cbd5e1;
    transition: all 0.2s ease;
    height: 34px;
}

.vinc-search-box input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.vinc-search-box .search-icon {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    font-size: 0.82rem;
}

/* --- TABLAS: AJUSTE 100% SIN SCROLL HORIZONTAL --- */
.vinc-table-container {
    width: 100%;
    overflow-x: hidden;
}

.vinc-table {
    width: 100% !important;
    table-layout: fixed;
    margin-bottom: 0;
    color: #334155;
    font-size: 0.80rem;
    border-collapse: separate;
    border-spacing: 0;
}

.vinc-table thead th {
    background-color: #f8fafc !important;
    color: #475569;
    font-size: 0.69rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 9px 10px !important;
    border-bottom: 2px solid #e2e8f0 !important;
    border-top: none !important;
    vertical-align: middle;
    line-height: 1.25;
}

.vinc-table tbody td {
    padding: 8px 10px !important;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    line-height: 1.3;
    background-color: #ffffff;
    transition: background-color 0.15s ease;
    word-break: break-word;
    overflow-wrap: break-word;
}

.vinc-table tbody tr:hover td {
    background-color: #f8fafc;
}

/* Modal específico para ancho completo y scroll vertical controlado */
.vinc-modal-table-container {
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    max-height: 520px;
}

.vinc-modal-table {
    width: 100% !important;
    table-layout: fixed;
    margin-bottom: 0;
    color: #334155;
    font-size: 0.76rem;
    border-collapse: separate;
    border-spacing: 0;
}

.vinc-modal-table thead th {
    background-color: #f8fafc !important;
    color: #475569;
    font-size: 0.67rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 8px 8px !important;
    border-bottom: 2px solid #e2e8f0 !important;
    border-top: none !important;
    vertical-align: middle;
    line-height: 1.2;
}

.vinc-modal-table tbody td {
    padding: 7px 8px !important;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    line-height: 1.3;
    word-break: break-word;
    overflow-wrap: break-word;
}

.vinc-modal-table tbody tr:hover td {
    background-color: #f8fafc;
}

/* --- ANULACIÓN ESTRICTA DE GRADIENTES ROTOS EN TABLAS DE VINCULACIÓN --- */
.vinc-table .text-gradient, 
.vinc-modal-table .text-gradient,
.vinc-table .purple-love,
.vinc-modal-table .purple-love {
    background: none !important;
    -webkit-text-fill-color: initial !important;
    color: #0284c7 !important;
    font-size: 0.85rem !important;
}

/* --- PRESERVACIÓN DE DOCK DE ICONOS EN DEFAULT.ASPX --- */
.icons-container .icon-item .icon-badge-wrap i {
    font-size: 1.25rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.icons-container .icon-item i.fa-3x {
    font-size: 1.25rem !important;
    display: inline-block !important;
}

/* --- TIPOGRAFÍA Y FORMATO DE CELDAS --- */
.vinc-hosp-name {
    color: #0f172a;
    font-weight: 600;
    font-size: 0.81rem;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    line-height: 1.3;
}

.vinc-patient-name {
    color: #0f172a;
    font-weight: 600;
    font-size: 0.81rem;
    line-height: 1.3;
}

.vinc-doctor-name {
    color: #334155;
    font-size: 0.77rem;
    line-height: 1.3;
}

.vinc-date-text {
    color: #475569;
    font-size: 0.77rem;
    white-space: normal;
    line-height: 1.3;
}

.vinc-epi-badge {
    background-color: #f8fafc;
    color: #334155;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 1px 6px;
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-weight: 700;
    font-size: 0.76rem;
    letter-spacing: 0.02em;
    display: inline-block;
    line-height: 1.3;
}

/* --- BADGES SUAVES (SOFT BADGES) --- */
.badge-soft-info {
    background-color: #e0f2fe !important;
    color: #0369a1 !important;
    border: 1px solid #bae6fd !important;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.70rem;
}

.badge-soft-warning {
    background-color: #fef3c7 !important;
    color: #b45309 !important;
    border: 1px solid #fde68a !important;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.70rem;
}

.badge-soft-success {
    background-color: #dcfce7 !important;
    color: #15803d !important;
    border: 1px solid #bbf7d0 !important;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.70rem;
}

.badge-soft-danger {
    background-color: #fee2e2 !important;
    color: #b91c1c !important;
    border: 1px solid #fecaca !important;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.70rem;
}

.badge-soft-secondary {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
    border: 1px solid #e2e8f0 !important;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.70rem;
}

.badge-soft-primary {
    background-color: #eff6ff !important;
    color: #1d4ed8 !important;
    border: 1px solid #bfdbfe !important;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.70rem;
}

/* ==========================================================================
   RESET TOTAL Y ESPECIFICIDAD MÁXIMA DE ICONOS EN BOTONES
   Anula la regla global table.table td button > i de callmed.css (28x28px y fondo)
   ========================================================================== */
table.table.vinc-table tbody tr td button > i,
table.table.vinc-table tbody tr td a > i,
table.table.vinc-modal-table tbody tr td button > i,
body table.table td .vinc-action-group button > i,
body .btn-action-detail i,
body .btn-action-link i,
body .btn-action-govi i,
body .vinc-btn-close-modal i {
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: none !important;
    line-height: 1 !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 3px 0 0 !important;
    display: inline-block !important;
    transform: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
    vertical-align: 0 !important;
    font-size: 0.72rem !important;
}

table.table.vinc-table tbody tr td button:hover > i,
table.table.vinc-table tbody tr td a:hover > i,
table.table.vinc-modal-table tbody tr td button:hover > i,
body table.table td .vinc-action-group button:hover > i,
body .btn-action-detail:hover i,
body .btn-action-link:hover i,
body .btn-action-govi:hover i,
body .vinc-btn-close-modal:hover i {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
}

/* --- BOTONES DE ACCIÓN REFINADOS, SLIM Y ESTILIZADOS --- */
.vinc-action-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 3px;
}

.btn-action-detail {
    display: inline-flex;
    align-items: center;
    gap: 0px;
    background-color: #ffffff !important;
    color: #475569 !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 4px !important;
    padding: 2px 7px !important;
    font-size: 0.70rem !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    height: 23px !important;
    cursor: pointer !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
    transition: all 0.15s ease-in-out !important;
}
.btn-action-detail i {
    color: #0284c7 !important;
    font-size: 0.72rem !important;
}
.btn-action-detail:hover {
    background-color: #f0f9ff !important;
    border-color: #0284c7 !important;
    color: #0284c7 !important;
    box-shadow: 0 1px 3px rgba(2, 132, 199, 0.15) !important;
    transform: translateY(-1px) !important;
}
.btn-action-detail:hover i {
    color: #0284c7 !important;
}

.btn-action-link {
    display: inline-flex;
    align-items: center;
    gap: 0px;
    background-color: #2563eb !important;
    color: #ffffff !important;
    border: 1px solid #1d4ed8 !important;
    border-radius: 4px !important;
    padding: 2px 8px !important;
    font-size: 0.70rem !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    height: 23px !important;
    cursor: pointer !important;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.20) !important;
    transition: all 0.15s ease-in-out !important;
}
.btn-action-link i {
    color: #ffffff !important;
    font-size: 0.72rem !important;
}
.btn-action-link:hover {
    background-color: #1d4ed8 !important;
    border-color: #1e40af !important;
    color: #ffffff !important;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.30) !important;
    transform: translateY(-1px) !important;
}
.btn-action-link:hover i {
    color: #ffffff !important;
}

.btn-action-govi {
    display: inline-flex;
    align-items: center;
    gap: 0px;
    background-color: #059669 !important;
    color: #ffffff !important;
    border: 1px solid #047857 !important;
    border-radius: 4px !important;
    padding: 2px 8px !important;
    font-size: 0.71rem !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    height: 23px !important;
    cursor: pointer !important;
    box-shadow: 0 1px 2px rgba(16, 185, 129, 0.20) !important;
    transition: all 0.15s ease-in-out !important;
}
.btn-action-govi i {
    color: #ffffff !important;
    font-size: 0.72rem !important;
}
.btn-action-govi:hover {
    background-color: #047857 !important;
    color: #ffffff !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.30) !important;
}
.btn-action-govi:hover i {
    color: #ffffff !important;
}

/* --- MODALES --- */
.vinc-modal-header {
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 16px;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.vinc-modal-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
}

/* Botón cerrar modal con texto visible garantizado en hover */
.vinc-btn-close-modal {
    background-color: #f1f5f9 !important;
    color: #334155 !important;
    border: 1px solid #cbd5e1 !important;
    font-weight: 600 !important;
    font-size: 0.78rem !important;
    border-radius: 5px !important;
    padding: 4px 14px !important;
    cursor: pointer !important;
    transition: all 0.15s ease-in-out !important;
}

.vinc-btn-close-modal:hover,
.vinc-btn-close-modal:focus,
.vinc-btn-close-modal:active {
    background-color: #e2e8f0 !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
}

/* --- ESTADO VACÍO (EMPTY STATE) --- */
.vinc-empty-box {
    text-align: center;
    padding: 2.5rem 1.5rem;
}

.vinc-empty-icon {
    font-size: 2.5rem;
    color: #10b981;
    margin-bottom: 0.5rem;
}

.vinc-empty-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.2rem;
}

.vinc-empty-subtitle {
    font-size: 0.82rem;
    color: #64748b;
}

/* ==========================================================================
   ESTILOS ESPECÍFICOS PARA INBOX.ASPX (TICKETS Y QUEJAS)
   ========================================================================== */
#tbInbox {
    border-collapse: separate !important;
    border-spacing: 0 12px !important;
    background: transparent !important;
}

#tbInbox thead {
    display: none !important;
}

#tbInbox tbody tr {
    background: transparent !important;
}

#tbInbox tbody tr td {
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

/* Tarjeta individual de ticket en el listado */
.message.card {
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    background-color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
    padding: 1.15rem 1.5rem !important;
    transition: all 0.2s ease-in-out !important;
    margin-bottom: 0 !important;
}

.message.card:hover {
    border-color: #cbd5e1 !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.07) !important;
    transform: translateY(-1px) !important;
}

/* Avatar del afiliado en el ticket */
.message.card .img-circle.rounded-circle {
    width: 38px !important;
    height: 38px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%) !important;
    border: 1px solid #bfdbfe !important;
    color: #2563eb !important;
    font-weight: 700 !important;
    font-size: 0.88rem !important;
    box-shadow: none !important;
}

.message.card .img-circle.rounded-circle span {
    font-size: 0.88rem !important;
    color: #2563eb !important;
    font-weight: 700 !important;
}

/* Título y número de ticket */
.message.card h5 a {
    color: #0f172a !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    transition: color 0.15s ease !important;
}

.message.card h5 a:hover {
    color: #2563eb !important;
    text-decoration: underline !important;
}

.message.card h5 span.text-gray-800 {
    color: #2563eb !important;
    background-color: #eff6ff !important;
    border: 1px solid #bfdbfe !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-size: 0.82rem !important;
    margin-right: 6px !important;
}

/* Etiquetas y clasificaciones dentro del ticket */
.message.card .text-gradient.purple-love {
    background: #f0fdf4 !important;
    color: #166534 !important;
    border: 1px solid #bbf7d0 !important;
    border-radius: 4px !important;
    padding: 2px 8px !important;
    font-size: 0.76rem !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
}

.message.card .text-gradient.purple-love i {
    color: #16a34a !important;
    font-size: 0.72rem !important;
}

/* Paginación y buscador de DataTables */
.dataTables_wrapper .dataTables_length select {
    border-radius: 6px !important;
    border: 1px solid #cbd5e1 !important;
    padding: 4px 8px !important;
    font-size: 0.82rem !important;
}

.dataTables_wrapper .dataTables_filter input {
    border-radius: 6px !important;
    border: 1px solid #cbd5e1 !important;
    padding: 4px 10px !important;
    font-size: 0.82rem !important;
    height: 34px !important;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
    outline: none !important;
}

/* ==========================================================================
   INPUTS, SELECTS Y GRUPOS DE FORMULARIOS (ESTILO CLÍNICO AZUL WINMED ADMIN)
   ========================================================================== */
.form-control,
.custom-select,
.custom-file-label,
input[type="text"].form-control,
input[type="password"].form-control,
input[type="email"].form-control,
input[type="number"].form-control,
input[type="tel"].form-control,
input[type="search"].form-control,
input[type="date"].form-control,
select.form-control,
textarea.form-control {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    color: #334155 !important;
    padding: 0.55rem 0.95rem !important;
    font-size: 0.88rem !important;
    font-family: inherit !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
}

.form-control:hover,
.custom-select:hover,
.custom-file-label:hover,
input[type="text"].form-control:hover,
input[type="password"].form-control:hover,
input[type="email"].form-control:hover,
input[type="number"].form-control:hover,
select.form-control:hover,
textarea.form-control:hover {
    border-color: #94a3b8 !important;
}

/* FOCUS AZUL MÉDICO (ELIMINA DEFINITIVAMENTE BORDES MORADOS/PÚRPURAS) */
.form-control:focus,
.custom-select:focus,
.custom-file-input:focus ~ .custom-file-label,
input.form-control:focus,
input[type="text"].form-control:focus,
input[type="password"].form-control:focus,
input[type="email"].form-control:focus,
input[type="number"].form-control:focus,
input[type="tel"].form-control:focus,
input[type="search"].form-control:focus,
input[type="date"].form-control:focus,
select.form-control:focus,
textarea.form-control:focus,
#txtUser:focus,
#txtPassword:focus {
    background-color: #ffffff !important;
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.18) !important;
    outline: none !important;
    z-index: 3 !important;
}

/* GRUPOS DE ENTRADA (INPUT-GROUPS) */
.input-group-text {
    background-color: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #64748b !important;
    border-radius: 8px !important;
    padding: 0.55rem 0.95rem !important;
    font-size: 0.88rem !important;
    display: flex !important;
    align-items: center !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
    transition: border-color 0.15s ease-in-out, color 0.15s ease-in-out !important;
}

.input-group-text i,
.input-group-text .fa,
.input-group-text .fas {
    color: #64748b !important;
    font-size: 0.90rem !important;
    transition: color 0.15s ease-in-out !important;
}

/* Cuando el campo dentro del input-group tiene foco */
.input-group:focus-within .input-group-text {
    border-color: #2563eb !important;
    background-color: #eff6ff !important;
    color: #2563eb !important;
}

.input-group:focus-within .input-group-text i,
.input-group:focus-within .input-group-text .fa,
.input-group:focus-within .input-group-text .fas {
    color: #2563eb !important;
}

.input-group > .form-control:not(:last-child),
.input-group > .custom-select:not(:last-child) {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.input-group > .input-group-append > .input-group-text,
.input-group > .input-group-append > .btn {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-top-right-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
    border-left: none !important;
}

.input-group > .input-group-prepend > .input-group-text,
.input-group > .input-group-prepend > .btn {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-top-left-radius: 8px !important;
    border-bottom-left-radius: 8px !important;
    border-right: none !important;
}

.input-group > .form-control:not(:first-child),
.input-group > .custom-select:not(:first-child) {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

/* --- INPUTS DEL LOGIN (DEFAULT.ASPX) FOCO AZUL MÉDICO --- */
.card.login .input-group,
.login .input-group {
    border: 1px solid #cbd5e1 !important;
    border-radius: 10px !important;
    background-color: #f8fafc !important;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
    overflow: hidden !important;
}

.card.login .input-group:hover,
.login .input-group:hover {
    border-color: #94a3b8 !important;
}

.card.login .input-group:focus-within,
.login .input-group:focus-within {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.18) !important;
    background-color: #ffffff !important;
}

.card.login .input-group-text,
.login .input-group-text {
    background: transparent !important;
    border: none !important;
    padding-right: 0.5rem !important;
    padding-left: 1rem !important;
    box-shadow: none !important;
}

.card.login .input-group-text i,
.login .input-group-text i {
    font-size: 1.1rem !important;
    color: #94a3b8 !important;
    transition: color 0.15s ease-in-out !important;
}

.card.login .input-group:focus-within .input-group-text i,
.login .input-group:focus-within .input-group-text i {
    color: #2563eb !important;
}

.card.login .form-control,
.login .form-control {
    height: 48px !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    color: #1e293b !important;
    padding-left: 0.5rem !important;
}

.card.login .form-control:focus,
.login .form-control:focus {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* ==========================================================================
   RESET UNIVERSAL DE ICONOS DENTRO DE BOTONES (ELIMINA RECUADROS MORADOS)
   ========================================================================== */
body .btn i,
body button i,
body a.btn i,
body .btn > i,
body button > i,
body a.btn > i,
body table.table td button > i,
body table.table td a.btn > i,
body .card-header .btn i,
body .card-header button i,
body .modal-footer .btn i,
body .modal-footer button i,
body .sh-main-card .btn i,
body .sh-main-card button i {
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: none !important;
    line-height: 1 !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 4px 0 0 !important;
    display: inline-block !important;
    transform: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
    vertical-align: middle !important;
    font-size: 0.85rem !important;
    color: inherit !important;
}

body .btn:hover i,
body button:hover i,
body a.btn:hover i,
body .btn:hover > i,
body button:hover > i,
body a.btn:hover > i {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
    color: inherit !important;
}

/* ==========================================================================
   PALETA MODERNA DE BOTONES PROFESIONALES (CLINICAL SAAS)
   ========================================================================== */
/* ==========================================================================
   PALETA MODERNA DE BOTONES PROFESIONALES (CLINICAL SAAS)
   ========================================================================== */
/* Botón Primario Moderno (Azul Médico) */
html body #form1 .btn-primary,
html body #form1 a.btn-primary,
html body #form1 button.btn-primary,
html body .btn-primary,
html body a.btn-primary,
html body button.btn-primary,
#form1 .btn-primary,
.btn-primary {
    background-color: #2563eb !important;
    background-image: none !important;
    border: 1px solid #1d4ed8 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.20) !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    transition: all 0.15s ease-in-out !important;
}

html body #form1 .btn-primary:hover,
html body #form1 .btn-primary:focus,
html body #form1 .btn-primary:active,
html body .btn-primary:hover,
html body .btn-primary:focus,
html body .btn-primary:active,
#form1 .btn-primary:hover,
#form1 .btn-primary:focus,
#form1 .btn-primary:active,
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: #1d4ed8 !important;
    background-image: none !important;
    border-color: #1e40af !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.35) !important;
    transform: translateY(-1px) !important;
}

html body #form1 .btn-primary i,
html body #form1 .btn-primary span,
html body #form1 .btn-primary:hover i,
html body #form1 .btn-primary:hover span,
html body .btn-primary i,
html body .btn-primary span,
html body .btn-primary:hover i,
html body .btn-primary:hover span,
#form1 .btn-primary i,
#form1 .btn-primary span,
.btn-primary i,
.btn-primary span {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Botón de Éxito / Guardar / Acción Positiva (Verde Esmeralda) */
html body #form1 .btn-success,
html body #form1 .btn-green,
html body #form1 a.btn-success,
html body #form1 button.btn-success,
html body .btn-success,
html body .btn-green,
html body a.btn-success,
html body button.btn-success,
body #btnActualizaProcHosp,
body #btnCrear,
body #btnNuevo,
#form1 .btn-success,
.btn-success {
    background-color: #059669 !important;
    background-image: none !important;
    border: 1px solid #047857 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    box-shadow: 0 1px 3px rgba(5, 150, 105, 0.20) !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    transition: all 0.15s ease-in-out !important;
}

html body #form1 .btn-success:hover,
html body #form1 .btn-success:focus,
html body #form1 .btn-success:active,
html body .btn-success:hover,
html body .btn-success:focus,
html body .btn-success:active,
body #btnActualizaProcHosp:hover,
body #btnCrear:hover,
body #btnNuevo:hover,
#form1 .btn-success:hover,
.btn-success:hover {
    background-color: #047857 !important;
    border-color: #065f46 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    box-shadow: 0 3px 8px rgba(5, 150, 105, 0.35) !important;
    transform: translateY(-1px) !important;
}

html body #form1 .btn-success i,
html body #form1 .btn-success span,
html body .btn-success i,
html body .btn-success span,
body #btnActualizaProcHosp i,
#form1 .btn-success i,
.btn-success i {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Botón de Información / Acción Secundaria (Cian / Azul Claro) */
html body #form1 .btn-info,
html body #form1 .btn-blue,
html body #form1 a.btn-info,
html body #form1 button.btn-info,
html body .btn-info,
html body .btn-blue,
html body a.btn-info,
html body button.btn-info,
#form1 .btn-info,
.btn-info {
    background-color: #0284c7 !important;
    background-image: none !important;
    border: 1px solid #0369a1 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    box-shadow: 0 1px 3px rgba(2, 132, 199, 0.20) !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    transition: all 0.15s ease-in-out !important;
}

html body #form1 .btn-info:hover,
html body #form1 .btn-info:focus,
html body #form1 .btn-info:active,
html body .btn-info:hover,
html body .btn-info:focus,
html body .btn-info:active,
#form1 .btn-info:hover,
.btn-info:hover {
    background-color: #0369a1 !important;
    border-color: #075985 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    box-shadow: 0 3px 8px rgba(2, 132, 199, 0.35) !important;
    transform: translateY(-1px) !important;
}

html body #form1 .btn-info i,
html body #form1 .btn-info span,
html body .btn-info i,
html body .btn-info span,
#form1 .btn-info i,
.btn-info i {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Botón de Peligro / Desvincular / Eliminar (Rojo Carmesí) */
html body #form1 .btn-danger,
html body #form1 .btn-red,
html body #form1 a.btn-danger,
html body #form1 button.btn-danger,
html body .btn-danger,
html body .btn-red,
html body a.btn-danger,
html body button.btn-danger,
#form1 .btn-danger,
.btn-danger {
    background-color: #dc2626 !important;
    background-image: none !important;
    border: 1px solid #b91c1c !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    box-shadow: 0 1px 3px rgba(220, 38, 38, 0.20) !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    transition: all 0.15s ease-in-out !important;
}

html body #form1 .btn-danger:hover,
html body #form1 .btn-danger:focus,
html body #form1 .btn-danger:active,
html body .btn-danger:hover,
html body .btn-danger:focus,
html body .btn-danger:active,
#form1 .btn-danger:hover,
.btn-danger:hover {
    background-color: #b91c1c !important;
    border-color: #991b1b !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    box-shadow: 0 3px 8px rgba(220, 38, 38, 0.35) !important;
    transform: translateY(-1px) !important;
}

html body #form1 .btn-danger i,
html body #form1 .btn-danger span,
html body .btn-danger i,
html body .btn-danger span,
#form1 .btn-danger i,
.btn-danger i {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Botones Deshabilitados (Disabled) */
html body #form1 .btn:disabled,
html body #form1 .btn.disabled,
html body .btn:disabled,
html body .btn.disabled,
.btn:disabled,
.btn.disabled,
button:disabled {
    background-color: #cbd5e1 !important;
    border-color: #cbd5e1 !important;
    color: #94a3b8 !important;
    -webkit-text-fill-color: #94a3b8 !important;
    opacity: 0.70 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    transform: none !important;
}

html body #form1 .btn:disabled i,
html body #form1 .btn:disabled span,
html body .btn:disabled i,
html body .btn:disabled span,
.btn:disabled i,
.btn:disabled span {
    color: #94a3b8 !important;
    -webkit-text-fill-color: #94a3b8 !important;
}

/* Botones Outline Refinados */
body .btn-outline-primary {
    background-color: #ffffff !important;
    border: 1px solid #2563eb !important;
    color: #2563eb !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}
body .btn-outline-primary:hover {
    background-color: #eff6ff !important;
    border-color: #1d4ed8 !important;
    color: #1d4ed8 !important;
    box-shadow: 0 2px 5px rgba(37, 99, 235, 0.15) !important;
    transform: translateY(-1px) !important;
}
body .btn-outline-primary i,
body .btn-outline-primary:hover i {
    color: inherit !important;
}

body .btn-outline-success {
    background-color: #ffffff !important;
    border: 1px solid #059669 !important;
    color: #059669 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}
body .btn-outline-success:hover {
    background-color: #f0fdf4 !important;
    border-color: #047857 !important;
    color: #047857 !important;
    box-shadow: 0 2px 5px rgba(5, 150, 105, 0.15) !important;
    transform: translateY(-1px) !important;
}
body .btn-outline-success i,
body .btn-outline-success:hover i {
    color: inherit !important;
}

body .btn-outline-danger {
    background-color: #ffffff !important;
    border: 1px solid #dc2626 !important;
    color: #dc2626 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}
body .btn-outline-danger:hover {
    background-color: #fef2f2 !important;
    border-color: #b91c1c !important;
    color: #b91c1c !important;
    box-shadow: 0 2px 5px rgba(220, 38, 38, 0.15) !important;
    transform: translateY(-1px) !important;
}
body .btn-outline-info {
    background-color: #ffffff !important;
    border: 1px solid #0284c7 !important;
    color: #0284c7 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}
body .btn-outline-info:hover {
    background-color: #f0f9ff !important;
    border-color: #0369a1 !important;
    color: #0369a1 !important;
    box-shadow: 0 2px 5px rgba(2, 132, 199, 0.15) !important;
    transform: translateY(-1px) !important;
}
body .btn-outline-info i,
body .btn-outline-info:hover i {
    color: inherit !important;
}

body .btn-outline-warning {
    background-color: #ffffff !important;
    border: 1px solid #d97706 !important;
    color: #d97706 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}
body .btn-outline-warning:hover {
    background-color: #fffbeb !important;
    border-color: #b45309 !important;
    color: #b45309 !important;
    box-shadow: 0 2px 5px rgba(217, 119, 6, 0.15) !important;
    transform: translateY(-1px) !important;
}
body .btn-outline-warning i,
body .btn-outline-warning:hover i {
    color: inherit !important;
}

body .btn-outline-secondary,
body .btn-outline-dark {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #475569 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}
body .btn-outline-secondary:hover,
body .btn-outline-dark:hover {
    background-color: #f8fafc !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08) !important;
    transform: translateY(-1px) !important;
}
body .btn-outline-secondary i,
body .btn-outline-secondary:hover i,
body .btn-outline-dark i,
body .btn-outline-dark:hover i {
    color: inherit !important;
}

/* Encabezados de Sección Clínicos */
.sh-main-card .card-header h5 {
    color: #0f172a !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
}
.sh-main-card .card-header h5 i {
    color: #2563eb !important;
}

/* ==========================================================================
   MENU LATERAL COLAPSADO / SHRINK (MODO COMPACTO ELEGANTE)
   ========================================================================== */
.sidebar.shrink,
#sidebar.shrink {
    width: 72px !important;
    min-width: 72px !important;
    max-width: 72px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    overflow-x: hidden !important;
    transition: all 0.2s ease-in-out !important;
}

.sidebar.shrink .sidebar-link,
#sidebar.shrink .sidebar-link,
.sidebar.shrink ul.sidebar-menu .sidebar-link,
#sidebar.shrink ul.sidebar-menu .sidebar-link {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.65rem 0.25rem !important;
    margin: 0.25rem 0.45rem !important;
    border-radius: 10px !important;
    text-align: center !important;
    width: auto !important;
    min-height: 46px !important;
    position: relative !important;
}

.sidebar.shrink .sidebar-link i,
#sidebar.shrink .sidebar-link i,
.sidebar.shrink ul.sidebar-menu .sidebar-link i,
#sidebar.shrink ul.sidebar-menu .sidebar-link i,
.sidebar.shrink .sidebar-link .sidebarMnIcon,
#sidebar.shrink .sidebar-link .sidebarMnIcon {
    margin: 0 !important;
    margin-right: 0 !important;
    width: auto !important;
    font-size: 1.25rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Ocultar etiquetas de texto para evitar encimamiento */
.sidebar.shrink .sidebar-link span:not(.badge),
#sidebar.shrink .sidebar-link span:not(.badge),
.sidebar.shrink ul.sidebar-menu .sidebar-link span:not(.badge),
#sidebar.shrink ul.sidebar-menu .sidebar-link span:not(.badge) {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Ocultar carets / flechas de submenú */
.sidebar.shrink .sidebar-link::after,
#sidebar.shrink .sidebar-link::after,
.sidebar.shrink .sidebar-link .fa-angle-down,
#sidebar.shrink .sidebar-link .fa-angle-down,
.sidebar.shrink .sidebar-link .fa-chevron-down,
#sidebar.shrink .sidebar-link .fa-chevron-down {
    display: none !important;
}

/* Ocultar acordeones de submenús en modo colapsado */
.sidebar.shrink .collapse,
#sidebar.shrink .collapse,
.sidebar.shrink .collapse.show,
#sidebar.shrink .collapse.show {
    display: none !important;
}

/* Submenús activos en modo expandido */
#sidebar .collapse .sidebar-link.active,
.sidebar .collapse .sidebar-link.active,
#sidebar .collapse .sidebar-link:focus,
.sidebar .collapse .sidebar-link:focus {
    background: #eff6ff !important;
    color: #2563eb !important;
    font-weight: 700 !important;
    border-radius: 4px 8px 8px 4px !important;
    border-left: 3.5px solid #2563eb !important;
}

/* Estado activo en modo colapsado */
.sidebar.shrink .sidebar-link.active,
#sidebar.shrink .sidebar-link.active,
.sidebar.shrink ul.sidebar-menu .sidebar-link.active,
#sidebar.shrink ul.sidebar-menu .sidebar-link.active {
    background: #eff6ff !important;
    color: #2563eb !important;
    border-left: none !important;
    border-radius: 10px !important;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.10) !important;
}
.sidebar.shrink .sidebar-link.active i,
#sidebar.shrink .sidebar-link.active i {
    color: #2563eb !important;
}

/* Badge numérico en modo colapsado (pip compacto en la esquina superior) */
.sidebar.shrink .sidebar-link .badge,
#sidebar.shrink .sidebar-link .badge,
.sidebar.shrink .sidebar-link span.badge,
#sidebar.shrink .sidebar-link span.badge {
    position: absolute !important;
    top: 3px !important;
    right: 5px !important;
    min-width: 16px !important;
    height: 16px !important;
    line-height: 14px !important;
    padding: 0 4px !important;
    font-size: 0.60rem !important;
    border-radius: 8px !important;
    margin: 0 !important;
}

/* ==========================================================================
   BOTONES DE TABLA Y ACCIÓN - ALTO CONTRASTE Y RESET DE ICONOS
   ========================================================================== */
body .btn-light,
body a.btn-light,
body button.btn-light,
body table.table td .btn,
body table.table td button,
body table.dataTable td .btn,
body table.dataTable td button {
    background-color: #ffffff !important;
    background-image: none !important;
    border: 1px solid #cbd5e1 !important;
    color: #2563eb !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
    transition: all 0.15s ease-in-out !important;
}

body .btn-light:hover,
body a.btn-light:hover,
body button.btn-light:hover,
body .btn-light:focus,
body .btn-light:active,
body table.table td .btn:hover,
body table.table td button:hover,
body table.dataTable td .btn:hover,
body table.dataTable td button:hover {
    background-color: #2563eb !important;
    background-image: none !important;
    border-color: #1d4ed8 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.30) !important;
    transform: translateY(-1px) !important;
}

body .btn-light i,
body table.table td .btn i,
body table.table td button i {
    color: #2563eb !important;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

body .btn-light:hover i,
body .btn-light:focus i,
body .btn-light:active i,
body table.table td .btn:hover i,
body table.table td button:hover i,
body table.dataTable td .btn:hover i,
body table.dataTable td button:hover i {
    color: #ffffff !important;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.text-primary, i.text-primary, span.text-primary, a.text-primary {
    color: #2563eb !important;
}

/* ==========================================================================
   SWITCHES / TOGGLES ELEGANTES EN AZUL MÉDICO (#2563eb)
   ========================================================================== */
.custom-switch {
    padding-left: 2.85rem !important;
    min-height: 1.65rem !important;
    display: inline-flex !important;
    align-items: center !important;
}

.custom-switch .custom-control-label {
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    color: #334155 !important;
    cursor: pointer !important;
    margin-bottom: 0 !important;
    line-height: 1.5 !important;
}

.custom-switch .custom-control-label::before {
    left: -2.85rem !important;
    width: 2.25rem !important;
    height: 1.25rem !important;
    border-radius: 999px !important;
    border: 1px solid #cbd5e1 !important;
    background: #cbd5e1 !important;
    background-color: #cbd5e1 !important;
    background-image: none !important;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out !important;
    box-shadow: none !important;
}

.custom-switch .custom-control-label::after {
    left: calc(-2.85rem + 2px) !important;
    top: calc(0.2rem + 2px) !important;
    width: calc(1.25rem - 4px) !important;
    height: calc(1.25rem - 4px) !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15) !important;
    transition: transform 0.15s ease-in-out !important;
}

.custom-control-input:checked ~ .custom-control-label::before,
.custom-switch .custom-control-input:checked ~ .custom-control-label::before,
.custom-checkbox .custom-control-input:checked ~ .custom-control-label::before,
.custom-radio .custom-control-input:checked ~ .custom-control-label::before {
    background: #356aae !important;
    background-color: #356aae !important;
    background-image: none !important;
    border-color: #2c5a96 !important;
    box-shadow: none !important;
}

.custom-switch .custom-control-input:checked ~ .custom-control-label::after {
    transform: translateX(1rem) !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12) !important;
}

.custom-control-input:focus ~ .custom-control-label::before,
.custom-switch .custom-control-input:focus ~ .custom-control-label::before {
    box-shadow: 0 0 0 2px rgba(53, 106, 174, 0.20) !important;
    border-color: #356aae !important;
}

/* ==========================================================================
   MODAL DE CARGA MODERNO (WM MODERN CLINICAL LOADER)
   ========================================================================== */
#dialogLoadingGral {
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    background: rgba(15, 23, 42, 0.40) !important;
}

#dialogLoadingGral .modal-dialog,
.wm-loader-dialog {
    max-width: 330px !important;
    margin: 1.75rem auto !important;
}

#dialogLoadingGral .modal-content,
.wm-loader-content {
    background: #ffffff !important;
    border-radius: 16px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.10) !important;
    overflow: hidden !important;
}

.wm-loader-spinner-wrap {
    position: relative;
    width: 58px;
    height: 58px;
    margin: 0 auto 0.85rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wm-loader-spinner {
    width: 58px;
    height: 58px;
    border: 3px solid #eff6ff;
    border-top: 3px solid #2563eb;
    border-right: 3px solid #3b82f6;
    border-radius: 50%;
    animation: wmSpin 0.9s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
}

.wm-loader-icon-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #2563eb;
    font-size: 1.25rem;
    animation: wmPulse 1.8s ease-in-out infinite;
}

.wm-loader-title {
    color: #0f172a !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.01em !important;
    margin-bottom: 0.20rem !important;
    line-height: 1.3 !important;
}

.wm-loader-subtitle {
    color: #64748b !important;
    font-size: 0.78rem !important;
    font-weight: 400 !important;
}

.wm-loader-progress-bar {
    width: 100%;
    height: 4px;
    background-color: #eff6ff;
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.wm-loader-progress-indeterminate {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    background: linear-gradient(90deg, #2563eb, #60a5fa, #2563eb);
    border-radius: 999px;
    animation: wmProgressIndeterminate 1.6s ease-in-out infinite;
}

@keyframes wmSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes wmPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.85; }
    50% { transform: translate(-50%, -50%) scale(1.18); opacity: 1; color: #1d4ed8; }
}

@keyframes wmProgressIndeterminate {
    0% { left: -40%; width: 40%; }
    50% { left: 30%; width: 60%; }
    100% { left: 100%; width: 40%; }
}

/* ==========================================================================
   SWEETALERT2 MODAL DE CARGA MODERNO (SWEETALERT2 MODERN CLINICAL LOADER)
   ========================================================================== */
.swal2-container.swal2-backdrop-show {
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
    background: rgba(15, 23, 42, 0.40) !important;
}

.swal2-popup.swal2-loading {
    background: #ffffff !important;
    border-radius: 16px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.10) !important;
    max-width: 330px !important;
    width: 330px !important;
    min-width: 0 !important;
    padding: 1.75rem 1.5rem !important;
    overflow: hidden !important;
}

.swal2-popup.swal2-loading .swal2-title {
    color: #0f172a !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.01em !important;
    margin: 0 0 0.35rem 0 !important;
    padding: 0 !important;
    line-height: 1.3 !important;
}

.swal2-popup.swal2-loading .swal2-html-container {
    color: #64748b !important;
    font-size: 0.82rem !important;
    font-weight: 400 !important;
    margin: 0 0 1rem 0 !important;
    padding: 0 !important;
    line-height: 1.4 !important;
}

.swal2-popup.swal2-loading .swal2-actions {
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

.swal2-popup.swal2-loading .swal2-loader {
    width: 54px !important;
    height: 54px !important;
    margin: 0.5rem auto 0 auto !important;
    border: 3.5px solid #eff6ff !important;
    border-top: 3.5px solid #2563eb !important;
    border-right: 3.5px solid #3b82f6 !important;
    border-radius: 50% !important;
    animation: wmSpin 0.9s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite !important;
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.12) !important;
}

/* SweetAlert2 General Modern Style (Confirmaciones, Modales, OTP y Alertas) */
.swal2-popup:not(.swal2-loading) {
    width: 32em !important;
    max-width: 500px !important;
    min-width: 440px !important;
    padding: 2rem 2.2rem !important;
    border-radius: 20px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25) !important;
    background: #ffffff !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

@media (max-width: 520px) {
    .swal2-popup:not(.swal2-loading) {
        min-width: 0 !important;
        width: 92vw !important;
        padding: 1.5rem 1.25rem !important;
    }
}

.swal2-popup .swal2-title {
    color: #0f172a !important;
    font-weight: 700 !important;
    font-size: 1.35rem !important;
    margin-bottom: 0.75rem !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

.swal2-popup .swal2-html-container {
    color: #475569 !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    line-height: 1.55 !important;
    font-size: 0.95rem !important;
    margin: 0.5rem 0 1.25rem 0 !important;
}

.swal2-popup .swal2-input {
    height: 46px !important;
    padding: 0.5rem 1rem !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 10px !important;
    font-size: 1.05rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.05em !important;
    color: #0f172a !important;
    margin: 1.25rem auto !important;
    width: 100% !important;
    max-width: 320px !important;
    box-sizing: border-box !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
    transition: all 0.15s ease !important;
    text-align: center !important;
}

.swal2-popup .swal2-input:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.18) !important;
    outline: none !important;
}

.swal2-popup .swal2-actions {
    margin: 1.25rem 0 0 0 !important;
    gap: 10px !important;
}

.swal2-popup .swal2-styled.swal2-confirm,
.swal2-styled.swal2-confirm,
.swal2-confirm {
    background-color: #2563eb !important;
    background-image: none !important;
    border: 1px solid #1d4ed8 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 0.90rem !important;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35) !important;
    padding: 0.6rem 1.6rem !important;
    transition: all 0.15s ease-in-out !important;
}

.swal2-popup .swal2-styled.swal2-confirm:hover,
.swal2-styled.swal2-confirm:hover,
.swal2-confirm:hover {
    background-color: #1d4ed8 !important;
    border-color: #1e40af !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.40) !important;
    transform: translateY(-1px) !important;
}

.swal2-popup .swal2-styled.swal2-cancel,
.swal2-styled.swal2-cancel,
.swal2-cancel {
    background-color: #ffffff !important;
    background-image: none !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
    -webkit-text-fill-color: #334155 !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 0.90rem !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
    padding: 0.6rem 1.6rem !important;
    transition: all 0.15s ease-in-out !important;
}

.swal2-popup .swal2-styled.swal2-cancel:hover,
.swal2-styled.swal2-cancel:hover,
.swal2-cancel:hover {
    background-color: #f8fafc !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a !important;
}

/* --- BOTONES DE FULLCALENDAR / AGENDA EN AZUL MÉDICO --- */
.fc .fc-button,
.fc .fc-button-primary,
.fc-button,
.fc-button-primary,
.fc-button-group > .fc-button {
    background-color: #ffffff !important;
    background-image: none !important;
    border: 1px solid #cbd5e1 !important;
    color: #2563eb !important;
    -webkit-text-fill-color: #2563eb !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    font-size: 0.82rem !important;
    padding: 0.35rem 0.75rem !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
    transition: all 0.15s ease-in-out !important;
    text-transform: capitalize !important;
}

.fc .fc-button:hover,
.fc .fc-button-primary:hover,
.fc-button:hover,
.fc-button-primary:hover {
    background-color: #eff6ff !important;
    border-color: #2563eb !important;
    color: #1d4ed8 !important;
    -webkit-text-fill-color: #1d4ed8 !important;
    box-shadow: 0 2px 5px rgba(37, 99, 235, 0.15) !important;
}

.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active,
.fc-button.fc-button-active,
.fc-button:active,
.fc-state-active {
    background-color: #2563eb !important;
    background-image: none !important;
    border-color: #1d4ed8 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.30) !important;
}

/* ==========================================================================
   BARRA SUPERIOR MODERNA (MODERN CLINICAL TOPBAR / HEADER)
   ========================================================================== */
header.header {
    position: sticky !important;
    top: 0 !important;
    z-index: 1030 !important;
}

header.header nav.navbar,
.wm-topbar-nav {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.02) !important;
    padding: 0.60rem 1.5rem !important;
    min-height: 64px !important;
    display: flex !important;
    align-items: center !important;
}

/* Sidebar Toggler & Logo */
.sidebar-toggler {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.85rem !important;
    text-decoration: none !important;
    margin-right: 1.5rem !important;
}

.sidebar-toggler .dark-logo,
.sidebar-toggler img {
    height: 38px !important;
    max-height: 38px !important;
    width: auto !important;
    object-fit: contain !important;
    transition: transform 0.2s ease !important;
}

.sidebar-toggler .dark-logo:hover {
    transform: scale(1.02);
}

.sidebar-toggler i.fa-align-left,
.sidebar-toggler i.fa-bars,
.sidebar-toggler i.fas {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 8px !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #475569 !important;
    font-size: 0.90rem !important;
    transition: all 0.2s ease !important;
}

.sidebar-toggler:hover i.fa-align-left,
.sidebar-toggler:hover i.fa-bars,
.sidebar-toggler:hover i.fas {
    background: #eff6ff !important;
    border-color: #bfdbfe !important;
    color: #2563eb !important;
    box-shadow: 0 2px 5px rgba(37, 99, 235, 0.15) !important;
    transform: translateY(-1px);
}

/* Badge Central / Módulo (Administración / Consulta Electrónica) */
#lblHdTipoAdministradora,
header.header .navbar-brand {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.55rem !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    color: #0f172a !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 999px !important;
    padding: 0.35rem 1.15rem !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02) !important;
    margin-right: 1.5rem !important;
}

#lblHdTipoAdministradora::before,
header.header .navbar-brand::before {
    content: "" !important;
    display: inline-block !important;
    width: 7px !important;
    height: 7px !important;
    border-radius: 50% !important;
    background-color: #2563eb !important;
    box-shadow: 0 0 0 2.5px rgba(37, 99, 235, 0.20) !important;
}

/* Botón de Notificaciones (Campana) */
#notifications {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    height: 38px !important;
    border-radius: 10px !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #64748b !important;
    position: relative !important;
    padding: 0 !important;
    transition: all 0.2s ease !important;
}

#notifications i.fa-bell,
#notifications i.fas {
    font-size: 1.05rem !important;
    color: #64748b !important;
    transition: color 0.2s ease !important;
}

#notifications:hover {
    background: #eff6ff !important;
    border-color: #bfdbfe !important;
    color: #2563eb !important;
}

#notifications:hover i.fa-bell,
#notifications:hover i.fas {
    color: #2563eb !important;
}

#notifications::after {
    display: none !important;
}

.notification-icon {
    position: absolute !important;
    top: 7px !important;
    right: 7px !important;
    width: 8px !important;
    height: 8px !important;
    background-color: #ef4444 !important;
    border: 2px solid #ffffff !important;
    border-radius: 50% !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25) !important;
}

/* Cápsula de Usuario (User Pill) */
#userInfo {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.65rem !important;
    padding: 0.25rem 0.85rem 0.25rem 0.35rem !important;
    border-radius: 999px !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
    font-weight: 600 !important;
    font-size: 0.84rem !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
}

#userInfo:hover {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04) !important;
}

#userInfo #ImLogo,
#userInfo img {
    width: 32px !important;
    height: 32px !important;
    max-width: 32px !important;
    border-radius: 50% !important;
    border: 2px solid #ffffff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.10) !important;
    object-fit: cover !important;
    margin-right: 0 !important;
}

#userInfo #lblNmAdmUser {
    color: #0f172a !important;
    font-weight: 600 !important;
    font-size: 0.84rem !important;
    letter-spacing: -0.01em !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

#userInfo,
#userInfo span:not(.fa):not([class*="fa-"]),
#userInfo strong,
#userInfo small,
header.header .navbar-brand,
header.header .nav-link {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

#userInfo::after {
    margin-left: 0.25rem !important;
    color: #94a3b8 !important;
    vertical-align: middle !important;
    font-size: 0.75rem !important;
}

/* Dropdown Menus del Header */
header.header .dropdown-menu {
    border-radius: 12px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.10), 0 8px 10px -6px rgba(0, 0, 0, 0.04) !important;
    padding: 0.5rem !important;
    margin-top: 0.5rem !important;
    background: #ffffff !important;
}

header.header .dropdown-item {
    border-radius: 8px !important;
    padding: 0.5rem 0.85rem !important;
    font-size: 0.84rem !important;
    font-weight: 500 !important;
    color: #334155 !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    transition: all 0.15s ease !important;
}

header.header .dropdown-item:hover {
    background-color: #eff6ff !important;
    color: #2563eb !important;
}

header.header .dropdown-item i {
    font-size: 0.90rem !important;
    width: 18px !important;
    text-align: center !important;
}

header.header .dropdown-divider {
    border-top: 1px solid #f1f5f9 !important;
    margin: 0.35rem 0 !important;
}

/* ==========================================================================
   TIMEPICKER / BOOTSTRAP DATETIMEPICKER MODERNO (CLOCK DIAL)
   ========================================================================== */
.bootstrap-datetimepicker-widget.dropdown-menu {
    width: 294px !important;
    min-width: 294px !important;
    max-width: 310px !important;
    padding: 12px !important;
    border-radius: 16px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 12px 30px -5px rgba(0, 0, 0, 0.15), 0 4px 10px -2px rgba(0, 0, 0, 0.05) !important;
    background: #ffffff !important;
    z-index: 9999999 !important;
    outline: none !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

.bootstrap-datetimepicker-widget .list-unstyled {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.bootstrap-datetimepicker-widget .timepicker {
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 20px !important;
    margin: 0 auto !important;
    padding: 8px 4px !important;
    background-color: #f8fafc !important;
    display: block !important;
}

.bootstrap-datetimepicker-widget table {
    width: 100% !important;
    margin: 0 auto !important;
    border-collapse: collapse !important;
}

.bootstrap-datetimepicker-widget table td {
    height: auto !important;
    line-height: inherit !important;
    width: auto !important;
    padding: 2px !important;
    vertical-align: middle !important;
    text-align: center !important;
    border: none !important;
}

.bdpw-clock-digit, 
.bdpw-timepicker-btn {
    width: 32px !important;
    height: 36px !important;
    line-height: 36px !important;
    text-align: center !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    margin: 0 !important;
    display: inline-block !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    box-sizing: border-box !important;
}

.bdpw-clock-digit {
    color: #475569 !important;
}

.bdpw-clock-digit:hover {
    background-color: #eff6ff !important;
    color: #2563eb !important;
}

.bdpw-clock-digit.center {
    color: #0f172a !important;
    font-weight: 800 !important;
    font-size: 1.15rem !important;
}

.bdpw-clock-digit.cursor {
    background-color: #2563eb !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-weight: 700 !important;
}

.bdpw-clock-digit.left {
    position: relative !important;
    left: -6px !important;
}

.bdpw-clock-digit.right {
    position: relative !important;
    left: 6px !important;
}

.bdpw-clock-digit.top {
    position: relative !important;
    top: -4px !important;
}

.bdpw-clock-digit.bottom {
    position: relative !important;
    top: 4px !important;
}

.bdpw-timepicker-btn {
    color: #2563eb !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.bdpw-timepicker-btn:hover {
    background-color: #eff6ff !important;
    color: #1d4ed8 !important;
}

.bdpw-timepicker-btn i,
.bdpw-timepicker-btn span {
    font-size: 0.95rem !important;
    color: #2563eb !important;
}

.bootstrap-datetimepicker-widget table td span.bdpw-timepicker-colon {
    display: inline !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    font-size: 1.15rem !important;
    padding: 0 2px !important;
}

.bootstrap-datetimepicker-widget button[data-action="togglePeriod"],
.bootstrap-datetimepicker-widget .btn-primary[data-action="togglePeriod"] {
    background-color: #2563eb !important;
    border: 1px solid #1d4ed8 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 0.85rem !important;
    border-radius: 6px !important;
    padding: 2px 6px !important;
    height: 32px !important;
    cursor: pointer !important;
}

.bootstrap-datetimepicker-widget button[data-action="togglePeriod"]:hover {
    background-color: #1d4ed8 !important;
}

/* ==========================================================================
   PESTAÑAS MODERNAS GLOBALES (NAV-TABS / NAV-PILLS - SIN PÚRPURA)
   ========================================================================== */
.nav-tabs {
    border-bottom: 2px solid #e2e8f0 !important;
    gap: 6px !important;
    margin-bottom: 1rem !important;
}

.nav-tabs .nav-item {
    margin-bottom: -2px !important;
}

.nav-tabs .nav-link,
.nav-tabs > li > a {
    border: 2px solid transparent !important;
    border-radius: 8px 8px 0 0 !important;
    padding: 0.60rem 1.15rem !important;
    font-weight: 600 !important;
    font-size: 0.88rem !important;
    color: #64748b !important;
    -webkit-text-fill-color: #64748b !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    background: transparent !important;
    transition: all 0.15s ease-in-out !important;
    text-decoration: none !important;
}

.nav-tabs .nav-link:hover,
.nav-tabs > li > a:hover {
    color: #2563eb !important;
    -webkit-text-fill-color: #2563eb !important;
    border-color: transparent !important;
    background: #f8fafc !important;
}

.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link,
.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
    color: #2563eb !important;
    -webkit-text-fill-color: #2563eb !important;
    background: #ffffff !important;
    border: 2px solid transparent !important;
    border-bottom: 2px solid #2563eb !important;
    font-weight: 700 !important;
}

.nav-tabs .nav-link i,
.nav-tabs > li > a i {
    color: inherit !important;
    -webkit-text-fill-color: inherit !important;
    font-size: 0.95rem !important;
}

/* ==========================================================================
   MODAL CONFIGURAR HORARIO DE ATENCIÓN (UI/UX PROFESIONAL PARA EL MÉDICO)
   ========================================================================== */
#modHorario .modal-content {
    border-radius: 16px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.20) !important;
    overflow: hidden !important;
}

#modHorario .modal-header {
    background: #ffffff !important;
    border-bottom: 1px solid #f1f5f9 !important;
    padding: 1.15rem 1.5rem !important;
}

#modHorario .modal-body {
    background: #f8fafc !important;
    padding: 1.25rem 1.5rem !important;
}

#modHorario .modal-footer {
    background: #ffffff !important;
    border-top: 1px solid #f1f5f9 !important;
    padding: 0.85rem 1.5rem !important;
}

#modHorario .nav-tabs {
    border-bottom: 2px solid #e2e8f0 !important;
    background: transparent !important;
}

#modHorario .nav-tabs .nav-link {
    border-radius: 8px 8px 0 0 !important;
    padding: 0.65rem 1.25rem !important;
    font-size: 0.90rem !important;
}

#modHorario .card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

/* Filas de Días */
#modHorario .form-row.form-group {
    padding: 10px 14px !important;
    margin: 0 !important;
    border-radius: 8px !important;
    align-items: center !important;
    transition: all 0.15s ease !important;
    min-height: 48px !important;
}

#modHorario .form-row.form-group:hover {
    background-color: #f1f5f9 !important;
}

#modHorario .WM-border-top-primary {
    border-top: 1px solid #f1f5f9 !important;
}

#modHorario .custom-control-label {
    font-weight: 600 !important;
    color: #1e293b !important;
    font-size: 0.90rem !important;
    cursor: pointer !important;
    user-select: none !important;
}

#modHorario .custom-switch .custom-control-input:checked ~ .custom-control-label::before {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
}

#modHorario [id^="idTxtBloqueado"] {
    color: #94a3b8 !important;
    font-size: 0.84rem !important;
    font-style: italic !important;
}

/* Chips e Intervalos de Horas Configuradas */
#modHorario [id^="spHorario"] {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    background: #eff6ff !important;
    border: 1px solid #bfdbfe !important;
    border-radius: 8px !important;
    padding: 3px 10px 3px 10px !important;
    margin: 3px 4px !important;
    position: relative !important;
    transition: all 0.15s ease-in-out !important;
    vertical-align: middle !important;
}

#modHorario [id^="spHorario"]:hover {
    background: #dbeafe !important;
    border-color: #93c5fd !important;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.12) !important;
}

#modHorario [id^="spHorario"] .badge,
#modHorario [id^="spHorario"] .badge-info {
    background: transparent !important;
    color: #1e40af !important;
    font-size: 0.84rem !important;
    font-weight: 700 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    letter-spacing: 0.01em !important;
}

#modHorario [id^="spHorario"] .delHorario {
    position: static !important;
    margin: 0 0 0 6px !important;
    font-size: 0.88rem !important;
    color: #ef4444 !important;
    cursor: pointer !important;
    transition: transform 0.15s ease, color 0.15s ease !important;
}

#modHorario [id^="spHorario"] .delHorario:hover {
    color: #b91c1c !important;
    transform: scale(1.20) !important;
}

/* Botón de Agregar Hora (+) */
#modHorario .AddHora {
    color: #10b981 !important;
    font-size: 1.35rem !important;
    vertical-align: middle !important;
    margin-left: 8px !important;
    cursor: pointer !important;
    transition: all 0.15s ease-in-out !important;
}

#modHorario .AddHora:hover {
    color: #059669 !important;
    transform: scale(1.15) !important;
}

/* ==========================================================================
   MODAL SECUNDARIO / ANIDADO (#modHora - MODAL SOBRE MODAL)
   ========================================================================== */
#modHora {
    background: rgba(15, 23, 42, 0.65) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    z-index: 300000 !important;
}

#modHora .modal-dialog {
    z-index: 300001 !important;
}

#modHora .modal-content {
    border-radius: 18px !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.15) !important;
    background: #ffffff !important;
    overflow: hidden !important;
}

/* Botones de Presets (Turnos Frecuentes) */
.wm-btn-preset,
button.wm-btn-preset,
.btn.wm-btn-preset {
    background-color: #ffffff !important;
    border: 1.5px solid #bfdbfe !important;
    color: #1e40af !important;
    -webkit-text-fill-color: #1e40af !important;
    font-weight: 600 !important;
    font-size: 0.80rem !important;
    padding: 6px 12px !important;
    border-radius: 8px !important;
    transition: all 0.15s ease-in-out !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
    cursor: pointer !important;
    outline: none !important;
    text-decoration: none !important;
}

.wm-btn-preset:hover {
    background-color: #eff6ff !important;
    border-color: #3b82f6 !important;
    color: #1d4ed8 !important;
    -webkit-text-fill-color: #1d4ed8 !important;
    transform: translateY(-1px) !important;
}

.wm-btn-preset:focus,
.wm-btn-preset:active,
.wm-btn-preset.active {
    background-color: #eff6ff !important;
    border-color: #2563eb !important;
    color: #1d4ed8 !important;
    -webkit-text-fill-color: #1d4ed8 !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25) !important;
    outline: none !important;
}

/* Botones de Ajuste de Tiempo (+/-) */
.wm-adj-time,
button.wm-adj-time,
.btn.wm-adj-time {
    background-color: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
    -webkit-text-fill-color: #334155 !important;
    font-weight: 700 !important;
    font-size: 0.75rem !important;
    padding: 4px 6px !important;
    border-radius: 6px !important;
    min-width: 0 !important;
    text-align: center !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    box-sizing: border-box !important;
    outline: none !important;
}

.wm-adj-time:hover {
    background-color: #eff6ff !important;
    border-color: #93c5fd !important;
    color: #1d4ed8 !important;
    -webkit-text-fill-color: #1d4ed8 !important;
}

.wm-adj-time:focus,
.wm-adj-time:active {
    background-color: #dbeafe !important;
    border-color: #2563eb !important;
    color: #1e40af !important;
    -webkit-text-fill-color: #1e40af !important;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.20) !important;
    outline: none !important;
}

/* Forzar color azul en el badge de día */
#lblDiaNombreModal {
    background-color: #2563eb !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-weight: 700 !important;
}

/* ==========================================================================
   FOOTER GLOBAL TIPO WINMED ADMIN
   ========================================================================== */
footer.footer,
.footer {
    background: #ffffff !important;
    border-top: 1px solid #e2e8f0 !important;
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.03) !important;
    padding: 0.9rem 1.5rem !important;
    width: 100% !important;
}

footer.footer p {
    margin-bottom: 0 !important;
    font-size: 0.82rem !important;
    font-weight: 500 !important;
}

footer.footer .text-primary,
footer.footer .text-primary p,
footer.footer .text-primary i {
    color: #2563eb !important;
    font-weight: 600 !important;
}

footer.footer .text-gray-400,
footer.footer .text-gray-400 p {
    color: #94a3b8 !important;
}

/* ==========================================================================
   INPUTS DE ARCHIVO (CUSTOM-FILE) - CLICK DIRECTO Y VISUAL MODERNO
   ========================================================================== */
.custom-file {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    height: 44px !important;
    margin-bottom: 0.85rem !important;
    cursor: pointer !important;
}

.custom-file-input {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    opacity: 0 !important;
    z-index: 20 !important; /* Siempre arriba para interceptar cualquier clic */
    cursor: pointer !important;
    display: block !important;
}

.custom-file-label {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    height: 100% !important;
    z-index: 1 !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 1rem !important;
    margin: 0 !important;
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    color: #334155 !important;
    font-size: 0.88rem !important;
    font-weight: 500 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
    cursor: pointer !important;
    pointer-events: none !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    padding-right: 110px !important;
}

.custom-file-label::after {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 2 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 1.25rem !important;
    color: #1e40af !important;
    background-color: #eff6ff !important;
    border-left: 1px solid #cbd5e1 !important;
    border-radius: 0 7px 7px 0 !important;
    content: "Examinar" !important;
    font-weight: 600 !important;
    font-size: 0.82rem !important;
    pointer-events: none !important;
}

.custom-file:hover .custom-file-label,
.custom-file-input:hover ~ .custom-file-label {
    border-color: #93c5fd !important;
}

.custom-file:hover .custom-file-label::after,
.custom-file-input:hover ~ .custom-file-label::after {
    background-color: #dbeafe !important;
    color: #1d4ed8 !important;
}

.custom-file-input:focus ~ .custom-file-label {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18) !important;
}

/* ==========================================================================
   JQUERY UI DATEPICKER - AZUL MÉDICO WINMED ADMIN (#2563eb)
   ========================================================================== */
.ui-datepicker.ui-widget.ui-widget-content,
div.ui-datepicker,
#ui-datepicker-div {
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.15), 0 0 0 1px rgba(0,0,0,0.04) !important;
    padding: 1.25rem !important;
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
    z-index: 100000 !important;
    width: 320px !important;
}

.ui-datepicker .ui-datepicker-header {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin-bottom: 0.85rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

.ui-datepicker .ui-datepicker-title {
    flex-grow: 1 !important;
    text-align: center !important;
    order: 2 !important;
    display: flex !important;
    justify-content: center !important;
    gap: 6px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
}

.ui-datepicker .ui-datepicker-title select {
    border-radius: 8px !important;
    border: 1px solid #cbd5e1 !important;
    padding: 0.35rem 0.6rem !important;
    color: #1e293b !important;
    background-color: #f8fafc !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    outline: none !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
}

.ui-datepicker .ui-datepicker-title select:hover,
.ui-datepicker .ui-datepicker-title select:focus {
    border-color: #2563eb !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15) !important;
}

.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    position: static !important;
    width: 32px !important;
    height: 32px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #475569 !important;
    transition: all 0.15s ease !important;
}

.ui-datepicker .ui-datepicker-prev:hover,
.ui-datepicker .ui-datepicker-next:hover {
    background: #2563eb !important;
    border-color: #1d4ed8 !important;
    color: #ffffff !important;
}

.ui-datepicker .ui-datepicker-prev {
    order: 1 !important;
}

.ui-datepicker .ui-datepicker-next {
    order: 3 !important;
}

.ui-datepicker table {
    margin: 0 !important;
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 4px !important;
}

.ui-datepicker th {
    color: #64748b !important;
    font-weight: 700 !important;
    font-size: 0.72rem !important;
    text-transform: uppercase !important;
    padding: 0.5rem 0 !important;
    letter-spacing: 0.05em !important;
}

.ui-datepicker td {
    padding: 0 !important;
    text-align: center !important;
}

.ui-datepicker td span,
.ui-datepicker td a,
body .ui-datepicker td a,
html body .ui-datepicker td a {
    border: none !important;
    background: transparent !important;
    color: #334155 !important;
    border-radius: 8px !important;
    font-weight: 500 !important;
    font-size: 0.85rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 34px !important;
    height: 34px !important;
    margin: 0 auto !important;
    transition: all 0.15s ease-in-out !important;
    text-decoration: none !important;
}

/* Hover en días */
.ui-datepicker td a:hover,
body .ui-datepicker td a.ui-state-hover,
body .ui-datepicker td a:hover,
html body .ui-datepicker td a:hover {
    background-color: #eff6ff !important;
    color: #2563eb !important;
    -webkit-text-fill-color: #2563eb !important;
    font-weight: 700 !important;
}

/* Día Actual (Today) */
.ui-datepicker td a.ui-state-highlight,
body .ui-datepicker td a.ui-state-highlight,
html body .ui-datepicker td a.ui-state-highlight {
    background-color: #eff6ff !important;
    border: 1.5px solid #93c5fd !important;
    color: #1d4ed8 !important;
    -webkit-text-fill-color: #1d4ed8 !important;
    font-weight: 700 !important;
}

/* Día Seleccionado (Active) - AZUL MÉDICO #2563eb */
.ui-datepicker td a.ui-state-active,
body .ui-datepicker td a.ui-state-active,
body .ui-datepicker td.ui-datepicker-current-day a,
html body .ui-datepicker td a.ui-state-active,
html body .ui-datepicker td.ui-datepicker-current-day a {
    background: #2563eb !important;
    background-color: #2563eb !important;
    background-image: none !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.35) !important;
}

/* Días deshabilitados / otros meses */
.ui-datepicker td.ui-datepicker-other-month span,
.ui-datepicker td.ui-datepicker-other-month a,
.ui-datepicker td.ui-state-disabled span {
    color: #cbd5e1 !important;
    -webkit-text-fill-color: #cbd5e1 !important;
    opacity: 0.5 !important;
}

/* Prepend Badge de ICD-10 */
#lblICD10:empty,
#wrapLblICD10:has(#lblICD10:empty),
.input-group-prepend:has(#lblICD10:empty),
.input-group-append:has(#lblICD10:empty) {
    display: none !important;
}

#lblICD10:not(:empty) {
    display: inline-flex !important;
    background-color: #2563eb !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 0.85rem !important;
    border-color: #2563eb !important;
}

/* ==========================================================================
   DATATABLES PAGINATION & TABLE VISIBILITY EN AZUL MÉDICO (#2563eb)
   ========================================================================== */
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button.active,
.dataTables_paginate .paginate_button.current,
.paginate_button.current,
.page-item.active .page-link,
.pagination .page-item.active .page-link,
li.paginate_button.active a,
li.paginate_button.active a:hover,
li.paginate_button.active .page-link {
    background: #2563eb !important;
    background-color: #2563eb !important;
    background-image: none !important;
    border-color: #1d4ed8 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.35) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.current):not(.disabled),
.pagination .page-item .page-link:hover {
    background-color: #eff6ff !important;
    border-color: #93c5fd !important;
    color: #1d4ed8 !important;
    -webkit-text-fill-color: #1d4ed8 !important;
}

/* Tablas con visibilidad completa de columnas */
#tbHistorialCon,
.table-responsive > table,
table.dataTable {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: auto !important;
}

#tbHistorialCon th,
#tbHistorialCon td {
    word-break: break-word !important;
    vertical-align: middle !important;
    padding: 0.65rem 0.55rem !important;
    font-size: 0.84rem !important;
}

#tbHistorialCon th:nth-child(1),
#tbHistorialCon th:nth-child(2),
#tbHistorialCon td:nth-child(1),
#tbHistorialCon td:nth-child(2) {
    width: 32px !important;
    min-width: 32px !important;
    max-width: 36px !important;
    text-align: center !important;
    white-space: nowrap !important;
    padding: 0.5rem 0.2rem !important;
}

#tbHistorialCon td:nth-child(3), /* Elegibilidad */
#tbHistorialCon td:nth-child(4), /* Fecha */
#tbHistorialCon td:nth-child(5)  /* Cedula */ {
    white-space: nowrap !important;
    font-size: 0.82rem !important;
}

#tbHistorialCon td:nth-child(8) /* ICD10 */ {
    min-width: 160px !important;
    max-width: 280px !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    line-height: 1.35 !important;
    font-size: 0.80rem !important;
}

#tbHistorialCon td:nth-child(8) ul {
    padding-left: 1.1rem !important;
    margin-bottom: 0 !important;
}

.table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
}

/* ==========================================================================
   HISTORIA CLÍNICA - ACCORDION & BOOTSTRAP-SWITCH EN AZUL MÉDICO (#2563eb)
   ========================================================================== */
.accordion .card {
    border: 1px solid #e2e8f0 !important;
    border-radius: 14px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
    margin-bottom: 1.25rem !important;
    overflow: hidden !important;
}

.accordion .card-header,
#form-Data .card-header {
    background-color: #ffffff !important;
    border-bottom: 1px solid #f1f5f9 !important;
    padding: 1.15rem 1.5rem !important;
    cursor: pointer !important;
}

.accordion .card-header h6,
.accordion .card-header h6[data-toggle="collapse"],
#form-Data .card-header h6 {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    color: #1e40af !important;
    -webkit-text-fill-color: #1e40af !important;
    font-size: 0.92rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.03em !important;
    text-transform: uppercase !important;
    margin: 0 !important;
    text-align: left !important;
}

.accordion .card-header:hover h6,
.accordion .card-header:hover {
    color: #2563eb !important;
    -webkit-text-fill-color: #2563eb !important;
    background-color: #f8fafc !important;
}

.accordion .card-header h6 i,
.accordion .card-header h6 i.pull-right,
.accordion .card-header h6 i.fa-chevron-down,
.accordion .card-header h6 i.fa-chevron-right,
#form-Data .card-header h6 i {
    float: none !important;
    margin: 0 !important;
    color: #2563eb !important;
    -webkit-text-fill-color: #2563eb !important;
    background-color: #eff6ff !important;
    border: 1px solid #bfdbfe !important;
    border-radius: 50% !important;
    width: 28px !important;
    min-width: 28px !important;
    height: 28px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.75rem !important;
    order: -1 !important;
    transition: all 0.2s ease !important;
}

.accordion .card-header h6.collapsed i.fa-chevron-down,
.accordion .card-header h6[aria-expanded="false"] i.fa-chevron-down {
    display: none !important;
}

.accordion .card-header h6.collapsed i.fa-chevron-right,
.accordion .card-header h6[aria-expanded="false"] i.fa-chevron-right {
    display: inline-flex !important;
}

.accordion .card-header h6:not(.collapsed) i.fa-chevron-right,
.accordion .card-header h6[aria-expanded="true"] i.fa-chevron-right {
    display: none !important;
}

.accordion .card-header h6:not(.collapsed) i.fa-chevron-down,
.accordion .card-header h6[aria-expanded="true"] i.fa-chevron-down {
    display: inline-flex !important;
}

/* Switches de Bootstrap-Switch en Azul Médico */
.bootstrap-switch .bootstrap-switch-handle-on,
.bootstrap-switch .bootstrap-switch-handle-off,
.bootstrap-switch .bootstrap-switch-label {
    white-space: nowrap !important;
}

.bootstrap-switch .bootstrap-switch-handle-on,
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary {
    background: #2563eb !important;
    background-color: #2563eb !important;
    background-image: none !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    text-shadow: none !important;
    opacity: 1 !important;
}

/* Cajas de ítems médicos (medical-item-box) */
.medical-item-box {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    padding: 1.1rem 1.25rem !important;
    margin-bottom: 0.75rem !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.medical-item-box:hover {
    border-color: #cbd5e1 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03) !important;
}

.medical-item-box label.control-label {
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    letter-spacing: 0.02em !important;
}

/* ==========================================================================
   RECOVER.ASPX - PANTALLA MODERNA DE RECUPERACIÓN DE CONSULTA
   ========================================================================== */
.recover-container {
    max-width: 1100px;
    margin: 0.5rem auto 2rem auto;
}

.recover-card {
    border-radius: 20px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.06), 0 20px 25px -5px rgba(0, 0, 0, 0.04) !important;
    background: #ffffff !important;
}

/* Columna Visual Izquierda */
.recover-visual-col {
    background: linear-gradient(145deg, #1e3a8a 0%, #1e40af 50%, #2563eb 100%) !important;
    min-height: 500px;
    overflow: hidden;
    position: relative;
    border-top-left-radius: 20px;
    border-bottom-left-radius: 20px;
}

.recover-visual-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 70%);
    pointer-events: none;
}

.recover-badge-pulse {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    letter-spacing: 0.03em;
}

.recover-badge-pulse-light {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #eff6ff;
    color: #1e40af;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.4rem 0.95rem;
    border-radius: 30px;
    border: 1px solid #bfdbfe;
    letter-spacing: 0.03em;
}

.recover-badge-pulse .pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #38bdf8;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7);
    animation: recoverPulse 2s infinite;
}

.pulse-dot-blue {
    width: 8px;
    height: 8px;
    background-color: #2563eb;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
    animation: recoverPulseBlue 2s infinite;
}

@keyframes recoverPulseBlue {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(37, 99, 235, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
}

@keyframes recoverPulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(56, 189, 248, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(56, 189, 248, 0);
    }
}

.recover-doctor-img {
    max-height: 330px;
    object-fit: contain;
    filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.25));
    transition: transform 0.3s ease;
}

.recover-doctor-img:hover {
    transform: scale(1.02);
}

/* Columna Derecha */
.recover-icon-circle {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 12px;
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

.recover-alert-box {
    background-color: #f0f7ff !important;
    border: 1px solid #bfdbfe !important;
    border-left: 4px solid #2563eb !important;
}

.recover-alert-icon {
    font-size: 1.15rem;
    color: #2563eb;
}

/* Tarjetas de Datos */
.recover-data-tile {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.recover-data-tile:hover {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.tile-icon-sm {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
}

/* Botones de Acción */
.btn-recover-cancel {
    background: #ffffff !important;
    color: #dc2626 !important;
    border: 1.5px solid #fca5a5 !important;
    border-radius: 12px !important;
    padding: 0.65rem 1.35rem !important;
    font-size: 0.88rem !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

.btn-recover-cancel:hover {
    background: #fef2f2 !important;
    border-color: #dc2626 !important;
    color: #b91c1c !important;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(220, 38, 38, 0.15) !important;
}

.btn-recover-confirm {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 0.65rem 1.65rem !important;
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35) !important;
}

.btn-recover-confirm:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.45) !important;
}

.btn-recover-cancel:active,
.btn-recover-confirm:active {
    transform: translateY(0);
}

/* ==========================================================================
   HOMOLOGACIÓN GLOBAL DE BOTONES CERRAR / SECUNDARIOS EN MODALES
   ========================================================================== */
.modal-footer .btn-secondary,
.modal-footer .btn-default,
.modal .btn-secondary,
.modal .btn-default {
    background-color: #f1f5f9 !important;
    background: #f1f5f9 !important;
    color: #334155 !important;
    border: 1px solid #cbd5e1 !important;
    font-weight: 600 !important;
}

.modal-footer .btn-secondary:hover,
.modal-footer .btn-secondary:focus,
.modal-footer .btn-secondary:active,
.modal-footer .btn-secondary.focus,
.modal .btn-secondary:hover,
.modal .btn-secondary:focus,
.modal .btn-secondary:active {
    background-color: #e2e8f0 !important;
    background: #e2e8f0 !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.25) !important;
    outline: none !important;
}

.modal-footer .btn-secondary i,
.modal .btn-secondary i {
    color: #475569 !important;
}

.modal-footer .btn-secondary:hover i,
.modal-footer .btn-secondary:focus i,
.modal-footer .btn-secondary:active i,
.modal .btn-secondary:hover i,
.modal .btn-secondary:focus i {
    color: #0f172a !important;
}

/* Validación en Modal de Cambio de Contraseña (Sin empalmes) */
#frmPassword .form-row > [class*="col-"] {
    display: flex !important;
    flex-direction: column !important;
    margin-bottom: 1.25rem !important;
    position: relative;
}

#frmPassword .invalid-feedback,
#frmPassword .alert-danger,
#frmPassword span.error,
#frmPassword label.error,
#frmPassword div.error {
    display: block !important;
    position: static !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    color: #b91c1c !important;
    background-color: #fef2f2 !important;
    border: 1px solid #fecaca !important;
    border-radius: 8px !important;
    padding: 0.4rem 0.75rem !important;
    margin-top: 6px !important;
    margin-bottom: 0 !important;
    line-height: 1.35 !important;
    box-shadow: 0 1px 2px rgba(220, 38, 38, 0.05) !important;
    width: 100% !important;
    box-sizing: border-box !important;
    clear: both !important;
}

#frmPassword .input-group.is-invalid,
#frmPassword .input-group.border-danger {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}







