/* ================================
   ESTILO GENERAL PARA LA PLATAFORMA VETERINARIA
================================ */

/* Fondo general blanco */
body.search-body {
    font-family: Arial, sans-serif;
    background-color: #ffffff;
    margin: 70px 20px 80px;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

body.form-body {
    font-family: Arial, sans-serif;
    background-color: #ffffff;
    margin: 90px;
    padding: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

/*BODY DEL LOGIN*/
body.login-body {
    font-family: Arial, sans-serif;
    background-color: #ffffff;
    margin: 70px;
    padding: 0;
    min-height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.neon-text {
    color: #3498db;
    text-shadow: 0 0 10px #3498db, 0 0 20px #3498db;	
    font-weight: bold;
    font-size: 24px;
    margin-bottom: 0px;
    display: block;
}

/*BODY DEL DASHBOARD*/
body.dashboard-body {
    font-family: Arial, sans-serif;
    background-color: #ffffff;
    margin: 70px;
    padding: 0;
    max-height: calc(100vh - 280px);
    min-height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

body.dashboard-body,
body.search-body {
    margin-top: 90px;
    min-height: calc(100vh - 170px);
    max-height: none;
    overflow-y: auto;
}

/* ================================
   HEADER SUPERIOR FIJO
================================ */
.top-user-bar {
    position: fixed;
    margin: -2px;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 98%;
    max-width: 98%;
    background-color: #DBEAFE;
    padding: none;
    box-shadow: 0 0 10px #3498db, 0 0 20px #3498db;
    z-index: 9999;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 10px;
    flex-wrap: wrap;
}

.user-info h2 {
    margin: 3px;
    font-size: 12px;
    color: #333;
}

.button-group {
    display: flex;
    gap: 8px;
}

.logout-btn,
.dashboard-btn2 {
    padding: 6px 10px;
    font-size: 12px;
    min-width: auto;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dark-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.logout-btn {
    background: #e74c3c;
    color: white;
    box-shadow: 0 0 5px #e74c3c, 0 0 10px #e74c3c;
}

.logout-btn:hover {
    background: none;
    box-shadow: 0 0 10px #c0392b, 0 0 20px #e74c3c;
}

/*BOTON DASHBOARD TAMAÑO EXCLUSIVO PARA EL HEADER*/
.dashboard-btn2 {
    padding: 6px 12px !important;
    font-size: 12px !important;
    min-width: auto !important;
    width: auto !important;
    box-shadow: 0 0 5px #2569fa, 0 0 10px #2569fa;
}

.dashboard-btn2:hover {
    background: none;
}

.dark-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px #080400, 0 0 25px #080400;
}

/* Botones principales - Verde oscuro brillante */
button,
.option-btn {
    padding: 4px 12px;
    background-color: transparent;
    color: black;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    width: 25%;
    font-size: 13px;
    font-weight: bold;
    box-shadow: 0 0 10px #3498db, 0 0 20px #3498db;
    transition: all 0.3s ease;
    margin: 10px 5px;
    display: inline-block;
    min-width: 150px;
    text-align: center;
}

button:hover,
.option-btn:hover {
    background-color: none;
    box-shadow: 0 0 10px #2ecc71, 0 0 20px #2ecc71;
    transform: scale(1.02);
}

/* Carrusel de consejos */
.consejos-bar {
    width: 30%;
    padding: 6px 0;
    background-color: transparent;
    border-radius: 70px;
    margin: 5px 0;
    box-shadow: none;
    overflow: hidden;
    position: relative;
    cursor: default;
}

.consejo-texto {
    display: inline-block;
    font-size: 13px;
    font-weight: 500;
    color: #FF8904;
    white-space: nowrap;
    padding: 0 20px;
    font-style: italic;
    animation: slideText 25s linear infinite;
    text-shadow: 0 0 8px #FF8904, 0 0 15px #FF8904 !important;
}

@keyframes slideText {
    0% { transform: translateX(100%); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateX(-100%); opacity: 0; }
}

/* ================================
   FORMULARIOS Y CONTENEDORES
================================ */
.form-container {
    width: 90%;
    max-width: 750px;
    padding: 20px;
    margin: 20px auto;
    background-color: #fdfdfd;
    border-radius: 8px;
    box-shadow: 0 0 10px #3498db, 0 0 20px #3498db;
}

.form-container2 {
    width: 90%;
    max-width: 450px;
    padding: 20px;
    margin: 40px auto;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 0 10px #3498db, 0 0 20px #3498db;
    text-align: center;
}

.form-container input[type="text"],
.form-container input[type="password"] {
    width: 80%;	
    max-width: 300px;	
    padding: 8px 10px;
    margin: 10px 0;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/*boton de inicio de sesión en el index.php*/
.form-container button {
    padding: 10px 16px;
    font-size: 15px;	
}

/* Formulario de búsqueda SEARCH.PHP compacto debajo del header - CORREGIDO */
.search-form-top {
    width: 98%;
    max-width: 98%;
    margin: 55px auto 10px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
    background-color: #f9f9f9;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #ddd;
    box-shadow: 0 0 10px #3498db, 0 0 20px #3498db;
}

#search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

#search-form input[type="text"],
#search-form input[type="number"] {
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    height: 12px;
}

#search-form label {
    font-size: 12px;
    margin-right: 5px;
    white-space: nowrap;
}

#search-form button {
    padding: 6px 8px;
    color: var(--btn-delete);
    border: 2px solid var(--btn-delete);
    background-color: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;    
    transition: all 0.3s ease;
    margin: 10px 5px;
    display: inline-block;
    min-width: auto;
    width: auto;
    text-align: center;
}

#search-form button:hover {
    background: #2980b9;
}

#search-form button.btn-mostrar:hover {
    background: #27ae60;
}

