/* Read-only form fields */
.readonly {
    background-color: #f5f5f5;
}
/* Attendance punctuality buttons: visually indicate disabled state */
.profile-section .btn:disabled {
    opacity: 0.5;
    filter: grayscale(30%);
    cursor: not-allowed;
}

.profile-section .btn:not(:disabled) {
    opacity: 1;
    filter: none;
}
/* Global reset - removes default browser margins/padding and sets box-sizing for consistent sizing across all elements */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Main body styling - sets font stack, gradient background, full height, and padding for all pages */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

/* Main container wrapper - centers content, sets max width, white background with rounded corners and shadow for all main content areas */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
}

/* Header section styling - blue gradient background with white text, centered content for page headers */
.header {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
    padding: 20px;
    text-align: center;
}

/* Fixed breadcrumb navigation - positioned at top of screen with blur effect, shows current page location and navigation path */
.breadcrumb {
    padding: 5px 7px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(248, 249, 250, 0.95);
}

/* Individual breadcrumb lines - flex layout for breadcrumb items with proper spacing */
.breadcrumb-line {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

/* Remove bottom margin from last breadcrumb line */
.breadcrumb-line:last-child {
    margin-bottom: 0;
}

/* Student tabs container - fixed position tabs for switching between multiple students during assessment, appears above breadcrumb */
.student-tabs-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 8px 20px;
    z-index: 110;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Individual student tab - clickable tab for each student with hover effects and active state styling */
.student-tab {
    padding: 5px;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #6c757d;
    min-width: fit-content;
}

/* Student tab hover state - light gray background on hover */
.student-tab:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

/* Active student tab - blue background with white text and bold font weight */
.student-tab.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
    font-weight: 600;
}

/* Adjust breadcrumb position when student tabs are visible - moves breadcrumb down to avoid overlap */
.breadcrumb-visible .breadcrumb {
    top: 50px; /* Move down to accommodate student tabs when visible */
}

/* Add top margin to main content when both breadcrumb and student tabs are visible */
.breadcrumb-visible .student-main-tabs,
.breadcrumb-visible .content {
    margin-top: 80px;
}

/* Positioning adjustments when only student tabs are visible (no breadcrumb) */
.student-tabs-visible .breadcrumb {
    top: 45px;
}

/* Push main tabs below student tabs when student tabs are visible */
.student-tabs-visible .student-main-tabs {
    margin-top:93px; /* Push below breadcrumb */
}

/* Reset content margin when student tabs are visible */
.student-tabs-visible .content {
    margin-top: 0px; /* Adjust for student tabs + breadcrumb */
}

/* Individual breadcrumb items - clickable navigation items with hover effects */
.breadcrumb-item {
    color: #6c757d;
    cursor: pointer;
    font-size: 14px;
    transition: color 0.2s ease;
}

/* Active breadcrumb item - blue color and bold font weight for current page */
.breadcrumb-item.active {
    color: #3498db;
    font-weight: 600;
}

/* Breadcrumb separator - adds arrow between breadcrumb items (not after last item) */
.breadcrumb-item:not(:last-child)::after {
    content: " › ";
    margin: 0 8px;
    color: #adb5bd;
}

/* Header title styling - large font size with bottom margin for page titles */
.header h1 {
    margin-bottom: 10px;
    font-size: 2em;
}

/* Main navigation tabs container - horizontal flex layout with light gray background and bottom border */
.nav-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

/* Individual navigation tab - equal width tabs with padding, no background, cursor pointer and smooth transitions */
.nav-tab {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

/* Active navigation tab - white background, blue bottom border, blue text color and bold font weight */
.nav-tab.active {
    background: white;
    border-bottom: 3px solid #3498db;
    color: #3498db;
    font-weight: bold;
}

/* Navigation tab hover state - light gray background on hover */
.nav-tab:hover {
    background: #e9ecef;
}

/* Main content area - padding around content with minimum height to prevent layout collapse */
.content {
    padding: 20px;
    min-height: 500px;
}

/* Student registration page - extra bottom padding to allow student cards to scroll above the testing/assessment box */
#studentRegister {
    padding-bottom: 400px; /* Add space at bottom so student cards can scroll above testing box */
}

/* Landing shell and landing content (full viewport, separate from app shell) */
#landingShell {
    max-width: none;
}

/* Blue fill under/around .dashboard so purple only shows as edge frame (body padding) */
#dashboardShell {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    min-height: calc(100vh - 40px); /* body padding 20px top + 20px bottom */
}

#landing {
    margin: 0; /* no container offset */
    padding: 0;
}

/* Landing page main content - full height flex column layout with centered content, blue gradient background and white text */
/* Login page - blue gradient */
.landing-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: calc(100vh - 40px); /* fallback: leave room for body 20px top+bottom padding so purple edge shows */
    min-height: calc(100dvh - 40px); /* modern viewport unit to avoid iOS toolbars */
    text-align: center;
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    width: 100%;
    margin: 0;
    padding: 20px 20px 40px 20px;
}

/* Landing page main title - large font size with top and bottom margins for prominent heading */
.landing-content h1 {
    font-size: 2.5rem;
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: 600;
}

/* Landing page description text - medium font size with large bottom margin and slight transparency */
.landing-content p {
    font-size: 1.2rem;
    margin-bottom: 60px;
    opacity: 0.9;
}

/* Landing page button container - vertical flex layout with gap between buttons and top margin */
.landing-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: -10px;
}

/* Landing page button base styling - large padding, medium font size, rounded corners, no border, cursor pointer with smooth transitions */
.landing-btn {
    padding: 20px 40px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}

/* All landing buttons use the same purple gradient styling */

/* Disable hover effects on touch devices */
@media (hover: none) and (pointer: coarse) {
    .landing-btn:hover {
        transform: none;
        box-shadow: none;
    }
}

/* Exit button styling - red gradient background with white text, overrides other styles */
.exit-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b) !important;
    color: white !important;
}

