:root {
    --primary-color: #6a11cb;
    --secondary-color: #8A2BE2;
    --accent-color: #4A00E0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --sidebar-width: 280px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    color: #333;
    overflow-x: hidden;
}

#sidebar .sidebar-header .logo {
    filter: brightness(0) invert(1); /* Convierte el logo a blanco */
    transition: all 0.3s ease;
}

#sidebar .sidebar-header .logo:hover {
    filter: brightness(0) invert(1) drop-shadow(0 0 8px rgba(255, 255, 255, 0.6));
    transform: scale(1.05);
}

#sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    height: 100vh;
    width: var(--sidebar-width);
    z-index: 1000;
    transition: all 0.3s ease;
    background: linear-gradient(to bottom, #6a11cb, #4A00E0);
    box-shadow: 3px 0 10px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
}

#sidebar.active {
    left: 0;
}

#sidebar .sidebar-header {
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    color: white;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 1;
}

#sidebar ul.components {
    padding: 20px 0;
}

#sidebar ul li a {
    padding: 15px 20px;
    display: block;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 4px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#sidebar ul li a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left: 4px solid white;
    transform: translateX(5px);
}

#sidebar ul li a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

#sidebar ul li.active > a {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-left: 4px solid white;
}

#content {
    width: 100%;
    min-height: 100vh;
    transition: all 0.3s ease;
    padding: 20px;
    position: relative;
}

#content.shifted {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
}

.overlay {
    display: none;
    position: fixed;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: all 0.5s ease-in-out;
}

#sidebar.active ~ #content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
}
.overlay.active {
    display: block;
    opacity: 1;
}

/* Efecto Glassmorphism */
.glass-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

/* Ajustes responsivos */
@media (min-width: 992px) {
    #sidebar {
        left: 0 !important;
        transform: translateX(0) !important;
    }
    
    #content {
        margin-left: var(--sidebar-width) !important;
        width: calc(100% - var(--sidebar-width)) !important;
    }
    
    #sidebarCollapse {
        display: none;
    }
    
    .overlay {
        display: none !important;
    }
}

@media (max-width: 991px) {
    #content.shifted {
        margin-left: 0;
        width: 100%;
    }
    
    #sidebar {
        width: 80%;
        max-width: 300px;
    }
    
    .mobile-menu-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
        background: rgba(0, 0, 0, 0.2);
        color: white;
    }
    
    #sidebar .sidebar-header {
        display: none;
    }
}

@media (max-width: 991px) {
    #sidebar {
        top: 80px; 
        height: calc(100vh - 80px); 
    }
    

    .overlay {
        top: 0;
        height: 100vh;
    }
   
    
    #dashboard-page .navbar {
        min-height: 60px;
        padding: 0.5rem 1rem;
    }
    
    .navbar-brand {
        font-size: 0.9rem;
    }
    
    .navbar-text {
        font-size: 0.8rem;
    }
    

    .navbar-collapse {
        display: none !important;
    }
    
    .navbar-text,
    .navbar-nav {
        display: none !important;
    }
    
  
    .navbar-brand {
        display: flex !important;
        align-items: center;
    }
    
    .navbar-toggler {
        margin-left: auto;
    }
}


@media (max-width: 576px) {
    #sidebar {
        top: 70px; 
        height: calc(100vh - 70px);
    }
    
    #dashboard-page .navbar {
        min-height: 55px;
        padding: 0.4rem 0.8rem;
    }
    
    .navbar-brand {
        font-size: 0.85rem;
    }
}


.page-section {
    display: none;
    min-height: 100vh;
}

.page-section.active {
    display: block;
}

.content-section {
    display: none;
    padding: 20px;
    background-color: #ffffffef;
}

.content-section.active {
    display: block;
}


.main-content-container {
    background: transparent;
    border-radius: 0;
    padding: 0;
    overflow: visible;
    min-height: calc(100vh - 100px);
}


.value-normal {
    color: var(--success-color) !important;
}

.value-warning {
    color: var(--warning-color) !important;
}

.value-danger {
    color: var(--danger-color) !important;
    animation: pulse 1.5s infinite;
}


@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translate3d(-30px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: float 15s infinite linear;
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

.form-control:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.25rem rgba(138, 43, 226, 0.25);
}

#home-page .navbar-nav .nav-link {
    cursor: pointer;
    transition: color 0.3s ease;
}

#home-page .navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
}
#reportes-section .btn {
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 600;
    width: 100%;
    margin-bottom: 15px;
}

#reportes-section .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

/* Corrección para el navbar en la página home */
#home-page .navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Ajustes para las tablas responsivas */
.table-responsive {
    border-radius: 10px;
    overflow: hidden;
}

/* Spinner de carga */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Correcciones específicas para evitar scroll no deseado */
#sidebar::-webkit-scrollbar {
    width: 6px;
}

