/* ===========================================
   SHARED RECORD EDIT STYLES
   Used by: student_manage.razor, staff_manage.razor
   Design language: Matches DuplicateStudents & EnrollmentExportImport
   =========================================== */

/* --- CSS Custom Properties (override per-page) --- */
:root {
    --re-accent: #004fb9;
    --re-accent-light: #e7f1fd;
    --re-accent-dark: #1a5bb5;
    --re-success: #28a745;
    --re-warning: #ffc107;
    --re-danger: #e74c3c;
    --re-info: #17a2b8;
    --re-text: #2c3e50;
    --re-text-muted: #6c757d;
    --re-bg: #f8f9fa;
    --re-card-bg: #ffffff;
    --re-border: #e9ecef;
    --re-radius: 12px;
    --re-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    --re-shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.12);
}

/* --- Page-level accent overrides --- */
.page-student {
    --re-accent: #004fb9;
    --re-accent-light: #e7f1fd;
    --re-accent-dark: #1a5bb5;
}

.page-staff {
    --re-accent: #7b1fa2;
    --re-accent-light: #f3e5f5;
    --re-accent-dark: #6a1b9a;
}

.page-school {
    --re-accent: #455a64;
    --re-accent-light: #eceff1;
    --re-accent-dark: #37474f;
}

.page-user-admin {
    --re-accent: #455a64;
    --re-accent-light: #eceff1;
    --re-accent-dark: #37474f;
}

/* ========================================
   WELCOME / HEADER SECTION
   ======================================== */

.re-welcome {
    background-color: var(--re-bg);
    border-left: 4px solid var(--re-accent);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}

.re-welcome-title {
    color: var(--re-accent);
    font-size: 1.4rem;
    margin: 0 0 0.5rem 0;
    font-weight: 600;
}

.re-welcome-subtitle {
    color: var(--re-text-muted);
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.5;
}

.re-school-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--re-accent-light);
    color: var(--re-accent-dark);
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 0.75rem;
}

.re-school-badge i {
    font-size: 0.85rem;
}

.re-field-full-width {
    grid-column: 1 / -1;
}

.re-selected-record {
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 0.85rem;
}

.re-selected-record-name {
    font-weight: 700;
    color: #1a2332;
    margin-bottom: 4px;
}

