* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f7fa;
    color: #2c3e50;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0 2rem;
}

.navbar-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-right: 2rem;
}

.navbar-links {
    display: flex;
    gap: 1.5rem;
    flex: 1;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

    .nav-link:hover {
        background-color: #34495e;
    }

.navbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-label {
    color: #bdc3c7;
    font-size: 0.875rem;
}

.user-name {
    font-weight: 600;
}

.user-role {
    color: #bdc3c7;
    font-size: 0.875rem;
}

.school-badge {
    background-color: #3498db;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

    .page-header h2 {
        font-size: 2rem;
        color: #2c3e50;
    }

/* Buttons */
.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

    .btn-primary:hover {
        background-color: #2980b9;
    }

.btn-secondary {
    background-color: #95a5a6;
    color: white;
    transition: all 0.2s ease;
}

    .btn-secondary:hover {
        filter: brightness(0.85);
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    }

    .btn-secondary:active {
        transform: translateY(0);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    }

.btn-danger {
    background-color: #e74c3c;
    color: white;
    transition: all 0.2s ease;
}

    .btn-danger:hover {
        filter: brightness(0.85);
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    }

    .btn-danger:active {
        transform: translateY(0);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    }

.btn-success {
    background-color: #27ae60;
    color: white;
    transition: all 0.2s ease;
}

    .btn-success:hover {
        filter: brightness(0.85);
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    }

    .btn-success:active {
        transform: translateY(0);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    }

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.813rem;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Cards */
.schools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.school-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

    .school-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }

    .school-card h3 {
        margin-bottom: 0.75rem;
        color: #2c3e50;
    }

.school-address {
    color: #7f8c8d;
    margin-bottom: 0.5rem;
}

.school-postcode {
    color: #95a5a6;
    margin-bottom: 1rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

    .form-group label {
        display: block;
        margin-bottom: 0.5rem;
        font-weight: 600;
        color: #2c3e50;
    }

.form-control {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid #dfe6e9;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

/* Dropdown arrow for select elements */
select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23636e72' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px;
    padding-right: 2.5rem;
    cursor: pointer;
}

/* form-select class (same as form-control for selects) */
.form-select {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid #dfe6e9;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23636e72' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px;
    background-color: white;
    padding-right: 2.5rem;
    cursor: pointer;
}

    .form-select:hover,
    select.form-control:hover {
        border-color: #b2bec3;
    }

    .form-select:focus {
        outline: none;
        border-color: #3498db;
    }

.form-control:focus {
    outline: none;
    border-color: #3498db;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

    .data-table thead {
        background-color: #34495e;
        color: white;
    }

    .data-table th {
        padding: 1rem;
        text-align: left;
        font-weight: 600;
    }

    .data-table td {
        padding: 1rem;
        border-bottom: 1px solid #ecf0f1;
    }

    .data-table tbody tr:hover {
        background-color: #f8f9fa;
    }

.selected-row {
    background-color: #e3f2fd !important;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.813rem;
    font-weight: 600;
}

.badge-success {
    background-color: #27ae60;
    color: white;
}

.badge-danger {
    background-color: #e74c3c;
    color: white;
}

.badge-info {
    background-color: #3498db;
    color: white;
}

.badge-inactive {
    background-color: #95a5a6;
    color: white;
}

.badge-secondary {
    background-color: #ecf0f1;
    color: #7f8c8d;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    width: 550px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

    /* Smaller modals for confirmations and simple actions */
    .modal-content.modal-small {
        width: 450px;
    }

    /* Larger modals for complex forms if needed */
    .modal-content.modal-large {
        width: 700px;
    }

    .modal-content h3 {
        margin-bottom: 1.5rem;
        color: #2c3e50;
    }

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: flex-end;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 420px;
}

    .login-card h2 {
        margin-bottom: 0.5rem;
        color: #2c3e50;
        text-align: center;
    }

.login-subtitle {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 2rem;
}

.default-credentials {
    margin-top: 2rem;
    padding: 1rem;
    background-color: #ecf0f1;
    border-radius: 6px;
    font-size: 0.875rem;
}

    .default-credentials code {
        background-color: white;
        padding: 0.25rem 0.5rem;
        border-radius: 3px;
        font-family: monospace;
    }

/* Change Password Page */
.change-password-container {
    max-width: 600px;
    margin: 0 auto;
}

.change-password-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    background: white;
    padding: 2rem 3rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

    .loading-spinner p {
        margin: 0;
        font-size: 1.125rem;
        color: #2c3e50;
        font-weight: 600;
    }

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #7f8c8d;
    background: white;
    border-radius: 8px;
}

/* Academic Years */
.academic-year-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.year-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #ecf0f1;
}

.terms-list {
    margin: 1rem 0;
}

.term-item {
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

.term-info {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.week-count {
    color: #7f8c8d;
    font-size: 0.875rem;
}

/* Attendance Specific */
.attendance-filters {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

    .attendance-filters .form-group {
        flex: 1;
        margin-bottom: 0;
    }

.attendance-entry {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.daily-attendance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1rem 0 2rem 0;
}

.day-attendance label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.attendance-summary {
    display: flex;
    gap: 2rem;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    margin: 1.5rem 0;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pupils-list {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

    .pupils-list h3 {
        margin-bottom: 1rem;
    }

/* Responsive Design */
@media (max-width: 768px) {
    .navbar-content {
        flex-direction: column;
        gap: 1rem;
    }

    .navbar-links {
        flex-wrap: wrap;
    }

    .schools-grid {
        grid-template-columns: 1fr;
    }

    .attendance-filters {
        flex-direction: column;
    }

    .daily-attendance-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        min-width: auto;
        width: 95%;
    }
}

/* Blazor Error UI */
#blazor-error-ui {
    background: #ffebe9;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

/* Footer */
.app-footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 2rem 0;
    margin-top: auto;
    border-top: 3px solid #3498db;
}

.footer-content {
    width: 100%;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-logo {
    font-size: 2rem;
}

.footer-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
}

.footer-text {
    text-align: right;
}

    .footer-text p {
        margin: 0.25rem 0;
        font-size: 0.9rem;
        color: #bdc3c7;
    }

    .footer-text a {
        margin: 0.25rem 0;
        font-size: 0.9rem;
        color: #bdc3c7;
    }

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .footer-text {
        text-align: center;
    }
}

/* Whole School Summary */
.whole-school-summary {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
}

    .summary-card.main-stat {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
    }

    .summary-card.best {
        border-left: 4px solid #27ae60;
    }

    .summary-card.worst {
        border-left: 4px solid #e74c3c;
    }

.summary-icon {
    font-size: 3rem;
    opacity: 0.9;
}

.summary-content {
    flex: 1;
}

.summary-label {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.summary-card.main-stat .summary-label {
    color: rgba(255,255,255,0.9);
}

.summary-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    color: #2c3e50;
}

.summary-card.main-stat .summary-value {
    color: white;
}

.summary-subtitle {
    font-size: 0.75rem;
    color: #7f8c8d;
    margin-top: 0.25rem;
}

.summary-card.main-stat .summary-subtitle {
    color: rgba(255,255,255,0.8);
}

/* Filter Controls */
.filter-controls {
    background: white;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
}

    .filter-checkbox input[type="checkbox"] {
        width: 18px;
        height: 18px;
        cursor: pointer;
    }

.filter-info {
    color: #7f8c8d;
    font-size: 0.875rem;
}

/* Sortable Table */
.sortable-table th {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s, color 0.2s;
}

    .sortable-table th:hover {
        background-color: #f0f4f8;
        color: #2c3e50;
    }

.table-subtitle {
    color: #7f8c8d;
    font-size: 0.875rem;
    margin-top: -0.5rem;
    margin-bottom: 1rem;
}

/* Performance Indicators */
.difference {
    font-weight: 700;
    font-size: 1.1rem;
}

    .difference.positive {
        color: #27ae60;
    }

    .difference.negative {
        color: #e74c3c;
    }

    .difference.neutral {
        color: #7f8c8d;
    }

.performance-indicator {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
}

.performance-excellent {
    background-color: #d4edda;
    color: #155724;
}

.performance-good {
    background-color: #d1ecf1;
    color: #0c5460;
}

.performance-neutral {
    background-color: #e2e3e5;
    color: #383d41;
}

.performance-fair {
    background-color: #fff3cd;
    color: #856404;
}

.performance-poor {
    background-color: #f8d7da;
    color: #721c24;
}

@media (max-width: 1200px) {
    .whole-school-summary {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .filter-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .summary-card {
        flex-direction: column;
        text-align: center;
    }
}

/* Attendance Page Enhancements */
.pupil-info {
    color: #7f8c8d;
    font-size: 1rem;
    margin-top: 0.5rem;
}

.missing-week-badge {
    display: inline-block;
    background-color: #fff3cd;
    color: #856404;
    padding: 0.5rem 1rem;
    margin: 0.25rem;
    border-radius: 6px;
    border: 1px solid #ffeaa7;
    cursor: pointer;
    transition: all 0.2s;
}

    .missing-week-badge:hover {
        background-color: #ffeaa7;
        transform: translateY(-1px);
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

.missing-weeks-section {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

    .missing-weeks-section h3 {
        margin-top: 0;
        color: #2c3e50;
    }

.missing-weeks-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.missing-week-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: #f8f9fa;
    border-left: 4px solid #f39c12;
    border-radius: 6px;
    transition: all 0.2s;
}

    .missing-week-card:hover {
        background-color: #fff3cd;
        transform: translateX(4px);
    }

.week-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

    .week-info strong {
        font-size: 1.1rem;
        color: #2c3e50;
    }

    .week-info span {
        font-size: 0.9rem;
        color: #7f8c8d;
    }

.pupil-selection {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

    .pupil-selection h3 {
        margin-top: 0;
        margin-bottom: 1.5rem;
    }

.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

    .entry-header h3 {
        margin: 0;
    }

.info-section {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 4px solid #27ae60;
}

    .info-section h3 {
        margin-top: 0;
        color: #27ae60;
    }

    .info-section p {
        color: #7f8c8d;
        margin-bottom: 0.5rem;
    }

/* RAG Callout Boxes */
.rag-callout {
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    border-left: 4px solid;
}

    .rag-callout.rag-green {
        background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
        border-left-color: #28a745;
    }

    .rag-callout.rag-amber {
        background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
        border-left-color: #ffc107;
    }

    .rag-callout.rag-red {
        background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
        border-left-color: #dc3545;
    }

.callout-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.callout-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: #2c3e50;
}

.callout-value {
    font-size: 2rem;
    font-weight: bold;
    color: #2c3e50;
}

.callout-status {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2c3e50;
}

/* New: Two-column whole school attendance callout */
.whole-school-attendance-callout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.attendance-column {
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 5px solid;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 140px;
}

    .attendance-column .column-label {
        font-size: 0.95rem;
        font-weight: 600;
        margin-bottom: 0.75rem;
        color: #2c3e50;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .attendance-column .column-value {
        font-size: 2.5rem;
        font-weight: bold;
        margin-bottom: 0.5rem;
        color: #1a1a1a;
    }

    .attendance-column .column-status {
        font-size: 0.85rem;
        font-weight: 500;
        opacity: 0.9;
    }

/* Grey column for previous attendance */
.grey-column {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-left-color: #6c757d;
}

    .grey-column .column-value {
        color: #495057;
    }

    .grey-column .column-label,
    .grey-column .column-status {
        color: #495057;
    }

/* Green column for meeting/exceeding */
.green-column {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-left-color: #28a745;
}

    .green-column .column-value {
        color: #155724;
    }

    .green-column .column-label,
    .green-column .column-status {
        color: #155724;
    }

/* Red column for below previous */
.red-column {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-left-color: #dc3545;
}

    .red-column .column-value {
        color: #721c24;
    }

    .red-column .column-label,
    .red-column .column-status {
        color: #721c24;
    }

/* Responsive: Stack on mobile */
@media (max-width: 768px) {
    .whole-school-attendance-callout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .attendance-column .column-value {
        font-size: 2rem;
    }
}

font-size: 0.9rem;
font-weight: 600;
color: #34495e;
text-transform: uppercase;
letter-spacing: 0.5px;
}

/* Attendance Grid */
.attendance-grid-container {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow-x: auto;
}

.attendance-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

    .attendance-grid th {
        background-color: #34495e;
        color: white;
        padding: 0.75rem 0.5rem;
        text-align: center;
        font-weight: 600;
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .attendance-grid td {
        padding: 0.5rem;
        border-bottom: 1px solid #ecf0f1;
        text-align: center;
    }

    .attendance-grid tbody tr:hover {
        background-color: #f8f9fa;
    }

.week-col {
    min-width: 60px;
}

.expected-col {
    min-width: 100px;
}

.day-col {
    min-width: 110px;
}

.total-col {
    min-width: 90px;
}

.percent-col {
    min-width: 120px;
}

.week-number {
    font-weight: 600;
    color: #2c3e50;
}

.editable-cell {
    width: 100%;
    padding: 0.4rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    text-align: center;
}

    .editable-cell:focus {
        outline: none;
        border-color: #3498db;
        box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
    }

.expected-input {
    max-width: 100px;
}

/* Add dropdown arrow to expected-input select */
select.expected-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%23636e72' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 10px;
    padding-right: 2rem;
    cursor: pointer;
}

.day-input {
    max-width: 100px;
}

/* Add dropdown arrow to day-input select */
select.day-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%23636e72' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 10px;
    padding-right: 2rem;
    cursor: pointer;
}

.calculated-cell {
    font-weight: 600;
    background-color: #f8f9fa;
}

    .calculated-cell.rag-green {
        color: #28a745;
    }

    .calculated-cell.rag-amber {
        color: #ffc107;
    }

    .calculated-cell.rag-red {
        color: #dc3545;
    }

/* Dashboard Enhancements */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

    .dashboard-header h2 {
        font-size: 2rem;
        color: #2c3e50;
    }

.year-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
}

    .year-selector label {
        font-weight: 600;
        color: #2c3e50;
        margin: 0;
    }

    .year-selector .form-control {
        min-width: 200px;
    }

.attendance-badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
}

    .attendance-badge.rag-green {
        background-color: #d4edda;
        color: #155724;
    }

    .attendance-badge.rag-amber {
        background-color: #fff3cd;
        color: #856404;
    }

    .attendance-badge.rag-red {
        background-color: #f8d7da;
        color: #721c24;
    }

.info-message {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    color: #7f8c8d;
    margin: 2rem 0;
}

.readonly-notice {
    background: #e8f4f8;
    border-left: 4px solid #3498db;
    color: #2c3e50;
}

.loading {
    text-align: center;
    padding: 3rem;
    font-size: 1.2rem;
    color: #7f8c8d;
}

.editable-cell:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Dashboard Styles */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

    .kpi-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    }

