/* Variables y estilos base */
:root {
    --primary: #2c3e50;
    --secondary: #3498db;
    --accent: #e74c3c;
    --light: #ecf0f1;
    --dark: #1a2530;
    --success: #2ecc71;
    --warning: #f39c12;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #1a2530 0%, #2c3e50 100%);
    color: var(--light);
    line-height: 1.6;
    margin: 0;
    min-height: 100vh;
    transition: background 0.5s ease;
    overflow-x: hidden;
}

/* Modo Inmersivo para RDP */
body.app-active {
    background: #000 !important;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Página de Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background-image: 
        linear-gradient(135deg, rgba(26, 37, 48, 0.85) 0%, rgba(44, 62, 80, 0.85) 100%),
        url('login-background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    position: relative;
}

/* Overlay adicional para mejor contraste */
.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(26, 37, 48, 0.4) 70%);
    pointer-events: none;
}

.login-box {
    background: rgba(26, 37, 48, 0.92);
    border-radius: 15px;
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
    z-index: 1;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

/* Branding de la empresa */
.company-branding {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
    padding: 18px 5px;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.15) 0%, rgba(44, 62, 80, 0.2) 100%);
    border-radius: 12px;
    border: 1px solid rgba(52, 152, 219, 0.4);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.2);
    backdrop-filter: blur(5px);
    transition: var(--transition);
}

.company-branding:hover {
    border-color: rgba(52, 152, 219, 0.6);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
    transform: translateY(-1px);
}

.company-logo {
    width: 48px;
    height: 48px;
    filter: brightness(1.3) contrast(1.2) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px;
    transition: var(--transition);
}

.company-logo:hover {
    transform: scale(1.05);
    filter: brightness(1.4) contrast(1.3) drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4));
}

.company-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffffff !important;  /* Color blanco por defecto - CAMBIA AQUÍ EL COLOR */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    position: relative;
}

/* Opciones de colores para el nombre de empresa - Descomenta el que prefieras */
/*
.company-name { color: #3498db !important; }     /* Azul 
.company-name { color: #e74c3c !important; }     /* Rojo 
.company-name { color: #2ecc71 !important; }     /* Verde 
.company-name { color: #f39c12 !important; }     /* Naranja 
.company-name { color: #9b59b6 !important; }     /* Púrpura 
.company-name { color: #1abc9c !important; }     /* Turquesa 
.company-name { color: #34495e !important; }     /* Gris oscuro 
.company-name { color: #f1c40f !important; }     /* Amarillo 
.company-name { color: #e67e22 !important; }     /* Naranja oscuro 
.company-name { color: #95a5a6 !important; }     /* Gris claro 
*/

/*
.company-name::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--secondary) 0%, transparent 100%);
    border-radius: 1px;
}
*/

.login-logo i {
    font-size: 4rem;
    color: var(--secondary);
    margin-bottom: 15px;
    text-shadow: 0 0 20px rgba(52, 152, 219, 0.5);
}

.login-logo h1 {
    font-size: 2.2rem;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.login-logo span {
    color: var(--secondary);
}

.login-logo p {
    color: rgba(236, 240, 241, 0.8);
    margin-top: 10px;
    font-size: 1.1rem;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
}

.login-form .form-group {
    margin-bottom: 25px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.login-form input {
    width: 100%;
    padding: 14px;
    border-radius: 8px;
    border: 1px solid rgba(236, 240, 241, 0.5);
    background: rgba(26, 37, 48, 0.6);
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    transition: var(--transition);
    backdrop-filter: blur(5px);
}

.login-form input:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.5);
    background: rgba(15, 25, 35, 0.9);
    color: #ffffff;
}

.login-btn {
    width: 100%;
    background: var(--secondary);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

.login-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.6);
}

.login-footer {
    text-align: center;
    margin-top: 25px;
    color: rgba(236, 240, 241, 0.7);
    font-size: 0.9rem;
}

/* Dashboard Styles */
.dashboard {
    display: none;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 25px; /* Añadido 25px de padding lateral */
    border-bottom: 1px solid rgba(236, 240, 241, 0.1);
    margin-bottom: 15px;
}

.header-search {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 500px;
    margin: 0 40px;
}

