/* SAS - Student Attendance System Styles */

/* Hide WordPress theme's entry-header on pages containing student dashboard to prevent duplicate headers */
body.sas-student-dashboard-page .entry-header {
    display: none !important;
}

/* Base Styles */
.sas-teacher-dashboard,
.sas-student-scanner,
.sas-student-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: white;
    color: #2c3e50;
}

/* Ensure all text has good contrast */
.sas-teacher-dashboard *,
.sas-student-scanner *,
.sas-student-dashboard * {
    color: inherit;
}

.sas-teacher-dashboard h1,
.sas-teacher-dashboard h2,
.sas-teacher-dashboard h3,
.sas-teacher-dashboard h4,
.sas-student-scanner h1,
.sas-student-scanner h2,
.sas-student-scanner h3,
.sas-student-scanner h4,
.sas-student-dashboard h1,
.sas-student-dashboard h2,
.sas-student-dashboard h3,
.sas-student-dashboard h4 {
    color: #2c3e50;
    font-weight: 600;
}

/* Student Dashboard specific text improvements */
.sas-student-scanner p,
.sas-student-scanner div,
.sas-student-scanner span,
.sas-student-dashboard p,
.sas-student-dashboard div,
.sas-student-dashboard span {
    color: #2c3e50;
}

.sas-student-scanner .description,
.sas-student-scanner .info-text,
.sas-student-dashboard .description,
.sas-student-dashboard .info-text {
    color: #34495e;
    font-weight: 500;
}

/* Student Dashboard Header Styling */
.sas-student-dashboard .sas-dashboard-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.sas-student-dashboard .sas-dashboard-header h2 {
    color: white !important;
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 600;
}

.sas-student-dashboard .sas-dashboard-header p {
    color: white !important;
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
}

/* Navigation Tabs */
.sas-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #e1e1e1;
    padding-bottom: 10px;
}

.sas-dashboard-nav,
.sas-scanner-tabs {
    display: flex;
    gap: 5px;
}

/* Dashboard Title and Logout Container */
.sas-title-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.sas-title-container .entry-title {
    margin: 0;
    flex-grow: 1;
}

.sas-logout-container {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 15px;
}

/* Logout section at bottom of dashboard */
.sas-logout-section {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin-top: 30px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.sas-logout-section .sas-logout-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 0;
}

.sas-logout-container a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

/* Enhanced styling for standardized buttons in logout container */
.sas-logout-container .sas-btn {
    min-width: 160px;
    justify-content: center;
    font-size: 16px;
    padding: 12px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.sas-logout-container .sas-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Legacy support for backwards compatibility */
.sas-portal-btn {
    background: #0073aa; /* WP blue */
    color: #fff;
}

.sas-portal-btn:hover {
    background: #005177;
    transform: translateY(-2px);
}

.sas-logout-btn {
    background: #d63638; /* WP red tone */
    color: white !important;
    text-decoration: none !important;
}

.sas-logout-btn:hover {
    background: #a02729;
    color: white !important;
    transform: translateY(-2px);
}

.sas-logout-container .dashicons {
    font-size: 18px;
}

.sas-tab-btn {
    background: #f7f7f7;
    border: 1px solid #ddd;
    border-bottom: none;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.2s ease;
    border-radius: 5px 5px 0 0;
}

.sas-tab-btn:hover {
    background: #e9e9e9;
    color: #333;
}

.sas-tab-btn.active {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
    position: relative;
}

.sas-tab-btn.active:after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #0073aa;
}

/* FIXED: Add missing tab content styles for better rendering */
.sas-tab-content {
    min-height: 200px;
    padding: 20px 0;
    border-top: 2px solid #e1e1e1;
    background: transparent;
}

.sas-tab-content.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

/* Form Elements */
.sas-form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.sas-form-group {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

.sas-form-group label {
    font-weight: 500;
    margin-bottom: 5px;
    color: #333;
    font-size: 13px;
}

.sas-form-control {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.sas-form-control:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

/* Buttons */
.sas-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 10px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    line-height: 1;
}

.sas-btn-primary {
    background: #0073aa;
    color: white;
}

.sas-btn-primary:hover {
    background: #005a87;
}

.sas-btn-success {
    background: #46b450;
    color: white;
}

.sas-btn-success:hover {
    background: #3e9f46;
}

.sas-btn-danger {
    background: #dc3545;
    color: white;
}

.sas-btn-danger:hover {
    background: #c82333;
}

.sas-btn-secondary {
    background: #6c757d;
    color: white;
}

.sas-btn-secondary:hover {
    background: #5a6268;
}

.sas-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Session Selection */
.sas-session-selection {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.sas-sessions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
    /* FIXED: Add proper alignment and ensure grid renders correctly */
    align-items: start;
    justify-content: center;
}

.sas-session-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sas-session-card:hover {
    border-color: #0073aa;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.1);
}

.sas-session-card label {
    cursor: pointer;
    margin: 0;
}

.sas-session-card input[type="radio"] {
    margin-right: 10px;
}

.session-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.session-type {
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    color: #495057;
    align-self: flex-start;
}

.session-room {
    color: #6c757d;
    font-size: 13px;
}

.session-status {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    align-self: flex-start;
}

.status-scheduled {
    background: #fff3cd;
    color: #856404;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-completed {
    background: #d1ecf1;
    color: #0c5460;
}

.sas-session-options {
    border-top: 1px solid #dee2e6;
    padding-top: 15px;
}

.sas-session-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #495057;
}

/* Student row layout with selection checkbox */
.student-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    transition: border-color 0.2s ease;
    gap: 15px;
}

.student-row:hover {
    border-color: #adb5bd;
}

/* Student selection checkbox */
.student-selection {
    display: flex;
    align-items: center;
}

.student-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin: 0;
}

.student-checkbox input[type="checkbox"] {
    margin: 0 5px 0 0;
    cursor: pointer;
    transform: scale(1.2);
}

.checkmark {
    position: relative;
}

/* Header controls for select all */
.header-controls {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.select-all-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #495057;
    margin: 0;
}

.select-all-checkbox {
    margin: 0;
    cursor: pointer;
    transform: scale(1.1);
}

/* Updated students header */
.students-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

/* Quick Horizontal Stats Bar */
.sas-quick-stats-bar {
    display: flex;
    gap: 20px;
    margin: 15px 0 10px 0;
    padding: 10px 0;
    border-top: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
}

.stats-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    padding: 8px;
    border-radius: 4px;
    background: #fff;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.stats-item:hover {
    border-color: #0073aa;
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.1);
}

.stats-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #6c757d;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.stats-count {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
}

.stats-present .stats-count {
    color: #28a745;
}

.stats-late .stats-count {
    color: #ffc107;
}

.stats-absent .stats-count {
    color: #dc3545;
}

.stats-not-set .stats-count {
    color: #6c757d;
}