/* Exit button hover state - darker red gradient with upward movement and red shadow */
.exit-btn:hover {
    background: linear-gradient(135deg, #c0392b, #a93226) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(231, 76, 60, 0.3);
}

/* Disable hover effects on touch devices */
@media (hover: none) and (pointer: coarse) {
    .exit-btn:hover {
        background: linear-gradient(135deg, #e74c3c, #c0392b) !important;
        transform: none;
        box-shadow: none;
    }
}

/* Exit button active state - reset hover effects when clicked */
.exit-btn:active,
.exit-btn:focus {
    background: linear-gradient(135deg, #e74c3c, #c0392b) !important;
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.2);
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

/* Tab content containers - hidden by default, only show when active class is applied */
.tab-content {
    display: none;
}

/* Active tab content - displays the content of the currently selected tab */
.tab-content.active {
    display: block;
}

/* Tab buttons */
.tab-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: #e9ecef;
    color: #333;
}

.tab-btn.active {
    background: white;
    color: #2c3e50;
    font-weight: 600;
    border-color: #ddd;
    border-bottom-color: white;
    position: relative;
    z-index: 1;
}

.tab-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Student cards grid layout - responsive grid that fits cards with minimum 300px width, 10px gap between cards */
.student-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 10px;
    margin-top: 20px;
}

.stream-group-header {
    grid-column: 1 / -1;
    padding: 5px 16px;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    margin-top: 10px;
    font-weight: 600;
    font-size: 16px;
    color: #495057;
}

/* Individual student card - blue gradient background, rounded corners, shadow, hover transform effect, fixed height with centered content */
.student-card {
    background: linear-gradient(135deg, #3498db, #2980b9);
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    cursor: pointer;
    height: 50px;
    display: flex;
    align-items: center;
}

/* Student selection checkboxes - consistent 18x18px sizing for checkboxes in student registration cards */
.student-card input.student-select {
    margin-top: 8px;
    width: 18px;
    height: 18px;
}

/* Enrolment Form Styles */
.form-section {
    background: #f8f9fa;
    /*border: 1px solid #e9ecef;*/
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 4px solid #939393;
    border-top: 1px solid #939393;
    padding: 10px 10px 1px 10px;
    margin-bottom: 20px;
}

.form-section h4 {
    color: #495057;
    margin: 0 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #dee2e6;
    font-size: 16px;
    font-weight: 600;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

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

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: 0;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Global CSS: Remove all focus indicators from readonly/view-only fields - make them 'inactive' and not focusable */
/* Applies to: readonly attributes, readonly class, and disabled fields (used for role-based view-only) */
input[readonly]:focus,
input[readonly]:active,
textarea[readonly]:focus,
textarea[readonly]:active,
input[disabled]:focus,
input[disabled]:active,
select[disabled]:focus,
select[disabled]:active,
textarea[disabled]:focus,
textarea[disabled]:active,
input.readonly:focus,
input.readonly:active,
textarea.readonly:focus,
textarea.readonly:active,
.readonly:focus,
.readonly:active {
    outline: none !important;
    outline-width: 0 !important;
    border-color: #ced4da !important;
    box-shadow: none !important;
    border: 1px solid #ced4da !important;
    background-color: #f5f5f5 !important;
    cursor: default !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

/* Helper text styles for form field descriptions */
.helper-text {
    display: block;
    margin-top: 4px;
    color: #9ca3af;
    font-size: 0.8rem;
    font-style: italic;
}

/* Custom placeholder styling for <input> fields*/
::placeholder {
    color: #9ca3af;
    font-size: 0.9rem;
    font-style: italic;
    opacity: 1; /* Override browser default opacity */
}

/* Select option placeholder styling */
.placeholder-option {
    color: #9ca3af;
    font-style: italic;
    font-size: 0.9rem;
}

/* Style placeholder options (empty value) in select dropdowns */
select option[value=""] {
    color: #9ca3af;
    font-style: italic;
    font-size: 0.9rem;
}

/* When a placeholder option is selected, style the select element */
select.placeholder-selected {
    color: #9ca3af;
    font-style: italic;
}

/* Normal selected text (default) */
select {
    color: #212529; /* Normal text color (black/dark) */
    font-style: normal;
}

/* Webkit browsers (Chrome, Safari, Edge) */
::-webkit-input-placeholder {
    color: #9ca3af;
    font-size: 0.9rem;
    font-style: italic;
    opacity: 1;
}

/* Firefox */
::-moz-placeholder {
    color: #9ca3af;
    font-size: 0.9rem;
    font-style: italic;
    opacity: 1;
}

/* Firefox 19+ */
::-moz-placeholder {
    color: #9ca3af;
    font-size: 0.9rem;
    font-style: italic;
    opacity: 1;
}

/* IE 10+ */
:-ms-input-placeholder {
    color: #9ca3af;
    font-size: 0.9rem;
    font-style: italic;
    opacity: 1;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

#subjectSelection {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 15px;
    min-height: 100px;
}

.subject-checkbox {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
}

.subject-checkbox input[type="checkbox"] {
    margin-right: 10px;
    width: 16px;
    height: 16px;
}

.subject-checkbox label {
    margin: 0;
    font-weight: normal;
    cursor: pointer;
    flex: 1;
}


/* Student profile section containers - light gray background, rounded corners, padding, shadow and bottom margin for profile information display */
.profile-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

/* Student information row - horizontal flex layout with centered items and bottom margin for student details display */
.student-info {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

/* Student avatar circle - circular white background with blue text, centered content, used for student initials or profile pictures */
.student-avatar {
    width: 30px;
    height: 3cqi;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3498db;
    font-size: 16px;
    font-weight: bold;
    margin-right: 10px;
}

/* Student details container - allows text to wrap and expand */
.student-details {
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Student name heading - white text with small bottom margin and medium font size */
.student-details h3 {
    margin-top: 4px;
    margin-bottom: 0px;
    color: white;
    font-size: 16px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Student detail text - semi-transparent white text with small font size and minimal margins */
.student-details p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    margin: 2px 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Assessment form container - white background with rounded corners, padding, and light gray border for form sections */
.assessment-form {
    background: white;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e9ecef;
}

/* Form row layout - horizontal flex layout with vertically centered items, consistent spacing and bottom margin for form field rows */
.form-row {
    display: flex;
    align-items: center; /* Center items vertically */
    margin-bottom: 15px;
    padding: 10px 0;
    gap: 10px; /* Consistent spacing between elements */
}

/* Form row labels - medium font weight, dark gray color, flex layout with centered alignment and minimum width for consistency */
.form-row label {
    font-weight: 500;
    color: #495057;
    display: flex;
    align-items: center; /* Center label text vertically */
    min-width: 120px; /* Ensure consistent label width */
}

/* Form row inputs and selects - fixed width, padding, light gray border, rounded corners and medium font size for form controls */
.form-row input, .form-row select {
    width: 120px;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
}

/* Date and time input fields - fallback styles for inputs without classes */
/* Note: Use .date-input and .time-input classes instead of inline styles */
input[type="date"],
input[type="time"] {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
}

/* Form-row date inputs - wider width for date picker display */
.form-row input[type="date"] {
    width: 180px;
}

/* CSS Classes for date and time inputs - use these classes instead of inline styles */
.date-input {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    width: 180px;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

.date-input.full-width {
    width: 100%;
}

.time-input {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    width: 120px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.time-input.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* DOR time inputs with special styling */
.time-input.dor-start {
    height: 36px;
    width: 140px;
    border: 2px solid #3498db;
    border-radius: 8px;
    background: #ffffff;
    color: #2c3e50;
}

.time-input.dor-end {
    height: 36px;
    width: 140px;
    border: 2px solid #e74c3c;
    border-radius: 8px;
    background: #ffffff;
    color: #2c3e50;
}

/* Assessment date inputs (smaller height, narrower width) */
.date-input.assessment {
    height: 30px;
    width: 140px;
}

/* Full-width date inputs (for modals) */
.date-input.full-width {
    width: 100%;
}

/* Enable wrapping for all multi-line inputs */
textarea {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    word-break: break-word;
    resize: vertical;
    line-height: 1.3em; /* normalize line height for calc */
    max-height: calc(10 * 1.3em); /* cap at ~10 lines */
    overflow-y: auto; /* scroll after 10 lines */
}

/* Counter section container - light gray background with rounded corners, padding and border for counter controls (like in assessment forms) */
.counter-row {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    border: 1px solid #e9ecef;
}

/* Counter section label - medium font size and weight, dark color with bottom margin for counter titles */
.counter-label {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 15px;
}

/* Counter controls layout - horizontal flex with space between minus button, value, and plus button */
.counter-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Counter button base styling - square button with rounded corners, light gray background, centered content and hover effects */
.counter-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background: #e9ecef;
    color: #666;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

/* Counter button hover state - darker gray background with slight scale up effect */
.counter-btn:hover {
    background: #d4d8db;
    transform: scale(1.05);
}

/* Plus counter button - light gray background with dark text color */
.counter-btn.plus {
    background: #e9ecef;
    color: #333;
}

/* Counter value display - large bold font, dark color, centered text with minimum width for consistent spacing */
.counter-value {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    min-width: 50px;
    text-align: center;
}

/* Juz/Quarter selection tabs - horizontal flex layout with gap, bottom margin and horizontal scroll for Quran chapter selection */
.juz-tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    align-items: center;
}

/* Individual Juz/Quarter tab - purple gradient background, white text, rounded corners; view-only (no hover/click) */
.juz-tab {
    height: 30px;
    padding: 3px 5px 5px;
    border: 2px solid #764ba2;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: default;
    pointer-events: none;
    font-size: 16px;
    font-weight: 500;
    color: white;
    transition: all 0.3s;
    white-space: nowrap;
}

/* Explicitly neutralize any hover effects that might be inherited */
.juz-tab:hover {
    transform: none;
    box-shadow: none;
}

/* Primary button styling - green gradient background, white text, full width, rounded corners with hover effects for main action buttons */
.btn {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    margin-top: 20px;
    transition: all 0.3s;
    width: 100%;
}

/* Primary button hover state - upward movement with green shadow effect */
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.4);
}

/* Disable hover effects on touch devices */
@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        transform: none;
        box-shadow: none;
    }
}

/* Primary button active state - reset hover effects when clicked */
.btn:active,
.btn:focus {
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.2);
    transform: translateY(0);
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

/* Back button styling - gray gradient background, auto width with right margin for navigation buttons */
.btn-back {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    margin-right: 10px;
    width: auto;
}

/* Back button hover state - gray shadow effect */
.btn-back:hover {
    box-shadow: 0 5px 15px rgba(127, 140, 141, 0.4);
}

/* Proceed button styling - blue gradient background with top margin for forward navigation buttons */
.btn-proceed {
    background: linear-gradient(135deg, #3498db, #2980b9);
    margin-top: 10px;
}

/* Proceed button hover state - blue shadow effect */
.btn-proceed:hover {
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

/* Progress bar container - light gray background, thin height, rounded corners with hidden overflow for progress indicators */
.progress-bar {
    background: #e9ecef;
    height: 4px;
    border-radius: 2px;
    margin-top: 5px;
    overflow: hidden;
}

/* Progress bar fill - green gradient background that fills the progress bar with smooth width transitions */
.progress-fill {
    height: 100%;
    background: #2ce479;
    transition: width 0.3s;
}

/* Statistics grid layout - responsive grid with minimum 200px column width, 20px gap for displaying student statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Statistics card - white background, centered text, rounded corners, blue left border and shadow for individual stat displays */
.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border-left: 4px solid #3498db;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Statistics number display - large bold font, dark blue color with small bottom margin for stat values */
.stat-number {
    font-size: 2em;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

/* Statistics label text - medium gray color, small font size for stat descriptions */
.stat-label {
    color: #7f8c8d;
    font-size: 14px;
}

/* Add student form container - light gray background, padding, rounded corners and bottom margin for new student registration form */
.add-student-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

/* Form group container - bottom margin for spacing between form field groups */
.form-group {
    margin-bottom: 15px;
}

/* Form group labels - block display, bottom margin, medium font weight and dark gray color for form field labels */
.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
}

/* Form group inputs and selects - full width, padding, light gray border, rounded corners and medium font size for form controls */
.form-group input, .form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 16px;
}

/* Custom select dropdown styling - removes default browser styling, adds custom down arrow icon positioned on the right side */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

/* Juz and Quarter selection row - horizontal flex layout with large gap, bottom margin and space-between justification for Quran chapter selection */
.juz-quarter-row {
    display: flex;
    gap: 25px;
    margin-bottom: 20px;
    justify-content: space-between;
}

/* Juz/Quarter form groups - equal flex width, no bottom margin, minimum width constraint for responsive layout */
.juz-quarter-row .form-group {
    flex: 1;
    margin-bottom: 0;
    min-width: 0;
}

/* Juz/Quarter select dropdowns - full width with minimum 80px width for proper display */
.juz-quarter-row .form-group select {
    width: 100%;
    min-width: 80px;
}

/* Search input box - full width, blue border, rounded corners, medium font size with no outline for student search functionality */
.search-box {
    width: 100%;
    padding: 12px;
    border: 2px solid #3498db;
    border-radius: 25px;
    font-size: 16px;
    margin-bottom: 3px;
    outline: none;
}

/* Search box focus state - darker blue border with blue glow shadow effect when focused */
.search-box:focus {
    border-color: #2980b9;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
}

/* Parent search results dropdown (New Student Registration) - same feel as student search */
.parent-search-results {
    position: absolute;
    z-index: 500;
    background: #fff;
    border: 2px solid #3498db;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 280px;
    overflow-y: auto;
    margin-top: 4px;
    list-style: none;
    padding: 0;
}
.parent-search-results .parent-search-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}
.parent-search-results .parent-search-item:last-child { border-bottom: none; }
.parent-search-results .parent-search-item:hover { background: #e8f4fd; }

/* Notification popup - fixed position in top right, green background, white text, shadow, initially hidden off-screen with slide-in animation */
.notification {
    position: fixed;
    top: 100px;
    right: 20px;
    background: #27ae60;
    color: white;
    padding: 15px 20px;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transform: translateX(400px);
    transition: transform 0.3s;
    z-index: 3000;
}

/* Notification show state - slides notification into view from the right side */
.notification.show {
    transform: translateX(0);
}

/* Student profile header - blue gradient background, white text, padding, rounded corners, flex layout with centered items for student profile pages */
.profile-header {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 0px;
    display: flex;
    align-items: center;
}

/* Large student avatar for profile header - 80x80px size, large font size with right margin for profile page headers */
.profile-header .student-avatar {
    width: 80px;
    height: 80px;
    font-size: 36px;
    margin-right: 20px;
}

/* Student main navigation tabs - horizontal flex layout with light gray background, bottom border, horizontal scroll and custom scrollbar styling */
.student-main-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: thin;
    scrollbar-color: #adb5bd #f8f9fa;
}

/* Custom scrollbar styling for student main tabs - thin scrollbar with light gray track and medium gray thumb */
.student-main-tabs::-webkit-scrollbar {
    height: 6px;
}

.student-main-tabs::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.student-main-tabs::-webkit-scrollbar-thumb {
    background: #adb5bd;
    border-radius: 3px;
}

/* Individual main tab - auto flex sizing, padding, no background, cursor pointer, medium font weight with transparent bottom border and minimum width */
.main-tab {
    flex: 0 0 auto;
    padding: 15px 25px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #6c757d;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    min-width: 120px;
}

/* Main tab hover state - light gray background with darker text color */
.main-tab:hover {
    background: #e9ecef;
    color: #495057;
}

/* Active main tab - blue text color, bold font weight with blue bottom border */
.main-tab.active {
    color: #3498db;
    font-weight: bold;
    border-bottom-color: #3498db;
}

/* Main tab content containers - hidden by default with top/bottom padding */
.main-tab-content {
    display: none;
    padding: 20px 0;
}

/* Active main tab content - displays the content of the currently selected main tab */
.main-tab-content.active {
    display: block;
}

/* Remove top margin from content when student profile is active to reduce white space between tabs and profile header */
body:has(#studentProfile.active) .content {
    margin-top: -10px !important;
}

/* Remove top padding from Listen tab content so the content sits tight under the navigation tabs */
#listen.main-tab-content {
    padding-top: 0;
}

/* Profile navigation tabs - horizontal flex layout with bottom margin and border for profile section navigation */
.profile-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #dee2e6;
}

/* Individual profile tab - padding, no background, cursor pointer, medium font size with transparent bottom border and smooth transitions */
.profile-tab {
    padding: 15px 25px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

/* Active profile tab - blue text color, blue bottom border and bold font weight */
.profile-tab.active {
    color: #3498db;
    border-bottom-color: #3498db;
    font-weight: bold;
}

/* Profile tab hover state - light gray background on hover */
.profile-tab:hover {
    background: #f8f9fa;
}

/* Section headers - large bold font, dark blue color, top/bottom margins, bottom padding and blue bottom border for content section titles */
.section-header {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    margin: 25px 0 15px 0;
    padding-bottom: 5px;
    border-bottom: 2px solid #3498db;
}

/* Total display container - light blue background, blue border, rounded corners, centered text, bold font weight and dark blue color for displaying totals/summaries */
.total-display {
    background: #e8f4fd;
    border: 2px solid #3498db;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: bold;
    color: #2c3e50;
}

/* Milestone card container - light gray background, rounded corners, padding, bottom margin and blue left border for displaying historical records */
.history-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #3498db;
}

/* Milestone card header - horizontal flex layout with space between, centered items, bottom margin and bold font weight for history record headers */
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: bold;
}

/* Error summary grid - responsive grid with minimum 120px columns, 10px gap, top margin and small font size for displaying error statistics */
.error-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 10px;
    font-size: 14px;
}

