* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    position: relative;
    overflow-x: hidden; /* Permitir scroll vertical, ocultar solo el horizontal */
}

.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/cenedis/img/escusuper.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(8px);
    z-index: -2;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: -1;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 35px;
    width: 100%;
    max-width: 380px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo-section {
    text-align: center;
    margin-bottom: 35px;
}

.logo-section img {
    width: 80px;
    height: auto;
    margin-bottom: 15px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.system-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
    letter-spacing: -0.5px;
}

.system-subtitle {
    font-size: 0.9rem;
    color: #7f8c8d;
    font-weight: 400;
}

.form-floating {
    margin-bottom: 20px;
}

.form-control {
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    padding: 12px 15px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
}

.form-control:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.15);
    background-color: #ffffff;
}

.form-floating label {
    color: #6c757d;
    font-weight: 500;
    padding: 12px 15px;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: #28a745;
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
}

.btn-login {
    background: linear-gradient(135deg, #1e7e34 0%, #28a745 100%);
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    margin-top: 10px;
}

.btn-login:hover {
    background: linear-gradient(135deg, #155724 0%, #1e7e34 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
    color: white;
}

.btn-login:active {
    transform: translateY(0);
}

.input-group-text {
    background-color: #f8f9fa;
    border: 2px solid #e1e8ed;
    border-right: none;
    border-radius: 12px 0 0 12px;
    color: #6c757d;
}

.input-group .form-control {
    border-left: none;
    border-radius: 0 12px 12px 0;
}

.divider {
    text-align: center;
    margin: 30px 0 20px;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, #dee2e6, transparent);
}

.divider span {
    background: rgba(255, 255, 255, 0.98);
    padding: 0 15px;
    color: #6c757d;
    font-size: 0.85rem;
    position: relative;
}

.help-links {
    text-align: center;
    margin-top: 25px;
}

.help-links a {
    color: #28a745;
    text-decoration: none;
    font-size: 0.9rem;
    margin: 0 10px;
    transition: color 0.3s ease;
}

.help-links a:hover {
    color: #155724;
    text-decoration: underline;
}

.version-info {
    text-align: center;
    margin-top: 20px;
    font-size: 0.75rem;
    color: #95a5a6;
}

@media (max-width: 480px) {
    .login-card {
        padding: 30px 20px;
        margin: 10px;
    }
    
    .system-title {
        font-size: 1.2rem;
    }
    
    .logo-section img {
        width: 70px;
    }
}

/* --- ESTILOS DEL DASHBOARD Y LAYOUT GENERAL --- */

.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    /* Transición suave para el ancho */
    transition: width 0.3s ease;
    overflow-y: auto;
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.sidebar-logo img {
    width: 40px;
    height: auto;
    margin-right: 10px;
    transition: all 0.3s;
}

/* --- MAGIA: Expandir menú al pasar el mouse (Hover) --- */
@media (min-width: 769px) {
    .sidebar.collapsed:hover {
        width: 280px; /* Recupera su ancho original */
        box-shadow: 4px 0 15px rgba(0,0,0,0.1); /* Sombrame un poquito para resaltar */
    }

    /* Mostrar elementos ocultos al hacer hover */
    .sidebar.collapsed:hover .sidebar-logo-text,
    .sidebar.collapsed:hover .user-info,
    .sidebar.collapsed:hover .menu-text,
    .sidebar.collapsed:hover .submenu-arrow,
    .sidebar.collapsed:hover .logout-text {
        display: block;
    }

    /* Ajustar alineaciones al expandir */
    .sidebar.collapsed:hover .sidebar-logo { justify-content: flex-start; }
    .sidebar.collapsed:hover .sidebar-logo img { margin-right: 10px; }
    .sidebar.collapsed:hover .user-avatar { margin-right: 10px; margin-bottom: 0; }
    .sidebar.collapsed:hover .menu-item > a { justify-content: flex-start; }
    
    /* Asegurar que el submenu flotante se oculte si expandimos el menu */
    .sidebar.collapsed:hover .submenu ul { position: relative; }
}

.sidebar.collapsed .sidebar-logo-text,
.sidebar.collapsed .user-info,
.sidebar.collapsed .menu-text,
.sidebar.collapsed .submenu-arrow,
.sidebar.collapsed .logout-text {
    display: none;
}

.sidebar.collapsed .sidebar-logo {
    justify-content: center;
}

.sidebar.collapsed .sidebar-logo img {
    margin-right: 0;
}

.sidebar-logo h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.sidebar-user {
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    font-size: 1.2rem;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.sidebar.collapsed .user-avatar {
    margin: 0 auto;
    margin-bottom: 10px;
}

.user-info strong {
    display: block;
    font-size: 0.9rem;
}

.user-info small {
    opacity: 0.8;
    font-size: 0.8rem;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar-menu li a:hover,
.sidebar-menu li.active a {
    background: rgba(255,255,255,0.1);
    color: white;
    padding-left: 25px;
}

.sidebar.collapsed .menu-item > a {
    justify-content: center;
}

.sidebar-menu li a i {
    margin-right: 10px;
    font-size: 1.1rem;
}

.submenu > a {
    justify-content: space-between;
}

.submenu ul {
    list-style: none;
    padding: 0;
    margin: 0;
    background: rgba(0,0,0,0.2);
    display: none;
}

.submenu.open ul {
    display: block;
}

.submenu ul li a {
    padding-left: 50px;
    font-size: 0.9rem;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    position: absolute;
    bottom: 0;
    width: 100%;
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px;
    background: rgba(220,53,69,0.2);
    color: #dc3545;
    border: 1px solid #dc3545;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: #dc3545;
    color: white;
}

/* Contenido Principal */
#content {
    flex: 1;
    margin-left: 280px;
    background: #f8f9fa;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

#content.collapsed {
    margin-left: 80px;
}

.top-navbar {
    background: white;
    padding: 15px 30px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 999;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.notifications .badge {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 0.7rem;
}

.main-content {
    padding: 30px;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

.page-subtitle {
    color: #6c757d;
    margin: 5px 0 0 0;
}

/* Stat Cards y Cards Generales */
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    transition: transform 0.3s;
    margin-bottom: 20px;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: white;
    font-size: 1.5rem;
}

.stat-content h3 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e50;
}

.stat-content p {
    margin: 5px 0 0 0;
    color: #6c757d;
    font-size: 0.9rem;
}

/* Estilo Glassmorphism para Tarjetas */
.card-glass {
    background: rgba(255, 255, 255, 0.65) !important; /* Más transparente */
    backdrop-filter: blur(15px) saturate(180%); /* Blur más intenso */
    -webkit-backdrop-filter: blur(15px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1); /* Sombra suave */
}

.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 25px;
}

.card-header {
    background: white;
    border-bottom: 1px solid #dee2e6;
    padding: 20px;
    border-radius: 12px 12px 0 0;
}

/* Ajuste para header dentro de tarjeta glass */
.card-glass .card-header {
    background: transparent;
    border-bottom: none;
    padding-bottom: 0;
}

/* --- ESTILOS PARA TABLAS FLOTANTES (BLUR & ROUNDED) --- */

/* Aplicar efecto glass a todas las tablas con clase .datatable */
.datatable,
.table {
    --bs-table-bg: transparent;
    --bs-table-accent-bg: transparent;
    border-collapse: separate;
    border-spacing: 0 12px; /* Más separación entre filas */
    margin-bottom: 0;
    position: relative;
}

/* Encabezados modernos con gradiente y blur */
.datatable thead th,
.table thead th {
    background: linear-gradient(135deg, rgba(44, 62, 80, 0.9) 0%, rgba(52, 73, 94, 0.85) 100%);
    color: white;
    border: none;
    padding: 18px 20px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    font-size: 0.8rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

/* Efecto de brillo sutil en encabezados */
.datatable thead th::before,
.table thead th::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
}

.datatable thead th:hover::before,
.table thead th:hover::before {
    left: 100%;
}

/* Bordes redondeados para el encabezado */
.datatable thead th:first-child,
.table thead th:first-child { 
    border-top-left-radius: 15px; 
    border-bottom-left-radius: 15px; 
}

.datatable thead th:last-child,
.table thead th:last-child { 
    border-top-right-radius: 15px; 
    border-bottom-right-radius: 15px; 
}

/* Contenedor de filas con efecto de tarjeta flotante */
.datatable tbody,
.table tbody {
    position: relative;
}

/* Filas con efecto de tarjeta moderna */
.datatable tbody tr,
.table tbody tr {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.75) 100%);
    backdrop-filter: blur(8px) saturate(120%);
    -webkit-backdrop-filter: blur(8px) saturate(120%);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border-radius: 15px;
    margin-bottom: 12px;
}