#search-form button.btn-pdf:hover {
    background: #d35400;
}

/* Inputs generales */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    max-width: 300px;
    padding: 8px 10px;
    margin: 10px 0;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border: 2px solid #2d2d2d;
    box-shadow: 0 0 10px #3498db, 0 0 20px #3498db;
    background: #ffffff;
}

/* Mejora visual para selects */
select {
    padding: 8px 30px 8px 12px;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%232B7FFF'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

select:focus {
    outline: none;
    box-shadow: 0 0 8px #27ae60, 0 0 15px #2ecc71;
}

.theme-toggle-container {
    text-align: center;
    margin-top: 20px;
}

/* ================================
   BOTONES ANIMADOS (NEÓN AZUL)
================================ */
.animated-btn {
    background-color: transparent;
    color: #333;
    border: 1px solid #2d2d2d;
    border-radius: 6px;
    padding: 6px 10px;
    margin: 5px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px #3498db, 0 0 20px #3498db;
}

.animated-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 8px #2B7FFF, 0 0 15px #2B7FFF;
}

.animated-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.animated-btn .icon {
    font-size: 12px;
    display: inline-block;
    transition: transform 0.3s ease;
}

.animated-btn.refresh-btn:hover .icon,
.animated-btn.clean-btn:hover .icon,
.animated-btn.pdf-btn:hover .icon,
.animated-btn.excel-btn:hover .icon {
    transform: rotate(10deg) scale(1.1);
}

/* Botones específicos */
.guardar-btn,
.modificar-btn {
    color: #27ae60;
    border: 2px solid #27ae60;
}

.eliminar-btn,
.btn-eliminar-responsable {
    color: #FB2C36;
    border: 2px solid #FB2C36;
    box-shadow: 0 0 8px #FB2C36;
}

.eliminar-btn:hover,
.btn-eliminar-responsable:hover {
    box-shadow: 0 0 15px #e74c3c;
    background-color: #ffe6e6;
}

.editar-btn,
.modificarsearch-btn {
    color: #155DFC;
    border: 2px solid #155DFC;
    box-shadow: 0 0 10px #3498db, 0 0 20px #3498db;
}

.modificarsearch-btn:hover {
    box-shadow: 0 0 15px #155DFC;
    background-color: #e8ffe8;
}

.btn-pequeno {
    padding: 6px 10px !important;
    font-size: 12px !important;
    min-width: auto !important;
    width: auto !important;
}

.btn-pequeno:hover {
    background: none;
}

/*BOTON CERRAR SESION TAMAÑO EXCLUSIVO PARA EL HEADER*/
.btn-logout {
    padding: 6px 10px !important;
    font-size: 12px !important;
    min-width: auto !important;
    width: auto !important;
    box-shadow: 0 0 5px #e74c3c, 0 0 10px #e74c3c !important;
}

.btn-logout:hover {
    background: none;
}

.dashboard-btn2 {
    box-shadow: 0 0 5px #2569fa, 0 0 10px #2569fa;
}

/* ================================
   TABLAS DE RESULTADOS
================================ */
.tabla-scroll-vertical-horizontal {
    width: 100%;
    max-height: calc(100vh - 250px);
    overflow-y: auto;
    overflow-x: auto;
    margin-top: 10px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: white;
}

/* Ajuste de la tabla para scroll y ancho */
.data-table {
    min-width: 98%;
    width: auto;
    border-collapse: collapse;
    font-size: 12px;
    table-layout: auto;
}

.data-table th,
.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #ddd;
    white-space: normal;
    word-wrap: break-word;
}

/* Mejora visual de los encabezados */
.data-table thead th {
    background-color: #ecf0f1;
    color: #2c3e50;
    font-weight: bold;
    font-size: 12px;
    position: static;
    top: 0;
    z-index: 2;
    box-shadow: inset 0 2px 0 #27ae60;
    white-space: nowrap;
    min-width: 160px;
    padding: 6px 5px;
}

/* Mejora del cuerpo de la tabla */
.data-table tbody tr:hover {
    background-color: #f1f1f1;
}