.re-selected-record-meta {
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========================================
   SEARCH BAR
   ======================================== */

.re-search-area {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.re-search-wrapper {
    flex: 0 0 280px;
    max-width: 280px;
}

@media (max-width: 900px) {
    .re-search-wrapper {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

.re-search-input {
    width: 100%;
    padding: 0.7rem 1rem 0.7rem 2.5rem;
    border: 2px solid var(--re-border);
    border-radius: var(--re-radius);
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: var(--re-card-bg);
}

.re-search-input:focus {
    border-color: var(--re-accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(44, 123, 229, 0.12);
}

.re-search-input::placeholder {
    color: #adb5bd;
}

.re-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    font-size: 0.95rem;
    pointer-events: none;
}

/* Dropdown results */
.re-autocomplete-dropdown {
    position: absolute;
    z-index: 1000;
    width: 100%;
    max-height: 320px;
    overflow-y: auto;
    background: var(--re-card-bg);
    border: 1px solid #dee2e6;
    border-radius: var(--re-radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    margin-top: 4px;
}

.re-autocomplete-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f1f3f5;
    display: flex;
    flex-direction: column;
    gap: 2px;
    transition: background-color 0.15s ease;
}

    .re-autocomplete-item:last-child {
        border-bottom: none;
    }

    .re-autocomplete-item:hover {
        background-color: var(--re-accent-light);
    }

.re-autocomplete-name {
    font-weight: 600;
    color: var(--re-text);
    font-size: 0.92rem;
}

.re-autocomplete-detail {
    font-size: 0.82rem;
    color: var(--re-text-muted);
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

/* Scrollbar */
.re-autocomplete-dropdown::-webkit-scrollbar {
    width: 6px;
}

.re-autocomplete-dropdown::-webkit-scrollbar-track {
    background: #f1f3f5;
    border-radius: 3px;
}

.re-autocomplete-dropdown::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 3px;
}

    .re-autocomplete-dropdown::-webkit-scrollbar-thumb:hover {
        background: #adb5bd;
    }

@media (max-width: 768px) {
    .re-autocomplete-dropdown {
        max-height: 240px;
    }
}
/* Add New Button */
.re-btn-add-new {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.7rem 1.25rem;
    background: var(--re-accent);
    color: white;
    border: none;
    border-radius: var(--re-radius);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.re-btn-add-new:hover {
    background: var(--re-accent-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}


/* ========================================
   CONTENT CARDS
   ======================================== */

.re-card {
    background: var(--re-card-bg);
    border-radius: var(--re-radius);
    box-shadow: var(--re-shadow);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    border-top: 5px solid var(--re-accent);
    transition: box-shadow 0.2s ease;
}

.re-card:hover {
    box-shadow: var(--re-shadow-hover);
}

.re-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--re-border);
}

.re-card-title {
    color: var(--re-text);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.re-card-title-icon {
    color: var(--re-accent);
    font-size: 1.1rem;
}

.re-card-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 600;
}

.re-badge-new {
    background: #e8f5e9;
    color: #2e7d32;
}

.re-badge-editing {
    background: var(--re-accent-light);
    color: var(--re-accent-dark);
}

/* Green accent for qualifications card */
.re-card.re-card-qualifications {
    border-top-color: var(--re-success);
}

/* Grey accent for audit card */
.re-card.re-card-audit {
    border-top-color: var(--re-text-muted);
}


/* ========================================
   FORM LAYOUT
   ======================================== */

.re-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 24px;
}

.re-form-grid-3col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px 24px;
}

.re-form-full-width {
    grid-column: 1 / -1;
}

.re-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.re-field-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--re-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.re-field-required::after {
    content: " *";
    color: var(--re-danger);
}

.re-field-readonly .re-field-label {
    color: #adb5bd;
}

/* Override DevExpress input styling within our form */
.re-field .dxbl-text-edit,
.re-field .dxbl-combobox,
.re-field .dxbl-date-edit,
.re-field .dxbl-spin-edit {
    border-radius: 8px;
}

/* Highlighted required fields */
.re-field-highlight input,
.re-field-highlight .dxbl-text-edit-input {
    background-color: #fffde7;
    border-color: #ffc107;
}

.re-field-highlight input:focus,
.re-field-highlight .dxbl-text-edit-input:focus {
    border-color: var(--re-accent);
    background-color: #ffffff;
}


/* ========================================
   TABS (restyled DevExpress tabs)
   ======================================== */

.re-tabs {
    margin-bottom: 1rem;
}

.re-tabs .dxbl-tabs {
    border-bottom: 2px solid var(--re-border);
    margin-bottom: 1.25rem;
}

.re-tabs .dxbl-tab {
    font-weight: 500;
    font-size: 0.95rem;
    padding: 10px 20px;
    color: var(--re-text-muted);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
}

.re-tabs .dxbl-tab:hover {
    color: var(--re-accent);
    background-color: var(--re-accent-light);
    border-radius: 8px 8px 0 0;
}

.re-tabs .dxbl-tab-selected,
.re-tabs .dxbl-tab.dxbl-active {
    color: var(--re-accent);
    font-weight: 600;
    border-bottom-color: var(--re-accent);
}

.re-tab-content {
    padding: 0.5rem 0;
}


/* ========================================
   QUALIFICATIONS CARD (Staff - Prominent)
   ======================================== */

.re-qual-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 1rem;
}

.re-qual-card {
    background: var(--re-bg);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    border-left: 4px solid #dee2e6;
    transition: all 0.2s ease;
}

.re-qual-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.re-qual-card.re-qual-filled {
    border-left-color: var(--re-success);
    background: linear-gradient(135deg, #f0fff4 0%, #ffffff 100%);
}

.re-qual-card-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--re-text-muted);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.re-qual-card.re-qual-filled .re-qual-card-title {
    color: #2e7d32;
}

.re-qual-field {
    margin-bottom: 0.5rem;
}

.re-qual-field label {
    font-size: 0.78rem;
    color: #999;
    display: block;
    margin-bottom: 2px;
}

/* Teaching qualification highlight */
.re-teaching-qual {
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
    border: 2px solid #4caf50;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.re-teaching-qual-icon {
    font-size: 1.5rem;
    color: #2e7d32;
}

.re-teaching-qual-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #2e7d32;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.re-teaching-qual-value {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--re-text);
}


/* ========================================
   SAVE AREA / VALIDATION
   ======================================== */

.re-save-area {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 2px solid var(--re-border);
}