.attendance-summary {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    margin-top: 10px;
}

.selected-count {
    font-weight: 600;
    color: #17a2b8;
    font-size: 14px;
}

.student-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.student-info strong {
    color: #333;
    font-size: 16px;
}

.admission-number {
    color: #6c757d;
    font-size: 13px;
}

.qr-badge {
    background: #28a745;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    align-self: flex-start;
}

.attendance-options {
    display: flex;
    gap: 15px;
}

.attendance-options label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.status-present {
    color: #28a745;
}

.status-late {
    color: #fd7e14;
}

.status-absent {
    color: #dc3545;
}

/* Bulk Actions */
.sas-bulk-action-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-top: 20px;
}

/* Enhanced Attendance Status Indicators */
.attendance-options label.selected {
    background-color: rgba(0, 115, 170, 0.1);
    border: 1px solid #0073aa;
    border-radius: 4px;
    padding: 4px 8px;
    transition: all 0.2s ease;
}

.student-row.has-attendance {
    border-left: 4px solid #0073aa;
}

.student-row.saved {
    background-color: rgba(40, 167, 69, 0.05);
    border-color: #28a745;
}

/* Enhanced Students Header */
.students-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

.attendance-summary {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.marked-count {
    font-weight: 600;
    color: #0073aa;
    font-size: 14px;
}

.status-counts {
    display: flex;
    gap: 15px;
    font-size: 12px;
}

.present-count {
    color: #28a745;
    font-weight: 500;
}

.late-count {
    color: #fd7e14;
    font-weight: 500;
}

.absent-count {
    color: #dc3545;
    font-weight: 500;
}

/* Student Search and Filter Controls */
.sas-student-controls-section {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.sas-controls-row {
    display: flex;
    gap: 30px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.sas-search-group,
.sas-filter-group {
    flex: 1;
    min-width: 250px;
}

.sas-search-group label,
.sas-filter-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
    font-size: 14px;
}

.sas-search-group label .dashicons,
.sas-filter-group label .dashicons {
    font-size: 16px;
    margin-right: 5px;
    vertical-align: middle;
}

.sas-search-help {
    display: block;
    color: #666;
    font-size: 12px;
    margin-top: 3px;
    font-style: italic;
}

#sas-student-search {
    position: relative;
}

.sas-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 2px;
    font-size: 14px;
}

.sas-search-clear:hover {
    color: #333;
}

/* Top Action Buttons */
.sas-top-action-bar {
    border-top: 1px solid #e1e1e1;
    padding-top: 15px;
    margin-top: 10px;
}

.sas-top-action-bar.sas-bulk-action-bar {
    justify-content: flex-start;
    gap: 10px;
}

/* Search highlighting */
.search-highlight {
    background-color: #fff3cd;
    padding: 1px 2px;
    border-radius: 2px;
}

/* Filter status indicators */
.sas-filter-indicator {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    margin-left: 5px;
}

.sas-filter-indicator.filter-present {
    background: #d4edda;
    color: #155724;
}

.sas-filter-indicator.filter-absent {
    background: #f8d7da;
    color: #721c24;
}

.sas-filter-indicator.filter-late {
    background: #fff3cd;
    color: #856404;
}

.sas-filter-indicator.filter-not-set {
    background: #e2e3e5;
    color: #6c757d;
}

/* Loading States */
.sas-loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    text-align: center;
    color: #6c757d;
}

.sas-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.sas-loading-state p {
    margin: 0;
    font-size: 16px;
}

/* Empty State */
.sas-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    text-align: center;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    color: #6c757d;
}

.sas-empty-icon .dashicons {
    font-size: 48px;
    color: #adb5bd;
    margin-bottom: 15px;
}

.sas-empty-state h4 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 18px;
}

.sas-empty-state p {
    margin: 0 0 20px 0;
    font-size: 14px;
    line-height: 1.5;
}

.sas-empty-actions ul {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
    text-align: left;
}

.sas-empty-actions li {
    padding: 3px 0;
    font-size: 13px;
}

.sas-empty-actions li:before {
    content: "• ";
    color: #0073aa;
    font-weight: bold;
}

/* Error State */
.sas-error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    text-align: center;
    background: rgba(220, 53, 69, 0.05);
    border: 2px solid rgba(220, 53, 69, 0.2);
    border-radius: 8px;
    color: #721c24;
}

.sas-error-icon .dashicons {
    font-size: 48px;
    color: #dc3545;
    margin-bottom: 15px;
}

.sas-error-state h4 {
    margin: 0 0 10px 0;
    color: #721c24;
    font-size: 18px;
}

.sas-error-state p {
    margin: 0 0 20px 0;
    font-size: 14px;
    line-height: 1.5;
}

.sas-error-actions {
    margin-top: 15px;
}

/* Spin animation for loading icons */
.dashicons.spin {
    animation: spin 1s linear infinite;
}

/* Enhanced Button States */
.sas-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.sas-btn:disabled:hover {
    background-color: inherit;
    border-color: inherit;
}

/* QR Code Display */
.sas-qr-container {
    background: white;
    border: 2px solid #0073aa;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin-top: 20px;
}

.sas-qr-info {
    margin-bottom: 20px;
}

.sas-qr-info p {
    margin: 5px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.sas-qr-subject {
    font-size: 18px;
    font-weight: 600;
    color: #0073aa;
}

.sas-qr-timer {
    color: #dc3545;
    font-weight: 500;
}

.sas-qr-refresh {
    color: #6c757d;
}

.sas-qr-code-box {
    display: inline-block;
    padding: 20px;
    background: white;
    border: 2px solid #f0f0f0;
    border-radius: 8px;
    margin: 20px 0;
}

.sas-qr-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

/* QR Scan Counter Styles */
.qr-stats {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
    text-align: center;
}

.qr-stats p {
    margin: 0;
    font-size: 16px;
    color: #495057;
}

#qr-scan-count {
    font-weight: 600;
    color: #28a745;
    font-size: 18px;
    transition: all 0.3s ease;
}

/* Animation when count updates */
#qr-scan-count.count-updated {
    background: #28a745;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.3);
}

.sas-stat-box {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px 20px;
    text-align: center;
}

.sas-stat-label {
    display: block;
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 5px;
}

.sas-stat-value {
    display: block;
    font-size: 24px;
    font-weight: 600;
    color: #0073aa;
}

.sas-qr-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 15px;
    margin-top: 20px;
    font-size: 14px;
    color: #856404;
}

/* Reports */
.report-type-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e1e1e1;
}

.report-tab {
    background: #f7f7f7;
    border: 1px solid #ddd;
    border-bottom: none;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 13px;
    color: #666;
    transition: all 0.2s ease;
    border-radius: 4px 4px 0 0;
}

.report-tab:hover {
    background: #e9e9e9;
    color: #333;
}

