/* UI Enhancements for School Management System */

/* Responsive Font Sizes */
@media (max-width: 768px) {
    html { font-size: 14px; }
    .display-6 { font-size: 1.5rem !important; }
    .page-header h2 { font-size: 1.25rem !important; }
    .page-header p { font-size: 0.875rem !important; }
}

/* Dashboard Card Improvements */
.card-modern {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    border: 1px solid rgba(148, 163, 184, 0.18) !important;
}

.card-modern:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08) !important;
    border-color: rgba(59,130,246,0.2) !important;
}

/* Awesome responsive surface */
body {
    background-image:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.08), transparent 30%),
        radial-gradient(circle at bottom right, rgba(139, 92, 246, 0.07), transparent 26%),
        linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
    background-attachment: fixed;
}

.main-content {
    padding-bottom: 1.5rem;
}

.dashboard-hero {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(37, 99, 235, 0.9));
    color: #fff;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 18px 40px rgba(37, 99, 235, 0.18);
}

.admin-priority-card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-height: 110px;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-priority-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.08);
    text-decoration: none;
}

.admin-priority-icon {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: 0.9rem;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.admin-priority-label {
    display: block;
    margin-bottom: 0.2rem;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.admin-priority-card h6 {
    color: #0f172a;
    font-weight: 800;
}

.dashboard-hero .feature-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 0.45rem 0.85rem;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(6px);
}

.teacher-classes-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 2rem 2.25rem;
    overflow: hidden;
}

.teacher-classes-hero h1 {
    font-size: clamp(1.7rem, 3vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.teacher-classes-hero-icon {
    display: grid;
    place-items: center;
    width: 6.5rem;
    height: 6.5rem;
    flex: 0 0 6.5rem;
    border-radius: 2rem;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.12);
    font-size: 2.75rem;
    transform: rotate(7deg);
}

.teacher-classes-stat {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1.15rem 1.25rem;
    border-radius: 1.1rem;
    background: rgba(255, 255, 255, 0.82);
}

.teacher-classes-stat-icon {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    flex: 0 0 2.75rem;
    border-radius: 0.85rem;
    background: currentColor;
    color: inherit;
    font-size: 1.1rem;
}

.teacher-classes-stat-icon i {
    color: #fff;
}

.teacher-classes-stat strong,
.teacher-classes-stat span {
    display: block;
}

.teacher-classes-stat strong {
    color: #0f172a;
    font-size: 1.35rem;
    line-height: 1.1;
}

.teacher-classes-stat div span {
    margin-top: 0.25rem;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
}

.teacher-class-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.94);
}

.teacher-class-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.25rem 0;
}

.teacher-class-avatar {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    color: #fff;
    background: linear-gradient(135deg, #4361ee, #7c3aed);
    box-shadow: 0 0.65rem 1.25rem rgba(67, 97, 238, 0.25);
}

.teacher-class-count {
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    color: #1d4ed8;
    background: #eff6ff;
    font-size: 0.75rem;
    font-weight: 800;
}

.teacher-class-card-body {
    flex: 1;
    padding: 1.15rem 1.25rem 1.35rem;
}

.teacher-class-label {
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.teacher-class-card h2 {
    margin: 0;
    color: #0f172a;
    font-size: 1.35rem;
    font-weight: 800;
}

.teacher-class-section {
    margin: 0.45rem 0 1.1rem;
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 600;
}

.teacher-class-subjects {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.teacher-subject-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid #e0e7ff;
    border-radius: 0.7rem;
    color: #3730a3;
    background: #f5f3ff;
    font-size: 0.78rem;
    font-weight: 700;
}

.teacher-subject-chip i {
    color: #6366f1;
    font-size: 0.7rem;
}

.teacher-class-actions {
    display: flex;
    gap: 0.65rem;
    padding: 1rem 1.25rem 1.25rem;
    border-top: 1px solid #eef2f7;
}

.teacher-class-actions .btn {
    min-height: 44px;
}

.teacher-classes-empty {
    padding: 3.5rem 1.5rem;
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.9);
}

.teacher-classes-empty-icon {
    display: grid;
    place-items: center;
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    border-radius: 1.25rem;
    color: #4f46e5;
    background: #eef2ff;
    font-size: 1.5rem;
}

.teacher-classes-empty h3 {
    color: #0f172a;
    font-size: 1.2rem;
    font-weight: 800;
}

.dashboard-surface {
    overflow: hidden;
    border-radius: 1.15rem !important;
    background: rgba(255, 255, 255, 0.9);
}

/* Shared responsive visual system */
:root {
    --ui-indigo: #6366f1;
    --ui-violet: #8b5cf6;
    --ui-cyan: #06b6d4;
    --ui-surface: rgba(255, 255, 255, 0.82);
    --ui-border: rgba(148, 163, 184, 0.2);
}

@keyframes ui-shimmer {
    0%, 100% { transform: translate3d(-4%, -2%, 0) scale(1); opacity: .55; }
    50% { transform: translate3d(3%, 2%, 0) scale(1.08); opacity: .8; }
}

.admin-dashboard .content-body,
.main-content > .content-body {
    position: relative;
}

.admin-dashboard .content-body::before,
.main-content > .content-body::before {
    content: "";
    position: absolute;
    top: -7rem;
    right: -9rem;
    width: 22rem;
    height: 22rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, .12), transparent 68%);
    pointer-events: none;
    animation: ui-shimmer 12s ease-in-out infinite;
}

.admin-dashboard .content-body > *,
.main-content > .content-body > * {
    position: relative;
    z-index: 1;
}

.admin-dashboard .dashboard-hero {
    background:
        radial-gradient(circle at 86% 18%, rgba(129, 140, 248, .5), transparent 26%),
        linear-gradient(128deg, #0f172a 0%, #1e3a8a 52%, #4f46e5 100%);
    border: 1px solid rgba(255, 255, 255, .13);
    box-shadow: 0 1.5rem 3rem rgba(30, 64, 175, .2);
}

.admin-dashboard .dashboard-hero .feature-pill {
    background: rgba(255, 255, 255, .11);
    border-color: rgba(255, 255, 255, .18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}

.admin-dashboard .admin-priority-card,
.admin-dashboard .stat-card,
.main-content .card-modern,
.main-content .dashboard-surface {
    background: var(--ui-surface);
    border-color: var(--ui-border) !important;
    box-shadow: 0 .8rem 2rem rgba(15, 23, 42, .055);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.admin-dashboard .admin-priority-card:hover,
.admin-dashboard .stat-card:hover,
.main-content .card-modern:hover {
    border-color: rgba(99, 102, 241, .35) !important;
    box-shadow: 0 1.2rem 2.5rem rgba(67, 56, 202, .13);
}

.admin-dashboard .admin-priority-icon {
    box-shadow: 0 .55rem 1.1rem rgba(67, 97, 238, .14);
}

/* Public landing page */
body.landing-page {
    background: #f8fafc;
}

body.landing-page .navbar {
    background: rgba(255, 255, 255, .78) !important;
    border-bottom: 1px solid rgba(148, 163, 184, .16);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    transition: box-shadow .25s ease, background .25s ease;
}

body.landing-page .navbar-brand {
    letter-spacing: -.03em;
}

body.landing-page .navbar .nav-link {
    position: relative;
    padding-inline: .9rem !important;
    color: #475569;
    transition: color .2s ease;
}

body.landing-page .navbar .nav-link::after {
    content: "";
    position: absolute;
    right: .9rem;
    bottom: .25rem;
    left: .9rem;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--ui-indigo), var(--ui-cyan));
    transform: scaleX(0);
    transform-origin: center;
    transition: transform .2s ease;
}

body.landing-page .navbar .nav-link:hover {
    color: var(--ui-indigo);
}

body.landing-page .navbar .nav-link:hover::after {
    transform: scaleX(1);
}

.landing-hero {
    isolation: isolate;
    min-height: max(680px, 100vh) !important;
    background:
        radial-gradient(circle at 8% 18%, rgba(99, 102, 241, .17), transparent 24%),
        radial-gradient(circle at 88% 72%, rgba(6, 182, 212, .15), transparent 23%),
        linear-gradient(135deg, #f8fafc 0%, #eef2ff 52%, #e0f2fe 100%) !important;
}

.landing-hero::before,
.landing-hero::after {
    position: absolute;
    border-radius: 50%;
    content: "";
    pointer-events: none;
    filter: blur(2px);
}

.landing-hero::before {
    top: 12%;
    right: -5rem;
    width: 17rem;
    height: 17rem;
    background: rgba(129, 140, 248, .16);
    animation: ui-shimmer 10s ease-in-out infinite;
}

.landing-hero::after {
    bottom: -7rem;
    left: 35%;
    width: 20rem;
    height: 20rem;
    border: 1px solid rgba(99, 102, 241, .12);
    box-shadow: 0 0 0 2rem rgba(99, 102, 241, .04), 0 0 0 4rem rgba(99, 102, 241, .025);
}

.landing-hero h1 {
    max-width: 700px;
    color: #0f172a;
    font-size: clamp(2.5rem, 5vw, 4.7rem) !important;
    letter-spacing: -.065em;
    line-height: 1.02;
}

.landing-hero .lead {
    max-width: 610px;
    color: #475569;
    line-height: 1.75;
}

.landing-hero .hero-btn {
    min-height: 54px;
    box-shadow: 0 .8rem 1.5rem rgba(37, 99, 235, .15);
}

.landing-hero .hero-btn.btn-primary {
    background: linear-gradient(135deg, #4f46e5, #2563eb);
    border-color: transparent;
}

.landing-hero img {
    filter: drop-shadow(0 2rem 3rem rgba(30, 64, 175, .2)) !important;
}

#features,
#about,
#contact {
    scroll-margin-top: 5rem;
}

#features .feature-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(248, 250, 252, .86));
    box-shadow: 0 .8rem 2rem rgba(15, 23, 42, .045);
}

#features .feature-card::after {
    position: absolute;
    right: -3rem;
    bottom: -4rem;
    width: 9rem;
    height: 9rem;
    border-radius: 50%;
    background: rgba(99, 102, 241, .08);
    content: "";
    transition: transform .35s ease;
}

#features .feature-card:hover::after {
    transform: scale(1.35);
}

#features .feature-icon {
    background: linear-gradient(135deg, rgba(99, 102, 241, .14), rgba(6, 182, 212, .14));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}

@media (max-width: 991.98px) {
    .landing-hero {
        min-height: auto !important;
        padding-top: 8rem !important;
    }

    .landing-hero h1 {
        font-size: clamp(2.35rem, 8vw, 4rem) !important;
    }

    body.landing-page .navbar-collapse {
        margin-top: .75rem;
        padding: .75rem;
        border: 1px solid rgba(148, 163, 184, .18);
        border-radius: 1rem;
        background: rgba(255, 255, 255, .94);
        box-shadow: 0 .8rem 2rem rgba(15, 23, 42, .08);
    }
}

@media (max-width: 575.98px) {
    .landing-hero {
        padding-top: 7.5rem !important;
        padding-bottom: 4rem !important;
    }

    .landing-hero h1 {
        font-size: 2.55rem !important;
    }

    .landing-hero .d-flex.gap-3 {
        gap: .7rem !important;
    }

    .landing-hero .hero-btn {
        padding-inline: 1rem !important;
    }

    #features .container,
    #about .container,
    #contact .container {
        padding-top: 3.5rem !important;
        padding-bottom: 3.5rem !important;
    }

    #features .feature-card {
        padding: 1.5rem !important;
    }
}

/* Feature cards: clear, responsive value propositions */
#features {
    background:
        linear-gradient(180deg, #fff 0%, #f8fafc 100%) !important;
}

#features .container > .text-center h2 {
    color: #172033;
    letter-spacing: -.045em;
}

#features .container > .text-center h6 {
    color: #ef3938 !important;
    letter-spacing: .16em;
}

#features .row.g-4 {
    align-items: stretch;
}

#features .row.g-4 > [class*="col-"] {
    display: flex;
}

#features .feature-card {
    isolation: isolate;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 265px;
    padding: 2rem 1.8rem !important;
    border: 1px solid rgba(148, 163, 184, .2);
    border-top: 4px solid #ef3938;
    border-radius: 1rem;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 .8rem 1.8rem rgba(15, 23, 42, .06);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

#features .row.g-4 > [class*="col-"]:nth-child(2) .feature-card {
    border-top-color: #ffc42b;
}

#features .row.g-4 > [class*="col-"]:nth-child(3) .feature-card {
    border-top-color: #3b82f6;
}

#features .feature-card::before {
    position: absolute;
    top: 0;
    right: 0;
    width: 7rem;
    height: 7rem;
    border-radius: 0 0 0 100%;
    background: rgba(239, 57, 56, .06);
    content: "";
    pointer-events: none;
    z-index: -1;
}

#features .row.g-4 > [class*="col-"]:nth-child(2) .feature-card::before {
    background: rgba(255, 196, 43, .1);
}

#features .row.g-4 > [class*="col-"]:nth-child(3) .feature-card::before {
    background: rgba(59, 130, 246, .08);
}

#features .feature-card:hover {
    border-color: rgba(99, 102, 241, .3);
    box-shadow: 0 1.2rem 2.4rem rgba(37, 99, 235, .12);
    transform: translateY(-8px);
}

#features .feature-icon {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 3.7rem;
    height: 3.7rem;
    flex: 0 0 3.7rem;
    margin-bottom: 1.35rem;
    border-radius: 1rem;
    color: #ef3938;
    background: #fff0ef;
    box-shadow: 0 .5rem 1rem rgba(239, 57, 56, .12);
    font-size: 1.5rem;
}

#features .row.g-4 > [class*="col-"]:nth-child(2) .feature-icon {
    color: #c98900;
    background: #fff8dd;
    box-shadow: 0 .5rem 1rem rgba(255, 196, 43, .16);
}

#features .row.g-4 > [class*="col-"]:nth-child(3) .feature-icon {
    color: #2563eb;
    background: #eaf2ff;
    box-shadow: 0 .5rem 1rem rgba(59, 130, 246, .14);
}

#features .feature-card h4 {
    position: relative;
    z-index: 1;
    margin-bottom: .7rem !important;
    color: #172033;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.2rem;
    letter-spacing: -.015em;
}

#features .feature-card p {
    position: relative;
    z-index: 1;
    margin-bottom: 0;
    color: #64748b !important;
    font-size: .9rem;
    line-height: 1.7;
}

@media (max-width: 767.98px) {
    #features .container {
        padding-inline: 1rem;
    }

    #features .row.g-4 {
        gap: .9rem !important;
    }

    #features .row.g-4 > [class*="col-"] {
        display: block;
    }

    #features .feature-card {
        min-height: 0;
        padding: 1.4rem !important;
        border-radius: .9rem;
    }

    #features .feature-icon {
        width: 3.25rem;
        height: 3.25rem;
        flex-basis: 3.25rem;
        margin-bottom: 1rem;
    }

    #features .feature-card h4 {
        font-size: 1.1rem;
    }

    #features .feature-card p {
        font-size: .86rem;
    }
}