#sidebar::-webkit-scrollbar-track {
    background: transparent;
}

#sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

#sidebar::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

/* Asegurar que el contenido del dashboard no cause scroll horizontal */
#dashboard-page .container-fluid {
    max-width: 100%;
    overflow-x: hidden;
}

/* Mejoras para cards de signos vitales */
.vital-card {
    text-align: center;
    padding: 20px;
    height: 100%;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.vital-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.vital-icon {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

/* Responsividad mejorada */
@media (max-width: 768px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .content-section > .p-4 {
        padding: 1rem !important;
    }
    
    .vital-card {
        min-height: 180px;
    }
    
    .hero-section {
        padding: 60px 0;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .navbar-brand span {
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    #content {
        padding: 10px;
    }
    
    .vital-value {
        font-size: 1.8rem;
    }
    
    .glass-card {
        margin-bottom: 15px;
    }
}

/* Efecto de paralaje */
.parallax-bg {
    position: relative;
    transform-style: preserve-3d;
}

.parallax-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: translateZ(-1px) scale(2);
    z-index: -1;
}

/* Animación de autodibujo */
.draw-animation {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: draw 3s ease-in-out forwards;
}

@keyframes draw {
    to {
        stroke-dashoffset: 0;
    }
}

/* Iconos animados */
.animated-icon {
    transition: transform 0.3s ease;
}

.animated-icon:hover {
    transform: scale(1.2) rotate(5deg);
}

/* Efectos 3D */
.card-3d {
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}

.card-3d:hover {
    transform: rotateY(10deg) rotateX(5deg);
}

.btn-primary {
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(to right, var(--accent-color), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.hero-section {
    background: linear-gradient(rgba(106, 17, 203, 0.8), rgba(37, 117, 252, 0.8));
    background-size: cover;
    background-position: center;
    color: white;
    padding: 80px 0;
    border-radius: 15px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path d="M0,0 L100,0 L100,100 Z" fill="rgba(255,255,255,0.1)"/></svg>');
    background-size: cover;
    transform: translateZ(-0.5px) scale(1.5);
    z-index: -1;
}

.feature-icon {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.login-container, .register-container {
    max-width: 800px;
    margin: 50px auto;
    padding: 30px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.risk-low {
    color: var(--success-color);
}

.risk-medium {
    color: var(--warning-color);
}

.risk-high {
    color: var(--danger-color);
}

.nav-tabs .nav-link.active {
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
}

.nav-tabs .nav-link {
    color: var(--primary-color);
    border: none;
    padding: 10px 20px;
    border-radius: 5px 5px 0 0;
    margin-right: 5px;
}

/* QR Code Section */
.qr-section {
    text-align: center;
    padding: 40px 20px;
}

.qr-code {
    width: 200px;
    height: 200px;
    margin: 0 auto 20px;
    background: white;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.tab-content {
    padding: 20px;
    border-radius: 0 0 15px 15px;
    background: white;
}

.home-feature {
    text-align: center;
    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.856);
    border-radius: 10%;
    transition: transform 0.3s ease;
}

.home-feature:hover {
    transform: translateY(-10px);
}

.home-feature-icon {
    font-size: 3.5rem;
    color: var(--secondary-color);
    margin-bottom: 20px;
}

/* Estilos para la sección de dispositivo */
.device-status {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.device-status-icon {
    font-size: 2rem;
    margin-right: 15px;
}

.device-connected {
    color: var(--success-color);
}

.device-disconnected {
    color: var(--danger-color);
}

.device-connecting {
    color: var(--warning-color);
}

.device-info-card {
    margin-bottom: 20px;
}

.progress {
    height: 10px;
    margin-bottom: 10px;
}

.bluetooth-device-list {
    max-height: 300px;
    overflow-y: auto;
}

.bluetooth-device-item {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

.bluetooth-device-item:hover {
    background-color: #f8f9fa;
}

.bluetooth-device-item:last-child {
    border-bottom: none;
}

/* Logo animado */
.logo-animated {
    display: inline-block;
    position: relative;
}

.logo-animated svg {
    width: 40px;
    height: 40px;
}

.heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite both;
}

@keyframes heartbeat {
    from {
        transform: scale(1);
        transform-origin: center center;
        animation-timing-function: ease-out;
    }
    10% {
        transform: scale(0.91);
        animation-timing-function: ease-in;
    }
    17% {
        transform: scale(0.98);
        animation-timing-function: ease-out;
    }
    33% {
        transform: scale(0.87);
        animation-timing-function: ease-in;
    }
    45% {
        transform: scale(1);
        animation-timing-function: ease-out;
    }
}

/* Animación de entrada para elementos */
.fade-in {
    animation: fadeIn 0.8s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estilos para gráficas */
.chart-container {
    position: relative;
    height: 300px;
    margin-bottom: 20px;
}

/* Estilos para alertas de predicción */
.prediction-alert {
    border-left: 5px solid;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}

.prediction-low {
    border-left-color: var(--success-color);
    background-color: rgba(40, 167, 69, 0.1);
}

.prediction-medium {
    border-left-color: var(--warning-color);
    background-color: rgba(255, 193, 7, 0.1);
}

.prediction-high {
    border-left-color: var(--danger-color);
    background-color: rgba(220, 53, 69, 0.1);
}

/* Estilos para tablas de historial */
.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th, .history-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.history-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.history-table tr:hover {
    background-color: #f5f5f5;
}

/* CORRECCIONES ESPECÍFICAS PARA LOS PROBLEMAS MENCIONADOS */

/* 1. Corrección del sidebar en laptops */
@media (min-width: 992px) and (max-width: 1400px) {
    #sidebar {
        width: 250px;
    }
    
    #content.shifted {
        margin-left: 250px;
        width: calc(100% - 250px);
    }
}

/* 2. Mejoras para el contenido de las páginas */
.page-section {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.page-section.active {
    opacity: 1;
}

.content-section {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease-in-out;
}

.content-section.active {
    opacity: 1;
    transform: translateY(0);
}

/* Mejorar el espaciado y organización del contenido */
.content-section > .p-4 {
    padding: 2rem !important;
}

/* Mejorar la grid y el layout */
.row {
    margin-left: -10px;
    margin-right: -10px;
}

.row > [class*="col-"] {
    padding-left: 10px;
    padding-right: 10px;
    margin-bottom: 20px;
}

/* 3. Correcciones para DataTables */
.dataTables_wrapper {
    margin: 20px 0;
    background: white;
    border-radius: 10px;
    padding: 20px;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 15px;
}

.dataTables_wrapper .dataTables_info {
    margin-top: 15px;
}

/* 4. Mejorar los formularios */
.form-control, .form-select {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(106, 17, 203, 0.25);
}

/* 5. Mejorar los botones */
.btn {
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
}

/* Estados de carga */
.loading-state {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: #6c757d;
}

.loading-state .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 15px;
}

/* 6. Estados vacíos */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* 7. Mejorar los badges */
.badge {
    font-size: 0.75em;
    font-weight: 600;
}

/* 8. Mejorar las alertas */
.alert {
    border-radius: 12px;
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* 9. Mejorar las progress bars */
.progress {
    border-radius: 10px;
    height: 12px;
    background: rgba(0,0,0,0.1);
}

.progress-bar {
    border-radius: 10px;
    transition: width 0.6s ease;
}

/* 10. Efecto de brillo para elementos importantes */
.pulse-glow {
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 5px rgba(106, 17, 203, 0.4);
    }
    50% {
        box-shadow: 0 0 20px rgba(106, 17, 203, 0.8);
    }
    100% {
        box-shadow: 0 0 5px rgba(106, 17, 203, 0.4);
    }
}

/* 11. MEJORAS ESPECÍFICAS PARA REPORTES - CORREGIDAS */
#reportes-section .btn:active {
    transform: translateY(-1px);
}

#reportes-section .btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
}

#reportes-section .btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
}

/* Estados de carga para botones de reportes */
#reportes-section .btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

/* Mejoras para las tarjetas de reportes */
#reportes-section .glass-card {
    transition: all 0.3s ease;
    height: 100%;
}

#reportes-section .glass-card:hover {
    transform: translateY(-5px);
}

/* Asegurar que los iconos de reportes sean visibles */
#reportes-section .fa-3x {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

/* 12. Mejoras para formularios de perfil */
#perfil-section .glass-card {
    padding: 25px;
}

