/* Dashboard Styles - Modern & Responsive */

/* Modal form styles */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.75rem 0;
    padding: 0.5rem 0;
    width: auto !important;
}

.form-check-input[type="checkbox"] {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    max-width: 16px !important;
    margin: 0 !important;
    padding: 0 !important;
    cursor: pointer;
    flex-shrink: 0;
    flex-grow: 0 !important;
    flex-basis: auto !important;
    accent-color: var(--color-primary, #2c5aa0);
    display: inline-block !important;
    box-sizing: border-box !important;
    -webkit-appearance: checkbox !important;
    -moz-appearance: checkbox !important;
    appearance: checkbox !important;
}

.form-check-label {
    margin: 0 !important;
    cursor: pointer;
    font-weight: 500;
    color: #333;
    font-size: 14px;
    line-height: 1.4;
}
.user-info {
    margin-bottom: 2rem;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    animation: fadeInUp 0.6s ease-out;
}

/* Role-based Dashboard Styles */
.role-dashboard {
    animation: fadeInUp 0.6s ease-out;
    margin: 1rem auto;
    color: #333;
    max-width: 1200px;
    padding: 0 1rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.dashboard-section {
    margin-bottom: 2rem;
    padding: 2rem 0;
    margin-top: 80px;
}

.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    border: 1px solid #e1e8ed;
    min-height: 180px;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.2rem;
    border-bottom: none;
    flex-shrink: 0;
}

.card-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-content {
    padding: 1.2rem;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-content p {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.5;
    font-size: 0.9rem;
}

.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(116, 185, 255, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, #fdcb6e 0%, #e17055 100%);
    color: white;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(253, 203, 110, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #00b894 0%, #00a085 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 184, 148, 0.3);
}

.btn-info {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    color: white;
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(116, 185, 255, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #e17055 0%, #d63031 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(225, 112, 85, 0.3);
}

/* Navigation External Links */
#campusVirtualLink a, #managementLink a {
    color: #667eea !important;
    font-weight: 600;
    transition: all 0.3s ease;
}

#campusVirtualLink a:hover, #managementLink a:hover {
    color: #764ba2 !important;
    transform: translateY(-1px);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

/* Hide page scroll when any modal is open */
html.modal-open,
html.modal-open body {
    overflow: hidden !important;
    height: 100% !important;
}

/* Fullscreen Modal - force full viewport coverage */
.fullscreen-modal {
    overflow: hidden !important;
    background-color: white !important;
}

.fullscreen-modal > .fullscreen-content {
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 1rem !important;
    border-radius: 0 !important;
    border: none !important;
    overflow: hidden;
    box-sizing: border-box;
    background-color: white;
    animation: none !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Browser fullscreen mode */
.fullscreen-modal:fullscreen {
    background-color: white;
    padding: 0;
}
.fullscreen-modal:fullscreen > .fullscreen-content {
    width: 100% !important;
    height: 100% !important;
}

.windowed-content {
    width: 80vw !important;
    height: 70vh !important;
    max-width: 1200px !important;
    margin: 10vh auto !important;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
    position: relative;
}

/* ========== FULLSCREEN MODAL - UNIVERSAL FLEX LAYOUT ========== */
/* All direct children of fullscreen-content: don't shrink by default */
.fullscreen-content > * {
    flex-shrink: 0;
}

/* The scrollable table/content area fills remaining space */
.fullscreen-content > .table-responsive,
.fullscreen-content > .users-list,
.fullscreen-content > .modal-body-fullscreen,
.fullscreen-content > .modal-body,
.fullscreen-content > .tab-content {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

/* Solicitudes: modal-body-fullscreen is a flex column layout container (NOT scroll) */
.modal-body-fullscreen {
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
}

.modal-body-fullscreen > * {
    flex-shrink: 0;
}

.modal-body-fullscreen > #allRequestsContent,
.modal-body-fullscreen > #mensajesEnviadosContent {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

/* Nested table-responsive inside scroll containers: disable its own scroll */
.fullscreen-content .modal-body .table-responsive,
.fullscreen-content .modal-body-fullscreen .table-responsive,
.fullscreen-content .users-list .table-responsive,
.fullscreen-content .tab-content .table-responsive {
    overflow: visible !important;
}

/* Ensure tables inside fullscreen modals don't collapse */
.fullscreen-content table {
    min-width: 100%;
}

/* Table headers don't wrap - forces minimum column widths */
.fullscreen-content table th {
    white-space: nowrap;
}

/* Config/Normativas tables need explicit min-width since they use % columns */
.fullscreen-content > .modal-body table {
    min-width: 800px;
}

/* Modal Header Controls */
.modal-header-controls {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 1001;
}

.window-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.window-controls button {
    padding: 0.25rem 0.5rem;
    border: none;
    border-radius: 4px;
    background: #f8f9fa;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
}

.window-controls button:hover {
    background: #e9ecef;
    transform: none;
    box-shadow: none;
}


.large-modal {
    max-width: 900px;
    width: 95%;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #e74c3c;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e1e8ed;
}

/* Table Styles */
.table-container {
    margin-top: 2rem;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    border: none;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid #e1e8ed;
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-validated {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Button Sizes */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* Search Section */
.search-section {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: center;
}

.search-section input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
}

.search-section input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Role Management */
.role-actions {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e1e8ed;
}

.role-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    margin: 0.25rem;
    font-size: 0.9rem;
    position: relative;
}

.btn-remove {
    background: none;
    border: none;
    color: white;
    margin-left: 0.5rem;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.2rem;
}

.btn-remove:hover {
    color: #ff6b6b;
}

/* Role Assignment */
#userRolesSection {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e1e8ed;
}

#userRolesSection h4 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

#currentRoles, #availableRoles {
    margin-bottom: 2rem;
    min-height: 60px;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

#availableRoles label {
    display: block;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#availableRoles label:hover {
    background-color: #e3f2fd;
}

.role-checkbox {
    margin-right: 0.5rem;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Users List */
.users-list {
    margin-top: 1rem;
}

/* Users table - roles column wrap */
#userManagementModal .users-list table td:nth-child(7) {
    max-width: 180px;
    white-space: normal;
    word-wrap: break-word;
    font-size: 0.8rem;
}

.windowed-content .users-list {
    height: calc(70vh - 200px);
}

/* Role Assignment Styles */
.roles-container {
    min-height: 120px;
    max-height: 200px;
    overflow-y: auto;
    padding: 15px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background-color: #f8f9fa;
}

#rolesCheckboxList {
    max-height: none !important;
    overflow: visible !important;
}

.assigned-roles {
    background: #e8f5e8;
    border-color: #28a745;
}

.role-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background: white;
    border-radius: 5px;
    border: 1px solid #dee2e6;
    cursor: pointer;
    transition: all 0.2s ease;
}

.role-item:hover {
    background: #e3f2fd;
    border-color: #2196f3;
}

.role-item.assigned {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.role-item.assigned:hover {
    background: #c3e6cb;
}

.role-item .role-name {
    font-weight: 500;
}

.role-item .role-action {
    font-size: 0.8rem;
    opacity: 0.7;
}

.role-item.assigned .role-action::before {
    content: "Clic para quitar";
}

.role-item:not(.assigned) .role-action::before {
    content: "Clic para asignar";
}

.roles-list {
    max-height: 400px;
    overflow-y: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .card {
        min-height: 160px;
    }
    
    .card-header {
        padding: 1rem;
    }
    
    .card-header h3 {
        font-size: 1rem;
    }
    
    .card-content {
        padding: 1rem;
    }
    
    .modal-content {
        margin: 2% auto;
        width: 95%;
        padding: 1.5rem;
    }
    
    .search-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .table {
        min-width: 600px;
    }
}

@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 0.8rem;
    }
    
    .role-dashboard {
        max-width: 100%;
        padding: 0 0.5rem;
    }
}