.datatable tbody tr td,
.table tbody tr td {
    border: none;
    padding: 18px 20px;
    vertical-align: middle;
    color: #2c3e50;
    font-weight: 500;
    position: relative;
    background: transparent;
}

/* Sin bordes redondeados individuales en celdas */
.datatable tbody tr td:first-child,
.table tbody tr td:first-child { 
    border-top-left-radius: 15px; 
    border-bottom-left-radius: 15px; 
}

.datatable tbody tr td:last-child,
.table tbody tr td:last-child { 
    border-top-right-radius: 15px; 
    border-bottom-right-radius: 15px; 
}

/* Efecto hover moderno */
.datatable tbody tr:hover,
.table tbody tr:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.9) 100%);
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 12px 35px rgba(0,0,0,0.12), 0 6px 15px rgba(0,0,0,0.08);
}

/* Efecto de resplandor en hover */
.datatable tbody tr:hover::before,
.table tbody tr:hover::before {
    background: linear-gradient(90deg, transparent, rgba(40, 167, 69, 0.2), transparent);
    height: 2px;
}

.datatable tbody tr:hover::after,
.table tbody tr:hover::after {
    background: linear-gradient(90deg, transparent, rgba(40, 167, 69, 0.1), transparent);
    height: 2px;
}

/* Estilos específicos para DataTables dentro de tarjetas glass */
.card-glass .datatable,
.card-glass .table {
    --bs-table-bg: transparent;
    --bs-table-accent-bg: transparent;
    border-collapse: separate;
    border-spacing: 0 12px;
    margin-bottom: 0;
}