#perfil-section .form-label {
    font-weight: 600;
    color: var(--primary-color);
}

/* 13. Corrección de emergencia para visibilidad */
.page-section:not(.active) {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

.content-section:not(.active) {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

#sidebar:not(.active) {
    transform: translateX(-100%) !important;
}

/* 14. Mejoras para modales */
.modal-content.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
}

/* 15. Estilos para botones de exportación */
.btn-export {
    position: relative;
    overflow: hidden;
}

.btn-export::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn-export:hover::before {
    left: 100%;
}

/* 16. Mejoras para las cards de signos vitales */
.vital-card .vital-value {
    transition: all 0.3s ease;
}

.vital-card:hover .vital-value {
    transform: scale(1.1);
}

/* 17. Ajustes finales para garantizar funcionalidad */
#content {
    min-height: 100vh;
}

/* Garantizar que los toast se muestren correctamente */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

/* Mejoras para las tablas responsivas */
.table-responsive {
    border-radius: 10px;
    overflow: hidden;
}

/* Asegurar que los botones de DataTables se vean bien */
.dt-buttons .btn {
    margin: 2px;
}

/* Corrección para el efecto de partículas en móviles */
@media (max-width: 768px) {
    .particles {
        display: none;
    }
}

/* Spinner de carga */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Mejoras para el formulario de login */
#loginForm .form-control {
    border-radius: 10px;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

