/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

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

/* App Layout */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 998;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.app-body {
    display: flex;
    flex: 1;
}

.main-content {
    flex: 1;
    padding: 2rem;
    padding-bottom: 5rem;
    transition: margin-left 0.3s ease;
    min-height: calc(100vh - 140px);
}

/* Header Components */
.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.3s;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo img {
    height: 40px;
}

.logo h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 300;
}

.header-right {
    display: flex;
    align-items: center;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    text-align: right;
}

.user-name {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-role,
.user-school {
    display: block;
    font-size: 0.75rem;
    color: #bdc3c7;
}

.user-actions {
    display: flex;
    gap: 0.5rem;
}

.progress-bar{position:fixed;top:0;left:0;width:100%;height:3px;background:transparent;display:none;z-index:9999}
.progress-bar .bar{height:100%;background:linear-gradient(90deg,#3498db,#2ecc71,#f39c12);background-size:200% 100%;animation:pbmove 1s linear infinite}
@keyframes pbmove{0%{background-position:0% 0}100%{background-position:100% 0}}

.header h1 {
    font-size: 1.8rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logout-btn {
    background: #e74c3c;
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s;
    font-weight: 600;
}

.logout-btn:hover {
    background: #c0392b;
    text-decoration: none;
}

/* Portal Selection */
.portal-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.portal-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.portal-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.portal-card.safeguarding {
    border-top: 4px solid #e74c3c;
}

.portal-card.health-safety {
    border-top: 4px solid #f39c12;
}

.portal-card h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.portal-card p {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.portal-btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: background 0.3s;
}

.portal-btn:hover {
    background: #2980b9;
}

/* Login Page */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-form h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.login-form h2 {
    text-align: center;
    color: #666;
    margin-bottom: 2rem;
    font-weight: normal;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.login-btn {
    width: 100%;
    padding: 0.8rem;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.login-btn:hover {
    background: #2980b9;
}

.error-message {
    background: #e74c3c;
    color: white;
    padding: 0.8rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    text-align: center;
}

.success-message {
    background: #27ae60;
    color: white;
    padding: 0.8rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    text-align: center;
}

/* Form Styles */
.form-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.rb-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    min-height: 100px;
    resize: vertical;
}

.form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.3s;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: #27ae60;
    color: white;
}

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

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

.btn-danger:hover {
    background: #c0392b;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-outline {
    background: transparent;
    color: #3498db;
    border: 2px solid #3498db;
}

.btn-outline:hover {
    background: #3498db;
    color: white;
    text-decoration: none;
}

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

.btn-secondary:hover {
    background: #5a6268;
    text-decoration: none;
}

/* Table Styles */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #f8f9fa;
    font-weight: bold;
    color: #2c3e50;
}

tr:hover {
    background: #f8f9fa;
}

/* Navigation */
.nav-tabs {
    display: flex;
    background: white;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 0;
}

.nav-tab {
    padding: 1rem 2rem;
    background: #f8f9fa;
    color: #666;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.nav-tab:hover,
.nav-tab.active {
    background: white;
    color: #2c3e50;
    border-bottom-color: #3498db;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .portal-selection,
    .stats-grid,
    .admin-cards,
    .grid-2,
    .rb-grid-2,
    .form-row {
        grid-template-columns: 1fr !important;
    }

    .nav-tabs {
        flex-wrap: wrap;
    }
    
    .nav-tab {
        flex: 1 1 auto;
        text-align: center;
        padding: 0.75rem 1rem;
    }

    .modal-overlay .modal {
        width: 95%;
        margin: 1rem;
        max-height: 90vh;
    }

    .header-right {
        flex-direction: column;
        gap: 1rem;
    }

    .user-menu {
        width: 100%;
        justify-content: center;
    }
}

/* Dashboard Styles */
.dashboard-container {
    max-width: 1200px;
}

.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
    font-size: 2rem;
}

.dashboard-subtitle {
    color: #666;
    font-size: 1.1rem;
    margin: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.stat-card.safeguarding {
    border-left: 4px solid #e74c3c;
}

.stat-card.hse {
    border-left: 4px solid #f39c12;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.stat-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.stat-header .icon {
    font-size: 1.5rem;
}

.stat-body {
    text-align: center;
    margin-bottom: 1rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.stat-details {
    display: flex;
    justify-content: space-around;
    font-size: 0.8rem;
    color: #888;
}

.stat-footer {
    text-align: center;
}

/* Portal Cards */
.portal-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.portal-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.portal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2980b9);
}

.portal-card.safeguarding::before {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
}

.portal-card.health-safety::before {
    background: linear-gradient(90deg, #f39c12, #e67e22);
}

.portal-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.portal-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.portal-card h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.portal-card p {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.portal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Admin Section */
.admin-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.admin-section h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

.admin-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.admin-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.admin-card h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.admin-card p {
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.action-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.action-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    text-decoration: none;
}

.action-icon {
    font-size: 2rem;
    width: 50px;
    text-align: center;
}

.action-content h3 {
    margin: 0 0 0.25rem 0;
    color: #2c3e50;
    font-size: 1rem;
}

.action-content p {
    margin: 0;
    color: #666;
    font-size: 0.85rem;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem 0;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: #3498db;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb .separator {
    color: #999;
}

/* Content Wrapper */
.content-wrapper {
    background: #f8f9fa;
    min-height: calc(100vh - 140px);
    padding: 2rem;
    margin: -2rem;
    border-radius: 8px;
}

/* Footer */
.main-footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 1rem 2rem;
    margin-top: auto;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-left,
.footer-right {
    font-size: 0.9rem;
}

.footer-left p,
.footer-right p {
    margin: 0;
    opacity: 0.9;
}

/* Status and Severity Badges */
.status-badge,
.severity-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: white;
}

/* Alerts */
.alerts-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1050;
    max-width: 400px;
}

.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.alert.show {
    opacity: 1;
    transform: translateX(0);
}

.alert-dismissible {
    position: relative;
    padding-right: 3rem;
}

.alert-close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.7;
}

.alert-close:hover {
    opacity: 1;
}

.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;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1060;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-overlay .modal {
    /* Reset overlay properties potentially inherited from generic .modal */
    position: relative;
    top: auto;
    left: auto;
    height: auto;
    z-index: auto;
    display: block;

    /* Box styles */
    background: white;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.7);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.modal-overlay.show .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Override modal size for employee modals */
#editEmployeeModal .modal-content,
#addEmployeeModal .modal-content {
    max-width: 1100px !important;
    width: 98% !important;
    min-height: 600px !important;
    max-height: 95vh !important;
    overflow-y: auto !important;
}

#editEmployeeModal,
#addEmployeeModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    overflow-y: auto;
    padding: 20px;
}

