
.school-management {
    padding-top: 100px;
    min-height: 100vh;
    background: var(--bg-gradient);
}


.dashboard-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    transition: var(--transition);
    backdrop-filter: blur(20px);
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.dashboard-card h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dashboard-card h3 i {
    color: var(--primary-500);
    font-size: 1.5rem;
}


.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-item {
    background: var(--bg-card);
    border-radius: var(--border-radius-md);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.stat-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    font-size: 2.5rem;
    color: var(--primary-500);
    margin-bottom: 1rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}


.role-principal .stat-icon { color: #ff6b6b; }
.role-teacher .stat-icon { color: #4ecdc4; }
.role-student .stat-icon { color: #45b7d1; }


.school-table {
    background: var(--bg-card);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.school-table .table {
    margin: 0;
    color: var(--text-primary);
}

.school-table .table th {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-medium);
    font-weight: 600;
    padding: 1rem;
}

.school-table .table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.school-table .table tbody tr:hover {
    background: var(--bg-secondary);
}


.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-action {
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-edit {
    background: var(--primary-500);
    color: white;
}

.btn-edit:hover {
    background: var(--primary-600);
    color: white;
    transform: translateY(-2px);
}

.btn-delete {
    background: #dc3545;
    color: white;
}

.btn-delete:hover {
    background: #c82333;
    color: white;
    transform: translateY(-2px);
}

.btn-activate {
    background: #28a745;
    color: white;
}

.btn-activate:hover {
    background: #218838;
    color: white;
    transform: translateY(-2px);
}

.btn-deactivate {
    background: #ffc107;
    color: #212529;
}

.btn-deactivate:hover {
    background: #e0a800;
    color: #212529;
    transform: translateY(-2px);
}


.school-form {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    margin-bottom: 2rem;
}

.form-section {
    margin-bottom: 2rem;
}

.form-section h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-light);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}

.form-control, .form-select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    border-radius: var(--border-radius-sm);
    padding: 0.75rem;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    background: var(--bg-card);
    border-color: var(--primary-500);
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25);
    color: var(--text-primary);
}

.form-control::placeholder {
    color: var(--text-muted);
}


.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-active {
    background: #28a745;
    color: white;
}

.status-inactive {
    background: #6c757d;
    color: white;
}

.status-pending {
    background: #ffc107;
    color: #212529;
}


.recent-activity {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-md);
    padding: 1rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item:hover {
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-100);
    color: var(--primary-600);
}

.activity-content h6 {
    margin: 0;
    color: var(--text-primary);
    font-weight: 600;
}

.activity-time {
    color: var(--text-muted);
    font-size: 0.8rem;
}


.exam-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-md);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.exam-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.exam-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.exam-title {
    color: var(--text-primary);
    font-weight: 600;
    margin: 0;
}

.exam-status {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
}

.exam-status.active {
    background: #28a745;
    color: white;
}

.exam-status.inactive {
    background: #6c757d;
    color: white;
}

.exam-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.exam-detail {
    text-align: center;
}

.exam-detail-label {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.exam-detail-value {
    color: var(--text-primary);
    font-weight: 600;
}


.grade-display {
    background: var(--bg-card);
    border-radius: var(--border-radius-md);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.grade-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.grade-subject {
    color: var(--text-primary);
    font-weight: 600;
    margin: 0;
}

.grade-score {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-500);
}

.grade-percentage {
    color: var(--text-secondary);
    font-size: 0.9rem;
}


@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn-action {
        text-align: center;
    }
    
    .exam-details {
        grid-template-columns: 1fr;
    }
    
    .school-form {
        padding: 1rem;
    }
}


[data-theme="dark"] .school-table .table th {
    background: var(--bg-tertiary);
    border-bottom-color: var(--border-medium);
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background: var(--bg-tertiary);
    border-color: var(--border-medium);
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    background: var(--bg-secondary);
}


.dashboard-card,
.stat-item,
.exam-card,
.grade-display {
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-500);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


@media print {
    .school-management {
        background: white;
        padding: 0;
    }
    
    .dashboard-card,
    .stat-item,
    .exam-card,
    .grade-display {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }
    
    .action-buttons {
        display: none;
    }
}
