@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');
/* Student Attendance Management System - White & Blue Design */

:root {
    --sidebar-width: clamp(280px, 20vw, 300px);
    --content-max-width: 1600px;
    --page-gutter: clamp(24px, 4vw, 40px);
    --card-radius: clamp(12px, 1.5vw, 16px);
    --shadow-soft: 0 8px 32px rgba(0, 123, 255, 0.1);
    --text-dark: #1f2a37;
    --text-muted: #64748b;
    --spacing-xs: clamp(6px, 0.5vw, 8px);
    --spacing-sm: clamp(10px, 1vw, 12px);
    --spacing-md: clamp(16px, 2vw, 20px);
    --spacing-lg: clamp(24px, 3vw, 32px);
    --spacing-xl: clamp(40px, 5vw, 48px);
}

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

html {
    font-size: 16px;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    width: 100%;
}

body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: var(--text-dark);
    line-height: 1.6;
    font-size: 16px;
    overflow-x: hidden;
    width: 100%;
}

img, svg, video, canvas, iframe, embed, object {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: min(100%, var(--content-max-width));
    margin-inline: auto;
    padding-inline: var(--page-gutter);
    padding-block: 28px;
}

/* Header Styles */
.header {
    background: white;
    padding: 28px;
    border-radius: var(--card-radius);
    box-shadow: 0 8px 32px rgba(0, 123, 255, 0.1);
    text-align: center;
    margin-bottom: 28px;
    border: 1px solid #e3f2fd;
    width: 100%;
}

.header h1 {
    color: #1976d2;
    font-size: 2.2rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.header p {
    color: #666;
    font-size: 1.05rem;
    margin: 0;
}

/* Alert Messages */
.alert {
    padding: 15px 20px;
    border-radius: var(--card-radius);
    margin-bottom: var(--spacing-md);
    font-weight: 500;
    border-left: 4px solid;
    width: 100%;
    font-size: 1rem;
}

.alert-success {
    background-color: #e8f5e8;
    color: #2e7d32;
    border-left-color: #4caf50;
}

.alert-error {
    background-color: #ffebee;
    color: #c62828;
    border-left-color: #f44336;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: clamp(16px, 3vw, 24px);
    margin-bottom: var(--spacing-lg);
    width: 100%;
}

/* Form Section */
.form-section {
    background: white;
    padding: 24px;
    border-radius: var(--card-radius);
    box-shadow: 0 2px 10px rgba(0, 123, 255, 0.06);
    border: 1px solid #e3f2fd;
    height: fit-content;
    width: 100%;
}

.form-section h2 {
    color: #1976d2;
    margin-bottom: var(--spacing-sm);
    font-size: 1.4rem;
    font-weight: 600;
}

.attendance-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    gap: var(--spacing-md);
    align-items: start;
    margin-bottom: var(--spacing-md);
}

.form-row-3 {
    grid-template-columns: 2fr 2fr 1fr;
}

@media (max-width: 600px) {
    .form-row-3 {
        grid-template-columns: 1fr 1fr;
    }
    .form-row-3 .form-group:last-child {
        grid-column: span 2;
    }
}

.register-form .form-row {
    margin-bottom: 0;
}

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

.form-group label {
    color: #1976d2;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    font-size: 1rem;
}

.form-group input,
.form-group select {
    padding: 13px 16px;
    border: 1px solid #e3f2fd;
    border-radius: var(--card-radius);
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    width: 100%;
}

.form-group select option {
    display: block !important;
    padding: 8px 12px;
    background: white;
    color: #333;
    font-size: 1rem;
}

.form-group input:hover,
.form-group select:hover {
    border-color: #1976d2;
}

/* Ensure dropdown shows selected value properly */
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    color: #333;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: menulist;
    -webkit-appearance: menulist;
    -moz-appearance: menulist;
}

.form-group select:hover {
    border-color: #1976d2;
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.1);
}

.form-group select:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

/* Ensure dropdown options are visible and selectable */
.form-group select option {
    padding: 8px 12px;
    background: white;
    color: #333;
    font-size: 1rem;
    font-weight: 500;
}

/* Style for disabled options */
.form-group select option:disabled {
    color: #999;
    background-color: #f5f5f5;
}

/* Class info styling */
.class-info {
    font-size: 0.9rem;
    color: #1976d2;
    font-weight: 600;
    margin-top: 5px;
    padding: 2px 8px;
    background: rgba(25, 118, 210, 0.1);
    border-radius: 4px;
    display: inline-block;
}

/* Analytics section styling */
.analytics-section {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

/* Attendance Analytics Pie Chart */
.attendance-analytics-card {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #f8fbff 0%, #eef2ff 50%, #fdf2ff 100%);
    border-radius: var(--card-radius);
    padding: clamp(20px, 4vw, 28px);
    border: 1px solid #e3f2fd;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: clamp(16px, 3vw, 24px);
}

.analytics-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: clamp(12px, 2vw, 20px);
}

.analytics-eyebrow {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.analytics-header h2 {
    margin: 0;
    font-size: clamp(1.25rem, 2vw, 1.6rem);
    color: #0f172a;
}

.analytics-subtitle {
    margin: 4px 0 0 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.analytics-timeframe {
    display: inline-flex;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    background: #f8fafc;
    overflow: hidden;
}

.analytics-range-btn {
    border: none;
    background: transparent;
    padding: 8px 18px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1d4ed8;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.analytics-range-btn.is-active,
.analytics-range-btn:focus-visible {
    background: #1d4ed8;
    color: #fff;
}

.analytics-range-btn:focus-visible {
    outline: 2px solid #1d4ed8;
    outline-offset: 2px;
}

.analytics-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: clamp(12px, 2vw, 20px);
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.9rem;
    color: #475569;
}

.filter-field input,
.filter-field select {
    border: 1px solid #dbeafe;
    border-radius: var(--card-radius);
    padding: 10px 14px;
    background: #fff;
    font-size: 0.95rem;
    color: #0f172a;
}

.analytics-content {
    display: grid;
    grid-template-columns: minmax(240px, 2fr) minmax(200px, 1fr);
    gap: clamp(16px, 3vw, 32px);
    align-items: center;
}

.analytics-chart {
    position: relative;
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.attendance-analytics-card canvas {
    width: 100% !important;
    max-width: 420px;
    height: auto !important;
}

.analytics-chart-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    color: #0f172a;
    background: transparent;
    font-weight: 600;
    pointer-events: none;
}

.analytics-summary {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 12px;
}

.analytics-summary li {
    background: #f8fafc;
    border-radius: var(--card-radius);
    padding: 16px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.analytics-summary span {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.analytics-summary strong {
    font-size: 1.4rem;
    color: #0f172a;
}

@media (max-width: 900px) {
    .analytics-content {
        grid-template-columns: 1fr;
    }

    .attendance-analytics-card {
        padding: 20px;
    }
}

@media (max-width: 600px) {
    .analytics-timeframe {
        width: 100%;
        justify-content: space-between;
    }

    .analytics-range-btn {
        flex: 1;
        text-align: center;
        padding: 10px;
    }

    .analytics-summary {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
}

.analytics-section h2 {
    color: #1976d2;
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Class analytics grid */
.class-analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 18px;
    margin-top: var(--spacing-md);
}

.class-analytics-card {
    background: rgb(253, 253, 253);
    border-radius: var(--card-radius);
    padding: 20px;
    box-shadow: 0 2px 10px rgba(14, 9, 9, 0.1);
    border: 1px solid #0b0d0f;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
}

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

.class-analytics-card .class-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f8f9fa;
}

.class-analytics-card .class-header h3 {
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.attendance-rate {
    text-align: right;
}

.rate-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1976d2;
}

.rate-label {
    font-size: 0.8rem;
    color: #666;
    font-weight: 500;
}

.class-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 80px), 1fr));
    gap: 12px;
}

.class-stats .stat-item {
    text-align: center;
    padding: 12px 10px;
    border-radius: var(--card-radius);
    border: 3px solid rgba(0, 0, 0, 0.693);
    background: #f9fbfc;
    min-height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.class-stats .stat-item.present {
    background: rgba(203, 213, 203, 0.714);
    border: 3px solid rgba(0, 0, 0, 0.693);
}

.class-stats .stat-item.absent {
    background: rgba(203, 213, 203, 0.714);
    border: 3px solid rgba(0, 0, 0, 0.693);
}

.class-stats .stat-item.late {
    background: rgba(203, 213, 203, 0.714);
    border: 3px solid rgba(0, 0, 0, 0.693);
}

.class-stats .stat-item.excused {
    background: rgba(203, 213, 203, 0.714);
    border: 3px solid rgba(0, 0, 0, 0.693);
}

.stat-number {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8rem;
    color: #666;
    font-weight: 500;
    line-height: 1.2;
}

/* Buttons */
.btn {
    padding: 11px 18px;
    border: none;
    border-radius: var(--card-radius);
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    text-align: center;
    position: relative;
    z-index: 15;
    pointer-events: auto;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #1e3a8a 0%, #0066CC 50%, #2563eb 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0066CC 0%, #2563eb 50%, #3b82f6 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.35);
}

.btn-primary:disabled {
    background: #9ca3af;
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: white;
    color: #1e3a8a;
    border: 1px solid #2563eb;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

.btn-secondary:hover {
    background: #f1f5ff;
    color: #0066CC;
    border-color: #0066CC;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-secondary:disabled {
    background: #f5f5f5;
    color: #9ca3af;
    border-color: #e0e0e0;
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.85rem;
}

.btn-edit {
    background: linear-gradient(135deg, #1e3a8a 0%, #0066CC 50%, #2563eb 100%);
    color: white;
    margin-right: 8px;
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.25);
}

.btn-edit:hover {
    background: linear-gradient(135deg, #0066CC 0%, #2563eb 50%, #3b82f6 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.35);
}

.btn-delete,
.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.btn-delete:hover,
.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

/* Table Section */
.table-section {
    background: white;
    padding: 28px;
    border-radius: var(--card-radius);
    box-shadow: 0 8px 32px rgba(7, 56, 107, 0.1);
    border: 1px solid #e3f2fd;
    width: 100%;
}

.table-section h2 {
    color: #10467d;
    margin-bottom: 22px;
    font-size: 1.4rem;
    font-weight: 600;
}

.table-container {
    display: block;
    width: 100%;
    max-width: 100%;
    max-height: 420px;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--card-radius);
    border: 1px solid #0066CC;
    background: #0066CC;
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.2);
    margin-bottom: var(--spacing-md);
}

/* On teacher pages, expand tables fully (no vertical scroll clipping) */
.teacher-dashboard .table-container {
    width: 100%;
    max-width: 100%;
    max-height: none;
    overflow-y: visible;
    overflow-x: visible;
}

/* On very small screens, allow horizontal scroll for teacher tables */
@media (max-width: 640px) {
    .teacher-dashboard .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Give the records table a framed background that blends with the table */
.student-dashboard #records-section .table-container {
    background: linear-gradient(135deg, #053266, #0f4fb8);
    border: none;
    padding: 3px;
    border-radius: 20px;
    max-width: 640px;
    margin: 0 auto var(--spacing-md);
    width: 100%;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.18);
}

.student-dashboard #records-section .attendance-table {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
}