/* ================================
   FIELDSET Y GRUPOS
================================ */
.grupo-afiliado {
    border: 1px solid #ddd;
    border-radius: 8px;
    margin: 20px 30px;
    padding: 15px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.grupo-afiliado legend {
    font-size: 14px;
    font-weight: bold;
    color: #2c3e50;
    padding: 5px 15px;
    background: #ecf0f1;
    border-radius: 4px;
    border: 1px solid #bdc3c7;
    position: relative;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

/* Neón para Activa/o */
.grupo-activo legend {
    border-color: #27ae60;
    box-shadow: 0 0 8px #27ae60, 0 0 15px #27ae60;
}

/* Neón para Jubilada/o */
.grupo-jubilado legend {
    border-color: #8e44ad;
    box-shadow: 0 0 8px #8e44ad, 0 0 15px #8e44ad;
}

/* Neón para Fallecida/o */
.grupo-fallecido legend {
    border-color: #e74c3c;
    box-shadow: 0 0 8px #e74c3c, 0 0 15px #e74c3c;
}

/* ================================
   TEMA OSCURO
================================ */
body[data-theme="dark"] {
    background-color: #121212;
    color: #e0e0e0;
}

body[data-theme="dark"] .form-container,
body[data-theme="dark"] .search-form-top,
body[data-theme="dark"] table,
body[data-theme="dark"] .checklist-table,
body[data-theme="dark"] .top-user-bar,
body[data-theme="dark"] .button-group button,
body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea {
    background-color: #1e1e1e;
    color: #ffffff;
    border-color: #444;
}

body[data-theme="dark"] .form-container h2,
body[data-theme="dark"] .search-form-top h2,
body[data-theme="dark"] th,
body[data-theme="dark"] .neon-text {
    color: #FAFAF9;
}

body[data-theme="dark"] .guardar-btn,
body[data-theme="dark"] .modificar-btn,
body[data-theme="dark"] .dashboard-btn,
body[data-theme="dark"] .logout-btn,
body[data-theme="dark"] .dark-toggle {
    background-color: #2B7FFF;
    color: white;
    border: none;
}

body[data-theme="dark"] .guardar-btn:hover,
body[data-theme="dark"] .modificar-btn:hover,
body[data-theme="dark"] .dashboard-btn:hover,
body[data-theme="dark"] .logout-btn:hover,
body[data-theme="dark"] .dark-toggle:hover {
    background-color: transparent;
}

/* ================================
   MEJORA DE BORDES EN TEMA OSCURO
================================ */

/* Bordes más definidos para inputs y selects en tema oscuro */
body[data-theme="dark"] input[type="text"],
body[data-theme="dark"] input[type="email"],
body[data-theme="dark"] input[type="password"],
body[data-theme="dark"] input[type="date"],
body[data-theme="dark"] input[type="number"],
body[data-theme="dark"] select,
body[data-theme="dark"] textarea {
    border: 2px solid #444 !important;
    border-radius: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 0 6px rgba(100, 100, 255, 0.15) !important;
}

/* Efecto al enfocar: borde más brillante */
body[data-theme="dark"] input[type="text"]:focus,
body[data-theme="dark"] input[type="email"]:focus,
body[data-theme="dark"] input[type="password"]:focus,
body[data-theme="dark"] input[type="date"]:focus,
body[data-theme="dark"] input[type="number"]:focus,
body[data-theme="dark"] select:focus,
body[data-theme="dark"] textarea:focus {
    border: 2px solid #FAFAF9 !important;
    outline: none;
    box-shadow: 0 0 10px rgba(98, 0, 234, 0.4), 0 0 15px rgba(98, 0, 234, 0.3) !important;
    background-color: #2a2a2a !important;
}

/* Mejora para selects desplegables */
body[data-theme="dark"] select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236200ea'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 30px !important;
}

/* Para que los placeholders también sean visibles */
body[data-theme="dark"] ::placeholder {
    color: #aaaaaa;
    opacity: 1;
}

body[data-theme="dark"] a {
    color: #FAFAF9;
}

body[data-theme="dark"] a:hover {
    color: #d7a8ff;
}

/* Mejora visual de inputs */
body[data-theme="dark"] input, 
body[data-theme="dark"] select, 
body[data-theme="dark"] textarea {
    box-shadow: 0 0 5px rgba(100, 100, 255, 0.2);
}

/* Ajuste para el datepicker de jQuery UI */
body[data-theme="dark"] .ui-widget {
    font-family: inherit;
}

body[data-theme="dark"] .ui-widget-content {
    background: #1e1e1e;
    border: 1px solid #444;
    color: #e0e0e0;
}

body[data-theme="dark"] .ui-state-default,
body[data-theme="dark"] .ui-widget-content .ui-state-default {
    background: #2d2d2d;
    border: 1px solid #555;
    color: #e0e0e0;
}

#theme-icon {
    transition: transform 0.3s ease, font-size 0.3s ease;
    font-size: 10px;
    display: inline-block;
}

#theme-toggle:hover #theme-icon {
    transform: rotate(180deg) scale(1.5);
}

/* Botón de cambio de tema */
.dark-toggle {
    background-color: #080400 !important;
    color: white !important;
    border-radius: 100% !important;
    box-shadow: 0 0 10px #080400, 0 0 20px #080400 !important;
    transition: all 0.3s ease !important;
}

/* Hover: efecto brillante */
.dark-toggle:hover {
    background-color: #080400 !important;
    box-shadow: 0 0 15px #080400, 0 0 25px #080400 !important;
    transform: scale(1.5) !important;
}

