:root {
    --primary-color: #d66700;
    --primary-dark: #b25400;
    --primary-light: #ffe6cc;
    --text-dark: #2b2b2b;
    --text-muted: #7a7a7a;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
    background: linear-gradient(160deg, #fff6ec 0%, #ffffff 55%);
    min-height: 100vh;
    margin: 0;
}

/* ===== Login Page ===== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 12px 35px rgba(214, 103, 0, 0.15);
    padding: 36px 32px;
    border-top: 6px solid var(--primary-color);
}

.login-logo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px auto;
    font-size: 28px;
    color: #fff;
    font-weight: 700;
}

.login-title {
    text-align: center;
    color: var(--text-dark);
    font-weight: 700;
    font-size: 22px;
    margin-bottom: 2px;
}

.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 13.5px;
    margin-bottom: 24px;
}

.password-group {
    position: relative;
}

    .password-group .toggle-password {
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        cursor: pointer;
        color: #777;
        font-size: 18px;
    }

        .password-group .toggle-password:hover {
            color: #000;
        }
/* Tabs */
.mac-tabs {
    display: flex;
    background: #fbeee0;
    border-radius: 12px;
    padding: 5px;
    margin-bottom: 26px;
}

.mac-tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 0;
    font-weight: 600;
    font-size: 14.5px;
    color: var(--text-muted);
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.25s ease;
}

    .mac-tab-btn.active {
        background: var(--primary-color);
        color: #fff;
        box-shadow: 0 4px 10px rgba(214, 103, 0, 0.35);
    }

.mac-tab-pane {
    display: none;
}

    .mac-tab-pane.active {
        display: block;
        animation: fadeIn 0.3s ease;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form fields */
.mac-form-group {
    margin-bottom: 18px;
}

.mac-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
    display: block;
}

.mac-input-group {
    display: flex;
    align-items: center;
    border: 1.5px solid #e7d2bb;
    border-radius: 10px;
    padding: 0 12px;
    background: #fffaf4;
    transition: border-color 0.2s;
    /*margin-bottom:20px;*/
}

    .mac-input-group:focus-within {
        border-color: var(--primary-color);
        background: #fff;
    }

    .mac-input-group i {
        color: var(--primary-color);
        font-size: 16px;
        margin-right: 8px;
    }

    .mac-input-group input {
        border: none;
        background: transparent;
        outline: none;
        padding: 11px 0;
        width: 100%;
        font-size: 14.5px;
        letter-spacing: 0.5px;
    }

/* OTP send row */
.otp-send-row {
    display: flex;
    gap: 8px;
}

    .otp-send-row .mac-input-group {
        flex: 1;
    }

.btn-send-otp {
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.2s;
}

    .btn-send-otp:hover {
        background: var(--primary-dark);
    }

    .btn-send-otp:disabled {
        background: #d9a973;
        cursor: not-allowed;
    }

/* Primary submit button */
.btn-mac-primary {
    width: 100%;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px 0;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin-top: 6px;
}

    .btn-mac-primary:hover {
        background: var(--primary-dark);
    }

    .btn-mac-primary:active {
        transform: scale(0.99);
    }

    .btn-mac-primary:disabled {
        background: #e5b78c;
        cursor: not-allowed;
    }

/* Alert / message box */
.mac-alert {
    display: none;
    padding: 10px 14px;
    border-radius: 9px;
    font-size: 13.5px;
    margin-bottom: 16px;
}

    .mac-alert.show {
        display: block;
    }

.mac-alert-success {
    background: #e6f7ea;
    color: #1e7e34;
    border: 1px solid #b7e4c2;
}

.mac-alert-error {
    background: #fdecea;
    color: #c0392b;
    border: 1px solid #f5c6cb;
}

.otp-hint {
    font-size: 12.5px;
    color: var(--text-muted);
    /* margin: -10px 0 16px 2px;*/
    margin: 5px 0 0px 3px;
}

.resend-text {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 14px;
}

    .resend-text a {
        color: var(--primary-color);
        font-weight: 600;
        text-decoration: none;
    }

        .resend-text a.disabled {
            color: #c9c9c9;
            pointer-events: none;
        }

/* Spinner */
.spinner-border-sm-mac {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* ===== Account Selection Page ===== */
.select-account-card {
    max-width: 460px;
}

.account-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 8px;
}

.account-card-form {
    margin: 0;
}

.account-card {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fffaf4;
    border: 1.5px solid #e7d2bb;
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

    .account-card:hover {
        border-color: var(--primary-color);
        background: #fff3e6;
        transform: translateY(-1px);
        box-shadow: 0 6px 14px rgba(214, 103, 0, 0.15);
    }

.account-card-icon {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
}

.account-card-info {
    flex: 1;
    min-width: 0;
}

.account-card-name {
    font-weight: 700;
    font-size: 15.5px;
    color: var(--text-dark);
}

.account-card-school {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

    .account-card-school i {
        color: var(--primary-color);
        margin-right: 4px;
    }

.account-card-meta {
    font-size: 12px;
    color: #a08c6f;
    margin-top: 2px;
}

.account-card-arrow {
    flex-shrink: 0;
    color: var(--primary-color);
    font-size: 18px;
}

/* ===== Simple message card (used by Error page) ===== */

.dashboard-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.dashboard-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 12px 35px rgba(214, 103, 0, 0.15);
    padding: 44px 40px;
    text-align: center;
    max-width: 420px;
    border-top: 6px solid var(--primary-color);
}

.dashboard-check {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    margin: 0 auto 18px auto;
}

.dashboard-card h2 {
    color: var(--text-dark);
    font-weight: 700;
    margin-bottom: 6px;
}

.dashboard-card p {
    color: var(--text-muted);
    margin-bottom: 22px;
}

.btn-logout {
    background: transparent;
    border: 1.5px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 10px;
    padding: 9px 22px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}

    .btn-logout:hover {
        background: var(--primary-color);
        color: #fff;
    }

/* ===== Dashboard (post login, post account-select) ===== */
.dash-page {
    min-height: 100vh;
    padding-bottom: 40px;
}

.dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--primary-color);
    color: #fff;
    padding: 16px 20px;
    box-shadow: 0 4px 14px rgba(214, 103, 0, 0.25);
}

.dash-header-school {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 16px;
    min-width: 0;
}

    .dash-header-school span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.dash-header-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.dash-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 16px;
    transition: background 0.2s;
}

    .dash-icon-btn:hover {
        background: rgba(255, 255, 255, 0.32);
        color: #fff;
    }

/* Student profile card */
.student-profile-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    margin: -20px 16px 20px 16px;
    padding: 18px 20px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 2;
}

.student-avatar {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--primary-light);
}

    .student-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.student-avatar-fallback {
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
}

.student-info h2 {
    margin: 0 0 4px 0;
    font-size: 18px;
    color: var(--text-dark);
    font-weight: 700;
}

.student-info p {
    margin: 2px 0;
    font-size: 13px;
    color: var(--text-muted);
}

    .student-info p i {
        color: var(--primary-color);
        margin-right: 5px;
    }