/* Individual error item - white background, padding, rounded corners and centered text for individual error statistics */
.error-item {
    background: #fff;
    padding: 8px;
    border-radius: 4px;
    text-align: center;
}

/* Mobile responsive styles - stacks Juz/Quarter row vertically, wraps profile tabs and sets minimum width for profile tabs on small screens */
@media (max-width: 768px) {
    .juz-quarter-row {
        flex-direction: column;
    }
    
    .profile-tabs {
        flex-wrap: wrap;
    }
    
    .profile-tab {
        flex: 1;
        min-width: 80px;
    }
}

/* Juz/Quarter/Pages/Lines selection row - horizontal flex layout with gap, bottom margin, no wrapping and hidden overflow for complex form layouts */
.juz-quarter-pages-lines-row {
    display: flex;
    gap: 0px 28px; /* row gap, column gap */
    margin-bottom: -15px;
    flex-wrap: wrap; /* allow wrapping to create 2 x 2 layout */
    overflow: hidden;
}

/* Form groups in Juz/Quarter/Pages/Lines row - equal flex sizing with minimum width constraint for responsive layout */
.juz-quarter-pages-lines-row .form-group {
    flex: 0 0 45%;
    max-width: 45%;
    min-width: 100px; /* prevent collapsing on small screens */
}