.report-tab.active {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

/* Table Filters */
.sas-table-filters {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    align-items: end;
}

.sas-filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 120px;
}

.sas-filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sas-filter-input,
.sas-filter-select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    color: #495057;
    background: white;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.sas-filter-input:focus,
.sas-filter-select:focus {
    outline: 0;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.25);
}

.sas-filter-input::placeholder {
    color: #6c757d;
    opacity: 1;
}

/* Filter specific adjustments */
.sessions-filters .sas-filter-group:last-child,
.history-filters .sas-filter-group:last-child {
    justify-content: flex-end;
    align-items: flex-end;
}

.sas-report-filters,
.sas-summary-filters,
.sas-daily-filters,
.sas-comprehensive-filters {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

/* Enhanced Modern Summary Cards */
.report-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: none;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
}

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

.summary-card h4 {
    margin: 0 0 12px 0;
    color: #6c757d;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.summary-value {
    font-size: 36px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    margin-bottom: 8px;
}

/* Summary Card Icons */
.summary-card .card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.summary-card.students .card-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.summary-card.classes .card-icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.summary-card.attendance .card-icon {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.summary-card.average .card-icon {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.sas-report-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.sas-report-table th {
    background: #0073aa;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sas-report-table td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
    font-size: 14px;
}

.sas-report-table tbody tr:hover {
    background: #f8f9fa;
}

.sas-report-table .status-present {
    color: #28a745;
    font-weight: 600;
}

.sas-report-table .status-absent {
    color: #dc3545;
    font-weight: 600;
}

.sas-report-table .status-late {
    color: #fd7e14;
    font-weight: 600;
}

.sas-report-table .percentage {
    font-weight: 600;
}

.report-table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

/* Student Scanner */
.sas-scanner-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.sas-scanner-instructions {
    background: #e7f3ff;
    border: 1px solid #b6d7ff;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
    color: #004085;
}

.sas-warning {
    color: #856404 !important;
    background: #fff3cd !important;
    border-color: #ffeaa7 !important;
}

.sas-scanner-controls {
    margin-top: 20px;
    margin-bottom: 20px;
}

#sas-qr-reader {
    border: 2px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    margin: 20px 0 30px 0;
    position: relative;
}





.sas-scan-result {
    margin: 20px 0;
    padding: 15px;
    border-radius: 6px;
    font-weight: 500;
}

.sas-scan-result.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.sas-scan-result.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.sas-today-attendance {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 20px;
    margin-top: 30px;
    text-align: left;
}

.sas-attendance-grid {
    display: grid;
    gap: 10px;
    margin-top: 15px;
    /* FIXED: Ensure proper grid flow for attendance records */
    grid-auto-flow: row;
    align-items: stretch;
    /* FIXED: Ensure grid stays within container on mobile */
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

.attendance-record {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 4px solid #dee2e6;
}

.attendance-record.present {
    border-left-color: #28a745;
}

.attendance-record.late {
    border-left-color: #fd7e14;
}

.attendance-record.absent {
    border-left-color: #dc3545;
}

.attendance-subject {
    font-weight: 500;
    color: #333;
}

.attendance-time {
    color: #6c757d;
    font-size: 13px;
}

.attendance-method {
    margin-top: 5px;
}

.attendance-status {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.attendance-status.present {
    background: #d4edda;
    color: #155724;
}

.attendance-status.late {
    background: #fff3cd;
    color: #856404;
}

.attendance-status.absent {
    background: #f8d7da;
    color: #721c24;
}

/* Today's Attendance Cards */
.sas-today-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.sas-attendance-card {
    padding: 20px;
    border-radius: 10px;
    border: 2px solid;
    background: #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sas-attendance-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.sas-attendance-card.sas-status-present {
    border-color: #27ae60;
    background: linear-gradient(135deg, #d5f4e6 0%, #fafffe 100%);
}

.sas-attendance-card.sas-status-absent {
    border-color: #e74c3c;
    background: linear-gradient(135deg, #fadbd8 0%, #fafffe 100%);
}

.sas-attendance-card.sas-status-late {
    border-color: #f39c12;
    background: linear-gradient(135deg, #fdeaa7 0%, #fafffe 100%);
}

.sas-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.sas-card-header strong {
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
}

.sas-card-header .sas-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sas-status-present .sas-status {
    background: #27ae60;
    color: white;
}

.sas-status-absent .sas-status {
    background: #e74c3c;
    color: white;
}

.sas-status-late .sas-status {
    background: #f39c12;
    color: white;
}

.sas-card-details {
    color: #2c3e50;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

/* Summary Section */
.sas-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

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

.sas-summary-card {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease;
}

.sas-summary-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.sas-summary-card h4 {
    margin: 0 0 10px 0;
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sas-summary-value {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
}

.sas-summary-value.sas-present {
    color: #27ae60;
}

.sas-summary-value.sas-absent {
    color: #e74c3c;
}

.sas-summary-value.sas-late {
    color: #f39c12;
}

.sas-summary-value.sas-percentage {
    color: #3498db;
}

/* Pie Chart Grid Layout for Subject Attendance */
.sas-subjects-pie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.sas-subject-pie-card {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sas-subject-pie-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.sas-subject-pie-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.sas-subject-pie-header h5 {
    margin: 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
    flex: 1;
}

.sas-subject-percentage {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
}

.sas-pie-chart-container {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
    height: 200px;
}

.sas-pie-chart-container canvas {
    max-width: 200px;
    max-height: 200px;
}

.sas-pie-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sas-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #2c3e50;
}

.sas-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    display: inline-block;
}

.sas-present-color {
    background-color: #27ae60;
}

.sas-absent-color {
    background-color: #e74c3c;
}

.sas-late-color {
    background-color: #f39c12;
}

.sas-no-data {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #7f8c8d;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

/* Mobile responsiveness for pie charts */
@media (max-width: 768px) {
    .sas-subjects-pie-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .sas-subject-pie-card {
        padding: 15px;
    }
    
    .sas-pie-chart-container {
        height: 180px;
    }
    
    .sas-pie-chart-container canvas {
        max-width: 180px;
        max-height: 180px;
    }
    
    .sas-subject-pie-header h5 {
        font-size: 15px;
    }
    
    .sas-subject-percentage {
        padding: 3px 10px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .sas-subjects-pie-grid {
        gap: 12px;
    }
    
    .sas-subject-pie-card {
        padding: 12px;
    }
    
    .sas-pie-chart-container {
        height: 160px;
    }
    
    .sas-pie-chart-container canvas {
        max-width: 160px;
        max-height: 160px;
    }
    
    .sas-legend-item {
        font-size: 12px;
    }
    
    .sas-legend-color {
        width: 14px;
        height: 14px;
    }
    
    /* FIXED: Extra small mobile screens - attendance stats */
    .sas-quick-stats-bar {
        gap: 4px;
        margin: 8px 0;
        padding: 6px 0;
    }
    
    .stats-item {
        min-width: calc(25% - 3px);
        max-width: calc(25% - 3px);
        padding: 4px 2px;
    }
    
    .stats-label {
        font-size: 8px;
        margin-bottom: 1px;
    }
    
    .stats-count {
        font-size: 12px;
    }
    
    .students-header {
        padding: 10px 8px;
    }
}

.sas-subjects-summary {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #e9ecef;
}

.sas-subject-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.2s ease;
}

.sas-subject-row:hover {
    background-color: rgba(52, 152, 219, 0.05);
    border-radius: 6px;
    padding-left: 10px;
    padding-right: 10px;
}

.sas-subject-row:last-child {
    border-bottom: none;
}

.sas-subject-info strong {
    display: block;
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 4px;
}

.sas-subject-info small {
    color: #7f8c8d;
    font-size: 12px;
}

.sas-subject-stats {
    display: flex;
    gap: 15px;
    align-items: center;
}

.sas-subject-stats span {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.sas-subject-stats .sas-present {
    background: #d5f4e6;
    color: #27ae60;
}

.sas-subject-stats .sas-absent {
    background: #fadbd8;
    color: #e74c3c;
}

.sas-subject-stats .sas-late {
    background: #fdeaa7;
    color: #f39c12;
}

.sas-subject-stats .sas-percentage {
    background: #e3f2fd;
    color: #1976d2;
    font-weight: bold;
}

/* History Section */
.sas-history-filters {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sas-form-row {
        flex-direction: column;
    }
    
    .sas-dashboard-nav,
    .sas-scanner-tabs {
        flex-direction: column;
    }
    
    .student-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* FIXED: Mobile attendance history table responsiveness */
    .sas-attendance-grid {
        gap: 8px;
        margin: 10px 0;
        max-width: calc(100vw - 40px);
    }
    
    .attendance-record {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px;
        gap: 8px;
        text-align: left;
    }
    
    .attendance-subject {
        font-size: 16px;
        font-weight: 600;
        margin-bottom: 4px;
    }
    
    .attendance-time {
        font-size: 12px;
        color: #6c757d;
    }
    
    .attendance-status {
        align-self: flex-end;
        margin-top: 8px;
    }
    
    /* FIXED: Ensure attendance history stays within main container */
    #sas-attendance-history,
    #sas-today-attendance {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        margin: 0;
        padding: 0 10px;
        box-sizing: border-box;
    }
    
    /* FIXED: Mobile table container constraints */
    .sas-today-attendance,
    .sas-history-content {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .sas-history-table,
    .sas-attendance-list {
        width: 100%;
        font-size: 14px;
        border-collapse: collapse;
    }
    
    .sas-history-table th,
    .sas-history-table td {
        padding: 8px 4px;
        word-wrap: break-word;
        max-width: 120px;
    }
    
    /* FIXED: Ensure student and teacher dashboard containers stay within viewport */
    .sas-student-dashboard,
    .sas-teacher-dashboard {
        max-width: 100vw;
        margin: 10px auto;
        padding: 15px 10px;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    /* FIXED: Ensure teacher dashboard sections stay within container */
    .sas-teacher-dashboard .sas-qr-section,
    .sas-teacher-dashboard .sas-sessions-section {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    /* FIXED: Ensure QR display and sessions display stay within container */
    .sas-teacher-dashboard #sas-qr-display,
    .sas-teacher-dashboard #sas-sessions-display {
        width: 100%;
        max-width: 100%;
        margin: 15px 0;
        padding: 15px 10px;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    /* FIXED: Mobile responsive QR container */
    .sas-qr-container {
        margin: 15px 0;
        padding: 15px 10px;
        max-width: calc(100vw - 40px);
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    /* FIXED: Mobile responsive sessions display */
    .sas-sessions-display {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        box-sizing: border-box;
    }
    
    .sas-section {
        margin-bottom: 20px;
        padding: 15px 10px;
    }
    
    .attendance-options {
        justify-content: center;
    }
    
    .sas-bulk-action-bar {
        flex-direction: column;
    }
    
    .sas-sessions-grid {
        grid-template-columns: 1fr;
    }
    
    .report-summary-cards {
        grid-template-columns: 1fr;
    }
    
    .sas-report-filters,
    .sas-summary-filters,
    .sas-daily-filters,
    .sas-comprehensive-filters,
    .sas-history-filters,
    .sas-table-filters {
        flex-direction: column;
    }
    
    .sas-filter-group {
        min-width: auto;
        width: 100%;
    }
    
    /* FIXED: Mobile-friendly attendance stats bar */
    .sas-quick-stats-bar {
        gap: 8px;
        margin: 10px 0;
        padding: 8px 0;
        flex-wrap: wrap;
        justify-content: space-around;
        max-width: 100%;
        overflow: visible;
    }
    
    .stats-item {
        flex: 1;
        min-width: calc(25% - 6px);
        max-width: calc(25% - 6px);
        padding: 6px 4px;
        margin: 0;
        font-size: 11px;
    }
    
    .stats-label {
        font-size: 9px;
        margin-bottom: 2px;
        line-height: 1.2;
    }
    
    .stats-count {
        font-size: 14px;
        line-height: 1.2;
    }
    
    /* Ensure students header fits mobile screens */
    .students-header {
        padding: 12px 10px;
        box-sizing: border-box;
        max-width: 100%;
        overflow: hidden;
    }
}

/* Loading States */
.sas-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px;
    color: #6c757d;
}

.sas-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notices */
.sas-notice {
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
    border-left: 4px solid #0073aa;
}

.sas-notice.success {
    background: #d4edda;
    border-left-color: #28a745;
    color: #155724;
}

.sas-notice.error {
    background: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

.sas-notice.warning {
    background: #fff3cd;
    border-left-color: #ffc107;
    color: #856404;
}

.sas-notice.info {
    background: #d1ecf1;
    border-left-color: #17a2b8;
    color: #0c5460;
}

/* Admin Styles */
.sas-admin-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

.sas-admin-section {
    background: white;
    border: 1px solid #ccd0d4;
    border-radius: 6px;
    margin-bottom: 20px;
}

.sas-admin-section h2 {
    margin: 0;
    padding: 15px 20px;
    border-bottom: 1px solid #ccd0d4;
    background: #f9f9f9;
    border-radius: 6px 6px 0 0;
}

.sas-admin-content {
    padding: 20px;
}

/* Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }

.mt-0 { margin-top: 0; }
.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.gap-10 { gap: 10px; }
.gap-15 { gap: 15px; }
.gap-20 { gap: 20px; }

/* Error and Status Messages */
.sas-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    color: #721c24;
    padding: 12px 16px;
    margin: 10px 0;
    font-weight: 500;
}

.sas-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    color: #155724;
    padding: 12px 16px;
    margin: 10px 0;
    font-weight: 500;
}

.sas-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    color: #856404;
    padding: 12px 16px;
    margin: 10px 0;
    font-weight: 500;
}

.sas-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 6px;
    color: #0c5460;
    padding: 12px 16px;
    margin: 10px 0;
    font-weight: 500;
}

/* Print Styles */
@media print {
    .sas-dashboard-nav,
    .sas-scanner-tabs,
    .sas-tab-btn,
    .sas-btn,
    .sas-form-row,
    .sas-bulk-action-bar {
        display: none !important;
    }
    
    .sas-report-table {
        border: 1px solid #000;
    }
    
    .sas-report-table th,
    .sas-report-table td {
        border: 1px solid #000;
        color: #000 !important;
        background: white !important;
    }
}

/* Prevent browser zoom when scanner is active */
body.sas-scanner-active {
    touch-action: pan-x pan-y;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Camera Zoom Controls */
.sas-zoom-controls {
    margin: 20px auto;
    padding: 20px;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-radius: 12px;
    border: 2px solid #2196f3;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.sas-zoom-header {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sas-zoom-header .dashicons {
    color: #1976d2;
    font-size: 20px;
}

.sas-zoom-header label {
    font-weight: 600;
    color: #1976d2;
    font-size: 16px;
    margin: 0;
}

.sas-zoom-control-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.sas-zoom-btn {
    background: #1976d2;
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 20px;
    font-weight: bold;
    touch-action: manipulation;
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3);
}

.sas-zoom-btn:hover {
    background: #1565c0;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.4);
}

.sas-zoom-btn:active {
    transform: scale(0.95);
}

.sas-zoom-btn .dashicons {
    font-size: 18px;
}

.sas-zoom-slider-container {
    flex: 1;
    max-width: 250px;
    text-align: center;
}

.sas-zoom-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #e0e0e0;
    border: none;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    margin-bottom: 8px;
}

.sas-zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #1976d2;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.sas-zoom-slider::-webkit-slider-thumb:hover {
    background: #1565c0;
    transform: scale(1.1);
}

.sas-zoom-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #1976d2;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.sas-zoom-display {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 4px 12px;
    display: inline-block;
    font-weight: 600;
    color: #1976d2;
    font-size: 14px;
    min-width: 50px;
}

.sas-zoom-hint {
    color: #1976d2;
    font-size: 12px;
    margin-top: 5px;
    opacity: 0.8;
    line-height: 1.4;
}
#qr-display {
    background: white;
    border: 3px solid #0073aa;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    margin: 20px auto;
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.15);
    max-width: 1100px; /* Increased to accommodate HD QR codes with padding */
}

/* QR Code container styling - Updated for HD quality */
#qr-display canvas,
#qr-display img {
    border: 3px solid #f0f0f0;
    border-radius: 12px;
    margin: 20px 0;
    display: block;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    max-width: 100%;
    height: auto;
    /* Maintain HD quality while being responsive */
}

/* QR Code info text styling */
.qr-info {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px 16px;
    margin: 15px 0;
    font-size: 14px;
    color: #495057;
    line-height: 1.5;
}

/* Desktop responsive QR codes - Optimize for larger screens */
@media (min-width: 1200px) {
    #qr-display {
        max-width: 1200px; /* Allow larger container for medium desktop screens */
    }
}

@media (min-width: 1440px) {
    #qr-display {
        max-width: 1300px; /* Allow even larger container for large desktop screens */
    }
}