/* Asegurar que los botones se vean bien en el contenedor */
.search-form-top .animated-btn {
    margin: 2px 5px;
}

/* En tema oscuro, mantener el estilo */
body[data-theme="dark"] .dark-toggle {
    background-color: transparent !important;
    box-shadow: 0 0 10px #fcd386, 0 0 20px #fcd386 !important;
}

body[data-theme="dark"] .dark-toggle:hover {
    background-color: transparent !important;
    box-shadow: 0 0 15px #fcd386, 0 0 25px #fcd386 !important;
}

/* Texto del header en tema oscuro */
body[data-theme="dark"] .user-info h2 {
    color: #ffffff !important;
    text-shadow: 0 0 10px #fcd386, 0 0 20px #fcd386 !important;
}

body[data-theme="dark"] .user-info h2 strong {
    color: #ffffff !important;
}

/* Tema oscuro para la tabla de bonificaciones sociales */
body[data-theme="dark"] .checklist-table-container {
    background-color: #1e1e1e;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

body[data-theme="dark"] .checklist-table-container h4 {
    color: #FAFAF9;
    text-align: center;
    margin-bottom: 10px;
}

body[data-theme="dark"] .checklist-table {
    width: 100%;
    border-collapse: collapse;
}

body[data-theme="dark"] .checklist-table td {
    padding: 8px;
}

body[data-theme="dark"] .checklist-table label {
    color: #e0e0e0;
}

body[data-theme="dark"] .checklist-table input[type="checkbox"] {
    accent-color: #bb86fc;
}

body[data-theme="dark"] .input-textbox {
    background-color: #2d2d2d !important;
    color: #e0e0e0 !important;
    border: 1px solid #555 !important;
}

/* Fondo del contenedor de cargas en tema oscuro */
body[data-theme="dark"] #cargas-container {
    background-color: #1e1e1e;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* Fondo de cada carga familiar en tema oscuro */
body[data-theme="dark"] .carga-item {
    background-color: #2d2d2d !important;
    color: #e0e0e0 !important;
    border: 1px solid #444 !important;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}

/* Inputs y selects dentro de cargas en tema oscuro */
body[data-theme="dark"] .carga-item input,
body[data-theme="dark"] .carga-item select,
body[data-theme="dark"] .carga-item textarea {
    background-color: #333 !important;
    color: #e0e0e0 !important;
    border: 1px solid #555 !important;
}

/* Borde neón en modo oscuro */
body[data-theme="dark"].focused input:focus,
body[data-theme="dark"].focused select:focus {
    border: 2px solid #FAFAF9 !important;
    box-shadow: 
        0 0 8px rgba(187, 134, 252, 0.3),
        0 0 14px rgba(187, 134, 252, 0.2),
        0 0 20px rgba(187, 134, 252, 0.15) !important;
}

/* ================================
   TEMA OSCURO - BOTONES DEL DASHBOARD
================================ */

/* Fondo y color general para botones en tema oscuro */
body[data-theme="dark"] .form-container {
    background-color: #1e1e1e;
    color: #e0e0e0;
    border: 1px solid #444;
}

body[data-theme="dark"] .form-container h3 {
    color: #FAFAF9;
}

/* Estilo para los botones del dashboard */
body[data-theme="dark"] .option-btn {
    background-color: #2d2d2d !important;
    color: #e0e0e0 !important;
    border: 1px solid #555 !important;
    box-shadow: 0 0 10px #3498db, 0 0 20px #3498db !important;
    transition: all 0.3s ease !important;
}

/* Hover en botones del dashboard */
body[data-theme="dark"] .option-btn:hover {
    background-color: #3a3a3a !important;
    box-shadow: 0 0 10px #FFB93B, 0 0 20px #FFB93B !important;
    transform: scale(1.02) !important;
}

/* Eliminar viñetas (puntos negros) de la lista de opciones */
.options-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.options-list li {
    margin: 10px 0;
}

/* Asegurar que los enlaces también respeten el color */
body[data-theme="dark"] .options-list a {
    text-decoration: none;
}

body[data-theme="dark"] .options-list li {
    margin: 10px 0;
}

/* Scrollbars en tema oscuro */
.tabla-scroll-vertical-horizontal::-webkit-scrollbar {
    height: 10px;
    width: 10px;
}

.tabla-scroll-vertical-horizontal::-webkit-scrollbar-thumb {
    background: #27ae60;
    border-radius: 10px;
    border: 2px solid #f1f1f1;
}

.tabla-scroll-vertical-horizontal::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

/* Asegura que la tabla interna no se achique */
.tabla-scroll-vertical-horizontal .data-table {
    max-width: 98%;
    width: auto;
    border-collapse: collapse;
    font-size: 12px;
}

/* Estilo limpio para la tabla en tema oscuro */
body[data-theme="dark"] .tabla-scroll-vertical-horizontal {
    background-color: #1e1e1e;
    border: 1px solid #444;
    box-shadow: 0 0 10px #3498db, 0 0 20px #3498db;
}

body[data-theme="dark"] .tabla-scroll-vertical-horizontal::-webkit-scrollbar-thumb {
    background: #21BCFF;
}

body[data-theme="dark"] .data-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 12px;
    table-layout: auto;
}

body[data-theme="dark"] .data-table th,
body[data-theme="dark"] .data-table td {
    border-bottom: 1px solid #444;
    border-right: 1px solid #333;
    padding: 4px 4px;
    text-align: left;
    color: #e0e0e0;
    background-color: #1e1e1e;
}

/* Encabezados más destacados */
body[data-theme="dark"] .data-table thead th {
    background-color: #444 !important;
    color: #FAFAF9;
    font-weight: bold;
    box-shadow: inset 0 2px 0 #196601;
    position: sticky;
    top: 0;
    z-index: 2;
    border-right: 1px solid #555;
    border-left: 1px solid #555;
    border-bottom: none;
}

/* Alternar colores de filas (opcional, para mejor lectura) */
body[data-theme="dark"] .data-table tbody tr:nth-child(even) {
    background-color: #242424;
}

body[data-theme="dark"] .data-table tbody tr:nth-child(odd) {
    background-color: #1e1e1e;
}

/* Botones de acción en tema oscuro */
body[data-theme="dark"] .modificarsearch-btn,
body[data-theme="dark"] .btn-eliminar-responsable {
    color: #ffffff;
    border: 1px solid #555;
    box-shadow: 0 0 10px #3498db, 0 0 20px #3498db;
    background-color: #2d2d2d;
}

body[data-theme="dark"] .modificarsearch-btn {
    color: #64b5f6;
    border-color: #64b5f6;
}

body[data-theme="dark"] .modificarsearch-btn:hover {
    background-color: #1a3a6e;
    box-shadow: 0 0 10px rgba(100, 181, 246, 0.4);
}

body[data-theme="dark"] .btn-eliminar-responsable {
    color: #ef5350;
    border-color: #ef5350;
}

body[data-theme="dark"] .btn-eliminar-responsable:hover {
    background-color: #5e1a1a;
    box-shadow: 0 0 10px rgba(239, 83, 80, 0.4);
}

/* Celdas con texto largo (truncado) */
body[data-theme="dark"] .truncate {
    color: #e0e0e0;
}

body[data-theme="dark"] .truncate:hover {
    background-color: #2d2d2d;
}

/* ================================
   FOOTER FIJO - CORREGIDO CON MODO OSCURO
================================ */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #DBEAFE !important;
    color: #2c3e50 !important;
    text-align: center;
    padding: 5px 0 !important;
    font-size: 0.8em;
    z-index: 9999;
    box-shadow: 0 0 10px #3498db, 0 0 20px #3498db;
    margin: 0;
    transition: all 0.3s ease;
}