/* Select dropdowns in Juz/Quarter/Pages/Lines row - full width with small font size and compact padding */
.juz-quarter-pages-lines-row .form-group select {
    width: 100%;
    font-size: 16px;
    padding: 8px 6px;
}

/* Tajweed rules grid - 2-column grid layout with 15px gap and top/bottom margins for displaying Tajweed error counters */
.tajweed-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.tajweed-grid-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 20px 0;
}

/* Individual Tajweed counter - vertical flex layout with gap for Tajweed error counter controls */
.tajweed-counter {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Tajweed counter labels - small font size, bold weight, medium gray color with capitalized text for Tajweed rule names */
.tajweed-counter label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    text-transform: capitalize;
}

/* Tajweed Section - Override padding */
.tajweed-section {
    padding: 10px 5px !important;
}

/* Tajweed Counter Styles - Matching Page Design */
.tajweed-counter-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.tajweed-counter-label {
    font-size: 12px;
    color: #666;
    text-align: left;
    font-weight: bold;
    text-transform: capitalize;
    margin-bottom: 1px;
    margin-left: 0px;
    width: 100%;
    padding-left: 2px;
}

/* OLD TAJWEED COUNTER STYLES - COMMENTED OUT
.tajweed-counter-controls {
    --counter-bg: #f8f9fa;
    background: var(--counter-bg);
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0px 6px 0px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    align-self: center;
    position: relative;
}

.tajweed-counter-label-box {
    background: #d6ecfa;
    border: 1px solid #dee2e6;
    border-radius: 4px 4px 0 0;
    padding: 1px 5px;
    font-size: 12px;
    font-weight: bold;
    color: #666;
    text-transform: capitalize;
    text-align: left;
    width: 110%;
    box-sizing: border-box;
    margin: 0;
    border-bottom: none;
}

.tajweed-counter-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0px;
    margin-top: 6px;
}

.tajweed-counter-btn {
    background: #d6ecfa;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    padding-bottom: 1px;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    color: #495057;
}

.tajweed-counter-btn:hover {
    transform: translateY(-1px);
}

.tajweed-counter-btn:active {
    transform: scale(0.95);
}

.tajweed-counter-display {
    background: transparent;
    border: none;
    padding: 8px 16px;
    text-align: center;
    min-width: 50px;
}
*/