.card-glass .datatable thead th,
.card-glass .table thead th {
    background: linear-gradient(135deg, rgba(44, 62, 80, 0.9) 0%, rgba(52, 73, 94, 0.85) 100%);
    color: white;
    border: none;
    padding: 18px 20px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    font-size: 0.8rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Bordes redondeados para el encabezado */
.card-glass .datatable thead th:first-child,
.card-glass .table thead th:first-child { border-top-left-radius: 15px; border-bottom-left-radius: 15px; }
.card-glass .datatable thead th:last-child,
.card-glass .table thead th:last-child { border-top-right-radius: 15px; border-bottom-right-radius: 15px; }

/* Filas con efecto de tarjeta moderna dentro de glass */
.card-glass .datatable tbody tr,
.card-glass .table tbody tr {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.75) 100%);
    backdrop-filter: blur(8px) saturate(120%);
    -webkit-backdrop-filter: blur(8px) saturate(120%);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border-radius: 15px;
    margin-bottom: 12px;
}

.card-glass .datatable tbody tr td,
.card-glass .table tbody tr td {
    border: none;
    padding: 18px 20px;
    vertical-align: middle;
    color: #2c3e50;
    font-weight: 500;
    position: relative;
    background: transparent;
}

/* Bordes redondeados para las filas */
.card-glass .datatable tbody tr td:first-child,
.card-glass .table tbody tr td:first-child { border-top-left-radius: 15px; border-bottom-left-radius: 15px; }
.card-glass .datatable tbody tr td:last-child,
.card-glass .table tbody tr td:last-child { border-top-right-radius: 15px; border-bottom-right-radius: 15px; }

/* Efecto Hover en filas dentro de glass */
.card-glass .datatable tbody tr:hover,
.card-glass .table tbody tr:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.9) 100%);
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 12px 35px rgba(0,0,0,0.12), 0 6px 15px rgba(0,0,0,0.08);
}

/* Efecto de pulsación sutil al hacer click */
.datatable tbody tr:active,
.table tbody tr:active {
    transform: translateY(-1px) scale(1.005);
    transition: transform 0.1s;
}

.card-title {
    color: #2c3e50;
    font-weight: 600;
}

/* Estilos para Formularios y Validaciones */
.form-control.is-invalid {
    border-color: #dc3545;
}