.header-search .search-box {
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo i {
    font-size: 2.5rem;
    color: var(--secondary);
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.logo span {
    color: var(--secondary);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
}

.user-name {
    font-weight: 600;
}

/* Botón Administrar */
.admin-btn {
    background: rgba(52, 152, 219, 0.2);
    color: var(--light);
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
    border: 1px solid rgba(52, 152, 219, 0.4);
}

.admin-btn:hover {
    background: var(--secondary);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.5);
    transform: translateY(-1px);
    border-color: var(--secondary);
}

.admin-btn i {
    font-size: 1rem;
}

/* Botón Salir */
.logout-btn {
    background: rgba(231, 76, 60, 0.2);
    color: var(--light);
    border: 1px solid rgba(231, 76, 60, 0.4);
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

.logout-btn:disabled {
    opacity: 0.3 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    transform: none !important;
}

.logout-btn:hover:not(:disabled) {
    background: var(--accent);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.5);
    transform: translateY(-1px);
    border-color: var(--accent);
}

.logout-btn i {
    font-size: 1rem;
}

/* Main Content */
.dashboard-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 25px;
}

/* Sidebar */
.sidebar {
    background: rgba(26, 37, 48, 0.7);
    border-radius: 15px;
    padding: 25px;
    backdrop-filter: blur(10px);
    height: fit-content;
    box-shadow: var(--shadow);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, margin 0.4s ease, width 0.4s ease;
    transform-origin: left;
    width: 300px;
    overflow: hidden;
}

/* Sidebar Toggle Button */
.sidebar-toggle-btn {
    background: none;
    border: none;
    color: var(--light);
    font-size: 1.5rem;
    cursor: pointer;
    margin-right: 20px;
    z-index: 1001;
    transition: var(--transition);
}

.sidebar-toggle-btn:disabled {
    opacity: 0.3 !important;
    cursor: not-allowed !important;
}

.sidebar-toggle-btn:hover {
    background: var(--secondary);
    color: white;
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.4);
}

/* Collapsed State Management */
.dashboard-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 25px;
    transition: grid-template-columns 0.4s cubic-bezier(0.4, 0, 0.2, 1), gap 0.4s ease;
}

.dashboard-content.sidebar-collapsed {
    grid-template-columns: 0px 1fr;
    gap: 0;
}

.dashboard-content.sidebar-collapsed .sidebar {
    transform: scaleX(0);
    opacity: 0;
    pointer-events: none;
    padding: 0;
    margin: 0;
    width: 0;
}

.dashboard-content.sidebar-collapsed .apps-container {
    width: 100%;
}

.sidebar-section {
    margin-bottom: 30px;
}

.sidebar-section h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-categories {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.category, .sidebar-btn {
    background: none;
    border: none;
    color: inherit;
    font-family: inherit;
    width: 100%;
    text-align: left;
    padding: 12px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 12px;
}

.category:hover, .category.active, .sidebar-btn:hover {
    background: var(--secondary);
}

.category i, .sidebar-btn i {
    width: 24px;
    text-align: center;
}

/* Apps Grid */
.apps-container {
    background: rgba(26, 37, 48, 0.7);
    border-radius: 15px;
    padding: 30px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    transition: padding 0.4s ease;
}

/* Modo Pantalla Completa para App */
.sidebar-collapsed .apps-container {
    padding: 0;
    border-radius: 0;
    background: #000; /* Fondo negro total cuando hay app */
}

.apps-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px; /* Reducido de 25px */
}

.apps-header h2 {
    font-size: 1.4rem; /* Reducido de 1.8rem */
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box {
    display: flex;
    background: rgba(236, 240, 241, 0.1);
    border-radius: 30px;
    overflow: hidden;
    width: 300px;
}

.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 20px;
    color: var(--light);
    outline: none;
}

.search-box button {
    background: var(--secondary);
    border: none;
    color: white;
    padding: 0 20px;
    cursor: pointer;
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
}

.app-card {
    background: rgba(44, 62, 80, 0.5);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
}

.app-card:hover {
    transform: translateY(-5px);
    border-color: var(--secondary);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.app-icon {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    background: rgba(52, 152, 219, 0.1);
}

.app-content {
    padding: 20px;
}

.app-content h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.app-content p {
    color: rgba(236, 240, 241, 0.7);
    font-size: 0.9rem;
    line-height: 1.5;
}

.app-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(236, 240, 241, 0.1);
}