/* Menu grid */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 14px;
    padding: 0 16px;
}

.menu-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #fff;
    border-radius: 14px;
    padding: 16px 8px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1.5px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
    min-height: 96px;
}

    .menu-card:hover {
        border-color: var(--primary-color);
        transform: translateY(-2px);
        box-shadow: 0 8px 18px rgba(214, 103, 0, 0.15);
    }

.menu-card-disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

    .menu-card-disabled:hover {
        transform: none;
        border-color: transparent;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    }

.menu-card-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--primary-light);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

    .menu-card-icon img {
        width: 26px;
        height: 26px;
        object-fit: contain;
        border-radius: 6px;
    }

.menu-card-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dark);
    text-align: center;
    line-height: 1.25;
}

.menu-card-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--primary-color);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== Feature Pages (Messages, Circular, Gallery, Video) ===== */
.feature-page {
    min-height: 100vh;
    padding-bottom: 40px;
}

.feature-header {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--primary-color);
    color: #fff;
    padding: 16px 20px;
    box-shadow: 0 4px 14px rgba(214, 103, 0, 0.25);
}

.feature-back-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 16px;
    flex-shrink: 0;
    transition: background 0.2s;
}

    .feature-back-btn:hover {
        background: rgba(255, 255, 255, 0.32);
        color: #fff;
    }

.feature-title {
    font-weight: 700;
    font-size: 17px;
}

.feature-body {
    padding: 18px 16px;
}

.filter-row {
    margin-bottom: 18px;
}

.feature-select {
    width: 100%;
    border: 1.5px solid #e7d2bb;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    background: #fffaf4;
    color: var(--text-dark);
    outline: none;
}

    .feature-select:focus {
        border-color: var(--primary-color);
    }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

    .empty-state i {
        font-size: 44px;
        color: var(--primary-light);
        display: block;
        margin-bottom: 12px;
    }

/* Messages */
.message-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message-card {
    display: flex;
    gap: 12px;
    background: #fff;
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--primary-color);
}

.message-card-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.message-card-text {
    font-size: 13.5px;
    color: var(--text-dark);
    line-height: 1.5;
}

.message-card-date {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 6px;
}

    .message-card-date i {
        margin-right: 4px;
    }

/* Circular */
.circular-preview-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px 20px;
    text-align: center;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.circular-preview-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--primary-light);
    color: var(--primary-color);
    font-size: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px auto;
}

.circular-preview-name {
    font-weight: 700;
    font-size: 15.5px;
    color: var(--text-dark);
}

.circular-preview-date {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 4px;
    margin-bottom: 18px;
}

.circular-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.circular-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-light);
    color: var(--primary-dark);
    border: none;
    border-radius: 10px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
}

    .circular-action-btn:hover {
        background: var(--primary-color);
        color: #fff;
    }

.circular-email-row {
    text-align: left;
    border-top: 1px solid #f0e2d0;
    padding-top: 18px;
}

/* Photo Gallery - Albums */
.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
}

.album-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s;
}

    .album-card:hover {
        transform: translateY(-2px);
    }

.album-card-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--primary-light);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    overflow: hidden;
}

    .album-card-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.album-card-name {
    padding: 10px 10px 2px 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
}

.album-card-date {
    padding: 0 10px 10px 10px;
    font-size: 11px;
    color: var(--text-muted);
}

/* Photo Gallery - Photos in album */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
}

.photo-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: var(--primary-light);
}

    .photo-card img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.photo-share-btn {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
}

/* Video Gallery */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}

.video-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.video-card-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: var(--primary-light);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    cursor: pointer;
    overflow: hidden;
}

    .video-card-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.video-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 34px;
    background: rgba(0, 0, 0, 0.2);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.video-card-name {
    padding: 10px 10px 4px 10px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-dark);
}

.video-download-link {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 10px 10px 10px;
    font-size: 11.5px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

/* Video Modal */
.video-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

    .video-modal.show {
        display: flex;
    }

.video-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
}

.video-modal-content {
    position: relative;
    max-width: 700px;
    width: 100%;
    z-index: 1;
}

.video-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
}

/* =====Homework and Video Gallery — premium redesign ===== */
.vg-page {
    padding-bottom: 100px;
}

.vg-header {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--primary-color);
    color: #fff;
    padding: 16px 20px;
    box-shadow: 0 4px 14px rgba(214, 103, 0, 0.25);
}

.vg-title {
    font-weight: 700;
    font-size: 18px;
}

.vg-updated {
    font-size: 11.5px;
    opacity: 0.85;
    margin-top: 2px;
}

.vg-toolbar {
    padding: 16px 16px 0 16px;
}

.vg-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1.5px solid #e7d2bb;
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 12px;
}

    .vg-search-box i {
        color: var(--primary-color);
    }

    .vg-search-box input {
        border: none;
        outline: none;
        flex: 1;
        font-size: 14px;
        background: transparent;
    }

.vg-filter-row {
    display: flex;
    gap: 10px;
    margin-bottom: 6px;
}

.vg-select {
    flex: 1;
}

.today-homework {
    border: 2px solid #ff9800 !important;
    background: #fff7e6 !important;
    box-shadow: 0 0 12px rgba(255,152,0,.25);
    animation: todayGlow 1.5s infinite alternate;
}

@keyframes todayGlow {
    from {
        box-shadow: 0 0 8px rgba(255,152,0,.20);
    }

    to {
        box-shadow: 0 0 18px rgba(255,152,0,.45);
    }
}
/* Cards */
.video-card {
    position: relative;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

    .video-card:hover {
        transform: translateY(-2px);
    }

.video-card-selected {
    background: #eaf3ff;
    border: 2px solid #3b82f6 !important;
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.2) !important;
}

.video-select-checkbox {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 3;
    width: 26px;
    height: 26px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

    .video-select-checkbox input {
        width: 16px;
        height: 16px;
        accent-color: var(--primary-color);
        cursor: pointer;
    }

.video-new-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #e63946;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.video-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
}

/* Sticky bottom action bar */
.vg-action-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: -80px;
    background: #fff;
    border-top: 1px solid #eee;
    box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.1);
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: bottom 0.25s ease;
    z-index: 500;
}

    .vg-action-bar.show {
        bottom: 0;
    }

.vg-action-count {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 14px;
}

.vg-action-buttons {
    display: flex;
    gap: 8px;
}

.vg-action-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 9px 14px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

    .vg-action-btn:hover {
        background: var(--primary-dark);
    }

.vg-action-btn-clear {
    background: #f1f1f1;
    color: var(--text-muted);
}

    .vg-action-btn-clear:hover {
        background: #e2e2e2;
    }

/* Skeleton loader */
.skeleton-card {
    cursor: default;
}

