:root {
    --primary-color: #3ba89f;      /* Keeping the teal/turquoise */
    --primary-light: #4fd1c7;      /* Lighter version of primary */
    --primary-dark: #2a7671;      /* Darker version of primary */
    --primary-color-rgb: 59, 168, 159;  /* RGB values of primary color */
    
    --secondary-color: #03251e;    /* Keeping the dark green */
    --secondary-light: #0a3d32;    /* Slightly lighter version of secondary */
    --secondary-dark: #021912;     /* Darker version of secondary */
    
    --white: #ffffff;
    --text-dark: #222;
    --text-light: #fff;
    --bg-light: #f8f9fa;
    --bg-white: #fff;
    --border-light: #e0e0e0;

    /* Status colors - más suaves y armoniosos con la paleta principal */
    --status-success: #2a9d8f; /* Verde azulado */
    --status-warning: #e9c46a; /* Amarillo suave */
    --status-danger: #e76f51;  /* Rojo terroso */
    --status-info: #1976d2;    /* Azul informativo */
    --status-neutral: #6c757d; /* Gris neutral */
    
    /* Bootstrap override colors */
    --bs-primary: #3ba89f;
    --bs-primary-rgb: 59, 168, 159;
    --bs-secondary: #03251e;
    --bs-secondary-rgb: 3, 37, 30;
}
body { 
    font-family: 'Poppins', 'Figtree', Arial, sans-serif; 
    background: var(--bg-light); 
    color: var(--text-dark);
    overflow: auto !important;
    height: auto !important;
}

/* --- PLANTILLAS RGPD --- */
.plantilla-sistema {
    background-color: rgba(var(--bs-primary-rgb), 0.05) !important;
    border-left: 4px solid var(--primary-color);
}

.plantilla-sistema:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.08) !important;
}

.plantilla-usuario {
    border-left: 4px solid var(--border-light);
}

.plantilla-usuario:hover {
    background-color: rgba(var(--bs-secondary-rgb), 0.02) !important;
}

.badge-sistema {
    background-color: var(--primary-color) !important;
    color: white !important;
}

.badge-usuario {
    background-color: var(--status-neutral) !important;
    color: white !important;
}

/* --- LOGIN Y PARTICULAS --- */
#particles-bg {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw; height: 100vh;
    z-index: 0;
    pointer-events: none;
    background: var(--bg-light);
    display: block;
}
canvas#particles-bg {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 0;
    pointer-events: none;
    background: var(--bg-light);
    display: block;
}
.particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.18;
    pointer-events: none;
    animation: particle-move 18s linear infinite;
}
@keyframes particle-move {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0.18;
    }
    80% {
        opacity: 0.18;
    }
    100% {
        transform: translateY(-120vh) scale(1.2);
        opacity: 0;
    }
}
.login-card {
    position: relative;
    z-index: 2;
    background: var(--bg-white);
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(var(--primary-color-rgb), 0.1);
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}
.modal {
    z-index: 1050;
}
.modal-backdrop {
    z-index: 1040 !important;
}
.modal-content {
    border-radius: 10px;
    background: var(--bg-white);
    color: var(--text-dark);
    z-index: 1060;
}
.modal.show {
    display: block;
}
body.modal-open {
    overflow: hidden !important;
}

.sidebar { 
    width: 250px; 
    background: var(--bg-white); 
    color: var(--text-dark);
    border-right: 1px solid var(--border-light);
    height: 100vh; 
    position: fixed; 
    padding-top: 20px; 
    transition: all 0.3s; 
    z-index: 1001; 
}

.sidebar a { 
    color: var(--text-dark); 
    padding: 15px; 
    display: block; 
    text-decoration: none; 
    font-size: 1.1em; 
    transition: 0.3s; 
}

.sidebar a:hover { 
    background: var(--primary-light); 
    color: var(--primary-dark);
    font-weight: 600;
    transform: scale(1.05); 
}

.topbar { 
    width: calc(100% - 250px); 
    height: 70px; /* Aumentado de 60px a 70px */
    background: var(--bg-white); 
    color: var(--text-dark);
    border-bottom: 1px solid var(--border-light);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08); 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 0 25px; /* Aumentado padding horizontal */
    position: fixed; 
    top: 0; 
    right: 0; 
    z-index: 1020; 
}