.kpi-icon {
    font-size: 3rem;
    opacity: 0.9;
}

.kpi-content {
    flex: 1;
}

.kpi-label {
    font-size: 0.875rem;
    color: #7f8c8d;
    margin-bottom: 0.25rem;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.2;
}

.kpi-subtitle {
    font-size: 0.75rem;
    color: #95a5a6;
    margin-top: 0.25rem;
}

.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chart-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.chart-card h3 {
    margin-top: 0;
    margin-bottom: 0;
    color: #2c3e50;
    font-size: 1.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1;
}

.chart-card canvas {
    max-height: 300px;
}

.attendance-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.875rem;
}

.badge-excellent {
    background-color: #d4edda;
    color: #155724;
}

.badge-good {
    background-color: #d1ecf1;
    color: #0c5460;
}

.badge-fair {
    background-color: #fff3cd;
    color: #856404;
}

.badge-poor {
    background-color: #f8d7da;
    color: #721c24;
}

.progress-bar {
    width: 100%;
    height: 24px;
    background-color: #ecf0f1;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2980b9);
    transition: width 0.3s ease;
    border-radius: 12px;
}

.performers-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.performer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #27ae60;
}

    .performer-item.attention {
        border-left-color: #e74c3c;
        background-color: #fff5f5;
    }

