/*
 * IFHAM brand layer (Academy-owned; see docs/academy/BRANDING.md).
 *
 * Loaded on every layout that includes design_1.web.includes.metas, after
 * the vendor CSS. Colors come from custom properties only:
 *   --academy-*   brand tokens emitted from config/academy.php `brand`
 *   --primary     the active Rocket LMS theme primary (IFHAM interactive purple
 *                 once `php artisan academy:apply-branding` has run)
 * Semantic colors (success / warning / danger / info) and session status
 * colors are never changed here.
 */

/* ------------------------------------------------------------------
 * Logos — official artwork is never cropped. The PNGs carry transparent
 * padding (wordmark: 21.5% top/bottom, 10.7% left/right; icon: 15.6% / 19.4%),
 * absorbed with negative margins derived from the rendered height so the
 * visible mark fills its container without distortion.
 * ------------------------------------------------------------------ */
.academy-brand-logo,
.academy-brand-icon {
    display: block;
    width: auto;
    max-width: none;
    object-fit: contain;
    flex-shrink: 0;
}

.academy-brand-logo {
    --logo-height: 80px;
    height: var(--logo-height);
    margin: calc(var(--logo-height) * -0.215) calc(var(--logo-height) * -0.203);
}

.academy-brand-icon {
    --logo-height: 48px;
    height: var(--logo-height);
    margin: calc(var(--logo-height) * -0.156) calc(var(--logo-height) * -0.204);
}

/* ------------------------------------------------------------------
 * Admin / Support — Academy sidebar
 * ------------------------------------------------------------------ */
.academy-sidebar .sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 88px;
    line-height: normal;
    padding: 0 16px;
}

.academy-sidebar .sidebar-brand a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.academy-sidebar .sidebar-brand .academy-brand-logo { --logo-height: 92px; }
.academy-sidebar .sidebar-brand-sm .academy-brand-icon { --logo-height: 46px; }

.academy-sidebar .sidebar-brand.sidebar-brand-sm { display: none; }
body.sidebar-mini .academy-sidebar .sidebar-brand { display: none; }
body.sidebar-mini .academy-sidebar .sidebar-brand.sidebar-brand-sm { display: flex; height: 72px; padding: 0; }

.academy-sidebar .sidebar-menu li.menu-header { color: var(--academy-text); opacity: .55; }

/* Active text uses the hover purple: 5.5:1 on the cream surface (AA). */
body:not(.sidebar-mini) .academy-sidebar .sidebar-menu li.active > a {
    position: relative;
    color: var(--academy-interactive-hover);
    background-color: var(--academy-surface);
}

body:not(.sidebar-mini) .academy-sidebar .sidebar-menu li.active > a::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background-color: var(--academy-interactive);
}

body:not(.sidebar-mini) .academy-sidebar .sidebar-menu li.active > a .icons { color: var(--academy-interactive); }

body.sidebar-mini .academy-sidebar .sidebar-menu > li.active > a {
    background-color: var(--academy-interactive);
    box-shadow: none;
    color: var(--academy-on-primary);
}

body.sidebar-mini .academy-sidebar .sidebar-menu > li.active > a .icons { color: var(--academy-on-primary); }

/* Mobile drawer: the vendor close button is fixed at the top-right corner,
   on top of the header avatar. Place it beside the open drawer, below the
   header band, with a 44px touch target. */
@media (max-width: 1024.98px) {
    body:has(.academy-sidebar) .sidebar-close {
        top: 112px;
        left: 262px;
        right: auto;
        width: 44px;
        height: 44px;
        padding: 0;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background-color: color-mix(in srgb, var(--academy-on-primary) 16%, transparent);
    }

    body:has(.academy-sidebar) .sidebar-close .close-icon { width: 28px; height: 28px; }
}

/* Phones / tablets: the drawer starts closed. The vendor script adds
   `sidebar-gone` only after load, so the open drawer used to slide away
   over the page on every load (0.5s). */
@media (max-width: 1024px) {
    body:not(.rtl):not(.sidebar-show) .main-sidebar.academy-sidebar { left: -250px; }
    body.rtl:not(.sidebar-show) .main-sidebar.academy-sidebar { right: -250px; }
}

/* ------------------------------------------------------------------
 * Admin / Support — header band (vendor bg-primary)
 * ------------------------------------------------------------------ */
.admin-header[data-academy-header] .academy-header-toggle { color: var(--academy-on-primary); }

/* ------------------------------------------------------------------
 * Teacher / Student — panel header
 * ------------------------------------------------------------------ */