.re-btn-save {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.75rem 2rem;
    background: var(--re-accent);
    color: white;
    border: none;
    border-radius: var(--re-radius);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.re-btn-save:hover:not(:disabled) {
    background: var(--re-accent-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.re-btn-save:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.re-btn-save.re-btn-create {
    background: var(--re-success);
}

.re-btn-save.re-btn-create:hover:not(:disabled) {
    background: #218838;
}

.re-validation-msg {
    font-size: 0.9rem;
    font-weight: 500;
}

.re-validation-msg.re-valid {
    color: var(--re-success);
}

.re-validation-msg.re-invalid {
    color: var(--re-danger);
}

.re-validation-msg.re-saving {
    color: var(--re-accent);
}


/* ========================================
   AUDIT TRAIL
   ======================================== */

.re-audit-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: var(--re-text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s ease;
}

.re-audit-toggle:hover {
    color: var(--re-text);
}

.re-audit-toggle-icon {
    transition: transform 0.2s ease;
}

.re-audit-toggle-icon.re-expanded {
    transform: rotate(90deg);
}

.re-audit-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.re-audit-item {
    display: flex;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 6px;
    background: var(--re-bg);
    font-size: 0.88rem;
    transition: background-color 0.15s ease;
}

.re-audit-item:hover {
    background: #e9ecef;
}

.re-audit-time {
    color: var(--re-text-muted);
    font-size: 0.8rem;
    min-width: 130px;
    white-space: nowrap;
}

.re-audit-user {
    color: var(--re-accent);
    font-weight: 600;
    font-size: 0.8rem;
    min-width: 80px;
}

.re-audit-detail {
    color: var(--re-text);
    flex: 1;
}

.re-audit-field {
    font-weight: 600;
}

.re-audit-old {
    color: var(--re-danger);
    text-decoration: line-through;
    font-size: 0.85rem;
}

.re-audit-new {
    color: var(--re-success);
    font-weight: 500;
}

.re-audit-empty {
    text-align: center;
    color: var(--re-text-muted);
    padding: 2rem;
    font-style: italic;
}

/* Audit scrollbar */
.re-audit-list::-webkit-scrollbar {
    width: 6px;
}

.re-audit-list::-webkit-scrollbar-track {
    background: #f1f3f5;
    border-radius: 3px;
}

.re-audit-list::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 3px;
}

.re-audit-list::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}


/* ========================================
   EMPTY / PLACEHOLDER STATES
   ======================================== */

.re-empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--re-text-muted);
}

.re-empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.re-empty-state-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--re-text);
}

.re-empty-state-text {
    font-size: 0.95rem;
    line-height: 1.5;
}


/* ========================================
   TOAST (shared override)
   ======================================== */

.re-toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}


/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1024px) {
    .re-form-grid {
        grid-template-columns: 1fr;
    }

    .re-form-grid-3col {
        grid-template-columns: 1fr 1fr;
    }

    .re-qual-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .re-form-grid-3col {
        grid-template-columns: 1fr;
    }

    .re-qual-grid {
        grid-template-columns: 1fr;
    }

    .re-search-area {
        flex-direction: column;
    }

    .re-btn-add-new {
        width: 100%;
        justify-content: center;
    }

    .re-card {
        padding: 1rem;
    }

    .re-save-area {
        flex-direction: column;
        align-items: stretch;
    }

    .re-btn-save {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .re-welcome {
        padding: 1rem;
    }

    .re-welcome-title {
        font-size: 1.2rem;
    }

    .re-audit-item {
        flex-direction: column;
        gap: 4px;
    }

    .re-audit-time {
        min-width: auto;
    }
}


/* ===========================================
   CLASS ASSIGNMENT STYLES — ADDITIONS TO record-edit.css (v2)
   Corrected: status classes use char(1) codes from SGCA
   Append to END of record-edit.css
   =========================================== */


/* --- Page-level accent overrides --- */

.page-sgca {
    --re-accent: #0d7c66;
    --re-accent-light: #e6f5f1;
    --re-accent-dark: #095c4b;
}

.page-tgca {
    --re-accent: #c45e1a;
    --re-accent-light: #fef3eb;
    --re-accent-dark: #9a4a14;
}


/* ========================================
   PERSON SUMMARY CARD
   ======================================== */

.re-person-summary {
    border-top-width: 4px;
    padding: 1rem 1.5rem;
}

.re-person-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.re-person-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.re-person-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--re-text);
    margin: 0;
}

.re-person-detail {
    font-size: 0.88rem;
    color: var(--re-text-muted);
}

.re-badge-active {
    color: var(--re-success);
    font-weight: 600;
}

.re-badge-inactive {
    color: var(--re-danger);
    font-weight: 600;
}

.re-btn-clear {
    background: none;
    border: 1px solid var(--re-border);
    color: var(--re-text-muted);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .re-btn-clear:hover {
        background: #f8d7da;
        color: var(--re-danger);
        border-color: var(--re-danger);
    }


/* ========================================
   CANCEL / DELETE BUTTONS
   ======================================== */

.re-btn-cancel {
    background: none;
    border: 1px solid var(--re-border);
    color: var(--re-text-muted);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .re-btn-cancel:hover {
        background: var(--re-bg);
        color: var(--re-text);
        border-color: var(--re-text-muted);
    }

.re-btn-delete {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.75rem 1.5rem;
    background: #fff;
    color: var(--re-danger);
    border: 2px solid var(--re-danger);
    border-radius: var(--re-radius);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .re-btn-delete:hover:not(:disabled) {
        background: var(--re-danger);
        color: #fff;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(231, 76, 60, 0.25);
    }

    .re-btn-delete:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }


/* ========================================
   COUNT BADGE
   ======================================== */

.re-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    background: var(--re-accent-light);
    color: var(--re-accent);
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 700;
}


/* ========================================
   CLASS HISTORY — TIMELINE LAYOUT
   ======================================== */

.re-history-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.re-year-group {
    position: relative;
    padding-left: 80px;
    margin-bottom: 0.5rem;
}

.re-year-label {
    position: absolute;
    left: 0;
    top: 8px;
    width: 60px;
    text-align: center;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--re-accent);
    background: var(--re-accent-light);
    padding: 6px 10px;
    border-radius: 8px;
}

