/* Ocultar input nativo del navegador sin romper el envío de datos */
input[type="file"].custom-file-input {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    opacity: 0 !important;
    position: absolute !important;
    pointer-events: none !important;
}
/* Contenedor Punteado */
.file-upload-box {
    border: 2px dashed #333333;
    border-radius: 8px;
    padding: 20px;
    background-color: #121212;
    transition: border-color 0.3s ease, background-color 0.3s ease;
    margin-bottom: 20px;
    cursor: pointer;
}

.file-upload-box:hover {
    border-color: #38b000;
}

.file-upload-label {
    cursor: pointer;
    display: block;
    width: 100%;
}

.file-upload-label strong {
    display: block;
    color: #ffffff;
    font-size: 1rem;
    margin-bottom: 4px;
}

.file-help-text {
    color: #aaaaaa;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

/* Contenedor simulado del input */
.file-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: #1a1a1a;
    padding: 8px 12px;
    border: 1px solid #333333;
    border-radius: 6px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden; /* <--- AGREGAR ESTA LÍNEA */
}

span.btn-select-file {
    background-color: #efefef !important;
    color: #000000 !important;
    border: 1px solid #767676;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-block;
    user-select: none;
    white-space: nowrap;
    flex-shrink: 0;
}

span.btn-select-file:hover {
    background-color: #e5e5e5 !important;
}