#loginForm .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(106, 17, 203, 0.25);
}

#loginForm button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Estados de botón mejorados */
.btn:disabled {
    pointer-events: none;
}

/* Mejoras de responsividad */
@media (max-width: 768px) {
    .login-container {
        margin: 20px auto;
        padding: 20px;
    }
    
    .navbar-brand span {
        font-size: 1rem;
    }
}

/* CORRECCIONES ESPECÍFICAS PARA SIDEBAR FIJO Y RESPONSIVIDAD */

/* Asegurar que el sidebar mantenga su forma en diferentes niveles de zoom */
@media (min-width: 992px) {
    #sidebar {
        min-width: var(--sidebar-width);
        max-width: var(--sidebar-width);
    }
    
    #content {
        min-width: calc(100% - var(--sidebar-width));
    }
}

/* Scroll suave para el sidebar */
#sidebar {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

/* Corrección para el navbar en la página home */
#home-page .navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Ajustes para la página home */
#home-page {
    padding-top: 0;
}

#home-page .hero-section {
    padding-top: 100px;
    padding-bottom: 80px;
    margin-top: 0;
}

/* Mejoras para las tablas de historial */
#historial-signos-section table td:first-child,
#historial-predicciones-section table td:first-child {
    white-space: nowrap;
}

/* Corrección para el overlay en móviles */
@media (max-width: 991px) {
    .overlay.active {
        display: block;
        opacity: 1;
    }
    
    #sidebar.active {
        left: 0;
        box-shadow: 3px 0 15px rgba(0, 0, 0, 0.3);
    }
}

/* Asegurar que el contenido del dashboard se vea correctamente */
#dashboard-page #content {
    padding-top: 0;
}

/* Corrección específica para el navbar del dashboard */
#dashboard-page .navbar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
}

/* Corrección para el sidebar en dispositivos móviles */
@media (max-width: 991px) {
    #sidebar {
        left: -100%;
    }
    
    #sidebar.active {
        left: 0;
    }
}

/* Mejoras para la accesibilidad y usabilidad */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: none;
}

/* Mejoras de rendimiento para animaciones */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Oculta completamente el header móvil del sidebar */
.mobile-menu-header {
    display: none !important;
}

/* Asegura que el sidebar-header principal se vea bien */
#sidebar .sidebar-header {
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    color: white;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 1;
}
.prediction-low {
    border-left-color: var(--success-color);
    background-color: rgba(40, 167, 69, 0.1);
}

.prediction-medio {
    border-left-color: var(--warning-color);
    background-color: rgba(255, 193, 7, 0.1);
}

.prediction-alto {
    border-left-color: var(--danger-color);
    background-color: rgba(220, 53, 69, 0.1);
}
.table-responsive table {
    width: 100% !important;
}
/* MEJORAS ESPECÍFICAS PARA TABLAS DATATABLES */
#historial-signos-section table,
#historial-predicciones-section table {
    width: 100% !important;
    table-layout: fixed;
}

#historial-signos-section table th,
#historial-predicciones-section table th {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    font-weight: 600;
    padding: 12px 15px;
    border: none;
}

#historial-signos-section table td,
#historial-predicciones-section table td {
    padding: 10px 15px;
    vertical-align: middle;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

/* Asegurar que las tablas vacías se vean bien */
.table > tbody > tr > td[colspan] {
    padding: 40px 20px !important;
    font-style: italic;
    color: #6c757d;
}

/* Responsividad mejorada para tablas */
@media (max-width: 768px) {
    #historial-signos-section table th,
    #historial-predicciones-section table th,
    #historial-signos-section table td,
    #historial-predicciones-section table td {
        padding: 8px 10px;
        font-size: 0.9rem;
    }
    
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        margin-bottom: 10px;
    }
}

/* MEJORAS PARA TABLAS CON Y SIN DATATABLES */
#historial-signos-section table,
#historial-predicciones-section table {
    width: 100% !important;
}

/* Estilos para tablas sin DataTables (estado vacío) */
.table-empty-state {
    padding: 40px 20px !important;
    text-align: center;
    font-style: italic;
    color: #6c757d;
}

.table-empty-state i {
    opacity: 0.5;
    margin-bottom: 10px;
}

/* Estilos para cuando DataTables está activo */
table.dataTable {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Ocultar mensaje de "No hay datos" de DataTables cuando tenemos nuestro propio estado */
.dataTables_empty {
    display: none !important;
}

/* Asegurar que las tablas sean responsivas */
.table-responsive {
    min-height: 200px;
    position: relative;
}

/* Loading state para tablas */
.table-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #6c757d;
}