@media (min-width: 1400px) {
    .dashboard-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 1.2rem;
    }
    
    .role-dashboard {
        max-width: 1300px;
    }
}

.user-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.user-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.user-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(30px, -30px);
}

.session-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-left: 5px solid rgba(255, 255, 255, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.session-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.15);
}

.session-card h3 {
    margin: 0 0 1rem 0;
    color: white;
    font-size: 1.1rem;
}

.session-card h3 i {
    color: white;
}

.session-card .text-success {
    color: #00ff88 !important;
    font-weight: bold;
    text-shadow: 0 0 3px rgba(0, 255, 136, 0.5);
}

.session-card strong {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
}

.session-card p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .user-info {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .user-card, .session-card {
        padding: 1.5rem;
        border-radius: 15px;
    }
    
    .user-card h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .user-card {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
        border-radius: 12px;
    }
    
    .user-avatar {
        font-size: 3rem;
    }
    
    .user-card h2 {
        font-size: 1.3rem;
    }
    
    .user-stats {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .session-card {
        padding: 1rem;
        border-radius: 12px;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.user-card h2 {
    margin: 0 0 1rem 0;
    font-size: 1.8rem;
    font-weight: 600;
}

/* User Card Enhanced Styles */
.user-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-avatar {
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.9);
    flex-shrink: 0;
}

.user-details {
    flex: 1;
}

.user-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    margin-top: 1rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.95;
}

.stat-item i {
    width: 16px;
    text-align: center;
}

.stat-item strong {
    font-weight: 600;
}

/* Session Card Enhanced */
.card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.card-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.role-checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.role-checkbox-item.last-role label::after {
    content: " (último rol - obligatorio)";
    font-size: 0.8rem;
    color: var(--color-warning);
    font-weight: 500;
}

.loading-spinner {
    text-align: center;
    padding: 1rem;
    color: var(--color-gray-500);
}

.loading-spinner i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: block;
}