#editEmployeeModal .modal-form,
#addEmployeeModal .modal-form {
    padding: 2rem !important;
}

/* Larger edit/add modals for admin, schools, students */
#editUserModal .modal-content,
#addUserModal .modal-content,
#editModal .modal-content,
#addModal .modal-content,
#editStudentModal .modal-content,
#addStudentModal .modal-content,
#importModal .modal-content,
#resetPasswordModal .modal-content,
#addCategoryModal .modal-content,
#editCategoryModal .modal-content,
#addStatusModal .modal-content,
#editStatusModal .modal-content,
#auditDetailsModal .modal-content,
#cleanupModal .modal-content {
    max-width: 1100px !important;
    width: 98% !important;
    min-height: 600px !important;
    max-height: 95vh !important;
    overflow-y: auto !important;
}

/* Tooltip */
.tooltip {
    position: absolute;
    background: #333;
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    z-index: 1070;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.tooltip.show {
    opacity: 1;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

/* Responsive Design */
@media (max-width: 1199px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }

    .action-cards {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .nav-container {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .portal-selection {
        grid-template-columns: 1fr;
    }
    
    .admin-cards,
    .action-cards {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .user-menu {
        flex-direction: column;
        align-items: flex-end;
    }
    
    .main-header {
        padding: 1rem;
    }
    
    .header-left .logo h1 {
        display: none;
    }
}

@media (max-width: 480px) {
    .portal-actions {
        flex-direction: column;
    }
    
    .stat-details {
        flex-direction: column;
        gap: 0.25rem;
    }
}
/* Enhanced Student Search Styles */
.student-search-container {
    position: relative;
    margin-bottom: 1rem;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 2.5rem;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
    background: white;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    font-size: 1.2rem;
    color: #6c757d;
    pointer-events: none;
}

.search-loading {
    position: absolute;
    right: 0.75rem;
    display: flex;
    align-items: center;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.search-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e1e8ed;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.suggestion-item {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.suggestion-item:hover,
.suggestion-item.active {
    background: #f8f9fa;
    border-left: 3px solid #3498db;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item.no-results {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #6c757d;
    cursor: default;
    justify-content: center;
    text-align: center;
    padding: 1.5rem;
}

.suggestion-item.error {
    color: #e74c3c;
    background: #fdf2f2;
    cursor: default;
    justify-content: center;
}

.no-results-icon {
    font-size: 1.5rem;
}

.no-results-text strong {
    display: block;
    margin-bottom: 0.25rem;
}

.no-results-text p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

.student-avatar {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    background: #e9ecef;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.student-info {
    flex: 1;
}

.student-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.student-details {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #6c757d;
}

.student-id,
.year-group {
    background: #e9ecef;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-weight: 500;
}

.select-indicator {
    font-size: 1.2rem;
    color: #28a745;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.suggestion-item:hover .select-indicator,
.suggestion-item.active .select-indicator {
    opacity: 1;
}

/* Enhanced Students Table */
.selected-students {
    margin-top: 2rem;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    background: white;
    overflow: hidden;
}

.students-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e8ed;
}

.students-table-header h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.students-count {
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
}

.students-count.success {
    background: #d4edda;
    color: #155724;
}

.students-count.warning {
    background: #fff3cd;
    color: #856404;
}

.enhanced-table {
    margin: 0;
    border: none;
}

.enhanced-table th {
    background: #f8f9fa;
    color: #2c3e50;
    font-weight: 600;
    padding: 1rem;
    border-bottom: 2px solid #e1e8ed;
    font-size: 0.9rem;
}

.enhanced-table td {
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.enhanced-table tr:hover {
    background: #f8f9fa;
}

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #6c757d;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin-bottom: 0.5rem;
}

.help-note {
    font-size: 0.9rem;
    font-style: italic;
    opacity: 0.8;
}

.section-description {
    color: #6c757d;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.5;
}

/* Responsive Design for Search */
@media (max-width: 768px) {
    .search-actions {
        flex-direction: column;
    }
    
    .students-table-header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .header-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .student-details {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .enhanced-table {
        font-size: 0.9rem;
    }
    
    .enhanced-table th,
    .enhanced-table td {
        padding: 0.75rem 0.5rem;
    }
}
/* Enhanced Student Selection Styles */
.student-controls {
    display: flex;
    gap: 1.5rem;
    align-items: end;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.form-select {
    padding: 0.75rem;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 1rem;
    background: white;
    min-width: 180px;
    transition: border-color 0.3s ease;
}

.form-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Student List Container */
.student-list-container {
    margin-top: 1.5rem;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    background: white;
    max-height: 400px;
    overflow-y: auto;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e1e8ed;
    background: #f8f9fa;
}

.list-header h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.list-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6c757d;
    font-size: 0.9rem;
}

.list-loading .spinner {
    width: 16px;
    height: 16px;
}

/* Student List */
.student-list {
    padding: 0;
}

.student-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.2s ease;
}

.student-item:hover {
    background-color: #f8f9fa;
}

.student-item:last-child {
    border-bottom: none;
}

.student-info {
    flex: 1;
}

.student-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.student-details {
    font-size: 0.85rem;
    color: #6c757d;
}

.student-grade {
    background: #e9ecef;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

.add-student-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    border-radius: 6px;
    white-space: nowrap;
    min-width: 80px;
}

.add-student-btn:disabled {
    background: #28a745;
    border-color: #28a745;
    color: white;
}

/* Empty State */
.empty-student-list {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.empty-student-list .empty-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .student-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-group {
        width: 100%;
    }
    
    .form-select {
        min-width: auto;
    }
    
    .student-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .add-student-btn {
        width: 100%;
    }
}

/* Loading Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.list-loading .spinner {
    animation: spin 1s linear infinite;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
}/* Student Management Page Styles */
.admin-page {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e1e8ed;
}

.header-content h1 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
    font-size: 2rem;
}

.header-content p {
    margin: 0;
    color: #6c757d;
    font-size: 1.1rem;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e8ed;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 50%;
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Filters Section */
.filters-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e8ed;
}

.filters-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.form-select,
.form-input {
    padding: 0.75rem;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-select:focus,
.form-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
}

/* Table Section */
.table-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e8ed;
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e1e8ed;
    background: #f8f9fa;
}

.table-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.2rem;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

.table-responsive {
    overflow-x: auto;
}

.enhanced-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.enhanced-table th {
    background: #f8f9fa;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #e1e8ed;
    white-space: nowrap;
}

.enhanced-table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f3f4;
    vertical-align: middle;
}

.enhanced-table tbody tr:hover {
    background: #f8f9fa;
}

/* Student Info */
.student-info {
    display: flex;
    flex-direction: column;
}

.student-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

/* Reference Number */
.reference-number {
    background: #f5f5f5;
    color: #333;
    padding: 0.35rem 0.6rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Courier New', Courier, monospace;
    border: 1px solid #ddd;
    display: inline-block;
    letter-spacing: 0.5px;
}

/* Badges */
.grade-badge {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

/* Pagination */
.pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-top: 1px solid #e1e8ed;
    background: #f8f9fa;
}

.pagination-info {
    color: #6c757d;
    font-size: 0.9rem;
}

.pagination {
    display: flex;
    gap: 0.25rem;
}

.page-link {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    color: #3498db;
    text-decoration: none;
    transition: all 0.2s ease;
}

.page-link:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.page-link.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    /* Ensure scrolling and spacing if display is overridden to block */
    overflow-y: auto;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    /* Centering and margins */
    margin: 2rem auto;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e1e8ed;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
}

.modal-close:hover {
    color: #333;
}

.modal-form {
    padding: 1.5rem;
}

/* Override modal size for employee modals */
#editEmployeeModal .modal-content,
#addEmployeeModal .modal-content {
    max-width: 1100px !important;
    width: 98% !important;
    min-height: 600px !important;
    max-height: 95vh !important;
    overflow-y: auto !important;
}

#editEmployeeModal,
#addEmployeeModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    overflow-y: auto;
    padding: 20px;
}

