/*=========================================================
    Professional Multi-School Management System
    Custom CSS - AdminLTE 3 Overrides & Enhancements
===========================================================*/

/* ===== Loading Spinner ===== */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner .spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #e9ecef;
    border-top: 5px solid #007bff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-spinner .spinner-text {
    margin-top: 15px;
    text-align: center;
    color: #6c757d;
    font-size: 14px;
}

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

.spinner-overlay {
    position: relative;
}

.spinner-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    z-index: 99;
}

.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
}

/* ===== Custom Card Styles ===== */
.card {
    border-radius: 0.5rem;
    box-shadow: 0 0 1px rgba(0,0,0,.125), 0 1px 3px rgba(0,0,0,.2);
    margin-bottom: 1.25rem;
    border: none;
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0,0,0,.125);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3, .card-header .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.5;
}

.card-header .card-tools {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    background-color: rgba(0,0,0,.03);
    border-top: 1px solid rgba(0,0,0,.125);
    padding: 0.75rem 1.25rem;
}

.card.card-primary { border-top: 3px solid #7c3aed; }
.card.card-secondary { border-top: 3px solid #6c757d; }
.card.card-success { border-top: 3px solid #28a745; }
.card.card-danger { border-top: 3px solid #dc3545; }
.card.card-warning { border-top: 3px solid #ffc107; }
.card.card-info { border-top: 3px solid #17a2b8; }
.card.card-dark { border-top: 3px solid #343a40; }

.card.card-outline { border-top: 0; border: 1px solid rgba(0,0,0,.125); }

.card.card-outline.card-primary { border: 1px solid #7c3aed; }
.card.card-outline.card-success { border: 1px solid #28a745; }
.card.card-outline.card-danger { border: 1px solid #dc3545; }
.card.card-outline.card-warning { border: 1px solid #ffc107; }
.card.card-outline.card-info { border: 1px solid #17a2b8; }

.card.card-solid { border-radius: 0; }

.info-box {
    box-shadow: 0 0 1px rgba(0,0,0,.125), 0 1px 3px rgba(0,0,0,.2);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    background: #fff;
    display: flex;
    align-items: center;
    min-height: 90px;
}

.info-box .info-box-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.5rem;
    color: #fff;
    flex-shrink: 0;
}

.info-box .info-box-content {
    padding-left: 1rem;
    flex: 1;
}

.info-box .info-box-text {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-box .info-box-number {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.small-box {
    border-radius: 0.5rem;
    position: relative;
    display: block;
    margin-bottom: 1.25rem;
    box-shadow: 0 0 1px rgba(0,0,0,.125), 0 1px 3px rgba(0,0,0,.2);
    overflow: hidden;
    padding: 1.25rem;
    color: #fff;
    transition: transform 0.2s;
}

.small-box:hover {
    transform: translateY(-2px);
}

.small-box .inner h3 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.small-box .inner p {
    font-size: 0.875rem;
    margin: 0;
    opacity: 0.9;
}

.small-box .icon {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 4rem;
    opacity: 0.2;
}

.small-box .small-box-footer {
    display: block;
    text-align: center;
    padding: 0.5rem 0;
    margin: 1.25rem -1.25rem -1.25rem;
    background: rgba(0,0,0,0.1);
    color: #fff;
    text-decoration: none;
    font-size: 0.875rem;
}

.small-box .small-box-footer:hover {
    background: rgba(0,0,0,0.15);
}

/* ===== Dashboard Widgets ===== */
.dashboard-widget {
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    background: #fff;
    box-shadow: 0 0 1px rgba(0,0,0,.125), 0 1px 3px rgba(0,0,0,.2);
}

.dashboard-widget .widget-title {
    font-size: 0.875rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.dashboard-widget .widget-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.dashboard-widget .widget-icon {
    font-size: 2.5rem;
    opacity: 0.2;
}

/* ===== Custom Badge Colors ===== */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    font-size: 0.75rem;
}

.badge.bg-lightblue { background-color: #3c8dbc; color: #fff; }
.badge.bg-navy { background-color: #001f3f; color: #fff; }
.badge.bg-olive { background-color: #3d9970; color: #fff; }
.badge.bg-lime { background-color: #01ff70; color: #000; }
.badge.bg-fuchsia { background-color: #f012be; color: #fff; }
.badge.bg-maroon { background-color: #d81b60; color: #fff; }
.badge.bg-teal { background-color: #39cccc; color: #fff; }
.badge.bg-purple { background-color: #605ca8; color: #fff; }
.badge.bg-orange { background-color: #ff851b; color: #fff; }

/* ===== Timeline Styles ===== */
.timeline {
    position: relative;
    padding: 0;
    list-style: none;
    margin: 0;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 18px;
    width: 2px;
    background-color: #e9ecef;
}

.timeline-item {
    position: relative;
    padding-left: 50px;
    margin-bottom: 1.25rem;
}

.timeline-item .timeline-icon {
    position: absolute;
    left: 8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: #007bff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.625rem;
    z-index: 1;
}

.timeline-item .timeline-content {
    background: #fff;
    padding: 1rem;
    border-radius: 0.375rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.12);
}

.timeline-item .timeline-content .timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.timeline-item .timeline-content .timeline-header h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.timeline-item .timeline-content .timeline-body {
    font-size: 0.875rem;
    color: #6c757d;
}

.timeline-item .timeline-content .timeline-footer {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #adb5bd;
}

/* ===== Chat Styles ===== */
.chat-container {
    height: 400px;
    overflow-y: auto;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 0.375rem;
}

.chat-message {
    display: flex;
    margin-bottom: 1rem;
    align-items: flex-start;
}

.chat-message.chat-message-right {
    flex-direction: row-reverse;
}

.chat-message .chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #007bff;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.chat-message.chat-message-right .chat-avatar {
    background: #28a745;
}

.chat-message .chat-bubble {
    max-width: 70%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,.1);
    margin: 0 0.75rem;
    position: relative;
}

.chat-message.chat-message-right .chat-bubble {
    background: #007bff;
    color: #fff;
}

.chat-message .chat-bubble .chat-text {
    font-size: 0.875rem;
    line-height: 1.4;
    margin: 0;
}

.chat-message .chat-bubble .chat-time {
    font-size: 0.625rem;
    color: #adb5bd;
    margin-top: 0.25rem;
    display: block;
}

.chat-message.chat-message-right .chat-bubble .chat-time {
    color: rgba(255,255,255,0.7);
}

.chat-input-area {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    background: #fff;
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 0.375rem 0.375rem;
}

.chat-input-area input {
    flex: 1;
}

/* ===== Custom Form Styles ===== */
.form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

.form-control.is-valid:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40,167,69,.25);
}

.form-control.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220,53,69,.25);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 0.375rem;
    color: #495057;
    font-size: 0.875rem;
}

.form-group .required::after {
    content: ' *';
    color: #dc3545;
}

.form-control-lg {
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
    font-size: 1rem;
}

.form-control-sm {
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.form-text {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* Custom file input */
.custom-file-upload {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.custom-file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.custom-file-upload .upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s;
    background: #f8f9fa;
}

.custom-file-upload .upload-area:hover {
    border-color: #007bff;
    background: #e8f0fe;
}

.custom-file-upload .upload-area i {
    font-size: 3rem;
    color: #adb5bd;
    margin-bottom: 0.5rem;
}

.custom-file-upload .upload-area p {
    margin: 0;
    font-size: 0.875rem;
    color: #6c757d;
}

/* ===== Image Preview ===== */
.image-preview {
    max-width: 200px;
    max-height: 200px;
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
    padding: 0.25rem;
    margin-top: 0.5rem;
    display: none;
}

.image-preview.show {
    display: block;
}

/* ===== Profile Styles ===== */
.profile-header {
    background: linear-gradient(135deg, #2e1065 0%, #7c3aed 50%, #a78bfa 100%);
    padding: 2rem;
    border-radius: 0.5rem;
    color: #fff;
    margin-bottom: 1.5rem;
}

.profile-header .profile-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,0.3);
    object-fit: cover;
}

.profile-header .profile-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 1rem 0 0.25rem;
}

.profile-header .profile-role {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* ===== Auth Pages ===== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2e1065 0%, #7c3aed 50%, #a78bfa 100%);
    padding: 1rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

.auth-card .auth-header {
    padding: 2rem;
    text-align: center;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.auth-card .auth-header img {
    max-height: 60px;
    margin-bottom: 1rem;
}

.auth-card .auth-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: #343a40;
}

.auth-card .auth-header p {
    font-size: 0.875rem;
    color: #6c757d;
    margin: 0.25rem 0 0;
}

.auth-card .auth-body {
    padding: 2rem;
}

.auth-card .auth-footer {
    padding: 1rem 2rem;
    text-align: center;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    font-size: 0.875rem;
}

/* ===== Table Styles ===== */
.table thead th {
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #495057;
    background-color: #f8f9fa;
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
    font-size: 0.875rem;
}

.table-hover tbody tr:hover {
    background-color: rgba(0,123,255,.04);
}

.table-actions {
    white-space: nowrap;
    width: 1%;
}

.table-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    margin: 0 0.125rem;
}

/* DataTables custom overrides */
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    padding: 0.375rem 0.75rem;
    margin-left: 0.5rem;
}

.dataTables_wrapper .dataTables_length select {
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    padding: 0.25rem;
}

.dt-buttons {
    margin-bottom: 0.5rem;
}

.dt-buttons .btn {
    margin-right: 0.25rem;
}

/* ===== Print Styles ===== */
@media print {
    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }

    .main-header,
    .main-sidebar,
    .navbar,
    .sidebar,
    .btn,
    .dataTables_filter,
    .dataTables_length,
    .dataTables_info,
    .dataTables_paginate,
    .dt-buttons,
    .no-print {
        display: none !important;
    }

    .content-wrapper {
        margin-left: 0 !important;
        padding: 0 !important;
    }

    .main-footer {
        display: none !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
        break-inside: avoid;
    }

    .table {
        border-collapse: collapse !important;
    }

    .table th,
    .table td {
        border: 1px solid #000 !important;
        padding: 0.5rem !important;
    }

    .badge {
        border: 1px solid #000 !important;
        color: #000 !important;
        background: #fff !important;
    }

    a {
        color: #000 !important;
        text-decoration: underline !important;
    }

    img {
        max-width: 100% !important;
    }

    @page {
        margin: 1cm;
    }
}

/* ===== Responsive Fixes ===== */
@media (max-width: 767.98px) {
    .main-sidebar {
        transform: translate(-250px, 0);
    }

    .sidebar-open .main-sidebar {
        transform: translate(0, 0);
    }

    .content-wrapper {
        margin-left: 0 !important;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .card-header .card-tools {
        width: 100%;
    }

    .info-box {
        flex-direction: column;
        text-align: center;
    }

    .info-box .info-box-icon {
        margin-bottom: 0.75rem;
    }

    .info-box .info-box-content {
        padding-left: 0;
    }

    .table-responsive {
        font-size: 0.8125rem;
    }

    .profile-header {
        text-align: center;
    }

    .auth-card {
        margin: 1rem;
        max-width: 100%;
    }

    .chat-message .chat-bubble {
        max-width: 85%;
    }

    .small-box .icon {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .card-body {
        padding: 0.75rem;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 120px;
    }

    .dt-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .dt-buttons .btn {
        font-size: 0.6875rem;
        padding: 0.25rem 0.375rem;
    }
}

/* ===== RTL Support ===== */
.rtl .main-sidebar {
    right: 0;
    left: auto;
}

.rtl .content-wrapper {
    margin-left: 0;
    margin-right: 250px;
}

.rtl .navbar-nav.ml-auto {
    margin-left: 0 !important;
    margin-right: auto !important;
}

.rtl .float-right {
    float: left !important;
}

.rtl .float-left {
    float: right !important;
}

.rtl .text-right {
    text-align: left !important;
}

.rtl .text-left {
    text-align: right !important;
}

.rtl .mr-2 { margin-right: 0 !important; margin-left: 0.5rem !important; }
.rtl .ml-2 { margin-left: 0 !important; margin-right: 0.5rem !important; }
.rtl .me-2 { margin-right: 0 !important; margin-left: 0.5rem !important; }
.rtl .ms-2 { margin-left: 0 !important; margin-right: 0.5rem !important; }
.rtl .pr-3 { padding-right: 0 !important; padding-left: 1rem !important; }
.rtl .pl-3 { padding-left: 0 !important; padding-right: 1rem !important; }

.rtl .nav-sidebar .nav-item .nav-link p {
    margin-right: 0.5rem;
    margin-left: 0;
}

.rtl .nav-sidebar .nav-item .nav-link .right {
    margin-left: 0;
    margin-right: auto;
}

.rtl .timeline::before {
    left: auto;
    right: 18px;
}

.rtl .timeline-item {
    padding-left: 0;
    padding-right: 50px;
}

.rtl .timeline-item .timeline-icon {
    left: auto;
    right: 8px;
}

.rtl .chat-message.chat-message-right {
    flex-direction: row;
}

.rtl .chat-message .chat-bubble {
    text-align: right;
}

/* ===== Utility Classes ===== */
.cursor-pointer {
    cursor: pointer;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.font-size-xs { font-size: 0.75rem; }
.font-size-sm { font-size: 0.875rem; }
.font-size-lg { font-size: 1.125rem; }
.font-size-xl { font-size: 1.25rem; }

.border-dashed {
    border-style: dashed !important;
}

.border-width-2 {
    border-width: 2px !important;
}

.min-width-200 { min-width: 200px; }
.min-width-300 { min-width: 300px; }

.hover-shadow:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s;
}

.hover-scale:hover {
    transform: scale(1.02);
    transition: transform 0.2s;
}

.transition-3 {
    transition: all 0.3s ease;
}

.overflow-auto {
    overflow: auto;
}

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

/* ===== Step Wizard ===== */
.step-wizard {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 0;
    list-style: none;
}

.step-wizard li {
    display: flex;
    align-items: center;
    position: relative;
    flex: 1;
}

.step-wizard li .step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    z-index: 1;
    transition: all 0.3s;
}

.step-wizard li .step-label {
    margin-left: 0.5rem;
    font-size: 0.8125rem;
    color: #6c757d;
    white-space: nowrap;
}

.step-wizard li.active .step-number {
    background: #007bff;
    color: #fff;
}

.step-wizard li.active .step-label {
    color: #007bff;
    font-weight: 600;
}

.step-wizard li.completed .step-number {
    background: #28a745;
    color: #fff;
}

.step-wizard li.completed .step-label {
    color: #28a745;
}

.step-wizard li::after {
    content: '';
    position: absolute;
    top: 18px;
    left: 36px;
    right: 0;
    height: 2px;
    background: #e9ecef;
    z-index: 0;
}

.step-wizard li:last-child::after {
    display: none;
}

.step-wizard li.completed::after {
    background: #28a745;
}

.step-wizard li.active::after {
    background: linear-gradient(to right, #28a745, #007bff);
}

/* ===== Notification Panel ===== */
.notification-item {
    display: flex;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.notification-item:hover {
    background: #f8f9fa;
}

.notification-item .notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

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

.notification-item .notification-content .notification-title {
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-item .notification-content .notification-text {
    font-size: 0.75rem;
    color: #6c757d;
    margin: 0.125rem 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-item .notification-content .notification-time {
    font-size: 0.625rem;
    color: #adb5bd;
    margin-top: 0.125rem;
}

/* ===== Calendar ===== */
.fc-event {
    border-radius: 0.25rem;
    padding: 2px 4px;
    font-size: 0.75rem;
    border: none;
    cursor: pointer;
}

.fc-toolbar-title {
    font-size: 1.25rem !important;
    font-weight: 600 !important;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ===== Kanban Board ===== */
.kanban-board {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.kanban-column {
    min-width: 280px;
    max-width: 280px;
    background: #f8f9fa;
    border-radius: 0.5rem;
    padding: 0.75rem;
}

.kanban-column .kanban-header {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #dee2e6;
}

.kanban-column .kanban-item {
    background: #fff;
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    cursor: grab;
    transition: box-shadow 0.2s;
}

.kanban-column .kanban-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

/* ===== Attendance Grid ===== */
.attendance-grid {
    display: grid;
    grid-template-columns: 200px repeat(auto-fill, 30px);
    gap: 1px;
    background: #dee2e6;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    overflow: hidden;
}

.attendance-grid .grid-header,
.attendance-grid .grid-item {
    padding: 0.5rem;
    font-size: 0.75rem;
    background: #fff;
    text-align: center;
}

.attendance-grid .grid-header {
    font-weight: 600;
    background: #f8f9fa;
}

.attendance-grid .grid-item.present {
    background: #d4edda;
    color: #155724;
}

.attendance-grid .grid-item.absent {
    background: #f8d7da;
    color: #721c24;
}

.attendance-grid .grid-item.late {
    background: #fff3cd;
    color: #856404;
}

/* ===== Grade Colors ===== */
.grade-a { color: #28a745; }
.grade-b { color: #17a2b8; }
.grade-c { color: #ffc107; }
.grade-d { color: #fd7e14; }
.grade-f { color: #dc3545; }

/* ===== Invoice ===== */
.invoice-header {
    border-bottom: 2px solid #343a40;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.invoice-total {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: right;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #343a40;
}

/*============================================================
    MODERN UI THEME  -  Burgundy / wine refresh
    (overrides for AdminLTE 3 + app styles)
============================================================*/
:root {
    --brand-50:  #f5f0ff;
    --brand-100: #ede4ff;
    --brand-200: #d8c4fb;
    --brand-400: #a78bfa;
    --brand-500: #7c3aed;
    --brand-600: #6d28d9;
    --brand-700: #5b21b6;
    --violet-500: #8b5cf6;
    --violet-600: #9c2233;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --border-soft: #ece5fa;
    --font-ui: 'Poppins', 'Source Sans Pro', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

html { overflow-x: hidden; }

body {
    font-family: var(--font-ui);
    background: #f1f5f9;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--slate-900);
}

a { transition: color .15s ease; }

::selection { background: rgba(124, 58, 237, .25); }

/* ===== Content area background ===== */
.content-wrapper {
    background: linear-gradient(160deg, #faf8ff 0%, #f0e9ff 55%, #f6f2fe 100%);
    transition: margin-left .3s ease;
    min-height: calc(100vh - 57px);
}

.content-wrapper > .content-header {
    background: transparent;
    padding-top: 1.1rem;
}

.content-header h1 { font-weight: 700; color: var(--slate-900); }
.breadcrumb-item a { color: var(--brand-600); }
.breadcrumb-item.active { color: var(--slate-600); }

/* ===== Navbar ===== */
.main-header.navbar {
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(226, 232, 240, .9);
    box-shadow: 0 2px 12px -6px rgba(15, 23, 42, .12);
    position: relative;
    padding: 0 .6rem;
}

.main-header.navbar::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-500), var(--violet-500), #fbbf24);
    opacity: .9;
}

.main-header .nav-link {
    color: var(--slate-600);
    border-radius: .5rem;
    transition: color .2s ease, background .2s ease, transform .15s ease;
}

.main-header .nav-link:hover {
    color: var(--brand-600);
    background: rgba(124, 58, 237, .08);
}

.main-header .navbar-nav > .nav-item > .nav-link { padding: .55rem .7rem; }

.main-header .navbar-badge {
    font-size: .6rem;
    padding: .2rem .45rem;
    border-radius: 1rem;
}

/* ===== Sidebar ===== */
/* Themeable sidebar: colours come from --side-* variables so the whole menu
   can be re-skinned from one place. Presets below are switched by setting
   data-theme on <html> (see the palette picker in includes/navbar.php).
   The choice is stored per-browser in localStorage (no DB writes). */
:root,
[data-theme="violet"] {
    --side-top:    #0b0713;
    --side-mid:    #1b1030;
    --side-bot:    #2c1850;
    --side-active-a: #7c3aed;
    --side-active-b: #4c1d95;
    --side-glow:   124, 58, 237;
    --side-link:   #c4b5fd;
    --side-soft:   #a78bfa;
    --side-grad-a: rgba(76, 29, 149, .60);
    --side-grad-b: rgba(139, 92, 246, .40);
}
[data-theme="burgundy"] {
    --side-top:    #150507;
    --side-mid:    #2a0b10;
    --side-bot:    #4a1220;
    --side-active-a: #b3283a;
    --side-active-b: #6b1220;
    --side-glow:   179, 40, 58;
    --side-link:   #f0b8bd;
    --side-soft:   #e28a94;
    --side-grad-a: rgba(107, 18, 32, .55);
    --side-grad-b: rgba(179, 40, 58, .45);
}
[data-theme="navy"] {
    --side-top:    #050b16;
    --side-mid:    #0b1b33;
    --side-bot:    #123055;
    --side-active-a: #2563eb;
    --side-active-b: #1e3a8a;
    --side-glow:   37, 99, 235;
    --side-link:   #bfdbfe;
    --side-soft:   #93c5fd;
    --side-grad-a: rgba(30, 58, 138, .55);
    --side-grad-b: rgba(59, 130, 246, .40);
}
[data-theme="emerald"] {
    --side-top:    #04120c;
    --side-mid:    #0a2318;
    --side-bot:    #10382a;
    --side-active-a: #10b981;
    --side-active-b: #047857;
    --side-glow:   16, 185, 129;
    --side-link:   #a7f3d0;
    --side-soft:   #6ee7b7;
    --side-grad-a: rgba(4, 120, 87, .55);
    --side-grad-b: rgba(52, 211, 153, .40);
}
[data-theme="rose"] {
    --side-top:    #140509;
    --side-mid:    #2a0e18;
    --side-bot:    #46121f;
    --side-active-a: #e11d48;
    --side-active-b: #9f1239;
    --side-glow:   225, 29, 57;
    --side-link:   #fecdd3;
    --side-soft:   #fda4af;
    --side-grad-a: rgba(159, 18, 57, .55);
    --side-grad-b: rgba(244, 63, 94, .40);
}
[data-theme="slate"] {
    --side-top:    #0a0c10;
    --side-mid:    #14181f;
    --side-bot:    #232a35;
    --side-active-a: #64748b;
    --side-active-b: #334155;
    --side-glow:   100, 116, 139;
    --side-link:   #e2e8f0;
    --side-soft:   #cbd5e1;
    --side-grad-a: rgba(51, 65, 85, .60);
    --side-grad-b: rgba(148, 163, 184, .35);
}

.main-sidebar {
    background: linear-gradient(180deg, var(--side-top) 0%, var(--side-mid) 55%, var(--side-bot) 100%) !important;
    box-shadow: 4px 0 24px -8px rgba(15, 23, 42, .35);
    transition: background .35s ease;
}

.main-sidebar .brand-link {
    background: linear-gradient(135deg, var(--side-grad-a), var(--side-grad-b)) !important;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    padding-top: .9rem;
    padding-bottom: .9rem;
}

.main-sidebar .brand-text { font-weight: 700; letter-spacing: .02em; }

.sidebar .user-panel {
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    padding-bottom: .6rem;
}

.user-panel .info a { font-weight: 600; color: #fff; }
.user-panel .info small { color: var(--side-link); }

.nav-sidebar .nav-header {
    color: var(--side-soft);
    text-transform: uppercase;
    letter-spacing: .1em;
    font-size: .72rem;
    font-weight: 600;
    padding: .8rem .9rem .35rem;
}

.nav-sidebar .nav-item .nav-link {
    border-radius: .65rem;
    margin: 2px .65rem;
    padding: .55rem .85rem;
    color: #cbd5e1;
    font-weight: 500;
    font-size: .92rem;
    transition: background .2s ease, color .2s ease, transform .15s ease, box-shadow .2s ease;
}

.nav-sidebar .nav-item .nav-link:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff;
    transform: translateX(2px);
}

.nav-sidebar .nav-item .nav-link.active,
.nav-sidebar .nav-item.menu-open > .nav-link,
.nav-sidebar > .nav-item > .nav-link.active {
    background: linear-gradient(135deg, var(--side-active-a), var(--side-active-b)) !important;
    color: #fff !important;
    box-shadow: 0 8px 18px -8px rgba(var(--side-glow), .75);
}

.nav-sidebar .nav-item .nav-link.active .nav-icon,
.nav-sidebar .nav-item .nav-link.active i { color: #fff; }

.nav-sidebar .nav-icon {
    width: 1.55rem;
    text-align: center;
    font-size: 1.02rem;
    color: var(--side-link);
}

.nav-sidebar .nav-item .nav-link .right { color: #94a3b8; }

.nav-sidebar .nav-treeview .nav-link {
    margin: 1px .85rem;
    padding: .42rem .7rem;
    font-size: .86rem;
    border-radius: .55rem;
}

.nav-sidebar .nav-treeview .nav-link.active {
    background: linear-gradient(135deg, var(--side-active-a), var(--side-active-b)) !important;
    box-shadow: 0 6px 14px -7px rgba(var(--side-glow), .8);
}

.nav-sidebar .nav-treeview .nav-icon { font-size: .55rem; color: var(--side-soft); }

/* collapsed mini sidebar (desktop) */
.sidebar-mini.sidebar-collapse .nav-sidebar .nav-item .nav-link {
    margin: 2px 8px;
    padding: .55rem .6rem;
}

/* ===== Cards ===== */
.card {
    border-radius: .9rem;
    border: 1px solid rgba(226, 232, 240, .75);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 14px 34px -18px rgba(15, 23, 42, .22);
    transition: box-shadow .25s ease, transform .25s ease;
}

.card:hover { box-shadow: 0 2px 4px rgba(15, 23, 42, .05), 0 22px 46px -20px rgba(124, 58, 237, .35); }

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--border-soft);
    padding: 1rem 1.25rem;
    border-radius: .9rem .9rem 0 0;
}

.card-header .card-title { font-weight: 600; color: var(--slate-800); }
.card.card-primary { border-top: 3px solid var(--brand-500); }
.card.card-info { border-top: 3px solid #06b6d4; }
.card.card-success { border-top: 3px solid #10b981; }
.card.card-warning { border-top: 3px solid #f59e0b; }
.card.card-danger { border-top: 3px solid #ef4444; }

/* ===== Small boxes (dashboard stats) ===== */
.small-box {
    border-radius: .9rem;
    box-shadow: 0 12px 30px -14px rgba(15, 23, 42, .4);
    transition: transform .25s ease, box-shadow .25s ease;
}

.small-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 44px -18px rgba(15, 23, 42, .5);
}

.small-box.bg-primary { background: linear-gradient(135deg, #8b5cf6, #5b21b6) !important; }
.small-box.bg-success { background: linear-gradient(135deg, #34d399, #059669) !important; }
.small-box.bg-warning { background: linear-gradient(135deg, #fbbf24, #d97706) !important; }
.small-box.bg-danger  { background: linear-gradient(135deg, #f87171, #dc2626) !important; }
.small-box.bg-info    { background: linear-gradient(135deg, #22d3ee, #0284c7) !important; }
.small-box.bg-secondary { background: linear-gradient(135deg, #94a3b8, #475569) !important; }
.small-box.bg-dark    { background: linear-gradient(135deg, #475569, #1e293b) !important; }

.small-box .icon {
    font-size: 4.4rem;
    opacity: .25;
    transition: transform .3s ease, opacity .3s ease;
}

.small-box:hover .icon {
    transform: scale(1.12) rotate(-6deg);
    opacity: .38;
}

.small-box .small-box-footer { border-radius: 0 0 .9rem .9rem; }

/* ===== Info boxes ===== */
.info-box {
    border-radius: .8rem;
    border: 1px solid rgba(226, 232, 240, .8);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 12px 28px -18px rgba(15, 23, 42, .25);
    transition: transform .2s ease, box-shadow .2s ease;
}

.info-box:hover { transform: translateY(-2px); }

.info-box .info-box-icon.bg-primary { background: linear-gradient(135deg, #8b5cf6, #5b21b6) !important; }
.info-box .info-box-icon.bg-success { background: linear-gradient(135deg, #34d399, #059669) !important; }
.info-box .info-box-icon.bg-warning { background: linear-gradient(135deg, #fbbf24, #d97706) !important; }
.info-box .info-box-icon.bg-danger  { background: linear-gradient(135deg, #f87171, #dc2626) !important; }
.info-box .info-box-icon.bg-info    { background: linear-gradient(135deg, #22d3ee, #0284c7) !important; }
.info-box .info-box-icon.bg-secondary { background: linear-gradient(135deg, #94a3b8, #475569) !important; }
.info-box .info-box-icon.bg-dark    { background: linear-gradient(135deg, #475569, #1e293b) !important; }

/* ===== Buttons ===== */
.btn { border-radius: .55rem; font-weight: 500; transition: all .2s ease; }

.btn-primary {
    background: linear-gradient(135deg, #8b5cf6, #5b21b6);
    border: none;
    box-shadow: 0 8px 18px -8px rgba(107, 18, 32, .7);
}
.btn-primary:hover, .btn-primary:focus {
    background: linear-gradient(135deg, #7c3aed, #2e1065);
    transform: translateY(-1px);
    box-shadow: 0 10px 22px -8px rgba(94, 15, 28, .8);
}

.btn-success { background: linear-gradient(135deg, #10b981, #059669); border: none; }
.btn-success:hover { background: linear-gradient(135deg, #059669, #047857); transform: translateY(-1px); }

.btn-danger { background: linear-gradient(135deg, #f87171, #dc2626); border: none; }
.btn-danger:hover { background: linear-gradient(135deg, #dc2626, #b91c1c); transform: translateY(-1px); }

.btn-warning { background: linear-gradient(135deg, #fbbf24, #d97706); border: none; color: #fff; }
.btn-warning:hover { background: linear-gradient(135deg, #f59e0b, #b45309); color: #fff; transform: translateY(-1px); }

.btn-info { background: linear-gradient(135deg, #22d3ee, #0284c7); border: none; color: #fff; }
.btn-info:hover { background: linear-gradient(135deg, #06b6d4, #0369a1); color: #fff; transform: translateY(-1px); }

.btn-secondary { background: linear-gradient(135deg, #94a3b8, #64748b); border: none; }
.btn-secondary:hover { background: linear-gradient(135deg, #64748b, #475569); }

.btn-outline-primary { color: var(--brand-600); border-color: var(--brand-400); }
.btn-outline-primary:hover { background: linear-gradient(135deg, #8b5cf6, #5b21b6); border-color: transparent; }

.btn-sm, .btn-group-sm > .btn { border-radius: .45rem; }

/* ===== Forms ===== */
.form-control, .form-select {
    border-radius: .55rem;
    border-color: #e2e8f0;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 .2rem rgba(124, 58, 237, .18);
}

.input-group-text {
    border-radius: .55rem;
    background: #f8fafc;
    border-color: #e2e8f0;
    color: var(--slate-600);
}

/* ===== Tables ===== */
.table thead th {
    background: linear-gradient(180deg, #f8fafc, #f1f5f9);
    color: var(--slate-700);
    border-bottom: 2px solid #e2e8f0;
}

.table-hover tbody tr:hover { background: rgba(124, 58, 237, .05); }

.table td { vertical-align: middle; }

/* Row checkboxes inside data tables (e.g. students list "#" column).
   AdminLTE 3.2 ships Bootstrap 4's .form-check-input rule (position:absolute;
   margin-left:-1.25rem) which pushes the checkbox OUT of its cell so only the
   1,2,3 row numbers appear to exist. Bootstrap 5 puts it in normal flow -
   re-assert that here. */
td .form-check-input.student-checkbox,
td .form-check-input.col-toggle-check,
th .form-check-input {
    position: static !important;
    margin: 0 !important;
    width: 1.05em;
    height: 1.05em;
    vertical-align: middle;
    cursor: pointer;
}

/* "Select all" checkbox in the students list # header */
#checkAllStudents { margin-right: .35rem; }

/* DataTables pagination */
.page-item.active .page-link {
    background: linear-gradient(135deg, #8b5cf6, #5b21b6);
    border-color: #5b21b6;
}
.page-link { color: var(--brand-600); }
.page-link:hover { color: var(--brand-700); }

/* ===== Modals & dropdowns ===== */
.modal-content { border-radius: 1rem; border: none; box-shadow: 0 30px 60px -24px rgba(15, 23, 42, .45); }
.modal-header { border-bottom: 1px solid var(--border-soft); border-radius: 1rem 1rem 0 0; }
.modal-footer { border-top: 1px solid var(--border-soft); border-radius: 0 0 1rem 1rem; }

.dropdown-menu { border-radius: .7rem; border: 1px solid rgba(226, 232, 240, .9); box-shadow: 0 18px 40px -20px rgba(15, 23, 42, .3); }
.dropdown-item:hover { background: rgba(124, 58, 237, .08); }

/* user menu */
.user-menu .user-header.bg-primary {
    background: linear-gradient(135deg, #7c3aed, #8b5cf6) !important;
}

/* ===== Badges ===== */
.badge { font-weight: 600; padding: .38em .68em; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #eef2f7; border-radius: 4px; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #c4b5fd, #8b5cf6); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #a78bfa, #7c3aed); }

/* ===== Main footer ===== */
.main-footer {
    background: rgba(255, 255, 255, .85);
    border-top: 1px solid var(--border-soft);
    color: var(--slate-600);
    font-size: .85rem;
}

/* ===== Focus visibility (accessibility) ===== */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
    outline: 2px solid var(--brand-500);
    outline-offset: 2px;
}

/* ===== Responsive (all devices) ===== */
@media (max-width: 991.98px) {
    .content-wrapper { padding-top: .5rem; }
    .main-header.navbar { padding: 0 .35rem; }
    .main-header .navbar-nav > .nav-item > .nav-link { padding: .5rem .55rem; }
}

@media (max-width: 767.98px) {
    .main-sidebar { width: 260px; }
    .content-wrapper, .main-footer { margin-left: 0 !important; }
    .content-wrapper { padding: .5rem; }
    .content-header h1 { font-size: 1.15rem; }
    .content-header .breadcrumb { font-size: .8rem; }
    .small-box .inner h3 { font-size: 1.45rem; }
    .small-box .icon { font-size: 3rem; }
    .nav-sidebar .nav-icon { font-size: 1.12rem; }
    .table-responsive { -webkit-overflow-scrolling: touch; }
    .card-body { padding: 1rem; }
    .nav-sidebar .nav-item .nav-link { padding: .6rem .85rem; }
}

@media (max-width: 575.98px) {
    .content-header h1 { font-size: 1.05rem; }
    .content-header h1 i { font-size: 1.1rem; }
    .main-header .navbar-nav .d-none { display: none !important; }
    .btn { white-space: nowrap; }
}

/* ===== Notification bell animation & pulse ===== */
.notif-bell-animate {
    animation: bellRing 0.6s ease-in-out 3;
}
@keyframes bellRing {
    0%, 100% { transform: rotate(0deg); }
    15% { transform: rotate(18deg); }
    30% { transform: rotate(-15deg); }
    45% { transform: rotate(12deg); }
    60% { transform: rotate(-8deg); }
    75% { transform: rotate(4deg); }
}
.notif-pulse {
    animation: notifPulse 2s ease-in-out infinite;
}
@keyframes notifPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.85; }
}

/* ===== Responsive top-right live search (students list) ===== */
.student-live-search { position: relative; }
.student-live-search .form-control {
    border-left: 0;
    box-shadow: none;
}
.student-live-search .form-control:focus {
    box-shadow: none;
    border-color: inherit;
}
.student-live-search .input-group-text {
    border-right: 0;
}
.student-live-search #liveSearchStatus { min-height: 1.1em; }

@media (min-width: 992px) {
    .student-live-search { max-width: 620px; margin-left: auto; }
}

@media (max-width: 575.98px) {
    .student-live-search .input-group > .input-group-text { display: none; }
    .student-live-search .form-control { border-left: 1px solid #ced4da; border-radius: .25rem 0 0 .25rem; }
}

/* ===== Weekly plan: dynamic-template answers render as tidy bullet lists ===== */
.weekly-dyn-preview .weekly-dyn-value {
    background: #fff;
    border: 1px solid #e6e9ee;
    border-radius: .4rem;
    padding: .6rem .75rem;
    min-height: 2.4rem;
    font-size: .9rem;
}
.weekly-dyn-preview .weekly-dyn-value ul.weekly-dyn-list { margin-bottom: 0; padding-left: 1.15rem; }
.weekly-dyn-preview .weekly-dyn-value li { margin-bottom: .2rem; }
.weekly-dyn-preview .weekly-dyn-value li:last-child { margin-bottom: 0; }

/* Keep the full-screen plan preview readable when printed from the modal */
@media print {
    .modal { position: static !important; overflow: visible !important; }
    .modal-dialog { max-width: 100% !important; margin: 0 !important; }
    .modal-content { border: 0 !important; box-shadow: none !important; }
    .modal-footer, .modal-header .btn-close, .main-header, .main-sidebar, .content-header { display: none !important; }
}


/* Notices: drag & drop attachment zone (PDF/image preview on drop) */
.drop-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    padding: 1.25rem;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}
.drop-zone:hover,
.drop-zone.drag-over {
    border-color: #7c3aed;
    background: #f5f0ff;
}

/* ===== Sidebar colour picker (topbar palette button) ===== */
.side-picker-menu {
    min-width: 210px;
    padding: .6rem .7rem;
}
.side-picker-menu .sp-title {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--slate-600);
    font-weight: 700;
    margin: 0 0 .5rem;
}
.side-picker-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .5rem;
}
.side-swatch {
    appearance: none;
    border: 2px solid rgba(255, 255, 255, .25);
    border-radius: 10px;
    height: 40px;
    cursor: pointer;
    padding: 0;
    transition: transform .15s ease, box-shadow .15s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
}
.side-swatch:hover { transform: translateY(-2px); }
.side-swatch.active {
    outline: 2px solid var(--brand-500);
    outline-offset: 2px;
}
.side-swatch[data-theme="violet"]   { background: linear-gradient(135deg, #7c3aed, #2c1850); }
.side-swatch[data-theme="burgundy"] { background: linear-gradient(135deg, #b3283a, #4a1220); }
.side-swatch[data-theme="navy"]     { background: linear-gradient(135deg, #2563eb, #123055); }
.side-swatch[data-theme="emerald"]  { background: linear-gradient(135deg, #10b981, #10382a); }
.side-swatch[data-theme="rose"]     { background: linear-gradient(135deg, #e11d48, #46121f); }
.side-swatch[data-theme="slate"]    { background: linear-gradient(135deg, #64748b, #232a35); }
.side-picker-reset {
    font-size: .75rem;
    margin-top: .55rem;
    padding: .25rem .5rem;
}

/* ===================== EXAM OPTION INLINE RENDERING =====================
   Answer options must read exactly like the update-exam live preview: the
   letter sits IN FRONT of the option text on the SAME line ("A. 2+2"). A
   block wrapper (<div class="rich-content">, <p>, …) inside the option label
   forces "A." onto its own line with the answer below it, which is what the
   student take-exam pages used to show. Keep the wrapper inline and flatten
   its block children; images / tables inside an option keep their own layout. */
.opt-inline,
.opt-inline .rich-content,
.form-check-label > .rich-content {
    display: inline;
}
.opt-inline > div,
.opt-inline > p,
.opt-inline .rich-content > div,
.opt-inline .rich-content > p,
.form-check-label > .rich-content > div,
.form-check-label > .rich-content > p {
    display: inline;
    margin: 0;
    padding: 0;
}

/* ---------------------------------------------------------------------------
   Teacher greeting (ሰላም ነው / እንደምን አደሩ / እንደምን ዋሉ) — panel slides in and the
   waving hand + sparkle icons keep moving so the welcome is noticed.
   --------------------------------------------------------------------------- */
.teacher-greeting {
    animation: teacherGreetIn .6s ease-out both;
    border-radius: .6rem;
}
.teacher-greeting .greet-wave {
    display: inline-block;
    transform-origin: 70% 80%;
    animation: teacherGreetWave 1.8s ease-in-out infinite;
}
.teacher-greeting .greet-spark {
    display: inline-block;
    animation: teacherGreetFloat 2.2s ease-in-out infinite;
}
@keyframes teacherGreetIn {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: none; }
}
@keyframes teacherGreetWave {
    0%, 100% { transform: rotate(0); }
    15% { transform: rotate(18deg); }
    30% { transform: rotate(-8deg); }
    45% { transform: rotate(14deg); }
    60% { transform: rotate(-4deg); }
    75% { transform: rotate(8deg); }
}
@keyframes teacherGreetFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
@media (prefers-reduced-motion: reduce) {
    .teacher-greeting,
    .teacher-greeting .greet-wave,
    .teacher-greeting .greet-spark { animation: none; }
}