.session-content {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.dashboard-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 4px solid var(--primary-color);
}

.dashboard-card h3 {
    margin: 0 0 1rem 0;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dashboard-card .icon {
    font-size: 1.2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-top: 3px solid var(--primary-color);
}

.stat-card .number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    display: block;
}

.stat-card .label {
    color: #666;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: none !important;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%) !important;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.table-container {
    background: white;
    border-radius: 8px;
    overflow-x: auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    width: 100%;
    max-width: none;
}

.table {
    width: 100%;
    min-width: 1200px;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table th:nth-child(1), .table td:nth-child(1) { width: 10%; }  /* DNI */
.table th:nth-child(2), .table td:nth-child(2) { width: 15%; }  /* Nombre */
.table th:nth-child(3), .table td:nth-child(3) { width: 15%; }  /* Apellidos */
.table th:nth-child(4), .table td:nth-child(4) { width: 22%; }  /* Email */
.table th:nth-child(5), .table td:nth-child(5) { width: 12%; }  /* Teléfono */
.table th:nth-child(6), .table td:nth-child(6) { width: 10%; }  /* Roles */
.table th:nth-child(7), .table td:nth-child(7) { width: 8%; }   /* Estado */
.table th:nth-child(8), .table td:nth-child(8) { width: 18%; }  /* Acciones */

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-validated {
    background: #d4edda;
    color: #155724;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-rejected {
    background: #f8d7da;
    color: #721c24;
}

.status-active {
    background: #d1ecf1;
    color: #0c5460;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #000;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #666;
    font-size: 0.8rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.search-box {
    margin-bottom: 1rem;
}

.search-box input {
    width: 100%;
    max-width: 400px;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.filters select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.loading {
    text-align: center;
    padding: 2rem;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .modal-content {
        margin: 2% auto;
        width: 95%;
    }
}

/* Estilos especiales para tarjeta destacada de Aula Virtual */
.card-highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    position: relative;
    overflow: hidden;
}

.card-highlight::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-20%, -20%); }
}

.card-highlight .card-header {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.card-highlight .card-header h3 {
    color: white;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.card-highlight .card-content {
    color: white;
    position: relative;
    z-index: 1;
}

.card-highlight .card-content p {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
}

.card-highlight .btn {
    background: white;
    color: #667eea;
    font-weight: 600;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.card-highlight .btn:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    color: #764ba2;
}

.card-highlight:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 50px rgba(102, 126, 234, 0.4);
}

/* Sync to SIGEM Confirmation Modal Styles */
.sync-fields-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sync-field-item {
    background: #f8f9fa;
    border-left: 4px solid #ffc107;
    padding: 12px 16px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.sync-field-item:hover {
    background: #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sync-field-name {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sync-field-name i {
    color: #ffc107;
    font-size: 0.85rem;
}

.sync-field-value {
    color: #212529;
    font-size: 0.95rem;
    margin: 0;
    padding-left: 24px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.sync-field-value.empty {
    color: #6c757d;
    font-style: italic;
}

#syncToSigemConfirmModal .modal-header {
    border-bottom: 2px solid #f0ad4e;
}

#syncToSigemConfirmModal .modal-footer {
    border-top: 1px solid #dee2e6;
    padding: 15px;
}

/* Tabla de Convocatorias - Estilos específicos */
#convocatoriasTable {
    min-width: auto !important;
    width: 100%;
}

#convocatoriasTable th,
#convocatoriasTable td {
    white-space: nowrap;
}

#convocatoriasTable .col-nombre,
#convocatoriasTable td:nth-child(2) {
    white-space: normal;
    word-wrap: break-word;
    max-width: 400px;
}

/* ========== MODAL CONVOCATORIAS - RESPONSIVE ALTURA ========== */