.skeleton-box {
    background: linear-gradient(90deg, #f0e6d8 25%, #f8f0e4 37%, #f0e6d8 63%);
    background-size: 400% 100%;
    animation: skeleton-shimmer 1.4s ease infinite;
}

.skeleton-line {
    height: 10px;
    border-radius: 6px;
    margin: 8px 10px;
    background: linear-gradient(90deg, #f0e6d8 25%, #f8f0e4 37%, #f0e6d8 63%);
    background-size: 400% 100%;
    animation: skeleton-shimmer 1.4s ease infinite;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0 50%;
    }
}

/* Modal enhancements for Video Gallery */
.vg-modal-content {
    max-width: 800px;
}

.vg-modal-info {
    margin-top: 12px;
    text-align: center;
}

.vg-modal-title {
    font-weight: 700;
    font-size: 16px;
    color: #fff;
}

.vg-modal-meta {
    font-size: 12.5px;
    color: #ddd;
    margin-top: 2px;
}

.vg-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 14px;
    flex-wrap: wrap;
}

.vg-modal-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
}

.vg-nav-btn {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

    .vg-nav-btn:hover:not(:disabled) {
        background: rgba(255, 255, 255, 0.25);
    }

    .vg-nav-btn:disabled {
        opacity: 0.35;
        cursor: not-allowed;
    }

/* ===== Circular Module â€” enhanced (card list, filters, multi-select) ===== */
.circ-page {
    padding-bottom: 100px;
}

.circ-toolbar {
    padding: 16px 16px 0 16px;
}

.circ-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1.5px solid #e7d2bb;
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 12px;
}

    .circ-search-box i {
        color: var(--primary-color);
    }

    .circ-search-box input {
        border: none;
        outline: none;
        flex: 1;
        font-size: 14px;
        background: transparent;
    }

.circ-filter-row {
    display: flex;
    gap: 10px;
    margin-bottom: 6px;
}

.circ-select {
    flex: 1;
    border: 1.5px solid #e7d2bb !important;
    border-radius: 10px !important;
    padding: 9px 12px !important;
    font-size: 13.5px !important;
    background-color: #fffaf4 !important;
    color: var(--text-dark) !important;
}

    .circ-select:focus {
        border-color: var(--primary-color) !important;
        box-shadow: 0 0 0 0.2rem rgba(214, 103, 0, 0.15) !important;
    }

/* Card list */
.circ-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.circular-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 2px solid transparent;
    border-radius: 14px;
    padding: 14px 14px 14px 46px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}

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

    .circular-card:active {
        transform: scale(0.99);
    }

.circular-card-selected {
    background: #eaf3ff;
    border-color: #3b82f6 !important;
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.2) !important;
}

.circular-select-checkbox {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
}

    .circular-select-checkbox input {
        width: 19px;
        height: 19px;
        accent-color: var(--primary-color);
        cursor: pointer;
    }

.circ-card-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--primary-light);
    color: var(--primary-color);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.circ-card-body {
    flex: 1;
    min-width: 0;
}

.circ-card-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.circ-card-title {
    font-weight: 700;
    font-size: 14.5px;
    color: var(--text-dark);
    overflow-wrap: anywhere;
}

.circ-new-badge {
    background: #e63946;
    color: #fff;
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.circ-card-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 5px;
    font-size: 12px;
    color: var(--text-muted);
}

.circ-card-category, .circ-card-date {
    display: flex;
    align-items: center;
    gap: 4px;
}

.circ-card-view-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-light);
    color: var(--primary-dark);
    border: none;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    min-height: 40px;
}

    .circ-card-view-btn:hover {
        background: var(--primary-color);
        color: #fff;
    }

/* Skeleton cards for Circular list */
.circ-skeleton-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    flex-shrink: 0;
}

.circ-skeleton-lines {
    flex: 1;
}

/* Sticky bottom action bar */
.circ-action-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: -80px;
    background: #fff;
    border-top: 1px solid #eee;
    box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.1);
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    transition: bottom 0.25s ease;
    z-index: 500;
}

    .circ-action-bar.show {
        bottom: 0;
    }

.circ-action-count {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 14px;
}

.circ-action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.circ-action-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    min-height: 40px;
}

    .circ-action-btn:hover {
        background: var(--primary-dark);
    }

.circ-action-btn-clear {
    background: #f1f1f1;
    color: var(--text-muted);
}

    .circ-action-btn-clear:hover {
        background: #e2e2e2;
    }

/* Mobile-first tweaks for touch targets and spacing */
@media (max-width: 480px) {
    .circular-card {
        padding: 14px 12px 14px 42px;
        gap: 10px;
    }

    .circ-card-view-btn .circ-view-btn-text {
        display: none;
    }

    .circ-card-view-btn {
        padding: 10px 12px;
    }

    .circ-filter-row {
        flex-direction: column;
    }

    .circ-action-bar {
        justify-content: center;
        text-align: center;
    }

    .circ-action-count {
        width: 100%;
        text-align: center;
    }
}

/* ===== Photo selection checkbox (Photo Gallery album detail) ===== */
.photo-select-checkbox {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 3;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

    .photo-select-checkbox input {
        width: 15px;
        height: 15px;
        accent-color: var(--primary-color);
        cursor: pointer;
    }

.photo-card {
    position: relative;
}

/* ===== Album collage preview (Photo Gallery home) ===== */
.album-collage {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 2px;
    aspect-ratio: 1 / 1;
    background: var(--primary-light);
    overflow: hidden;
}

.album-collage-cell {
    overflow: hidden;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .album-collage-cell img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.album-collage-empty {
    grid-column: span 2;
    grid-row: span 2;
    color: var(--primary-color);
    font-size: 30px;
}

.album-card-meta {
    display: flex;
    gap: 12px;
    padding: 0 10px 4px 10px;
    font-size: 11px;
    color: var(--text-muted);
}

    .album-card-meta i {
        color: var(--primary-color);
        margin-right: 3px;
    }

.album-view-link {
    padding: 0 10px 10px 10px;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-color);
}

/* ===== Album detail page toolbar ===== */
.album-detail-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
}

/* ===== Full-screen photo viewer ===== */
.photo-viewer-content {
    max-width: 700px;
}

.photo-viewer-position {
    text-align: center;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    opacity: 0.85;
}

#photoViewerImg {
    width: 100%;
    max-height: 65vh;
    object-fit: contain;
    border-radius: 12px;
    transition: transform 0.25s ease;
    cursor: zoom-in;
}

    #photoViewerImg.zoomed {
        transform: scale(1.8);
        cursor: zoom-out;
    }

/* ===== Food Chart - Enhanced ===== */

.food-toolbar {
    padding: 16px 16px 0 16px;
}

.food-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1.5px solid #e7d2bb;
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 6px;
}

    .food-search-box i {
        color: var(--primary-color);
    }

    .food-search-box input {
        border: none;
        outline: none;
        flex: 1;
        font-size: 14px;
        background: transparent;
    }

.food-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    border: 2px solid transparent;
    border-radius: 14px;
    padding: 14px 18px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

    .food-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.10);
        border-color: var(--primary-color);
    }

    .food-card:active {
        transform: scale(0.98);
    }