.attendance-table {
    width: 100%;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: var(--card-radius);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.attendance-table thead {
    background: #0066CC;
    color: white;
}

.attendance-table th {
    padding: 14px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.2px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.attendance-table th:first-child {
    border-top-left-radius: 12px;
}

.attendance-table th:last-child {
    border-top-right-radius: 12px;
}

.attendance-table td {
    padding: 13px 12px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
    font-size: 0.92rem;
}

/* Teacher pages: increase padding/row height for readability */
.teacher-dashboard .attendance-table th {
    padding: 16px 16px;
    font-size: 0.98rem;
}

.teacher-dashboard .attendance-table td {
    padding: 14px 16px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.attendance-table tbody tr {
    background-color: #ffffff;
    transition: background-color 0.3s ease;
}

.attendance-table tbody tr:nth-child(even) {
    background-color: #f1f5ff;
}

.attendance-table tbody tr:hover {
    background-color: #e0e7ff;
    transition: background-color 0.3s ease;
}

.attendance-table tbody tr:last-child td {
    border-bottom: none;
}

.attendance-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 12px;
}

.attendance-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 12px;
}

/* Status Badges */
.status-badge {
    padding: 5px 9px;
    border-radius: 11px;
    font-size: 0.77rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: inline-block;
}

.status-present {
    background: #e8f5e8;
    color: #2e7d32;
}

.status-absent {
    background: #ffebee;
    color: #c62828;
}

.status-late {
    background: #fff3e0;
    color: #ef6c00;
}

.status-excused {
    background: #e3f2fd;
    color: #1976d2;
}

/* Actions Column */
.actions {
    white-space: nowrap;
}

.actions form {
    display: inline;
}

/* No Data Message */
.no-data {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px;
}

/* Footer */
.footer {
    background: white;
    padding: 18px;
    border-radius: var(--card-radius);
    box-shadow: 0 8px 32px rgba(0, 123, 255, 0.1);
    text-align: center;
    color: #666;
    border: 1px solid #e3f2fd;
    width: 100%;
}

/* Responsive Design */
@media (max-width: 768px) {
    .school-header {
        padding: 24px;
        flex-direction: column;
        text-align: center;
        gap: 18px;
    }
    
    .school-logo-img {
        width: 65px;
        height: 65px;
    }
    
    .school-name {
        font-size: 1.9rem;
    }
    
    .school-motto {
        font-size: 1rem;
    }
    
    .main-content {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .student-main-content .main-content,
    .main-content.student-main-content,
    .student-main-content {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 18px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .container {
        padding: 20px;
    }
    
    .form-section,
    .table-section {
        padding: 22px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .attendance-table {
        font-size: 0.88rem;
    }
    
    .attendance-table th,
    .attendance-table td {
        padding: 11px 10px;
    }
    
    .btn:not(.btn-sm):not(.btn-edit):not(.btn-delete):not(.btn-danger) {
        width: 100%;
    }
    
    .search-container {
        min-width: 100%;
        max-width: 100%;
    }
    
    .class-stats {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 90px), 1fr));
    }

    .attendance-month-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .calendar-nav {
        width: 100%;
        justify-content: space-between;
        margin-bottom: 4px;
    }

    .attendance-legend {
        width: 100%;
        justify-content: flex-start;
        gap: 6px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8rem;
    }

    .main-content,
    .student-main-content {
        gap: 16px;
    }
    
    .btn {
        padding: 12px 16px;
        font-size: 0.95rem;
        width: 100%;
    }
    
    .form-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .actions {
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    
    .btn-sm {
        padding: 9px 13px;
        font-size: 0.88rem;
    }
    
    .class-analytics-grid,
    .attendance-breakdown {
        grid-template-columns: 1fr;
    }
    
    .school-header {
        padding: 20px;
    }
    
    .modal-content {
        width: 95%;
        padding: 22px;
        margin: 16px auto;
    }
    
    .form-section,
    .table-section,
    .stat-card {
        padding: 18px;
    }

    .student-dashboard .stats-grid,
    .student-dashboard #overview-section .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
}

/* Animation for smooth transitions */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-section,
.table-section {
    animation: fadeIn 0.6s ease-out;
}

/* Custom scrollbar for table */
.table-container::-webkit-scrollbar {
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #1e3a8a 0%, #0066CC 50%, #2563eb 100%);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #0066CC 0%, #183c88 50%, #13428e 100%);
}

/* Authentication Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    width: 100%;
}

.auth-card {
    background: white;
    padding: 36px;
    border-radius: var(--card-radius);
    box-shadow: 0 20px 60px rgba(0, 123, 255, 0.15);
    border: 1px solid #e3f2fd;
    width: 100%;
    max-width: 480px;
    animation: fadeIn 0.6s ease-out;
}

.auth-header {
    text-align: center;
    margin-bottom: 26px;
}

.auth-header h1 {
    color: #1976d2;
    font-size: 2rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.auth-header p {
    color: #666;
    font-size: 1rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.btn-full {
    width: 100%;
    margin-top: 10px;
}

.auth-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e3f2fd;
}

.auth-footer p {
    color: #666;
    margin-bottom: 15px;
}

.auth-footer a {
    color: #1976d2;
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.demo-accounts {
    background: #f8f9ff;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    border: 1px solid #e3f2fd;
}

.demo-accounts h4 {
    color: #1976d2;
    margin-bottom: 10px;
    font-size: 1rem;
}

.demo-accounts p {
    margin: 5px 0;
    font-size: 0.9rem;
    color: #555;
}

/* Dashboard Styles */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-info h1 {
    margin-bottom: 5px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 20; /* above main-content but below modals */
}

.header-actions .btn {
    position: relative;
    z-index: 21;
    cursor: pointer;
    pointer-events: auto;
}

.admin-layout .header-actions {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.admin-layout .header-actions .search-container {
    flex: 1 1 320px;
    max-width: 540px;
}

.admin-layout .header-actions .search-btn,
.admin-layout .header-actions .btn {
    flex-shrink: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #666;
}

.dashboard-nav {
    background: white;
    padding: 18px;
    border-radius: var(--card-radius);
    box-shadow: 0 8px 32px rgba(0, 123, 255, 0.1);
    border: 1px solid #e3f2fd;
    margin-bottom: var(--spacing-lg);
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.nav-link {
    padding: 13px 22px;
    background: #f8f9ff;
    color: #1976d2;
    text-decoration: none;
    border-radius: var(--card-radius);
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    font-size: 1rem;
    white-space: nowrap;
}

.nav-link:hover {
    background: #e3f2fd;
    transform: translateY(-2px);
}

.nav-link.active {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(25, 118, 210, 0.3);
}

.dashboard-section {
    display: block;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 18px;
    margin-bottom: var(--spacing-lg);
}

.stat-card {
    background: white;
    padding: 16px;
    border-radius: var(--card-radius);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.06);
    border: 1px solid #e3f2fd;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    width: 100%;
}

.student-dashboard .header,
.student-dashboard #overview-section {
    max-width: 720px;
    margin-inline: auto;
    margin-bottom: 18px;
}

.student-dashboard #overview-section {
    width: 100%;
    align-self: center;
}

.student-dashboard #records-section {
    max-width: 720px;
    margin-inline: auto;
    width: 100%;
    align-self: center;
}

.student-dashboard #overview-section .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 12px;
    max-width: 640px;
    margin-inline: auto;
}

.student-dashboard #overview-section .stat-card {
    padding: 14px 16px;
    border-radius: 20px;
    min-height: 115px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(219, 234, 254, 0.85));
    border: 1px solid rgba(59, 130, 246, 0.25);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
    position: relative;
    overflow: hidden;
}

.student-dashboard #overview-section .stat-card::before {
    content: '';
    position: absolute;
    width: 140px;
    height: 140px;
    top: -70px;
    right: -40px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.25), transparent 70%);
    pointer-events: none;
}

.student-dashboard #overview-section .stat-icon {
    width: 38px;
    height: 38px;
    font-size: 1.25rem;
    border-radius: 10px;
    background: linear-gradient(135deg, #1d4ed8, #3b82f6);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.25);
}

.student-dashboard #overview-section .stat-content h3 {
    font-size: 1.2rem;
    color: #0f172a;
}

.student-dashboard #overview-section .stat-content p {
    font-size: 0.8rem;
    color: #475569;
}


.stat-icon {
    font-size: 1.6rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1976d2;
    border-radius: 0;
    color: white;
    flex-shrink: 0;
}

.stat-content h3 {
    color: #1976d2;
    font-size: 1.3rem;
    margin-bottom: 3px;
    font-weight: 700;
}

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

/* Student Info Card */
.student-info-card {
    background: white;
    padding: 28px;
    border-radius: var(--card-radius);
    box-shadow: 0 8px 32px rgba(0, 123, 255, 0.1);
    border: 1px solid #e3f2fd;
    width: 100%;
}

.student-info-card h2 {
    color: #1976d2;
    margin-bottom: 25px;
    font-size: 1.5rem;
    font-weight: 600;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 18px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.info-item label {
    color: #1976d2;
    font-weight: 600;
    font-size: 0.9rem;
}

.info-item span {
    color: #333;
    font-size: 1rem;
    padding: 8px 12px;
    background: #f8f9ff;
    border-radius: 6px;
    border: 1px solid #e3f2fd;
}

.record-details {
    color: #666;
    font-size: 0.85rem;
}

/* Error Page */
.error-content {
    text-align: center;
    padding: 30px 0;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.error-content h2 {
    color: #1976d2;
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.error-content p {
    color: #666;
    margin-bottom: 10px;
    line-height: 1.6;
}

/* Status badges for roles */
.status-admin {
    background: #e8f5e8;
    color: #2e7d32;
}

.status-student {
    background: #e3f2fd;
    color: #1976d2;
}

/* Responsive updates for auth pages */
@media (max-width: 768px) {
    .auth-card {
        padding: 30px 20px;
        margin: 10px;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .dashboard-nav {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-link {
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .user-info {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .main-header {
        padding: 20px 35px;
    }
    .table-section,
    .student-info-card,
    .section-analytics-card,
    .profile-card,
    .search-attendance-results {
        padding: 24px;
    }
}

@media (max-width: 1024px) {
    .admin-layout {
        flex-direction: column;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        flex-direction: column;
        box-shadow: none;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
        top: auto;
        left: 0;
        margin-top: 110px;
        padding-bottom: 0;
    }

    .sidebar-nav ul {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        padding: 0 20px 20px;
    }

    .nav-item {
        flex: 1 1 160px;
        justify-content: center;
    }

    .main-wrapper {
        margin-left: 0;
        width: 100%;
    }

    .school-header {
        flex-direction: column;
        text-align: center;
    }

    .header-content,
    .header-actions,
    .user-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-nav {
        overflow-x: auto;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: flex;
    }

    .main-content {
        grid-template-columns: 1fr;
    }

    .stats-grid,
    .info-grid,
    .class-stats {
        grid-template-columns: 1fr;
    }

    .table-section,
    .form-section,
    .student-info-card {
        padding: 18px;
    }

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

    .attendance-table {
        min-width: 640px;
    }

    .header-actions,
    .header-info,
    .header-content {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .sidebar-nav ul {
        flex-direction: column;
    }

    .nav-item {
        flex: 1 1 auto;
    }

    .search-container,
    .header-actions {
        width: 100%;
    }

    .school-header {
        padding: 20px;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
    }
}

/* Section Analytics Styles */
.section-analytics-card {
    background: white;
    border-radius: var(--card-radius);
    padding: 26px;
    margin-bottom: 22px;
    box-shadow: 0 4px 16px rgba(0, 123, 255, 0.1);
    border: 1px solid #e3f2fd;
    width: 100%;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e3f2fd;
    flex-wrap: wrap;
    gap: 12px;
}

.section-header h3 {
    color: #1976d2;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    flex: 1 1 auto;
}

.section-header-actions {
    margin-left: auto;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    flex: 0 0 auto;
}

.section-header-actions form {
    margin: 0;
    display: flex;
}

.section-header-actions .btn {
    min-width: 140px;
    text-align: center;
}

@media (max-width: 640px) {
    .section-header h3 {
        width: 100%;
    }

    .section-header-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        margin-left: 0;
    }

    .section-header-actions form {
        width: 100%;
    }

    .section-header-actions .btn {
        width: 100%;
    }
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1976d2;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-top: 2px;
}

.attendance-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 100px), 1fr));
    gap: 12px;
}

.breakdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    border-radius: var(--card-radius);
    text-align: center;
}

.breakdown-item.present {
    background: #e8f5e8;
    border: 1px solid #4caf50;
}

.breakdown-item.absent {
    background: #ffebee;
    border: 1px solid #f44336;
}

.breakdown-item.late {
    background: #fff3e0;
    border: 1px solid #ff9800;
}

.breakdown-item.excused {
    background: #e3f2fd;
    border: 1px solid #2196f3;
}

.breakdown-item .icon {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.breakdown-item .count {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.breakdown-item .label {
    font-size: 0.8rem;
    color: #666;
}

.no-data-message {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 1.1rem;
}

/* Profile Picture Styles */
.profile-picture-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.profile-picture-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e3f2fd;
    cursor: pointer;
    transition: all 0.3s ease;
}

.profile-picture-small:hover {
    border-color: #1976d2;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
}

.profile-picture-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #e3f2fd;
    margin: 0 auto 20px;
    display: block;
}

.profile-picture-header {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e3f2fd;
    cursor: pointer;
    transition: all 0.3s ease;
}

.profile-picture-header:hover {
    border-color: #1976d2;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

#messageModal {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#messageModal .modal-content {
    position: relative;
    max-height: 85vh;
    overflow-y: auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid #e3f2fd;
    animation: slideIn 0.3s ease-out;
}

#messageModal .modal-content::-webkit-scrollbar {
    width: 8px;
}

#messageModal .modal-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

#messageModal .modal-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

#messageModal .modal-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.modal-content {
    background: white;
    padding: 32px;
    border-radius: var(--card-radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid #e3f2fd;
    max-width: 580px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    margin: auto;
    animation: slideIn 0.3s ease-out;
}

.account-status-modal h2 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #0f172a;
}

.account-status-intro {
    color: #475569;
    margin-bottom: 12px;
    line-height: 1.6;
}

.account-status-list {
    margin: 0;
    padding-left: 20px;
    color: #1f2937;
}

.account-status-list li {
    margin-bottom: 6px;
    line-height: 1.4;
}

.account-status-note {
    margin-top: 14px;
    color: #475569;
    font-size: 0.95rem;
}