.user-menu { 
    position: relative;
    padding: 8px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: var(--text-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.2rem;
}

.user-avatar:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.profile-card {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background: var(--bg-white);
    color: var(--text-dark);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 12px;
}

.profile-card:hover {
    background: var(--bg-light);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.user-info {
    padding-right: 8px;
}

.user-info h6 {
    color: var(--secondary-color);
    font-size: 0.95rem;
}

.user-info small {
    font-size: 0.8rem;
}

.dropdown-menu {
    margin-top: 10px !important;
    background: var(--bg-white);
    color: var(--text-dark);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0;
    min-width: 240px;
    display: none;
    z-index: 1021 !important; /* Mayor que el z-index de .topbar */
}

.dropdown-menu.show {
    display: block;
}

.dropdown-header {
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-white);
    border-radius: 12px 12px 0 0;
}

.dropdown-item {
    padding: 0.7rem 1.5rem;
    transition: all 0.3s;
}

.dropdown-item:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.dropdown-item.text-danger:hover {
    background-color: rgba(var(--status-danger), 0.1);
}

.dropdown-divider {
    margin: 0.3rem 0;
    border-color: var(--border-light);
}

.content { 
    display: block !important;
    flex-direction: unset !important;
    overflow: visible !important;
    height: auto !important;
    margin-left: 260px; 
    padding: 70px 20px 20px; 
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s; 
}

.content h2 {
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.card { 
    transition: transform 0.3s ease-in-out, box-shadow 0.3s; 
    border-radius: 12px; 
    background: var(--bg-white);
    color: var(--text-dark);
    box-shadow: 0px 4px 10px rgba(var(--primary-color-rgb), 0.05);
    border: 1px solid var(--border-light);
}

.card:hover { 
    transform: none; /* Quitar el efecto zoom de la card que contiene la tabla */
    box-shadow: 0px 4px 10px rgba(var(--primary-color-rgb), 0.05);
}

.card.mb-4 {
    margin-bottom: 1rem !important;
    flex-shrink: 0;
}

.chart-container { 
    position: relative;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 1.5rem;
    margin: 1rem 0;
    background: var(--bg-white); 
    border-radius: 12px; 
    box-shadow: 0px 4px 10px rgba(var(--primary-color-rgb), 0.05); 
    margin-top: 20px; 
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-y: auto;
    padding: 15px;
    margin-bottom: 20px;
}

.chart-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    width: 100%;
    max-width: 800px; /* Aumentado de 500px */
    margin: 0 auto;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#sidebarToggle { 
    display: none; 
    background: transparent;
    border: none;
    color: var(--secondary-color);
    font-size: 1.5rem;
    padding: 0.5rem;
}

.logo-sidebar {
    max-width: 180px;
    height: auto;
    margin: 0 auto;
}

.logo-topbar {
    height: 40px;
    width: auto;
}

.stats-card {
    border: 1px solid var(--border-light);
    background: var(--bg-white);
    color: var(--text-dark);
    transition: transform 0.2s ease-in-out;
    margin-bottom: 20px;
}

.stats-card:hover {
    transform: translateY(-5px);
}

.stats-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stats-icon i {
    font-size: 1.5rem;
}

.stats-card h3 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-dark);
}

.stats-card p {
    font-size: 0.9rem;
    font-weight: 500;
}

.search-bar {
    width: 300px;
}

.search-bar .input-group {
    background: var(--bg-white);
    border-radius: 8px;
}

.search-bar input,
.search-bar .input-group-text {
    background: transparent;
    color: var(--text-dark);
    border: 1px solid var(--border-light);
}

.search-bar input:focus {
    box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.08);
    border-color: var(--primary-color);
}

.clock-display {
    color: var(--secondary-color);
    font-size: 0.9rem;
    padding: 6px 12px;
    background: var(--bg-white);
    border-radius: 8px;
}

.notifications-bell .btn {
    color: var(--secondary-color);
    padding: 8px;
    border-radius: 8px;
}

.notifications-bell .btn:hover {
    background: var(--bg-white);
}

.notifications-dropdown {
    width: 300px;
    padding: 0;
}