.food-card-today {
    background: #fff8ef;
    border-color: var(--primary-color);
}

    .food-card-today:hover {
        border-color: var(--primary-dark);
        box-shadow: 0 8px 20px rgba(214, 103, 0, 0.15);
    }

/* Larger Food Images */
.food-card-photo {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    border-radius: 14px;
    background: var(--primary-light);
    color: var(--primary-color);
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.food-card:hover .food-card-photo {
    transform: scale(1.05);
}

.food-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.food-card-body {
    flex: 1;
    min-width: 0;
}

.food-card-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.food-card-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-dark);
}

.food-today-badge {
    background: var(--primary-color);
    color: #fff;
    font-size: 9.5px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.food-card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 5px;
    font-size: 12.5px;
    color: var(--text-muted);
}

    .food-card-meta span {
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .food-card-meta i {
        color: var(--primary-color);
        font-size: 13px;
    }

/* ===== Food Modal ===== */
.food-slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,.55);
    color: #fff;
    cursor: pointer;
    z-index: 20;
}

.food-prev {
    left: 12px;
}

.food-next {
    right: 12px;
}

.food-slider-btn:hover {
    background: #000;
}

.food-image-counter {
    text-align: center;
    font-weight: 600;
    padding: 10px;
    color: #666;
}

.food-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: foodModalFadeIn 0.3s ease;
}

    .food-modal.show {
        display: flex;
    }

@keyframes foodModalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.food-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.food-modal-content {
    position: relative;
    width: 100%;
    max-width: 500px;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
    z-index: 1;
    animation: foodModalSlideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.food-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

    .food-modal-close:hover {
        background: rgba(0, 0, 0, 0.7);
        transform: rotate(90deg);
    }

.food-modal-image-container {
    width: 100%;
    aspect-ratio: 16 / 10;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

    .food-modal-image-container img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: none;
    }

.food-modal-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 72px;
    color: var(--primary-color);
    background: var(--primary-light);
}

.food-modal-info {
    padding: 20px 24px 24px;
}

.food-modal-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.food-modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13.5px;
    color: var(--text-muted);
}

    .food-modal-meta span {
        display: flex;
        align-items: center;
        gap: 5px;
    }

    .food-modal-meta i {
        color: var(--primary-color);
        font-size: 14px;
    }

.food-modal-today-badge {
    margin-top: 12px;
    padding: 6px 14px;
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

/* Mobile responsive for Food Modal */
@media (max-width: 480px) {
    .food-card-photo {
        width: 56px;
        height: 56px;
        font-size: 26px;
    }

    .food-card {
        padding: 12px 14px;
        gap: 12px;
    }

    .food-card-name {
        font-size: 13.5px;
    }

    .food-modal-content {
        max-width: 95%;
        border-radius: 16px;
    }

    .food-modal-image-container {
        aspect-ratio: 16 / 11;
    }

    .food-modal-info {
        padding: 16px 18px 20px;
    }

    .food-modal-name {
        font-size: 17px;
    }

    .food-modal-meta {
        font-size: 12.5px;
        gap: 10px;
    }

    .food-modal-close {
        top: 8px;
        right: 8px;
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}

/* Tablet */
@media (min-width: 481px) and (max-width: 768px) {
    .food-card-photo {
        width: 64px;
        height: 64px;
    }

    .food-modal-content {
        max-width: 90%;
    }
}

/* ===== Academic Planners ===== */
.ap-toolbar {
    padding: 16px 16px 0 16px;
}

.ap-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1.5px solid #e7d2bb;
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 6px;
}

    .ap-search-box i {
        color: var(--primary-color);
    }

    .ap-search-box input {
        border: none;
        outline: none;
        flex: 1;
        font-size: 14px;
        background: transparent;
    }

.ap-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ap-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ap-folder-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.ap-file-card {
    align-items: flex-start;
}

.ap-file-card-locked {
    opacity: 0.75;
}

.ap-card-icon {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    overflow: hidden;
}

.ap-folder-icon {
    background: var(--primary-light);
    color: var(--primary-color);
}

.ap-file-icon {
    background: #eef2f7;
    color: #5b6b7c;
}

.ap-file-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ap-card-body {
    flex: 1;
    min-width: 0;
}

.ap-card-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-dark);
    overflow-wrap: anywhere;
}

.ap-card-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ap-card-sub {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 2px;
}

.ap-card-chevron {
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 16px;
}

.ap-card-instructions {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.ap-card-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 5px;
    font-size: 11.5px;
    color: var(--text-muted);
}

    .ap-card-meta span {
        display: flex;
        align-items: center;
        gap: 4px;
    }

.ap-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.ap-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 9px 14px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    min-height: 38px;
}

    .ap-action-btn:hover {
        background: var(--primary-dark);
    }

.ap-action-btn-outline {
    background: #fff;
    color: var(--primary-color);
    border: 1.5px solid var(--primary-color);
}

    .ap-action-btn-outline:hover {
        background: var(--primary-light);
    }

.ap-badge {
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.ap-badge-locked {
    background: #6c757d;
    color: #fff;
}

.ap-badge-expired {
    background: #e63946;
    color: #fff;
}

@media (max-width: 480px) {
    .ap-card-actions {
        flex-direction: column;
    }

    .ap-action-btn, .ap-action-btn-outline {
        width: 100%;
        justify-content: center;
    }
}

/* ===== Exams ===== */
.exam-tabs {
    display: flex;
    gap: 8px;
    padding: 14px 16px 0 16px;
}

.exam-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #fff;
    border: 1.5px solid #e7d2bb;
    color: var(--text-muted);
    border-radius: 12px;
    padding: 10px 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    min-height: 42px;
}

    .exam-tab.active {
        background: var(--primary-color);
        border-color: var(--primary-color);
        color: #fff;
    }

.exam-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.exam-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border-radius: 14px;
    padding: 13px 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

    .exam-card:active {
        transform: scale(0.99);
    }

.exam-card-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--primary-light);
    color: var(--primary-color);
    font-size: 19px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.exam-card-icon-pdf {
    background: #fdeceb;
    color: #e63946;
}

.exam-card-body {
    flex: 1;
    min-width: 0;
}

.exam-card-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-dark);
}

.exam-card-sub {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 2px;
}

.exam-card-chevron {
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 16px;
}

/* Marks popup */
.exam-marks-modal-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-dark);
    padding: 4px 24px 12px 4px;
    text-align: center;
}

.exam-marks-body {
    min-height: 80px;
}

.exam-marks-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 30px 10px;
    color: var(--text-muted);
    font-size: 13px;
}

.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--primary-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.exam-marks-table {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.exam-marks-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 6px;
    font-size: 13.5px;
    color: var(--text-dark);
    border-bottom: 1px solid #f3ede4;
}

    .exam-marks-row span:last-child {
        font-weight: 700;
        color: var(--primary-color);
    }