[data-academy-header] .panel-header__logo-box {
    display: flex;
    align-items: center;
    align-self: stretch;
}

.academy-panel-brand {
    display: inline-flex;
    align-items: center;
    height: 56px;
    border-radius: 8px;
}

.academy-panel-brand .academy-brand-logo { --logo-height: 84px; }
.academy-panel-brand .academy-brand-icon { --logo-height: 48px; }
.academy-panel-brand .academy-brand-icon { display: none; }

@media (max-width: 991.98px) {
    .academy-panel-brand { height: 48px; }
    .academy-panel-brand .academy-brand-logo { display: none !important; }
    .academy-panel-brand .academy-brand-icon { display: block; }

    /* Icon left, actions (language, notifications, profile) right. The vendor
       mobile rule makes the actions box content-width, which left it beside
       the logo with a short underline; the line spans the header instead. */
    [data-academy-header].panel-header {
        justify-content: space-between;
        border-bottom: 1px solid var(--gray-200);
    }

    [data-academy-header] .panel-header__contents {
        flex: 1 1 auto;
        min-width: 0;
        border-bottom: 0 !important;
    }
}

/* Panel sidebar: active item */
[data-academy-nav] .panel-sidebar__menu.sidenav-item-active {
    background-color: var(--academy-surface);
    border-radius: 12px;
}

[data-academy-nav] .panel-sidebar__menu.sidenav-item-active .text-primary {
    color: var(--academy-interactive-hover) !important;
}

/* ------------------------------------------------------------------
 * IFHAM auth layout (academy::auth.layout): login, register, password reset
 * ------------------------------------------------------------------ */
.academy-auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}

.academy-auth__card {
    width: 100%;
    max-width: 460px;
    padding: 32px;
    border-radius: 24px;
    box-shadow: 0 12px 40px color-mix(in srgb, var(--academy-text) 8%, transparent);
}

.academy-auth__brand {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.academy-auth__brand .academy-brand-logo { --logo-height: 120px; }

@media (max-width: 575.98px) {
    .academy-auth { padding: 16px 12px; align-items: flex-start; }
    .academy-auth__card { padding: 24px 16px; border-radius: 16px; }
    .academy-auth__brand .academy-brand-logo { --logo-height: 100px; }
}

/* Vendor auth pages built for the two-column public card. */
.academy-auth__card .pl-16 { padding-left: 0 !important; }
.academy-auth__card .pt-16 { padding-top: 0 !important; }

/* Page headings centered as on /login; form labels and inputs stay left-aligned. */
.academy-auth__card div:has(> h1.font-24) { text-align: center; }

/* Error pages (academy override of design_1.web.errors.errors). */
.academy-error-page__image { max-width: 260px; margin: 0 auto; }

/* Register: the vendor fixed-height (387px) scroll area clipped the last
   fields. In the single-column card the form grows with the page instead. */
.academy-auth__card .auth-page-form-container {
    height: auto;
    max-height: none;
    overflow: visible;
    padding-right: 0 !important;
}

.academy-auth__card .auth-page-form-container .simplebar-track { display: none; }

/* Admin login (academy override of admin.auth.new.layout): CSS-only brand
   surface instead of the theme's stock photo. */
.academy-auth-surface {
    background-color: var(--academy-surface);
    background-image:
        radial-gradient(60% 55% at 10% 15%, color-mix(in srgb, var(--academy-lavender) 24%, transparent), transparent 70%),
        radial-gradient(55% 50% at 90% 85%, color-mix(in srgb, var(--academy-secondary) 18%, transparent), transparent 70%),
        linear-gradient(180deg, var(--academy-surface) 0%, color-mix(in srgb, var(--academy-primary) 10%, var(--academy-surface)) 100%);
}

/* Admin auth pages: no vendor footer is rendered, so the brand surface fills
   the whole viewport (the vendor sizes it to 100vh minus its footer). */
.admin-auth-pages__bg.academy-auth-surface { height: 100vh; }

/* ------------------------------------------------------------------
 * Vendor logo slots fed by the site `logo` / `dark_mode_logo` settings
 * (admin login, public site header). Matched on the IFHAM files only, so a
 * different logo uploaded later through the Rocket LMS settings keeps the
 * vendor sizing.
 * ------------------------------------------------------------------ */
.admin-auth-pages__contents .content-box__logo:has(img[src$="/ifham-logo.png"]) {
    height: auto;
    display: flex;
    justify-content: center;
}

.admin-auth-pages__contents .content-box__logo img[src$="/ifham-logo.png"] {
    --logo-height: 112px;
    height: var(--logo-height);
    width: auto;
    max-width: none;
    object-fit: contain;
    margin: calc(var(--logo-height) * -0.215) 0;
}

.theme-header-1__logo img[src$="/ifham-logo.png"],
.theme-header-1__logo img[src$="/ifham-logo-light.png"] {
    --logo-height: 72px;
    height: var(--logo-height);
    width: auto;
    max-width: none;
    object-fit: contain;
    margin: calc(var(--logo-height) * -0.215) calc(var(--logo-height) * -0.203);
}

/* ------------------------------------------------------------------
 * Interactive states. Rocket's design_1 CSS already follows --primary; the
 * rules below cover the places where the vendor CSS hardcodes its own blues
 * (Stisla/Bootstrap in the admin panel) or uses the semantic --info for focus.
 * ------------------------------------------------------------------ */
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary.disabled:hover,
.btn-primary.disabled:focus {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover-border, var(--primary-hover)) !important;
}