/* Dashboard-specific theme systems. */
body.app-page.theme-classic .admin-dashboard .dashboard-hero {
    min-height: 150px !important;
    padding: 1.5rem 1.75rem !important;
    border-radius: 4px !important;
    border-top: 5px solid #e5a93d !important;
    background: #24324a !important;
    box-shadow: 0 10px 20px rgba(23, 32, 51, .14) !important;
}

body.app-page.theme-classic .admin-dashboard .dashboard-hero h2 {
    font-size: clamp(1.5rem, 2.6vw, 2.35rem);
    letter-spacing: -.035em;
}

body.app-page.theme-classic .admin-dashboard .admin-priority-card {
    display: flex;
    align-items: center;
    gap: .8rem;
    min-height: 94px;
    padding: 1rem;
    border: 1px solid #d7dee8;
    border-left: 4px solid #e5a93d;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 5px 12px rgba(23, 32, 51, .045);
}

body.app-page.theme-classic .admin-dashboard .admin-priority-card:hover {
    transform: translateY(-2px);
    border-left-color: #2563eb;
    box-shadow: 0 9px 18px rgba(23, 32, 51, .1);
}

body.app-page.theme-classic .admin-dashboard .admin-priority-icon {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 4px !important;
}

body.app-page.theme-classic .admin-dashboard .stat-card {
    border: 1px solid #d7dee8 !important;
    border-left: 4px solid #2563eb !important;
    border-radius: 4px !important;
    box-shadow: 0 5px 14px rgba(23, 32, 51, .05) !important;
}

body.app-page.theme-classic .admin-dashboard .stat-card .value {
    color: #172033;
    font-size: 2rem;
}

body.app-page.theme-classic .admin-dashboard .quick-action-card {
    min-height: 142px;
    border-radius: 4px !important;
    border: 1px solid #d7dee8 !important;
    border-bottom: 4px solid #2563eb !important;
    background: #fff !important;
    box-shadow: 0 5px 14px rgba(23, 32, 51, .05);
}

body.app-page.theme-classic .admin-dashboard .quick-action-card:hover {
    transform: translateY(-3px);
    background: #f8fafc !important;
    color: #172033 !important;
}

body.app-page.theme-classic .admin-dashboard .card-header {
    border-radius: 4px 4px 0 0 !important;
}

body.app-page.theme-classic .admin-dashboard .table-premium thead th {
    background: #24324a;
    color: #fff;
}

body.app-page.theme-aurora .admin-dashboard .dashboard-hero {
    min-height: 220px !important;
    padding: clamp(1.7rem, 4vw, 3.2rem) !important;
    border-radius: 28px !important;
    border: 1px solid rgba(255,255,255,.25) !important;
    background:
        radial-gradient(circle at 82% 8%, rgba(45,212,191,.52), transparent 14rem),
        radial-gradient(circle at 8% 100%, rgba(244,114,182,.36), transparent 16rem),
        linear-gradient(120deg, #241044 0%, #8b3d8f 48%, #0f8f91 100%) !important;
    box-shadow: 0 28px 50px rgba(104, 45, 133, .25) !important;
}

body.app-page.theme-aurora .admin-dashboard .dashboard-hero h2 {
    font-size: clamp(1.8rem, 3.8vw, 3.2rem);
    letter-spacing: -.06em;
}

body.app-page.theme-aurora .admin-dashboard .admin-priority-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 116px;
    padding: 1.15rem;
    border: 1px solid rgba(168, 85, 247, .16);
    border-radius: 20px;
    background: rgba(255,255,255,.7);
    box-shadow: 0 16px 30px rgba(76, 29, 149, .09);
    backdrop-filter: blur(16px);
}

body.app-page.theme-aurora .admin-dashboard .admin-priority-card:hover {
    transform: translateY(-5px) rotate(.25deg);
    border-color: rgba(45, 212, 191, .45);
    box-shadow: 0 24px 42px rgba(76, 29, 149, .16);
}

body.app-page.theme-aurora .admin-dashboard .admin-priority-icon {
    flex: 0 0 50px;
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    border-radius: 16px !important;
    background: linear-gradient(135deg, rgba(244,114,182,.2), rgba(45,212,191,.2)) !important;
    color: #7c3aed !important;
}

body.app-page.theme-aurora .admin-dashboard .stat-card {
    min-height: 150px;
    border: 1px solid rgba(168, 85, 247, .16) !important;
    border-left: 0 !important;
    border-radius: 22px !important;
    background: linear-gradient(135deg, rgba(255,255,255,.82), rgba(246,240,255,.62)) !important;
    box-shadow: 0 18px 34px rgba(76, 29, 149, .1) !important;
}

body.app-page.theme-aurora .admin-dashboard .stat-card .value {
    color: #4c1d95;
    font-size: 2.25rem;
}

body.app-page.theme-aurora .admin-dashboard .quick-action-card {
    min-height: 166px;
    border-radius: 22px !important;
    border: 1px solid rgba(168, 85, 247, .16) !important;
    background: rgba(255,255,255,.62) !important;
    box-shadow: 0 18px 35px rgba(76, 29, 149, .1);
    backdrop-filter: blur(14px);
}

body.app-page.theme-aurora .admin-dashboard .quick-action-card:hover {
    transform: translateY(-6px) scale(1.015);
    background: linear-gradient(135deg, rgba(244,114,182,.16), rgba(45,212,191,.14)) !important;
    color: #35145f !important;
}

body.app-page.theme-aurora .admin-dashboard .quick-action-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(244,114,182,.22), rgba(45,212,191,.2));
    color: #7c3aed;
}

body.app-page.theme-aurora .admin-dashboard .card-header {
    border-radius: 22px 22px 0 0 !important;
}

body.app-page.theme-aurora .admin-dashboard .table-premium thead th {
    background: linear-gradient(135deg, #5b247a, #1b8b8f);
    color: #fff;
}

body.app-page.theme-aurora .admin-dashboard .table-premium tbody tr:hover {
    background: rgba(244, 114, 182, .08);
}

@media (max-width: 767.98px) {
    body.app-page.theme-aurora .admin-dashboard .dashboard-hero {
        min-height: 180px !important;
        border-radius: 22px !important;
    }

    body.app-page.theme-classic .admin-dashboard .dashboard-hero {
        min-height: 132px !important;
    }

    body.app-page.theme-aurora .admin-dashboard .admin-priority-card,
    body.app-page.theme-classic .admin-dashboard .admin-priority-card {
        min-height: 88px;
    }
}

/* Extra ambient motion and tactile hover effects */
@keyframes reference-orbit {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(-1deg); }
    50% { transform: translate3d(0, -8px, 0) rotate(1deg); }
}

@keyframes reference-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 57, 56, .16); }
    50% { box-shadow: 0 0 0 .65rem rgba(239, 57, 56, 0); }
}

@keyframes reference-sheen {
    0% { transform: translateX(-130%) skewX(-18deg); }
    55%, 100% { transform: translateX(160%) skewX(-18deg); }
}

.reference-hero-visual::before,
.reference-hero-visual::after {
    position: absolute;
    border-radius: 50%;
    content: "";
    pointer-events: none;
}

.reference-hero-visual::before {
    width: 12rem;
    height: 12rem;
    margin: 0 0 12rem -18rem;
    background: rgba(255, 196, 43, .13);
    filter: blur(1px);
    animation: reference-orbit 7s ease-in-out infinite;
}

.reference-hero-visual::after {
    width: 5rem;
    height: 5rem;
    margin: 0 0 4rem 20rem;
    border: 1px solid rgba(255, 255, 255, .23);
    animation: reference-orbit 5s ease-in-out .5s infinite reverse;
}

.reference-hero-image {
    animation: reference-orbit 6s ease-in-out infinite;
}

.reference-kicker {
    animation: reference-glow 3s ease-in-out infinite;
}

.reference-action {
    position: relative;
    overflow: hidden;
}

.reference-action::after {
    position: absolute;
    top: -40%;
    left: 0;
    width: 2.8rem;
    height: 180%;
    background: rgba(255, 255, 255, .24);
    content: "";
    pointer-events: none;
    transform: translateX(-130%) skewX(-18deg);
}

.reference-action:hover::after {
    animation: reference-sheen .8s ease forwards;
}

#features .feature-card {
    --feature-glow: rgba(239, 57, 56, .16);
}

#features .row.g-4 > [class*="col-"]:nth-child(2) .feature-card {
    --feature-glow: rgba(255, 196, 43, .2);
}

#features .row.g-4 > [class*="col-"]:nth-child(3) .feature-card {
    --feature-glow: rgba(59, 130, 246, .17);
}

#features .feature-card::after {
    right: -4rem;
    bottom: -5rem;
    width: 11rem;
    height: 11rem;
    background: var(--feature-glow);
    filter: blur(2px);
    transition: transform .45s ease, opacity .45s ease;
}

#features .feature-card:hover::after {
    opacity: .72;
    transform: scale(1.25) translate(-.35rem, -.35rem);
}

#features .feature-card .feature-icon {
    transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s ease;
}

#features .feature-card:hover .feature-icon {
    box-shadow: 0 .8rem 1.25rem var(--feature-glow);
    transform: translateY(-5px) rotate(-4deg) scale(1.06);
}

#features .feature-card h4 {
    transition: color .25s ease, transform .25s ease;
}

#features .feature-card:hover h4 {
    color: #4f46e5;
    transform: translateX(3px);
}

#features .row.g-4 > [class*="col-"]:nth-child(1) .feature-card {
    animation-delay: .08s;
}

#features .row.g-4 > [class*="col-"]:nth-child(2) .feature-card {
    animation-delay: .18s;
}

#features .row.g-4 > [class*="col-"]:nth-child(3) .feature-card {
    animation-delay: .28s;
}

@media (hover: hover) {
    .reference-learn-more {
        position: relative;
        overflow: hidden;
    }

    .reference-learn-more::after {
        position: absolute;
        inset: 0 auto 0 -35%;
        width: 28%;
        background: rgba(255, 255, 255, .24);
        content: "";
        transform: skewX(-18deg);
        transition: left .55s ease;
    }

    .reference-learn-more:hover::after {
        left: 120%;
    }
}

@media (max-width: 767.98px) {
    .reference-hero-visual::before,
    .reference-hero-visual::after {
        display: none;
    }

    .reference-hero-image {
        animation-duration: 8s;
    }
}

