:root {
    --amss-primary: #1463ff;
    --amss-ink: #172033;
    --amss-muted: #657085;
    --amss-bg: #f5f7fb;
}

body {
    color: var(--amss-ink);
    background: #fff;
}

.admin-page .min-vh-100 > .flex-grow-1 {
    min-width: 0;
}

html {
    scroll-behavior: smooth;
}

.hero-section {
    background: linear-gradient(180deg, #eef4ff 0%, #ffffff 100%);
    scroll-margin-top: 84px;
}

@media (max-width: 575.98px) {
    .hero-section .row.g-5 {
        --bs-gutter-x: 1.5rem;
    }
}

.system-panel,
.content-card,
.metric-card,
.login-card {
    background: #fff;
    border: 1px solid #e5e9f2;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(23, 32, 51, 0.06);
}

.system-panel,
.content-card,
.metric-card {
    padding: 1.25rem;
}

.operational-dashboard .content-card {
    min-width: 0;
}

.operational-dashboard .row > [class*="col"] {
    min-width: 0;
}

.dashboard-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.dashboard-quick-actions .btn {
    white-space: normal;
}

.dashboard-billing-table {
    table-layout: fixed;
    width: 100%;
}

.dashboard-billing-table th,
.dashboard-billing-table td {
    overflow-wrap: anywhere;
    vertical-align: middle;
}

.dashboard-billing-table .col-invoice {
    width: 14%;
}

.dashboard-billing-table .col-student {
    width: 20%;
}

.dashboard-billing-table .col-program {
    width: 10%;
}

.dashboard-billing-table .col-period {
    width: 9%;
}

.dashboard-billing-table .col-due {
    width: 15%;
}

.dashboard-billing-table .col-balance {
    width: 15%;
}

.dashboard-billing-table .col-status {
    width: 10%;
}

.dashboard-billing-table .col-action {
    width: 7%;
}

.dashboard-badge {
    max-width: 100%;
    white-space: normal;
}

.dashboard-action-btn {
    white-space: normal;
}

.dashboard-billing-table-wrap {
    display: block;
    max-width: 100%;
    min-width: 0;
    width: 100%;
}

@media (max-width: 1199.98px) {
    .dashboard-billing-table-wrap {
        overflow-x: auto;
    }

    .dashboard-billing-table {
        min-width: 760px;
        table-layout: auto;
    }
}

.academy-row {
    align-items: center;
    color: var(--amss-ink);
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid #edf0f6;
    border-radius: 8px;
    background: #f9fbff;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.academy-row:hover,
.academy-row:focus {
    border-color: #b8c7f2;
    box-shadow: 0 10px 22px rgba(23, 32, 51, 0.08);
    color: var(--amss-ink);
    transform: translateY(-1px);
}

.academy-directory-panel {
    min-width: 0;
    scroll-margin-top: 84px;
}

.academy-card-title {
    line-height: 1.25;
}

.academy-status-dot {
    background: #1f9d55;
    border: 3px solid #dff6e8;
    border-radius: 999px;
    flex: 0 0 auto;
    height: 0.85rem;
    width: 0.85rem;
}

.academy-empty-state {
    background: #f9fbff;
    border: 1px dashed #cfd8e8;
    border-radius: 8px;
    color: var(--amss-muted);
    padding: 1rem;
}

.public-nav-secondary {
    font-size: 0.95rem;
}

.auth-page,
.admin-page {
    background: var(--amss-bg);
}

.auth-shell {
    background: #f4f7fb;
    min-height: 100vh;
}

.auth-content {
    min-height: 100vh;
}

.auth-alert {
    left: 50%;
    max-width: 440px;
    position: fixed;
    top: 1rem;
    transform: translateX(-50%);
    width: calc(100% - 2rem);
    z-index: 5;
}

.login-portal {
    display: grid;
    grid-template-columns: minmax(360px, 44%) minmax(0, 56%);
    min-height: 100vh;
}

.login-brand-panel {
    align-items: center;
    background: #172033;
    color: #fff;
    display: flex;
    min-height: 100vh;
    overflow: hidden;
    padding: 3rem;
    position: relative;
}

.login-brand-panel::after {
    border: 1px solid rgba(224, 182, 93, 0.28);
    border-radius: 8px;
    bottom: 2rem;
    content: "";
    left: 2rem;
    pointer-events: none;
    position: absolute;
    right: 2rem;
    top: 2rem;
}

.login-brand-accent {
    background: #d7aa45;
    border-radius: 999px;
    height: 3px;
    margin-bottom: 2rem;
    width: 74px;
}

.login-brand-content {
    max-width: 520px;
    position: relative;
    z-index: 1;
}

.login-card {
    max-width: 440px;
    padding: 2rem;
}

.login-form-panel {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 3rem 2rem;
}

.login-brand-logo-wrap {
    align-items: center;
    display: flex;
    justify-content: flex-start;
    margin: 0 0 2rem;
    max-height: 128px;
    overflow: hidden;
}

.login-brand-logo {
    background: #fff;
    border-radius: 8px;
    display: block;
    height: auto;
    max-height: 118px;
    max-width: 232px;
    object-fit: contain;
    padding: 5px;
    width: 232px;
}

.login-brand-fallback {
    color: #fff;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 2rem;
}

.login-brand-kicker {
    color: #d7aa45;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
}

.login-brand-panel h1 {
    font-size: clamp(2.65rem, 3.9vw, 3.65rem);
    font-weight: 800;
    line-height: 1.08;
    margin-bottom: 1rem;
    overflow-wrap: anywhere;
}

.login-brand-subtitle {
    color: rgba(255, 255, 255, 0.86);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.login-brand-description {
    color: rgba(255, 255, 255, 0.72);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 0;
}

.login-password-toggle {
    min-width: 104px;
}

.admin-sidebar {
    background: #172033;
    flex: 0 0 260px;
    max-width: 260px;
    min-width: 260px;
    width: 260px;
}

.admin-sidebar .admin-brand {
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.admin-sidebar .admin-brand-logo-wrap {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 112px;
    overflow: hidden;
    padding: 10px 12px;
    width: 100%;
}

.admin-sidebar .admin-brand-logo {
    background: #fff;
    border-radius: 6px;
    display: block;
    height: auto;
    margin: 0 auto;
    max-height: var(--sidebar-logo-max-height, 96px);
    max-width: var(--sidebar-logo-width, 96px);
    object-fit: contain;
    padding: 3px;
    width: var(--sidebar-logo-width, 96px);
}

.admin-sidebar .admin-brand-text {
    display: block;
    overflow-wrap: anywhere;
}

.portal-mobile-logo {
    background: #fff;
    border: 1px solid #dfe5ee;
    border-radius: 6px;
    display: none;
    flex: 0 0 48px;
    height: 48px;
    object-fit: contain;
    padding: 2px;
    width: 48px;
}

.admin-account-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.86);
    padding: 0.75rem;
}

.admin-account-name {
    color: #fff;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.admin-account-email,
.admin-account-context {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.78rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.admin-account-role {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.82rem;
    font-weight: 600;
    margin-top: 0.35rem;
    line-height: 1.25;
}

.admin-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.74);
}

.admin-sidebar .nav-link.active,
    .admin-sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.parent-mobile-nav {
    display: none;
}

.parent-child-card {
    min-width: 0;
}

.parent-child-photo {
    border-radius: 8px;
    flex: 0 0 auto;
    height: 72px;
    object-fit: cover;
    width: 72px;
}

.parent-child-photo-lg {
    height: 96px;
    width: 96px;
}

.parent-child-photo-empty {
    align-items: center;
    background: #e8eef8;
    color: #172033;
    display: flex;
    font-size: 1.35rem;
    font-weight: 800;
    justify-content: center;
}

.parent-empty-state {
    background: #f9fbff;
    border: 1px dashed #cfd8e8;
    border-radius: 8px;
    color: var(--amss-muted);
    padding: 1rem;
}

.parent-child-switcher .btn {
    white-space: normal;
}

.parent-chart {
    display: block;
    height: auto;
    max-width: 100%;
}

@media (max-width: 1100px) {
    .login-brand-panel {
        padding: 2.5rem;
    }

    .login-brand-panel h1 {
        font-size: clamp(2.35rem, 3.7vw, 3rem);
    }

    .login-brand-subtitle {
        font-size: 1rem;
        margin-bottom: 0.85rem;
    }

    .login-brand-description {
        font-size: 0.95rem;
        line-height: 1.6;
    }
}

@media (max-width: 768px) {
    .admin-sidebar {
        display: none;
    }

    .portal-mobile-logo {
        display: block;
    }

    .parent-mobile-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
    white-space: normal;
    }

    .parent-mobile-nav .nav-link {
    border-radius: 10px;
    color: var(--amss-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 10px;
    text-align: center;
    text-decoration: none;
    }

    .parent-mobile-nav .nav-link.active {
        background: #e8eef8;
        color: var(--amss-primary);
        font-weight: 700;
    }

    .admin-page main {
        padding: 1rem !important;
    }

    .login-portal {
        display: block;
        min-height: 100vh;
    }

    .login-brand-panel {
        min-height: auto;
        padding: 2rem 1.25rem;
    }

    .login-brand-panel::after {
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
        top: 1rem;
    }

    .login-brand-logo-wrap {
        margin-bottom: 1.25rem;
        max-height: 96px;
    }

    .login-brand-logo {
        max-height: 88px;
        max-width: 174px;
        padding: 4px;
        width: 174px;
    }

    .login-brand-panel h1 {
        font-size: clamp(1.9rem, 9vw, 2.35rem);
        line-height: 1.12;
        margin-bottom: 0.85rem;
    }

    .login-brand-subtitle {
        font-size: 0.98rem;
        margin-bottom: 0.75rem;
    }

    .login-brand-description {
        font-size: 0.92rem;
        line-height: 1.55;
    }

    .login-form-panel {
        min-height: auto;
        padding: 1.5rem 1rem 2rem;
    }

    .login-card {
        padding: 1.5rem;
    }
}
.admin-mobile-menu {
    display: none;
}

@media (max-width: 768px) {
    .admin-mobile-menu {
        display: block;
    }

    .admin-mobile-menu-summary {
        cursor: pointer;
        font-weight: 700;
        list-style: none;
        padding: 14px 20px;
        position: relative;
    }

    .admin-mobile-menu-summary::-webkit-details-marker {
        display: none;
    }

    .admin-mobile-menu-summary::after {
        content: "☰";
        position: absolute;
        right: 20px;
    }

    .admin-mobile-menu[open] .admin-mobile-menu-summary::after {
        content: "×";
    }

    .admin-mobile-menu-links {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding: 0 16px 16px;
    }

    .admin-mobile-menu-links .nav-link {
        align-items: center;
        border-radius: 10px;
        color: var(--amss-ink);
        display: flex;
        justify-content: center;
        min-height: 44px;
        padding: 8px 10px;
        text-align: center;
        text-decoration: none;
    }

    .admin-mobile-menu-links .nav-link.active {
        background: #e8eef8;
        color: var(--amss-primary);
        font-weight: 700;
    }
}