.run-btn {
    background: var(--success);
    color: white;
    border: none;
    padding: 6px 15px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.run-btn:hover {
    background: #27ae60;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 0;
    margin-top: 40px;
    border-top: 1px solid rgba(236, 240, 241, 0.1);
    color: rgba(236, 240, 241, 0.6);
}

/* Mensaje de error */
.error-message {
    color: var(--accent);
    margin-top: 10px;
    text-align: center;
    font-size: 0.9rem;
    height: 20px;
}

/* Responsive */
@media (max-width: 992px) {
    .dashboard-content {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        display: none;
    }
    
    .apps-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 20px;
    }
    
    .user-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .admin-btn, .logout-btn {
        width: 100%;
        justify-content: center;
        margin: 5px 0;
    }
    
    .search-box {
        width: 100%;
        margin-top: 15px;
    }
    
    .apps-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .login-box {
        padding: 30px 20px;
    }
    
    .login-container {
        background-attachment: scroll;
    }
    
    /* Modal responsive */
    .modal-content {
        width: 95%;
        margin: 2% auto;
        padding: 25px 20px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-content h2 {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .admin-section {
        padding: 20px 15px;
        margin-bottom: 25px;
    }
    
    .user-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        text-align: left;
    }
    
    .user-actions {
        display: flex;
        gap: 10px;
        width: 100%;
        justify-content: flex-end;
    }
    
    .close {
        top: 15px;
        right: 15px;
        font-size: 28px;
        width: 35px;
        height: 35px;
    }
}

/* Animación shake para errores */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* Modal de Administración */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background: linear-gradient(135deg, rgba(26, 37, 48, 0.95) 0%, rgba(44, 62, 80, 0.95) 100%);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(135deg, rgba(26, 37, 48, 0.95) 0%, rgba(44, 62, 80, 0.9) 100%);
    margin: 3% auto;
    padding: 40px;
    border-radius: 20px;
    width: 85%;
    max-width: 900px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    position: relative;
    border: 1px solid rgba(52, 152, 219, 0.3);
    backdrop-filter: blur(15px);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { 
        transform: translateY(-50px);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h2 {
    color: var(--light);
    font-size: 1.8rem;
    margin-bottom: 30px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.modal-content h2 i {
    color: var(--secondary);
    font-size: 2rem;
}

.close {
    color: rgba(236, 240, 241, 0.6);
    position: absolute;
    top: 25px;
    right: 30px;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.close:hover,
.close:focus {
    color: var(--light);
    background: rgba(231, 76, 60, 0.3);
    border-color: var(--accent);
    transform: scale(1.1);
    text-decoration: none;
}

.admin-section {
    margin-bottom: 35px;
    padding: 25px;
    background: rgba(44, 62, 80, 0.3);
    border-radius: 15px;
    border: 1px solid rgba(52, 152, 219, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.admin-section h3 {
    color: var(--secondary);
    font-size: 1.3rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.admin-section h3::before {
    content: '⚙️';
    font-size: 1.2rem;
}

/* Elementos del modal - Formularios */
.admin-section .form-group {
    margin-bottom: 20px;
}

.admin-section .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--light);
    font-size: 0.95rem;
}

.admin-section input[type="text"],
.admin-section input[type="password"],
.admin-section select {
    width: 100%;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid rgba(52, 152, 219, 0.3);
    background: rgba(44, 62, 80, 0.6);
    color: var(--light);
    font-size: 1rem;
    transition: var(--transition);
    backdrop-filter: blur(5px);
}

.admin-section input[type="text"]:focus,
.admin-section input[type="password"]:focus,
.admin-section select:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
    background: rgba(44, 62, 80, 0.8);
}

/* Checkboxes personalizados */
.admin-section input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(52, 152, 219, 0.5);
    border-radius: 4px;
    background: rgba(44, 62, 80, 0.6);
    cursor: pointer;
    position: relative;
    margin-right: 10px;
    transition: var(--transition);
}

.admin-section input[type="checkbox"]:checked {
    background: var(--secondary);
    border-color: var(--secondary);
}

.admin-section input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: -2px;
    left: 2px;
    color: white;
    font-size: 14px;
    font-weight: bold;
}

/* Lista de usuarios */
.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 12px;
    margin-bottom: 15px;
    border: 1px solid rgba(52, 152, 219, 0.2);
    transition: var(--transition);
}

.user-item:hover {
    background: rgba(52, 152, 219, 0.15);
    border-color: rgba(52, 152, 219, 0.4);
    transform: translateY(-1px);
}

.user-actions button {
    padding: 8px 15px;
    margin-left: 8px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-delete {
    background: rgba(231, 76, 60, 0.8);
    color: white;
    border: 1px solid rgba(231, 76, 60, 0.5);
}

.btn-delete:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.4);
}

