* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    line-height: 1.6;
    color: #333;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

.app-header {
    text-align: center;
    margin-bottom: 30px;
    color: #667eea;
}

.app-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.app-header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.main-content {
    display: grid;
    gap: 35px;
}

section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

section:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

section h2 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

section h2 i {
    color: #667eea;
}

.profile-form {
    display: grid;
    gap: 25px;
}

fieldset {
    border: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group label {
    font-weight: 600;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group label i {
    color: #667eea;
}

.form-group input,
.form-group select {
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: #ffffff;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.error-message {
    color: #e53e3e;
    font-size: 0.9rem;
    margin-top: 5px;
    display: none;
}

.error-message.show {
    display: block;
}

.form-group input.error,
.form-group select.error {
    border-color: #e53e3e;
    background-color: #fed7d7;
}

.form-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s ease;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #718096;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #4a5568;
}

.btn-danger {
    background: #e53e3e;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #c53030;
}

.btn-complete {
    background: #48bb78;
    color: white;
}

.btn-complete:hover:not(:disabled) {
    background: #38a169;
}

.btn-edit {
    background: #4299e1;
    color: white;
}

.btn-edit:hover:not(:disabled) {
    background: #3182ce;
}

.btn-delete {
    background: #e53e3e;
    color: white;
}

.btn-delete:hover:not(:disabled) {
    background: #c53030;
}

.filter-controls {
    display: grid;
    grid-template-columns: 2fr 1.2fr 1fr auto auto;
    gap: 20px;
    align-items: end;
}

.search-group {
    position: relative;
}

.search-group input {
    padding: 14px 40px 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    width: 100%;
    font-size: 1rem;
    background: #ffffff;
}

.search-group i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
}

.filter-group select {
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    width: 100%;
    font-size: 1rem;
    background: #ffffff;
}

.filter-group button {
    width: 100%;
    min-width: fit-content;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    padding: 25px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 18px;
    border: 1px solid #e2e8f0;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-card i {
    font-size: 2rem;
    color: #667eea;
}

.stat-card h3 {
    font-size: 1.8rem;
    color: #2d3748;
    margin-bottom: 5px;
}

.stat-card p {
    color: #718096;
    font-size: 0.9rem;
}

.students-container {
    display: grid;
    gap: 20px;
}

.no-students {
    text-align: center;
    padding: 50px 30px;
    color: #a0aec0;
    font-size: 1rem;
}

.no-students i {
    font-size: 3.5rem;
    margin-bottom: 20px;
    display: block;
    opacity: 0.6;
}

.no-students p {
    font-size: 1.1rem;
}

.student-card {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    padding: 25px;
    position: relative;
    transition: all 0.3s ease;
}

.student-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.student-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

.student-info {
    flex: 1;
}

.student-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 5px;
}

.student-id {
    color: #667eea;
    font-weight: 500;
    margin-bottom: 5px;
}

.student-email {
    color: #718096;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 5px;
}

.student-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.detail-item {
    background: white;
    padding: 12px 15px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.detail-label {
    font-size: 0.8rem;
    color: #718096;
    margin-bottom: 3px;
}

.detail-value {
    font-weight: 600;
    color: #2d3748;
}

.gpa-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.gpa-excellent {
    background: #c6f6d5;
    color: #22543d;
}

.gpa-good {
    background: #bee3f8;
    color: #2a4365;
}

.gpa-average {
    background: #feebc8;
    color: #744210;
}

.gpa-poor {
    background: #fed7d7;
    color: #742a2a;
}

.student-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 5px;
}

.student-actions button {
    padding: 10px 16px;
    font-size: 0.9rem;
    min-width: auto;
    font-weight: 500;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 35px;
    border-radius: 18px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    animation: slideIn 0.3s ease;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.modal-content h3 {
    color: #2d3748;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.modal-content h3 i {
    color: #f56500;
}

.modal-content p {
    color: #718096;
    margin-bottom: 30px;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 18px;
    justify-content: center;
}

.csv-format-info {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    text-align: left;
}

.csv-format-info h4 {
    color: #2d3748;
    margin-bottom: 12px;
    font-size: 1.1rem;
    font-weight: 600;
}

.csv-format-info p {
    margin-bottom: 10px;
    color: #4a5568;
    font-size: 0.9rem;
}

.csv-format-info code {
    background: #edf2f7;
    padding: 10px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    display: block;
    margin-top: 8px;
    word-break: break-all;
}

#importPreview {
    margin: 20px 0;
}

#previewTable {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.preview-table th,
.preview-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.preview-table th {
    background: #f7fafc;
    font-weight: 600;
    color: #2d3748;
    position: sticky;
    top: 0;
}

.preview-table td {
    color: #4a5568;
}

.import-stats {
    background: #e6fffa;
    border: 1px solid #81e6d9;
    border-radius: 8px;
    padding: 12px;
    margin: 10px 0;
    color: #234e52;
}

.import-error {
    background: #fed7d7;
    border: 1px solid #fc8181;
    border-radius: 8px;
    padding: 12px;
    margin: 10px 0;
    color: #742a2a;
}

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

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

@media (max-width: 992px) {
    .filter-controls {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    fieldset {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }
    
    .app-header h1 {
        font-size: 1.8rem;
    }
    
    section {
        padding: 20px;
        border-radius: 12px;
    }
    
    .filter-controls {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }
    
    .stat-card {
        padding: 18px 15px;
    }
    
    .stat-card i {
        font-size: 1.5rem;
    }
    
    .stat-card h3 {
        font-size: 1.4rem;
    }
    
    .student-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .student-actions {
        justify-content: flex-start;
    }
    
    .form-actions {
        justify-content: stretch;
    }
    
    .form-actions button {
        flex: 1;
    }
    
    section {
        padding: 20px;
    }
    
    .student-details {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .student-actions {
        flex-direction: column;
    }
    
    .student-actions button {
        width: 100%;
    }
    
    .app-header h1 {
        font-size: 1.8rem;
    }
    
    section {
        padding: 15px;
    }
}