.footer-content {
    animation: neon-glow 2s ease-in-out infinite alternate;
    width: 100%;
    text-align: center;
}

@keyframes neon-glow {
    0% { text-shadow: 0 0 5px #27ae60, 0 0 10px #2ecc71; }
    100% { text-shadow: 0 0 10px #27ae60, 0 0 20px #2ecc71; }
}

/* MODO OSCURO - TAMBIÉN DELGADO */
body[data-theme="dark"] .footer {
    background-color: #1a1a1a !important;
    color: #e0e0e0 !important;
    box-shadow: 0 0 10px #4a5568, 0 0 20px #2d3748 !important;
    border-top: 1px solid #333;
    padding: 5px 0;      /* ← CONSISTENTE CON MODO CLARO */
    font-size: 0.8em;    /* ← CONSISTENTE CON MODO CLARO */
}

body[data-theme="dark"] .footer-content {
    animation: neon-glow-dark 2s ease-in-out infinite alternate;
}

@keyframes neon-glow-dark {
    0% { 
        text-shadow: 0 0 5px #4299e1, 0 0 10px #3182ce; 
    }
    100% { 
        text-shadow: 0 0 10px #63b3ed, 0 0 20px #4299e1; 
    }
}

/* Botón Volver Arriba */
.back-to-top {
    position: fixed;
    bottom: 70px;
    right: 30px;
    z-index: 9999;
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    background: transparent !important;
    color: #4299e1 !important;
    border: 2px solid #4299e1 !important;
    border-radius: 50% !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    box-shadow: 
        0 0 8px rgba(66, 153, 225, 0.4),
        0 0 15px rgba(66, 153, 225, 0.3) !important;
    animation: breathe 2s ease-in-out infinite alternate;
    transition: all 0.3s ease;
    
    /* ESTADO INICIAL - OCULTO */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

@keyframes breathe {
    0% {
        box-shadow: 
            0 0 5px rgba(66, 153, 225, 0.3),
            0 0 10px rgba(66, 153, 225, 0.2);
    }
    100% {
        box-shadow: 
            0 0 12px rgba(66, 153, 225, 0.6),
            0 0 20px rgba(66, 153, 225, 0.5);
    }
}

.back-to-top:hover {
    transform: rotate(-45deg) scale(1.1) !important;
    box-shadow: 
        0 0 12px rgba(66, 153, 225, 0.6),
        0 0 20px rgba(66, 153, 225, 0.5) !important;
}

.back-to-top.visible:hover {
    transform: rotate(-45deg) scale(1.1) !important;
}

body[data-theme="dark"] .back-to-top {
    color: #4299e1 !important;
    border-color: #4299e1 !important;
    background: transparent !important;
    box-shadow: 
        0 0 8px rgba(66, 153, 225, 0.4),
        0 0 15px rgba(66, 153, 225, 0.3) !important;
}

body[data-theme="dark"] .back-to-top:hover {
    transform: rotate(-45deg) scale(1.1) !important;
    box-shadow: 
        0 0 12px rgba(66, 153, 225, 0.6),
        0 0 20px rgba(66, 153, 225, 0.5) !important;
}

/* ================================
   MENSAJES Y ERRORES
================================ */
.error-message {
    color: #e74c3c;
    background: #fdf2f2;
    border: 1px solid #e74c3c;
    padding: 10px;
    margin: 10px 0;
    border-radius: 6px;
    font-size: 14px;
}

/* ================================
   ICONOS
================================ */

/* Botón con ícono + */
.agregar-carga-btn .btn-plus {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-color: white;
    color: #27ae60;
    border-radius: 50%;
    font-size: 14px;
    line-height: 20px;
    text-align: center;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px #3498db, 0 0 20px #3498db;
}

.agregar-carga-btn:hover .btn-plus {
    transform: rotate(90deg) scale(1.2);
}

/* Evitar selección accidental */
#lista-comentarios td, #lista-comentarios th {
    user-select: none;
}

/* Resaltar fila al pasar el mouse */
#lista-comentarios tbody tr:hover {
    background-color: #f8f9fa !important;
}

/* === AJUSTE PARA PÁGINAS CON FORMULARIOS LARGOS === */
body.full-height-form {
    margin-bottom: 0 !important;
    padding-bottom: 100px;
}

body.full-height-form .form-container {
    margin-bottom: 90px !important;
    min-height: calc(100vh - 180px);
}

/* Asegurar que el último elemento sea visible */
.full-height-form .acciones-container:last-of-type {
    margin-bottom: 15px;
}

/* === NOTIFICACIONES TIPO TOAST === */
.toast {
    visibility: hidden;
    min-width: 300px;
    max-width: 400px;
    background-color: #333;
    color: white;
    text-align: center;
    border-radius: 8px;
    padding: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateY(-50px);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.toast.show {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background-color: #27ae60;
}

.toast.error {
    background-color: #e74c3c;
}

.toast.warning {
    background-color: #f39c12;
}

.toast.info {
    background-color: #3498db;
}

.toast::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #fff, #fff);
    animation: progress-bar 5s linear forwards;
}

@keyframes progress-bar {
    from { width: 100%; }
    to { width: 0; }
}

/* ================================
   AJUSTES ESPECÍFICOS PARA FICHAS_MEDICAS.PHP
================================ */

/* Ajuste del margen superior para el body de fichas_medicas. Elevación del formulario de búsqueda y la tabla de resultados */
body.search-body {
    margin-top: 40px !important;
}

/* Ajuste específico para el formulario de búsqueda en fichas_medicas */
.search-form-top {
    margin-top: 75px !important;
    margin-bottom: 5px;
}

/* Ajuste de celdas para evitar solapamiento */
.data-table td, .data-table th {
    white-space: normal;
    padding: 0px 2px;
    min-width: 160px;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
    word-wrap: break-word;
    border-right: 1px solid #c9c9c9;
    border-left: 1px solid #c9c9c9;
}

/* Asegurar que el contenedor de la tabla tenga el espacio correcto */
.tabla-scroll-vertical-horizontal {
    width: 98%;
    max-width: 98%;
    margin: 10px auto;
    padding: 2px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: #d0ece7;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.2);
    max-height: calc(100vh - 150px);
    min-height: 300px;
    overflow-y: auto;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #27ae60 #f1f1f1;
}

/* Ajuste adicional para pantallas más pequeñas */
@media (max-width: 768px) {
    body.search-body {
        margin-top: 80px !important;
    }
    
    .search-form-top {
        margin-top: 60px !important;
    }
}

/* Corrección específica para el header en fichas_medicas */
.top-user-bar {
    z-index: 10000;
    position: fixed;
    top: 8px;
}

/* Ajuste del contenido principal para que no quede detrás del header */
.main-content {
    margin-top: 100px;
}

/*RESPONSIVE*/

/* Pantallas pequeñas: laptops comunes (1366x768) */
@media (max-height: 768px), (max-width: 1366px) and (max-height: 800px) {
    .tabla-scroll-vertical-horizontal {
        max-height: calc(100vh - 340px) !important;
    }
}

@media (max-height: 768px), (max-width: 1366px) and (max-height: 800px) {
    .dashboard-body {
        max-height: calc(100vh - 120px) !important;
    }
}

/* Para dispositivos móviles */
@media (max-width: 768px) {
    body.full-height-form {
        padding-bottom: 120px;
    }
    
    body.full-height-form .form-container {
        margin-bottom: 110px;
        padding: 20px;
    }
    
    .top-user-bar {
        padding: 6px 8px;
    }
    
    .user-info h2 {
        font-size: 12px;
    }
    
    .consejos-bar {
        width: 90%;
    }
    
    .consejo-texto {
        font-size: 11px;
    }
}

/* ================================
   AJUSTES ESPECÍFICOS PARA FICHAS_MEDICAS.PHP
================================ */

/* Quitar scroll del navegador solo para fichas_medicas.php */
body.fichas-medicas-body {
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Ajuste del contenido principal para fichas_medicas */
body.fichas-medicas-body .main-content {
    width: 100%;
    height: 100vh;
    margin: 0;
    padding: 0;
}

/* Asegurar que la tabla esté sobre el footer */
body.fichas-medicas-body .tabla-scroll-vertical-horizontal {
    max-height: calc(100vh - 160px) !important;
    height: calc(100vh - 160px);
    margin: 5px auto;
    border: none;
    border-radius: 6px;
}

/* Ajustar el formulario de búsqueda */
body.fichas-medicas-body .search-form-top {
    margin: 50px auto 5px auto !important;
    width: 98%;
    border-radius: 6px;
}

/* Línea de neón azul para grupos de responsables */
.grupo-afiliado {
    border: 1px solid #ddd;
    border-radius: 8px;
    margin: 15px 20px;
    padding: 15px;
    background-color: #fff;
    box-shadow: 0 0 10px #3498db, 0 0 20px #3498db;
    position: relative;
}

.grupo-afiliado::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 10px;
    background: linear-gradient(45deg, #3498db, #2B7FFF, #3498db);
    z-index: -1;
    animation: neon-border 2s ease-in-out infinite alternate;
}

@keyframes neon-border {
    0% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Estadísticas de búsqueda transparente */
.estadisticas-busqueda {
    background: transparent !important;
    border: 1px solid #c3e6cb;
    border-radius: 5px;
    padding: 8px 12px;
    margin: 10px 15px;
    font-size: 13px;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

/* Tema oscuro para estadísticas */
body[data-theme="dark"] .estadisticas-busqueda {
    background: transparent !important;
    border: 1px solid #444;
    color: #e0e0e0;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
}

/* Ajuste específico para la tabla en fichas_medicas */
body.fichas-medicas-body .data-table {
    width: 100%;
    table-layout: auto;
}

/* Header fijo para fichas_medicas */
body.fichas-medicas-body .top-user-bar {
    top: 0;
    margin: 8px auto;
}

/* Eliminar cualquier padding o margin extra */
body.fichas-medicas-body .form-container,
body.fichas-medicas-body .search-form-top,
body.fichas-medicas-body .tabla-scroll-vertical-horizontal {
    margin-left: auto;
    margin-right: auto;
}

/* ================================
   RESPONSIVE: Pantallas pequeñas (1366x768 y similares)
================================ */

/* Ajuste para el contenedor de la tabla en fichas_medicas en pantallas pequeñas */
@media (max-height: 768px), (max-width: 1366px) and (max-height: 800px) {
    body.fichas-medicas-body .tabla-scroll-vertical-horizontal {
        max-height: calc(100vh - 270px) !important;
        height: calc(100vh - 270px);
    }
}

/* Ajuste para el dashboard en pantallas pequeñas */
@media (max-height: 768px), (max-width: 1366px) and (max-height: 800px) {
    .dashboard-body {
        max-height: calc(100vh - 120px) !important;
    }
}

/* Ajuste adicional para tablets y móviles */
@media (max-width: 1024px) {
    body.fichas-medicas-body .tabla-scroll-vertical-horizontal {
        max-height: calc(100vh - 300px) !important;
        height: calc(100vh - 300px);
        margin: 5px 10px;
    }
}

/* Ajuste para móviles en landscape */
@media (max-width: 768px) and (orientation: landscape) {
    body.fichas-medicas-body .tabla-scroll-vertical-horizontal {
        max-height: calc(100vh - 320px) !important;
        height: calc(100vh - 320px);
    }
}

/* Ajuste para móviles en portrait */
@media (max-width: 768px) and (orientation: portrait) {
    body.fichas-medicas-body .tabla-scroll-vertical-horizontal {
        max-height: calc(100vh - 350px) !important;
        height: calc(100vh - 350px);
        margin: 5px;
    }
    
    /* Ajustar también el formulario de búsqueda en móviles */
    body.fichas-medicas-body .search-form-top {
        margin: 60px auto 5px auto !important;
        padding: 4px;
    }
}

/* Ajuste para pantallas muy pequeñas (móviles pequeños) */
@media (max-width: 480px) {
    body.fichas-medicas-body .tabla-scroll-vertical-horizontal {
        max-height: calc(100vh - 380px) !important;
        height: calc(100vh - 380px);
        margin: 2px;
    }
}

/* Ajuste para pantallas altas (más de 1080p) */
@media (min-height: 1080px) {
    body.fichas-medicas-body .tabla-scroll-vertical-horizontal {
        max-height: calc(100vh - 200px) !important;
        height: calc(100vh - 200px);
    }
}

/* Ajuste para pantallas ultra anchas */
@media (min-width: 1920px) {
    body.fichas-medicas-body .tabla-scroll-vertical-horizontal {
        max-height: calc(100vh - 150px) !important;
        height: calc(100vh - 150px);
        margin: 10px auto;
        max-width: 1800px;
    }
}

/* ================================
   AJUSTE ESPECÍFICO PARA LAPTOPS 1366x768
================================ */

/* Ajuste principal para la tabla en laptops 1366x768 */
@media (max-width: 1366px) and (max-height: 768px) {
    body.fichas-medicas-body {
        margin-top: 50px !important;
        overflow: auto !important;
    }
    
    body.fichas-medicas-body .search-form-top {
        margin: 60px auto 5px auto !important;
        padding: 4px 6px;
        transform: scale(0.95);
        transform-origin: top center;
    }
    
    body.fichas-medicas-body .tabla-scroll-vertical-horizontal {
        max-height: calc(100vh - 220px) !important;
        height: calc(100vh - 220px);
        margin: 2px auto;
        padding: 2px;
    }
    
    /* Reducir el tamaño de los grupos */
    .grupo-afiliado {
        margin: 8px 10px;
        padding: 8px;
    }
    
    .grupo-afiliado legend {
        font-size: 12px;
        padding: 3px 8px;
    }
    
    /* Ajustar tabla interna */
    .data-table {
        font-size: 11px;
    }
    
    .data-table th,
    .data-table td {
        padding: 4px 6px;
        min-width: 120px;
    }
    
    /* Ajustar botones */
    .animated-btn {
        padding: 4px 6px;
        font-size: 11px;
        margin: 2px;
    }
    
    /* Ajustar footer */
    .footer {
        padding: 6px 0;
        font-size: 0.8em;
        position: fixed;
        bottom: 0;
    }
}

/* Ajuste adicional para cuando la altura es exactamente 768px */
@media (max-height: 768px) {
    body.fichas-medicas-body .tabla-scroll-vertical-horizontal {
        max-height: calc(100vh - 240px) !important;
        height: calc(100vh - 240px);
    }
}

/* Ajuste extra para márgenes muy ajustados */
@media (max-width: 1366px) and (max-height: 768px) and (orientation: landscape) {
    body.fichas-medicas-body .tabla-scroll-vertical-horizontal {
        max-height: calc(100vh - 200px) !important;
        height: calc(100vh - 200px);
    }
    
    /* Comprimir aún más el formulario de búsqueda */
    #contenedor-seleccion-masiva {
        gap: 2px;
        padding: 0 2px;
    }
    
    #search-form input[type="text"] {
        width: 90px !important;
        padding: 2px 4px;
        font-size: 11px;
        height: 10px;
    }
    
    #search-form select {
        width: 80px !important;
        padding: 2px 4px;
        font-size: 11px;
    }
}

/* ================================
   ESTILOS ESPECÍFICOS BIBLIOTECA VIRTUAL
================================ */

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.stat-card h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
}