/* Labels Outside Design (Design 3) */
.tajweed-counter-wrapper-outside {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tajweed-counter-label-outside {
    font-size: 13px;
    color: #2c3e50;
    text-align: center;
    font-weight: 700;
    text-transform: capitalize;
    margin-top: 0px;
    margin-bottom: 2px;
}

.tajweed-counter-controls-compact {
    --counter-bg: #79c6f9; /* Default blue for Sabaq */
    background: var(--counter-bg);
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    align-self: center;
    position: relative;
    overflow: hidden;
}

.tajweed-counter-compact-btn {
    flex: 2;
    background: var(--counter-bg);
    border: none;
    color: #2c3e50;
    font-size: 21px;
    font-weight: bold;
    padding: 7px 11px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;

    
}

.tajweed-counter-compact-btn:hover {
    transform: translateY(-1px);
}

.tajweed-counter-compact-btn:active {
    transform: scale(0.95);
}

.tajweed-counter-compact-display {
    background: #ffffff;
    border: none;
    padding: 8px 20px;
    text-align: center;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;

}

.tajweed-counter-value {
    font-size: 20px;
    font-weight: normal;
    color: #2c3e50;
}

/* Color Overrides for Compact Design */
.sabaq-dor-counter-compact {
    --counter-bg: #f9c879; /* Orange #e67e22*/
}

.dor-counter-compact {
    --counter-bg: #6bd095; /* Green 27ae60*/
}

/* Sabaq Dor Counter Section - Orange Background */
.sabaq-dor-counter-section-controls {
    --counter-bg: #f9c879; /* Orange for Sabaq Dor */
    background: var(--counter-bg);
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    align-self: center;
    position: relative;
    overflow: hidden;
}

.counter-section-btn {
    flex: 2;
    background: var(--counter-bg);
    border: none;
    color: #2c3e50;
    font-size: 21px;
    font-weight: bold;
    padding: 7px 11px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.counter-section-btn:hover {
    transform: translateY(-1px);
}

.counter-section-btn:active {
    transform: scale(0.95);
}

.counter-section-display {
    background: #ffffff;
    border: none;
    padding: 8px 20px;
    text-align: center;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

/* Dor Counter Section - Green Background */
.dor-counter-section-controls {
    --counter-bg: #6bd095; /* Green for Dor */
    background: var(--counter-bg);
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    align-self: center;
    position: relative;
    overflow: hidden;
}

/* Sabaq Counter Section - Blue Background */
.sabaq-counter-section-controls {
    --counter-bg: #79c6f9; /* Blue for Sabaq */
    background: var(--counter-bg);
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    align-self: center;
    position: relative;
    overflow: hidden;
}

/* Compact error summary grid - grid layout with gap and top/bottom margins for condensed error displays */
.error-summary-compact {
    display: grid;
    gap: 10px;
    margin: 15px 0;
}

/* Sabaq error summary - 3-column grid layout for Sabaq assessment error displays */
.error-summary-compact.sabaq {
    grid-template-columns: repeat(3, 1fr);
}

/* Sabaq-Dor and Dor error summaries - 4-column grid layout for Sabaq-Dor and Dor assessment error displays */
.error-summary-compact.sabaq-dor,
.error-summary-compact.dor {
    grid-template-columns: repeat(4, 1fr);
}

/* Session section container - top/bottom margins, padding, blue left border and light gray background for grouping session-related content */
.session-section {
    margin: 20px 0;
    padding: 15px;
    border-left: 3px solid #3498db;
    background-color: #f8f9fa;
}

/* Individual session item - top/bottom margins, padding, white background, rounded corners and light gray border for individual session records */
.session-item {
    margin: 10px 0;
    padding: 10px;
    background-color: white;
    border-radius: 5px;
    border: 1px solid #e9ecef;
}


/* Collapsible section container - top/bottom margins, light gray border, rounded corners and hidden overflow for expandable content sections */
.collapsible-section {
    margin: 20px 0;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

/* Collapsible section header - light gray background, padding, cursor pointer, flex layout with space between, bottom border and smooth background transitions */
.collapsible-header {
    background-color: #f8f9fa;
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.3s ease;
}

/* Collapsible header hover state - darker gray background on hover */
.collapsible-header:hover {
    background-color: #e9ecef;
}

/* Toggle icon for collapsible sections - small font size, smooth transform transitions and medium gray color for expand/collapse indicators */
.toggle-icon {
    font-size: 12px;
    transition: transform 0.3s ease;
    color: #6c757d;
}

/* Collapsible section content - padding and white background for the expandable content area */
.collapsible-content {
    padding: 20px;
    background-color: white;
}

/* Section headers inside collapsible content - removes top margin, padding and border for proper spacing within collapsible sections */
.collapsible-content .section-header {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

/* Enhanced checkbox styling - removes default appearance, blue background, square shape, cursor pointer, scaled up with proper spacing and vertical alignment */
.checkbox-input {
    appearance: none;
    -webkit-appearance: none;
    width: 20px !important;
    height: 20px !important;
    border: 0px solid #3498db;
    background-color: #3498db;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    margin-left: 10px; /* Reduce space between label and checkbox */
    vertical-align: middle; /* Center vertically with text */
    transition: none !important; /* Remove transition effects from form-group input */
    border-color: #3498db !important;
    box-shadow: none !important;
}

/* Checked checkbox state - green background and border color when checkbox is selected */
.checkbox-input:checked {
    background-color: #27ae60;
    border-color: #27ae60;
}

/* Checkmark for checked checkbox - white checkmark symbol centered in the checkbox when selected */
.checkbox-input:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

/* Square radio button styling - same size as checkboxes (20-24x20-24px), square shape */
input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 22px !important;
    height: 22px !important;
    border: 2px solid #3498db;
    background-color: white;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    transition: none !important;
    box-shadow: none !important;
    margin: 0 4px 0 0;
}

/* Checked radio button state - white background with blue border */
input[type="radio"]:checked {
    background-color: white;
    border-color: #3498db;
}

/* Blue square inside checked radio button - similar to traditional radio button's filled circle */
input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 11px;
    height: 11px;
    background-color: #3498db;
    border-radius: 2px;
}

/* Form row select dropdowns - minimum 200px width, padding, light gray border, rounded corners, medium font size, white background with smooth border transitions */
.form-row select {
    min-width: 200px;
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    background-color: white;
    transition: border-color 0.3s ease;
}

/* Form row select focus state - removes default outline and changes border to blue when focused */
.form-row select:focus {
    outline: none;
    border-color: #3498db;
}

/* Juz/Quarter row with no wrapping - prevents flex items from wrapping to new lines with 25px gap */
.juz-quarter-row.nowrap {
    flex-wrap: nowrap;
    gap: 25px;
}

/* Form groups in nowrap Juz/Quarter row - auto flex sizing to prevent wrapping */
.juz-quarter-row.nowrap .form-group {
    flex: 0 0 auto;
}

/* Select dropdowns in nowrap Juz/Quarter row - auto width with minimum 120px width to prevent wrapping */
.juz-quarter-row.nowrap .form-group select {
    width: auto;
    min-width: 120px;
}

/* Mobile responsive styles for nowrap Juz/Quarter row - reduces gap and minimum width on small screens to maintain single line layout */
@media (max-width: 600px) {
    .juz-quarter-row.nowrap { gap: 12px; }
    .juz-quarter-row.nowrap .form-group select { min-width: 100px; }
}

/* ========================================
   COMPREHENSIVE MOBILE RESPONSIVE STYLES
   ======================================== */

/* Mobile styles for screens smaller than 768px */
@media (max-width: 768px) {
    /* Body and container adjustments */
    body {
        padding: 10px;
    }
    
    .container {
        margin: 0;
        border-radius: 8px;
    }
    
    /* Dashboard header mobile adjustments */
    .dashboard-header {
        padding: 20px 15px;
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .dashboard-header h1 {
        font-size: 1.8rem;
        margin-bottom: 10px;
    }
    
    .user-info {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .user-info span {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
    
    .logout-btn {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
    
    /* Role navigation mobile adjustments */
    .role-nav {
        padding: 20px 15px;
    }
    
    .role-section {
        flex-direction: column;
        align-items: center;
    }
    
    #selectedSchoolNav {
        flex-direction: column;
        align-items: stretch;
    }
    
    .role-btn {
        width: 100%;
        max-width: 300px;
        min-width: auto;
        padding: 15px 20px;
        font-size: 1rem;
    }
    
    /* Form section mobile adjustments */
    .form-section {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .form-section h4 {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    /* Form row mobile adjustments - stack vertically */
    .form-row {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 10px;
    }
    
    .form-row .form-group {
        width: 100%;
    }
    
    .form-row label {
        min-width: auto;
        margin-bottom: 5px;
    }
    
    .form-row input, 
    .form-row select {
        width: 100%;
        min-width: auto;
    }
    
    /* Form group mobile adjustments */
    .form-group {
        margin-bottom: 10px;
    }
    
    .form-group label {
        font-size: 13px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 10px 12px;
    }
    
    /* Juz/Quarter row mobile adjustments */
    .juz-quarter-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .juz-quarter-row .form-group {
        margin-bottom: 0;
    }
    
    .juz-quarter-row .form-group select {
        width: 100%;
        min-width: auto;
    }
    
    /* Selector row mobile adjustments */
    .selector-row-two {
        flex-direction: row; /* keep two columns on mobile */
        gap: 10px;
        flex-wrap: nowrap;
    }
    
    .selector-row-two .form-group {
        width: auto; /* do not stretch to 100% to avoid stacking */
        flex: 1 1 0;
        min-width: 0;
    }
    
    .selector-row-two .form-group select {
        width: 100%;
        font-size: 16px;
        padding: 10px 12px;
    }
    
    /* Juz/Quarter/Pages/Lines row mobile adjustments - keep two columns */
    .juz-quarter-pages-lines-row {
        flex-wrap: wrap;
        gap: 0px 25px;
    }
    
    .juz-quarter-pages-lines-row .form-group {
        flex: 0 0 45%;
        max-width: 45%;
    }
    
    .juz-quarter-pages-lines-row .form-group select {
        width: 100%;
        font-size: 16px;
        padding: 10px 12px;
    }
    
    /* Student grid mobile adjustments */
    .student-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-top: 15px;
    }
    
    .student-card {
        height: 35px;
        padding: 5px 10px;
    }
    
    /* Profile tabs mobile adjustments */
    .profile-tabs {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .profile-tab {
        flex: 1;
        min-width: 80px;
        padding: 10px 15px;
        font-size: 14px;
    }
    
    /* Main tabs mobile adjustments */
    .student-main-tabs {
        padding: 0 10px;
    }
    
    .main-tab {
        padding: 12px 15px;
        font-size: 14px;
        min-width: 100px;
    }
    
    /* Ensure main tabs are not hidden under fixed breadcrumb/student tabs */
    .breadcrumb-visible .student-main-tabs,
    .breadcrumb-visible .content {
        margin-top: 120px;
    }
    
    .student-tabs-visible .student-main-tabs {
        margin-top: 69px; /* Will be overridden by JavaScript for dynamic adjustment */
    }
    
    /* Counter controls mobile adjustments */
    .counter-controls {
        justify-content: center;
        gap: 20px;
    }
    
    .counter-btn {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    
    .counter-value {
        font-size: 20px;
        min-width: 40px;
    }
    
    /* Tajweed grid mobile adjustments */
    .tajweed-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        margin: 15px 0;
    }
    
    .tajweed-grid-2col {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        margin: 15px 0px;
    }
    
    /* Error summary mobile adjustments */
    .error-summary {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        font-size: 12px;
    }
    
    .error-summary-compact.sabaq {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .error-summary-compact.sabaq-dor,
    .error-summary-compact.dor {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Stats grid mobile adjustments */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* Collapsible section mobile adjustments */
    .collapsible-section {
        margin: 15px 0;
    }
    
    .collapsible-header {
        padding: 12px 15px;
    }
    
    .collapsible-content {
        padding: 15px;
    }
    
    /* Search box mobile adjustments */
    .search-box {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px 15px;
    }
    
    /* Notification mobile adjustments */
    .notification {
        top: 100px;
        right: 10px;
        left: auto;
        max-width: calc(100% - 20px);
        transform: translateX(150%); /* start fully off-screen to the right */
        text-align: center;
        z-index: 3000;
    }
    
    .notification.show {
        transform: translateX(0);
    }
}

/* Mobile styles for screens smaller than 480px */
@media (max-width: 480px) {
    body {
        padding: 5px;
    }
    
    .dashboard-header {
        padding: 15px 10px;
    }
    
    .dashboard-header h1 {
        font-size: 1.5rem;
    }
    
    .role-nav {
        padding: 15px 10px;
    }
    
    .form-section {
        padding: 10px 10px 1px 10px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 8px 10px;
        font-size: 16px;
    }
    
    .role-btn {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    
    .main-tab {
        padding: 10px 12px;
        font-size: 13px;
        min-width: 80px;
    }
    
    .profile-tab {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .counter-btn {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
    
    .counter-value {
        font-size: 18px;
        min-width: 35px;
    }
    
    .error-summary {
        grid-template-columns: 1fr;
        font-size: 11px;
    }
    
    .error-summary-compact.sabaq,
    .error-summary-compact.sabaq-dor,
    .error-summary-compact.dor {
        grid-template-columns: 1fr;
    }
}

/* Two-selector row layout - horizontal flex with bottom-aligned items, 15px gap, no wrapping, bottom margin and hidden overflow for Juz + Quarter selection matching Sabaq spacing */
.selector-row-two {
    display: flex;
    align-items: flex-end;
    gap: 28px;
    flex-wrap: nowrap;
    margin-bottom: 5px;
    overflow: hidden;
}

/* Form groups in two-selector row - no bottom margin, equal flex sizing with minimum width constraint */
.selector-row-two .form-group {
    margin-bottom: 0;
    flex: 1 1 0;
    min-width: 0;
}

/* Select dropdowns in two-selector row - small font size with compact padding */
.selector-row-two .form-group select {
    font-size: 16px;
    padding: 8px 6px;
}

/* Fraction display - slightly larger font size with baseline vertical alignment for displaying fractional values */
.fraction {
    font-size: 1.1em;
    vertical-align: baseline;
}

/* Milestone achievement cards - white background, blue left border, padding, margins, rounded corners, shadow, smooth transitions and light gray border for displaying student milestones */
.milestone-card {
    background: #ffffff;
    border-left: 4px solid #3498db;
    padding: 16px;
    margin: 10px 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

/* Milestone card hover state - enhanced shadow with slight upward movement for interactive feedback */
.milestone-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

/* Home button styling - blue gradient background, white text, square shape, compact padding with hover effects */
.home-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 6px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 24px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -3px;
}

/* Home button hover state - darker blue gradient with upward movement and blue shadow */
.home-btn:hover {
    background: linear-gradient(135deg, #2980b9, #1f618d);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* Disable hover effects on touch devices */
@media (hover: none) and (pointer: coarse) {
    .home-btn:hover {
        background: linear-gradient(135deg, #3498db, #2980b9);
        transform: none;
        box-shadow: none;
    }
}

/* Home button active state - reset hover effects when clicked */
.home-btn:active,
.home-btn:focus {
    background: linear-gradient(135deg, #3498db, #2980b9);
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

/* ========================================
   ROLE-BASED DASHBOARD STYLES
   ======================================== */

/* Dashboard card - blue gradient (same as login .landing-content); body purple shows in padding around it */
.dashboard {
    max-width: 1200px;
    margin: 0 auto;
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Dashboard header - blue gradient (matches login) */
.dashboard-header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-header h1 {
    font-size: 2.5rem;
    font-weight: 300;
    margin: 0;
}

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

.user-info span {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.role-nav {
    padding: 30px;
}

.role-section {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

#selectedSchoolNav {
    flex-direction: row;
    align-items: flex-start;
}

#selectedSchoolHeader {
    width: 100%;
    flex-basis: 100%;
}

.role-btn {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 2px solid #dee2e6;
    color: #495057;
    padding: 20px 30px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    font-weight: 500;
    min-width: 180px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.role-btn:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    border-color: transparent;
}

.role-btn:active {
    transform: translateY(-1px);
}

.role-btn.disabled {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 2px solid #dee2e6;
    color: #adb5bd;
    cursor: not-allowed;
    opacity: 0.7;
}

.role-btn.disabled:hover {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    color: #adb5bd;
    transform: none;
    box-shadow: none;
    border-color: #dee2e6;
}

/* Form styling for login */
.login-form {
    max-width: 400px;
    margin: 0 auto;
}

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

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

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

.landing-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.landing-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

.landing-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

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

/* Dor card layout */
.juz-time-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.juz-display {
    display: flex;
    flex-direction: column;
}

.juz-main {
    font-size: 1rem;
    line-height: 1;
    height: 1.2em;
    display: flex;
    align-items: center;
}

.juz-increment {
    font-size: 1rem;
    color: #666;
    margin-top: 6px;
    line-height: 1;
}

.time-display {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.time-label {
    font-size: 1rem;
    color: #000;
    line-height: 1;
    height: 1.2em;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.time-value {
    font-size: 1rem;
    margin-top: 6px;
    line-height: 1;
}

/* 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;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 10px;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 12px 12px 0 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    position: absolute;
    top: 2px;
    right: 7px;
    z-index: 10;
}

.close:hover {
    opacity: 0.7;
}

.modal-body {
    padding: 15px 15px;
}

/* School Grid Styles - Similar to Student Grid */
.school-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 10px;
    margin-top: 20px;
}

.school-card {
    background: linear-gradient(135deg, #3498db, #2980b9);
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    cursor: pointer;
    height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
}

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

.school-card h4 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.school-card p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Legacy School List Styles (kept for compatibility) */
.school-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.school-info h4 {
    margin: 0 0 5px 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.school-info p {
    margin: 0;
    color: #6c757d;
    font-size: 0.9rem;
}

.school-actions {
    display: flex;
    gap: 10px;
}

.school-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.school-actions .btn-edit {
    background: #3498db;
    color: white;
}

.school-actions .btn-deactivate {
    background: #e74c3c;
    color: white;
}

.school-actions .btn-activate {
    background: #27ae60;
    color: white;
}

.school-actions button:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

/* Mobile layout for all assessment cards */
@media (max-width: 768px) {
    .juz-display {
        display: flex;
        flex-direction: column;
    }
    
    .juz-main {
        font-size: 1rem;
        line-height: 1;
        height: 1.2em;
        display: flex;
        align-items: center;
    }
    
    .juz-increment {
        font-size: 1rem;
        color: #666;
        margin-top: 6px;
        line-height: 1;
    }
    
    .time-display {
        text-align: left;
        margin-top: 0px;
    }
    
    .time-label {
        font-size: 1rem;
        line-height: 1;
        height: 1.2em;
        display: flex;
        align-items: center;
        justify-content: flex-start;
    }
    
    .time-value {
        font-size: 1rem;
    }
    
    
    /* Error summary mobile 2x2 grid for all assessment types */
    .error-summary-compact.dor,
    .error-summary-compact.sabaq,
    .error-summary-compact.sabaq-dor {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-top: 8px;
    }
    
    .error-summary-compact.dor .error-item,
    .error-summary-compact.sabaq .error-item,
    .error-summary-compact.sabaq-dor .error-item {
        text-align: center;
        padding: 8px;
        background: #f8f9fa;
        border-radius: 6px;
        border: 1px solid #e9ecef;
    }
}

/* Staff card styling - separate from student cards */
.staff-card {
    background: linear-gradient(135deg, #3498db, #2980b9);
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    cursor: pointer;
    min-height: 55px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.staff-card.inactive-staff {
    background: #d4d4d4 !important;
    border: 1px solid #a9a9a9 !important;
    color: #666 !important;
}

.staff-card.inactive-staff h3,
.staff-card.inactive-staff p {
    color: #666 !important;
}

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

.staff-card input[type="checkbox"] {
    margin: 0;
    width: 18px;
    height: 18px;
}

.staff-card.selected {
    border: 2px solid #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* Staff card mobile adjustments */
@media (max-width: 768px) {
    .staff-card {
        min-height: 55px;
        padding: 8px 12px;
    }
}

/* Purple form headers (same styling as modal-header) */
.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 10px;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 12px 12px 0 0;
    margin: -10px -10px 10px -10px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.form-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
    color: white;
}

.form-header .close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: opacity 0.2s;
    position: absolute;
    top: 2px;
    right: 7px;
    z-index: 10;
}

.form-header .close:hover {
    opacity: 0.7;
}