/* Checkboxes de aplicaciones */
.app-checkbox {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px;
    border-radius: 6px;
    background: rgba(44, 62, 80, 0.3);
    transition: var(--transition);
}

.app-checkbox:hover {
    background: rgba(44, 62, 80, 0.5);
}

.app-checkbox input {
    margin-right: 12px;
}

.app-checkbox label {
    margin: 0 !important;
    cursor: pointer;
    flex: 1;
}


/* Añadido para el contenedor del iframe */
.iframe-container {
    position: fixed;
    top: 10%;
    left: 10%;
    width: 80%;
    height: 80%;
    background: rgba(44, 62, 80, 0.7);
    border-radius: 15px;
    border: 1px solid rgba(52, 152, 219, 0.3);
    z-index: 1000;
    padding: 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overscroll-behavior: contain;
}

.iframe-container button {
    align-self: flex-end;
    margin-top: 10px;
    padding: 8px 15px;
    border-radius: 20px;
    background: var(--accent);
    color: white;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.iframe-container button:hover {
    background: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.4);
}

/* Ajuste para enlaces y botones en categorías */
.category {
    padding: 12px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--light);
    text-decoration: none;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
}

.category:hover, .category.active {
    background: var(--secondary);
    color: var(--light);
}

.category i {
    width: 24px;
    text-align: center;
}

/* Estilos para el modal de documentación */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    overflow-y: auto;
}

.modal-content {
    background: var(--dark);
    margin: 5% auto;
    padding: 20px;
    border-radius: 15px;
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    overflow-y: auto;
    color: var(--light);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.doc-content {
    margin-top: 15px;
    padding: 10px;
    background: var(--background);
    border-radius: 8px;
    line-height: 1.6;
}

.doc-content h1, .doc-content h2, .doc-content h3 {
    color: var(--accent);
}

.doc-content code {
    background: #2c3e50;
    padding: 2px 6px;
    border-radius: 4px;
}

.doc-content pre {
    background: #2c3e50;
    color: var(--light); 
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
}

.close {
    float: right;
    font-size: 24px;
    color: var(--light);
    cursor: pointer;
}

.close:hover {
    color: var(--accent);
}
/*
    pre {
        background-color: #f8f8f8;
        color: var(--light); 
        padding: 10px;
        border-radius: 5px;
        overflow-x: auto;
        font-family: monospace;
        border: 1px solid #ddd;
    }

    code.hljs {
        background: none;
        padding: 0;
    }

*/

/* Añadir al final del archivo */

/* Estilos para el loader de RDP */
.rdp-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--light);
}

.loader-spinner {
    border: 5px solid rgba(52, 152, 219, 0.3);
    border-radius: 50%;
    border-top: 5px solid var(--secondary);
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

/* Estilos para mensajes de error */
.rdp-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 20px;
    color: var(--accent);
}

.rdp-error i {
    font-size: 3rem;
    margin-bottom: 20px;
}

.rdp-error p {
    margin-bottom: 20px;
    font-size: 1.2rem;
}

/* Mejoras para el iframe */
.iframe-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark);
    z-index: 2000;
    padding: 0;
    border-radius: 0;
    border: none;
    overscroll-behavior: contain;
}

.iframe-container button {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 2001;
    padding: 10px 20px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.iframe-container button:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

/* Barra de estado de conexión */
.connection-status {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    z-index: 2001;
    display: flex;
    align-items: center;
    gap: 8px;
}

.connection-status .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}


/* Estilos para el contenedor del iframe */
.iframe-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 180px); /* Aumentado de 250px */
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    margin-top: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    overscroll-behavior: contain;
}

.iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Botón de cerrar para la cabecera del dashboard */
#btn-close-app {
    padding: 8px 20px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.9rem;
    display: none; /* Se activa por JS */
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    background: var(--accent);
    color: white;
}

#btn-close-app:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.5);
    filter: brightness(1.1);
}