@media (min-width: 1920px) {
    #qr-display {
        max-width: 1500px; /* Maximize container for very large desktop screens */
        padding: 30px; /* Slightly more padding on very large screens */
    }
    
    .qr-info {
        font-size: 16px; /* Larger text on very large screens */
        padding: 16px 20px;
    }
}

/* Mobile responsive QR codes - Updated for HD quality */
@media (max-width: 768px) {
    #qr-display {
        margin: 15px 10px;
        padding: 25px 20px;
        border-width: 3px;
        max-width: calc(100vw - 20px); /* Ensure it fits on mobile screens */
    }
    
    /* Scale HD QR code appropriately on mobile - maintain good scanning quality */
    #qr-display canvas,
    #qr-display img {
        max-width: 100%;
        height: auto;
        width: auto;
        /* Ensure minimum scanning quality even on tablets */
        min-width: 400px;
        min-height: 400px;
    }
    
    .qr-info {
        font-size: 14px;
        padding: 12px 16px;
        font-weight: 500;
    }
    
    /* Better touch targets for mobile */
    .sas-qr-refresh {
        min-height: 48px;
        padding: 14px 20px;
        font-size: 16px;
    }
    
    /* Teacher Dashboard QR Container - Mobile Responsive */
    .sas-qr-container {
        margin: 15px 10px;
        padding: 20px 15px;
        max-width: calc(100vw - 20px);
    }
    
    .sas-qr-code-box {
        padding: 15px;
        margin: 15px 0;
        max-width: 100%;
        overflow: hidden;
    }
    
    /* Teacher Dashboard QR Code - Mobile Responsive */
    #sas-qr-code-display canvas,
    #sas-qr-code-display img {
        max-width: 100%;
        height: auto;
        display: block;
        margin: 0 auto;
        border-radius: 8px;
    }
    
    /* Enhanced QR Scanner for Mobile */
    #sas-qr-reader {
        max-width: 100%;
        margin: 15px 0 25px 0;
        /* Prevent browser zoom on scanner container */
        touch-action: pan-x pan-y;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    /* Prevent browser zoom on video element */
    #sas-qr-reader video {
        touch-action: none;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    /* Ensure adequate spacing for scanner controls on mobile */
    .sas-scanner-controls {
        margin-top: 25px;
        margin-bottom: 20px;
    }
        border-radius: 12px;
        border-width: 3px;
    }
    

    
    /* Zoom controls for mobile - Enhanced for touch accessibility and conflict-free visibility */
    .sas-zoom-controls {
        position: relative !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 9999 !important;
        margin: 15px 10px !important;
        padding: 18px 15px !important;
        background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%) !important;
        border-radius: 12px !important;
        border: 2px solid #2196f3 !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15) !important;
        max-width: calc(100vw - 20px) !important;
        /* Prevent any parent CSS from hiding zoom controls */
        pointer-events: auto !important;
        transform: none !important;
        clip: auto !important;
        clip-path: none !important;
        overflow: visible !important;
    }
    
    .sas-zoom-control-group {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 12px !important;
        margin-bottom: 12px !important;
    }
    
    .sas-zoom-btn {
        position: relative !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 52px !important;
        height: 52px !important;
        font-size: 22px !important;
        background: #1976d2 !important;
        color: white !important;
        border: none !important;
        border-radius: 50% !important;
        cursor: pointer !important;
        touch-action: manipulation !important;
        box-shadow: 0 3px 10px rgba(25, 118, 210, 0.4) !important;
        transition: all 0.2s ease !important;
        z-index: 10000 !important;
    }
    
    .sas-zoom-btn:active {
        transform: scale(0.95);
        background: #1565c0;
    }
    
    .sas-zoom-slider-container {
        max-width: 200px;
    }
    
    .sas-zoom-slider {
        height: 10px;
        border-radius: 5px;
    }
    
    .sas-zoom-slider::-webkit-slider-thumb {
        width: 22px;
        height: 22px;
    }
    
    .sas-zoom-display {
        font-size: 15px;
        padding: 6px 14px;
    }
    
    .sas-zoom-header label {
        font-size: 15px;
    }
    
    .sas-zoom-hint {
        font-size: 12px;
        margin-top: 8px;
    }
    
    /* Improve touch target sizes */
    .sas-scanner-controls button {
        min-height: 48px;
        padding: 14px 24px;
        font-size: 16px;
        touch-action: manipulation;
    }
}