.exam-marks-header-row {
    text-align: center;
    font-weight: 700;
    font-size: 13px;
    color: var(--text-dark);
    padding: 10px 0 4px 0;
}

.exam-marks-summary-row {
    background: var(--primary-light);
    border-radius: 10px;
    padding: 10px 12px;
    margin-top: 4px;
    border-bottom: none;
}

/* Marksheet PDF popup */
.exam-pdf-modal-content {
    max-width: 620px;
    display: flex;
    flex-direction: column;
    height: 82vh;
}

.exam-pdf-frame {
    flex: 1;
    width: 100%;
    border: 1px solid #eee;
    border-radius: 10px;
    min-height: 0;
}

.exam-pdf-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

    .exam-pdf-actions .ap-action-btn,
    .exam-pdf-actions .ap-action-btn-outline {
        flex: 1;
        justify-content: center;
    }

@media (max-width: 480px) {
    .exam-tabs {
        flex-direction: row;
    }

    .exam-tab {
        font-size: 12px;
        padding: 10px 4px;
    }

    .exam-pdf-modal-content {
        height: 88vh;
    }
}

/* ===== Calendar ===== */
.cal-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    padding: 14px;
    margin: 0 16px 16px 16px;
}

.cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.cal-nav-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid #e7d2bb;
    background: #fff;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 15px;
}

    .cal-nav-btn:hover {
        background: var(--primary-light);
    }

.cal-month-label {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-dark);
}

.cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.cal-cell {
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 12.5px;
    color: var(--text-dark);
    transition: background 0.15s ease;
}

.cal-cell-empty {
    cursor: default;
}

.cal-cell-has-events:hover {
    background: var(--primary-light);
}

.cal-cell-today .cal-cell-num {
    background: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cal-cell-selected {
    background: #eaf3ff;
    box-shadow: inset 0 0 0 2px #3b82f6;
}

.cal-cell-dots {
    display: flex;
    gap: 2px;
    height: 5px;
}

.cal-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
}

.cal-legend {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 14px;
    flex-wrap: wrap;
}

.cal-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.cal-legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.cal-detail-panel {
    padding: 0 16px;
}

.cal-detail-heading {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.cal-detail-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cal-detail-card {
    background: #fff;
    border-left: 4px solid #999;
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.cal-detail-card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.cal-detail-card-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-dark);
}

.cal-detail-card-badge {
    flex-shrink: 0;
    color: #fff;
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.cal-detail-card-desc {
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--text-muted);
}

.cal-detail-card-img {
    margin-top: 8px;
    width: 100%;
    border-radius: 8px;
}

@media (max-width: 380px) {
    .cal-cell {
        font-size: 11px;
    }

    .cal-cell-today .cal-cell-num {
        width: 19px;
        height: 19px;
    }
}

/* ===== Dashboard header — Account dropdown menu ===== */
.account-menu {
    position: relative;
}

.account-menu-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

    .account-menu-btn:hover {
        background: rgba(255, 255, 255, 0.32);
    }

.account-menu-caret {
    font-size: 10px;
    transition: transform 0.2s;
}

.account-menu-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
    min-width: 220px;
    padding: 8px;
    z-index: 50;
    animation: fadeIn 0.15s ease;
}

    .account-menu-dropdown.show {
        display: block;
    }

.account-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    padding: 11px 12px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-dark);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s;
}

    .account-menu-item:hover {
        background: var(--primary-light);
        color: var(--primary-dark);
    }

    .account-menu-item i {
        font-size: 16px;
        color: var(--primary-color);
        width: 18px;
        text-align: center;
    }

.account-menu-item-danger {
    color: #c0392b;
}

    .account-menu-item-danger i {
        color: #c0392b;
    }

    .account-menu-item-danger:hover {
        background: #fdecea;
        color: #c0392b;
    }

.account-menu-divider {
    height: 1px;
    background: #f0e2d0;
    margin: 6px 4px;
}

.account-menu-item-badge {
    margin-left: auto;
    background: #EA6100;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

/* Set Default Year modal list */
.account-menu-year-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
    max-height: 300px;
    overflow-y: auto;
}

.d-none {
    display: none !important;
}

.account-menu-year-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fffaf4;
    border: 1.5px solid #e7d2bb;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s;
}

    .account-menu-year-item:hover {
        border-color: var(--primary-color);
        background: var(--primary-light);
    }

    .account-menu-year-item i {
        color: var(--primary-color);
    }

    .account-menu-year-item:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

.account-menu-year-item-loading {
    background: var(--primary-light);
    border-color: var(--primary-color);
}

/* ===== Dashboard Summary===== */

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    margin: 16px;
}

.summary-card {
    background: #fff;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.summary-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

    .summary-card-title h3 {
        margin: 0;
        font-size: 16px;
        font-weight: 700;
        color: #1f2937;
    }

.summary-card-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.summary-icon-green {
    background: #E4F6EC;
    color: #22A55D;
}

.summary-empty {
    color: #9ca3af;
    font-size: 13px;
    padding: 12px 0;
}

/* Attendance */
.attendance-body {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.attendance-donut {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.attendance-donut-hole {
    width: 100px;
    height: 100px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.attendance-donut-pct {
    font-size: 22px;
    font-weight: 800;
    color: #1f2937;
    line-height: 1.2;
}

.attendance-donut-label {
    font-size: 12px;
    color: #6b7280;
}

.attendance-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    min-width: 180px;
}

    .attendance-legend li {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 13px;
        color: #374151;
        padding: 6px 0;
    }

        .attendance-legend li b {
            margin-left: auto;
            color: #1f2937;
        }

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.dot-green {
    background: #22A55D;
}

.dot-red {
    background: #E14C4C;
}

.dot-orange {
    background: #F5A623;
}

.dot-blue {
    background: #3B82F6;
}

.summary-footer {
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14px;
}

.footer-green {
    background: #E4F6EC;
    color: #178A47;
    font-weight: 700;
}

.footer-red {
    background: #fc602e63;
    color: #8a3b17;
    font-weight: 700;
}
/* Fees */
.fees-rows {
    display: flex;
    flex-direction: column;
}

.fees-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #F1F1F1;
    font-size: 14px;
    color: #374151;
}

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

    .fees-row b {
        font-size: 15px;
        color: #1f2937;
    }

.fees-green {
    color: #22A55D !important;
}

.fees-orange {
    color: #F5A623 !important;
}

.fees-red {
    color: #E14C4C !important;
}

.fees-details-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    background: #FDEEE1;
    color: #EA6100;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    padding: 12px;
    border-radius: 10px;
}

    .fees-details-btn:hover {
        background: #FBE0C8;
        color: #EA6100;
    }

/* Today's Activity */
.today-activity-card {
    background: #fff;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    margin: 16px;
}

    .today-activity-card .summary-card-title {
        margin-bottom: 12px;
    }

.summary-icon-orange {
    background: #FDEEE1;
    color: #EA6100;
}

.today-activity-count {
    margin-left: auto;
    background: #EA6100;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 7px;
}

.today-activity-viewall {
    margin-left: 10px;
    font-size: 12px;
    font-weight: 700;
    color: #EA6100;
    text-decoration: none;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

    .today-activity-viewall:hover {
        text-decoration: underline;
    }

.today-activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 4px;
}

.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: #FAFAFA;
    border-radius: 10px;
    border: 1px solid #F0F0F0;
}