.notifications-dropdown .dropdown-header {
    padding: 12px 16px;
    font-weight: 600;
}

.notifications-dropdown .dropdown-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
}

.notifications-dropdown .dropdown-item:last-child {
    text-align: center;
    font-weight: 500;
}

.catalog-btn {
    background: var(--primary-color);
    color: var(--text-light);
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    border: none;
    display: flex;
    align-items: center;
}

.catalog-btn:hover {
    background: var(--primary-dark);
    color: var(--text-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(var(--primary-color-rgb), 0.2);
}

.catalog-btn i {
    font-size: 1.1rem;
}

/* Estilos para la tabla de técnicos */
.table-responsive {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--bg-white);
    flex: 1;
    overflow-y: auto;
    margin: 0;
    padding: 1rem;
    position: relative;
    z-index: 1;
    width: 100%;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 0 8px rgba(0,0,0,0.03);
    min-width: 0;
    max-width: 100vw;
}

.table-responsive::-webkit-scrollbar {
    width: 8px;
    height: 6px;
    background: var(--bg-white);
}

.table-responsive::-webkit-scrollbar-track {
    background: var(--bg-white);
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 3px;
}

/* Show a scroll hint on mobile */
@media (max-width: 767px) {
    .table-scroll-hint {
        display: block;
        text-align: center;
        font-size: 0.85rem;
        color: var(--status-neutral);
        margin-bottom: 0.5rem;
    }
    .table-responsive {
        margin-bottom: 1rem;
    }
}

/* Ensure .content and .main-content are scrollable on small screens */
@media (max-width: 991px) {
    .content, .main-content {
        overflow-y: auto !important;
        overflow-x: visible !important;
        height: auto !important;
        min-height: 100vh;
        max-height: none;
    }
    .table-container-wrapper {
        overflow-x: auto !important;
        width: 100vw;
        max-width: 100vw;
    }
    .card-body {
        overflow-x: auto !important;
        max-width: 100vw;
    }
}

/* Remove max-height for table-responsive on small screens */
@media (max-width: 991px) {
    .table-responsive {
        max-height: none !important;
        height: auto !important;
    }
}

.sticky-top {
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.action-btn {
    color: var(--secondary-color);
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    padding: 6px 12px;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: var(--primary-color);
    color: var(--text-light);
    transform: translateY(-2px);
}

.table-hover tbody tr:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
    transition: background-color 0.2s ease;
}

/* Estilos para las cabeceras ordenables */
.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.sortable:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.sortable i {
    opacity: 0.3;
    transition: all 0.2s ease;
}

.sortable:hover i {
    opacity: 1;
}

.fa-sort-asc,
.fa-sort-desc {
    opacity: 1 !important;
    color: var(--primary-color);
}

/* Estilos para los filtros */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-color-rgb), 0.25);
}

.form-select {
    cursor: pointer;
}

.form-control::placeholder {
    color: var(--status-neutral);
    opacity: 0.8;
}

/* Estilos para el modal de detalles */
.modal-content {
    border: 1px solid var(--border-light);
    border-radius: 15px;
    background: var(--bg-white);
    color: var(--text-dark);
}

.modal-header,
.modal-footer {
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
    word-wrap: break-word;
}

.modal .user-avatar {
    background: var(--primary-color);
    margin-bottom: 1rem;
}

.modal .tecnico-estado {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

.modal .form-label {
    margin-bottom: 0.3rem;
}

.modal .tecnico-email {
    word-break: break-word;
    max-width: 100%;
}

.modal-backdrop.show {
    opacity: 0.7;
}

.fw-medium {
    font-weight: 500;
}

/* Estilos adicionales para modales */
.modal .list-group-item {
    transition: all 0.2s ease;
    border-left: none;
    border-right: none;
}

.modal .list-group-item:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.modal .list-group-item:first-child {
    border-top: none;
}

.modal .list-group-item:last-child {
    border-bottom: none;
}

.modal .list-group-item .fa-download {
    opacity: 0.5;
    transition: all 0.2s ease;
}

.modal .list-group-item:hover .fa-download {
    opacity: 1;
    transform: translateY(-2px);
}

/* Ajustar efecto fade de los modales */
.fade-light {
    transition: opacity 0.15s linear;
}

.fade-light.show {
    opacity: 1;
}

.modal-backdrop {
    opacity: 0.3 !important; /* Reducir opacidad del fondo */
    transition: opacity 0.15s linear;
}

.modal-backdrop.show {
    opacity: 0.3 !important;
}

/* Asegurar que solo haya un backdrop visible */
.modal-backdrop ~ .modal-backdrop {
    display: none;
}

/* Estilos para el modal de documentos */
.documentos-container {
    min-height: 200px;
    position: relative;
}

.documentos-list .list-group-item {
    border: none;
    border-radius: 8px;
    margin-bottom: 8px;
    background: var(--bg-white);
    transition: all 0.3s ease;
}

.documentos-list .list-group-item:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
    transform: translateX(5px);
}