/* Extra small mobile devices - Maintain HD quality */
@media (max-width: 480px) {
    #qr-display {
        margin: 10px 5px;
        padding: 20px 15px;
        max-width: calc(100vw - 10px);
    }
    
    /* Still maintain excellent scanning quality even on small devices */
    #qr-display canvas,
    #qr-display img {
        max-width: 100%;
        height: auto;
        /* Minimum HD quality for reliable scanning on lower-quality cameras */
        min-width: 350px;
        min-height: 350px;
    }
    
    .qr-info {
        font-size: 13px;
        padding: 10px 14px;
    }
    
    /* Teacher Dashboard QR Container - Small Mobile */
    .sas-qr-container {
        margin: 10px 5px;
        padding: 15px 10px;
        max-width: calc(100vw - 10px);
    }
    
    .sas-qr-code-box {
        padding: 10px;
        margin: 10px 0;
    }
    
    /* Teacher Dashboard QR Code - Small Mobile */
    #sas-qr-code-display canvas,
    #sas-qr-code-display img {
        max-width: 100%;
        height: auto;
        min-width: 280px; /* Ensure minimum scannable size */
    }
    
    /* Small mobile QR scanner optimizations */
    #sas-qr-reader {
        margin: 10px 0 20px 0;
        border-radius: 8px;
    }
    
    /* Ensure adequate spacing for scanner controls on small mobile */
    .sas-scanner-controls {
        margin-top: 20px;
        margin-bottom: 15px;
    }
    

    
    /* Compact zoom controls for small screens - Optimized for tiny devices */
    .sas-zoom-controls {
        margin: 12px 5px;
        padding: 15px 12px;
        max-width: calc(100vw - 10px);
    }
    
    .sas-zoom-control-group {
        gap: 10px;
        flex-direction: column;
        align-items: center;
    }
    
    .sas-zoom-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
        margin: 0 5px;
    }
    
    .sas-zoom-slider-container {
        width: 100%;
        max-width: 280px;
        order: 3;
        margin-top: 10px;
    }
    
    .sas-zoom-header label {
        font-size: 14px;
    }
    
    .sas-zoom-hint {
        font-size: 11px;
        margin-top: 10px;
    }
    
    .sas-zoom-display {
        font-size: 14px;
        margin-bottom: 8px;
    }
}