.invalid-feedback {
    display: none;
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-control.is-invalid ~ .invalid-feedback {
    display: block;
}

/* Ajustes para DataTables */
.datatable .btn-group-sm > .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.badge {
    font-size: 0.75rem;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    #content {
        margin-left: 0;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .stat-card {
        margin-bottom: 15px;
    }
    
    /* En móviles, la ventanita flotante se vuelve normal para que no tape */
    .floating-stats {
        position: static !important;
        width: 100% !important;
        margin-bottom: 20px;
        transform: none !important;
    }
    
    /* --- OPTIMIZACIÓN TABLAS MÓVIL --- */
    
    /* Permitir scroll horizontal en las tarjetas de tablas */
    .card-body {
        padding: 10px; /* Menos relleno para ganar espacio */
        overflow-x: auto; /* Scroll horizontal nativo */
        -webkit-overflow-scrolling: touch; /* Scroll suave en iOS */
    }

    /* Texto más compacto en tablas */
    .datatable thead th,
    .table thead th {
        padding: 12px 10px;
        font-size: 0.75rem; /* Letra un poco más chica */
        white-space: nowrap; /* Evitar que los títulos se rompan */
    }

    .datatable tbody tr td,
    .table tbody tr td {
        padding: 12px 10px;
        font-size: 0.8rem;
    }
    
    /* Fondo oscuro para el menú móvil */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5); /* Oscuro semi-transparente */
        z-index: 999; /* Debajo del sidebar (1000) pero encima de todo lo demás */
        backdrop-filter: blur(3px); /* Efecto borroso bonito */
        display: none; /* Oculto por defecto */
        transition: opacity 0.3s ease;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
}

/* --- MODO OSCURO FORZADO (GLASS DARK) --- */

[data-bs-theme="dark"] body {
    color: #e0e0e0;
}

/* El contenido principal debe ser transparente para ver el fondo */
[data-bs-theme="dark"] #content {
    background: transparent; 
}