.btn-primary:focus-visible,
.btn-outline-primary:focus-visible {
    box-shadow: 0 0 0 3px var(--academy-focus) !important;
    outline: none;
}

/* The Teacher / Student theme removes every outline (`* { outline: none !important }` in
   design_1 app.min.css), so keyboard users saw no focus at all. Keyboard focus only
   (:focus-visible), interactive elements only; mouse clicks are unaffected. */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
[role="tab"]:focus-visible,
summary:focus-visible,
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
    outline: 2px solid var(--academy-primary-dark) !important;
    outline-offset: 2px !important;
    border-radius: 2px;
}

.form-control:focus,
.custom-select:focus,
.input-group-text:focus,
.custom-file-label:focus,
.select2-container--focus .select2-selection,
.select2-container--open .select2-selection {
    border-color: var(--academy-primary-dark) !important;
    box-shadow: 0 0 0 3px var(--academy-focus) !important;
}

/* Validation keeps its semantic colors. */
.form-control.is-invalid:focus,
.was-validated .form-control:invalid:focus {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 25%, transparent) !important;
}

.form-control.is-valid:focus,
.was-validated .form-control:valid:focus {
    border-color: var(--success) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 25%, transparent) !important;
}

.custom-control-input:checked ~ .custom-control-label::before {
    border-color: var(--primary);
    background-color: var(--primary);
}

.custom-control-input:focus ~ .custom-control-label::before {
    box-shadow: 0 0 0 3px var(--academy-focus);
}

.page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
}

.page-link:focus { box-shadow: 0 0 0 3px var(--academy-focus); }

/* Stisla shadows tinted with its own blue. */
.nav-pills .nav-item .nav-link.active,
.card .card-header h4 + .card-header-action .btn.active,
.card .card-header h4 + .card-header-form .btn.active,
.accordion .accordion-header[aria-expanded="true"],
.wizard-steps .wizard-step.wizard-step-active,
.shadow-primary {
    box-shadow: 0 2px 6px var(--academy-focus);
}

::selection { background-color: var(--academy-secondary-soft); color: var(--academy-text); }

/* ==================================================================
 * Academy admin UI components (docs/academy/PORTALS.md → Admin UI patterns)
 * ================================================================== */

/* ------------------------------------------------------------------
 * Buttons — readable in every state. The vendor admin CSS gives the outline
 * buttons an `!important` text color but a non-important hover color, so a
 * hovered outline-primary button became purple text on a purple fill; other
 * outline variants turn white text onto light fills. Hover / focus / active
 * fill with a dark-enough tone and white (or dark) text; disabled buttons
 * keep their resting look.
 * ------------------------------------------------------------------ */
.btn-outline-primary:not(:disabled):not(.disabled):hover,
.btn-outline-primary:not(:disabled):not(.disabled):focus,
.btn-outline-primary:not(:disabled):not(.disabled):active,
.btn-outline-primary:not(:disabled):not(.disabled).active {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: var(--academy-on-primary) !important;
}

.btn-outline-secondary:not(:disabled):not(.disabled):hover,
.btn-outline-secondary:not(:disabled):not(.disabled):focus,
.btn-outline-secondary:not(:disabled):not(.disabled):active {
    background-color: var(--academy-ui-neutral-strong) !important;
    border-color: var(--academy-ui-neutral-strong) !important;
    color: var(--academy-ui-white) !important;
}