.activity-item-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.activity-icon-blue {
    background: #E6F0FF;
    color: #2563EB;
}

.activity-icon-purple {
    background: #F1E9FE;
    color: #7C3AED;
}

.activity-icon-yellow {
    background: #FFF6D9;
    color: #C9910A;
}

.activity-icon-green {
    background: #E4F6EC;
    color: #22A55D;
}

.activity-icon-pink {
    background: #FCE7F3;
    color: #DB2777;
}

.activity-icon-orange {
    background: #FDEEE1;
    color: #EA6100;
}

.activity-icon-teal {
    background: #E1F5F3;
    color: #0D9488;
}

.activity-item-body {
    flex: 1;
    min-width: 0;
}

.activity-item-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.activity-item-type {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6b7280;
}

.activity-item-time {
    font-size: 12px;
    color: #9ca3af;
    white-space: nowrap;
}

.activity-item-title {
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
    margin-top: 4px;
}

.activity-item-text {
    font-size: 13px;
    color: #374151;
    margin-top: 4px;
    white-space: pre-line;
    word-break: break-word;
}

.activity-item-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #EA6100;
    text-decoration: none;
}

    .activity-item-link:hover {
        text-decoration: underline;
    }

.activity-item-photo {
    display: block;
    max-width: 220px;
    max-height: 140px;
    width: auto;
    height: auto;
    border-radius: 8px;
    margin-top: 8px;
    object-fit: cover;
}

/* ===== Recently Shared (Notifications) page ===== */
.rs-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.rs-toolbar-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

    .rs-toolbar-label i {
        color: var(--primary-color);
    }

.rs-date-select {
    flex: 1;
    min-width: 160px;
    max-width: 220px;
}

.rs-module-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.rs-module-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #F0F0F0;
    border-radius: 30px;
    padding: 6px 12px 6px 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.rs-module-chip-empty {
    opacity: 0.55;
}

.rs-module-chip-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.rs-module-chip-name {
    font-size: 12.5px;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
}

.rs-module-chip-count {
    background: #F3F4F6;
    color: #374151;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.rs-feed-list {
    max-height: none;
    overflow-y: visible;
}

.rs-file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.rs-file-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #FDEEE1;
    color: #EA6100;
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 8px;
    max-width: 220px;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

    .rs-file-chip span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .rs-file-chip:hover {
        background: #FBE0C8;
        color: #EA6100;
    }

/* ===== Reusable "View" button â€” used everywhere a view/open link exists ===== */
.mac-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #FFF3E9;
    color: #EA6100;
    border: 1px solid #FBDDC0;
    font-size: 12.5px;
    font-weight: 700;
    text-decoration: none;
    padding: 7px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    margin-top: 8px;
    transition: background 0.15s ease, transform 0.1s ease;
}

    .mac-view-btn i {
        font-size: 13px;
    }

    .mac-view-btn:hover {
        background: #FFE6D2;
        color: #EA6100;
        transform: translateY(-1px);
    }

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

.rs-view-full-btn {
    background: #EEF2FF;
    color: #4338CA;
    border-color: #E0E7FF;
}

    .rs-view-full-btn:hover {
        background: #E0E7FF;
        color: #4338CA;
    }

/* ---- Message / description preview clamp (Recently Shared) ---- */
.rs-text-preview {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
    line-height: 1.6;
    word-break: break-word;
    white-space: pre-line;
}

/* ---- Image thumbnails (small) -> click opens full-screen slider ---- */
.rs-thumb-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-top: 8px;
    max-width: 320px;
}

.rs-thumb {
    position: relative;
    padding: 0;
    border: none;
    background: none;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    cursor: pointer;
    display: block;
}

    .rs-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.rs-thumb-more {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== Module-wise count chips as FILTERS (Recently Shared page) ===== */
.rs-module-chip {
    cursor: pointer;
    border: 1px solid #F0F0F0;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

    .rs-module-chip.rs-module-chip-active {
        border-color: #EA6100;
        box-shadow: 0 0 0 2px rgba(234, 97, 0, 0.15);
    }

    .rs-module-chip.rs-module-chip-dimmed {
        opacity: 0.4;
    }

/* ===== Attendance Feature ===== */
.att-summary-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    padding: 22px 16px 18px 16px;
    margin: 0 16px 14px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.att-donut {
    width: 132px;
    height: 132px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.att-donut-hole {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.att-donut-pct {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-dark);
}

.att-donut-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.att-stat-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.att-stat {
    background: #fff8f1;
    border: 1px solid #f3ddc4;
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.att-stat-value {
    font-size: 17px;
    font-weight: 800;
    color: var(--primary-dark);
}

.att-stat-label {
    font-size: 11px;
    color: var(--text-muted);
}

.att-stat-danger {
    background: #fdecec;
    border-color: #f6c6c6;
}

    .att-stat-danger .att-stat-value {
        color: #c0392b;
    }

.att-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #fff4e0;
    border: 1px solid #f3ddc4;
    color: var(--text-dark);
    font-size: 12.5px;
    line-height: 1.4;
    border-radius: 12px;
    padding: 10px 12px;
    margin: 0 16px 16px 16px;
}

    .att-note i {
        color: var(--primary-color);
        margin-top: 1px;
        flex-shrink: 0;
    }

.att-cal-card {
    margin-top: 2px;
}

.att-cell-absent .cal-cell-num {
    background: #fdecec;
    color: #c0392b;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.att-month-chip-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 16px 16px 16px;
}

.att-month-chip {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fdecec;
    color: #c0392b;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    white-space: nowrap;
}

@media (max-width: 380px) {
    .att-donut {
        width: 114px;
        height: 114px;
    }

    .att-donut-hole {
        width: 82px;
        height: 82px;
    }

    .att-donut-pct {
        font-size: 19px;
    }
}

/* ===== Profile Feature ===== */
.profile-header-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    padding: 26px 16px 20px 16px;
    margin: 0 16px 16px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.profile-avatar-lg {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    border: 3px solid var(--primary-color);
}

    .profile-avatar-lg img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.profile-avatar-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
}

.profile-name {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-dark);
}

.profile-meta {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.profile-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 6px 16px 8px 16px;
}

.profile-field-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    padding: 4px 14px;
    margin: 0 16px 16px 16px;
}

.profile-field-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 0;
    border-bottom: 1px solid #f2e6d8;
}

    .profile-field-row:last-child {
        border-bottom: none;
    }

.profile-field-row-compact {
    padding: 8px 0;
}

.profile-field-label {
    font-size: 12.5px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.profile-field-value {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-dark);
    text-align: right;
}

.profile-parent-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 0 16px 16px 16px;
}