/* Layout flex para el modal de convocatorias */
#convocatoriasModal .fullscreen-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#convocatoriasModal .fullscreen-content > h3 {
    flex-shrink: 0;
    margin-bottom: 0.5rem;
}

#convocatoriasModal .convocatorias-toolbar {
    flex-shrink: 0;
    margin-bottom: 0.5rem !important;
}

#convocatoriasModal .table-responsive {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

#convocatoriasModal .d-flex.justify-content-between.mt-3 {
    flex-shrink: 0;
    margin-top: 0.5rem !important;
}

/* Pantallas con poca altura (< 800px) */
@media (max-height: 800px) {
    #convocatoriasModal .fullscreen-content {
        height: 100vh !important;
        margin: 0 !important;
        padding: 0.75rem !important;
    }
    
    #convocatoriasModal .fullscreen-content > h3 {
        font-size: 1.25rem;
        margin-bottom: 0.25rem;
    }
    
    #convocatoriasModal .convocatorias-toolbar {
        margin-bottom: 0.25rem !important;
    }
    
    #convocatoriasModal .convocatorias-toolbar .row {
        margin-bottom: 0.25rem !important;
    }
    
    #convocatoriasModal .convocatorias-toolbar .form-control,
    #convocatoriasModal .convocatorias-toolbar .form-select,
    #convocatoriasModal .convocatorias-toolbar .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.85rem;
    }
    
    /* Sincronización más compacta */
    #convocatoriasModal .sync-section {
        padding: 0.5rem;
        background: #f8f9fa;
        border-radius: 4px;
        margin-bottom: 0.25rem;
    }
    
    #convocatoriasModal .sync-section .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
    
    #convocatoriasModal .sync-info small {
        font-size: 0.75rem;
    }
    
    /* Tabla más compacta */
    #convocatoriasModal #convocatoriasTable th,
    #convocatoriasModal #convocatoriasTable td {
        padding: 0.35rem 0.5rem;
        font-size: 0.8rem;
    }
    
    #convocatoriasModal #convocatoriasTable .btn-sm {
        padding: 0.15rem 0.35rem;
        font-size: 0.75rem;
    }
    
    /* Paginación compacta */
    #convocatoriasModal .pagination-info {
        font-size: 0.8rem;
    }
    
    #convocatoriasModal .pagination .page-link {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
}

/* Pantallas muy pequeñas en altura (< 650px) */
@media (max-height: 650px) {
    #convocatoriasModal .fullscreen-content {
        height: 100vh !important;
        margin: 0 !important;
        padding: 0.5rem !important;
    }
    
    #convocatoriasModal .fullscreen-content > h3 {
        font-size: 1.1rem;
        margin-bottom: 0.15rem;
    }
    
    /* Toolbar inline en una sola fila */
    #convocatoriasModal .convocatorias-toolbar .row.mb-3 {
        flex-wrap: nowrap;
        gap: 0.25rem;
    }
    
    #convocatoriasModal .convocatorias-toolbar .col-md-4,
    #convocatoriasModal .convocatorias-toolbar .col-md-2 {
        flex: 0 0 auto;
        width: auto;
        padding: 0 0.15rem;
    }
    
    #convocatoriasModal .convocatorias-toolbar .form-control,
    #convocatoriasModal .convocatorias-toolbar .form-select {
        width: auto;
        min-width: 100px;
    }
    
    #convocatoriasModal #searchConvocatorias {
        min-width: 180px;
    }
    
    /* Ocultar textos de botones, solo iconos */
    #convocatoriasModal .sync-section .btn .me-2,
    #convocatoriasModal .sync-section .btn .me-1 {
        margin-right: 0 !important;
    }
    
    /* Sincronización colapsada por defecto */
    #convocatoriasModal .sync-section {
        padding: 0.25rem 0.5rem;
    }
    
    #convocatoriasModal .sync-section .row {
        flex-wrap: nowrap;
        align-items: center;
    }
    
    #convocatoriasModal .sync-log {
        max-height: 100px;
    }
    
    #convocatoriasModal .sync-log-content {
        height: 80px !important;
    }
    
    /* Tabla aún más compacta */
    #convocatoriasModal #convocatoriasTable th,
    #convocatoriasModal #convocatoriasTable td {
        padding: 0.25rem 0.35rem;
        font-size: 0.75rem;
    }
    
    #convocatoriasModal #convocatoriasTable .btn-sm {
        padding: 0.1rem 0.25rem;
        font-size: 0.7rem;
    }
    
    #convocatoriasModal #convocatoriasTable .btn-sm i {
        font-size: 0.7rem;
    }
}