.btn-outline-success:not(:disabled):not(.disabled):hover,
.btn-outline-success:not(:disabled):not(.disabled):focus,
.btn-outline-success:not(:disabled):not(.disabled):active {
    background-color: var(--academy-ui-success-strong) !important;
    border-color: var(--academy-ui-success-strong) !important;
    color: var(--academy-ui-white) !important;
}

.btn-outline-danger:not(:disabled):not(.disabled):hover,
.btn-outline-danger:not(:disabled):not(.disabled):focus,
.btn-outline-danger:not(:disabled):not(.disabled):active {
    background-color: var(--academy-ui-danger-strong) !important;
    border-color: var(--academy-ui-danger-strong) !important;
    color: var(--academy-ui-white) !important;
}

.btn-outline-warning:not(:disabled):not(.disabled):hover,
.btn-outline-warning:not(:disabled):not(.disabled):focus,
.btn-outline-warning:not(:disabled):not(.disabled):active,
.btn-outline-info:not(:disabled):not(.disabled):hover,
.btn-outline-info:not(:disabled):not(.disabled):focus,
.btn-outline-info:not(:disabled):not(.disabled):active,
.btn-outline-light:not(:disabled):not(.disabled):hover,
.btn-outline-light:not(:disabled):not(.disabled):focus,
.btn-outline-light:not(:disabled):not(.disabled):active {
    color: var(--academy-ui-dark-text) !important;
}

.btn-danger:not(:disabled):not(.disabled):hover,
.btn-danger:not(:disabled):not(.disabled):focus,
.btn-danger:not(:disabled):not(.disabled):active { background-color: var(--academy-ui-danger-strong) !important; border-color: var(--academy-ui-danger-strong) !important; color: var(--academy-ui-white) !important; }

.btn-secondary:not(:disabled):not(.disabled):hover,
.btn-secondary:not(:disabled):not(.disabled):focus,
.btn-secondary:not(:disabled):not(.disabled):active { background-color: var(--academy-ui-neutral-strong) !important; border-color: var(--academy-ui-neutral-strong) !important; color: var(--academy-ui-white) !important; }

.btn:disabled,
.btn.disabled {
    opacity: .55;
    cursor: not-allowed;
    box-shadow: none !important;
}

.btn-outline-primary:disabled:hover,
.btn-outline-primary.disabled:hover,
.btn-outline-secondary:disabled:hover,
.btn-outline-secondary.disabled:hover,
.btn-outline-danger:disabled:hover,
.btn-outline-danger.disabled:hover,
.btn-outline-success:disabled:hover,
.btn-outline-success.disabled:hover { background-color: transparent !important; }

.btn-outline-secondary:disabled:hover,
.btn-outline-secondary.disabled:hover { color: var(--academy-ui-muted) !important; }

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--academy-focus) !important;
}

/* Vendor dropdown items: focus / active used white text on a white fill. */
.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--academy-surface);
    color: var(--academy-text) !important;
}

.dropdown-item:active,
.dropdown-item.active {
    background-color: var(--primary);
    color: var(--academy-on-primary) !important;
}

/* ------------------------------------------------------------------
 * Row-action menu (academy::admin.partials.row-actions)
 * ------------------------------------------------------------------ */
.academy-actions { display: inline-block; }

.academy-actions__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background-color: transparent;
    color: var(--academy-ui-neutral-strong);
    cursor: pointer;
}

.academy-actions__toggle:hover,
.academy-actions__toggle[aria-expanded="true"] {
    background-color: var(--academy-surface);
    border-color: color-mix(in srgb, var(--academy-primary) 45%, transparent);
    color: var(--academy-interactive-hover);
}

.academy-actions__toggle:focus { outline: none; }
.academy-actions__toggle:focus-visible { box-shadow: 0 0 0 3px var(--academy-focus); }

.academy-actions__menu {
    display: none;
    position: fixed;
    z-index: 1040;
    min-width: 200px;
    max-width: calc(100vw - 16px);
    padding: 6px;
    border-radius: 12px;
    background-color: var(--academy-ui-white);
    box-shadow: 0 10px 30px color-mix(in srgb, var(--academy-text) 18%, transparent), 0 0 0 1px color-mix(in srgb, var(--academy-text) 6%, transparent);
    text-align: left;
}

.academy-actions__menu.is-open { display: block; }

.academy-actions__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--academy-text);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    text-align: left;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
}

.academy-actions__item .icons { flex-shrink: 0; color: currentColor; opacity: .8; }