.account-status-actions {
    margin-top: 20px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.close {
    position: absolute;
    top: 14px;
    right: 18px;
    font-size: 30px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.close:hover {
    color: #1976d2;
}

/* Message Modal Specific Styles */
#messageModal .modal-content {
    max-width: 700px !important;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.profile-modal-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e3f2fd;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.profile-picture-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #0066CC;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.2);
}

.profile-modal-header h2 {
    color: #0066CC;
    margin-bottom: 5px;
    font-size: 1.8rem;
    font-weight: 600;
    text-align: center;
}

.user-role {
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    background: linear-gradient(135deg, #0066CC 0%, #2563eb 100%);
    padding: 6px 18px;
    border-radius: 20px;
    display: inline-block;
    margin-top: 10px;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.25);
}

.profile-modal-body {
    padding-top: 20px;
    width: 100%;
}

.info-grid-centered {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    max-width: 100%;
    margin: 0 auto;
}

.info-item {
    display: flex;
    flex-direction: column;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 10px;
    border-left: 4px solid #0066CC;
    transition: all 0.3s ease;
}

.info-item:hover {
    background: #f1f5ff;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.1);
}

.info-item label {
    font-weight: 600;
    color: #0066CC;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.info-item span {
    color: #333;
    font-size: 1rem;
    font-weight: 500;
}

/* Search Form Styles */
.search-form {
    background: #f8f9ff;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e3f2fd;
    margin-bottom: 20px;
}

.search-form .form-row {
    display: flex;
    gap: 15px;
    align-items: end;
}

.search-form .form-group {
    flex: 1;
}

.search-form .form-group:last-child {
    flex: 0 0 auto;
}

/* Alert Styles */
.alert-warning {
    background-color: #fff3e0;
    color: #ef6c00;
    border-left-color: #ff9800;
}

.alert-info {
    background-color: #e3f2fd;
    color: #1976d2;
    border-left-color: #2196f3;
}

/* Animation for modal */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive updates for profile pictures */
@media (max-width: 768px) {
    .profile-picture-small {
        width: 35px;
        height: 35px;
    }
    
    .profile-picture-large {
        width: 100px;
        height: 100px;
    }
    
    .modal-content {
        padding: 20px;
        margin: 20px;
        justify-content: center;
        align-items: center;
    }
    
    .search-form .form-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-form .form-group:last-child {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .profile-picture-small {
        width: 30px;
        height: 30px;
    }
    
    .profile-picture-large {
        width: 80px;
        height: 80px;
    }
    
    .modal-content {
        padding: 15px;
        margin: 10px;
        justify-content: center;
    }
}

/* Admin Layout Styles */
.admin-layout {
    display: block;
    min-height: 100vh;
    background: linear-gradient(135deg, #f8f9ff 0%, #e3f2fd 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1e3a8a 0%, #0066CC 50%, #2563eb 100%);
    color: white;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    position: fixed;
    height: calc(100vh - 76px);
    left: 0;
    top: 76px;
    z-index: 1400; /* Above main content but below header */
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    overflow-y: auto;
    overflow-x: hidden;
    pointer-events: auto;
    padding-bottom: 20px;
    transform: translateX(0);
    transition: transform 0.3s ease;
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 1300;
    display: none;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

body.sidebar-open {
    overflow: hidden;
}

/* Collapsed Sidebar State removed to match teacher panel (no desktop collapse) */

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5px;
}

.sidebar-close-btn {
    display: none;
    position: absolute;
    top: 16px;
    right: 16px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.sidebar-close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.sidebar-nav {
    flex: 1;
    padding: 30px 0;
    overflow-y: auto;
    position: relative;
    z-index: 1001; /* Ensure nav is above sidebar background */
    pointer-events: auto;
}

.sidebar-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-nav li {
    margin: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 16px 25px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid transparent;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    z-index: 1002; /* Higher z-index to ensure clickability */
    pointer-events: auto !important;
    cursor: pointer;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    transition: width 0.3s ease;
}

.nav-item:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    color: white;
    transform: translateX(8px);
    border-left-color: #fbbf24;
}

.nav-item:hover::before {
    width: 4px;
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    color: white;
    border-left-color: #fbbf24;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nav-item.active::before {
    width: 4px;
}

.nav-icon {
    font-size: 1.4rem;
    margin-right: 12px;
    width: 24px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--navy, #0d47a1);
}


.nav-text {
    font-weight: 600;
    letter-spacing: 0.3px;
}

body.admin-has-sidebar .main-wrapper {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
}

@media (max-width: 1024px) {
    body.admin-has-sidebar .main-wrapper {
        margin-left: 0;
        width: 100%;
    }
}

.sidebar-footer {
    padding: 25px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1001;
    pointer-events: auto;
}

.user-profile {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.user-profile:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sidebar .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    object-fit: cover;
    transition: all 0.3s ease;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}

.sidebar .user-profile:hover .user-avatar {
    border-color: #fbbf24;
    transform: scale(1.05);
}

.user-details {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.user-name {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 3px;
    color: white;
}

.user-role {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.1);
    padding: 3px 8px;
    border-radius: 12px;
    display: inline-block;
    font-weight: 500;
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 15px;
    position: relative;
    z-index: 1002;
    pointer-events: auto !important;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(220, 38, 38, 0.2) 100%);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s ease;
    font-weight: 600;
    border: 1px solid rgba(239, 68, 68, 0.3);
    font-size: 0.9rem;
}

.logout-btn:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.3) 0%, rgba(220, 38, 38, 0.3) 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

@media (max-width: 1024px) {
    .sidebar {
        top: 0;
        height: 100vh;
        padding-top: 96px;
        transform: translateX(-100%);
        pointer-events: none;
    }

    .sidebar.open {
        pointer-events: auto;
    }

    .sidebar-overlay {
        display: block;
    }

    .sidebar-close-btn {
        display: inline-flex;
    }
}

/* Main Wrapper */
.main-wrapper {
    margin-left: 0;
    position: relative;
    z-index: 1; /* Lower than sidebar to ensure sidebar is clickable */
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    background: linear-gradient(135deg, #f8f9ff 0%, #e3f2fd 100%);
    /* No transition - instant adjustment */
}

/* Teacher pages: ensure wrapper/content use full viewport width */
.teacher-dashboard .main-wrapper,
.teacher-main-wrapper {
    width: 100%;
    max-width: none;
    margin: 0;
}

/* Collapsed main-wrapper rules removed */

/* School Header */
.school-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #0066CC 50%, #2563eb 100%);
    color: white;
    padding: 25px 35px;
    display: flex;
    align-items: center;
    gap: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    z-index: 10; /* ensure header is above sidebar */
    width: 100%;
    box-sizing: border-box;
    margin: 0;
}

.school-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 50%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
}

.school-logo {
    flex-shrink: 0;
    position: relative;
}

.school-logo-img {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.3);
    background: white;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.school-logo:hover .school-logo-img {
    transform: scale(1.05);
    border-color: #fbbf24;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.school-info {
    flex: 1;
}

