* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
}

.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-container h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
}

/* Roles de usuario */
.role-firmador {
    background: #dc3545;
    color: white;
}

.role-profesor {
    background: #17a2b8;
    color: white;
}

.role-normal {
    background: #28a745;
    color: white;
}

.user-role {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
    margin-top: 2px;
}

.view-scope {
    font-size: 11px;
    color: #666;
    margin-top: 2px;
    display: block;
}

.badge-lectura {
    background: #f8f9fa;
    color: #666;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    border: 1px solid #ddd;
    display: inline-block;
}

.btn-firmar-todos {
    background: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 8px 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    margin-left: auto;
    transition: all 0.3s;
}

.btn-firmar-todos:hover {
    background: #218838;
    transform: scale(1.02);
}

.btn-firmar-todos.btn-disabled {
    background: #6c757d;
    cursor: default;
    opacity: 0.7;
}

.btn-firmar-todos.btn-disabled:hover {
    background: #6c757d;
    transform: none;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.form-group textarea {
    height: 100px;
    resize: vertical;
}

.btn-login, .btn-primary {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-login:hover, .btn-primary:hover {
    background: #5a67d8;
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 10px;
    border-radius: 5px;
    margin-top: 20px;
    text-align: center;
}

/* Estilos de la pagina principal */
.dashboard {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-bar {
    background: white;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar h1 {
    color: #333;
    font-size: 24px;
}

.user-info {
    display: flex;
    gap: 15px;
    align-items: center;
}

.btn-primary {
    width: auto;
    padding: 10px 20px;
}

.btn-logout {
    padding: 8px 16px;
    background: #dc3545;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: #c82333;
}

.table-container {
    flex: 1;
    padding: 20px;
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background: #667eea;
    color: white;
    font-weight: 500;
}

tr:hover {
    background: #f5f5f5;
}

th, td {
    padding: 12px 8px;
}

/* Ajustar anchos de columna */
th:nth-child(1) { width: 90px; }  /* Fecha */
th:nth-child(2) { width: 80px; }  /* Hora */
th:nth-child(3) { width: auto; }  /* Descripción (flexible) */
th:nth-child(4) { width: 100px; } /* Horario */
th:nth-child(5) { width: 100px; } /* Firma */
th:nth-child(6) { width: 120px; } /* Firmado por */
th:nth-child(7) { width: 120px; } /* Registrado por - NUEVA */
th:nth-child(8) { width: 150px; } /* Acciones */

/* Estilo para el texto de registrado por */
td:nth-child(7) {
    font-size: 13px;
    color: #555;
}

/* Si quieres destacar el nombre del creador con un icono */
td:nth-child(7)::before {
    content: "👤 ";
    font-size: 12px;
    opacity: 0.7;
}

/* Botón gestionar usuarios */
.btn-gestion-usuarios {
    background: #70e504;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-gestion-usuarios:hover {
    background: #6cd708;
    transform: scale(1.02);
}

/* Botón cambiar contraseña */
.btn-cambiar-password {
    background: #ffc107;
    color: #333;
    border: none;
    border-radius: 5px;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-cambiar-password:hover {
    background: #e0a800;
    transform: scale(1.02);
}

/* Grupo de botones */
.botones-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Estilos comunes para botones */
.botones-group button, .botones-group .btn-logout {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

/* Botón cambiar contraseña */
.btn-cambiar-password {
    background: #ffc107;
    color: #333;
    border: none;
}

.btn-cambiar-password:hover {
    background: #e0a800;
    transform: scale(1.05);
}

/* Botón añadir registro */
.btn-primary {
    background: #667eea;
    color: white;
    border: none;
}

.btn-primary:hover {
    background: #5a67d8;
    transform: scale(1.05);
}

/* Botón logout */
.btn-logout {
    background: #dc3545;
    color: white;
    border: none;
}

.btn-logout:hover {
    background: #c82333;
    transform: scale(1.05);
}

/* Menú desplegable */
.dropdown {
    position: relative;
    display: inline-block;
}

/* Botón del menú desplegable redondo */
.btn-dropdown {
    background: #28f104;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.btn-dropdown:hover {
    background: #02b217;
    transform: scale(1.05);
}

/* Contenido del menú desplegable */
.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 45px;
    background-color: white;
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    border-radius: 8px;
    z-index: 1000;
    overflow: hidden;
}

.dropdown-content.show {
    display: block;
}

.dropdown-content button {
    width: 100%;
    padding: 12px 16px;
    text-align: left;
    border: none;
    background: white;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.dropdown-content button:hover {
    background-color: #f1f1f1;
}

/* Logo en esquina superior izquierda - Sin recuadro */
.logo-top-left {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 100;
}

.login-logo-small {
    width: auto;
    height: 60px;
    object-fit: contain;
    /* Eliminar bordes, sombras y fondos */
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
}



/* Ajuste responsive para móviles */
@media screen and (max-width: 768px) {
    th:nth-child(1), td:nth-child(1) { width: 70px; }  /* Fecha más pequeña */
    th:nth-child(2), td:nth-child(2) { width: 60px; }  /* Hora más pequeña */
    th:nth-child(4), td:nth-child(4) { width: 80px; }  /* Horario más pequeño */
    th:nth-child(5), td:nth-child(5) { width: 80px; }  /* Firma más pequeña */
    th:nth-child(6), td:nth-child(6) { width: 100px; } /* Firmado por */
    th:nth-child(7), td:nth-child(7) { width: 100px; } /* Registrado por */
    th:nth-child(8), td:nth-child(8) { width: 120px; } /* Acciones */
    
    td:nth-child(7)::before {
        content: "";
    }
}
/* ===== FIN DE LOS NUEVOS ESTILOS ===== */

.firma-miniatura {
    max-width: 50px;
    max-height: 30px;
    cursor: pointer;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.sin-firma {
    color: #999;
    font-style: italic;
}

.firma-miniatura {
    max-width: 50px;
    max-height: 30px;
    cursor: pointer;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.sin-firma {
    color: #999;
    font-style: italic;
}

/* Estilo de las filas */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    overflow: auto;
}

.modal-content {
    background: white;
    margin: 50px auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    position: relative;
}

.firma-modal {
    max-width: 800px;
    text-align: center;
}

.firma-modal img {
    max-width: 100%;
    max-height: 500px;
}

.close {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close:hover {
    color: #333;
}

#canvas-firma {
    border: 2px solid #ddd;
    border-radius: 5px;
    background: white;
    cursor: crosshair;
    width: 100%;
    height: auto;
}

.firma-controles {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

.btn-secondary {
    padding: 8px 16px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #5a6268;
}
Estilos para botón eliminar */
.btn-eliminar {
    padding: 5px 10px !important;
    background: #dc3545 !important;
    color: white !important;
    border: none !important;
    border-radius: 3px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    transition: background 0.3s !important;
    margin: 0 2px !important;
}

.btn-eliminar:hover {
    background: #c82333 !important;  /* Rojo más oscuro al pasar el ratón */
}

/* Estilos para mensaje de éxito */
.success-message {
    background: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}

/* Botones de confirmación */
.confirmar-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
}

.confirmar-buttons button {
    padding: 10px 20px;
    min-width: 100px;
}

/* Ajustes para la tabla */
th:last-child, td:last-child {
    text-align: center;
    width: 100px;
}
.btn-firmar {
    padding: 5px 10px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s;
    margin-right: 5px;
}

.btn-firmar:hover {
    background: #218838;
}

/* Badge de firmado */
.firmado-badge {
    display: inline-block;
    background: #28a745;
    color: white;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 3px;
    margin-left: 5px;
}

/* Ajustes para la tabla */
th:last-child, td:last-child {
    min-width: 150px;
    text-align: center;
}

td .btn-firmar,
td .btn-eliminar {
    margin: 2px;
    display: inline-block;
}

/* Stats bar */
.stats-bar {
    background: white;
    padding: 10px 20px;
    margin: 0 20px 10px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stat-item {
    font-size: 14px;
    color: #555;
    padding: 5px 10px;
    background: #f8f9fa;
    border-radius: 20px;
}
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.main-content.with-sidebar {
    height: calc(100vh - 80px);
}

/* Sidebar */
.users-sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
    padding: 20px 0;
}

.users-sidebar h3 {
    padding: 0 20px;
    margin-bottom: 15px;
    color: #333;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.user-list {
    display: flex;
    flex-direction: column;
}

.user-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    text-decoration: none;
    color: #333;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.user-item:hover {
    background: #f5f5f5;
    border-left-color: #667eea;
}

.user-item.active {
    background: #e8f0fe;
    border-left-color: #667eea;
    font-weight: 500;
}

.user-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border-radius: 50%;
    margin-right: 12px;
    font-size: 14px;
}

.user-item.active .user-icon {
    background: #667eea;
    color: white;
}

.user-name-sidebar {
    flex: 1;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-count {
    background: #e0e0e0;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    color: #666;
    margin-left: 8px;
}

.user-item.active .user-count {
    background: #667eea;
    color: white;
}

/* Barra de búsqueda de usuarios */
.user-search {
    padding: 0 10px;
    margin-bottom: 10px;
}

.user-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
}

.user-search input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.user-search input::placeholder {
    color: #999;
}

/* Área de contenido */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Filtro info */
.filter-info {
    margin-bottom: 15px;
}

.filter-badge {
    display: inline-block;
    background: #e8f0fe;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    color: #333;
    border: 1px solid #667eea;
}

.clear-filter {
    margin-left: 10px;
    color: #667eea;
    text-decoration: none;
    font-weight: bold;
}

.clear-filter:hover {
    text-decoration: underline;
}

.stats {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.stat-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: #f8f9fa;
    border-radius: 30px;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.stat-link:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.stat-link.active {
    background: #667eea;
    color: white;
    border-color: #5a67d8;
}

.stat-link.active .stat-number {
    background: rgba(255,255,255,0.2);
    color: white;
}

.stat-icon {
    font-size: 18px;
}

.stat-label {
    font-size: 14px;
    font-weight: 500;
}

.stat-number {
    background: rgba(0,0,0,0.05);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
}

/* Información de filtros */
.filters-info {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-badge {
    display: inline-flex;
    align-items: center;
    background: #e8f0fe;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    color: #333;
    border: 1px solid #667eea;
    gap: 8px;
}

.filter-label {
    color: #666;
    font-size: 12px;
}

.remove-filter {
    color: #667eea;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    padding: 0 5px;
}

.remove-filter:hover {
    color: #dc3545;
}

.clear-all-filters {
    color: #667eea;
    text-decoration: none;
    font-size: 13px;
    padding: 5px 12px;
    border: 1px dashed #667eea;
    border-radius: 20px;
}

.clear-all-filters:hover {
    background: #667eea;
    color: white;
}

/* Estilos para filas según estado */
.fila-pendiente {
    background-color: #fff3cd;
}

.fila-pendiente:hover {
    background-color: #ffe69c !important;
}

.fila-firmada {
    background-color: #d4edda;
}

.fila-firmada:hover {
    background-color: #c3e6cb !important;
}

.pendiente-text {
    color: #856404;
    font-style: italic;
}

/* Ajustes para celdas */
.firma-cell {
    text-align: center;
    vertical-align: middle;
}

.acciones-cell {
    text-align: center;
    white-space: nowrap;
}

.firma-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    color: #666;
}

.tab-btn:hover {
    background: #f0f0f0;
}

.tab-btn.active {
    background: #667eea;
    color: white;
}

.firma-opcion {
    display: none;
}

.firma-opcion.active {
    display: block;
}

/* Estilos para la vista previa de imagen */
#preview-container {
    text-align: center;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 5px;
}

#preview-imagen {
    max-width: 100%;
    max-height: 150px;
    object-fit: contain;
}

.firma-miniatura {
    max-width: 80px;
    max-height: 40px;
    object-fit: contain;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 2px;
    background: white;
    cursor: pointer;
    transition: transform 0.2s;
}

.firma-miniatura:hover {
    transform: scale(1.5);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 10;
}

.firma-cell {
    text-align: center;
    vertical-align: middle;
    min-width: 100px;
}

.firmado-badge {
    display: inline-block;
    background: #28a745;
    color: white;
    font-size: 11px;
    padding: 2px 5px;
    border-radius: 10px;
    margin-left: 5px;
}

.sin-firma {
    color: #999;
    font-style: italic;
    font-size: 12px;
}

.firma-miniatura {
    max-width: 100px;
    max-height: 50px;
    width: auto;
    height: auto;
    object-fit: contain;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    background: white;
}

.firma-miniatura:hover {
    opacity: 0.9;
}

/* Modal de firma con scroll */
.firma-modal {
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
}

.firma-modal img {
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

.btn-modificar {
    padding: 5px 10px !important;
    background: #6cb2eb !important;  /* Azul claro */
    color: white !important;
    border: none !important;
    border-radius: 3px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    transition: background 0.3s !important;
    margin: 0 2px !important;
}

.btn-modificar:hover {
    background: #4a9fd8 !important;  /* Azul más oscuro al pasar el ratón */
}
.btn-small {
    padding: 5px 8px;
    font-size: 14px;
}

/* Anotaciones */
.anotaciones-cell {
    max-width: 200px;
    word-wrap: break-word;
    font-size: 12px;
}

.anotacion-texto {
    cursor: help;
    color: #555;
    line-height: 1.4;
}

.sin-anotacion {
    color: #ccc;
    font-style: italic;
}

/* Botón registrar usuario */
.btn-registro-usuario {
    background: #a5b817;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-registro-usuario:hover {
    background: #8b9613;
    transform: scale(1.02);
}

.btn-evaluar {
    background: #28a745;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 2px 8px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.3s;
}

.btn-evaluar:hover {
    background: #218838;
    transform: scale(1.02);
}

.btn-ver-evaluaciones {
    background: #17a2b8;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.3s;
}

.btn-ver-evaluaciones:hover {
    background: #138496;
    transform: scale(1.02);
}

/* Botón gestión de alumnos */
.btn-gestion-alumnos {
    background: #6f42c1;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.btn-gestion-alumnos:hover {
    background: #5a32a3;
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.btn-gestion-alumnos:active {
    transform: scale(0.98);
}

/* Ajustes responsive */
@media screen and (max-width: 768px) {
    .main-content.with-sidebar {
        flex-direction: column;
    }
    
    .users-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        padding: 10px 0;
        max-height: 150px;
    }
    
    .user-list {
        flex-direction: row;
        overflow-x: auto;
        padding: 0 10px;
    }
    
    .user-item {
        flex-direction: column;
        padding: 10px;
        min-width: 80px;
        border-left: none;
        border-bottom: 3px solid transparent;
    }
    
    .user-item:hover {
        border-left-color: transparent;
        border-bottom-color: #667eea;
    }
    
    .user-item.active {
        border-left-color: transparent;
        border-bottom-color: #667eea;
    }
    
    .user-icon {
        margin-right: 0;
        margin-bottom: 5px;
    }
    
    .user-name-sidebar {
        font-size: 12px;
        text-align: center;
    }
    
    .user-count {
        margin-left: 0;
        margin-top: 5px;
    }

    .stats {
        justify-content: center;
    }
    
    .stat-link {
        flex: 1;
        justify-content: center;
    }
    
    .filters-info {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-badge {
        justify-content: space-between;
    }
}

/* Botones pequeños para acciones */
.btn-small {
    padding: 5px 8px;
    font-size: 14px;
    margin: 0 2px;
}