.re-year-group::before {
    content: '';
    position: absolute;
    left: 29px;
    top: 42px;
    bottom: 0;
    width: 2px;
    background: var(--re-border);
}

.re-year-group:last-child::before {
    display: none;
}

.re-history-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: var(--re-bg);
    border: 1px solid var(--re-border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

    .re-history-card:hover {
        background: var(--re-accent-light);
        border-color: var(--re-accent);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    }

    .re-history-card.re-history-selected {
        background: var(--re-accent-light);
        border-color: var(--re-accent);
        border-width: 2px;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    }

.re-history-main {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    flex-wrap: wrap;
}

.re-history-class {
    font-weight: 600;
    color: var(--re-text);
    font-size: 0.95rem;
    background: #fff;
    padding: 2px 10px;
    border-radius: 6px;
    border: 1px solid var(--re-border);
}

.re-history-subject {
    font-weight: 500;
    color: #6d28d9;
    font-size: 0.88rem;
    background: #f5f3ff;
    padding: 2px 10px;
    border-radius: 6px;
}

.re-history-stream {
    font-size: 0.82rem;
    color: var(--re-text-muted);
    font-style: italic;
}

.re-history-school {
    font-size: 0.82rem;
    color: var(--re-text-muted);
}

.re-history-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    min-width: 160px;
}

.re-history-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* SGCA Status colour variants — char(1) codes */
.re-status-N {
    background: #e8f5e9;
    color: #2e7d32;
}
/* New */
.re-status-P {
    background: #e3f2fd;
    color: #1565c0;
}
/* Promoted */
.re-status-D {
    background: #fbe9e7;
    color: #bf360c;
}
/* Dropped */
.re-status-R {
    background: #fff3e0;
    color: #e65100;
}
/* Repeating */
.re-status-C {
    background: #e8eaf6;
    color: #283593;
}
/* Completed */
.re-status-M {
    background: #fce4ec;
    color: #880e4f;
}
/* Deceased */
.re-status-E {
    background: #e0f7fa;
    color: #00695c;
}
/* Re-Entrant */
.re-status-O {
    background: #f3e5f5;
    color: #7b1fa2;
}
/* Overseas */
.re-status-Z {
    background: #fff8e1;
    color: #f57f17;
}
/* Inclusive */

.re-history-audit {
    font-size: 0.75rem;
    color: #adb5bd;
}

.re-history-edit-hint {
    display: none;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: var(--re-accent);
    font-weight: 500;
}

.re-history-card:hover .re-history-edit-hint {
    display: block;
}


/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .re-year-group {
        padding-left: 0;
        padding-top: 40px;
    }

    .re-year-label {
        position: relative;
        top: 0;
        left: 0;
        display: inline-block;
        margin-bottom: 8px;
    }

    .re-year-group::before {
        display: none;
    }

    .re-history-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .re-history-meta {
        align-items: flex-start;
        min-width: auto;
    }

    .re-history-edit-hint {
        display: none !important;
    }

    .re-person-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .re-history-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* ===========================================
   UPDATED PAGE BANNER + DELETE/UNDO STYLES
   =========================================== */

.re-updated-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
    border: 1px solid #a5d6a7;
    border-left: 4px solid #43a047;
    border-radius: 8px;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #2e7d32;
}

.re-updated-banner-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.re-updated-banner-content {
    flex: 1;
}

.re-updated-banner-title {
    font-weight: 700;
    font-size: 0.88rem;
    margin-bottom: 2px;
}

.re-updated-banner-text {
    font-size: 0.82rem;
    color: #388e3c;
    line-height: 1.4;
}

.re-updated-banner-version {
    font-weight: 700;
    background: #43a047;
    color: #fff;
    padding: 1px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    letter-spacing: 0.3px;
}