.file-name-text {
    color: #cccccc;
    font-size: 0.9rem;
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Botón 'X' para eliminar selección */
.btn-remove-file {
    background: transparent !important;
    border: none !important;
    color: #ff4d4d !important;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 2px 8px !important;
    border-radius: 4px;
    line-height: 1;
    flex-shrink: 0;
    transition: background-color 0.2s, color 0.2s;
}

.btn-remove-file:hover {
    background-color: rgba(255, 77, 77, 0.2) !important;
    color: #ff1a1a !important;
}

/* Estilos para las Pestañas de Roles */
.tabs-container .tab-btn {
    background: #1a1a1a;
    color: #a0a0a0;
    border: 1px solid #333;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tabs-container .tab-btn:hover {
    background: #2a2a2a;
    color: #ffffff;
}

.tabs-container .tab-btn.active {
    background: #00aa4f;
    color: #ffffff;
    border-color: #00aa4f;
}
/* ==========================================================================
   1. BASES Y NAVEGACIÓN
   ========================================================================== */

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #121212 !important;
    color: #e0e0e0;
    line-height: 1.6;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #000000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.8);
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.logo img {
    height: 45px;
    width: auto;
    object-fit: contain;
}

/* Botón Hamburguesa */
.hamburger {
    display: none;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

.hamburger:hover {
    color: #38b000;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 15px;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-links a {
    color: #ffffff;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
}

.nav-links a:hover {
    color: #38b000;
}

/* Botones en header */
.user-actions-box {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-user, .btn-user-panel {
    background-color: #38b000;
    color: white !important;
    padding: 7px 15px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    cursor: pointer;
}

.btn-logout-nav {
    background-color: #d90429;
    color: white !important;
    padding: 7px 15px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Mensaje de error interno en modales */
.error-msg {
    background-color: rgba(217, 4, 41, 0.15);
    border: 1px solid #d90429;
    color: #ff4d6d;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.88rem;
    margin-bottom: 15px;
    text-align: center;
    font-weight: 500;
}

/* ==========================================================================
   2. CONTENEDORES PRINCIPALES (PANELES Y LANDING)
   ========================================================================== */
.main-container, .panel-container { 
    max-width: 1100px; 
    margin: 100px auto 40px auto !important;
    padding: 20px;
    background-color: #121212;
}

section {
    padding: 120px 20px 80px 20px;
    min-height: 80vh;
    text-align: center;
}

section:nth-child(even) {
    background-color: #181818;
}

section h1, section h2 {
    color: #ffffff;
    font-size: 2rem;
}

h1, h2, h3, .section-title {
    color: #ffffff;
    margin-top: 15px;
    margin-bottom: 15px;
}

.section-title {
    border-bottom: 2px solid #38b000;
    padding-bottom: 5px;
    text-transform: uppercase;
    font-size: 1.2rem;
}

/* ==========================================================================
   3. TARJETAS DE PERFIL / INFORMACIÓN DE USUARIOS
   ========================================================================== */
.user-card, .profile-card {
    background-color: #1e1e1e;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.perfil-card {
    background-color: #000000 !important;
    border: 1px solid #1a1a1a;
    border-radius: 20px;
    padding: 25px 35px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.perfil-avatar {
    width: 95px;
    height: 95px;
    background-color: #38b000 !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 2.5rem;
    flex-shrink: 0;
}

.perfil-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.perfil-info .info-nombre {
    color: #ffffff;
    font-size: 1.3rem;
    font-weight: 500;
    margin-bottom: 6px;
}

.perfil-info .info-item {
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 300;
}

.perfil-promedio {
    color: #38b000;
    font-size: 1.25rem;
    font-weight: 500;
    text-align: right;
    white-space: nowrap;
}

.action-bar-pdf {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 30px;
}

.action-bar-pdf .btn-pdf {
    background-color: #38b000 !important;
    color: #ffffff !important;
    padding: 10px 28px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.action-bar-pdf .btn-pdf:hover {
    background-color: #2d8a00 !important;
}

/* ==========================================================================
   4. FORMULARIOS, CAMPOS Y BOTONES
   ========================================================================== */
input, 
select, 
textarea, 
.input-dark, 
.select-dark, 
.select-custom {
    width: 100%;
    box-sizing: border-box;
    background-color: #1a1a1a !important;
    border: 1px solid #333333;
    color: #ffffff !important;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.95rem;
    margin-bottom: 12px;
    display: block;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, 
select:focus, 
textarea:focus {
    border-color: #38b000 !important;
    box-shadow: 0 0 5px rgba(56, 176, 0, 0.4);
}

input[type="number"].input-num {
    width: 60px;
    text-align: center;
    margin: 0 auto;
    padding: 5px;
    background-color: #252525 !important;
}

select option {
    background-color: #1a1a1a;
    color: #ffffff;
}

button, 
.btn-green, 
.btn-pdf, 
.btn-add, 
.btn-submit {
    background-color: #38b000;
    color: #ffffff !important;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.2s, transform 0.1s;
}

button:hover, 
.btn-green:hover, 
.btn-submit:hover {
    background-color: #2d8a00;
}

button:active {
    transform: scale(0.98);
}

/* ==========================================================================
   5. TABLAS RESPONSIVAS CON DESPLAZAMIENTO FLUIDO
   ========================================================================== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 25px;
    border-radius: 12px;
    border: 1px solid #2a2a2a;
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: #1e1e1e;
    min-width: 650px; /* Asegura un ancho mínimo para evitar aplastamientos */
}

th {
    background-color: #181818;
    color: #38b000;
    font-weight: 600;
    text-align: left;
    padding: 14px 18px;
    border-bottom: 1px solid #2a2a2a;
    white-space: nowrap;
}

td {
    padding: 14px 18px;
    border-bottom: 1px solid #252525;
    color: #dddddd;
    white-space: nowrap;
}

tr:hover td {
    background-color: #242424;
}

td button, td .btn-edit, td .btn-delete {
    padding: 5px 10px;
    font-size: 0.8rem;
    border-radius: 6px;
    margin-right: 4px;
}

/* ==========================================================================
   6. VENTANAS EMERGENTES (MODALES)
   ========================================================================== */
.modal, 
.modal-crud {
    display: none; 
    position: fixed; 
    z-index: 2000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    background-color: rgba(0, 0, 0, 0.75); 
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
}

.modal-content, 
.modal-crud-content {
    background-color: #1e1e1e !important;
    border: 1px solid #333333;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 460px;
    color: #ffffff;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
    position: relative;
    box-sizing: border-box;
}

.modal-content label, 
.modal-crud-content label,
.form-group label {
    display: block;
    color: #cccccc;
    font-size: 0.88rem;
    margin-bottom: 5px;
    text-align: left;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #888888;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
}

.close-btn:hover {
    color: #ffffff;
}

/* ==========================================================================
   7. MEDIA QUERIES (DESPLIEGUE DESLIZANTE DE MENÚ HAMBURGUESA)
   ========================================================================== */
@media screen and (max-width: 1120px) {
    .hamburger {
        display: block;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #000000;
        padding: 20px 0;
        box-shadow: 0 10px 15px rgba(0, 0, 0, 0.9);
        border-top: 1px solid #222222;
        gap: 18px;
    }

    .nav-links.active {
        display: flex;
    }

    .user-actions-box {
        flex-direction: column;
        width: 80%;
        margin: 0 auto;
    }

    .btn-user, .btn-user-panel, .btn-logout-nav {
        width: 100%;
        justify-content: center;
    }

    .main-container, .panel-container {
        margin-top: 90px !important;
        padding: 15px;
    }

    .perfil-card {
        flex-direction: column;
        text-align: left; /* Alinea los datos a la izquierda en pantallas pequeñas */
        align-items: center; /* Mantiene la tarjeta y el avatar centrados */
        padding: 25px 20px;
        gap: 20px;
    }

    .perfil-info {
        width: 100%;
        text-align: left; /* Asegura que el texto no se centre ni se encime */
    }

    .perfil-info .info-item {
        margin-bottom: 6px; /* Da espacio vertical entre cada dato */
        word-break: break-word; /* Evita desbordamiento si el texto es muy largo */
    }

    .perfil-promedio {
        width: 100%;
        text-align: center; /* Mantiene el promedio centrado al final de la tarjeta */
        border-top: 1px solid #222; /* Divisor opcional para separar visualmente */
        padding-top: 15px;
        margin-top: 5px;
    }

    .action-bar-pdf {
        justify-content: center;
    }
}

@media screen and (max-width: 480px) {
    nav {
        padding: 0.8rem 1rem;
    }

    .modal-content, .modal-crud-content {
        width: 95%;
        padding: 20px 15px;
    }
}