.profile-parent-block {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.profile-parent-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--primary-light);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 8px;
}

    .profile-parent-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.profile-parent-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.profile-parent-block .profile-field-row {
    width: 100%;
    text-align: left;
}

.profile-parent-block .profile-field-value {
    text-align: right;
}

@media (max-width: 580px) {
    .profile-parent-grid {
        grid-template-columns: 1fr;
    }
}

/* Dashboard: student avatar ab Profile page ka clickable link hai */
.student-avatar-link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
}

/* ===== Fees Feature ===== */
.mac-alert-info {
    background: #fff4e0;
    color: var(--text-dark);
    border: 1px solid #f3ddc4;
    display: none;
}

    .mac-alert-info.show {
        display: flex;
    }

.fee-banner-alert {
    align-items: flex-start;
    gap: 8px;
    transition: box-shadow 0.2s ease;
}

    .fee-banner-alert i {
        color: var(--primary-color);
        margin-top: 1px;
        flex-shrink: 0;
    }

.fee-banner-pulse {
    box-shadow: 0 0 0 3px var(--primary-light);
}

.fee-summary-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    padding: 18px 16px;
    margin: 0 16px 16px 16px;
}

.fee-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.fee-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: #fff8f1;
    border: 1px solid #f3ddc4;
    border-radius: 12px;
    padding: 12px 6px;
}

.fee-stat-value {
    font-size: 15px;
    font-weight: 800;
    color: var(--primary-dark);
}

.fee-stat-label {
    font-size: 10.5px;
    color: var(--text-muted);
    text-align: center;
}

.fee-stat-success {
    background: #eaf7ee;
    border-color: #bfe6c9;
}

    .fee-stat-success .fee-stat-value {
        color: #1e7e34;
    }

.fee-stat-danger {
    background: #fdecec;
    border-color: #f6c6c6;
}

    .fee-stat-danger .fee-stat-value {
        color: #c0392b;
    }

.fee-tabs {
    display: flex;
    gap: 8px;
    margin: 0 16px 14px 16px;
    overflow-x: auto;
}

.fee-tab {
    flex-shrink: 0;
    background: #fff;
    border: 1.5px solid #e7d2bb;
    color: var(--text-muted);
    font-size: 12.5px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.fee-tab-active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.fee-card-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0 16px 16px 16px;
}

.fee-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    padding: 14px;
}

.fee-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.fee-card-title {
    font-size: 14.5px;
    font-weight: 800;
    color: var(--text-dark);
}

.fee-card-group {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 2px;
}

.fee-card-status-badge {
    flex-shrink: 0;
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: capitalize;
    padding: 4px 10px;
    border-radius: 20px;
}

.fee-card-month {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

.fee-card-amounts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.fee-amount-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: #fff8f1;
    border: 1px solid #f3ddc4;
    border-radius: 10px;
    padding: 7px 11px;
    min-width: 74px;
}

.fee-amount-value {
    font-size: 13px;
    font-weight: 800;
    color: var(--primary-dark);
}

.fee-amount-label {
    font-size: 10px;
    color: var(--text-muted);
}

.fee-amount-success {
    background: #eaf7ee;
    border-color: #bfe6c9;
}

    .fee-amount-success .fee-amount-value {
        color: #1e7e34;
    }

.fee-amount-danger {
    background: #fdecec;
    border-color: #f6c6c6;
}

    .fee-amount-danger .fee-amount-value {
        color: #c0392b;
    }

.fee-receipt-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #f0dcc4;
}

.fee-receipt-chip {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 11.5px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    text-decoration: none;
}

.fee-pay-online-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    z-index: 20;
}

.fee-pay-online-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--primary-color);
    color: #fff;
    font-size: 14.5px;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    padding: 13px;
    cursor: pointer;
}

/* ===== Apply Leave Feature ===== */
.leave-summary-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    padding: 14px 16px;
    margin: 0 16px 16px 16px;
}

.leave-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.leave-summary-year {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--text-muted);
}

.leave-summary-total {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-dark);
}

.leave-type-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.leave-type-chip {
    background: #fff8f1;
    border: 1px solid #f3ddc4;
    color: var(--text-muted);
    font-size: 11.5px;
    padding: 5px 11px;
    border-radius: 20px;
}

    .leave-type-chip b {
        color: var(--primary-dark);
    }

.leave-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0 16px 16px 16px;
}

.leave-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    padding: 14px;
}

.leave-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.leave-card-type {
    font-size: 14.5px;
    font-weight: 800;
    color: var(--text-dark);
}

.leave-card-dates {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 3px;
}

.leave-status-badge {
    flex-shrink: 0;
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
}

.leave-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-muted);
}

    .leave-card-meta span {
        display: flex;
        align-items: center;
        gap: 5px;
    }

.leave-reason {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #f0dcc4;
    font-size: 12.5px;
}

.leave-reason-label {
    font-weight: 700;
    color: var(--text-dark);
    margin-right: 4px;
}

.leave-reason-text {
    color: var(--text-muted);
}

.leave-reason-clamped {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.leave-reason-expanded {
    display: inline;
}

.leave-view-more-btn {
    display: block;
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 11.5px;
    font-weight: 700;
    padding: 4px 0 0 0;
    cursor: pointer;
}

.leave-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
}

.leave-attachment-chip {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 11.5px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    text-decoration: none;
}

.leave-delete-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #fdecec;
    color: #c0392b;
    border: none;
    font-size: 11.5px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    margin-left: auto;
}

    .leave-delete-btn:disabled {
        opacity: 0.6;
        cursor: default;
    }

/* Bottom Apply Leave CTA */
.leave-apply-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    z-index: 20;
}

.leave-apply-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--primary-color);
    color: #fff;
    font-size: 14.5px;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    padding: 13px;
    cursor: pointer;
}

/* Apply Leave modal */
.leave-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    align-items: flex-end;
    justify-content: center;
}

    .leave-modal.show {
        display: flex;
    }

.leave-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.leave-modal-content {
    position: relative;
    width: 100%;
    max-width: 500px;
    max-height: 88vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding: 24px 18px calc(20px + env(safe-area-inset-bottom));
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.25);
    z-index: 1;
    animation: leaveModalSlideUp 0.3s ease;
}

@keyframes leaveModalSlideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.leave-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: #f5efe6;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
}

.leave-modal-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 16px;
}

.leave-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.leave-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.leave-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .leave-form-group label {
        font-size: 12.5px;
        font-weight: 700;
        color: var(--text-dark);
    }

.leave-form-hint {
    font-size: 10.5px;
    font-weight: 400;
    color: var(--text-muted);
}

.leave-form-input {
    border: 1.5px solid #e7d2bb;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13.5px;
    color: var(--text-dark);
    background: #fff;
    font-family: inherit;
}

    .leave-form-input:focus {
        outline: none;
        border-color: var(--primary-color);
    }

.leave-form-textarea {
    resize: vertical;
}