.re-updated-banner-dismiss {
    background: none;
    border: none;
    color: #66bb6a;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    line-height: 1;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

    .re-updated-banner-dismiss:hover {
        background: rgba(0, 0, 0, 0.06);
        color: #2e7d32;
    }

@keyframes re-banner-fade-in {
    from {
        opacity: 0;
        transform: translateY(-28px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ========================================
   DELETE CONFIRMATION OVERLAY
   ======================================== */

.re-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: re-overlay-fade-in 0.2s ease;
}

.re-confirm-dialog {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
    padding: 2rem;
    max-width: 420px;
    width: 90%;
    text-align: center;
    animation: re-dialog-scale-in 0.2s ease;
}

.re-confirm-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.re-confirm-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--re-text);
    margin-bottom: 0.5rem;
}

.re-confirm-text {
    font-size: 0.9rem;
    color: var(--re-text-muted);
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

.re-confirm-detail {
    background: var(--re-bg);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    color: var(--re-text);
    text-align: left;
    line-height: 1.6;
}

.re-confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.re-confirm-btn-cancel {
    padding: 0.6rem 1.5rem;
    background: var(--re-bg);
    color: var(--re-text);
    border: 1px solid var(--re-border);
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

    .re-confirm-btn-cancel:hover {
        background: #e9ecef;
    }

.re-confirm-btn-delete {
    padding: 0.6rem 1.5rem;
    background: var(--re-danger, #e74c3c);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

    .re-confirm-btn-delete:hover {
        background: #c0392b;
        transform: translateY(-1px);
    }

@keyframes re-overlay-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes re-dialog-scale-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}


/* ========================================
   UNDO BAR — fixed at bottom
   ======================================== */

.re-undo-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 10001;
    font-size: 0.9rem;
    animation: re-undo-slide-up 0.3s ease;
    min-width: 320px;
}

.re-undo-text {
    flex: 1;
}

.re-undo-btn {
    background: #3498db;
    color: #fff;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s ease;
    white-space: nowrap;
}

    .re-undo-btn:hover {
        background: #2980b9;
    }

.re-undo-countdown {
    font-size: 0.8rem;
    color: #95a5a6;
    min-width: 24px;
    text-align: right;
}

@keyframes re-undo-slide-up {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ===========================================
   SCHOOL MANAGEMENT STYLES
   =========================================== */


/* --- Page-level accent: teal for schools --- */
.page-school {
    --re-accent: #00838f;
    --re-accent-light: #e0f7fa;
    --re-accent-dark: #006064;
}


/* ========================================
   ISLAND FILTER PILLS
   ======================================== */

.re-school-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    padding: 0;
}

.re-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--re-card-bg);
    color: var(--re-text-muted);
    border: 1px solid var(--re-border);
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

    .re-pill:hover {
        background: var(--re-accent-light);
        border-color: var(--re-accent);
        color: var(--re-accent);
    }

    .re-pill.re-pill-active {
        background: var(--re-accent);
        color: #fff;
        border-color: var(--re-accent);
    }

        .re-pill.re-pill-active .re-pill-count {
            background: rgba(255, 255, 255, 0.25);
            color: #fff;
        }

.re-pill-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    background: var(--re-bg);
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 700;
}


/* ========================================
   SCHOOL LIST GRID (compact cards)
   ======================================== */

.re-school-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
    margin-bottom: 1.25rem;
    max-height: 340px;
    overflow-y: auto;
    padding: 4px;
}

    /* Scrollbar styling */
    .re-school-grid::-webkit-scrollbar {
        width: 6px;
    }

    .re-school-grid::-webkit-scrollbar-track {
        background: #f1f3f5;
        border-radius: 3px;
    }

    .re-school-grid::-webkit-scrollbar-thumb {
        background: #ced4da;
        border-radius: 3px;
    }

        .re-school-grid::-webkit-scrollbar-thumb:hover {
            background: #adb5bd;
        }

.re-school-list-card {
    background: var(--re-card-bg);
    border: 1px solid var(--re-border);
    border-left: 4px solid var(--re-border);
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .re-school-list-card:hover {
        border-left-color: var(--re-accent);
        background: var(--re-accent-light);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    }

    .re-school-list-card.re-school-selected {
        border-left-color: var(--re-accent);
        border-left-width: 4px;
        background: var(--re-accent-light);
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    }

.re-school-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.re-school-list-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--re-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.re-school-list-id {
    font-size: 0.72rem;
    color: var(--re-text-muted);
    background: var(--re-bg);
    padding: 1px 8px;
    border-radius: 4px;
    font-weight: 600;
    flex-shrink: 0;
    margin-left: 8px;
}

.re-school-list-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--re-text-muted);
}

.re-school-list-wifi {
    font-size: 0.7rem;
}

.re-school-list-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: var(--re-text-muted);
    font-style: italic;
}


/* ========================================
   SCHOOL STATS BAR
   ======================================== */

.re-school-stats-bar {
    display: flex;
    gap: 0;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--re-border);
}

.re-stat-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 12px;
    border-right: 1px solid var(--re-border);
}

    .re-stat-item:last-child {
        border-right: none;
    }

.re-stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--re-accent);
}

.re-stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--re-text-muted);
}

/* ========================================
   Transfer cards (per-year sub-cards)
   ======================================== */

.re-transfers-section {
    margin: 0.75rem 0 0.5rem 1.5rem;
    padding-left: 1rem;
    border-left: 2px dashed var(--re-border, #c5cad1);
}

.re-transfers-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--re-muted, #6b7280);
    margin-bottom: 0.4rem;
}