.documentos-list .list-group-item .doc-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.documentos-list .doc-info {
    flex: 1;
}

.documentos-list .doc-actions {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.documentos-list .list-group-item:hover .doc-actions {
    opacity: 1;
}

.no-documents {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    text-align: center;
    color: var(--status-neutral);
}

.documentos-cae-list {
    max-height: 60vh;
    overflow-y: auto;
}

/* Estilo para el scrollbar */
.documentos-cae-list::-webkit-scrollbar {
    width: 6px;
}

.documentos-cae-list::-webkit-scrollbar-track {
    background: var(--bg-white);
    border-radius: 3px;
}

.documentos-cae-list::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 3px;
}

.documentos-cae-list::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

.documentos-cae-list .doc-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.documentos-cae-list .badge {
    font-size: 0.8rem;
    padding: 0.35em 0.65em;
}

/* Mejoras para nombres largos en documentos CAE */
.documentos-cae-list .list-group-item {
    padding: 12px 16px;
}

.documentos-cae-list .doc-info {
    flex: 1;
    min-width: 0; /* Permite que el contenido se comprima */
    overflow: hidden;
}

.documentos-cae-list .doc-info h6 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.documentos-cae-list .doc-info small {
    display: block;
    margin-top: 4px;
    font-size: 0.8rem;
    color: var(--secondary-color);
}

.documentos-cae-list .doc-actions {
    flex-shrink: 0;
    margin-left: 12px;
}

/* Responsive para documentos CAE */
@media (max-width: 576px) {
    .documentos-cae-list .list-group-item {
        padding: 10px 12px;
    }
    
    .documentos-cae-list .doc-info h6 {
        font-size: 0.9rem;
        -webkit-line-clamp: 3;
    }
    
    .documentos-cae-list .doc-icon {
        width: 35px;
        height: 35px;
    }
}

/* Estilos para el modal de documentos de técnico */
#documentsModal .list-group-item {
    padding: 1rem;
    border: 1px solid rgba(0,0,0,.125);
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
}

#documentsModal .list-group-item:hover {
    background-color: rgba(0,0,0,.02);
}

#documentsModal .text-truncate {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#documentsModal .btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

#documentsModal .btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Asegurar que el modal tenga suficiente ancho */
#documentsModal .modal-dialog {
    max-width: 600px;
}

/* Mejorar el espaciado del contenido del modal */
#documentsModal .modal-body {
    padding: 1.5rem;
}

/* --- RGPD Tables with Vertical Scroll --- */
.table-container-wrapper {
    position: relative;
    width: 100%;
}

.table-responsive {
    max-height: none !important;
    height: auto !important;
    min-height: 0 !important;
    margin-bottom: 0 !important;
}

.table-responsive thead.sticky-top {
    position: sticky;
    top: 0;
    z-index: 10;
}

.table-responsive thead.sticky-top th {
    background-color: var(--bg-white);
    position: -webkit-sticky;  /* Para Safari */
    position: sticky;
    top: 0;
    z-index: 10;
    border-top: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Correccion para Firefox */
@-moz-document url-prefix() {
    .table-responsive thead.sticky-top th {
        background-clip: padding-box;
    }
}

/* Mejoras visuales para filas seleccionadas/hover en tablas */
.table-responsive tbody tr:hover {
    background-color: rgba(var(--primary-color-rgb), 0.05);
}

/* Añadir sombra suave al contenedor de la tabla */
.table-container-wrapper .card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden;
    border: none;
}