.leave-halfday-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-dark);
}

    .leave-halfday-check input {
        width: 16px;
        height: 16px;
        accent-color: var(--primary-color);
    }

.leave-submit-btn {
    width: 100%;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 13px;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 4px;
}

    .leave-submit-btn:disabled {
        opacity: 0.7;
        cursor: default;
    }

@media (max-width: 380px) {
    .leave-form-row {
        grid-template-columns: 1fr;
    }
}

/* ===== Time Table (single page, tabs) ===== */
.tt-tabs {
    display: flex;
    gap: 8px;
    margin: 0 16px 14px 16px;
    overflow-x: auto;
}

.tt-tab {
    flex-shrink: 0;
    background: #fff;
    border: 1.5px solid #e7d2bb;
    color: var(--text-muted);
    font-size: 12.5px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tt-tab-active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.tt-tab-panel {
    display: none;
}

.tt-tab-panel-active {
    display: block;
}

/* ===== Time Table grid (Time column + Day columns) ===== */
.tt-grid-scroll {
    overflow-x: auto;
    margin: 0 16px 14px 16px;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    -webkit-overflow-scrolling: touch;
}

.tt-grid-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    min-width: 560px;
    background: #fff;
}

    .tt-grid-table th,
    .tt-grid-table td {
        border: 1px solid #f0dcc4;
        padding: 9px 10px;
        text-align: center;
        vertical-align: middle;
        font-size: 11.5px;
    }

    .tt-grid-table thead th {
        background: var(--primary-color);
        color: #fff;
        font-size: 12px;
        font-weight: 700;
        white-space: nowrap;
        border-color: var(--primary-dark);
        position: sticky;
        top: 0;
        z-index: 2;
    }

.tt-grid-time-col {
    background: var(--primary-light) !important;
    color: var(--primary-dark) !important;
    font-weight: 800;
    font-size: 10.5px;
    white-space: nowrap;
    width: 68px;
    min-width: 68px;
    position: sticky;
    left: 0;
    z-index: 1;
}

thead .tt-grid-time-col {
    z-index: 3;
}

.tt-grid-today-badge {
    display: block;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 2px;
    opacity: 0.9;
}

.tt-grid-today-col {
    background: #fff8ef;
}

thead .tt-grid-today-col {
    background: var(--primary-dark) !important;
}

.tt-grid-cell-subject {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 12px;
}

.tt-grid-cell-teacher {
    color: var(--text-muted);
    font-size: 10px;
    margin-top: 2px;
}

.tt-grid-recess-cell {
    background: #fffaf0;
}

    .tt-grid-recess-cell .tt-grid-cell-subject {
        color: #b57500;
    }

.tt-grid-blank-cell {
    color: #cfc0aa;
}

.tt-holiday-chip-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f5efe6;
    color: var(--text-muted);
    font-size: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    margin: 0 16px 16px 16px;
}

/* ===== Time Table PDF List (Weekly / Exam tabs) ===== */
.tt-pdf-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0 16px 16px 16px;
}

.tt-pdf-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    padding: 12px 14px;
}

.tt-pdf-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #fdecea;
    color: #e05c4b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.tt-pdf-title {
    flex: 1;
    min-width: 0;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tt-pdf-open-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 11.5px;
    font-weight: 700;
    padding: 7px 13px;
    border-radius: 20px;
    text-decoration: none;
}

@media (max-width: 380px) {
    .tt-grid-table {
        min-width: 500px;
    }
}

/* ============================================================
   MacViewer â€” global in-page file viewer (PDF/Text/YouTube/Sheet
   frame, Audio/Video player, Image lightbox, Text/message popup)
   Markup: Views/Shared/_MacViewerModal.cshtml
   Logic:  wwwroot/js/macViewer.js
   ============================================================ */
.mac-viewer-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

    .mac-viewer-modal.show {
        display: flex;
    }

.mac-viewer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 17, 17, 0.72);
}

.mac-viewer-content {
    position: relative;
    width: min(920px, 96vw);
    height: min(88vh, 900px);
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

.mac-viewer-content-media {
    height: auto;
    max-height: 88vh;
}

.mac-viewer-content-text {
    height: auto;
    max-height: 80vh;
}

.mac-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #F0F0F0;
    background: #FAFAFA;
    flex-shrink: 0;
}

.mac-viewer-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14.5px;
    font-weight: 700;
    color: #1f2937;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

    .mac-viewer-header-title i {
        color: #EA6100;
        flex-shrink: 0;
    }

.mac-viewer-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.mac-viewer-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: #F3F4F6;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    font-size: 15px;
    transition: background 0.15s ease;
}

    .mac-viewer-icon-btn:hover {
        background: #E5E7EB;
        color: #374151;
    }

.mac-viewer-frame {
    flex: 1;
    width: 100%;
    border: none;
    background: #525659;
}

.mac-media-wrap {
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111827;
}

.mac-media-el {
    width: 100%;
    max-height: 70vh;
    border-radius: 8px;
}

audio.mac-media-el {
    width: 100%;
    max-height: none;
}

.mac-media-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-align: center;
    padding: 20px;
}

    .mac-media-error i {
        font-size: 30px;
        color: #FBBF24;
    }

    .mac-media-error p {
        margin: 0;
        font-size: 14px;
    }

/* ---- Image lightbox ---- */
.mac-image-viewer-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2100;
    align-items: center;
    justify-content: center;
}

    .mac-image-viewer-modal.show {
        display: flex;
    }

.mac-image-viewer-topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    z-index: 2;
    background: linear-gradient(to bottom, rgba(0,0,0,0.55), transparent);
}

.mac-image-viewer-title {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60vw;
}

.mac-image-viewer-modal .mac-viewer-icon-btn {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

    .mac-image-viewer-modal .mac-viewer-icon-btn:hover {
        background: rgba(255,255,255,0.28);
        color: #fff;
    }

.mac-image-viewer-img {
    max-width: 92vw;
    max-height: 84vh;
    object-fit: contain;
    border-radius: 4px;
    user-select: none;
    z-index:inherit;
}

.mac-image-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
}

    .mac-image-nav-btn:hover {
        background: rgba(255,255,255,0.28);
    }

    .mac-image-nav-btn:disabled {
        opacity: 0.3;
        cursor: default;
    }

.mac-image-nav-prev {
    left: 14px;
}

.mac-image-nav-next {
    right: 14px;
}

.mac-image-viewer-position {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
}

/* ---- Text / message viewer ---- */
.mac-text-viewer-body {
    padding: 18px 20px;
    overflow-y: auto;
    font-size: 15px;
    line-height: 1.8;
    color: #1f2937;
}

.mac-text-viewer-date {
    font-size: 12.5px;
    color: #6b7280;
    margin-bottom: 10px;
}

@media (max-width: 480px) {
    .mac-viewer-content {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }

    .mac-image-viewer-img {
        max-width: 96vw;
    }

    .mac-image-nav-btn {
        width: 38px;
        height: 38px;
        font-size: 17px;
    }
}