.stat-card p {
    font-size: 24px;
    font-weight: bold;
    margin: 0;
}

/* Documents Grid */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.document-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    background: white;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.document-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.doc-icon {
    font-size: 24px;
}

.doc-info h4 {
    margin: 0 0 5px 0;
    color: #333;
}

.doc-meta {
    font-size: 12px;
    color: #666;
    margin: 0;
}

/* Success Message */
.success-message {
    color: #27ae60;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 10px;
    margin: 10px 0;
    border-radius: 6px;
    font-size: 14px;
}

/* Tema oscuro para nuevos elementos */
body[data-theme="dark"] .stat-card {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
}

body[data-theme="dark"] .document-card {
    background: #2d2d2d;
    border-color: #444;
}

body[data-theme="dark"] .doc-info h4 {
    color: #e0e0e0;
}

body[data-theme="dark"] .success-message {
    background: #1e3a2c;
    border-color: #27ae60;
    color: #90ee90;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .documents-grid {
        grid-template-columns: 1fr;
    }
    
    .document-card {
        flex-direction: column;
        text-align: center;
    }
}

/* ================================
   CORRECCIÓN PARA FOOTER CENTRADO
================================ */

/* Asegurar que el footer esté siempre centrado */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #2D9966;
    color: white;
    text-align: center;
    padding: 10px 0;
    font-size: 0.9em;
    z-index: 9999;
    box-shadow: 0 0 10px #3498db, 0 0 20px #3498db;
    margin: 0 !important;
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer-content {
    animation: neon-glow 2s ease-in-out infinite alternate;
    width: 100%;
    text-align: center;
}

@keyframes neon-glow {
    0% { text-shadow: 0 0 5px #27ae60, 0 0 10px #2ecc71; }
    100% { text-shadow: 0 0 10px #27ae60, 0 0 20px #2ecc71; }
}

/* Eliminar cualquier estilo que pueda desplazar el footer */
body {
    margin: 0 !important;
    padding: 0 !important;
}

/* Asegurar que los contenedores principales no afecten el footer */
.main-content {
    margin-bottom: 60px !important;
}

/* Corrección específica para el dashboard */
body.dashboard-body .form-container {
    margin-bottom: 80px !important;
}