@media (prefers-reduced-motion: reduce) {
    .reference-hero-image,
    .reference-kicker,
    .reference-hero-visual::before,
    .reference-hero-visual::after {
        animation: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* Reference-inspired public school homepage */
.landing-page .navbar {
    min-height: 74px;
    box-shadow: 0 1px 0 rgba(15, 23, 42, .08) !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.landing-page .navbar > .container {
    max-width: 1180px;
}

.landing-page .navbar-brand {
    color: #161616 !important;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.05rem;
}

.landing-page .navbar-brand i,
.landing-page .navbar-brand #navbar-logo-fallback {
    display: inline-grid;
    place-items: center;
    width: 2.2rem;
    height: 2.45rem;
    margin-right: .65rem !important;
    color: #fff;
    background: #ed3937;
    clip-path: polygon(50% 0, 92% 14%, 92% 72%, 50% 100%, 8% 72%, 8% 14%);
    font-size: .95rem;
}

.landing-page .navbar-brand img {
    max-width: 2.2rem;
    max-height: 2.45rem !important;
    object-fit: contain;
}

.landing-page .navbar .nav-link {
    padding: 1.7rem .9rem !important;
    color: #101010;
    font-family: Arial, sans-serif;
    font-size: .72rem;
    font-weight: 700 !important;
}

.landing-page .navbar .nav-link::after {
    bottom: 1.1rem;
    background: #ed3937;
}

.landing-page .navbar .btn {
    border: 0;
    border-radius: 0 !important;
    background: #ffc42b;
    color: #fff;
    font-size: .72rem;
    min-height: 38px;
    padding-inline: 1.2rem !important;
}

.reference-hero {
    min-height: 520px !important;
    padding: 74px 0 0 !important;
    background:
        linear-gradient(90deg, rgba(112, 137, 151, .93), rgba(126, 148, 159, .88)),
        #8097a4 !important;
}

.reference-hero::before {
    top: -10rem;
    right: -7rem;
    width: 28rem;
    height: 28rem;
    background: rgba(255, 255, 255, .06);
    filter: blur(0);
}

.reference-hero::after {
    display: none;
}

.reference-hero-main {
    min-height: 380px;
}

.reference-hero-visual {
    align-self: stretch;
    display: flex;
    align-items: end;
    justify-content: center;
}

.reference-hero-image {
    width: min(100%, 570px);
    max-height: 405px !important;
    object-fit: contain;
    object-position: center bottom;
    filter: none !important;
    mix-blend-mode: multiply;
    transform: translateY(1.5rem);
}

.reference-hero-copy {
    padding: 2rem 2rem 4rem 1.5rem;
    color: #fff;
}

.reference-kicker {
    display: block;
    margin-bottom: .9rem;
    color: #ffc42b;
    font-family: Arial, sans-serif;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.reference-hero-copy h1 {
    max-width: 600px;
    margin: 0 0 .75rem;
    color: #fff !important;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.6rem, 5vw, 4rem) !important;
    font-weight: 700;
    letter-spacing: -.035em;
    line-height: 1.05;
}

.reference-hero-copy h1 .text-gradient {
    color: #fff;
    background: none;
    -webkit-text-fill-color: initial;
}

.reference-hero-copy .lead {
    max-width: 430px;
    margin-bottom: 1.5rem;
    color: rgba(255, 255, 255, .9);
    font-family: Georgia, "Times New Roman", serif;
    font-size: .82rem;
    line-height: 1.45;
}

.reference-hero-content {
    color: rgba(255, 255, 255, .9);
}

.reference-learn-more {
    min-width: 94px;
    min-height: 40px;
    border: 0;
    padding: .65rem 1.1rem;
    color: #fff;
    background: #ef3f3b;
    font-family: Georgia, "Times New Roman", serif;
    font-size: .72rem;
    font-weight: 700;
    transition: background .2s ease, transform .2s ease;
}

.reference-learn-more i {
    margin-left: .45rem;
    font-size: .6rem;
}

.reference-learn-more:hover {
    background: #d92e2a;
    transform: translateY(-2px);
}

.reference-hero-actions {
    position: relative;
    z-index: 3;
    margin-top: -1.7rem;
}

.reference-action {
    display: flex;
    align-items: center;
    min-height: 54px;
    padding: .7rem 1.1rem;
    text-decoration: none;
    font-family: Georgia, "Times New Roman", serif;
    font-size: .78rem;
    font-weight: 700;
    transition: filter .2s ease, transform .2s ease;
}

.reference-action:hover {
    color: inherit;
    filter: brightness(.96);
    transform: translateY(-2px);
}

.reference-action span {
    margin-right: auto;
}

.reference-action i {
    margin-right: .9rem;
    font-size: 1.2rem;
}

.reference-action b {
    font-size: 1.25rem;
    line-height: 1;
}

.reference-action-red {
    color: #fff;
    background: #ef3938;
}

.reference-action-yellow {
    color: #fff;
    background: #ffc42b;
}

.reference-action-white {
    color: #111;
    background: #fff;
}

@media (max-width: 991.98px) {
    .landing-page .navbar .nav-link {
        padding: .75rem !important;
    }

    .landing-page .navbar .nav-link::after {
        bottom: .35rem;
    }

    .reference-hero {
        padding-top: 74px !important;
    }

    .reference-hero-main {
        min-height: 0;
    }

    .reference-hero-visual {
        order: 2;
        min-height: 260px;
    }

    .reference-hero-copy {
        order: 1;
        padding: 3rem 1rem 2rem;
    }

    .reference-hero-copy h1,
    .reference-hero-copy .lead {
        margin-inline: auto;
    }

    .reference-hero-actions {
        margin-top: 0;
    }
}

@media (max-width: 575.98px) {
    .landing-page .navbar-brand {
        max-width: calc(100vw - 5rem);
        font-size: .9rem;
    }

    .reference-hero {
        padding-bottom: 0 !important;
    }

    .reference-hero-copy {
        padding-top: 2.3rem;
    }

    .reference-hero-copy h1 {
        font-size: 2.5rem !important;
    }

    .reference-hero-image {
        max-height: 280px !important;
        transform: translateY(.75rem);
    }

    .reference-action {
        min-height: 52px;
        padding-inline: .85rem;
    }
}

/* Shared admin workspace polish */
.admin-sidebar {
    border-right: 1px solid rgba(148, 163, 184, 0.14);
    background:
        radial-gradient(circle at 10% 0%, rgba(99, 102, 241, 0.18), transparent 28%),
        linear-gradient(180deg, #111827 0%, #0f172a 100%);
}

.admin-sidebar .sidebar-header {
    min-height: 78px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-sidebar .nav-link,
.admin-sidebar .sidebar-group-toggle {
    min-height: 42px;
    margin: 0.15rem 0.75rem;
    border-radius: 0.75rem;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .sidebar-group-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(2px);
}

.admin-sidebar .nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.95), rgba(124, 58, 237, 0.88));
    box-shadow: 0 0.5rem 1rem rgba(30, 41, 59, 0.25);
}

.admin-top-navbar {
    min-height: 70px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 0.5rem 1.5rem rgba(15, 23, 42, 0.04);
    backdrop-filter: blur(14px);
}

.admin-top-navbar .input-group {
    min-height: 42px;
    border-color: rgba(148, 163, 184, 0.2) !important;
    background: rgba(248, 250, 252, 0.9) !important;
}

/* Admin dashboard workspace */
.admin-dashboard .content-body {
    max-width: 1680px;
    margin: 0 auto;
}

.admin-dashboard .dashboard-hero {
    position: relative;
    overflow: hidden;
    min-height: 190px;
    padding: clamp(1.35rem, 3vw, 2.25rem) !important;
    border-radius: 1.35rem;
}

.admin-dashboard .dashboard-hero::after {
    position: absolute;
    right: -4rem;
    bottom: -7rem;
    width: 18rem;
    height: 18rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 50%;
    box-shadow: 0 0 0 2rem rgba(255, 255, 255, 0.05), 0 0 0 4rem rgba(255, 255, 255, 0.035);
    content: "";
    pointer-events: none;
}

.admin-dashboard .dashboard-hero > .d-flex {
    position: relative;
    z-index: 1;
}

.admin-dashboard .stat-card {
    min-height: 150px;
    border-radius: 1.1rem !important;
}

.admin-dashboard .stat-card .value {
    overflow-wrap: anywhere;
    line-height: 1.1;
}

.admin-dashboard .stat-card .smallest {
    line-height: 1.3;
}

.admin-dashboard .card:not(.card-modern) {
    overflow: hidden;
}

.admin-dashboard .card-header {
    min-height: 60px;
    display: flex;
    align-items: center;
}

.admin-dashboard .quick-action-card {
    min-height: 118px;
    border-radius: 1rem;
}

.admin-dashboard .quick-action-card:hover {
    transform: translateY(-4px);
}

.admin-dashboard .quick-action-card .fw-bold {
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.admin-dashboard .table-premium th {
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    .admin-dashboard .dashboard-hero {
        min-height: 0;
    }

    .admin-dashboard .stat-card {
        min-height: auto;
        padding: 1.1rem !important;
    }

    .admin-dashboard .quick-action-card {
        min-height: 108px;
        padding: 0.85rem;
    }

    .admin-dashboard .quick-action-card .fw-bold {
        font-size: 0.8rem;
    }

    .admin-dashboard .quick-action-icon {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }
}

.admin-tabs {
    position: relative;
    z-index: 2;
    border-color: rgba(148, 163, 184, 0.2) !important;
    background: rgba(255, 255, 255, 0.88) !important;
    box-shadow: 0 0.6rem 1.5rem rgba(15, 23, 42, 0.06) !important;
    scrollbar-width: thin;
}

.admin-tabs .nav-link {
    min-height: 42px;
    padding: 0.65rem 0.9rem;
    color: #64748b;
    font-weight: 700;
    white-space: nowrap;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.admin-tabs .nav-link:hover {
    color: #3730a3;
    background: #eef2ff;
    transform: translateY(-1px);
}

.admin-tabs .nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, #4361ee, #7c3aed);
}

.main-content > .p-4,
.main-content > .content-body {
    min-width: 0;
}

.main-content .card:not(.card-modern) {
    border-color: rgba(148, 163, 184, 0.16);
    border-radius: 1rem;
}

.main-content .table-responsive {
    border-radius: 0.9rem;
    scrollbar-color: #c7d2fe transparent;
}

.main-content .form-control,
.main-content .form-select {
    min-height: 44px;
    border-color: #dbe3ef;
    border-radius: 0.7rem;
}

.main-content .form-control:focus,
.main-content .form-select:focus {
    border-color: #818cf8;
}

@media (max-width: 768px) {
    .admin-top-navbar {
        min-height: 60px;
    }

    .admin-tabs {
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 0.9rem !important;
    }

    .admin-tabs .nav-item {
        flex: 0 0 auto;
    }

    .admin-tabs .nav-link {
        font-size: 0.78rem;
    }

    .main-content > .p-4 {
        padding: 1rem !important;
    }
}

.student-welcome-hero,
.parent-welcome-hero {
    position: relative;
    overflow: hidden;
    border-radius: 1.25rem !important;
}

.student-welcome-hero::after,
.parent-welcome-hero::after {
    position: absolute;
    right: 4%;
    bottom: -4rem;
    width: 12rem;
    height: 12rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 50%;
    box-shadow: 0 0 0 2rem rgba(255, 255, 255, 0.04), 0 0 0 4rem rgba(255, 255, 255, 0.03);
    content: "";
    pointer-events: none;
}

.student-welcome-hero > *,
.parent-welcome-hero > * {
    position: relative;
    z-index: 1;
}

.student-dashboard-stats .stat-card,
.parent-dashboard-stats .stat-card {
    height: 100%;
    min-height: 9.5rem;
    border-radius: 1.15rem;
}

.student-dashboard-stats .stat-card .value,
.parent-dashboard-stats .stat-card .value {
    max-width: 100%;
    overflow-wrap: anywhere;
}

.student-dashboard .quick-action-card {
    min-height: 8.25rem;
    border: 1px solid #e8edf5;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.78);
}

.student-dashboard .quick-action-card:hover {
    border-color: rgba(67, 97, 238, 0.3);
    background: #fff;
    box-shadow: 0 0.8rem 1.5rem rgba(15, 23, 42, 0.08);
}

.parent-wallet-card {
    min-height: 15rem;
    border-radius: 1.25rem !important;
}

.parent-child-card {
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 1.2rem;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 0.6rem 1.5rem rgba(15, 23, 42, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.parent-child-card:hover {
    border-color: rgba(67, 97, 238, 0.24);
    box-shadow: 0 1rem 2rem rgba(15, 23, 42, 0.1);
    transform: translateY(-3px);
}

.parent-child-card .child-card-header {
    padding: 1.15rem;
    background: linear-gradient(135deg, #f8fafc, #eef2ff);
}

.parent-child-card .btn {
    min-height: 42px;
    border-radius: 0.75rem;
}

@media (max-width: 768px) {
    .student-welcome-hero,
    .parent-welcome-hero {
        padding: 1.25rem !important;
    }

    .student-welcome-hero h2,
    .parent-welcome-hero h2 {
        font-size: 1.45rem !important;
    }

    .student-dashboard-stats,
    .parent-dashboard-stats {
        --bs-gutter-x: 0.75rem;
        --bs-gutter-y: 0.75rem;
    }

    .student-dashboard-stats .stat-card,
    .parent-dashboard-stats .stat-card {
        min-height: 8.75rem;
        padding: 1rem !important;
    }

    .student-dashboard .quick-action-card {
        min-height: 7rem;
        padding: 0.85rem !important;
    }

    .parent-wallet-card {
        min-height: auto;
    }
}

@media (max-width: 420px) {
    .student-dashboard-stats .value,
    .parent-dashboard-stats .value {
        font-size: 1.15rem !important;
    }

    .student-dashboard .quick-action-card {
        font-size: 0.78rem;
    }
}

.parent-welcome-hero,
.student-dashboard .dashboard-hero {
    border-radius: 1.35rem;
}

/* Deep responsive pass: keep dense workspaces usable on tablets and phones. */
.main-content {
    min-width: 0;
}

.top-navbar .container-fluid {
    gap: .75rem;
}

.top-navbar .input-group {
    min-width: 0;
}

.top-navbar .input-group input {
    min-width: 0;
    text-overflow: ellipsis;
}

.content-body .row {
    max-width: 100%;
}

.content-body .chart-container,
.content-body canvas {
    max-width: 100%;
}

.main-content .table-responsive {
    position: relative;
    border: 1px solid rgba(148, 163, 184, .14);
    background: rgba(255, 255, 255, .52);
}

.main-content .table-responsive::after {
    position: absolute;
    right: .5rem;
    bottom: .5rem;
    padding: .25rem .5rem;
    border-radius: 999px;
    color: #64748b;
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 .2rem .6rem rgba(15, 23, 42, .08);
    content: "Swipe to view";
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: .04em;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}

.main-content .table-responsive:hover::after {
    opacity: 1;
}

.main-content .table > :not(caption) > * > * {
    padding: .85rem .9rem;
    vertical-align: middle;
}

.main-content .table thead th {
    color: #475569;
    background: rgba(241, 245, 249, .75);
    font-size: .72rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.main-content .table tbody tr {
    transition: background .18s ease;
}

.main-content .table tbody tr:hover {
    background: rgba(238, 242, 255, .55);
}

.main-content .btn-group {
    flex-wrap: wrap;
    gap: .35rem;
}

.main-content .btn-group > .btn {
    border-radius: .7rem !important;
}

.main-content .form-label {
    color: #475569;
    font-size: .78rem;
}

.main-content textarea.form-control {
    min-height: 7rem;
    resize: vertical;
}

.main-content .alert {
    border-radius: .9rem;
}

.main-content .modal-header {
    background: linear-gradient(135deg, rgba(248, 250, 252, .98), rgba(238, 242, 255, .88));
}

.sidebar {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, .35) transparent;
}

.sidebar .nav-link,
.sidebar .sidebar-group-toggle {
    min-height: 44px;
}

@media (max-width: 991.98px) {
    .top-navbar .container-fluid {
        gap: .35rem;
    }

    .top-navbar .ms-auto {
        margin-left: auto !important;
    }

    .content-body .row {
        --bs-gutter-x: .85rem;
    }

    .main-content .table-responsive::after {
        opacity: .75;
    }
}

@media (max-width: 767.98px) {
    .top-navbar .container-fluid {
        min-width: 0;
    }

    .top-navbar .dropdown {
        position: static;
    }

    .top-navbar .dropdown-menu {
        max-width: calc(100vw - 1rem) !important;
    }

    .content-body .row > [class*="col-"] {
        min-width: 0;
    }

    .main-content .table-responsive {
        margin-inline: -.15rem;
        border-radius: .8rem;
    }

    .main-content .table > :not(caption) > * > * {
        padding: .7rem .65rem;
        font-size: .82rem;
    }

    .main-content .table thead th {
        font-size: .66rem;
    }

    .main-content .input-group {
        flex-wrap: nowrap;
    }

    .main-content .input-group > .btn {
        flex: 0 0 auto;
        width: auto;
    }

    .main-content .card-header {
        gap: .7rem;
        flex-wrap: wrap;
    }

    .main-content .card-header > :first-child {
        min-width: 0;
    }

    .main-content .card-header .card-title,
    .main-content .card-header h1,
    .main-content .card-header h2,
    .main-content .card-header h3,
    .main-content .card-header h4,
    .main-content .card-header h5,
    .main-content .card-header h6 {
        overflow-wrap: anywhere;
    }

    .landing-page .navbar-brand {
        max-width: calc(100vw - 5rem);
        overflow: hidden;
        font-size: .9rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .landing-page .navbar-brand img {
        flex: 0 0 auto;
        max-width: 2rem;
        object-fit: contain;
    }

    .landing-hero .row {
        --bs-gutter-y: 1.75rem;
    }

    .landing-hero .hero-btn {
        min-width: 0;
        flex: 1 1 0;
    }

    .landing-hero img {
        max-height: 280px !important;
        object-fit: contain;
    }
}

@media (max-width: 420px) {
    .top-navbar .dropdown-toggle .rounded-circle {
        width: 32px !important;
        height: 32px !important;
    }

    .top-navbar .gap-3 {
        gap: .4rem !important;
    }

    .landing-hero .d-flex.gap-3 {
        align-items: stretch;
    }

    .landing-hero .hero-btn {
        font-size: .86rem;
    }
}

/* Dashboard visual hierarchy */
.admin-dashboard .content-body {
    padding-top: clamp(1rem, 2vw, 1.75rem);
}

.admin-dashboard .dashboard-hero h2 {
    max-width: 44rem;
    font-size: clamp(1.7rem, 3vw, 2.5rem);
    letter-spacing: -.045em;
}

.admin-dashboard .dashboard-hero p {
    max-width: 42rem;
    color: rgba(226, 232, 240, .82) !important;
}

.admin-dashboard .stat-card {
    isolation: isolate;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.35rem !important;
    border: 1px solid rgba(148, 163, 184, .2) !important;
    border-top: 0 !important;
    border-left-width: 0 !important;
}

.admin-dashboard .stat-card::before {
    height: 4px;
    opacity: 1;
    background: linear-gradient(90deg, var(--accent-color), var(--ui-violet));
}

.admin-dashboard .stat-card:nth-child(2)::before {
    background: linear-gradient(90deg, #10b981, #06b6d4);
}

.admin-dashboard .stat-card:nth-child(3)::before {
    background: linear-gradient(90deg, #f59e0b, #f97316);
}

.admin-dashboard .stat-card:nth-child(4)::before {
    background: linear-gradient(90deg, #06b6d4, #3b82f6);
}

.admin-dashboard .stat-card .value {
    margin-top: .2rem !important;
    font-size: clamp(1.65rem, 2.5vw, 2.15rem);
    letter-spacing: -.04em;
}

.admin-dashboard .stat-card .icon-box {
    width: 3.25rem;
    height: 3.25rem;
    display: grid;
    place-items: center;
    border-radius: 1rem !important;
    box-shadow: 0 .65rem 1.25rem rgba(37, 99, 235, .12);
}

.admin-dashboard .stat-card a {
    color: #4f46e5 !important;
    font-weight: 700;
}

.admin-dashboard .row > .col-lg-12 > .card,
.admin-dashboard .row > .col-lg-8 > .card,
.admin-dashboard .row > .col-lg-4 > .card,
.admin-dashboard .row > .col-12 > .card {
    border: 1px solid rgba(148, 163, 184, .18) !important;
    border-radius: 1.2rem !important;
    background: rgba(255, 255, 255, .78);
    box-shadow: 0 1rem 2.5rem rgba(15, 23, 42, .06) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.admin-dashboard .card-header {
    padding: 1.1rem 1.25rem !important;
    border-bottom-color: rgba(148, 163, 184, .14) !important;
    background: linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(248, 250, 252, .78)) !important;
}

.admin-dashboard .card-header h5 {
    color: #1e293b;
    font-size: .98rem;
    letter-spacing: -.01em;
}

.admin-dashboard .card-header h5 i {
    color: #6366f1;
}

.admin-dashboard .card-body {
    padding: 1.25rem;
}

.admin-dashboard .row > .col-lg-12 > .card .card-body .border.rounded-3 {
    position: relative;
    overflow: hidden;
    border-color: rgba(148, 163, 184, .18) !important;
    background: linear-gradient(145deg, rgba(248, 250, 252, .9), rgba(238, 242, 255, .5)) !important;
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.admin-dashboard .row > .col-lg-12 > .card .card-body .border.rounded-3::after {
    position: absolute;
    right: -2.5rem;
    bottom: -3.5rem;
    width: 8rem;
    height: 8rem;
    border-radius: 50%;
    background: rgba(99, 102, 241, .08);
    content: "";
    pointer-events: none;
}

.admin-dashboard .row > .col-lg-12 > .card .card-body .border.rounded-3:hover {
    border-color: rgba(99, 102, 241, .3) !important;
    box-shadow: 0 .8rem 1.5rem rgba(67, 56, 202, .1);
    transform: translateY(-3px);
}

.admin-dashboard .quick-action-card {
    min-height: 7.25rem;
    padding: 1rem !important;
    border: 1px solid rgba(148, 163, 184, .18);
    background: linear-gradient(145deg, rgba(255, 255, 255, .95), rgba(248, 250, 252, .82));
    box-shadow: 0 .45rem 1rem rgba(15, 23, 42, .04);
}

.admin-dashboard .quick-action-card .quick-action-icon {
    width: 2.75rem;
    height: 2.75rem;
    margin-bottom: .7rem;
    border-radius: .85rem;
    display: grid;
    place-items: center;
    box-shadow: 0 .4rem .85rem rgba(67, 97, 238, .1);
}

.admin-dashboard .quick-action-card:hover {
    border-color: rgba(99, 102, 241, .35);
    background: #fff;
    box-shadow: 0 .9rem 1.5rem rgba(67, 56, 202, .12);
}

.admin-dashboard .table-premium {
    margin-bottom: 0;
}

.admin-dashboard .table-premium tbody td {
    border-color: rgba(226, 232, 240, .7);
}

@media (max-width: 767.98px) {
    .admin-dashboard .dashboard-hero h2 {
        font-size: 1.65rem;
    }

    .admin-dashboard .dashboard-hero .btn {
        width: 100%;
    }

    .admin-dashboard .stat-card {
        padding: 1.1rem !important;
    }

    .admin-dashboard .stat-card .icon-box {
        width: 2.8rem;
        height: 2.8rem;
    }

    .admin-dashboard .card-body {
        padding: 1rem;
    }

    .admin-dashboard .quick-action-card {
        min-height: 6.5rem;
        padding: .8rem !important;
    }
}

/* Shared admin workspace: applies to every page using the admin shell. */
body.admin-app {
    background:
        radial-gradient(circle at 0 0, rgba(99, 102, 241, .09), transparent 24rem),
        radial-gradient(circle at 100% 18%, rgba(6, 182, 212, .07), transparent 22rem),
        #f4f7fb;
}

body.admin-app .main-content {
    min-height: 100vh;
}

body.admin-app .content-body {
    width: min(100%, 1680px);
    margin-inline: auto;
    padding: clamp(1rem, 2vw, 1.75rem) !important;
}

body.admin-app .page-header {
    position: relative;
    isolation: isolate;
    margin-bottom: 1.35rem;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 1.25rem !important;
    background:
        radial-gradient(circle at 92% 0, rgba(129, 140, 248, .45), transparent 25%),
        linear-gradient(125deg, #111827 0%, #1e3a8a 58%, #4f46e5 100%);
    box-shadow: 0 1.25rem 2.75rem rgba(30, 64, 175, .16);
}

body.admin-app .page-header::before {
    position: absolute;
    right: 8%;
    bottom: -7rem;
    width: 15rem;
    height: 15rem;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 50%;
    box-shadow: 0 0 0 1.5rem rgba(255, 255, 255, .04), 0 0 0 3rem rgba(255, 255, 255, .025);
    content: "";
    pointer-events: none;
}

body.admin-app .page-header > * {
    position: relative;
    z-index: 1;
}

/* Project-wide theme compositions. Classic keeps the clean institutional layout;
   Aurora adds a layered, luminous workspace without changing page markup. */
body.theme-classic {
    --theme-page-radius: .85rem;
    --theme-card-radius: .85rem;
    background: #f3f6fb;
}

body.theme-classic .sidebar {
    background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
    border-right: 1px solid rgba(148, 163, 184, .18);
    box-shadow: 14px 0 30px rgba(15, 23, 42, .08);
}

body.theme-classic .sidebar .nav-link,
body.theme-classic .sidebar .sidebar-group-toggle {
    border-radius: .7rem;
    margin: .2rem .55rem;
    color: rgba(226, 232, 240, .88);
}

body.theme-classic .sidebar .nav-link:hover,
body.theme-classic .sidebar .sidebar-group-toggle:hover,
body.theme-classic .sidebar .nav-link.active {
    color: white;
    background: linear-gradient(135deg, rgba(59, 130, 246, .22), rgba(37, 99, 235, .18));
    box-shadow: inset 3px 0 0 #7dd3fc;
}

body.theme-classic .card,
body.theme-classic .dashboard-surface,
body.theme-classic .card-modern,
body.theme-classic .modal-content,
body.theme-classic .form-card {
    border-radius: var(--theme-card-radius) !important;
    border: 1px solid rgba(148, 163, 184, .18);
    box-shadow: 0 8px 18px rgba(15, 23, 42, .05) !important;
    background: rgba(255, 255, 255, .96);
}

body.theme-classic .btn {
    border-radius: .65rem;
    box-shadow: none;
}

body.theme-classic .page-header,
body.theme-classic .header-premium {
    border-radius: 1rem !important;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid rgba(148, 163, 184, .18);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
    color: #0f172a;
}

body.theme-classic .page-header * {
    color: inherit;
}

body.theme-classic .top-navbar,
body.theme-classic .navbar {
    background: rgba(255, 255, 255, .9) !important;
    border-bottom: 1px solid rgba(148, 163, 184, .18);
    box-shadow: 0 8px 20px rgba(15, 23, 42, .03);
}

body.theme-classic.landing-page {
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
}

body.theme-classic.landing-page .navbar {
    background: rgba(255,255,255,.94) !important;
    border-bottom: 1px solid rgba(148,163,184,.18);
    box-shadow: 0 10px 30px rgba(15,23,42,.06) !important;
}

body.theme-classic.landing-page .navbar .nav-link,
body.theme-classic.landing-page .navbar .btn {
    color: #0f172a;
}

body.theme-classic.landing-page .landing-hero {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    box-shadow: inset 0 -1px 0 rgba(148,163,184,.16);
}

body.theme-classic.landing-page .reference-hero-copy h1 {
    color: #0f172a;
    text-shadow: none;
}

body.theme-classic.landing-page .feature-card,
body.theme-classic.landing-page .about-card,
body.theme-classic.landing-page .contact-card {
    background: rgba(255,255,255,.96);
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 1.2rem;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .07);
}

body.theme-classic .main-content .table thead th {
    background: rgba(15, 23, 42, .04);
    color: #0f172a;
}

body.theme-aurora {
    --theme-page-radius: 1.5rem;
    --theme-card-radius: 1.35rem;
    background:
        radial-gradient(circle at 15% 0%, rgba(168, 85, 247, .16), transparent 24rem),
        radial-gradient(circle at 100% 18%, rgba(34, 211, 238, .18), transparent 22rem),
        linear-gradient(180deg, #f5f3ff 0%, #eef8ff 100%);
}

body.theme-aurora .sidebar {
    background:
        radial-gradient(circle at 85% 8%, rgba(96, 165, 250, .32), transparent 18rem),
        radial-gradient(circle at 0% 40%, rgba(168, 85, 247, .25), transparent 18rem),
        linear-gradient(180deg, #0b1020 0%, #1d1137 45%, #0f172a 100%);
    border-right: 1px solid rgba(196, 181, 253, .22);
    box-shadow: 18px 0 40px rgba(75, 29, 149, .18);
}

body.theme-aurora .sidebar .nav-link,
body.theme-aurora .sidebar .sidebar-group-toggle {
    border-radius: 1rem;
    margin: .2rem .55rem;
    color: rgba(224, 231, 255, .9);
    border: 1px solid transparent;
}

body.theme-aurora .sidebar .nav-link:hover,
body.theme-aurora .sidebar .sidebar-group-toggle:hover,
body.theme-aurora .sidebar .nav-link.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, .82), rgba(34, 211, 238, .62));
    color: #fff;
    border-color: rgba(255,255,255,.14);
    box-shadow: 0 12px 22px rgba(76, 29, 149, .25);
    transform: translateX(5px);
}

body.theme-aurora .navbar,
body.theme-aurora .top-navbar,
body.theme-aurora .card,
body.theme-aurora .dashboard-surface,
body.theme-aurora .card-modern,
body.theme-aurora .form-card,
body.theme-aurora .modal-content {
    border-radius: var(--theme-card-radius) !important;
    border: 1px solid rgba(168, 85, 247, .18);
    box-shadow: 0 18px 32px rgba(76, 29, 149, .12), inset 0 1px 0 rgba(255,255,255,.45) !important;
    background: rgba(255,255,255,.74);
    backdrop-filter: blur(14px);
}

body.theme-aurora .btn {
    border-radius: 999px;
    background: linear-gradient(135deg, #7c3aed 0%, #22d3ee 100%);
    border: none;
    color: #fff;
    box-shadow: 0 12px 24px rgba(124, 58, 237, .25);
}

body.theme-aurora .btn:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

body.theme-aurora .form-control,
body.theme-aurora .form-select {
    border-radius: 1rem;
    border-color: rgba(168, 85, 247, .22);
    background: rgba(255,255,255,.85);
}

body.theme-aurora .page-header,
body.theme-aurora .header-premium {
    border-radius: var(--theme-page-radius) !important;
    background:
        radial-gradient(circle at 90% 0%, rgba(34, 211, 238, .4), transparent 22%),
        linear-gradient(135deg, #1b133a 0%, #4f46e5 42%, #0ea5e9 100%);
    border: 1px solid rgba(255,255,255,.12);
    box-shadow: 0 22px 40px rgba(79, 70, 229, .22);
    color: #fff;
}

body.theme-aurora .main-content .table thead th {
    background: linear-gradient(135deg, rgba(168, 85, 247, .12), rgba(34, 211, 238, .12));
    color: #4c1d95;
}

body.theme-aurora.landing-page {
    background:
        radial-gradient(circle at 10% 0%, rgba(168, 85, 247, .18), transparent 26rem),
        radial-gradient(circle at 100% 12%, rgba(34, 211, 238, .18), transparent 24rem),
        linear-gradient(180deg, #f5f3ff 0%, #edf7ff 100%);
}

body.theme-aurora.landing-page .navbar {
    background: rgba(255,255,255,.72) !important;
    border-bottom: 1px solid rgba(168, 85, 247, .12);
    backdrop-filter: blur(18px);
    box-shadow: 0 16px 36px rgba(76,29,149,.09) !important;
}

body.theme-aurora.landing-page .navbar-brand,
body.theme-aurora.landing-page .navbar .nav-link,
body.theme-aurora.landing-page .navbar .btn {
    color: #1f1638 !important;
}

body.theme-aurora.landing-page .landing-hero {
    background:
        radial-gradient(circle at 12% 10%, rgba(168, 85, 247, .26), transparent 26rem),
        radial-gradient(circle at 92% 8%, rgba(34, 211, 238, .18), transparent 20rem),
        linear-gradient(135deg, #f5f3ff 0%, #e0f2fe 100%);
}

body.theme-aurora.landing-page .reference-hero-copy h1 {
    background: linear-gradient(135deg, #1f1638 0%, #7c3aed 45%, #0ea5e9 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: none;
}

body.theme-aurora.landing-page .reference-hero-copy .reference-kicker,
body.theme-aurora.landing-page .reference-hero-copy p,
body.theme-aurora.landing-page .reference-hero-copy .lead {
    color: #43385f;
}

body.theme-aurora.landing-page .feature-card,
body.theme-aurora.landing-page .about-card,
body.theme-aurora.landing-page .contact-card {
    border: 1px solid rgba(168, 85, 247, .16);
    border-radius: 1.6rem;
    box-shadow: 0 20px 40px rgba(76, 29, 149, .12);
    background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(248,250,252,.82));
}

body.theme-aurora.landing-page .feature-icon {
    background: linear-gradient(135deg, rgba(124,58,237,.12), rgba(34,211,238,.12));
    color: #7c3aed;
}

body.theme-aurora.landing-page .hero-btn,
body.theme-aurora.landing-page .btn-primary {
    background: linear-gradient(135deg, #7c3aed, #06b6d4);
    border: none;
    box-shadow: 0 14px 26px rgba(124, 58, 237, .28);
}

@media (prefers-reduced-motion: no-preference) {
    body.theme-aurora .card,
    body.theme-aurora .feature-card,
    body.theme-aurora .quick-action-card {
        transition: transform .25s ease, box-shadow .25s ease;
    }

    @media (max-width: 767.98px) {
        body.theme-classic .main-content,
        body.theme-aurora .main-content {
            padding-bottom: 1rem;
        }

        body.theme-classic .page-header,
        body.theme-classic .header-premium {
            border-radius: .9rem !important;
            margin-inline: -.15rem;
            padding: 1.15rem !important;
        }

        body.theme-classic .main-content .card,
        body.theme-classic .main-content .dashboard-surface {
            box-shadow: 0 3px 12px rgba(15, 23, 42, .07) !important;
        }

        body.theme-classic .main-content .table-responsive {
            border-radius: .7rem;
        }

        body.theme-aurora .page-header,
        body.theme-aurora .header-premium {
            margin-inline: -.35rem;
            padding: 1.35rem !important;
            border-radius: 1.35rem !important;
            background:
                radial-gradient(circle at 100% 0, rgba(34, 211, 238, .5), transparent 45%),
                linear-gradient(150deg, #17113b, #4c1d95 60%, #0891b2);
        }

        body.theme-aurora .main-content .card,
        body.theme-aurora .main-content .dashboard-surface {
            background: rgba(255, 255, 255, .78);
            backdrop-filter: blur(14px);
        }

        body.theme-aurora .main-content .row.g-4,
        body.theme-aurora .main-content .row.g-3 {
            --bs-gutter-y: 1rem;
        }

        body.theme-aurora .main-content .table-responsive {
            border: 1px solid rgba(139, 92, 246, .14);
            border-radius: 1rem;
            box-shadow: 0 .75rem 1.75rem rgba(76, 29, 149, .08);
        }

        body.theme-aurora .main-content .btn-group {
            border-radius: 999px;
            overflow: hidden;
        }

        body.theme-aurora.landing-page .landing-hero {
            min-height: auto;
            padding-top: 7rem;
            padding-bottom: 3rem;
            text-align: center;
        }

        body.theme-aurora.landing-page .landing-hero .hero-content,
        body.theme-aurora.landing-page .landing-hero .container > .row {
            align-items: center;
        }

        body.theme-aurora.landing-page .landing-hero img {
            filter: drop-shadow(0 1.25rem 1.5rem rgba(76, 29, 149, .2));
        }

        body.theme-aurora.landing-page .feature-card,
        body.theme-aurora.landing-page .about-card,
        body.theme-aurora.landing-page .contact-card {
            border-radius: 1.25rem;
            padding: 1.15rem !important;
        }
    }

    @media (min-width: 768px) {
        body.theme-classic .main-content > .content-body {
            max-width: 1440px;
        }

        body.theme-aurora .main-content > .content-body {
            max-width: 1680px;
        }

        body.theme-aurora .main-content .row > [class*="col-"] {
            transition: transform .25s ease;
        }
    }

    body.theme-aurora .card:hover,
    body.theme-aurora .feature-card:hover,
    body.theme-aurora .quick-action-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 1.5rem 3rem rgba(76, 29, 149, .17) !important;
    }
}

body.admin-app .page-header h2,
body.admin-app .page-header h1 {
    max-width: 48rem;
    letter-spacing: -.04em;
}

body.admin-app .page-header .btn {
    min-height: 44px;
    border: 0;
    box-shadow: 0 .55rem 1rem rgba(15, 23, 42, .16);
}

body.admin-app .main-content > .p-4 > .card,
body.admin-app .content-body > .card,
body.admin-app .content-body .card {
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 1rem;
    box-shadow: 0 .8rem 2rem rgba(15, 23, 42, .055);
}

body.admin-app .content-body .card-header {
    min-height: 3.75rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    border-bottom-color: rgba(148, 163, 184, .14);
    background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(248, 250, 252, .8));
}

body.admin-app .content-body .card-header h1,
body.admin-app .content-body .card-header h2,
body.admin-app .content-body .card-header h3,
body.admin-app .content-body .card-header h4,
body.admin-app .content-body .card-header h5,
body.admin-app .content-body .card-header h6 {
    margin-bottom: 0;
    color: #1e293b;
    font-size: .95rem;
    letter-spacing: -.01em;
}

body.admin-app .content-body .card-body {
    min-width: 0;
}

body.admin-app .content-body .form-control,
body.admin-app .content-body .form-select,
body.admin-app .content-body .input-group {
    min-height: 44px;
    border-color: #dbe3ef;
    border-radius: .72rem;
    background: rgba(255, 255, 255, .9);
}

body.admin-app .content-body .form-control:focus,
body.admin-app .content-body .form-select:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 .22rem rgba(99, 102, 241, .13);
}

body.admin-app .content-body .btn {
    min-height: 42px;
    border-radius: .72rem;
}

body.admin-app .content-body .table-responsive {
    border: 1px solid rgba(148, 163, 184, .15);
    border-radius: .9rem;
    background: rgba(255, 255, 255, .62);
}

body.admin-app .content-body table thead th {
    color: #475569;
    background: #f8fafc;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .055em;
    text-transform: uppercase;
    white-space: nowrap;
}

body.admin-app .content-body table tbody tr {
    transition: background-color .18s ease;
}

body.admin-app .content-body table tbody tr:hover {
    background: #f5f7ff;
}

body.admin-app .content-body .pagination .page-link {
    min-width: 40px;
    min-height: 40px;
    display: inline-grid;
    place-items: center;
    border-radius: .65rem !important;
}

body.admin-app .content-body .modal-content {
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 1.2rem;
}

body.admin-app .content-body .modal-header {
    background: linear-gradient(135deg, #f8fafc, #eef2ff);
}

body.admin-app .content-body .alert {
    border: 1px solid rgba(148, 163, 184, .15);
    border-radius: .9rem;
    box-shadow: 0 .5rem 1.25rem rgba(15, 23, 42, .04);
}

body.admin-app .sidebar {
    background:
        radial-gradient(circle at 10% 0, rgba(99, 102, 241, .2), transparent 17rem),
        linear-gradient(180deg, #111827, #0b1020);
}

body.admin-app .sidebar .nav-link.active,
body.admin-app .sidebar .sidebar-group-toggle:hover,
body.admin-app .sidebar .nav-link:hover {
    box-shadow: inset 3px 0 0 #818cf8;
}

/* Theme-specific sidebar compositions (placed after the shared shell rules). */
body.theme-classic .sidebar {
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    border-right: 1px solid rgba(148, 163, 184, .18);
}

body.theme-classic .sidebar .nav-link,
body.theme-classic .sidebar .sidebar-group-toggle {
    border-radius: .65rem;
}

body.theme-classic .sidebar .nav-link.active,
body.theme-classic .sidebar .sidebar-group-toggle:hover,
body.theme-classic .sidebar .nav-link:hover {
    background: #334155;
    box-shadow: inset 3px 0 0 #60a5fa;
}

body.theme-aurora .sidebar {
    background:
        radial-gradient(circle at 82% 4%, rgba(34, 211, 238, .4), transparent 15rem),
        radial-gradient(circle at 0 45%, rgba(139, 92, 246, .35), transparent 18rem),
        linear-gradient(165deg, #0b1020 0%, #25104d 52%, #0b3c5d 100%);
    border-right: 1px solid rgba(196, 181, 253, .2);
    box-shadow: .9rem 0 2.5rem rgba(30, 27, 75, .22);
}

body.theme-aurora .sidebar .sidebar-header {
    border-bottom-color: rgba(196, 181, 253, .18);
}

body.theme-aurora .sidebar .nav-link,
body.theme-aurora .sidebar .sidebar-group-toggle {
    margin: .12rem .45rem;
    border: 1px solid transparent;
    border-radius: .9rem;
}

body.theme-aurora .sidebar .nav-link.active,
body.theme-aurora .sidebar .sidebar-group-toggle:hover,
body.theme-aurora .sidebar .nav-link:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, .78), rgba(6, 182, 212, .48));
    border-color: rgba(255, 255, 255, .16);
    box-shadow: 0 .5rem 1.25rem rgba(76, 29, 149, .3);
    color: #fff;
    transform: translateX(4px);
}

body.theme-aurora .sidebar-section-header {
    color: #a5b4fc;
    letter-spacing: .12em;
}

@media (max-width: 991.98px) {
    body.theme-aurora .sidebar {
        box-shadow: .75rem 0 2rem rgba(30, 27, 75, .3);
    }
}

/* Final theme identities.
   These compositions deliberately change the shell geometry so the modes feel
   like separate products rather than alternate color palettes. */
body.app-page.theme-classic {
    --sidebar-width: 228px;
    --classic-ink: #172033;
    --classic-line: #d7dee8;
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    background: #edf1f5;
}

body.app-page.theme-classic .sidebar {
    width: var(--sidebar-width);
    background: #172033;
    border-right: 0;
    box-shadow: 7px 0 0 #d6dee8;
}

body.app-page.theme-classic .sidebar-header {
    height: 76px;
    padding-inline: 18px;
    background: #101827;
    border-bottom: 4px solid #e5a93d;
}

body.app-page.theme-classic .sidebar-header .brand-text {
    color: #f8fafc;
    text-transform: uppercase;
    letter-spacing: .16em;
    font-size: .82rem;
}

body.app-page.theme-classic .sidebar-section-header {
    color: #94a3b8;
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .2em;
    text-transform: uppercase;
    padding-inline: 18px;
}

body.app-page.theme-classic .sidebar .nav-link,
body.app-page.theme-classic .sidebar .sidebar-group-toggle {
    margin: 0;
    padding: .72rem 1rem;
    border-radius: 0;
    border-left: 3px solid transparent;
    color: #b9c4d4;
    font-size: .86rem;
}

body.app-page.theme-classic .sidebar .nav-link:hover,
body.app-page.theme-classic .sidebar .sidebar-group-toggle:hover,
body.app-page.theme-classic .sidebar .nav-link.active {
    transform: none;
    color: #fff;
    background: #24324a;
    border-left-color: #e5a93d;
    box-shadow: none;
}

body.app-page.theme-classic .main-content {
    margin-left: var(--sidebar-width);
}

body.app-page.theme-classic .top-navbar {
    min-height: 60px;
    padding-inline: 1rem;
    background: #fff !important;
    border-bottom: 1px solid var(--classic-line);
    box-shadow: 0 1px 0 rgba(23, 32, 51, .04);
}

body.app-page.theme-classic .content-body {
    padding: 1.25rem !important;
}

body.app-page.theme-classic .page-header,
body.app-page.theme-classic .header-premium {
    min-height: 128px;
    padding: 1.35rem 1.5rem !important;
    border-radius: 4px !important;
    border: 1px solid var(--classic-line);
    border-top: 5px solid #e5a93d;
    background: #fff;
    box-shadow: 0 8px 18px rgba(23, 32, 51, .06);
}

body.app-page.theme-classic .page-header h1,
body.app-page.theme-classic .page-header h2,
body.app-page.theme-classic .page-header h3 {
    color: var(--classic-ink);
    letter-spacing: -.025em;
}

body.app-page.theme-classic .card,
body.app-page.theme-classic .dashboard-surface,
body.app-page.theme-classic .card-modern,
body.app-page.theme-classic .form-card {
    border: 1px solid var(--classic-line);
    border-radius: 4px !important;
    box-shadow: 0 5px 14px rgba(23, 32, 51, .045) !important;
    background: #fff;
}

body.app-page.theme-classic .card-header {
    min-height: 3.25rem;
    background: #f7f9fb;
    border-bottom: 1px solid var(--classic-line);
}

body.app-page.theme-classic .btn {
    border-radius: 4px;
    box-shadow: 0 2px 0 rgba(23, 32, 51, .12);
}

body.app-page.theme-classic .form-control,
body.app-page.theme-classic .form-select {
    border-radius: 4px;
    background: #fff;
}

body.app-page.theme-classic .stats-card,
body.app-page.theme-classic .quick-action-card {
    border-left: 4px solid #e5a93d !important;
}

body.app-page.theme-aurora {
    --sidebar-width: 292px;
    font-family: "DM Sans", Inter, system-ui, sans-serif;
    background:
        radial-gradient(circle at 8% 0, rgba(244, 114, 182, .2), transparent 22rem),
        radial-gradient(circle at 100% 18%, rgba(45, 212, 191, .18), transparent 26rem),
        #f8f7ff;
}

body.app-page.theme-aurora .sidebar {
    width: calc(var(--sidebar-width) - 24px);
    top: 14px;
    left: 14px;
    height: calc(100vh - 28px);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 26px;
    background:
        linear-gradient(145deg, rgba(33, 20, 67, .98), rgba(11, 54, 73, .98));
    box-shadow: 0 24px 55px rgba(48, 25, 90, .25);
}

body.app-page.theme-aurora .sidebar-header {
    height: 92px;
    margin: 10px;
    padding-inline: 16px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(244,114,182,.2), rgba(45,212,191,.14));
    border: 1px solid rgba(255,255,255,.12);
}

body.app-page.theme-aurora .sidebar-header .brand-text {
    color: #fff;
    font-size: 1rem;
    letter-spacing: .08em;
}

body.app-page.theme-aurora .sidebar-section-header {
    padding-inline: 22px;
    color: #f9a8d4;
    font-size: .65rem;
    letter-spacing: .22em;
    text-transform: uppercase;
}

body.app-page.theme-aurora .sidebar .nav-link,
body.app-page.theme-aurora .sidebar .sidebar-group-toggle {
    margin: .22rem .7rem;
    padding: .78rem .9rem;
    border: 1px solid transparent;
    border-radius: 14px;
    color: #d8d7f5;
    font-size: .88rem;
}

body.app-page.theme-aurora .sidebar .nav-link:hover,
body.app-page.theme-aurora .sidebar .sidebar-group-toggle:hover,
body.app-page.theme-aurora .sidebar .nav-link.active {
    transform: translateX(5px);
    color: #fff;
    background: linear-gradient(135deg, rgba(244,114,182,.72), rgba(45,212,191,.58));
    border-color: rgba(255,255,255,.2);
    box-shadow: 0 12px 22px rgba(18, 13, 44, .25);
}

body.app-page.theme-aurora .main-content {
    margin-left: var(--sidebar-width);
}

body.app-page.theme-aurora .top-navbar {
    min-height: 78px;
    margin: 14px 18px 0;
    padding-inline: 1.35rem;
    border: 1px solid rgba(168, 85, 247, .14);
    border-radius: 20px;
    background: rgba(255,255,255,.62) !important;
    box-shadow: 0 16px 32px rgba(76, 29, 149, .08);
}

body.app-page.theme-aurora .content-body {
    padding: clamp(1.25rem, 3vw, 2.5rem) !important;
}

body.app-page.theme-aurora .page-header,
body.app-page.theme-aurora .header-premium {
    min-height: 190px;
    padding: clamp(1.6rem, 4vw, 3rem) !important;
    border-radius: 28px !important;
    border: 1px solid rgba(255,255,255,.25);
    background:
        radial-gradient(circle at 85% 15%, rgba(45,212,191,.45), transparent 15rem),
        linear-gradient(120deg, #241044 0%, #8b3d8f 48%, #0f8f91 100%);
    box-shadow: 0 25px 48px rgba(104, 45, 133, .22);
}

body.app-page.theme-aurora .card,
body.app-page.theme-aurora .dashboard-surface,
body.app-page.theme-aurora .card-modern,
body.app-page.theme-aurora .form-card {
    border: 1px solid rgba(168, 85, 247, .15);
    border-radius: 22px !important;
    box-shadow: 0 18px 35px rgba(76, 29, 149, .1) !important;
    background: rgba(255,255,255,.68);
    backdrop-filter: blur(18px);
}

body.app-page.theme-aurora .card-header {
    min-height: 4rem;
    padding-inline: 1.35rem;
    border-bottom: 1px solid rgba(168, 85, 247, .12);
    border-radius: 22px 22px 0 0;
    background: linear-gradient(135deg, rgba(244,114,182,.1), rgba(45,212,191,.08));
}

body.app-page.theme-aurora .btn {
    border-radius: 999px;
    padding-inline: 1.15rem;
    box-shadow: 0 10px 22px rgba(124, 58, 237, .2);
}

body.app-page.theme-aurora .form-control,
body.app-page.theme-aurora .form-select {
    border-radius: 14px;
    background: rgba(255,255,255,.78);
}

body.app-page.theme-aurora .stats-card,
body.app-page.theme-aurora .quick-action-card {
    border: 1px solid rgba(244,114,182,.18) !important;
    border-radius: 24px !important;
}

@media (max-width: 991.98px) {
    body.app-page.theme-classic .main-content,
    body.app-page.theme-aurora .main-content {
        margin-left: 0;
    }

    body.app-page.theme-classic .sidebar {
        width: 228px;
        top: 0;
        left: 0;
        height: 100vh;
        border-radius: 0;
        box-shadow: 8px 0 24px rgba(15, 23, 42, .22);
    }

    body.app-page.theme-aurora .sidebar {
        width: 292px;
        top: 0;
        left: 0;
        height: 100vh;
        border-radius: 0 24px 24px 0;
    }

    body.app-page.theme-aurora .top-navbar {
        margin: 8px;
        min-height: 66px;
        border-radius: 16px;
    }

    body.app-page.theme-aurora .content-body {
        padding: 1rem !important;
    }
}

body.app-page.theme-classic {
    background: #f1f5f9;
}

body.app-page.theme-aurora {
    background:
        radial-gradient(circle at 0 0, rgba(139, 92, 246, .14), transparent 26rem),
        radial-gradient(circle at 100% 18%, rgba(6, 182, 212, .1), transparent 24rem),
        #f5f3ff;
}

body.app-page.theme-aurora .main-content {
    background: transparent;
}

/* Bootstrap rows use negative gutters. Keep those gutters inside the app
   shell so they cannot create a page-wide horizontal scroll bar. */
body.app-page {
    overflow-x: hidden;
}

body.app-page .main-content {
    min-width: 0;
    max-width: 100%;
    overflow-x: clip;
}

body.app-page.theme-aurora .navbar,
body.app-page.theme-aurora .top-navbar {
    background: rgba(255, 255, 255, .74) !important;
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(139, 92, 246, .12);
}

body.app-page.theme-aurora .table,
body.app-page.theme-aurora .list-group,
body.app-page.theme-aurora .dropdown-menu,
body.app-page.theme-aurora .pagination .page-link {
    border-color: rgba(139, 92, 246, .14);
}

body.app-page.theme-aurora .table tbody tr {
    transition: background-color .2s ease, transform .2s ease;
}

body.app-page.theme-aurora .table tbody tr:hover {
    background: rgba(139, 92, 246, .06);
    transform: translateX(2px);
}

body.app-page.theme-aurora .alert,
body.app-page.theme-aurora .toast,
body.app-page.theme-aurora .pagination .page-link {
    border-radius: .9rem;
}

/* Distinct page systems: these rules intentionally change geometry, not only
   palette, so switching themes is immediately visible on every internal page. */
body.app-page.theme-classic {
    --sidebar-width: 260px;
    font-family: Inter, system-ui, sans-serif;
}

body.app-page.theme-classic .sidebar {
    width: var(--sidebar-width);
}

body.app-page.theme-classic .main-content {
    margin-left: var(--sidebar-width);
}

body.app-page.theme-classic .top-navbar {
    min-height: 64px;
    box-shadow: 0 1px 0 rgba(15, 23, 42, .08);
}

body.app-page.theme-classic .content-body {
    padding: 1.25rem !important;
}

body.app-page.theme-classic .card-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

body.app-page.theme-aurora {
    --sidebar-width: 312px;
    font-family: Inter, system-ui, sans-serif;
}

body.app-page.theme-aurora .sidebar {
    width: var(--sidebar-width);
}

body.app-page.theme-aurora .main-content {
    margin-left: var(--sidebar-width);
}

body.app-page.theme-aurora .top-navbar {
    min-height: 82px;
    padding-inline: 1.4rem;
    border: 0;
    box-shadow: 0 .75rem 2rem rgba(76, 29, 149, .09);
}

body.app-page.theme-aurora .content-body {
    padding: clamp(1.25rem, 3vw, 2.5rem) !important;
}

body.app-page.theme-aurora .page-header {
    min-height: 170px;
    padding: clamp(1.5rem, 3vw, 2.5rem) !important;
    display: flex;
    align-items: center;
}

body.app-page.theme-aurora .card-header {
    background: linear-gradient(135deg, rgba(139, 92, 246, .08), rgba(6, 182, 212, .06));
    border-bottom: 1px solid rgba(139, 92, 246, .12);
}

body.app-page.theme-aurora .card-body {
    padding: clamp(1.15rem, 2vw, 1.75rem);
}

body.app-page.theme-aurora .nav-tabs .nav-link,
body.app-page.theme-aurora .nav-pills .nav-link {
    border-radius: 999px;
}

body.app-page.theme-aurora .pagination {
    gap: .35rem;
}

body.app-page.theme-aurora .pagination .page-item .page-link {
    border-radius: 999px !important;
}

@media (max-width: 991.98px) {
    body.app-page.theme-classic,
    body.app-page.theme-aurora {
        --sidebar-width: min(85vw, 312px);
    }

    body.app-page.theme-classic .main-content,
    body.app-page.theme-aurora .main-content {
        margin-left: 0;
    }

    body.app-page.theme-aurora .top-navbar {
        min-height: 68px;
        padding-inline: .85rem;
    }
}

@media (max-width: 991.98px) {
    body.admin-app .content-body {
        padding: 1rem .85rem 2rem !important;
    }

    body.admin-app .page-header {
        padding: 1.25rem !important;
    }

    body.admin-app .page-header .d-flex {
        align-items: stretch !important;
    }
}

@media (max-width: 767.98px) {
    body.admin-app .content-body {
        padding: .75rem .65rem 2rem !important;
    }

    body.admin-app .page-header {
        margin-bottom: 1rem;
        border-radius: 1rem !important;
    }

    body.admin-app .page-header h2,
    body.admin-app .page-header h1 {
        font-size: 1.45rem !important;
        line-height: 1.2;
    }

    body.admin-app .content-body .card-header {
        min-height: 3.35rem;
        padding: .8rem .9rem !important;
        flex-wrap: wrap;
    }

    body.admin-app .content-body .card-body {
        padding: .9rem !important;
    }

    body.admin-app .content-body .card-header > .btn,
    body.admin-app .content-body .card-header > .btn-group,
    body.admin-app .content-body .card-header > form {
        width: 100%;
    }

    body.admin-app .content-body .table-responsive {
        margin-inline: -.1rem;
        max-width: calc(100% + .2rem);
    }

    body.admin-app .content-body table:not(.table-modern-stack) {
        min-width: 620px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.admin-app *,
    body.admin-app *::before,
    body.admin-app *::after {
        animation: none !important;
        transition: none !important;
    }
}

.parent-welcome-hero {
    position: relative;
    overflow: hidden;
}

.parent-welcome-hero > .d-flex {
    position: relative;
    z-index: 2;
}

.parent-welcome-icon {
    place-items: center;
    width: 4.75rem;
    height: 4.75rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.12);
    font-size: 2rem;
}

.parent-dashboard .card-modern,
.student-dashboard .card-modern {
    border-radius: 1.1rem;
}

.parent-dashboard .stat-card,
.student-dashboard .stat-card {
    min-height: 154px;
}

.parent-dashboard .quick-action-card,
.student-dashboard .quick-action-card {
    min-height: 112px;
    border-radius: 1rem;
}

@media (max-width: 576px) {
    .parent-dashboard .content-body,
    .student-dashboard .content-body {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    .parent-dashboard .page-header,
    .student-dashboard .page-header {
        padding: 1.25rem !important;
    }

    .parent-dashboard .page-header h2,
    .student-dashboard .page-header h2 {
        font-size: 1.35rem !important;
    }

    .parent-dashboard .row.g-4,
    .student-dashboard .row.g-4 {
        --bs-gutter-y: 1rem;
    }

    .parent-dashboard .wallet-card {
        padding: 1.25rem !important;
    }
}

@media (max-width: 576px) {
    .teacher-classes-hero {
        align-items: flex-start;
        padding: 1.35rem;
    }

    .teacher-classes-hero-icon {
        width: 3.25rem;
        height: 3.25rem;
        flex-basis: 3.25rem;
        border-radius: 1rem;
        font-size: 1.35rem;
    }

    .teacher-classes-hero p {
        font-size: 0.85rem;
    }

    .teacher-class-card h2 {
        font-size: 1.2rem;
    }
}

.card-modern,
.stats-card,
.quick-action-card,
.form-control,
.form-select,
.table,
.btn,
.input-group-text {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card-modern:focus-within,
.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.12);
}

.btn-primary,
.btn-success,
.btn-danger,
.btn-warning,
.btn-outline-primary,
.btn-modern {
    background-image: linear-gradient(135deg, rgba(255,255,255,0.14), rgba(255,255,255,0.02));
    border-width: 1px;
}

.btn-primary:hover,
.btn-success:hover,
.btn-danger:hover,
.btn-warning:hover,
.btn-outline-primary:hover,
.btn-modern:hover {
    filter: brightness(1.03);
}

/* Stacking Stats Cards on Mobile */
@media (max-width: 576px) {
    .stats-card {
        padding: 1rem !important;
    }
    .stats-number {
        font-size: 1.75rem !important;
    }
}

@media (max-width: 991px) {
    body {
        background-attachment: scroll;
    }

    .main-content {
        margin-left: 0 !important;
        width: 100%;
    }

    .content-body {
        padding: 1rem !important;
    }

    .top-navbar {
        padding: 0 1rem !important;
    }

    .page-header {
        padding: 1.4rem 1rem !important;
        border-radius: 1rem !important;
    }

    .sidebar {
        transform: translateX(-105%);
    }

    .sidebar.active,
    .sidebar.show {
        transform: translateX(0);
    }
}

@media (max-width: 768px) {
    .page-header .d-flex {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem;
    }

    .page-header h2 {
        font-size: 1.5rem !important;
        line-height: 1.25;
    }

    .quick-action-card {
        padding: 1rem !important;
    }

    .btn,
    .btn-modern {
        min-height: 44px;
        padding-top: 0.7rem;
        padding-bottom: 0.7rem;
    }

    .table-modern-stack td {
        padding: 0.8rem 0.6rem !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Sidebar Custom Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 4px;
}
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}
.sidebar:hover::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
}

/* Table Modern Stack Improvements */
@media (max-width: 768px) {
    .table-modern-stack thead {
        display: none;
    }
    .table-modern-stack tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-lg);
        background: #fff;
        padding: 0.5rem;
        box-shadow: var(--shadow-sm);
    }
    .table-modern-stack td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        padding: 0.5rem !important;
        border: none !important;
    }
    .table-modern-stack td::before {
        content: attr(data-label);
        font-weight: 700;
        text-transform: uppercase;
        font-size: 0.75rem;
        color: var(--text-muted);
        text-align: left;
        margin-right: 1rem;
    }
    .table-modern-stack td:last-child {
        border-top: 1px solid var(--border-color) !important;
        margin-top: 0.5rem;
        padding-top: 0.75rem !important;
        justify-content: flex-end;
    }
}

/* Sidebar Overlay Fix */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 1030;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
}

/* Global responsive polish */
.content-body > .container-fluid,
.content-body > .container,
.main-content > .container-fluid {
    width: 100%;
    max-width: 1600px;
    margin-inline: auto;
}

.card,
.card-modern,
.stats-card,
.quick-action-card,
.form-control,
.form-select,
.input-group,
.btn,
.table {
    min-width: 0;
}

.card-header,
.card-footer {
    gap: 0.75rem;
    flex-wrap: wrap;
}

.table-responsive {
    max-width: 100%;
    overflow-x: auto !important;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.table-responsive > .table {
    min-width: 640px;
}

.table-responsive .dropdown-menu {
    max-width: min(18rem, calc(100vw - 2rem));
}

/* Premium global polish for all admin pages */
.page-header,
.card-modern,
.stats-card,
.quick-action-card,
.table-card,
.form-control,
.form-select,
.input-group,
.btn,
.btn-modern,
.modal-content {
    border-radius: 1rem;
}

.page-header {
    box-shadow: 0 18px 40px rgba(37, 99, 235, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.card-modern,
.stats-card,
.quick-action-card,
.table-card {
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(148, 163, 184, 0.18) !important;
}

.btn,
.btn-modern,
.btn-primary,
.btn-outline-primary,
.btn-success,
.btn-danger,
.btn-warning {
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.btn:hover,
.btn-modern:hover,
.btn-primary:hover,
.btn-outline-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(59, 130, 246, 0.18);
}

.form-control,
.form-select,
.input-group {
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255,255,255,0.9);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.02);
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.12);
}

label,
.form-label,
.card-header,
.card-title,
.table th,
.sidebar-section-header {
    letter-spacing: 0.01em;
    font-weight: 700;
}

.table-card .table,
.table-responsive > .table {
    border-collapse: separate;
    border-spacing: 0;
}

.btn-primary,
.btn-success,
.btn-danger,
.btn-warning,
.btn-outline-primary {
    min-height: 44px;
}

@media (max-width: 991.98px) {
    .content-body form.row > [class*="col-"] {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
    }

    .content-body .row > [class*="col-"] {
        width: 100%;
        max-width: 100%;
    }

    .page-header .btn-group,
    .page-header .d-flex.gap-2,
    .page-header .d-flex.justify-content-between,
    .page-header .d-flex.align-items-center {
        width: 100%;
        flex-wrap: wrap;
    }
}

@media (max-width: 767.98px) {
    .page-header {
        padding: 1.25rem 1rem !important;
    }

    .page-header .d-flex {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .page-header .btn,
    .page-header .btn-group,
    .page-header .dropdown,
    .page-header form,
    .page-header .d-flex > * {
        width: 100%;
    }

    .card-modern,
    .stats-card,
    .quick-action-card,
    .table-card {
        border-radius: 1rem !important;
    }

    .top-navbar .dropdown-menu {
        right: 0.25rem !important;
        left: auto !important;
        width: min(17rem, calc(100vw - 1rem)) !important;
    }
}

@media (max-width: 576px) {
    .content-body {
        padding: 0.75rem !important;
    }

    .page-header h2,
    .page-header h1,
    .page-header .display-6 {
        font-size: 1.5rem !important;
        line-height: 1.3;
    }

    .card-body,
    .card-header,
    .card-footer {
        padding-left: 0.9rem !important;
        padding-right: 0.9rem !important;
    }

    .btn,
    .btn-modern,
    .form-control,
    .form-select {
        min-height: 44px;
        border-radius: 0.8rem;
    }

    .table-responsive > .table {
        min-width: 520px;
    }
}

.form-control,
.form-select,
.input-group {
    max-width: 100%;
}

.modal-dialog {
    width: auto;
    max-width: calc(100% - 2rem);
}

.modal-content {
    overflow: hidden;
    border: 0;
    box-shadow: var(--shadow-2xl);
}

/* Compact, responsive student edit workflow. Keep the form usable without making
   the dialog dominate the viewport, especially on phones and small laptops. */
.student-edit-modal .modal-dialog {
    width: min(100% - 2rem, 900px);
    max-width: 900px;
    margin: 1rem auto;
}

.student-edit-modal .modal-content {
    max-height: calc(100vh - 2rem);
    border-radius: 1.25rem;
}

.student-edit-modal .modal-header {
    padding: .85rem 1.25rem;
    min-height: 58px;
}

.student-edit-modal .modal-header .modal-title {
    font-size: 1rem;
    letter-spacing: .01em;
}

.student-edit-modal .modal-body {
    padding: 1.15rem 1.25rem !important;
    overflow-y: auto;
    scrollbar-width: thin;
}

.student-edit-modal .modal-body h6 {
    margin-top: .35rem;
    margin-bottom: .65rem !important;
    font-size: .72rem;
    letter-spacing: .08em;
}

.student-edit-modal .modal-body .row {
    --bs-gutter-y: .75rem;
}

.student-edit-modal .modal-body .form-label {
    margin-bottom: .3rem;
    font-size: .7rem;
    letter-spacing: .04em;
}

.student-edit-modal .modal-body .form-control,
.student-edit-modal .modal-body .form-select {
    min-height: 40px;
    padding: .45rem .7rem;
    font-size: .9rem;
}

.student-edit-modal .modal-footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    padding: .75rem 1.25rem;
    border-top: 1px solid rgba(148, 163, 184, .2);
}

.student-edit-modal .modal-footer .btn {
    min-height: 40px;
}

.student-profile-modal .modal-dialog {
    width: min(100% - 2rem, 920px);
    max-width: 920px;
    margin: 1rem auto;
}

.student-profile-modal .modal-content {
    max-height: calc(100vh - 2rem);
    border-radius: 1.25rem;
}

.student-profile-modal .modal-body {
    padding: 1.15rem 1.25rem !important;
}

.student-profile-modal .nav-tabs {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: .35rem;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(10px);
    border-radius: .9rem;
}

.student-profile-modal .nav-tabs .nav-link {
    min-height: 38px;
    padding: .45rem .7rem !important;
    font-size: .72rem;
}

.page-header {
    overflow: hidden;
}

@media (max-width: 991.98px) {
    .top-navbar {
        position: sticky;
        top: 0;
        min-height: var(--header-height);
        padding-inline: 0.75rem !important;
        box-shadow: 0 1px 0 rgba(15, 23, 42, 0.08);
    }

    .top-navbar .container-fluid {
        min-height: var(--header-height);
    }

    .top-navbar .menu-toggle {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar {
        width: min(var(--sidebar-width), 88vw) !important;
        max-width: 340px;
        z-index: 1040;
    }

    .content-body {
        min-width: 0;
    }

    .page-header .btn-group,
    .page-header .d-flex.gap-2 {
        width: 100%;
        flex-wrap: wrap;
    }

    .page-header .btn-group > .btn,
    .page-header .d-flex.gap-2 > .btn {
        flex: 1 1 auto;
    }
}

@media (max-width: 767.98px) {
    body {
        padding-bottom: env(safe-area-inset-bottom);
        overflow-x: hidden;
    }

    .top-navbar {
        padding-left: 0 !important;
        padding-right: 0.5rem !important;
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden;
    }

    .top-navbar .container-fluid {
        justify-content: flex-start !important;
        gap: 0.5rem;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .top-navbar .menu-toggle {
        position: relative !important;
        left: 0 !important;
        top: 0 !important;
        margin: 0 !important;
        flex-shrink: 0;
        transform: none !important;
    }

    .sidebar-header .menu-toggle {
        position: absolute !important;
        right: 0.75rem !important;
        left: auto !important;
        top: 0.75rem !important;
        margin: 0 !important;
        transform: none !important;
    }

    .main-content {
        overflow-x: hidden !important;
        width: 100vw !important;
        max-width: 100% !important;
        padding-bottom: calc(6.5rem + env(safe-area-inset-bottom)) !important;
    }

    .content-body {
        padding: 0.875rem !important;
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .page-header {
        margin-bottom: 1rem !important;
        padding: 1.25rem !important;
        border-radius: var(--radius-lg) !important;
    }

    .page-header h1,
    .page-header h2,
    .page-header h3 {
        overflow-wrap: anywhere;
    }

    .row.g-3,
    .row.g-4 {
        --bs-gutter-y: 0.875rem;
    }

    .card-body {
        padding: 1rem !important;
    }

    .card-header,
    .card-footer {
        padding: 0.875rem 1rem !important;
    }

    .card-header > .btn,
    .card-header > .btn-group,
    .card-header > form {
        width: 100%;
    }

    .card-header > .btn,
    .card-header > .btn-group > .btn {
        min-height: 44px;
    }

    .table-responsive > .table {
        min-width: 600px;
    }

    .table-modern-stack {
        min-width: 0 !important;
    }

    .table-modern-stack td {
        overflow-wrap: anywhere;
    }

    .top-navbar .dropdown-menu {
        position: absolute !important;
        top: calc(100% + 0.5rem) !important;
        right: 0 !important;
        left: auto !important;
        width: min(20rem, calc(100vw - 1.5rem)) !important;
        max-height: calc(100vh - var(--header-height) - 1.5rem);
        overflow-y: auto;
    }

    .modal-dialog {
        max-width: calc(100% - 1rem);
        margin: 0.5rem auto;
    }

    .modal-body {
        max-height: calc(100vh - 12rem);
        overflow-y: auto;
    }

    .student-edit-modal .modal-dialog {
        width: min(100% - 1rem, 760px);
        margin: .5rem auto;
    }

    .student-edit-modal .modal-content {
        max-height: calc(100vh - 1rem);
    }

    .student-profile-modal .modal-dialog {
        width: min(100% - 1rem, 760px);
        margin: .5rem auto;
    }

    .student-profile-modal .modal-content {
        max-height: calc(100vh - 1rem);
    }
}

@media (max-width: 575.98px) {
    .student-edit-modal .modal-dialog {
        width: calc(100% - .75rem);
        margin: .375rem auto;
    }

    .student-edit-modal .modal-content {
        border-radius: 1rem;
        max-height: calc(100vh - .75rem);
    }

    .student-edit-modal .modal-header,
    .student-edit-modal .modal-body {
        padding-left: .85rem !important;
        padding-right: .85rem !important;
    }

    .student-edit-modal .modal-header {
        min-height: 52px;
        padding-top: .7rem;
        padding-bottom: .7rem;
    }

    .student-edit-modal .modal-body {
        padding-top: .85rem !important;
        padding-bottom: .85rem !important;
    }

    .student-profile-modal .modal-dialog {
        width: calc(100% - .75rem);
        margin: .375rem auto;
    }

    .student-profile-modal .modal-content {
        border-radius: 1rem;
        max-height: calc(100vh - .75rem);
    }

    .student-profile-modal .modal-body {
        padding: .85rem !important;
    }

    .student-profile-modal .nav-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        justify-content: flex-start !important;
    }

    .student-profile-modal .nav-tabs .nav-item {
        flex: 0 0 auto;
    }

    .student-edit-modal .modal-footer {
        gap: .5rem;
        padding: .65rem .85rem;
    }

    .student-edit-modal .modal-footer .btn {
        flex: 1 1 auto;
        margin: 0 !important;
    }
}

@media (max-width: 576px) {
    .top-navbar .btn,
    .top-navbar .btn-link,
    .top-navbar .menu-toggle,
    .top-navbar .dropdown-toggle {
        width: auto !important;
        min-width: 44px;
        flex: 0 0 auto;
    }
}

@media (max-width: 420px) {
    .content-body {
        padding: 0.625rem !important;
    }

    .btn,
    .form-control,
    .form-select {
        font-size: 0.9rem;
    }

    .page-header h2 {
        font-size: 1.25rem !important;
    }

    .stats-card,
    .quick-action-card {
        border-radius: var(--radius-lg) !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .card-modern:hover,
    .stats-card:hover,
    .quick-action-card:hover {
        transform: none;
    }
    opacity: 1;
}

/* Quick Action Cards */
.quick-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    border-radius: var(--radius-xl);
    background: #fff;
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
    height: 100%;
    text-align: center;
}

/* Theme identity overrides must remain last because the shared responsive
   rules above intentionally set the shell dimensions for every mode. */
body.app-page.theme-classic {
    --sidebar-width: 228px !important;
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif !important;
    background: #edf1f5 !important;
}

body.app-page.theme-classic .sidebar {
    width: 228px !important;
    background: #172033 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: 7px 0 0 #d6dee8 !important;
}

body.app-page.theme-classic .sidebar-header {
    height: 76px !important;
    padding-inline: 18px !important;
    background: #101827 !important;
    border-bottom: 4px solid #e5a93d !important;
}

body.app-page.theme-classic .sidebar .nav-link,
body.app-page.theme-classic .sidebar .sidebar-group-toggle {
    margin: 0 !important;
    padding: .72rem 1rem !important;
    border-radius: 0 !important;
    border-left: 3px solid transparent !important;
}

body.app-page.theme-classic .sidebar .nav-link:hover,
body.app-page.theme-classic .sidebar .sidebar-group-toggle:hover,
body.app-page.theme-classic .sidebar .nav-link.active {
    transform: none !important;
    background: #24324a !important;
    border-left-color: #e5a93d !important;
    box-shadow: none !important;
}

body.app-page.theme-classic .main-content {
    margin-left: 228px !important;
}

body.app-page.theme-classic .top-navbar {
    min-height: 60px !important;
    margin: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    box-shadow: 0 1px 0 rgba(23, 32, 51, .08) !important;
}

body.app-page.theme-classic .page-header,
body.app-page.theme-classic .header-premium {
    min-height: 128px !important;
    border-radius: 4px !important;
    border-top: 5px solid #e5a93d !important;
    background: #fff !important;
    box-shadow: 0 8px 18px rgba(23, 32, 51, .06) !important;
}

body.app-page.theme-classic .card,
body.app-page.theme-classic .dashboard-surface,
body.app-page.theme-classic .card-modern,
body.app-page.theme-classic .form-card {
    border-radius: 4px !important;
    background: #fff !important;
    box-shadow: 0 5px 14px rgba(23, 32, 51, .045) !important;
}

body.app-page.theme-classic .card-header {
    background: #f7f9fb !important;
    border-bottom: 1px solid #d7dee8 !important;
}

body.app-page.theme-classic .btn,
body.app-page.theme-classic .form-control,
body.app-page.theme-classic .form-select {
    border-radius: 4px !important;
}

body.app-page.theme-aurora {
    --sidebar-width: 292px !important;
    font-family: "DM Sans", Inter, system-ui, sans-serif !important;
    background: #f8f7ff !important;
}

body.app-page.theme-aurora .sidebar {
    width: 268px !important;
    top: 14px !important;
    left: 14px !important;
    height: calc(100vh - 28px) !important;
    border: 1px solid rgba(255,255,255,.2) !important;
    border-radius: 26px !important;
    background: linear-gradient(145deg, rgba(33,20,67,.98), rgba(11,54,73,.98)) !important;
    box-shadow: 0 24px 55px rgba(48,25,90,.25) !important;
}

body.app-page.theme-aurora .sidebar-header {
    height: 92px !important;
    margin: 10px !important;
    padding-inline: 16px !important;
    border-radius: 18px !important;
    background: linear-gradient(135deg, rgba(244,114,182,.2), rgba(45,212,191,.14)) !important;
    border: 1px solid rgba(255,255,255,.12) !important;
}

body.app-page.theme-aurora .sidebar .nav-link,
body.app-page.theme-aurora .sidebar .sidebar-group-toggle {
    margin: .22rem .7rem !important;
    padding: .78rem .9rem !important;
    border-radius: 14px !important;
}

body.app-page.theme-aurora .sidebar .nav-link:hover,
body.app-page.theme-aurora .sidebar .sidebar-group-toggle:hover,
body.app-page.theme-aurora .sidebar .nav-link.active {
    transform: translateX(5px) !important;
    background: linear-gradient(135deg, rgba(244,114,182,.72), rgba(45,212,191,.58)) !important;
    border-color: rgba(255,255,255,.2) !important;
    box-shadow: 0 12px 22px rgba(18,13,44,.25) !important;
}

body.app-page.theme-aurora .main-content {
    margin-left: 292px !important;
}

body.app-page.theme-aurora .top-navbar {
    min-height: 78px !important;
    margin: 14px 18px 0 !important;
    border-radius: 20px !important;
    background: rgba(255,255,255,.62) !important;
    box-shadow: 0 16px 32px rgba(76,29,149,.08) !important;
}

body.app-page.theme-aurora .page-header,
body.app-page.theme-aurora .header-premium {
    min-height: 190px !important;
    border-radius: 28px !important;
    background: linear-gradient(120deg, #241044 0%, #8b3d8f 48%, #0f8f91 100%) !important;
    box-shadow: 0 25px 48px rgba(104,45,133,.22) !important;
}

body.app-page.theme-aurora .card,
body.app-page.theme-aurora .dashboard-surface,
body.app-page.theme-aurora .card-modern,
body.app-page.theme-aurora .form-card {
    border-radius: 22px !important;
    background: rgba(255,255,255,.68) !important;
    box-shadow: 0 18px 35px rgba(76,29,149,.1) !important;
}

body.app-page.theme-aurora .card-header {
    min-height: 4rem !important;
    border-radius: 22px 22px 0 0 !important;
    background: linear-gradient(135deg, rgba(244,114,182,.1), rgba(45,212,191,.08)) !important;
}

body.app-page.theme-aurora .btn {
    border-radius: 999px !important;
}

body.app-page.theme-aurora .form-control,
body.app-page.theme-aurora .form-select {
    border-radius: 14px !important;
}

@media (max-width: 991.98px) {
    body.app-page.theme-classic .main-content,
    body.app-page.theme-aurora .main-content {
        margin-left: 0 !important;
    }

    body.app-page.theme-classic .sidebar {
        width: 228px !important;
        top: 0 !important;
        left: 0 !important;
        height: 100vh !important;
        border-radius: 0 !important;
    }

    body.app-page.theme-aurora .sidebar {
        width: 292px !important;
        top: 0 !important;
        left: 0 !important;
        height: 100vh !important;
        border-radius: 0 24px 24px 0 !important;
    }

    body.app-page.theme-aurora .top-navbar {
        margin: 8px !important;
        min-height: 66px !important;
        border-radius: 16px !important;
    }
}

.quick-action-card:hover {
    background: var(--primary-light);
    color: #fff !important;
    transform: scale(1.05);
}

.quick-action-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--accent-light);
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.quick-action-card:hover .quick-action-icon {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

/* Form Styling */
.form-control:focus, .form-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.25rem var(--accent-light);
}

.rounded-pill-sm {
    border-radius: 50rem !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

/* Manage Students action hierarchy */
.template-panel-heading {
    display: flex;
    align-items: center;
    gap: .8rem;
    margin-bottom: 1rem;
}

.template-panel-heading h5 {
    color: #172554;
    letter-spacing: -.01em;
}

.template-panel-icon {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    flex: 0 0 2.75rem;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    border-radius: .9rem;
    box-shadow: 0 8px 16px rgba(37, 99, 235, .2);
}

.template-download-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
}

.template-download-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-width: 0;
    padding: .7rem .65rem;
    color: #1e293b;
    text-decoration: none;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: .85rem;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.template-download-item:hover,
.template-download-item:focus-visible {
    color: #172554;
    background: #fff;
    border-color: #93c5fd;
    box-shadow: 0 8px 18px rgba(37, 99, 235, .12);
    transform: translateY(-2px);
}

.template-download-icon {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 2.25rem;
    border-radius: .7rem;
    font-size: .85rem;
}

.template-download-item > span:nth-child(2) {
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.template-download-item strong,
.template-download-item small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.template-download-item strong {
    font-size: .78rem;
}

.template-download-item small {
    margin-top: .2rem;
    color: #64748b;
    font-size: .65rem;
}

.template-download-arrow {
    margin-left: auto;
    color: #94a3b8;
    font-size: .7rem;
    transition: color .2s ease, transform .2s ease;
}

.template-download-item:hover .template-download-arrow,
.template-download-item:focus-visible .template-download-arrow {
    color: #2563eb;
    transform: translateY(2px);
}

.template-icon-blue { color: #2563eb; background: #dbeafe; }
.template-icon-purple { color: #7c3aed; background: #ede9fe; }
.template-icon-teal { color: #0f766e; background: #ccfbf1; }
.template-icon-orange { color: #c2410c; background: #ffedd5; }
.template-icon-green { color: #15803d; background: #dcfce7; }
.template-icon-pink { color: #be185d; background: #fce7f3; }

.remove-photo-background {
    border-radius: .65rem;
    font-weight: 600;
}

.photo-processing-status {
    max-width: 100%;
}

@media (max-width: 575.98px) {
    .template-download-grid {
        grid-template-columns: 1fr;
    }

    .template-download-item {
        min-height: 3.25rem;
        padding: .7rem .75rem;
    }
}

.student-action-group {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: .4rem;
    flex-wrap: wrap;
}

.student-action-btn {
    min-height: 36px;
    border-radius: 10px !important;
    padding: .45rem .7rem !important;
    font-weight: 700;
    border: 1px solid transparent;
    white-space: nowrap;
}

.student-action-view {
    color: #1d4ed8;
    background: #eff6ff;
    border-color: #bfdbfe;
}

.student-action-edit {
    color: #047857;
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.student-action-more {
    color: #475569;
    background: #f8fafc;
    border-color: #cbd5e1;
}

.student-action-btn:hover,
.student-action-btn:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(15, 23, 42, .1);
}

.student-action-group .dropdown-menu {
    min-width: 230px;
    padding: .5rem;
    border: 1px solid rgba(148, 163, 184, .2) !important;
    border-radius: 14px;
}

.student-action-group .dropdown-item {
    min-height: 40px;
    display: flex;
    align-items: center;
    border-radius: 9px;
}

.student-action-group .dropdown-item:hover,
.student-action-group .dropdown-item:focus {
    background: #eff6ff;
}

@media (max-width: 767.98px) {
    .student-action-group {
        width: 100%;
        justify-content: flex-end;
        margin-top: .8rem;
    }

    .student-action-btn {
        min-height: 42px;
        padding-inline: .8rem !important;
    }

    /* Keep student cards comfortable and prevent names/actions escaping the card. */
    .d-block.d-md-none.card-modern .list-group-item {
        padding: 1rem !important;
        overflow: visible;
    }

    .d-block.d-md-none.card-modern .list-group-item > .d-flex {
        align-items: flex-start !important;
        gap: .75rem !important;
    }

    .d-block.d-md-none.card-modern .list-group-item > .d-flex > .d-flex:first-child {
        min-width: 0;
        flex: 1 1 auto;
    }

    .d-block.d-md-none.card-modern .list-group-item > .d-flex > .d-flex:first-child > div:last-child {
        min-width: 0;
    }

    .d-block.d-md-none.card-modern .list-group-item > .d-flex > .d-flex:first-child .fw-bold,
    .d-block.d-md-none.card-modern .list-group-item > .d-flex > .d-flex:first-child .small {
        overflow-wrap: anywhere;
    }

    .d-block.d-md-none.card-modern .list-group-item > .d-flex > .ms-auto {
        flex: 0 0 auto;
    }

    .d-block.d-md-none.card-modern .student-action-group {
        width: auto;
        margin-top: 0;
    }

    .d-block.d-md-none.card-modern .student-action-btn {
        min-height: 40px;
    }

    .d-block.d-md-none.card-modern .student-action-group .dropdown-menu {
        max-width: calc(100vw - 2rem);
        max-height: calc(100vh - 7rem);
        overflow-y: auto;
    }
}

/* Classic refinements: denser, more institutional presentation */
body.app-page.theme-classic {
    --classic-accent: #e5a93d;
    --classic-ink: #172033;
    --classic-muted: #6b7280;
}

/* Sidebar polish for classic */
body.app-page.theme-classic .sidebar {
    background: linear-gradient(180deg,#0b1220 0%, #172033 100%) !important;
    border-right: 0 !important;
    box-shadow: 6px 0 0 rgba(229,169,61,0.06) !important;
}

body.app-page.theme-classic .sidebar .nav-link {
    padding: .6rem 1rem !important;
    color: rgba(255,255,255,0.92) !important;
    font-weight: 600;
}

body.app-page.theme-classic .sidebar .nav-link .fas,
body.app-page.theme-classic .sidebar .nav-link i {
    width: 28px; text-align:center; margin-right:.6rem; color: rgba(255,255,255,0.85);
}

body.app-page.theme-classic .sidebar .nav-link.active {
    background: linear-gradient(90deg, rgba(229,169,61,0.12), rgba(229,169,61,0.06));
    color: #fff !important;
    border-left: 3px solid var(--classic-accent) !important;
}

/* Navbar: subtle left accent and compact height */
body.app-page.theme-classic .top-navbar {
    min-height: 56px !important;
    border-bottom: 1px solid rgba(214,222,234,0.6) !important;
    background: linear-gradient(180deg,#ffffff,#f7f9fb) !important;
}

/* Sharper, denser cards */
body.app-page.theme-classic .card,
body.app-page.theme-classic .card-modern,
body.app-page.theme-classic .stats-card,
body.app-page.theme-classic .quick-action-card {
    border-radius: 6px !important;
    border: 1px solid rgba(215,222,232,0.9) !important;
    background: linear-gradient(180deg,#ffffff,#fbfdff) !important;
}

body.app-page.theme-classic .card-header {
    background: linear-gradient(180deg,#fafcff,#f3f6fb) !important;
    border-bottom: 1px solid rgba(215,222,232,0.9) !important;
}

/* Priority / stat cards */
body.app-page.theme-classic .admin-priority-card {
    padding: .9rem !important;
    gap: .6rem !important;
}

body.app-page.theme-classic .admin-priority-icon {
    width:44px; height:44px; border-radius:6px; display:grid; place-items:center; font-size:1.1rem; box-shadow:0 .35rem .8rem rgba(23,32,51,.05);
}

body.app-page.theme-classic .stat-card .value,
body.app-page.theme-classic .admin-priority-card .value {
    font-weight:800; color:var(--classic-ink); font-size:1.95rem;
}

/* Quick action tweaks */
body.app-page.theme-classic .quick-action-card {
    padding: .85rem !important; min-height:120px; display:flex; align-items:flex-start; gap:.75rem;
}

body.app-page.theme-classic .quick-action-icon {
    width:48px; height:48px; border-radius:8px; display:grid; place-items:center; font-size:1.25rem; color:#fff; background:var(--classic-accent);
}

/* Tables: compact, with classic header */
body.app-page.theme-classic .table-premium thead th {
    background: #1f2a37 !important; color: #fff !important; font-weight:700; letter-spacing:.02em;
}

body.app-page.theme-classic .table-premium tbody tr:nth-child(odd) {
    background: rgba(15,20,30,0.02);
}

/* Forms and buttons */
body.app-page.theme-classic .btn-primary {
    background: var(--classic-accent) !important; border-color: rgba(0,0,0,0.08) !important; color: #0b1220 !important;
}

body.app-page.theme-classic .btn-outline-primary {
    border-color: rgba(23,32,51,0.06) !important; color: var(--classic-ink) !important; background: transparent !important;
}

/* Page header tweaks for classic */
body.app-page.theme-classic .page-header {
    background: linear-gradient(180deg,#1f2a37,#24324a) !important; color: #fff !important; border-radius:6px !important;
}

@media (max-width: 991.98px) {
    body.app-page.theme-classic .sidebar { box-shadow: 8px 0 24px rgba(15, 23, 42, .18) !important; }
    body.app-page.theme-classic .admin-priority-card { min-height:88px !important; }
}

/* Corporate compact refinements (applied for Classic by default) */
body.theme-classic, body.app-page.theme-classic {
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

body.theme-classic .sidebar {
    width: 220px !important;
}

body.theme-classic .sidebar .brand {
    padding: .85rem 1rem; font-weight:700; letter-spacing:.02em; color:#fff !important;
}

body.theme-classic .top-navbar {
    padding: .45rem 1rem !important; min-height:52px !important;
}

body.theme-classic .card, body.theme-classic .card-modern {
    border-radius: 6px !important;
}

body.theme-classic .page-header h1,
body.theme-classic .page-header h2 {
    font-weight:700; color: #fff; letter-spacing: -0.02em;
}

/* Compact table rows and tighter paddings */
body.theme-classic .table td, body.theme-classic .table th {
    padding: .55rem .75rem !important;
}

/* Stronger active indicator */
body.theme-classic .sidebar .nav-link.active {
    box-shadow: inset 4px 0 0 var(--classic-accent) !important;
}

/* Accent-tinted borders for important components */
body.theme-classic .card-important {
    border-left: 4px solid var(--classic-accent) !important;
}

@media (max-width: 767.98px) {
    body.theme-classic .sidebar { width: 100% !important; }
    body.theme-classic .top-navbar .navbar-brand { padding-left: .5rem; }
}

/* Classes and arms workspace: preserve clear actions on narrow screens. */
.auth-school-brand {
    width: 100%;
    text-align: center;
    margin-bottom: 1rem;
}

.forgot-password-page .auth-school-brand-top {
    grid-column: 1 / -1;
    padding: 1rem 1rem 0;
    margin-bottom: 0;
}

.forgot-password-page .auth-school-brand-top img,
.forgot-password-page .auth-school-brand-top .auth-school-brand-fallback {
    width: 44px !important;
    height: 44px !important;
}

.forgot-password-page .auth-school-brand-top .auth-school-brand-name {
    font-size: .8rem !important;
    font-weight: 700;
}

.auth-school-brand img,
.auth-school-brand-fallback {
    width: 48px;
    height: 48px;
    object-fit: contain;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .12);
}

.auth-school-brand-fallback {
    color: #2563eb;
    font-size: 1.8rem;
}

.auth-school-brand-name {
    margin-top: .35rem;
    color: #172033;
    font-size: .82rem;
    font-weight: 700;
    line-height: 1.25;
}

.manage-classes-page .page-header {
    overflow: hidden;
}

.manage-classes-page .page-header > .d-flex {
    align-items: flex-start !important;
}

.manage-classes-page .page-header .page-header-actions,
.manage-classes-page .page-header > .d-flex > .d-flex:last-child {
    flex: 0 0 auto;
}

.manage-classes-page .page-header .btn {
    min-height: 42px;
    white-space: nowrap;
}

body.theme-aurora .manage-classes-page .page-header .btn-light {
    background: rgba(255,255,255,.96) !important;
    border: 1px solid rgba(255,255,255,.8) !important;
    color: #312e81 !important;
}

body.theme-aurora .manage-classes-page .page-header .btn-light i {
    color: #4f46e5 !important;
}

.manage-classes-page .table-container {
    overflow: hidden;
}

.manage-classes-page .table-container > .p-4 {
    padding: 1rem 1.15rem !important;
}

.manage-classes-page .table-container > .d-block.d-md-none {
    padding: .65rem !important;
}

.manage-classes-page .table-container > .d-block.d-md-none .list-group-item {
    border: 1px solid rgba(148,163,184,.16) !important;
    border-radius: .8rem !important;
    margin-bottom: .55rem;
    padding: .85rem !important;
    background: rgba(255,255,255,.86);
}

@media (max-width: 767.98px) {
    .manage-classes-page .page-header {
        margin-inline: 0 !important;
        padding: 1rem !important;
    }

    .manage-classes-page .page-header > .d-flex {
        display: block !important;
    }

    .manage-classes-page .page-header > .d-flex > div:first-child {
        margin-bottom: .85rem;
    }

    .manage-classes-page .page-header > .d-flex > .d-flex:last-child {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .55rem !important;
        width: 100%;
    }

    .manage-classes-page .page-header > .d-flex > .d-flex:last-child .btn {
        width: 100%;
        padding-inline: .6rem !important;
        font-size: .78rem;
    }

    .manage-classes-page .page-header > .d-flex > .d-flex:last-child .btn i {
        margin-right: .3rem !important;
    }

    .manage-classes-page .row.g-4 {
        --bs-gutter-y: 1rem;
    }

    .manage-classes-page .card-modern.stat-card {
        min-height: 104px;
    }

    .manage-classes-page .table-container {
        height: auto !important;
    }

    .manage-classes-page .table-container > .p-4 h5 {
        font-size: .95rem;
    }
}

@media (max-width: 360px) {
    .manage-classes-page .page-header > .d-flex > .d-flex:last-child {
        grid-template-columns: 1fr;
    }
}

/* Fix: ensure class/arm names are legible on light cards (override theme header color inheritance) */
.manage-classes-page .list-group-item,
.manage-classes-page .list-group-item .fw-bold,
.manage-classes-page .list-group-item .small,
.manage-classes-page .list-group-item .text-muted {
    color: #0b1220 !important;
}

/* Tables in this workspace should use dark text for readability */
.manage-classes-page .table-modern tbody td,
.manage-classes-page .table-modern thead th,
.manage-classes-page .table-container .empty-state {
    color: #0b1220 !important;
}

/* Keep badge and pill colors intact by targeting text elements only */
.manage-classes-page .list-group-item .badge,
.manage-classes-page .list-group-item .bg-primary-light,
.manage-classes-page .list-group-item .bg-info-light,
.manage-classes-page .list-group-item .bg-success-light {
    color: inherit !important;
}

/* Shared mobile record cards: prevent theme header color inheritance from
   making names and metadata white on light card surfaces. */
@media (max-width: 767.98px) {
    body.app-page .main-content .d-block.d-md-none .list-group-item,
    body.app-page .main-content .d-block.d-md-none .list-group-item .fw-bold,
    body.app-page .main-content .d-block.d-md-none .list-group-item .small,
    body.app-page .main-content .d-block.d-md-none .list-group-item .text-muted {
        color: #0b1220 !important;
    }

    body.app-page .main-content .d-block.d-md-none .list-group-item .badge,
    body.app-page .main-content .d-block.d-md-none .list-group-item [class*="bg-"] {
        color: inherit !important;
    }

    body.app-page .main-content .table-modern tbody td,
    body.app-page .main-content .table-premium tbody td {
        color: #0b1220;
    }
}