.school-name {
    font-size: 2rem;
    font-weight: 800;
    margin: 0 0 6px 0;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

.school-motto {
    font-size: 1.05rem;
    margin: 0;
    opacity: 0.9;
    font-style: italic;
    font-weight: 300;
    letter-spacing: 0.3px;
}

.main-wrapper {
    margin-left: 0;
    position: relative;
    z-index: 1; /* Lower than sidebar to ensure sidebar is clickable */
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    background: linear-gradient(135deg, #f8f9ff 0%, #e3f2fd 100%);
    /* No transition - instant adjustment */
}
.main-header .header-content {
    /* Removed flex properties to allow main-header to control layout */
}

.main-header h1 {
    margin: 0;
    color: #1e3a8a;
    font-size: 2rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.3px;
}

.search-container {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #f8f9ff 0%, #e3f2fd 100%);
    border-radius: 26px;
    padding: 12px 18px;
    border: 2px solid #e3f2fd;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    min-width: min(100%, 280px);
    width: 100%;
    max-width: 500px;
}

.search-container:focus-within {
    border-color: #1e3a8a;
    box-shadow: 0 0 0 4px rgba(30, 58, 138, 0.1);
    transform: translateY(-2px);
}

.search-input {
    border: none;
    background: transparent;
    outline: none;
    padding: 10px 12px;
    font-size: 1rem;
    width: 100%;
    color: #1e3a8a;
    font-weight: 500;
}

.search-input::placeholder {
    color: #64748b;
    font-weight: 400;
}

.search-btn {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: white;
    transition: all 0.3s ease;
    padding: 8px 12px;
    border-radius: 20px;
    margin-left: 10px;
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.3);
}

.search-btn:hover {
    background: linear-gradient(135deg, #0066CC 0%, #3b82f6 100%);
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(30, 58, 138, 0.4);
}

/* Search Results Styles */
.search-results-section {
    padding: 20px 30px;
    background-color: #f5f7fa;
}

.search-user-profile {
    margin-bottom: 30px;
}

.profile-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e3f2fd;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 30px;
}

.profile-info h2 {
    margin: 0 0 10px 0;
    color: #1976d2;
    font-size: 2rem;
    font-weight: 600;
}

.profile-info .user-role {
    background: #e3f2fd;
    color: #1976d2;
    padding: 5px 15px;
    border-radius: 20px;
    display: inline-block;
    font-weight: 500;
    margin-bottom: 20px;
}

.profile-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.detail-item label {
    font-weight: 600;
    color: #666;
    font-size: 0.9rem;
}

.detail-item span {
    color: #333;
    font-size: 1rem;
}

.search-attendance-results {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e3f2fd;
}

.search-attendance-results h3 {
    margin: 0 0 20px 0;
    color: #1976d2;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Search Users List Styles */
.search-users-list {
    margin-bottom: 30px;
}

.search-users-list h3 {
    margin: 0 0 20px 0;
    color: #1976d2;
    font-size: 1.5rem;
    font-weight: 600;
}

.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.user-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-card:hover {
    border-color: #1976d2;
    box-shadow: 0 4px 20px rgba(25, 118, 210, 0.2);
    transform: translateY(-2px);
}

.user-avatar {
    flex-shrink: 0;
}

.user-avatar img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e3f2fd;
}

.user-info {
    flex: 1;
}

.user-info h4 {
    margin: 0 0 8px 0;
    color: #1976d2;
    font-size: 1.2rem;
    font-weight: 600;
}

.user-role-badge {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-block;
    margin: 0 0 10px 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-details span {
    font-size: 0.9rem;
    color: #666;
}

.user-details span:first-child {
    font-weight: 600;
    color: #333;
}

/* Enhanced Search Results */
.search-results-section {
    background: linear-gradient(135deg, #f8f9ff 0%, #e3f2fd 100%);
    border-radius: 15px;
    margin: 20px 30px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.search-user-profile .profile-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    border: 2px solid #e3f2fd;
    box-shadow: 0 8px 32px rgba(25, 118, 210, 0.1);
}

.search-user-profile .profile-header {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    color: white;
    padding: 25px;
    border-radius: 15px 15px 0 0;
    margin: -30px -30px 30px -30px;
}

.search-user-profile .profile-info h2 {
    color: white;
    margin-bottom: 10px;
}

.search-user-profile .user-role {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.search-user-profile .profile-details {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.search-user-profile .detail-item {
    background: rgba(255, 255, 255, 0.9);
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #1976d2;
}

.search-user-profile .detail-item label {
    color: #1976d2;
    font-weight: 700;
}

.search-user-profile .detail-item span {
    color: #333;
    font-weight: 500;
}

/* Enhanced User Cards */
.user-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    border: 2px solid #e3f2fd;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.user-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1976d2, #42a5f5);
}

.user-card:hover {
    border-color: #1976d2;
    box-shadow: 0 8px 32px rgba(25, 118, 210, 0.2);
    transform: translateY(-4px);
}

.user-card .user-avatar img {
    border: 3px solid #e3f2fd;
    transition: all 0.3s ease;
}

.user-card:hover .user-avatar img {
    border-color: #1976d2;
    transform: scale(1.1);
}

.user-card .user-info h4 {
    color: #0e5eae;
    font-weight: 700;
    margin-bottom: 8px;
}

.user-role-badge {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1976d2;
    border: 1px solid #90caf9;
    font-weight: 600;
}

.user-details span {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

.user-details span:first-child {
    color: #08529c;
    font-weight: 700;
    font-size: 1rem;
}

/* Enhanced Table Styling */
.attendance-table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.attendance-table thead {
    background: #0066CC;
    color: white;
}

.attendance-table thead th {
    padding: 15px 12px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.2px;
}

.attendance-table tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid #f0f0f0;
}

.attendance-table tbody tr:hover {
    background: linear-gradient(135deg, #f8f9ff 0%, #e3f2fd 100%);
    transform: scale(1.01);
}

.attendance-table tbody td {
    padding: 12px 10px;
    vertical-align: middle;
    font-size: 0.9rem;
}

/* Enhanced Status Badges */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.status-present {
    background: linear-gradient(135deg, #4caf50 0%, #66bb6a 100%);
    color: white;
}

.status-absent {
    background: linear-gradient(135deg, #f44336 0%, #ef5350 100%);
    color: white;
}

.status-late {
    background: linear-gradient(135deg, #ff9800 0%, #ffb74d 100%);
    color: white;
}

/* Enhanced Buttons */
.btn {
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.btn-primary {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    border: none;
}

.btn-secondary {
    background: linear-gradient(135deg, #757575 0%, #616161 100%);
    border: none;
    color: white;
}

.btn-edit {
    background: linear-gradient(135deg, #4caf50 0%, #66bb6a 100%);
    border: none;
    color: white;
}

.btn-delete {
    background: linear-gradient(135deg, #f44336 0%, #ef5350 100%);
    border: none;
    color: white;
}

/* Search Description */
.search-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 20px;
    font-style: italic;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 30px 35px;
    background: linear-gradient(135deg, #f8f9ff 0%, #e3f2fd 100%);
    min-height: calc(100vh - 200px);
    position: relative;
    z-index: 10; /* ensure content is above sidebar */
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding-top: 0;
    overflow-x: hidden;
}

/* Ensure all interactive elements in main-content are clickable */
.main-content * {
    position: relative;
    z-index: inherit;
}

.main-content input,
.main-content select,
.main-content textarea,
.main-content button,
.main-content .btn,
.main-content a,
.main-content table,
.main-content form {
    position: relative;
    z-index: 15;
    pointer-events: auto;
}

/* Footer Styles */
.main-footer {
    background: #2c3e50;
    color: white;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    padding: 40px 30px;
}

.footer-section h3,
.footer-section h4 {
    margin: 0 0 15px 0;
    color: #ecf0f1;
}

.footer-section h3 {
    font-size: 1.3rem;
}

.footer-section h4 {
    font-size: 1.1rem;
    color: #bdc3c7;
}

.footer-section p {
    margin: 5px 0;
    color: #bdc3c7;
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    margin: 8px 0;
}

.footer-section ul li a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: #3498db;
}

.footer-bottom {
    background: #34495e;
    padding: 20px 30px;
    text-align: center;
    border-top: 1px solid #34495e;
}

.footer-bottom p {
    margin: 0;
    color: #bdc3c7;
    font-size: 0.9rem;
}

/* Responsive Design for Admin Layout */
@media (max-width: 768px) {
    .main-wrapper {
        margin-left: 0;
        width: 100%;
    }
    
    .main-content {
        width: 100%;
    }
    
    .main-header {
        padding: 20px 35px;
    }
    
    .main-header .header-content {
        flex-direction: row;
        gap: 20px;
        align-items: center;
    }
    
    .search-container {
        min-width: min(100%, 280px);
        width: 100%;
    }
    
    .school-header {
        padding: 25px 35px;
        flex-direction: row;
        text-align: left;
        gap: 25px;
    }
    
    .school-logo-img {
        width: 65px;
        height: 65px;
    }
    
    .school-name {
        font-size: 2rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        padding: 30px 20px;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .nav-group-header {
        padding: 14px 20px;
        margin: 2px 10px;
    }
    
    .nav-submenu .nav-item {
        padding: 10px 20px 10px 35px;
    }
}

@media (max-width: 480px) {
    .main-header {
        padding: 12px 15px;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .school-header {
        padding: 15px;
    }
    
    .school-name {
        font-size: 1.5rem;
    }
    
    .school-motto {
        font-size: 0.9rem;
    }
    
    .search-container {
        padding: 10px 15px;
    }
    
    .search-input {
        font-size: 0.9rem;
    }
    
    .footer-content {
        padding: 20px 15px;
    }
    
    .footer-bottom {
        padding: 15px;
    }
    
    .nav-group-header {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    
    .nav-submenu .nav-item {
        padding: 8px 15px 8px 30px;
        font-size: 0.85rem;
    }
    
    .sidebar-header h2 {
        font-size: 1.4rem;
    }
}

/* Class Management Styles */
.class-management-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.08);
    margin-bottom: 30px;
    border: 1px solid #0e0f0f;
    overflow: hidden;
}

.class-header {
    background: linear-gradient(135deg, #1976d2 0%, #42a5f5 100%);
    color: rgb(23, 18, 18);
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.class-header h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
}

.class-stats {
    display: flex;
    gap: 20px;
    align-items: center;
}

.student-count, .class-date {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}

.class-content {
    padding: 25px;
}

.bulk-actions {
    background: #d3d6d9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border-left: 4px solid #1976d2;
}

.bulk-actions h4 {
    color: #1976d2;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.bulk-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.students-list h4 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.student-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.student-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.attendance-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.attendance-select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    min-width: 120px;
}

.status-unmarked {
    background: #f8f9fa;
    color: #6c757d;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.student-row {
    transition: background-color 0.2s ease;
}

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

/* Responsive adjustments for class management */
@media (max-width: 768px) {
    .class-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .class-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .bulk-buttons {
        justify-content: center;
    }
    
    .attendance-actions {
        flex-direction: column;
        gap: 5px;
    }
    
    .attendance-select {
        min-width: 100px;
    }
}

/* Admin Panel Navigation Styles */
.dashboard-section {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.dashboard-section:first-child {
    display: block;
}

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

.nav-item {
    transition: all 0.3s ease;
    cursor: pointer;
}

.nav-item:hover {
    background-color: rgba(25, 118, 210, 0.1);
    transform: translateX(5px);
}

.nav-item.active {
    background-color: rgba(25, 118, 210, 0.15);
    border-left: 3px solid #1976d2;
}

.nav-item.active .nav-icon {
    transform: scale(1.1);
}

/* Navigation Menu Styles */
.nav-group {
    margin-bottom: 8px;
    position: relative;
}

.nav-group-header {
    display: flex;
    align-items: center;
    padding: 16px 25px;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin: 4px 15px;
    font-weight: 700;
    font-size: 1rem;
    user-select: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    z-index: 1002; /* Higher z-index to ensure clickability */
    pointer-events: auto !important;
}

.nav-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    margin: 0 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    z-index: 1002; /* Higher z-index to ensure clickability */
    pointer-events: auto;
}

.nav-group.active .nav-submenu {
    max-height: 300px;
    padding: 8px 0;
}

.nav-group-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-group-header:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateX(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nav-group-header:hover::before {
    opacity: 1;
}

.nav-group-header.active {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    color: white;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.nav-arrow {
    margin-left: auto;
    font-size: 0.9rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #fbbf24;
}

.nav-group-header.active .nav-arrow {
    transform: rotate(180deg);
    color: #fbbf24;
}

.nav-submenu li {
    margin: 0;
}

.nav-submenu .nav-item {
    display: flex;
    align-items: center;
    padding: 12px 25px 12px 45px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    border-radius: 8px;
    margin: 3px 8px;
    border-left: none;
    position: relative;
    font-weight: 500;
    cursor: pointer;
    pointer-events: auto !important;
    z-index: 1002; /* Higher z-index to ensure clickability */
}

.nav-submenu .nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    transition: width 0.3s ease;
}

.nav-submenu .nav-item:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    color: white;
    transform: translateX(8px);
}

.nav-submenu .nav-item:hover::before {
    width: 3px;
}

.nav-submenu .nav-item.active {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    color: white;
    border-left: 3px solid #fbbf24;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nav-submenu .nav-item.active::before {
    width: 3px;
}

/* Ensure proper section visibility */
#overall-attendance-section {
    display: block;
}

#student-management-section,
#teacher-management-section,
#teacher-assignments-section {
    display: none;
}

/* Make Admin Panel header clickable */
.sidebar-header {
    cursor: pointer;
}

/* Homepage Styles */
.homepage {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Navigation Styles */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px;
    display: flex;
    justify-content: space-between;
    align-items: left;
    height: 100px;
}

/* Admin, Teacher, Student Navigation Styles */
.admin-nav,
.teacher-nav,
.student-nav {
    background: linear-gradient(135deg, #1e3a8a 0%, #0066CC 50%, #2563eb 100%) !important;
    color: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

/* Enhanced nav-container for admin/teacher/student */
.admin-nav .nav-container,
.teacher-nav .nav-container,
.student-nav .nav-container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 75px;
    gap: 20px;
    box-sizing: border-box;
    position: relative;
}

/* Logo section on the left */
.admin-nav .nav-logo-section,
.teacher-nav .nav-logo-section,
.student-nav .nav-logo-section {
    display: flex;
    align-items: left;
    flex-direction: row;
    gap: 8px;
    flex-shrink: 0;
    z-index: 2;
    height: 100%;
}

.header-logo {
    height: 50px;
    width: auto;
    max-width: 50px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

.header-logo:hover {
    transform: scale(1.05);
}

/* Navigation menu */
.admin-nav .nav-menu,
.teacher-nav .nav-menu,
.student-nav .nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    justify-content: flex-end;
    flex: 1;
    min-width: 0;
    overflow: visible;
}

.admin-nav .nav-link,
.teacher-nav .nav-link,
.student-nav .nav-link {
    color: rgba(255, 255, 255, 0.95);
    padding: 8px 14px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.85rem;
    white-space: nowrap;
    text-decoration: none;
    position: relative;
    overflow: visible;
    background: transparent;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    z-index: 10;
    line-height: 1.2;
}

/* Student nav proportional tweaks */
.student-nav .nav-container {
    max-width: 760px;
    padding: 0 16px;
    height: 52px;
    gap: 10px;
}

.student-nav .nav-logo-section {
    align-items: center;
    gap: 5px;
    height: 52px;
}

.student-nav .header-logo {
    height: 30px;
    max-width: 30px;
}

.student-nav .nav-menu {
    gap: 5px;
}

.student-nav .nav-link {
    padding: 4px 8px;
    font-size: 0.75rem;
    line-height: 1.05;
}

.admin-nav .nav-link:hover,
.teacher-nav .nav-link:hover,
.student-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

.admin-nav .nav-link.active,
.teacher-nav .nav-link.active,
.student-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 600;
    border-color: rgba(255, 255, 255, 0.3);
}

/* Ensure navigation fits on one line */
@media (min-width: 769px) {
    .admin-nav .nav-menu,
    .teacher-nav .nav-menu,
    .student-nav .nav-menu {
        flex-wrap: nowrap;
        overflow: visible;
    }
    
    .admin-nav .nav-link,
    .teacher-nav .nav-link,
    .student-nav .nav-link {
        flex-shrink: 1;
    }
}

.admin-nav .logout-link,
.teacher-nav .logout-link,
.student-nav .logout-link {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    transition: all 0.3s ease;
}

.admin-nav .logout-link:hover,
.teacher-nav .logout-link:hover,
.student-nav .logout-link:hover {
    background: rgba(239, 68, 68, 0.35);
    border-color: rgba(239, 68, 68, 0.5);
}

.badge {
    background: #f59e0b;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-left: 6px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.nav-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
    padding-left: 8px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.user-name-header {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #1e3a8a;
}

.brand-text h1 {
    margin: 0;
    font-size: 1.5rem;
    color: #1e3a8a;
    font-weight: 700;
}

.brand-text p {
    margin: 0;
    font-size: 0.9rem;
    color: #64748b;
    font-style: italic;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-link {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: #1e3a8a;
    background: rgba(30, 58, 138, 0.1);
}

.user-menu {
    position: relative;
    cursor: pointer;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.user-profile:hover {
    background: rgba(30, 58, 138, 0.1);
}

.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #1e3a8a;
}

.user-name {
    font-weight: 600;
    color: #1e3a8a;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    padding: 10px 0;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-link {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
}

.dropdown-link:hover {
    background: rgba(30, 58, 138, 0.1);
    color: #1e3a8a;
}

body.landing-page {
    padding-top: 110px;
    background: linear-gradient(135deg, #f8fbff 0%, #eef2ff 45%, #fdf2ff 100%);
}

@media (max-width: 768px) {
    body.landing-page {
        padding-top: 95px;
    }
}

body.nav-open {
    overflow: hidden;
}


.landing-nav {
    background: #ffffff !important;
    box-shadow: 0 15px 30px rgba(15, 23, 42, 0.08);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    z-index: 1200;
}

.landing-nav .nav-container {
    max-width: 1200px;
    padding: 0 clamp(16px, 4vw, 32px);
    min-height: 90px;
    gap: clamp(12px, 2vw, 24px);
}

.landing-nav .nav-logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    flex-wrap: wrap;
    row-gap: 6px;
}

.landing-nav .nav-logo-section {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.landing-nav .nav-logo-cluster {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.landing-nav .nav-logo-cluster img {
    flex: 0 0 auto;
}

.landing-nav .header-logo {
    height: clamp(42px, 4vw, 52px);
    width: auto;
}

.landing-nav .header-brand-info .system-name {
    margin: 0;
    font-size: 1.2rem;
    color: #0f172a;
    font-weight: 700;
}

.landing-nav .header-brand-info .system-tagline {
    margin: 0;
    font-size: 0.85rem;
    color: #475569;
    font-style: italic;
}

.landing-nav .nav-menu {
    gap: 14px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.landing-nav .nav-link {
    border-radius: 999px;
    padding: 10px 18px;
    font-size: 0.9rem;
    color: #1f2937;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.landing-nav .nav-link:hover {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.landing-nav .nav-link.active {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
    box-shadow: 0 8px 18px rgba(29, 78, 216, 0.3);
}

.landing-nav .nav-cta-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.landing-nav .btn-sm {
    border-radius: 999px;
    padding: 10px 22px;
}

.landing-nav .nav-user-info {
    border-left: 1px solid rgba(15, 23, 42, 0.1);
    padding-left: 12px;
    gap: 10px;
}

.landing-nav .user-profile-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.landing-nav .user-profile-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.landing-nav .nav-user-info .user-name-header {
    color: #0f172a;
}

.landing-nav .nav-user-info .user-role-header {
    color: #475569;
}

.landing-nav .nav-cta-group .btn-secondary {
    background: #ffffff;
    color: #1d4ed8;
    border: 1px solid #1d4ed8;
}

.landing-nav .nav-cta-group .btn-secondary:hover {
    background: #e0ecff;
}

.landing-nav .mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: rgba(15, 23, 42, 0.05);
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 12px;
    padding: 10px;
    cursor: pointer;
    margin-left: auto;
}

.landing-nav .mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background: #0f172a;
    border-radius: 999px;
}

.landing-nav .nav-overlay {
    display: none;
}

.landing-nav .mobile-sidebar-brand {
    display: none;
    width: 100%;
}

.landing-nav .nav-logo-section {
    align-items: center;
}

.landing-nav .nav-logo-section .header-brand-info {
    display: flex;
    flex-direction: column;
}


@media (max-width: 1024px) {
    .landing-nav .nav-container {
        min-height: 80px;
    }
}

@media (max-width: 900px) {
    .landing-nav .nav-menu {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(85vw, 360px);
        background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 55%, #2563eb 100%);
        flex-direction: column;
        align-items: stretch;
        padding: 110px 28px 32px;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        box-shadow: -10px 0 40px rgba(15, 23, 42, 0.4);
        overflow-y: auto;
        gap: 12px;
        border-top-left-radius: 24px;
        border-bottom-left-radius: 24px;
    }

    .landing-nav .nav-menu.active {
        transform: translateX(0);
    }

    .landing-nav .nav-link,
    .landing-nav .nav-cta-group,
    .landing-nav .nav-user-info {
        width: 100%;
    }

    .landing-nav .nav-link {
        border-radius: 16px;
        font-size: 1rem;
        padding: 14px 18px;
        color: #fff;
        border-color: rgba(255, 255, 255, 0.2);
        background: rgba(255, 255, 255, 0.08);
    }

    .landing-nav .nav-link.active {
        background: rgba(255, 255, 255, 0.2);
        border-color: rgba(255, 255, 255, 0.35);
        color: #fff;
    }

    .landing-nav .nav-cta-group {
        flex-direction: column;
    }

    .landing-nav .nav-user-info {
        flex-direction: column;
        align-items: flex-start;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        margin-top: 4px;
        padding-top: 14px;
    }

    .landing-nav .nav-user-info .user-name-header,
    .landing-nav .nav-user-info .user-role-header {
        color: rgba(255, 255, 255, 0.95);
    }

    .landing-nav .nav-cta-group .btn-secondary {
        background: rgba(255, 255, 255, 0.12);
        color: #fff;
        border-color: rgba(255, 255, 255, 0.35);
    }

    .landing-nav .mobile-menu-toggle {
        display: flex;
    }

    .landing-nav .nav-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 23, 42, 0.6);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease;
        z-index: 1199;
    }

    .landing-nav .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .landing-nav .mobile-sidebar-brand {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding-bottom: 18px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        margin-bottom: 6px;
    }

    .landing-nav .mobile-brand-logos {
        display: flex;
        justify-content: center;
        gap: 12px;
    }

    .landing-nav .mobile-brand-logo {
        width: 48px;
        height: 48px;
        object-fit: contain;
    }

    .landing-nav .mobile-brand-text {
        text-align: center;
        color: #fff;
    }

    .landing-nav .mobile-brand-name {
        margin: 0;
        font-size: 1.1rem;
        font-weight: 700;
    }

    .landing-nav .mobile-brand-tagline {
        margin: 0;
        font-size: 0.9rem;
        color: rgba(255, 255, 255, 0.85);
    }
}

@media (max-width: 600px) {
    .landing-nav .header-logo {
        height: 38px;
    }

    .landing-nav .nav-logo-link {
        flex-direction: column;
        align-items: flex-start;
    }

    .landing-nav .nav-logo-cluster {
        width: 100%;
        justify-content: flex-start;
    }

    .landing-nav .header-brand-info .system-name {
        font-size: 1.1rem;
    }

    .landing-nav .nav-container {
        padding: 8px 18px;
        min-height: 110px;
    }
}



/* Hero Section */
.hero-section {
    position: relative;
    overflow: hidden;
    min-height: clamp(540px, calc(100vh - 90px), 760px);
    display: flex;
    align-items: center;
    padding: clamp(60px, 12vw, 120px) 0;
}

.hero-background {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
    z-index: -2;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(3, 7, 18, 0.4);
    z-index: -1;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(20px, 6vw, 60px);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: clamp(28px, 5vw, 56px);
    align-items: center;
}

.hero-text {
    color: #fff;
    text-align: left;
    max-width: 560px;
}

.hero-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.25em;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 14px;
}

.hero-title {
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    font-weight: 800;
    margin-bottom: 18px;
    line-height: 1.15;
    text-shadow: 0 8px 32px rgba(15, 23, 42, 0.5);
}

.hero-subtitle {
    font-size: clamp(1rem, 2.2vw, 1.35rem);
    margin-bottom: 32px;
    opacity: 0.95;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.92);
}

.hero-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.btn-large {
    padding: clamp(12px, 2vw, 16px) clamp(22px, 4vw, 32px);
    font-size: 1rem;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(18px);
    padding: 24px;
    border-radius: 18px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: transform 0.3s ease, background 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.22);
}

.stat-number {
    font-size: clamp(2rem, 4.6vw, 3rem);
    font-weight: 800;
    color: #fff;
    margin-bottom: 6px;
}

.stat-label {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
}

@media (max-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-text {
        text-align: center;
        margin: 0 auto;
    }

    .hero-buttons {
        justify-content: center;
    }
}

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

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-size: 0.85rem;
    font-weight: 600;
    color: #2563eb;
    margin-bottom: 12px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 20px;
}

.section-subtitle {
    font-size: 1.1rem;
    color: #64748b;
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.7;
}

.about-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 20px;
}

.about-card p {
    color: #64748b;
    line-height: 1.6;
}

/* Academics Section */
.academics-section {
    padding: 100px 0;
    background: white;
}

.academics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
}

.academic-card {
    background: linear-gradient(135deg, #f8f9ff 0%, #e3f2fd 100%);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(30, 58, 138, 0.1);
    transition: all 0.3s ease;
}

.academic-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
}

.card-image {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    color: white;
    font-size: 2rem;
}

.academic-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 20px;
}

.academic-card p {
    color: #64748b;
    margin-bottom: 25px;
    line-height: 1.6;
}

.card-features {
    list-style: none;
    padding: 0;
}

.card-features li {
    padding: 8px 0;
    color: #64748b;
    position: relative;
    padding-left: 20px;
}

.card-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #1e3a8a;
    font-weight: bold;
}

/* Features Section */
.features-section {
    padding: 100px 0;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    color: white;
}

.features-section .section-title,
.features-section .section-subtitle,
.features-section .section-eyebrow {
    color: rgba(255, 255, 255, 0.95);
}

.features-section .section-subtitle {
    color: rgba(255, 255, 255, 0.85);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.feature-item {
    text-align: center;
    padding: 40px 20px;
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
    font-size: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.feature-item h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.feature-item p {
    opacity: 0.9;
    line-height: 1.6;
}

/* Contact Section */
.contact-section {
    padding: 100px 0;
    background: #f8f9ff;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 20px;
}

.contact-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.contact-details h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 10px;
}

.contact-details p {
    color: #64748b;
    line-height: 1.6;
}

.contact-form {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(30, 58, 138, 0.1);
}

.contact-form h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.4rem;
    color: #1e3a8a;
}

.contact-form p {
    margin-bottom: 24px;
    color: #475569;
    line-height: 1.5;
}

.contact-form-fields {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.contact-form .form-group label {
    color: #1e3a8a;
    font-weight: 600;
    margin-bottom: 6px;
}

.contact-form .form-group textarea {
    min-height: 140px;
    resize: vertical;
}

@media (max-width: 900px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .contact-form {
        order: -1;
    }
}

@media (max-width: 600px) {
    .contact-form {
        padding: 28px;
    }
}

.form-group {
    margin-bottom: 25px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e3f2fd;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9ff;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1e3a8a;
    background: white;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

/* Footer */
.main-footer {
    background: #1e3a8a;
    color: white;
    padding: 60px 0 20px;
}

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

.footer-section h3,
.footer-section h4 {
    margin-bottom: 20px;
    color: white;
}

.footer-section h3 {
    font-size: 1.5rem;
}

.footer-section h4 {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.footer-logos {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.footer-logos img {
    width: clamp(55px, 7vw, 70px);
    height: auto;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.2));
}

.footer-logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: white;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        flex-direction: column;
        gap: var(--spacing-sm);
        width: 100%;
    }

    .footer-logos {
        justify-content: center;
    }
    
    /* Admin/Teacher/Student Header Mobile Styles */
    .admin-nav .nav-container,
    .teacher-nav .nav-container,
    .student-nav .nav-container {
        height: auto;
        padding: 12px;
        gap: var(--spacing-sm);
        flex-direction: column;
    }
    
    .admin-nav .nav-menu,
    .teacher-nav .nav-menu,
    .student-nav .nav-menu {
        position: fixed;
        top: 75px;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #1e3a8a 0%, #0066CC 50%, #2563eb 100%) !important;
        flex-direction: column;
        align-items: stretch;
        padding: 20px;
        gap: 10px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
        transform: translateY(-100%);
        transition: transform 0.3s ease, opacity 0.3s ease;
        opacity: 0;
        visibility: hidden;
        z-index: 999;
        max-height: calc(100vh - 75px);
        overflow-y: auto;
    }
    
    .admin-nav .nav-menu.active,
    .teacher-nav .nav-menu.active,
    .student-nav .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .admin-nav .nav-link,
    .teacher-nav .nav-link,
    .student-nav .nav-link {
        color: white;
        margin: 4px 0;
        display: block;
        text-align: left;
        width: 100%;
        padding: 12px 16px;
        font-size: 0.95rem;
        border-radius: 8px;
    }
    
    .admin-nav .nav-logo-section,
    .teacher-nav .nav-logo-section,
    .student-nav .nav-logo-section {
        gap: 6px;
    }
    
    .header-logo {
        height: 35px;
        max-width: 35px;
    }
    
    .admin-nav .nav-logo-section .header-logo:not(:first-child),
    .teacher-nav .nav-logo-section .header-logo:not(:first-child),
    .student-nav .nav-logo-section .header-logo:not(:first-child) {
        display: none;
    }
    
    .nav-user-info {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        padding-top: 12px;
        margin-top: 8px;
        border-left: none;
        margin-left: 0;
        padding-left: 0;
    }
    
    .user-name-header {
        display: block;
        text-align: center;
        padding: 8px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        max-width: 100%;
    }
}

@media (max-width: 1200px) {
    .admin-nav .nav-container,
    .teacher-nav .nav-container,
    .student-nav .nav-container {
        padding: 0 25px;
        gap: 15px;
    }
    
    .admin-nav .nav-link,
    .teacher-nav .nav-link,
    .student-nav .nav-link {
        padding: 8px 10px;
        font-size: 0.8rem;
    }
    
    .header-logo {
        height: 45px;
        max-width: 45px;
    }
    
    .user-name-header {
        font-size: 0.75rem;
        max-width: 120px;
    }
}

@media (max-width: 992px) {
    .admin-nav .nav-container,
    .teacher-nav .nav-container,
    .student-nav .nav-container {
        padding: 0 20px;
        gap: 12px;
    }
    
    .admin-nav .nav-link,
    .teacher-nav .nav-link,
    .student-nav .nav-link {
        padding: 7px 9px;
        font-size: 0.75rem;
    }
    
    .header-logo {
        height: 40px;
        max-width: 40px;
    }
    
    .user-name-header {
        display: none;
    }
    
    .nav-user-info {
        border-left: none;
        margin-left: 0;
        padding-left: 0;
        gap: 6px;
    }
}

@media (max-width: 768px) {
    .hero-content {
        text-align: center;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .hero-buttons {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    
    .about-grid,
    .academics-grid,
    .features-grid {
        grid-template-columns: 1fr;
    }
}

/* Login Page Styles */
.login-page {
    overflow: hidden;
}

/* Register Page Styles */
.register-page {
    overflow: hidden;
}

.homepage-background {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    overflow-y: auto;
}

.login-overlay,
.register-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 4vw, 48px);
    min-height: 100vh;
    overflow-y: auto;
}

.login-container,
.register-container {
    width: 100%;
}

.login-container {
    max-width: 960px;
    animation: slideInUp 0.5s ease-out;
}

.register-container {
    max-width: 1100px;
    margin: auto;
    animation: slideInUp 0.5s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card,
.register-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 1fr;
    overflow: hidden;
    text-align: left;
    gap: 0;
}

.register-card {
    border-radius: 20px;
}

.auth-info-panel {
    padding: clamp(24px, 5vw, 48px);
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: clamp(16px, 3vw, 28px);
    justify-content: space-between;
    background: linear-gradient(160deg, #0f172a 0%, #1e3a8a 45%, #2563eb 100%);
}

.login-info-panel {
    background: linear-gradient(160deg, #0f172a 0%, #1e3a8a 40%, #2563eb 100%);
}

.register-info-panel {
    background: linear-gradient(160deg, #0f172a 0%, #2563eb 45%, #0ea5e9 100%);
}

.auth-info-panel h2 {
    font-size: clamp(1.5rem, 2.5vw, 2.1rem);
    margin-bottom: 6px;
    font-weight: 700;
    color: #fff;
}

.auth-info-panel p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.98rem;
}

.brand-logos {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.brand-logos img {
    width: 64px;
    height: auto;
    filter: drop-shadow(0 6px 14px rgba(15, 23, 42, 0.35));
}

.auth-highlights {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-highlights li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.auth-highlights i {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 4px;
}

.auth-highlights span {
    flex: 1;
}

.auth-info-footer {
    font-size: 0.9rem;
    line-height: 1.5;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 12px;
}

.auth-info-footer span {
    font-weight: 600;
}

.auth-form-panel {
    background: rgba(255, 255, 255, 0.98);
    padding: clamp(24px, 4.5vw, 48px);
    display: flex;
    flex-direction: column;
}

.login-header {
    margin-bottom: 24px;
    text-align: left;
}

.register-header {
    margin-bottom: 24px;
    text-align: left;
}

.register-header h1 {
    font-size: 1.9rem;
    margin-bottom: 8px;
}

.register-header p {
    font-size: 0.95rem;
}

.login-logo,
.register-logo {
    margin-bottom: 20px;
}

.login-logo-img,
.register-logo-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #1e3a8a;
    box-shadow: 0 8px 24px rgba(30, 58, 138, 0.3);
}

.login-header h1,
.register-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 10px;
}

.login-header p,
.register-header p {
    color: #64748b;
    font-size: 1rem;
}

.auth-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    font-weight: 700;
    color: #2563eb;
    margin-bottom: 6px;
}

.text-on-dark {
    color: rgba(255, 255, 255, 0.85);
}

.auth-subtitle {
    color: #475569;
    font-size: 0.95rem;
    margin-bottom: 0;
}

.login-form,
.register-form {
    text-align: left;
}

.login-form .form-group {
    margin-bottom: 25px;
}

.register-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #1e3a8a;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.register-form label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #1e3a8a;
    margin-bottom: 8px;
    font-size: 16px;
}

.login-form label i,
.register-form label i {
    font-size: 0.9rem;
    opacity: 0.8;
}

.login-form input,
.login-form select {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e3f2fd;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(248, 249, 255, 0.8);
    backdrop-filter: blur(10px);
}

.register-form input,
.register-form select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e3f2fd;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

.login-form input:focus,
.login-form select:focus {
    outline: none;
    border-color: #1e3a8a;
    background: white;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
    transform: translateY(-2px);
}

.register-form input:focus,
.register-form select:focus {
    outline: none;
    border-color: #2563eb;
    background: white;
    box-shadow: 0 0 4px rgba(37, 99, 235, 0.3);
    transform: translateY(-1px);
}

.login-form input::placeholder,
.register-form input::placeholder {
    color: #94a3b8;
    font-style: italic;
}

.btn-full {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.register-form .btn-full {
    padding: 14px 20px;
    font-size: 18px;
    border-radius: 8px;
    background: linear-gradient(135deg, #1e3a8a 0%, #0066CC 50%, #2563eb 100%);
    color: white;
    font-weight: 600;
    margin-top: 10px;
}

.register-form .btn-full:hover {
    background: linear-gradient(135deg, #0066CC 0%, #2563eb 50%, #3b82f6 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(30, 58, 138, 0.3);
}

.btn-full:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(30, 58, 138, 0.3);
}

.login-footer {
    margin-top: 30px;
    text-align: left;
}

.register-footer {
    margin-top: 20px;
    text-align: left;
}

.register-footer p {
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.register-footer a {
    font-size: 0.85rem;
}

.login-footer p,
.register-footer p {
    color: #64748b;
    margin-bottom: 15px;
}

.login-footer a,
.register-footer a {
    color: #1e3a8a;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.login-footer a:hover,
.register-footer a:hover {
    color: #2563eb;
    text-decoration: underline;
}

.back-home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(30, 58, 138, 0.1);
    border-radius: 8px;
    color: #1e3a8a;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.back-home:hover {
    background: rgba(30, 58, 138, 0.2);
    transform: translateY(-2px);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #dc2626;
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.alert-error i {
    font-size: 1.1rem;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #16a34a;
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.alert-success i {
    font-size: 1.1rem;
}

/* Responsive Login and Register */
@media (max-width: 768px) {
    .login-overlay,
    .register-overlay {
        padding: 20px 16px 32px;
        align-items: flex-start;
    }

    .login-card,
    .register-card {
        grid-template-columns: 1fr;
    }

    .auth-info-panel,
    .auth-form-panel {
        padding: 24px 20px;
    }

    .brand-logos {
        justify-content: center;
    }

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

    .form-row {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .register-form .form-group {
        margin-bottom: 18px;
    }

    .login-footer,
    .register-footer {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .auth-info-panel,
    .auth-form-panel {
        padding: 20px 18px;
    }

    .brand-logos img {
        width: 56px;
    }

    .login-header h1,
    .register-header h1 {
        font-size: 1.6rem;
    }

    .login-form input,
    .login-form select,
    .register-form input,
    .register-form select {
        padding: 12px 16px;
    }

    .btn-full {
        padding: 12px 16px;
        font-size: 1rem;
    }
}

@media (min-width: 900px) {
    .login-card,
    .register-card {
        grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
    }
}

@media (min-width: 1100px) {
    .register-card {
        grid-template-columns: minmax(320px, 0.85fr) minmax(420px, 1.15fr);
    }
}



.mobile-overlay.active {
    display: block;
}

/* Enhanced Card Styles */
.dashboard-section {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(30, 58, 138, 0.1);
    margin-bottom: 30px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.dashboard-section:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.info-section {
    background: linear-gradient(135deg, #f8f9ff 0%, #e3f2fd 100%);
    padding: 25px 30px;
    border-bottom: 1px solid #e3f2fd;
}

.info-section h2 {
    color: #1e3a8a;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: 0.3px;
}

.info-section p {
    color: #64748b;
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

/* Enhanced Form Section */
.form-section {
    background: white;
    padding: 25px 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #e3f2fd;
    margin-bottom: 25px;
    transition: all 0.3s ease;
}

.form-section:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.form-section h2 {
    color: #1e3a8a;
    margin-bottom: 20px;
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Enhanced Table Section */
.table-section {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(30, 58, 138, 0.1);
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

.table-section:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.table-section h2 {
    color: #1e3a8a;
    margin-bottom: 25px;
    font-size: 1.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Enhanced Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(30, 58, 138, 0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1e3a8a, #2563eb);
}


.stat-icon {
    font-size: 1.8rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1976d2;
    border-radius: 0;
    color: white;
}


.stat-content h3 {
    color: #1e3a8a;
    font-size: 2rem;
    margin-bottom: 5px;
    font-weight: 800;
    line-height: 1;
}

.stat-content p {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0;
    font-weight: 500;
}

/* Enhanced spacing and symmetry improvements */
.dashboard-sections {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.section-analytics-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 4px 16px rgba(0, 123, 255, 0.1);
    border: 1px solid #e3f2fd;
    transition: all 0.3s ease;
}

.section-analytics-card:hover {
    box-shadow: 0 6px 24px rgba(0, 123, 255, 0.15);
    transform: translateY(-2px);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e3f2fd;
}

.section-header h3 {
    color: #1976d2;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.section-details {
    padding-top: 10px;
}

/* Real-time Message Modal Styles */
.message-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.message-modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.message-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.message-modal-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    border: 2px solid rgba(30, 58, 138, 0.1);
}

.message-modal.active .message-modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.message-modal-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    color: white;
    padding: 20px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.message-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.message-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 24px;
    line-height: 1;
    padding: 0;
}

.message-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg) scale(1.1);
}

.message-modal-close span {
    display: block;
    font-weight: 300;
}

.message-modal-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #f8f9ff;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #e3f2fd;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #0066CC 0%, #3b82f6 100%);
}

.message-item {
    display: flex;
    gap: 12px;
    animation: messageFadeIn 0.3s ease-in;
    padding: 8px;
    border-radius: 12px;
    transition: background-color 0.2s ease;
}

.message-item:hover {
    background-color: rgba(30, 58, 138, 0.05);
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.2);
}

.message-content {
    flex: 1;
    min-width: 0;
}

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

.message-sender-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.message-sender {
    font-weight: 700;
    color: #1e3a8a;
    font-size: 0.95rem;
}

.message-role {
    font-size: 0.75rem;
    color: #2563eb;
    background: rgba(37, 99, 235, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
    font-weight: 600;
    width: fit-content;
}

.message-student {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
    margin-top: 2px;
}

.message-time {
    font-size: 0.75rem;
    color: #64748b;
    white-space: nowrap;
    cursor: help;
    flex-shrink: 0;
}

.message-subject {
    font-weight: 600;
    color: #2563eb;
    font-size: 0.9rem;
    margin-bottom: 6px;
    padding: 4px 8px;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 6px;
    display: inline-block;
}

.message-text {
    color: #333;
    line-height: 1.5;
    font-size: 0.95rem;
    word-wrap: break-word;
    padding: 10px 15px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e3f2fd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.message-modal-footer {
    padding: 20px 25px;
    background: white;
    border-top: 2px solid #e3f2fd;
}

.message-input-container {
    display: flex;
    gap: 12px;
    align-items: center;
}

.message-input {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid #e3f2fd;
    border-radius: 25px;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
    background: #f8f9ff;
    color: #333;
}

.message-input:focus {
    border-color: #2563eb;
    background: white;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.message-input::placeholder {
    color: #94a3b8;
}

.message-send-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
    white-space: nowrap;
}

.message-send-btn:hover {
    background: linear-gradient(135deg, #0066CC 0%, #3b82f6 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(30, 58, 138, 0.4);
}

.message-send-btn:active {
    transform: translateY(0);
}

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

/* Responsive Design for Message Modal */
@media (max-width: 768px) {
    .message-modal-content {
        width: 95%;
        max-height: 90vh;
        border-radius: 16px;
    }

    .message-modal-header {
        padding: 16px 20px;
    }

    .message-modal-header h2 {
        font-size: 1.3rem;
    }

    .chat-messages {
        padding: 15px;
        gap: 12px;
    }

    .message-modal-footer {
        padding: 15px 20px;
    }

    .message-input-container {
        gap: 10px;
    }

    .message-input {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .message-send-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .message-modal-content {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
        height: 100vh;
    }

    .message-modal-header {
        padding: 14px 18px;
    }

    .message-modal-header h2 {
        font-size: 1.2rem;
    }

    .message-avatar {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }

    .message-text {
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    .message-sender {
        font-size: 0.9rem;
    }

    .message-time {
        font-size: 0.7rem;
    }
}

/* --------------------------------------------------
   Modern UI Refresh - November 2025
-------------------------------------------------- */
:root {
    --primary-700: #0066CC;
    --primary-600: #2563eb;
    --primary-100: #eef2ff;
    --neutral-50: #f8fafc;
    --neutral-100: #f1f5f9;
    --neutral-200: #e2e8f0;
    --slate-700: #1f2937;
    --slate-500: #64748b;
    --border-soft: rgba(148, 163, 184, 0.25);
    --shadow-soft: 0 18px 35px rgba(15, 23, 42, 0.08);
}

.container,
.main-wrapper,
.main-content {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
}

.container,
.main-wrapper {
    padding-left: 48px;
    padding-right: 48px;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.table-section,
.info-section,
.analytics-section,
.form-section,
.dashboard-section,
.card-section {
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid rgba(37, 99, 235, 0.08);
    padding: 28px 32px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 32px;
    position: relative;
}

.table-section > h2,
.info-section > h2,
.analytics-section > h2,
.form-section > h2,
.dashboard-section > h2,
.card-section > h2 {
    font-size: 1.45rem;
    font-weight: 600;
    color: var(--primary-700);
    margin-bottom: 20px;
    padding-bottom: 12px;
    position: relative;
}

.table-section > h2::after,
.info-section > h2::after,
.analytics-section > h2::after,
.form-section > h2::after,
.dashboard-section > h2::after,
.card-section > h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 82px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary-700) 0%, var(--primary-600) 100%);
}

.table-section > p,
.info-section > p,
.analytics-section > p,
.form-section > p,
.dashboard-section > p,
.card-section > p {
    color: var(--slate-500);
    margin-bottom: 18px;
    font-size: 0.96rem;
}

.table-container {
    display: block;
    margin-top: 8px;
    width: 100%;
    max-width: 100%;
    max-height: 420px;
    overflow-x: auto;
    overflow-y: auto;
    background: #0066CC;
    border-radius: 16px;
    border: 1px solid #0066CC;
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.2);
    position: relative;
}

.search-users-table {
    width: 100%;
    min-width: 100%;
}

.table-container::-webkit-scrollbar {
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: var(--neutral-100);
    border-radius: 999px;
}

.table-container::-webkit-scrollbar-thumb {
    background: rgba(37, 99, 235, 0.35);
    border-radius: 999px;
}

.attendance-table {
    width: 100%;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #ffffff;
    font-size: 0.95rem;
}

.attendance-table thead th {
    text-align: center;
    padding: 14px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: white;
    background: #0066CC;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.attendance-table tbody tr {
    transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.attendance-table tbody tr:nth-child(odd) {
    background: #ffffff;
}

.attendance-table tbody tr:nth-child(even) {
    background: var(--neutral-50);
}

.attendance-table tbody tr:hover {
    background: rgba(37, 99, 235, 0.08);
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.08);
}

.attendance-table th,
.attendance-table td {
    padding: 14px 18px;
    color: var(--slate-700);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    text-align: left;
    vertical-align: middle;
}

.attendance-table tbody td:first-child {
    font-weight: 600;
}

.attendance-table tbody tr:last-child td {
    border-bottom: none;
}

.table-section .btn,
.table-container .btn,
.attendance-table .btn {
    margin: 0 4px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    text-decoration: none;
}

.btn-sm {
    padding: 7px 14px;
    font-size: 0.84rem;
    border-radius: 10px;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.btn-primary,
.btn-edit {
    background: linear-gradient(135deg, var(--primary-700) 0%, var(--primary-600) 100%);
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.28);
}

.btn-primary:hover,
.btn-edit:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 14px 28px rgba(30, 64, 175, 0.28);
}

.btn-secondary {
    background: #9ca3af;
    color: #ffffff;
    box-shadow: 0 10px 18px rgba(148, 163, 184, 0.28);
}

.btn-secondary:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 14px 24px rgba(100, 116, 139, 0.3);
}

.btn-delete,
.btn-danger {
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(239, 68, 68, 0.25);
}

.btn-delete:hover,
.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 16px 28px rgba(239, 68, 68, 0.35);
}

.table-section .no-data,
.info-section .no-data,
.analytics-section .no-data {
    padding: 28px;
    background: var(--neutral-50);
    border-radius: 16px;
    border: 1px dashed var(--border-soft);
    text-align: center;
    color: var(--slate-500);
    font-weight: 500;
}

.form-section .form-row {
    gap: 18px;
}

.form-section .form-group {
    margin-bottom: 16px;
}

.form-section .form-group label {
    font-weight: 600;
    color: var(--primary-700);
}

.form-section .form-group input,
.form-section .form-group select,
.form-section .form-group textarea {
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: #ffffff;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.form-section .form-group input:focus,
.form-section .form-group select:focus,
.form-section .form-group textarea:focus {
    border-color: var(--primary-600);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

/* Report-style table containers for teacher views (analytics-like cards) */
.teacher-dashboard .table-container.report-style {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
    border-radius: 20px;
    padding: 24px;
    max-height: none;
    overflow-y: visible;
    overflow-x: auto;
}

.teacher-dashboard .table-container.report-style .attendance-table {
    background: #ffffff;
    width: 100%;
    min-width: 100%;
}

/* ========================================
   UNIFIED TEACHER LAYOUT SYSTEM
   All teacher pages use consistent widths and alignment
   ======================================== */

/* Standard wrapper for all teacher pages */
.teacher-dashboard .teacher-main-wrapper,
.teacher-dashboard .main-wrapper {
    max-width: 1680px;
    width: 100%;
    margin: 0 auto;
    padding: 120px clamp(24px, 4vw, 48px) 60px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Header alignment - spans full wrapper width */
.teacher-dashboard .main-header {
    width: 100%;
    max-width: 100%;
    margin: 0 0 16px 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

/* Admin layout wrapper */
.admin-layout .admin-main-wrapper,
.admin-layout .main-wrapper {
    max-width: 1680px;
    width: 100%;
    margin: 0 auto;
    padding: 120px clamp(24px, 4vw, 48px) 60px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Admin header alignment - spans full wrapper width */
.admin-layout .main-header {
    width: 100%;
    max-width: 100%;
    margin: 0 0 16px 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.teacher-dashboard .header-content {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    min-width: 0;
}

.teacher-dashboard .header-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Search container alignment */
.teacher-dashboard .search-container {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 400px;
    width: 100%;
}

/* Content sections - all use full available width */
.teacher-dashboard .main-content {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.teacher-dashboard .dashboard-section,
.teacher-dashboard .table-section,
.teacher-dashboard .attendance-month-card,
.teacher-dashboard .card-section,
.teacher-dashboard .section-analytics-card,
.admin-layout .dashboard-section,
.admin-layout .table-section,
.admin-layout .attendance-month-card,
.admin-layout .card-section,
.admin-layout .section-analytics-card {
    width: 100%;
    max-width: 100%;
    margin: 0;
    background: #ffffff;
    border-radius: 20px;
    padding: 36px 40px;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.08);
}

/* Tables use full section width */
.teacher-dashboard .table-container {
    width: 100%;
    max-width: 100%;
}

.teacher-dashboard .table-container.report-style {
    width: 100%;
    max-width: 100%;
}

@media (max-width: 1024px) {
    .container,
    .main-wrapper {
        padding-left: 24px;
        padding-right: 24px;
    }

    .table-section,
    .info-section,
    .analytics-section,
    .form-section,
    .dashboard-section,
    .card-section {
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .container,
    .main-wrapper {
        padding-left: 16px;
        padding-right: 16px;
    }

    .table-section,
    .info-section,
    .analytics-section,
    .form-section,
    .dashboard-section,
    .card-section {
        padding: 20px;
        margin-bottom: 24px;
    }

    .attendance-table {
        min-width: 640px;
    }

    .table-section > h2,
    .info-section > h2,
    .analytics-section > h2,
    .form-section > h2,
    .dashboard-section > h2,
    .card-section > h2 {
        font-size: 1.25rem;
    }

    .btn {
        padding: 8px 14px;
        border-radius: 10px;
        font-size: 0.85rem;
    }
}

.student-dashboard {
    padding-top: 110px;
    padding-bottom: 36px;
}

.student-main-content {
    gap: 24px;
}

.student-dashboard .main-content,
.main-content.student-main-content,
.student-main-content {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0;
    min-height: unset;
}

@media (max-width: 768px) {
    .student-dashboard {
        padding-top: 100px;
        padding-bottom: 24px;
    }
}

.dashboard-columns {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.dashboard-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.dashboard-column--left {
    flex: 1 1 340px;
    min-width: 0;
}

.dashboard-column--right {
    flex: 2 1 520px;
    min-width: 0;
}

@media (max-width: 1024px) {
    .dashboard-columns {
        flex-direction: row;
        flex-wrap: wrap;
        overflow: visible;
        padding-bottom: 0;
    }

    .dashboard-column {
        flex: 1 1 320px;
        min-width: 0;
    }
}

.attendance-month-card {
    background: #fff;
    border-radius: 24px;
    padding: 24px 26px 24px;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.18);
    border: 1px solid rgba(148, 163, 184, 0.25);
    max-width: 720px;
    margin-inline: auto;
}

.student-dashboard .attendance-month-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(230, 240, 255, 0.95));
    border: 1px solid rgba(30, 64, 175, 0.15);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.16);
    position: relative;
    overflow: hidden;
}

.student-dashboard .attendance-month-card::before,
.student-dashboard .attendance-month-card::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.15);
    filter: blur(70px);
    z-index: 0;
}

.student-dashboard .attendance-month-card::before {
    width: 260px;
    height: 260px;
    top: -110px;
    right: -60px;
}

.student-dashboard .attendance-month-card::after {
    width: 200px;
    height: 200px;
    bottom: -110px;
    left: -50px;
}

.student-dashboard .attendance-month-card > * {
    position: relative;
    z-index: 1;
}

.student-dashboard .attendance-month-header .brand-title,
.student-dashboard .calendar-nav__current {
    color: #0f172a;
}

.student-dashboard .attendance-month-header .brand-subtitle {
    color: #475569;
}

.student-dashboard .calendar-nav__link {
    color: #1e3a8a;
    border-color: rgba(30, 64, 175, 0.25);
    background: rgba(226, 232, 240, 0.35);
}

.student-dashboard .calendar-nav__link:hover {
    background: rgba(30, 64, 175, 0.1);
    color: #0f172a;
}

.student-dashboard .attendance-legend .legend-item {
    color: #0f172a;
    border-radius: 12px;
    background: rgba(226, 232, 240, 0.6);
    padding: 6px 12px;
}

.student-dashboard .month-calendar-wrapper {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.student-dashboard .month-calendar thead th {
    background: rgba(226, 232, 240, 0.8);
    color: #1e3a8a;
}

.student-dashboard .month-calendar tbody td {
    border-right: 1px solid rgba(226, 232, 240, 0.7);
}

.student-dashboard .calendar-day-trigger {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    color: #0f172a;
}

.student-dashboard .calendar-day-trigger:hover,
.student-dashboard .calendar-day-trigger:focus-visible {
    background: rgba(219, 234, 254, 0.6);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35);
    transform: translateY(-1px);
}

.student-dashboard .calendar-day-trigger.is-outside {
    opacity: 0.35;
}

.student-dashboard .calendar-day-trigger.is-today {
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.5);
}

.student-dashboard .calendar-day-trigger.status-present {
    background: rgba(110, 231, 183, 0.35);
    border-color: rgba(16, 185, 129, 0.35);
    color: #065f46;
}

.student-dashboard .calendar-day-trigger.status-late {
    background: rgba(253, 230, 138, 0.5);
    border-color: rgba(245, 158, 11, 0.4);
    color: #92400e;
}

.student-dashboard .calendar-day-trigger.status-absent {
    background: rgba(254, 202, 202, 0.6);
    border-color: rgba(239, 68, 68, 0.35);
    color: #7f1d1d;
}

.student-dashboard .calendar-day-trigger.status-excused {
    background: rgba(191, 219, 254, 0.6);
    border-color: rgba(59, 130, 246, 0.35);
    color: #1d4ed8;
}

.student-dashboard .calendar-day-trigger.status-holiday {
    background: rgba(254, 215, 170, 0.6);
    border-color: rgba(249, 115, 22, 0.35);
    color: #9a3412;
}

.student-dashboard .calendar-day-trigger.status-noclass,
.student-dashboard .calendar-day-trigger.status-none {
    background: rgba(241, 245, 249, 0.8);
    border-color: rgba(203, 213, 225, 0.6);
    color: #475569;
}

.attendance-month-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 6px 0 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.attendance-month-header .brand-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 220px;
}

.attendance-month-header .brand-title {
    font-size: 1.15rem;
    line-height: 1.3;
    margin: 0;
}

.attendance-month-header .brand-subtitle {
    font-size: 0.85rem;
    margin: 0;
    color: #475569;
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
    margin-bottom: 6px;
}

.calendar-nav__link {
    color: #1e3a8a;
    font-weight: 600;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(30, 64, 175, 0.2);
    transition: background 0.2s ease, color 0.2s ease;
    font-size: 0.82rem;
}

.calendar-nav__link:hover {
    background: rgba(30, 64, 175, 0.1);
    color: #0f172a;
}

.calendar-nav__current {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
}

.month-calendar-wrapper {
    margin-top: 16px;
    overflow-x: auto;
    border-radius: 20px;
    background: #fff;
    padding: 0;
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.month-calendar {
    width: 100%;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.month-calendar thead th {
    text-transform: uppercase;
    font-size: 0.76rem;
    letter-spacing: 0.12em;
    text-align: center;
    padding: 14px 8px;
    color: #1e3a8a;
    background: rgba(226, 232, 240, 0.5);
    border-bottom: 1px solid rgba(148, 163, 184, 0.4);
}

.month-calendar tbody tr {
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.month-calendar tbody tr:last-child {
    border-bottom: none;
}

.month-calendar tbody td {
    padding: 0;
    border-right: 1px solid rgba(148, 163, 184, 0.22);
}

.month-calendar tbody td:last-child {
    border-right: none;
}

.calendar-table-cell {
    padding: 4px;
    vertical-align: middle;
    text-align: center;
}

.calendar-day-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    min-height: 28px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #0f172a;
    cursor: pointer;
    border: none;
    background: transparent;
    border-radius: 6px;
    transition: color 0.2s ease, box-shadow 0.2s ease;
}

.calendar-day-trigger:hover,
.calendar-day-trigger:focus-visible {
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
    outline: none;
}

.calendar-day-trigger.is-today {
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35);
}

.calendar-day-trigger.is-outside {
    opacity: 0.35;
}

.calendar-day-trigger.is-weekend {
    text-decoration: underline;
}

.calendar-day-trigger.status-present,
.calendar-day-trigger.status-absent,
.calendar-day-trigger.status-late,
.calendar-day-trigger.status-excused,
.calendar-day-trigger.status-holiday,
.calendar-day-trigger.status-noclass,
.calendar-day-trigger.status-none {
    background: transparent;
    color: inherit;
}

.calendar-day-number {
    font-size: 0.95rem;
}

.attendance-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.legend-item {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(226, 232, 240, 0.7);
    color: #1e293b;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.25);
}

.legend-item--present { background: rgba(34, 197, 94, 0.22); color: #047857; }
.legend-item--late    { background: rgba(253, 224, 71, 0.24); color: #92400e; }
.legend-item--absent  { background: rgba(239, 68, 68, 0.24); color: #b91c1c; }
.legend-item--excused { background: rgba(96, 165, 250, 0.26); color: #1d4ed8; }
.legend-item--noclass { background: rgba(148, 163, 184, 0.3); color: #475569; }

.calendar-day-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    color: #0f172a;
    font-weight: 600;
}

.calendar-day-number {
    font-size: 1rem;
}

.calendar-day-name {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
}

.calendar-status-line {
    display: flex;
}

.calendar-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

.calendar-status--present { background: rgba(34, 197, 94, 0.18); color: #047857; }
.calendar-status--late    { background: rgba(253, 224, 71, 0.22); color: #92400e; }
.calendar-status--absent  { background: rgba(239, 68, 68, 0.22); color: #b91c1c; }
.calendar-status--excused { background: rgba(96, 165, 250, 0.24); color: #1d4ed8; }
.calendar-status--noclass { background: rgba(148, 163, 184, 0.24); color: #475569; }
.calendar-status--none    { background: rgba(226, 232, 240, 0.6); color: #475569; }

.calendar-times {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.75rem;
    color: #475569;
}

.calendar-status--present::before { content: '🟢'; margin-right: 6px; }
.calendar-status--late::before { content: '🟡'; margin-right: 6px; }
.calendar-status--absent::before { content: '🔴'; margin-right: 6px; }
.calendar-status--excused::before { content: '🔵'; margin-right: 6px; }
.calendar-status--noclass::before { content: '⚪'; margin-right: 6px; }
.calendar-status--none::before { content: '•'; margin-right: 6px; color: #64748b; }

.legend-item--holiday { background: rgba(249, 115, 22, 0.24); color: #b45309; }

.calendar-status--holiday { background: rgba(249, 115, 22, 0.22); color: #b45309; }
.calendar-status--holiday::before { content: '🟠'; margin-right: 6px; }

.calendar-modal-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.calendar-modal-status {
    font-weight: 600;
    font-size: 1.05rem;
}

.calendar-modal-status.status-present { color: #047857; }
.calendar-modal-status.status-absent { color: #b91c1c; }
.calendar-modal-status.status-late { color: #92400e; }
.calendar-modal-status.status-excused { color: #1d4ed8; }
.calendar-modal-status.status-holiday { color: #b45309; }
.calendar-modal-status.status-noclass,
.calendar-modal-status.status-none { color: #475569; }

.calendar-modal-notes {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.calendar-modal-notes li {
    background: #f1f5f9;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.95rem;
    color: #0f172a;
}
    gap: 12px;
}

.teacher-dashboard .search-container .search-input {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid rgba(30, 64, 175, 0.25);
    font-size: 0.95rem;
}

.teacher-dashboard .search-container .search-btn {
    padding: 12px 22px;
    border-radius: 14px;
}

.teacher-dashboard .attendance-month-card,
.teacher-dashboard .dashboard-section,
.teacher-dashboard .table-section {
    width: 100%;
    padding: 36px 40px;
    border-radius: 20px;
    box-shadow: 0 24px 48px rgba(30, 58, 138, 0.12);
}

.teacher-dashboard .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.teacher-dashboard .stat-card {
    padding: 28px 30px;
    border-radius: 20px;
    gap: 18px;
}

.teacher-dashboard .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    font-size: 1.6rem;
}

.teacher-dashboard .stat-content h3 {
    font-size: 2rem;
}

.teacher-dashboard .stat-content p {
    font-size: 0.95rem;
}

.teacher-dashboard .table-container {
    border-radius: 20px;
    border: 1px solid #0066CC;
    background: #0066CC;
    box-shadow: 0 18px 36px rgba(30, 64, 175, 0.2);
}

.teacher-dashboard .attendance-table {
    min-width: 100%;
}

.teacher-dashboard .attendance-table th,
.teacher-dashboard .attendance-table td {
    padding: 18px 22px;
    font-size: 0.95rem;
}

.teacher-dashboard .attendance-table th {
    font-size: 0.85rem;
}

@media (max-width: 1024px) {
    .teacher-dashboard .teacher-main-wrapper {
        padding: 160px 60px 72px;
    }
}

@media (max-width: 768px) {
    .teacher-dashboard .teacher-main-wrapper {
        padding: 150px 40px 60px;
        gap: 32px;
    }

    .teacher-dashboard .main-header {
        /* Removed flex-direction: column to maintain horizontal layout */
        align-items: flex-start;
        gap: 16px;
    }

    .teacher-dashboard .header-actions {
        /* Removed width: 100% to maintain flex layout */
        justify-content: flex-start;
    }

    .teacher-dashboard .search-container {
        /* Removed width: 100% to allow flexible sizing */
    }

    .teacher-dashboard .search-container .search-input {
        /* Removed width: 100% to allow flex sizing */
    }

    .teacher-dashboard .attendance-month-card,
    .teacher-dashboard .dashboard-section,
    .teacher-dashboard .table-section {
        padding: 28px;
    }
}

/* Dashboard Full-Width Layout */
.teacher-dashboard .teacher-main-wrapper,
.admin-layout .admin-main-wrapper,
.student-dashboard {
    margin: 0 auto;
    width: 100%;
    max-width: 1680px;
    padding: 180px 80px 96px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 48px;
}

/* Responsive padding adjustments */
@media (max-width: 1024px) {
    .teacher-dashboard .main-header,
    .admin-layout .main-header {
        padding: 0 0 12px 0;
    }
}

@media (max-width: 768px) {
    .teacher-dashboard .main-header,
    .admin-layout .main-header {
        padding: 0 0 12px 0;
    }
}

.teacher-dashboard .header-content,
.admin-layout .header-content {
    /* Removed flex-direction: column to allow horizontal layout */
}

.teacher-dashboard .header-actions,
.admin-layout .header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.teacher-dashboard .search-container,
.admin-layout .search-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.teacher-dashboard .search-container .search-input,
.admin-layout .search-container .search-input {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid rgba(30, 64, 175, 0.25);
    font-size: 0.95rem;
}

.teacher-dashboard .search-container .search-btn,
.admin-layout .search-container .search-btn {
    flex-shrink: 0;
    padding: 12px 22px;
    border-radius: 14px;
    white-space: nowrap;
}

.teacher-dashboard .attendance-month-card,
.teacher-dashboard .dashboard-section,
.teacher-dashboard .table-section,
.admin-layout .attendance-month-card,
.admin-layout .dashboard-section,
.admin-layout .table-section,
.student-dashboard .dashboard-section,
.student-dashboard .table-section,
.student-dashboard .attendance-month-card {
    width: 100%;
    padding: 36px 40px;
    border-radius: 20px;
    box-shadow: 0 24px 48px rgba(30, 58, 138, 0.12);
    border: 1px solid rgba(30, 58, 138, 0.12);
    background: #ffffff;
}

.teacher-dashboard .stats-grid,
.admin-layout .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.student-dashboard .stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 30px;
    max-width: 760px;
    margin-inline: auto;
}

.teacher-dashboard .stat-card,
.admin-layout .stat-card,
.student-dashboard .header,
.student-dashboard #overview-section {
    max-width: 720px;
    margin-inline: auto;
    margin-bottom: 18px;
}

.student-dashboard #overview-section {
    width: 100%;
}
.student-dashboard .attendance-month-card {
    background: transparent;
    border: none;
    box-shadow: none;
    max-width: 760px;
}
.student-dashboard .stat-card {
    background: transparent;
    border: 1px solid rgba(30, 58, 138, 0.3);
    box-shadow: none;
}

.student-dashboard .stat-card::before {
    display: none;
}

.student-dashboard .table-container {
    background: transparent;
    border: 1px solid rgba(0, 102, 204, 0.35);
    box-shadow: none;
}

.student-dashboard .attendance-table {
    background: transparent;
    box-shadow: none;
}

.student-dashboard .attendance-table tbody tr,
.student-dashboard .attendance-table tbody tr:nth-child(even),
.student-dashboard .attendance-table tbody tr:hover {
    background-color: transparent;
}

.teacher-dashboard .stat-card::before,
.admin-layout .stat-card::before,
.student-dashboard .stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1e3a8a, #2563eb);
}

.teacher-dashboard .stat-icon,
.admin-layout .stat-icon,
.student-dashboard .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(30, 64, 175, 0.12);
}

.teacher-dashboard .stat-content h3,
.admin-layout .stat-content h3,
.student-dashboard .stat-content h3 {
    font-size: 2rem;
    margin: 0;
    color: #0f172a;
}

.teacher-dashboard .stat-content p,
.admin-layout .stat-content p,
.student-dashboard .stat-content p {
    margin: 6px 0 0 0;
    font-size: 0.95rem;
    color: #475569;
}

.teacher-dashboard .table-container,
.admin-layout .table-container,
.student-dashboard .table-container {
    width: 100%;
    max-width: 100%;
    border-radius: 22px;
    border: 1px solid #0066CC;
    background: #0066CC;
    box-shadow: 0 18px 36px rgba(30, 64, 175, 0.2);
    overflow-x: auto;
    overflow-y: auto;
    max-height: 420px;
    scrollbar-color: rgba(15, 23, 42, 0.45) rgba(148, 163, 184, 0.2);
}

.teacher-dashboard .attendance-table,
.admin-layout .attendance-table,
.student-dashboard .attendance-table {
    min-width: 100%;
    border-collapse: collapse;
    background: white;
}

@media (min-width: 1200px) {
    .attendance-table,
    .teacher-dashboard .attendance-table,
    .admin-layout .attendance-table,
    .student-dashboard .attendance-table,
    .search-users-table {
        min-width: 1200px;
    }
}

.teacher-dashboard .attendance-table th,
.admin-layout .attendance-table th,
.student-dashboard .attendance-table th,
.teacher-dashboard .attendance-table td,
.admin-layout .attendance-table td,
.student-dashboard .attendance-table td {
    padding: 18px 22px;
    font-size: 0.95rem;
    text-align: left;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.teacher-dashboard .attendance-table th,
.admin-layout .attendance-table th,
.student-dashboard .attendance-table th {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: white;
    background: #0066CC;
}

.student-main-content {
    display: flex;
    flex-direction: column;
    gap: 48px;
}

@media (max-width: 1024px) {
    .teacher-dashboard .teacher-main-wrapper,
    .admin-layout .admin-main-wrapper,
    .student-dashboard {
        padding: 120px 40px 56px;
    }
}

@media (max-width: 768px) {
    .teacher-dashboard .teacher-main-wrapper,
    .admin-layout .admin-main-wrapper,
    .student-dashboard {
        padding: 110px 28px 48px;
        gap: 24px;
    }

    .teacher-dashboard .main-header,
    .admin-layout .main-header {
        /* Removed flex-direction: column to maintain horizontal layout */
        align-items: flex-start;
        gap: 16px;
    }

    .teacher-dashboard .header-actions,
    .admin-layout .header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .teacher-dashboard .search-container,
    .admin-layout .search-container {
        /* Removed width: 100% to allow flexible sizing */
    }

    .teacher-dashboard .search-container .search-input,
    .admin-layout .search-container .search-input {
        /* Removed width: 100% to allow flex sizing */
    }

    .teacher-dashboard .attendance-month-card,
    .teacher-dashboard .dashboard-section,
    .teacher-dashboard .table-section,
    .admin-layout .attendance-month-card,
    .admin-layout .dashboard-section,
    .admin-layout .table-section,
    .student-dashboard .dashboard-section,
    .student-dashboard .table-section,
    .student-dashboard .attendance-month-card {
        padding: 28px;
    }

    .student-dashboard .stats-grid {
        gap: 24px;
    }

    .student-dashboard .stat-card {
        padding: 30px 32px;
    }

    .student-dashboard .attendance-table th,
    .student-dashboard .attendance-table td {
        padding: 18px 22px;
    }

    .teacher-dashboard .table-container::-webkit-scrollbar,
    .admin-layout .table-container::-webkit-scrollbar,
    .student-dashboard .table-container::-webkit-scrollbar {
        height: 8px;
        width: 8px;
    }

    .teacher-dashboard .table-container::-webkit-scrollbar-thumb,
    .admin-layout .table-container::-webkit-scrollbar-thumb,
    .student-dashboard .table-container::-webkit-scrollbar-thumb {
        background: rgba(15, 23, 42, 0.35);
        border-radius: 20px;
    }

    .admin-layout .attendance-table {
        width: 100%;
        min-width: 960px;
        font-size: 0.94rem;
    }

    .admin-layout .attendance-table th,
    .admin-layout .attendance-table td {
        padding: 16px 18px;
    }

    @media (max-width: 640px) {
        .teacher-dashboard .table-container,
        .admin-layout .table-container,
        .student-dashboard .table-container {
            padding-bottom: 10px;
            border-radius: 18px;
            box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
            overflow-x: auto;
            overflow-y: auto;
            max-height: 350px;
        }

        .admin-layout .attendance-table {
            min-width: 720px;
            font-size: 0.9rem;
        }

        .admin-layout .attendance-table th,
        .admin-layout .attendance-table td {
            padding: 12px;
            white-space: nowrap;
        }
    }

    .student-dashboard .month-calendar-wrapper {
        border-radius: 20px;
        padding: 12px;
    }

    .student-dashboard .month-calendar {
        min-width: 100%;
    }
}

.teacher-dashboard .teacher-main-wrapper,
.teacher-dashboard .main-wrapper,
.admin-layout .admin-main-wrapper,
.admin-layout .main-wrapper,
.student-dashboard {
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 1680px;
    padding: 96px 48px 64px !important;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.admin-layout .student-main-content,
.admin-layout.student-dashboard .main-wrapper {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 130px clamp(24px, 4.8vw, 48px) 70px;
    gap: 36px;
}

.admin-layout .dashboard-section,
.admin-layout .table-section,
.admin-layout .attendance-month-card,
.admin-layout .card-section {
    max-width: 1320px;
    margin: 0 auto;
    width: 100%;
    border-radius: 26px;
    padding: clamp(24px, 3.5vw, 36px);
    box-shadow: 0 22px 42px rgba(15, 23, 42, 0.08);
}

@media (max-width: 600px) {
    .student-dashboard {
        padding: 96px 14px 32px !important;
        gap: 24px !important;
    }

    .student-main-content {
        width: 100%;
        gap: 24px;
    }

    .student-dashboard #overview-section .stats-grid,
    .teacher-dashboard #overview-section .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .student-dashboard #overview-section .stats-grid .stat-card:last-child:nth-child(odd),
    .teacher-dashboard #overview-section .stats-grid .stat-card:last-child:nth-child(odd) {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .student-dashboard .stat-card {
        width: 100%;
        padding: 18px;
        border-radius: 16px;
    }

    .student-dashboard .stat-icon {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
    }

    .student-dashboard .stat-content h3 {
        font-size: 1.4rem;
    }

    .student-dashboard .dashboard-section,
    .student-dashboard .card-section,
    .student-dashboard .attendance-month-card,
    .student-dashboard .table-section {
        padding: 20px;
        border-radius: 16px;
    }

    .student-dashboard .table-container {
        width: 100%;
        max-width: 100%;
        border-radius: 14px;
    }

    .student-dashboard .attendance-table {
        min-width: 100%;
        font-size: 0.85rem;
    }

    .student-dashboard .attendance-table th,
    .student-dashboard .attendance-table td {
        padding: 12px 10px;
    }

    .student-nav .nav-container {
        width: 100%;
        padding: 8px 12px;
        align-items: stretch;
        gap: 10px;
    }
}

    /* Teacher dashboard responsive layout - maintains alignment */
    .teacher-dashboard .main-header {
        width: 100%;
        max-width: 100%;
        /* Removed flex-direction: column to maintain horizontal layout */
        align-items: flex-start;
        gap: 16px;
    }

    .teacher-dashboard .header-actions {
        /* Removed width: 100% to maintain flex layout */
        justify-content: flex-start;
    }

    .teacher-dashboard .search-container {
        width: 100%;
        display: flex;
        gap: 12px;
    }

    .teacher-dashboard .search-container .search-input {
        flex: 1;
        min-width: 0;
    }

    .teacher-dashboard .search-container .search-btn {
        flex-shrink: 0;
    }

   
    .teacher-dashboard .main-content {
        display: flex;
        flex-direction: column;
        gap: 28px;
        width: 100%;
        max-width: 100%;
    }

    .teacher-dashboard #overview-section,
    .teacher-dashboard .dashboard-section,
    .teacher-dashboard .table-section,
    .teacher-dashboard .attendance-month-card,
    .teacher-dashboard .section-analytics-card {
        width: 100%;
        max-width: 100%;
        padding: clamp(20px, 4vw, 28px);
    }

    .teacher-dashboard .dashboard-section .form-section {
        background: transparent;
        box-shadow: none;
        border: none;
        padding: 0;
        margin-bottom: 18px;
    }

    .teacher-dashboard #overview-section .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
        max-width: 640px;
        margin: 12px auto 0;
    }

    .teacher-dashboard #overview-section .stat-card {
        padding: 14px 16px;
        border-radius: 20px;
        min-height: 115px;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(219, 234, 254, 0.85));
        border: 1px solid rgba(59, 130, 246, 0.25);
        box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
        position: relative;
        overflow: hidden;
    }

    .teacher-dashboard #overview-section .stat-card::before {
        content: '';
        position: absolute;
        width: 140px;
        height: 140px;
        top: -70px;
        right: -40px;
        background: radial-gradient(circle, rgba(37, 99, 235, 0.25), transparent 70%);
    }

    .teacher-dashboard #overview-section .stat-icon {
        width: 38px;
        height: 38px;
        font-size: 1.25rem;
        border-radius: 10px;
        background: linear-gradient(135deg, #1d4ed8, #3b82f6);
        box-shadow: 0 10px 20px rgba(37, 99, 235, 0.25);
    }

    .teacher-dashboard #overview-section .stat-content h3 {
        font-size: 1.2rem;
        color: #0f172a;
    }

    .teacher-dashboard #overview-section .stat-content p {
        font-size: 0.8rem;
        color: #475569;
    }

    .teacher-dashboard .table-container {
        background: linear-gradient(135deg, #053266, #0f4fb8);
        border: none;
        padding: 3px;
        border-radius: 20px;
        width: 100%;
        max-width: 100%;
        margin: 0 0 var(--spacing-md);
        box-shadow: 0 6px 20px rgba(15, 23, 42, 0.18);
    }

    .teacher-dashboard .table-container .attendance-table {
        border-radius: 16px;
        overflow: hidden;
        box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
    }

    .teacher-dashboard .attendance-month-card {
        position: relative;
        overflow: hidden;
    }

    .teacher-dashboard .attendance-month-card::before,
    .teacher-dashboard .attendance-month-card::after {
        content: '';
        position: absolute;
        border-radius: 50%;
        background: rgba(37, 99, 235, 0.12);
        filter: blur(70px);
        z-index: 0;
    }

    .teacher-dashboard .attendance-month-card::before {
        width: 240px;
        height: 240px;
        top: -110px;
        right: -60px;
    }

    .teacher-dashboard .attendance-month-card::after {
        width: 180px;
        height: 180px;
        bottom: -90px;
        left: -40px;
    }

    .teacher-dashboard .attendance-month-card > * {
        position: relative;
        z-index: 1;
    }

    @media (max-width: 900px) {
        .teacher-dashboard #overview-section .stats-grid {
            grid-template-columns: 1fr;
        }
    }

    @media (max-width: 768px) {
        .teacher-dashboard .teacher-main-wrapper {
            padding: 110px clamp(16px, 4vw, 24px) 36px;
            gap: 24px;
        }

        .teacher-dashboard .main-header,
        .teacher-dashboard #overview-section,
        .teacher-dashboard .dashboard-section,
        .teacher-dashboard .table-section,
        .teacher-dashboard .attendance-month-card,
        .teacher-dashboard .section-analytics-card {
            padding: 20px;
            width: 100%;
            max-width: 100%;
        }

        .teacher-dashboard .search-container {
            /* Removed flex-direction: column to keep search horizontal */
        }

        .teacher-dashboard .table-container {
            width: 100%;
            max-width: 100%;
        }
    }

/* Mobile responsive adjustments for teacher dashboard headers */
@media (max-width: 768px) {
    .teacher-dashboard .main-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 16px;
        flex-wrap: wrap;
    }

    .teacher-dashboard .header-content {
        flex: 1 1 auto;
        min-width: 0;
    }

    .teacher-dashboard .header-actions {
        flex: 0 0 auto;
        min-width: 200px;
    }

    .teacher-dashboard .search-container {
        width: 100%;
        max-width: 280px;
    }

    .teacher-dashboard .search-container input {
        flex: 1;
        min-width: 150px;
        max-width: 200px;
    }
}