/* Premium Design System */
:root {
    --primary-color: #21409a;
    --primary-light: #3b56a9;
    --secondary-color: #64748b;
    --accent-color: #cc0000;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --light-color: #f8fafc;
    --dark-color: #1e293b;
    --sidebar-width: 280px;
    --glass: rgba(255, 255, 255, 0.8);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: #f1f5f9;
    margin: 0;
    color: var(--dark-color);
    line-height: 1.6;
}

/* Layout */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Modernized */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: white;
    position: fixed;
    height: 100%;
    transition: var(--transition);
    z-index: 1000;
    box-shadow: 4px 0 15px rgba(0,0,0,0.1);
}

.sidebar-header {
    padding: 30px 20px;
    text-align: center;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin: 0;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.sidebar-menu li a {
    padding: 14px 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #94a3b8;
    border-left: 4px solid transparent;
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-menu li a:hover {
    background: rgba(255,255,255,0.05);
    color: white;
}

.sidebar-menu li a.active {
    background: rgba(33, 64, 154, 0.15);
    color: white;
    border-left-color: var(--primary-color);
}

.sidebar-menu li a i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 30px;
    transition: var(--transition);
}

.topbar {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    border-radius: 16px;
    margin-bottom: 35px;
    border: 1px solid rgba(255,255,255,0.3);
}

.page-title h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark-color);
}

/* Premium Cards */
.card {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid #e2e8f0;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: #1e293b;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 15px;
}

/* Modern Buttons */
.btn {
    padding: 10px 22px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    font-size: 0.9rem;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(33, 64, 154, 0.2);
}

.btn-primary:hover {
    background: var(--primary-light);
    box-shadow: 0 6px 16px rgba(33, 64, 154, 0.3);
}

.btn-success {
    background: var(--success-color);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
    }
    .sidebar-header h2, .sidebar-menu li a span {
        display: none;
    }
    .main-content {
        margin-left: 80px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .main-content {
        margin-left: 0;
        padding: 15px;
    }
    .sidebar.open {
        transform: translateX(0);
        width: 280px;
    }
    .sidebar.open .sidebar-header h2, .sidebar.open .sidebar-menu li a span {
        display: inline;
    }
}

/* Course Cards Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

.course-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.course-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.course-card-img-container {
    height: 180px;
    position: relative;
    background: linear-gradient(135deg, #21409a 0%, #1e293b 100%);
}

.course-card-img-overlay {
    position: absolute;
    bottom: -20px;
    right: -20px;
    width: 120px;
    height: 120px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    backdrop-filter: blur(5px);
}

.course-card-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.course-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 10px;
    line-height: 1.4;
}

/* Status Badges */
.status-badge {
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.entregado { background: #dcfce7; color: #166534; }
.status-badge.observado { background: #fee2e2; color: #991b1b; }
.status-badge.omiso { background: #f1f5f9; color: #475569; }
.status-badge.pendiente { background: #eff6ff; color: #1e40af; }

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Professional Table Styles */
#studentsTable, .table-professional {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 20px;
}

#studentsTable thead th, .table-professional thead th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 16px 20px;
    border-bottom: 2px solid #e2e8f0;
    text-align: left;
}

#studentsTable tbody tr, .table-professional tbody tr {
    transition: var(--transition);
}

#studentsTable tbody tr:hover, .table-professional tbody tr:hover {
    background: #f1f5f9;
}

#studentsTable tbody td, .table-professional tbody td {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    color: #1e293b;
    font-size: 0.9rem;
    vertical-align: middle;
}

#studentsTable tbody tr:last-child td, .table-professional tbody tr:last-child td {
    border-bottom: none;
}

/* Photo Styling */
.table-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #e2e8f0;
}

/* Search Bar Enhancement */
#tableSearch {
    transition: var(--transition);
}

#tableSearch:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(33, 64, 154, 0.1);
}

/* Modal and Form Styles */
#studentForm {
    background: #f8fafc;
    border: 1px solid #e2e8f0 !important;
    box-shadow: var(--shadow-sm);
    animation: fadeIn 0.3s ease-out;
}

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

#studentForm h4 {
    margin-top: 0;
    color: var(--dark-color);
    font-weight: 700;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* Button Variants in Table */
.btn-warning {
    background: #fef3c7;
    color: #92400e;
}

.btn-warning:hover {
    background: #fde68a;
}

.btn-danger-soft {
    background: #fee2e2;
    color: #991b1b;
}

.btn-danger-soft:hover {
    background: #fecaca;
}

.btn-info {
    background: #e0f2fe;
    color: #075985;
}

.btn-info:hover {
    background: #bae6fd;
}

.btn-success {
    background: #dcfce7;
    color: #166534;
}

.btn-success:hover {
    background: #bbf7d0;
}