.re-transfer-card {
    position: relative;
    padding: 0.7rem 0.9rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--re-border, #d1d5db);
    border-left: 3px solid var(--re-accent, #00838F);
    border-radius: 6px;
    background: var(--re-card-bg-subtle, #fafbfc);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

    .re-transfer-card:hover {
        background: var(--re-card-bg-hover, #f1f5f9);
        border-color: var(--re-accent, #00838F);
    }

.re-transfer-main {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.9rem;
    align-items: center;
    font-size: 0.92rem;
}

.re-transfer-date {
    font-weight: 600;
    color: var(--re-text, #1f2937);
}

.re-transfer-route {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--re-text, #1f2937);
}

.re-transfer-arrow {
    color: var(--re-accent, #00838F);
    font-weight: 700;
}

.re-transfer-from,
.re-transfer-to {
    font-weight: 500;
}

.re-transfer-reason {
    display: inline-block;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    background: var(--re-pill-bg, #e0f2f1);
    color: var(--re-pill-fg, #00695c);
    font-size: 0.78rem;
    font-weight: 600;
}

.re-transfer-notes {
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: var(--re-muted, #6b7280);
    font-style: italic;
}

.re-transfer-meta {
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: var(--re-muted, #6b7280);
}

/* ========================================
   "+ Add transfer" button
   ======================================== */

.re-add-transfer-btn {
    margin: 0.5rem 0 0 1.5rem;
    padding: 0.45rem 0.9rem;
    background: transparent;
    color: var(--re-accent, #00838F);
    border: 1px dashed var(--re-accent, #00838F);
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s;
}

    .re-add-transfer-btn:hover {
        background: var(--re-accent-soft, rgba(0, 131, 143, 0.08));
    }

/* ========================================
   Transfer modal sizing + readonly fields
   ======================================== */

.re-transfer-modal {
    min-width: min(560px, 95vw);
    max-width: 640px;
}

.re-transfer-form-grid {
    margin: 1rem 0;
}

.re-field-readonly {
    padding: 0.5rem 0.7rem;
    background: var(--re-readonly-bg, #f3f4f6);
    border: 1px solid var(--re-border, #e5e7eb);
    border-radius: 4px;
    color: var(--re-text, #1f2937);
    font-size: 0.9rem;
    min-height: 1.4rem;
}

.re-field-empty {
    color: var(--re-muted, #9ca3af);
    font-style: italic;
}

.re-field-span-2 {
    grid-column: span 2;
}

/* === Year group header (with Add transfer button) === */
.re-year-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.re-btn-add-transfer {
    font-size: 0.8125rem;
    padding: 0.25rem 0.75rem;
    background: transparent;
    border: 1px solid var(--re-border, #d0d0d0);
    border-radius: 6px;
    cursor: pointer;
    color: var(--re-text-secondary, #555);
    transition: all 0.15s ease;
}

    .re-btn-add-transfer:hover {
        background: var(--re-bg-hover, #f5f7fa);
        border-color: var(--re-accent, #1a5276);
        color: var(--re-accent, #1a5276);
    }

/* === Transfer sub-timeline === */
.re-transfer-timeline {
    margin-left: 1.75rem;
    border-left: 1px dashed var(--re-border, #d0d0d0);
    padding-left: 1.125rem;
    margin-top: 0.5rem;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.re-transfer-card {
    background: #fff;
    border: 0.5px solid var(--re-border, #e0e0e0);
    border-radius: 6px;
    padding: 0.625rem 0.875rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.15s ease;
}

    .re-transfer-card:hover {
        background: #fafbfc;
        border-color: var(--re-accent, #1a5276);
    }

    .re-transfer-card::before {
        content: '';
        position: absolute;
        left: -1.19rem;
        top: 1.1rem;
        width: 1.125rem;
        height: 1px;
        background: var(--re-border, #d0d0d0);
    }

.re-transfer-content {
    flex: 1;
    min-width: 0;
}

.re-transfer-main {
    font-size: 0.8125rem;
    line-height: 1.4;
}

.re-transfer-date {
    font-weight: 600;
}

.re-transfer-sep {
    color: var(--re-text-secondary, #666);
}

.re-transfer-school {
    font-weight: 600;
}

.re-transfer-class {
    color: var(--re-text-secondary, #666);
}

.re-transfer-audit {
    font-size: 0.6875rem;
    color: var(--re-text-tertiary, #999);
    margin-top: 0.1875rem;
}

.re-transfer-reason {
    background: var(--re-bg-secondary, #f0f0f0);
    color: var(--re-text-secondary, #555);
    font-size: 0.6875rem;
    padding: 0.1875rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
    white-space: nowrap;
    margin-left: 0.5rem;
}

/* === Transfer modal === */
.re-transfer-dialog {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
}

.re-transfer-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.re-transfer-dialog-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.re-transfer-dialog-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.125rem;
    color: var(--re-text-secondary, #666);
    padding: 0.25rem;
}

.re-transfer-dialog-subtitle {
    font-size: 0.75rem;
    color: var(--re-text-secondary, #666);
    margin-bottom: 1.25rem;
}

.re-transfer-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.re-transfer-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.re-transfer-from {
    background: #f5f7fa;
    border-radius: 6px;
    padding: 0.625rem 0.75rem;
}

.re-transfer-from-label {
    font-size: 0.6875rem;
    color: var(--re-text-tertiary, #999);
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.re-transfer-from-value {
    font-size: 0.875rem;
    font-weight: 600;
}

.re-transfer-warning {
    background: #fff8e1;
    border-radius: 6px;
    padding: 0.625rem 0.75rem;
    font-size: 0.8125rem;
    color: #856404;
}

.re-transfer-validation {
    background: #fdecea;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    color: #a32d2d;
}

.re-transfer-dialog-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 1.5rem;
}


/* ========================================
   RESPONSIVE — SCHOOL SPECIFIC
   ======================================== */

@media (max-width: 768px) {
    .re-school-grid {
        grid-template-columns: 1fr;
        max-height: 250px;
    }

    .re-school-filter-pills {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 6px;
    }

    .re-school-stats-bar {
        flex-wrap: wrap;
    }

    .re-stat-item {
        flex: 0 0 50%;
        border-right: none;
        border-bottom: 1px solid var(--re-border);
    }

        .re-stat-item:nth-last-child(-n+2) {
            border-bottom: none;
        }
}

@media (max-width: 480px) {
    .re-school-grid {
        max-height: 200px;
    }

    .re-stat-item {
        flex: 0 0 100%;
    }

        .re-stat-item:last-child {
            border-bottom: none;
        }
}

.re-form-grid .temis-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background-color: #fafafa;
    font-size: 0.9rem;
    color: #2c3e50;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

    .re-form-grid .temis-select:focus {
        outline: none;
        border-color: var(--re-accent, #004fb9);
        background-color: #fff;
        box-shadow: 0 0 0 2px rgba(0, 79, 185, 0.1);
    }

    .re-form-grid .temis-select:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        background-color: #f0f0f0;
    }

.re-form-grid .temis-number-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background-color: #fafafa;
    font-size: 0.9rem;
    color: #2c3e50;
    transition: border-color 0.2s, box-shadow 0.2s;
}

    .re-form-grid .temis-number-input:focus {
        outline: none;
        border-color: var(--re-accent, #004fb9);
        background-color: #fff;
        box-shadow: 0 0 0 2px rgba(0, 79, 185, 0.1);
    }

.temis-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.temis-radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafafa;
}

    .temis-radio-label:hover {
        border-color: var(--re-accent, #004fb9);
        background: #f0f4ff;
    }

.temis-radio-active {
    border-color: var(--re-accent, #004fb9);
    background: #f0f4ff;
    color: var(--re-accent, #004fb9);
    font-weight: 500;
}

.temis-radio-label input[type="radio"] {
    accent-color: var(--re-accent, #004fb9);
    margin: 0;
}

.dashboard-actions .temis-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background-color: #fafafa;
    font-size: 0.9rem;
    color: #2c3e50;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

    .dashboard-actions .temis-select:focus {
        outline: none;
        border-color: #004fb9;
        box-shadow: 0 0 0 2px rgba(0,79,185,0.1);
    }


/* Staff variant of the school chip — indigo palette */
.re-school-badge--staff {
    background: #ede7f6;
    color: #4527a0;
    border: 1px solid rgba(69, 39, 160, 0.18);
}

/* ============================================================
   Admin / Ministry-only page identity
   ============================================================ */

/* Ministry-Only badge — slate palette */
.re-ministry-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: #eceff1;
    color: #37474f;
    border: 1px solid rgba(55, 71, 79, 0.2);
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}

    .re-ministry-chip i {
        color: #455a64;
        font-size: 0.85rem;
    }

/* Page-level mode selector (toggles primary page behaviour) */
.re-mode-selector {
    margin: 0 0 16px;
    padding: 14px 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.re-mode-selector-label {
    display: block;
    margin-bottom: 10px;
    font-size: 11px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* ============================================================
   Admin panels — clean replacement for .dashboard-card / .dashboard-actions
   ============================================================ */

.re-panel {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px 22px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.re-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.re-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #1a2332;
}

    .re-panel-title i {
        color: #455a64;
        font-size: 1.05rem;
    }

/* ============================================================
   Status chip — shown next to panel title to signal dynamic state
   ============================================================ */

.re-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

    .re-status-chip i {
        font-size: 0.85rem;
    }

.re-status-chip--success {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}

.re-status-chip--error {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}

.re-status-chip--warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

/* ============================================================
   Stat tiles — flat replacement for gradient .summary-item
   ============================================================ */

.re-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.re-stat {
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 3px solid #94a3b8;
    border-radius: 8px;
}

.re-stat--success {
    border-left-color: #16a34a;
}

.re-stat--warning {
    border-left-color: #d97706;
}

.re-stat--error {
    border-left-color: #dc2626;
}

.re-stat--info {
    border-left-color: #0284c7;
}

.re-stat--neutral {
    border-left-color: #94a3b8;
}

.re-stat-label {
    font-size: 11px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 4px;
}

.re-stat-value {
    font-size: 1.45rem;
    font-weight: 700;
    color: #1a2332;
    line-height: 1.2;
}

.re-stat--success .re-stat-value {
    color: #16a34a;
}

.re-stat--warning .re-stat-value {
    color: #d97706;
}

.re-stat--error .re-stat-value {
    color: #dc2626;
}

.re-stat--info .re-stat-value {
    color: #0284c7;
}

.re-stat-value-sm {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1a2332;
    line-height: 1.3;
    word-break: break-word;
}

@media (max-width: 1024px) {
    .re-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .re-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Warning banner — for destructive admin operations
   ============================================================ */
.re-warning-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-left: 4px solid #d97706;
    border-radius: 8px;
    margin-bottom: 16px;
    color: #78350f;
    font-size: 0.9rem;
    line-height: 1.5;
}

    .re-warning-banner i {
        color: #d97706;
        font-size: 1.1rem;
        margin-top: 2px;
        flex-shrink: 0;
    }

    .re-warning-banner strong {
        color: #78350f;
    }

/* ============================================================
   Segmented mode toggle — slate accent
   ============================================================ */
.re-mode-toggle {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 16px;
}

.re-mode-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

    .re-mode-toggle-btn:hover:not(.re-mode-toggle-btn--active) {
        color: #1a2332;
        background: rgba(255, 255, 255, 0.6);
    }

.re-mode-toggle-btn--active {
    background: white;
    color: #1a2332;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

    .re-mode-toggle-btn--active i {
        color: #455a64;
    }

/* ============================================================
   Panel modifiers — duplicate/primary distinction + full-width
   ============================================================ */
.re-panel--duplicate {
    border-left: 3px solid #dc2626;
}

.re-panel--primary {
    border-left: 3px solid #16a34a;
}

.re-panel--full {
    grid-column: 1 / -1;
}

/* Panel-header action chips (To Remove / To Keep) */
.re-action-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.re-action-chip--remove {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}

.re-action-chip--keep {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}

/* ============================================================
   Detail list — clean replacement for .student-details
   ============================================================ */
.re-detail-list {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.re-detail-list-header {
    font-size: 0.78rem;
    font-weight: 700;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 10px;
}

.re-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 7px 0;
    border-bottom: 1px solid #f8fafc;
    gap: 12px;
}

    .re-detail-row:last-child {
        border-bottom: none;
    }

.re-detail-label {
    font-size: 0.85rem;
    color: #6c757d;
    flex-shrink: 0;
}

.re-detail-value {
    font-size: 0.9rem;
    color: #1a2332;
    text-align: right;
    word-break: break-word;
}

.re-status-pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.re-status-pill--active {
    background: #dcfce7;
    color: #15803d;
}

.re-status-pill--inactive {
    background: #fee2e2;
    color: #b91c1c;
}

/* ============================================================
   Modal record cards — cleaner replacement for .popup-student-info
   ============================================================ */
.re-modal-record-card {
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid;
    margin: 10px 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

.re-modal-record-card--duplicate {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #7f1d1d;
}

.re-modal-record-card--primary {
    background: #f0fdf4;
    border-color: #86efac;
    color: #14532d;
}

/* ============================================================
   Info callout — replacement for .info-box
   ============================================================ */
.re-info-callout {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-left: 4px solid #0284c7;
    border-radius: 8px;
    color: #0c4a6e;
    font-size: 0.9rem;
    line-height: 1.5;
}

    .re-info-callout i {
        color: #0284c7;
        font-size: 1.05rem;
        margin-top: 2px;
        flex-shrink: 0;
    }

/* ============================================================
   Confirmation callout — for the "you are about to..." box
   ============================================================ */
.re-confirm-callout {
    padding: 14px 16px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-left: 4px solid #d97706;
    border-radius: 8px;
    margin-bottom: 16px;
    color: #78350f;
    font-size: 0.9rem;
    line-height: 1.6;
}

    .re-confirm-callout strong {
        color: #78350f;
    }

.re-confirm-callout-warning {
    margin: 10px 0 0;
    color: #b45309;
    font-weight: 600;
}

/* Make the toggle buttons feel a bit more substantial */
.re-mode-toggle-btn {
    padding: 10px 22px;
    font-size: 0.95rem;
    gap: 10px;
}

    .re-mode-toggle-btn i {
        font-size: 1rem;
    }

/* ????????????????????????????????????????????????????????????
   Identity-coloured active states — overrides the neutral default
   ???????????????????????????????????????????????????????????? */

/* Students active ? green */
.re-mode-toggle-btn--active.re-mode-toggle-btn--students {
    background: #dcfce7;
    color: #15803d;
    box-shadow: 0 1px 3px rgba(22, 163, 74, 0.18);
}

    .re-mode-toggle-btn--active.re-mode-toggle-btn--students i {
        color: #16a34a;
    }

/* Teachers active ? indigo */
.re-mode-toggle-btn--active.re-mode-toggle-btn--staff {
    background: #ede7f6;
    color: #4527a0;
    box-shadow: 0 1px 3px rgba(69, 39, 160, 0.2);
}

    .re-mode-toggle-btn--active.re-mode-toggle-btn--staff i {
        color: #512da8;
    }