.academy-actions__item:hover,
.academy-actions__item:focus {
    outline: none;
    background-color: var(--academy-surface);
    color: var(--academy-interactive-hover);
    text-decoration: none;
}

.academy-actions__item:focus-visible { box-shadow: inset 0 0 0 2px var(--academy-primary-dark); }

.academy-actions__item--danger { color: var(--academy-ui-danger-text); }
.academy-actions__item--danger:hover,
.academy-actions__item--danger:focus { background-color: var(--academy-ui-danger-soft); color: var(--academy-ui-danger-strong); }

.academy-actions__item--success { color: var(--academy-ui-success-text); }
.academy-actions__item--success:hover,
.academy-actions__item--success:focus { background-color: var(--academy-ui-success-soft); color: var(--academy-ui-success-text); }

.academy-actions__separator {
    height: 1px;
    margin: 6px 4px;
    background-color: color-mix(in srgb, var(--academy-text) 10%, transparent);
}

/* ------------------------------------------------------------------
 * Academy pages: tables, badges, cards, forms
 * ------------------------------------------------------------------ */
/* The vendor makes every badge `display: flex`, so status badges stretched
   across their table cell. Badges are compact and inline. */
[data-academy-page] .badge {
    display: inline-flex;
    align-items: center;
    width: auto;
    max-width: 100%;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 16px;
    white-space: nowrap;
}

/* Status badges: soft fill + dark text (the vendor's solid fills put white
   text on light gray / light blue). Session status colors are separate. */
[data-academy-page] .badge-success { background-color: var(--academy-ui-success-soft); color: var(--academy-ui-success-text); }
[data-academy-page] .badge-info { background-color: var(--academy-ui-info-soft); color: var(--academy-ui-info-text); }
[data-academy-page] .badge-warning { background-color: var(--academy-ui-warning-soft); color: var(--academy-ui-warning-text); }
[data-academy-page] .badge-danger { background-color: var(--academy-ui-danger-soft); color: var(--academy-ui-danger-text); }
[data-academy-page] .badge-secondary,
[data-academy-page] .badge-light { background-color: var(--academy-ui-neutral-soft); color: var(--academy-ui-neutral-text); }
[data-academy-page] .badge-primary { background-color: color-mix(in srgb, var(--academy-primary) 22%, var(--academy-ui-white)); color: var(--academy-interactive-hover); }

[data-academy-page] .table td,
[data-academy-page] .table th { vertical-align: middle; }

[data-academy-page] .table th {
    color: color-mix(in srgb, var(--academy-text) 72%, transparent);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

[data-academy-page] .table .academy-col-actions { width: 1%; text-align: right; white-space: nowrap; }

/* Wide tables scroll inside their card (.table-responsive). */
[data-academy-page] .table-responsive { -webkit-overflow-scrolling: touch; }

.academy-empty {
    padding: 32px 16px;
    color: var(--academy-ui-muted);
    text-align: center;
}

.academy-empty__title { margin-bottom: 4px; color: var(--academy-text); font-weight: 600; }

/* Section headings above a group of cards. */
.academy-section-title {
    margin: 4px 0 12px;
    color: color-mix(in srgb, var(--academy-text) 65%, transparent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

/* Dashboard metric cards: one grid, equal heights, icon / label / value aligned. */
.academy-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.academy-stat {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    height: 100%;
    min-height: 96px;
    padding: 20px;
    border-radius: 12px;
    background-color: var(--academy-ui-white);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--academy-text) 6%, transparent);
    color: var(--academy-text);
}

a.academy-stat { text-decoration: none; transition: box-shadow .15s ease, transform .15s ease; }
a.academy-stat:hover { color: var(--academy-text); text-decoration: none; box-shadow: 0 8px 22px color-mix(in srgb, var(--academy-text) 12%, transparent); transform: translateY(-1px); }
a.academy-stat:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--academy-focus); }

.academy-stat__icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background-color: var(--primary);
    color: var(--academy-on-primary);
}

.academy-stat__icon--muted { background-color: var(--academy-primary-dark); }
.academy-stat__body { min-width: 0; }

.academy-stat__label {
    margin: 0 0 4px;
    color: color-mix(in srgb, var(--academy-text) 70%, transparent);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: normal;
}

.academy-stat__value { margin: 0; color: var(--academy-text); font-size: 26px; font-weight: 700; line-height: 1.1; }

@media (max-width: 1199.98px) {
    .academy-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}