.performer-name {
    font-weight: 600;
    color: #2c3e50;
}

.performer-rate {
    font-size: 1.125rem;
    font-weight: 700;
    color: #27ae60;
}

.performer-item.attention .performer-rate {
    color: #e74c3c;
}

.no-data {
    text-align: center;
    padding: 2rem;
    color: #95a5a6;
    font-style: italic;
}

@media (max-width: 768px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .charts-row {
        grid-template-columns: 1fr;
    }

    .kpi-card {
        flex-direction: column;
        text-align: center;
    }
}

/* Seed Data Progress Display */
.progress-box {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.progress-messages {
    max-height: 400px;
    overflow-y: auto;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.progress-message {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

    .progress-message:last-child {
        border-bottom: none;
    }

/* Users Page Filters */
.filters-section {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

    .filters-section .form-group {
        margin-bottom: 0;
    }

.mb-3 {
    margin-bottom: 1rem;
}

/* Help Notice */
.help-notice {
    background: #e7f3ff;
    border-left: 4px solid #2196F3;
    color: #1565C0;
    margin-bottom: 1.5rem;
}

    .help-notice strong {
        color: #0D47A1;
    }

/* Navigation Dropdown */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    min-width: 200px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    margin-top: 0.25rem;
    z-index: 1000;
    padding: 0.5rem 0;
}

    .nav-dropdown:hover .dropdown-menu,
    .dropdown-menu:hover {
        display: block;
    }

.dropdown-item {
    display: block;
    padding: 0.75rem 1.25rem;
    color: #2c3e50;
    text-decoration: none;
    transition: background-color 0.2s;
}

    .dropdown-item:hover {
        background-color: #f0f4f8;
        color: #2c3e50;
    }

.dropdown-divider {
    height: 1px;
    background-color: #e0e0e0;
    margin: 0.5rem 0;
}

/* Adjust navbar to accommodate dropdown */
.navbar-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Action Buttons Spacing */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Help Button */
.btn-help {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border: 1px solid #34495e;
    background: #34495e; /* Dark background by default */
    color: white; /* White text by default */
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

    .btn-help:hover {
        background: white; /* White background on hover */
        border-color: #34495e;
        color: #34495e; /* Dark text on hover */
    }

    .btn-help:active {
        background: #f0f0f0;
    }

/* White question mark in help button (default dark background) */
.help-icon {
    color: #ffffff;
    font-weight: bold;
    font-size: 1.1em;
    margin-right: 0.25rem;
}

/* Change question mark to dark when background is white (on hover without school branding) */
.btn-help:hover .help-icon {
    color: #34495e;
}

/* School Branding Page Styles */
.loading-section {
    text-align: center;
    padding: 3rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 2rem 0;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.suggestion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.suggestion-card {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

    .suggestion-card:hover {
        border-color: #3498db;
        box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
    }

    .suggestion-card.selected {
        border-color: #27ae60;
        background: #e8f5e9;
        box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
    }

.logo-preview {
    width: 100%;
    height: 100px;
    background: #f5f5f5;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
}

    .logo-preview img {
        max-width: 90%;
        max-height: 90px;
        object-fit: contain;
    }

.color-preview {
    width: 100%;
    height: 70px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.color-preview-small {
    height: 50px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.color-value {
    font-family: monospace;
    font-size: 14px;
    color: #555;
    text-align: center;
    margin-top: 0.5rem;
}

.color-value-small {
    font-family: monospace;
    font-size: 12px;
    color: #666;
    text-align: center;
    margin-top: 0.25rem;
}

.status {
    padding: 1rem 1.5rem;
    border-radius: 6px;
    margin: 1rem 0;
    font-weight: 500;
}

    .status.success {
        background: #d4edda;
        color: #155724;
        border-left: 4px solid #28a745;
    }

    .status.warning {
        background: #fff3cd;
        color: #856404;
        border-left: 4px solid #ffc107;
    }

.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #6c757d;
}

.section {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

    .section h3 {
        margin-top: 0;
        color: #2c3e50;
        border-bottom: 2px solid #ecf0f1;
        padding-bottom: 0.5rem;
        margin-bottom: 1.5rem;
    }

.preview-header {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Navbar title link hover */
.navbar-title a:hover {
    opacity: 0.9;
}

/* Bulk Actions Bar */
.bulk-actions-bar {
    padding: 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
}

    .checkbox-label input[type="checkbox"] {
        cursor: pointer;
        width: 18px;
        height: 18px;
    }

/* Validation Summary */
.validation-summary {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-left: 4px solid #ffc107;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
}

    .validation-summary strong {
        color: #856404;
        display: block;
        margin-bottom: 0.5rem;
    }

    .validation-summary ul {
        margin: 0;
        padding-left: 1.5rem;
        color: #856404;
    }

    .validation-summary li {
        margin: 0.25rem 0;
    }

/* ============================================
   Environment Banner Styles
   ============================================ */

.env-banner {
    width: 100%;
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    animation: slideDown 0.3s ease-out;
}

.env-banner-dev {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border-bottom: 3px solid #1e7e34;
}

.env-banner-staging {
    background: linear-gradient(135deg, #ffc107 0%, #ffca2c 100%);
    color: #856404;
    border-bottom: 3px solid #d39e00;
}

.env-badge {
    font-size: 0.9rem;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.env-info {
    font-size: 0.85rem;
    opacity: 0.95;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .env-banner {
        padding: 0.6rem 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .env-badge {
        font-size: 0.8rem;
    }

    .env-info {
        font-size: 0.75rem;
        text-align: center;
    }
}

/* ============================================
   System Diagnostics Page Styles
   ============================================ */

.diagnostics-container {
    max-width: 1200px;
    margin: 0 auto;
}

.diagnostics-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

    .diagnostics-header h1 {
        margin: 0 0 0.5rem 0;
        font-size: 2rem;
    }

    .diagnostics-header p {
        margin: 0;
        opacity: 0.95;
    }

.diagnostic-section {
    background: white;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid #e1e8ed;
}

    .diagnostic-section h2 {
        margin: 0 0 1rem 0;
        font-size: 1.3rem;
        color: #2c3e50;
        padding-bottom: 0.75rem;
        border-bottom: 2px solid #f0f3f5;
    }

.diagnostic-item {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f8f9fa;
}

    .diagnostic-item:last-child {
        border-bottom: none;
    }

.diagnostic-label {
    font-weight: 600;
    color: #5a6c7d;
    font-size: 0.9rem;
}

.diagnostic-value {
    color: #2c3e50;
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 0.5rem;
    border-radius: 4px;
    word-break: break-all;
}

    .diagnostic-value.status-ok {
        background: #d4edda;
        color: #155724;
        font-weight: 600;
    }

    .diagnostic-value.status-error {
        background: #f8d7da;
        color: #721c24;
        font-weight: 600;
    }

    .diagnostic-value.status-warning {
        background: #fff3cd;
        color: #856404;
        font-weight: 600;
    }

.test-button {
    margin-top: 1rem;
    display: inline-block;
}

/* Responsive diagnostics */
@media (max-width: 768px) {
    .diagnostic-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .diagnostic-label {
        font-size: 0.85rem;
    }

    .diagnostic-value {
        font-size: 0.85rem;
    }
}

/* Footer version / environment display */
.footer-version {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #7f8c8d;
    font-family: monospace;
}

.footer-env {
    font-size: 0.7rem;
    color: #5d6d7e;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