/* QR Stats Animation */
.count-updated {
    background-color: #28a745 !important;
    color: white !important;
    border-radius: 4px;
    padding: 4px 8px;
    transition: all 0.3s ease-in-out;
    transform: scale(1.1);
}

#sas-scan-count {
    display: inline-block;
    transition: all 0.3s ease-in-out;
}

/* Status badges for attendance history */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.status-good {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-badge.status-moderate {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-badge.status-low {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.percentage.status-good {
    color: #155724;
    font-weight: 600;
}

.percentage.status-moderate {
    color: #856404;
    font-weight: 600;
}

.percentage.status-low {
    color: #721c24;
    font-weight: 600;
}

/* Enhanced mobile responsiveness for student dashboard attendance sections */
@media (max-width: 768px) {
    /* Make logout centered on mobile */
    .sas-logout-container {
        justify-content: center;
        margin-bottom: 20px;
    }
    
    .sas-logout-container a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 120px;
        padding: 12px 20px;
        font-size: 16px;
    }
    
    /* Enhanced Today's Attendance mobile layout */
    .sas-today-attendance {
        padding: 15px;
        margin: 15px 0;
        border-radius: 8px;
        overflow-x: hidden;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .sas-today-attendance h3 {
        font-size: 18px;
        margin-bottom: 15px;
        text-align: center;
    }
    
    /* Make attendance grid fully responsive on mobile */
    .sas-attendance-grid {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow: visible;
        gap: 0;
    }
    
    .attendance-record {
        display: block;
        width: 100%;
        max-width: 100%;
        margin-bottom: 12px;
        padding: 15px;
        box-sizing: border-box;
        border-radius: 8px;
        background: #f8f9fa;
        border-left: 4px solid #dee2e6;
        overflow: hidden;
    }
    
    .attendance-subject {
        display: block;
        font-size: 16px;
        font-weight: 600;
        color: #333;
        margin-bottom: 8px;
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
    }
    
    .attendance-time {
        display: block;
        font-size: 14px;
        color: #6c757d;
        margin-bottom: 8px;
    }
    
    .attendance-status {
        display: inline-block;
        padding: 6px 12px;
        border-radius: 16px;
        font-size: 12px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    /* Enhanced Recent Attendance History mobile layout */
    .sas-history-content {
        padding: 15px;
        margin: 15px 0;
        border-radius: 8px;
        overflow-x: hidden;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .sas-history-content h3 {
        font-size: 18px;
        margin-bottom: 15px;
        text-align: center;
    }
    
    /* Replace table with mobile-friendly cards for history */
    .history-table-container {
        overflow: visible;
        max-width: 100%;
    }
    
    .sas-history-table {
        display: none; /* Hide table on mobile */
    }
    
    /* Create mobile-friendly history display */
    .sas-history-mobile {
        display: block;
        width: 100%;
    }
    
    .history-record-card {
        background: #fff;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        padding: 15px;
        margin-bottom: 12px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
    
    .history-record-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 10px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .history-record-date {
        font-weight: 600;
        color: #333;
        font-size: 14px;
    }
    
    .history-record-subject {
        font-weight: 600;
        color: #0073aa;
        font-size: 16px;
        margin-bottom: 8px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

/* ====== MODERN DASHBOARD ENHANCEMENTS ====== */

/* Modern Admin Dashboard Styles */
.sas-admin-dashboard {
    background: #f8f9fa;
    border-radius: 20px;
    padding: 30px;
    margin: 20px 0;
}

.sas-admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.sas-admin-stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 6px 25px rgba(0,0,0,0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.sas-admin-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
}

.sas-admin-stat-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.sas-admin-stat-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.sas-admin-stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    margin-right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.sas-admin-stat-icon.students {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.sas-admin-stat-icon.teachers {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.sas-admin-stat-icon.sessions {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.sas-admin-stat-icon.attendance {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.sas-admin-stat-content h3 {
    margin: 0 0 8px 0;
    color: #6c757d;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.sas-admin-stat-value {
    font-size: 36px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.sas-admin-stat-change {
    font-size: 14px;
    font-weight: 600;
    margin-top: 8px;
}

.sas-admin-stat-change.positive {
    color: #28a745;
}

.sas-admin-stat-change.negative {
    color: #dc3545;
}

/* Modern Progress Bars */
.sas-progress-container {
    margin-top: 16px;
}

.sas-progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
    color: #6c757d;
}

.sas-progress-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.sas-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Modern Chart Container */
.sas-chart-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin: 24px 0;
    box-shadow: 0 6px 25px rgba(0,0,0,0.1);
}

.sas-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.sas-chart-title {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

.sas-chart-filters {
    display: flex;
    gap: 12px;
}

.sas-chart-filter {
    padding: 8px 16px;
    border: 2px solid #e9ecef;
    border-radius: 20px;
    background: white;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.sas-chart-filter:hover,
.sas-chart-filter.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Enhanced Table Styles */
.sas-modern-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 25px rgba(0,0,0,0.1);
    margin: 24px 0;
}

.sas-modern-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.sas-modern-table thead th {
    padding: 20px 16px;
    text-align: left;
    color: white;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sas-modern-table tbody tr {
    transition: background-color 0.3s ease;
}

.sas-modern-table tbody tr:hover {
    background-color: #f8f9fa;
}

.sas-modern-table tbody td {
    padding: 16px;
    border-bottom: 1px solid #e9ecef;
    color: #495057;
}

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

/* Status Badges Enhancement */
.sas-status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sas-status-badge.present {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
}

.sas-status-badge.absent {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
}

.sas-status-badge.late {
    background: linear-gradient(135deg, #feca57 0%, #ff9ff3 100%);
    color: white;
}

/* Method badge styles */
.sas-method-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    margin-left: 8px;
}

.sas-method-badge.qr {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
}

.sas-method-badge.manual {
    background: linear-gradient(135deg, #3498db 0%, #5dade2 100%);
    color: white;
}

.sas-method-badge.auto {
    background: linear-gradient(135deg, #f39c12 0%, #f5b041 100%);
    color: white;
}

/* Mobile responsive adjustments for method badges */
@media (max-width: 768px) {
    .sas-method-badge {
        padding: 3px 6px;
        font-size: 10px;
        margin-left: 0;
        margin-top: 5px;
    }
    
    .attendance-method {
        margin-top: 8px;
    }
}

/* Donut Chart Styles */
.sas-donut-container {
    position: relative;
    display: inline-block;
}

.sas-donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.sas-donut-value {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
}

.sas-donut-label {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Enhanced Student Dashboard Cards */
.sas-student-stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.sas-student-stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 6px 25px rgba(0,0,0,0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.sas-student-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
}

.sas-student-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.15);
}

/* Student Stats Breakdown */
.sas-student-stats-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
    margin-top: 16px;
}

.sas-stat-item {
    text-align: center;
    font-size: 13px;
}

/* Admin Layout Enhancements */
.sas-admin-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.sas-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-style: italic;
}

/* Enhanced status badge styles */
.sas-status-badge.excused {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
}

/* Chart height adjustments */
.sas-chart-container canvas {
    max-height: 400px;
}

/* Student Attendance Pie Chart Styles */
.sas-student-stat-card .sas-chart-container {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
    margin: 15px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sas-student-stat-card .sas-chart-container canvas {
    max-width: 180px;
    max-height: 180px;
}

/* Session Management Mobile Responsiveness */
.sas-sessions-mobile {
    display: none; /* Hidden by default, shown on mobile */
}

.sas-desktop-only {
    display: block; /* Shown by default, hidden on mobile */
}

.sas-mobile-only {
    display: none; /* Hidden by default, shown on mobile */
}

/* Session card styles for mobile */
.session-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s ease;
}

.session-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.session-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.session-card-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.session-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

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

.session-status.status-completed {
    background: #cce7ff;
    color: #004085;
}

.session-status.status-pending {
    background: #fff3cd;
    color: #856404;
}

.session-card-body {
    margin-bottom: 12px;
}

.session-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 4px 0;
}

.session-label {
    font-weight: 600;
    color: #666;
    min-width: 60px;
}

.session-value {
    color: #333;
    text-align: right;
    flex: 1;
}

.session-card-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px solid #eee;
}

.session-card-actions .sas-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    font-size: 14px;
}

.session-card-actions .dashicons {
    font-size: 16px;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .sas-desktop-only {
        display: none !important;
    }
    
    .sas-mobile-only {
        display: block !important;
    }
    
    .sessions-table-container {
        overflow: visible;
    }
    
    .sas-sessions-content h3 {
        text-align: center;
        margin-bottom: 20px;
        font-size: 20px;
    }
}
@media (max-width: 768px) {
    .sas-admin-stats {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .sas-admin-stat-card {
        padding: 20px;
    }
    
    .sas-admin-stat-icon {
        width: 48px;
        height: 48px;
        font-size: 24px;
        margin-right: 16px;
    }
    
    .sas-admin-stat-value {
        font-size: 28px;
    }
    
    .sas-chart-container {
        padding: 20px;
    }
    
    .sas-chart-filters {
        flex-wrap: wrap;
    }
    
    .report-summary-cards {
        grid-template-columns: 1fr;
    }
    
    .sas-student-stat-cards {
        grid-template-columns: 1fr;
    }
    
    .sas-admin-row {
        grid-template-columns: 1fr;
    }
}
    
    .history-record-stats {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 8px;
        margin-top: 10px;
    }
    
    .history-stat {
        text-align: center;
        padding: 8px;
        background: #f8f9fa;
        border-radius: 6px;
    }
    
    .history-stat-label {
        display: block;
        font-size: 11px;
        color: #6c757d;
        text-transform: uppercase;
        font-weight: 600;
        letter-spacing: 0.5px;
        margin-bottom: 4px;
    }
    
    .history-stat-value {
        display: block;
        font-size: 14px;
        font-weight: 600;
        color: #333;
    }
    
    .history-stat-value.present {
        color: #28a745;
    }
    
    .history-stat-value.late {
        color: #fd7e14;
    }
    
    .history-stat-value.absent {
        color: #dc3545;
    }
    
    .history-stat-value.percentage {
        color: #0073aa;
    }
}

/* Show mobile version only on mobile */
@media (min-width: 769px) {
    .sas-history-mobile {
        display: none;
    }
}

/* Additional mobile styles for admin pages */
@media (max-width: 768px) {
    /* Admin page headers */
    .wrap h1 {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    /* WordPress admin tables mobile improvements */
    .wp-list-table.widefat {
        font-size: 12px;
        overflow-x: auto;
        display: block;
        white-space: nowrap;
    }
    
    .wp-list-table.widefat th,
    .wp-list-table.widefat td {
        padding: 8px 4px;
    }
    
    /* Admin notices mobile */
    .notice {
        margin: 10px 0;
        padding: 10px;
    }
    
    /* Form elements in admin */
    .sas-filter-group select,
    .sas-filter-group input,
    .sas-form-group select,
    .sas-form-group input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    /* Admin button adjustments */
    .button {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .button-large {
        padding: 10px 16px;
        font-size: 16px;
    }
}

/* Modern Today's Attendance Styles */
.sas-today-attendance-modern {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    margin-top: 30px;
    padding: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.sas-attendance-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 20px 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.sas-attendance-header .dashicons {
    color: white;
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.sas-attendance-header h4 {
    color: white !important;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    flex: 1;
}

.sas-attendance-date {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
}

.sas-modern-attendance-list {
    padding: 20px 25px;
    background: white;
    min-height: 200px;
}

.sas-modern-attendance-list .sas-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 160px;
    color: #666;
    gap: 10px;
}

.sas-modern-attendance-list .sas-loading .dashicons {
    animation: spin 1s linear infinite;
}

.sas-attendance-item-modern {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #dee2e6;
    transition: all 0.3s ease;
}

.sas-attendance-item-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.sas-attendance-item-modern.present {
    border-left-color: #28a745;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
}

.sas-attendance-item-modern.late {
    border-left-color: #fd7e14;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
}

.sas-attendance-item-modern.absent {
    border-left-color: #dc3545;
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
}

.sas-attendance-item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sas-attendance-subject-modern {
    font-weight: 600;
    font-size: 16px;
    color: #2c3e50;
}

.sas-attendance-time-modern {
    font-size: 14px;
    color: #6c757d;
}

.sas-attendance-status-modern {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.sas-attendance-status-modern.present {
    background: #28a745;
    color: white;
}

.sas-attendance-status-modern.late {
    background: #fd7e14;
    color: white;
}

.sas-attendance-status-modern.absent {
    background: #dc3545;
    color: white;
}

.sas-attendance-status-modern .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.sas-no-attendance-modern {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.sas-no-attendance-modern .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

@media (max-width: 768px) {
    .sas-today-attendance-modern {
        margin-top: 20px;
    }
    
    .sas-attendance-header {
        padding: 15px 20px;
    }
    
    .sas-modern-attendance-list {
        padding: 15px 20px;
    }
    
    .sas-attendance-item-modern {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px 15px;
    }
    
    .sas-attendance-status-modern {
        align-self: flex-end;
    }
}

/* Message Styles */
.sas-message-container {
    margin-bottom: 20px;
}

.sas-message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 10px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sas-message-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.sas-message-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.sas-message-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.sas-message-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* Scan Result Styles */
.sas-scan-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1px solid #28a745;
    color: #155724;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin: 15px 0;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}

.sas-scan-success .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: #28a745;
    margin-bottom: 8px;
}

.sas-scan-error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 1px solid #dc3545;
    color: #721c24;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin: 15px 0;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.2);
}

.sas-scan-error .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: #dc3545;
    margin-bottom: 8px;
}

/* Success Popup Styles */
.sas-success-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

.sas-success-popup {
    background: white;
    border-radius: 16px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: popupSlideUp 0.3s ease-out;
}

@keyframes popupSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.sas-popup-header {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sas-popup-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.sas-popup-title .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: white;
}

.sas-popup-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.sas-popup-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sas-popup-content {
    padding: 24px;
}

.sas-success-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.sas-summary-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #28a745;
}

.sas-label {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.sas-value {
    font-weight: 500;
    color: #2c3e50;
    font-size: 14px;
    text-align: right;
}

.sas-success-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.sas-stat-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

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

.sas-stat-card.success {
    border-color: #28a745;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
}

.sas-stat-card.total {
    border-color: #007bff;
    background: linear-gradient(135deg, #cce7ff 0%, #b6d7ff 100%);
}

.sas-stat-card.error {
    border-color: #dc3545;
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
}

.sas-stat-number {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 8px;
    color: #2c3e50;
}

.sas-stat-card.success .sas-stat-number {
    color: #155724;
}

.sas-stat-card.total .sas-stat-number {
    color: #004085;
}

.sas-stat-card.error .sas-stat-number {
    color: #721c24;
}

.sas-stat-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
}

.sas-success-message {
    background: #e7f4fd;
    border: 1px solid #b6d7ff;
    border-radius: 8px;
    padding: 16px;
    color: #004085;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
}

.sas-popup-footer {
    padding: 16px 24px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    text-align: right;
}

.sas-popup-footer .sas-btn {
    min-width: 100px;
}

/* Mobile responsiveness for popup */
@media (max-width: 768px) {
    .sas-success-popup {
        width: 95%;
        max-width: none;
    }
    
    .sas-popup-header {
        padding: 16px 20px;
    }
    
    .sas-popup-title {
        font-size: 16px;
    }
    
    .sas-popup-content {
        padding: 20px;
    }
    
    .sas-success-summary {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .sas-success-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .sas-stat-card {
        padding: 16px;
    }
    
    .sas-stat-number {
        font-size: 24px;
    }
    
    .sas-popup-footer {
        padding: 12px 20px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .sas-success-stats {
        grid-template-columns: 1fr;
    }
    
    /* Student controls responsive */
    .sas-controls-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .sas-search-group,
    .sas-filter-group {
        min-width: auto;
    }
    
    .sas-top-action-bar.sas-bulk-action-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .sas-top-action-bar .sas-btn {
        margin-bottom: 8px;
    }
}

/* Live Session Indicators for Sessions Breakdown */
.live-session-row {
    background-color: rgba(40, 167, 69, 0.05) !important;
    border-left: 4px solid #28a745;
}

.live-session-dot,
.completed-session-dot {
    font-size: 16px;
    display: inline-block;
    transition: transform 0.2s ease;
}

.live-session-dot:hover,
.completed-session-dot:hover {
    transform: scale(1.2);
}

.sessions-legend {
    font-size: 14px;
    line-height: 1.5;
}

.sessions-legend .live-session-dot,
.sessions-legend .completed-session-dot {
    font-size: 14px;
    margin-right: 5px;
}

/* Live session pulse animation */
.live-session-dot {
    animation: livePulse 2s infinite;
}

@keyframes livePulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* Mobile responsiveness for sessions breakdown legend */
@media (max-width: 768px) {
    .sessions-legend {
        text-align: center;
        font-size: 13px;
    }
    
    .live-session-row {
        border-left-width: 3px;
    }
}
}