/* Responsive adjustments for RGPD navigation */
@media (max-width: 767px) {
    .nav-pills {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 10px;
        scrollbar-width: thin;
        scrollbar-color: var(--primary-light) transparent;
    }
    
    .nav-pills::-webkit-scrollbar {
        height: 4px;
    }
    
    .nav-pills::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .nav-pills::-webkit-scrollbar-thumb {
        background-color: var(--primary-light);
        border-radius: 20px;
    }
    
    .nav-pills .nav-link {
        white-space: nowrap;
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .nav-pills .nav-item {
        margin-bottom: 5px;
    }
}

@media (max-width: 768px) {
    .sidebar { 
        transform: translateX(-250px); 
        top: 0;
    }
    .sidebar.active { 
        transform: translateX(0); 
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }
    .topbar { 
        left: 0; 
        width: 100%;
        padding: 0 15px;
        height: 60px;
    }
    .content { 
        margin-left: 0; 
        padding: 75px 15px 15px; 
        height: calc(100vh - 60px);
        padding-top: 60px;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    #sidebarToggle { 
        display: block; 
        position: static; /* Cambiado de fixed a static */
        background: transparent;
        border: none;
        color: var(--secondary-color);
        padding: 8px;
        font-size: 1.2rem;
        border-radius: 4px;
        cursor: pointer;
        transition: transform 0.2s;
    }

    #sidebarToggle:active {
        transform: scale(0.95);
    }

    .card { 
        margin-bottom: 15px; 
    }
    .row { 
        margin-right: 0; 
        margin-left: 0; 
    }
    .chart-container { 
        height: 500px;
        margin: 1rem 0;
        padding: 10px; 
        margin-top: 15px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch; /* Para scroll suave en iOS */
        height: 350px;
        margin-top: 15px;
    }
    .chart-wrapper {
        min-height: 350px; /* Altura ajustada para móvil */
        padding: 5px;
        max-width: 100%;
    }
    .topbar .logo { 
        margin-left: 45px; 
    }
    .logo-topbar {
        height: 30px;
    }
    .profile-card {
        background: transparent;
        border: none;
        padding: 0;
    }
    .profile-card:hover {
        transform: none;
        background: transparent;
        box-shadow: none;
    }
    .search-bar {
        width: 150px; /* Reducido para móviles */
        margin-left: 10px;
    }
    .search-bar input::placeholder {
        font-size: 0.9rem;
    }
    .clock-display {
        display: none !important;
    }
    .notifications-bell .btn {
        padding: 4px 8px;
    }
    .notifications-dropdown {
        width: 280px;
        position: fixed;
        top: 60px !important;
        right: 10px !important;
        left: auto !important;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
        z-index: 1021 !important;
    }
    .user-menu .dropdown-menu {
        position: fixed;
        top: 60px !important;
        right: 10px !important;
        left: auto !important;
        width: 280px;
        z-index: 1021 !important;
    }
    .stats-card {
        margin-bottom: 15px;
    }
    .stats-icon {
        width: 40px;
        height: 40px;
    }
    .stats-card h3 {
        font-size: 1.5rem;
    }
    .d-flex.align-items-center.gap-4 {
        gap: 0.75rem !important;
    }

    .notifications-dropdown,
    .user-menu .dropdown-menu {
        position: fixed !important;
        top: 60px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: calc(100% - 20px) !important;  /* Ancho ajustable al dispositivo */
        max-width: 300px;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
        margin-top: 0 !important;
        transform: none !important;
    }

    /* Fondo oscuro cuando el dropdown está activo */
    .dropdown.show::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    /* Asegurar que el dropdown está por encima del overlay */
    .notifications-dropdown.show,
    .user-menu .dropdown-menu.show {
        z-index: 1000;
    }

    /* Ajustar la posición del badge de notificaciones */
    .notifications-bell .badge {
        transform: translate(25%, -50%) !important;
        top: 0 !important;
    }

    .catalog-btn {
        padding: 6px 12px;
        font-size: 0.9rem;
    }

    .dropdown-menu {
        position: fixed !important;
        top: 60px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: calc(100% - 2rem) !important;
        max-width: 300px !important;
        margin: 0 !important;
        z-index: 1000 !important;
        box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.25) !important;
    }

    .dropdown-menu.show {
        display: block !important;
    }

    /* Sidebar overlay */
    .sidebar::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s, visibility 0.3s;
    }

    .sidebar.active::before {
        opacity: 1;
        visibility: visible;
    }

    .dropdown-menu.show {
        display: block !important;
        z-index: 1000 !important;
    }

    .notifications-dropdown.show,
    .user-menu .dropdown-menu.show {
        position: fixed !important;
        top: 60px !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        width: calc(100% - 20px) !important;
        max-width: 300px !important;
    }

    /* Fix mobile avatar shape */
    .user-avatar {
        min-width: 35px;  /* Added min-width */
        aspect-ratio: 1;  /* Force square shape */
    }

    .mobile-dropdown-overlay {
        z-index: 1019; /* Por debajo de los dropdowns pero por encima del resto */
    }

    .modal-dialog {
        margin: 1rem;
    }
    
    .modal .user-avatar {
        width: 100px !important;
        height: 100px !important;
    }

    /* Reset estados hover en móvil */
    .dropdown-item {
        background: transparent !important;
        color: inherit !important;
    }
    
    /* Solo aplicar estilos al tocar */
    .dropdown-item:active {
        background: var(--primary-light) !important;
        color: var(--primary-dark) !important;
    }

    /* Fijar position y tamaño de dropdowns */
    .notifications-dropdown,
    .user-menu .dropdown-menu {
        position: fixed !important;
        top: 60px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: calc(100% - 2rem) !important;
        max-width: 300px;
        margin: 0 !important;
        border-radius: 12px !important;
        background: var(--bg-white) !important;
    }

    /* Asegurar que los items del dropdown no mantengan estados hover */
    .dropdown-menu.show .dropdown-item {
        background: transparent !important;
    }

    /* Eliminar efectos de hover persistentes */
    * {
        -webkit-tap-highlight-color: transparent;
    }

    /* Manejo de dropdowns en móvil */
    .dropdown {
        position: relative;
    }

    .dropdown.show::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .dropdown-menu.show {
        position: fixed !important;
        top: 60px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: calc(100% - 2rem) !important;
        max-width: 300px !important;
        margin: 0 !important;
        z-index: 1000 !important;
        background: var(--bg-white) !important;
    }

    /* --- Responsividad mejorada para tablas RGPD --- */
    @media (min-width: 1200px) {
        .table-responsive {
            max-height: 500px;  /* Pantallas más grandes pueden mostrar más filas */
        }
    }

    @media (min-width: 992px) and (max-width: 1199px) {
        .table-responsive {
            max-height: 450px;
        }
    }

    @media (min-width: 768px) and (max-width: 991px) {
        .table-responsive {
            max-height: 400px;
        }
    }

    @media (max-width: 767px) {
        .table-responsive {
            max-height: 350px;
        }
        
        /* Ajustar columnas en móvil */
        .table-responsive table td,
        .table-responsive table th {
            padding: 0.5rem;
            font-size: 0.875rem;
        }
        
        /* Ocultar algunas columnas en pantallas muy pequeñas */
        @media (max-width: 576px) {
            .table-responsive table .hide-xs {
                display: none;
            }
        }
    }

    /* Clases de utilidad para ocultar columnas en pantallas pequeñas */
    @media (max-width: 992px) {
        .hide-md {
            display: none !important;
        }
    }

    @media (max-width: 768px) {
        .hide-sm {
            display: none !important;
        }
    }

    @media (max-width: 576px) {
        .hide-xs {
            display: none !important;
        }
        
        /* Ajustar ancho de columnas prioritarias en móvil */
        .mobile-expand {
            min-width: 50%;
        }
    }
}


.active>.page-link, .page-link.active {
    background-color: var(--primary-color) !important;
    color: var(--text-light) !important;
    border-color: var(--primary-color) !important;
}

.active>.page-link, .page-link.active {
    background-color: var(--primary-color) !important;
    color: var(--text-light) !important;
    border-color: var(--primary-color) !important;
}

.page-link{
    color: var(--primary-color) !important;
}