@media (max-width: 575.98px) {
    .academy-stat-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-bottom: 20px; }
    .academy-stat { min-height: 76px; padding: 14px 16px; }
    .academy-stat__icon { width: 44px; height: 44px; }
    .academy-stat__icon .icons { width: 22px; height: 22px; }
    .academy-stat__value { font-size: 22px; }
}

/* Forms: a readable measure on wide screens, full width on phones. */
.academy-form { max-width: 960px; }
.academy-form--narrow { max-width: 640px; }
.academy-form .card-header h4 { font-size: 16px; }
.academy-form .form-group { margin-bottom: 20px; }
.academy-form .input-label { font-weight: 600; }
.academy-form .form-text { line-height: 1.45; }

.academy-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

@media (max-width: 575.98px) {
    .academy-form-actions .btn { flex: 1 1 auto; }
}

/* Weekly slot rows (New schedule): one header row, aligned columns. */
.academy-slot-head {
    color: color-mix(in srgb, var(--academy-text) 70%, transparent);
    font-size: 12px;
    font-weight: 600;
}

.academy-actions__button { display: inline-flex; align-items: center; gap: 6px; }

/* Course Content: compact reorder buttons in a fixed slot beside the row menus. */
.academy-move { display: inline-flex; justify-content: flex-end; gap: 6px; min-width: 70px; }
.academy-move-btn { min-width: 32px; padding-left: 8px; padding-right: 8px; }

/* Searchable pickers (select2) match the 48px inputs of the filter rows. */
[data-academy-page] .select2-container .select2-selection--single {
    height: 48px;
    padding-top: 2px;
    padding-bottom: 2px;
}

[data-academy-page] .select2-container .select2-selection--single .select2-selection__rendered { line-height: 42px; }
[data-academy-page] .select2-container .select2-selection--single .select2-selection__arrow { height: 46px; }
/* The closed language menu must not widen the page beyond the header. */
.language-select .language-dropdown { left: auto !important; right: 0 !important; }
.rtl .language-select .language-dropdown { left: 0 !important; right: auto !important; }

/* Table avatars keep their round shape when the name column is narrow. */
.table td img.rounded-circle { flex-shrink: 0; }

/* An open picker stays above the fields below it (the vendor stylesheet gives every picker the same z-index). */
.select2-container.select2-container--open { z-index: 1060 !important; }

/* Solid semantic buttons on Academy pages: the vendor fills put white text on
   a light red (3.2:1) and a light orange (2:1). */
[data-academy-page] .btn-danger:not(:disabled):not(.disabled) {
    background-color: var(--academy-ui-danger-strong) !important;
    border-color: var(--academy-ui-danger-strong) !important;
    color: var(--academy-ui-white) !important;
}

[data-academy-page] .btn-danger:not(:disabled):not(.disabled):hover,
[data-academy-page] .btn-danger:not(:disabled):not(.disabled):focus { background-color: var(--academy-ui-danger-text) !important; }

[data-academy-page] .btn-warning,
[data-academy-page] .btn-warning:hover,
[data-academy-page] .btn-warning:focus { color: var(--academy-ui-dark-text) !important; }

/* ------------------------------------------------------------------
 * Public informational website (Q8; docs/academy/PORTALS.md): the header,
 * footer and page frame that replace the vendor marketplace ones.
 * ------------------------------------------------------------------ */
.academy-public-header {
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-200);
}

.academy-public-header__logo {
    display: block;
}

.academy-public-header__logo .academy-brand-logo {
    --logo-height: 64px;
}

.academy-public-header__nav {
    gap: 16px;
}

.academy-public-page {
    padding-top: 40px;
    padding-bottom: 56px;
}

.academy-public-hero {
    padding: 48px 24px;
    border-radius: 24px;
}

.academy-public-hero h1 {
    font-size: 32px;
    line-height: 1.25;
}

.academy-public-hero p {
    max-width: 560px;
    margin: 16px auto 0;
}

.academy-public-hero__actions {
    gap: 12px;
    margin-top: 24px;
}

.academy-public-facts {
    margin-top: 8px;
}

.academy-public-facts > div {
    margin-top: 16px;
}

.academy-public-fact {
    padding: 24px;
    border-radius: 16px;
}

.academy-public-fact p {
    margin-top: 8px;
}

.academy-public-footer {
    padding: 20px 0;
    border-top: 1px solid var(--gray-200);
}

.academy-public-footer .container {
    gap: 12px;
}

.academy-public-footer__nav {
    gap: 16px;
}