#editEmployeeModal .modal-form,
#addEmployeeModal .modal-form {
    padding: 2rem !important;
}

/* Tooltip */
.tooltip {
    position: absolute;
    background: #333;
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    z-index: 1070;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.tooltip.show {
    opacity: 1;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

/* Responsive Design */
@media (max-width: 1199px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }

    .action-cards {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .nav-container {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .portal-selection {
        grid-template-columns: 1fr;
    }
    
    .admin-cards,
    .action-cards {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .user-menu {
        flex-direction: column;
        align-items: flex-end;
    }
    
    .main-header {
        padding: 1rem;
    }
    
    .header-left .logo h1 {
        display: none;
    }
}

@media (max-width: 480px) {
    .portal-actions {
        flex-direction: column;
    }
    
    .stat-details {
        flex-direction: column;
        gap: 0.25rem;
    }
}
/* Enhanced Student Search Styles */
.student-search-container {
    position: relative;
    margin-bottom: 1rem;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 2.5rem;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
    background: white;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    font-size: 1.2rem;
    color: #6c757d;
    pointer-events: none;
}

.search-loading {
    position: absolute;
    right: 0.75rem;
    display: flex;
    align-items: center;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.search-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e1e8ed;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.suggestion-item {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.suggestion-item:hover,
.suggestion-item.active {
    background: #f8f9fa;
    border-left: 3px solid #3498db;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item.no-results {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #6c757d;
    cursor: default;
    justify-content: center;
    text-align: center;
    padding: 1.5rem;
}

.suggestion-item.error {
    color: #e74c3c;
    background: #fdf2f2;
    cursor: default;
    justify-content: center;
}

.no-results-icon {
    font-size: 1.5rem;
}

.no-results-text strong {
    display: block;
    margin-bottom: 0.25rem;
}

.no-results-text p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

.student-avatar {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    background: #e9ecef;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.student-info {
    flex: 1;
}

.student-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.student-details {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #6c757d;
}

.student-id,
.year-group {
    background: #e9ecef;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-weight: 500;
}

.select-indicator {
    font-size: 1.2rem;
    color: #28a745;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.suggestion-item:hover .select-indicator,
.suggestion-item.active .select-indicator {
    opacity: 1;
}

/* Enhanced Students Table */
.selected-students {
    margin-top: 2rem;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    background: white;
    overflow: hidden;
}

.students-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e8ed;
}

.students-table-header h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.students-count {
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
}

.students-count.success {
    background: #d4edda;
    color: #155724;
}

.students-count.warning {
    background: #fff3cd;
    color: #856404;
}

.enhanced-table {
    margin: 0;
    border: none;
}

.enhanced-table th {
    background: #f8f9fa;
    color: #2c3e50;
    font-weight: 600;
    padding: 1rem;
    border-bottom: 2px solid #e1e8ed;
    font-size: 0.9rem;
}

.enhanced-table td {
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.enhanced-table tr:hover {
    background: #f8f9fa;
}

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #6c757d;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin-bottom: 0.5rem;
}

.help-note {
    font-size: 0.9rem;
    font-style: italic;
    opacity: 0.8;
}

.section-description {
    color: #6c757d;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.5;
}

/* Responsive Design for Search */
@media (max-width: 768px) {
    .search-actions {
        flex-direction: column;
    }
    
    .students-table-header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .header-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .student-details {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .enhanced-table {
        font-size: 0.9rem;
    }
    
    .enhanced-table th,
    .enhanced-table td {
        padding: 0.75rem 0.5rem;
    }
}/*
 Enhanced Student Selection Styles */
.student-controls {
    display: flex;
    gap: 1.5rem;
    align-items: end;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.form-select {
    padding: 0.75rem;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 1rem;
    background: white;
    min-width: 180px;
    transition: border-color 0.3s ease;
}

.form-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Student List Container */
.student-list-container {
    margin-top: 1.5rem;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    background: white;
    max-height: 400px;
    overflow-y: auto;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e1e8ed;
    background: #f8f9fa;
}

.list-header h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.list-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6c757d;
    font-size: 0.9rem;
}

.list-loading .spinner {
    width: 16px;
    height: 16px;
}

/* Student List */
.student-list {
    padding: 0;
}

.student-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.2s ease;
}

.student-item:hover {
    background-color: #f8f9fa;
}

.student-item:last-child {
    border-bottom: none;
}

.student-info {
    flex: 1;
}

.student-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.student-details {
    font-size: 0.85rem;
    color: #6c757d;
}

.student-grade {
    background: #e9ecef;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

.add-student-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    border-radius: 6px;
    white-space: nowrap;
    min-width: 80px;
}

.add-student-btn:disabled {
    background: #28a745;
    border-color: #28a745;
    color: white;
}

/* Empty State */
.empty-student-list {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.empty-student-list .empty-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .student-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-group {
        width: 100%;
    }
    
    .form-select {
        min-width: auto;
    }
    
    .student-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .add-student-btn {
        width: 100%;
    }
}

/* Loading Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.list-loading .spinner {
    animation: spin 1s linear infinite;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
}/* Student Management Page Styles */
.admin-page {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e1e8ed;
}

.header-content h1 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
    font-size: 2rem;
}

.header-content p {
    margin: 0;
    color: #6c757d;
    font-size: 1.1rem;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e8ed;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 50%;
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Filters Section */
.filters-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e8ed;
}

.filters-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.form-select,
.form-input {
    padding: 0.75rem;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-select:focus,
.form-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
}

/* Table Section */
.table-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e8ed;
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e1e8ed;
    background: #f8f9fa;
}

.table-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.2rem;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

.table-responsive {
    overflow-x: auto;
}

.enhanced-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.enhanced-table th,
.enhanced-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e1e8ed;
}

.enhanced-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.enhanced-table tbody tr:hover {
    background: #f8f9fa;
}

/* Student Info */
.student-info {
    display: flex;
    flex-direction: column;
}

.student-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

/* Reference Number */
.reference-number {
    background: #f5f5f5;
    color: #333;
    padding: 0.35rem 0.6rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Courier New', Courier, monospace;
    border: 1px solid #ddd;
    display: inline-block;
    letter-spacing: 0.5px;
}

/* Badges */
.grade-badge {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: #27ae60;
    color: white;
}

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

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

.btn-danger:hover {
    background: #c0392b;
}

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

.btn-secondary:hover {
    background: #5a6268;
}

.btn-outline {
    background: transparent;
    color: #3498db;
    border: 2px solid #3498db;
}

.btn-outline:hover {
    background: #3498db;
    color: white;
}

/* Alert Styles */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.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;
}/* User Management Specific Styles */
.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.user-email {
    font-size: 0.85rem;
    color: #6c757d;
}

/* Role Badges */
.role-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.role-badge.role-super_admin {
    background: #e8f5e8;
    color: #2e7d32;
}

.role-badge.role-school_admin {
    background: #e3f2fd;
    color: #1976d2;
}

.role-badge.role-school_manager {
    background: #fff3e0;
    color: #f57c00;
}

.role-badge.role-normal_user {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* Permission Badges */
.permissions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.permission-badge {
    background: #e1f5fe;
    color: #0277bd;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Last Login Styles */
.last-login {
    color: #2c3e50;
    font-size: 0.85rem;
}

.never-logged {
    color: #6c757d;
    font-style: italic;
    font-size: 0.85rem;
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: normal;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.checkbox-label:hover {
    background: #f8f9fa;
}

.checkbox-label input[type="checkbox"] {
    margin: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Button Variants */
.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #e67e22;
    transform: translateY(-1px);
}

/* Enhanced Action Buttons for Users */
.action-buttons .btn-sm {
    min-width: 70px;
    justify-content: center;
}

/* Responsive adjustments for user table */
@media (max-width: 768px) {
    .permissions {
        flex-direction: column;
    }
    
    .permission-badge {
        text-align: center;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .checkbox-group {
        gap: 0.5rem;
    }
}

/* Status indicators */
.status-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

/* Form enhancements */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Modal content spacing */
.modal-form .form-group:last-of-type {
    margin-bottom: 1rem;
}

/* Help text styling */
.help-text {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 0.25rem;
    font-style: italic;
}

/* Employee Management Specific Styles */
.employee-info {
    display: flex;
    flex-direction: column;
}

.employee-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

/* Department Badges */
.department-badge {
    background: #f0f8ff;
    color: #1e3a8a;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Contact Information */
.contact-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.contact-info .email {
    font-size: 0.85rem;
    color: #2c3e50;
}

.contact-info .phone {
    font-size: 0.85rem;
    color: #6c757d;
}

.no-contact {
    font-size: 0.85rem;
    color: #6c757d;
    font-style: italic;
}

/* Employee Table Responsive */
@media (max-width: 768px) {
    .contact-info {
        font-size: 0.8rem;
    }
    
    .department-badge {
        font-size: 0.75rem;
        padding: 0.2rem 0.5rem;
    }
}

/* Form styling for employee forms */
.modal-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .modal-form .form-row {
        grid-template-columns: 1fr;
    }
}

/* Enhanced input styling */
input[type="tel"] {
    padding: 0.75rem;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

input[type="tel"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Status badge variations for employees */
.status-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

/* Simple Navigation Bar */
.navbar {
    background: #2c3e50;
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.nav-brand {
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: #bdc3c7;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: white;
    background: #34495e;
}

/* Admin Dashboard Responsive Styles */
.admin-dashboard {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.dashboard-header {
    text-align: center;
    margin-bottom: 3rem;
}

.dashboard-header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.dashboard-header p {
    font-size: 1.2rem;
    color: #6c757d;
}

/* Statistics Grid - Fully Responsive */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e8ed;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
}

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

/* Dashboard Specific Styles */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.assignment-list {
    margin: 0;
    padding-left: 1rem;
}

.user-tracking-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.tracking-card-small {
    flex: 1;
    min-width: 240px;
}

.tracking-card-large {
    flex: 2;
    min-width: 320px;
}

.status-breakdown-body {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* General Grid Fallback */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .dashboard-grid,
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    /* Fix Portal Selection Overflow */
    .portal-selection {
        grid-template-columns: 1fr !important;
    }
    
    .portal-card {
        padding: 1.5rem;
    }

    .tracking-card-small,
    .tracking-card-large {
        flex: 1 1 100%; /* Full width on small screens */
        min-width: 0; /* Reset min-width to avoid overflow */
    }
    
    .detail-card {
        padding: 1.25rem; /* Reduce padding on small screens */
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }
    
    .stat-card .stat-header h3 {
        font-size: 1.1rem;
    }
    
    .status-breakdown-body {
        justify-content: center;
    }
}

/* Responsive Forms */
@media (max-width: 768px) {
    .form-row,
    .form-row.two-columns,
    .form-row.three-columns {
        grid-template-columns: 1fr;
    }
}