/* Barra superior oscura y translúcida */
[data-bs-theme="dark"] .top-navbar {
    background: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* Tarjetas Glass Oscuras */
[data-bs-theme="dark"] .card-glass {
    background: rgba(0, 0, 0, 0.6) !important; /* Cristal negro */
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Textos en tarjetas */
[data-bs-theme="dark"] .card-title,
[data-bs-theme="dark"] .page-title {
    color: #fff;
}

[data-bs-theme="dark"] .text-muted {
    color: #a0a0a0 !important;
}

/* Corrección para botones y textos oscuros forzados por Bootstrap */
[data-bs-theme="dark"] .text-dark {
    color: #f8f9fa !important;
}

[data-bs-theme="dark"] .btn-light {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* --- TABLAS FLOTANTES EN MODO OSCURO --- */

[data-bs-theme="dark"] .card-glass .table thead th {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(30, 30, 30, 0.8) 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

[data-bs-theme="dark"] .card-glass .table tbody tr {
    background: rgba(40, 40, 40, 0.7); /* Filas oscuras */
    box-shadow: none;
}

[data-bs-theme="dark"] .card-glass .table tbody tr:hover {
    background: rgba(60, 60, 60, 0.9) !important;
}

[data-bs-theme="dark"] .card-glass .table tbody tr td {
    color: #e0e0e0; /* Texto claro */
}

/* Inputs y Selects */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

[data-bs-theme="dark"] .form-control:focus {
    background-color: rgba(0, 0, 0, 0.5);
}

/* --- ESTILOS PARA ESTADÍSTICAS FLOTANTES --- */
.floating-stats {
    position: fixed;
    top: 130px; /* Un poco más abajo del header */
    right: 20px;
    width: 180px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 900;
    border: 1px solid rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.floating-stats:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

[data-bs-theme="dark"] .floating-stats {
    background: rgba(30, 30, 30, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- ESTILOS VISOR MTO --- */
.mto-paper {
    background-color: #ffffff;
    color: #212529; /* Texto oscuro forzado en modo claro */
    border-radius: 8px;
    padding: 30px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace; /* Fuente tipo máquina de escribir */
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-wrap;
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.02);
    min-height: 400px;
}

/* Adaptación Visor MTO a Modo Oscuro */
[data-bs-theme="dark"] .mto-paper {
    background-color: rgba(20, 20, 20, 0.6); /* Fondo casi negro translúcido */
    color: #e0e0e0; /* Texto claro */
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 30px rgba(0,0,0,0.5);
}

.text-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6c757d;
    margin-bottom: 2px;
    display: block;
}

[data-bs-theme="dark"] .text-label {
    color: #adb5bd;
}

/* --- ESTILOS BANDEJA MTO --- */
.table-hover tbody tr { cursor: pointer; transition: background-color 0.2s ease; }
.table-hover tbody tr:hover { background-color: #f8f9fa; }
.table-hover tbody tr.selected { background-color: #e3f2fd; }
.nav-tabs .nav-link { color: #6c757d; }
.nav-tabs .nav-link.active { color: #0d6efd; font-weight: 500; }
.adjunto-icon { color: #6c757d; transition: color 0.2s ease; }
.adjunto-icon.has-file { color: #28a745; }
.adjunto-icon:hover { color: #007bff; }
.estado-badge { font-size: 0.8em; padding: 0.35em 0.65em; }
#buscadorMTOs:focus { box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25); }
.filtro-activo { background-color: #f8f9fa; border-radius: 0.375rem; }
.fade-in { animation: fadeIn 0.3s ease-in; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Responsive específico para MTO */
@media (max-width: 768px) {
    .nav-tabs .nav-link { padding: 0.5rem 0.75rem; font-size: 0.875em; }
}

/* --- ESTILOS PERFIL --- */
.profile-photo-container { 
    position: relative; width: 160px; height: 160px; margin: 0 auto; 
    border-radius: 50%; overflow: hidden; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.15); border: 4px solid rgba(255, 255, 255, 0.8); 
}
.photo-overlay { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0, 0, 0, 0.5); display: flex; flex-direction: column; 
    justify-content: center; align-items: center; opacity: 0; 
    transition: opacity 0.3s ease; cursor: pointer; 
}
.profile-photo-container:hover .photo-overlay { opacity: 1; }

/* --- ESTILOS NOTIFICACIONES --- */
.notification-item { 
    border-left: 4px solid #dee2e6; padding: 12px 15px; margin-bottom: 10px; 
    background: #f8f9fa; border-radius: 8px; transition: all 0.3s ease; color: #212529; 
}
.notification-item.no_leida { border-left-color: #007bff; background: #e7f3ff; }
.notification-item.leida { border-left-color: #6c757d; background: #f8f9fa; }
.notification-item:hover { transform: translateX(5px); box-shadow: 0 2px 8px rgba(0,0,0,0.1); }

[data-bs-theme="dark"] .notification-item { background: rgba(255, 255, 255, 0.05); color: #e0e0e0; border-left-color: rgba(255, 255, 255, 0.2); }
[data-bs-theme="dark"] .notification-item.no_leida { background: rgba(13, 110, 253, 0.15); border-left-color: #0d6efd; }
[data-bs-theme="dark"] .notification-item.leida { background: rgba(255, 255, 255, 0.03); border-left-color: #495057; }
[data-bs-theme="dark"] .notification-item:hover { background: rgba(255, 255, 255, 0.1); box-shadow: 0 2px 8px rgba(0,0,0,0.3); }

.notification-type { font-size: 0.7rem; padding: 2px 6px; border-radius: 12px; background: #6c757d; color: white; text-transform: uppercase; font-weight: 600; }
.notification-type.mto_asignado { background: #28a745; }
.notification-type.cambio_estado { background: #17a2b8; }
.notification-type.nueva_funcion { background: #6f42c1; }
.notification-type.sistema { background: #fd7e14; }
.notification-type.info { background: #17a2b8; }
.notification-actions { display: flex; flex-direction: column; gap: 5px; margin-left: 10px; }
.animate-pulse { animation: pulse 2s infinite; }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.1); } 100% { transform: scale(1); } }

#listaNotificaciones { max-height: 400px; overflow-y: auto; }
#listaNotificaciones::-webkit-scrollbar { width: 6px; }
#listaNotificaciones::-webkit-scrollbar-track { background: #f1f1f1; }
#listaNotificaciones::-webkit-scrollbar-thumb { background: #888; border-radius: 3px; }
#listaNotificaciones::-webkit-scrollbar-thumb:hover { background: #555; }

/* Ajustes Modal LG */
.modal-lg { max-width: 800px; }
