/* ======================================================================
   Moroccan Red Crescent — Unified Operational Portal Shell V3
   Base source of truth remains: static/akcel/css/style.css
   This file only normalizes the operational portal chrome:
   hero, sidebar, grouped application navigation and working-office picker.
   ====================================================================== */

:root {
    --mrc-portal-red: #b42318;
    --mrc-portal-red-strong: #8f1d17;
    --mrc-portal-red-deep: #731611;
    --mrc-portal-red-soft: #fff1f0;
    --mrc-portal-ink: #101828;
    --mrc-portal-text: #344054;
    --mrc-portal-muted: #667085;
    --mrc-portal-muted-2: #98a2b3;
    --mrc-portal-line: #eaecf0;
    --mrc-portal-line-strong: #d0d5dd;
    --mrc-portal-canvas: #f6f7f9;
    --mrc-portal-surface: #ffffff;
    --mrc-portal-surface-soft: #f9fafb;
    --mrc-portal-shadow: 0 12px 34px rgba(16, 24, 40, 0.06);
    --mrc-portal-shadow-soft: 0 7px 22px rgba(16, 24, 40, 0.045);
    --mrc-portal-radius: 16px;
    --mrc-portal-radius-sm: 10px;
}

/* Prevent app-level legacy rules from producing horizontal overflow. */
body.mrc-portal-shell-v2,
body.mrc-portal-shell-v2 .page-wraper,
body.mrc-portal-shell-v2 .page-content,
body.mrc-portal-shell-v2 .h27-portal {
    max-width: 100%;
    overflow-x: clip;
}

.h27-portal.portal-shell-ready {
    --h27-red: var(--mrc-portal-red);
    --h27-red-dark: var(--mrc-portal-red-strong);
    --h27-red-deep: var(--mrc-portal-red-deep);
    --h27-red-soft: var(--mrc-portal-red-soft);
    --h27-text: var(--mrc-portal-text);
    --h27-muted: var(--mrc-portal-muted);
    --h27-border: var(--mrc-portal-line);
    --h27-bg: var(--mrc-portal-canvas);
    --h27-card: var(--mrc-portal-surface);
    --h27-shadow: var(--mrc-portal-shadow);
    color: var(--mrc-portal-text);
    background: var(--mrc-portal-canvas);
}

.h27-portal.portal-shell-ready *,
.h27-portal.portal-shell-ready *::before,
.h27-portal.portal-shell-ready *::after {
    box-sizing: border-box;
}

/* ----------------------------------------------------------------------
   One hero language for every operational app.
   The JS adds corr-portal-hero + portal-shell-hero to existing h27 heroes.
   ---------------------------------------------------------------------- */
.h27-portal.portal-shell-ready .h27-hero.portal-shell-hero,
.h27-portal.portal-shell-ready .h27-hero.corr-portal-hero {
    position: relative;
    overflow: hidden;
    padding: 136px 0 36px;
    color: #fff;
    background:
        radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.13), transparent 29%),
        linear-gradient(125deg, #731611 0%, #941d17 46%, #b42318 100%);
}

.h27-portal.portal-shell-ready .h27-hero.portal-shell-hero::before,
.h27-portal.portal-shell-ready .h27-hero.portal-shell-hero::after {
    content: "";
    position: absolute;
    pointer-events: none;
    border-radius: 999px;
}

.h27-portal.portal-shell-ready .h27-hero.portal-shell-hero::before {
    width: 230px;
    height: 230px;
    inset-inline-start: -72px;
    bottom: -150px;
    border: 34px solid rgba(255, 255, 255, 0.06);
}

.h27-portal.portal-shell-ready .h27-hero.portal-shell-hero::after {
    width: 155px;
    height: 155px;
    inset-inline-end: 8%;
    top: -75px;
    background: rgba(255, 255, 255, 0.05);
}

.h27-portal.portal-shell-ready .h27-hero > .container,
.h27-portal.portal-shell-ready .h27-content-section > .container {
    width: min(96%, 1540px);
    max-width: 1540px;
}

.h27-portal.portal-shell-ready .h27-hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 300px);
    gap: 28px;
    align-items: center;
}

.h27-portal.portal-shell-ready .h27-kicker,
.h27-portal.portal-shell-ready .h27-eyebrow {
    margin-bottom: 9px;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
}

.h27-portal.portal-shell-ready .h27-title {
    max-width: 900px;
    margin: 0 0 8px;
    color: #fff;
    font-size: clamp(1.65rem, 2.7vw, 2.45rem);
    font-weight: 850;
    line-height: 1.25;
}

.h27-portal.portal-shell-ready .h27-subtitle {
    max-width: 920px;
    margin: 0;
    color: rgba(255, 255, 255, 0.84);
    font-size: 0.86rem;
    line-height: 1.75;
}

.h27-portal.portal-shell-ready .h27-user-card,
.h27-portal.portal-shell-ready :is(
    .corr-current-unit,
    .members-mgmt-current-unit,
    .discipline-current-unit,
    .vp-current-unit
) {
    border: 1px solid rgba(255, 255, 255, 0.21);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.10);
    box-shadow: 0 10px 24px rgba(53, 5, 8, 0.11);
    backdrop-filter: blur(8px);
}

.h27-portal.portal-shell-ready .h27-user-card {
    gap: 11px;
    padding: 13px 14px;
}

.h27-portal.portal-shell-ready .h27-user-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 11px;
}

.h27-portal.portal-shell-ready :is(
    .corr-hero-side,
    .members-mgmt-hero-side,
    .discipline-hero-side,
    .vp-hero-side
) {
    display: grid;
    gap: 9px;
    min-width: 0;
}

.h27-portal.portal-shell-ready :is(
    .corr-current-unit,
    .members-mgmt-current-unit,
    .discipline-current-unit,
    .vp-current-unit
) {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 13px;
    color: #fff;
}

.h27-portal.portal-shell-ready :is(
    .corr-current-unit,
    .members-mgmt-current-unit,
    .discipline-current-unit,
    .vp-current-unit
) span {
    font-size: 0.68rem;
    opacity: 0.8;
}

.h27-portal.portal-shell-ready :is(
    .corr-current-unit,
    .members-mgmt-current-unit,
    .discipline-current-unit,
    .vp-current-unit
) strong {
    overflow: hidden;
    font-size: 0.80rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ----------------------------------------------------------------------
   Main layout and sidebar.
   ---------------------------------------------------------------------- */
.h27-portal.portal-shell-ready .h27-content-section {
    min-height: 620px;
    padding: 24px 0 58px;
    background: linear-gradient(180deg, #f2f4f7 0, var(--mrc-portal-canvas) 160px, #fff 100%);
}

.h27-portal.portal-shell-ready .h27-layout {
    display: grid;
    grid-template-columns: minmax(250px, 278px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.h27-portal.portal-shell-ready .h27-main {
    min-width: 0;
}

.h27-portal.portal-shell-ready .h27-sidebar {
    position: sticky;
    top: 96px;
    align-self: start;
    overflow: hidden;
    min-width: 0;
    border: 1px solid var(--mrc-portal-line);
    border-radius: var(--mrc-portal-radius);
    background: var(--mrc-portal-surface);
    box-shadow: var(--mrc-portal-shadow);
}

.h27-portal.portal-shell-ready .h27-sidebar-title {
    display: flex;
    gap: 9px;
    align-items: center;
    padding: 14px 15px;
    color: #fff;
    background: linear-gradient(135deg, var(--mrc-portal-red-strong), var(--mrc-portal-red));
    font-size: 0.84rem;
    font-weight: 850;
}

.h27-portal.portal-shell-ready .h27-sidebar-title :is(svg, i) {
    flex: 0 0 auto;
}

.h27-portal.portal-shell-ready .h27-sidebar-actions {
    padding: 9px 9px 0;
}

.h27-portal.portal-shell-ready .h27-sidebar-action {
    min-height: 40px;
    padding: 8px 10px;
    border-radius: 9px;
    font-size: 0.77rem;
}

/* ----------------------------------------------------------------------
   Unified "working office" control.
   Existing domain switch endpoints remain untouched; only the presentation
   is normalized. Future applications can use .portal-working-office.
   ---------------------------------------------------------------------- */
.h27-portal.portal-shell-ready :is(
    .portal-working-office,
    .corr-unit-switch,
    .members-unit-switch,
    .discipline-unit-switch,
    .vp-unit-switch
) {
    margin: 11px 9px 8px;
    padding: 11px;
    border: 1px solid var(--mrc-portal-line);
    border-radius: 12px;
    background: var(--mrc-portal-surface-soft);
}

.h27-portal.portal-shell-ready :is(
    .portal-working-office,
    .corr-unit-switch,
    .members-unit-switch,
    .discipline-unit-switch,
    .vp-unit-switch
) label {
    display: block;
    margin: 0 0 7px;
    color: var(--mrc-portal-muted);
    font-size: 0.69rem;
    font-weight: 800;
}

.h27-portal.portal-shell-ready :is(
    .corr-unit-switch-row,
    .members-unit-switch-row,
    .discipline-unit-switch-row,
    .vp-unit-switch-row,
    .portal-working-office-row
) {
    display: flex;
    gap: 7px;
    align-items: stretch;
    min-width: 0;
}

.h27-portal.portal-shell-ready :is(
    .portal-working-office,
    .corr-unit-switch,
    .members-unit-switch,
    .discipline-unit-switch,
    .vp-unit-switch
) select {
    width: 100%;
    min-width: 0;
    min-height: 39px;
    flex: 1 1 auto;
    padding: 7px 10px;
    border: 1px solid var(--mrc-portal-line-strong);
    border-radius: 9px;
    background-color: #fff;
    color: var(--mrc-portal-text);
    font: inherit;
    font-size: 0.75rem;
    box-shadow: none;
}

.h27-portal.portal-shell-ready :is(
    .portal-working-office,
    .corr-unit-switch,
    .members-unit-switch,
    .discipline-unit-switch,
    .vp-unit-switch
) select:focus {
    border-color: #e6a8a3;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.08);
}

.h27-portal.portal-shell-ready :is(
    .portal-working-office,
    .corr-unit-switch,
    .members-unit-switch,
    .discipline-unit-switch,
    .vp-unit-switch
) button {
    display: inline-grid;
    width: 39px;
    min-width: 39px;
    min-height: 39px;
    place-items: center;
    padding: 0;
    border: 1px solid var(--mrc-portal-line-strong);
    border-radius: 9px;
    background: #fff;
    color: var(--mrc-portal-red);
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.h27-portal.portal-shell-ready :is(
    .portal-working-office,
    .corr-unit-switch,
    .members-unit-switch,
    .discipline-unit-switch,
    .vp-unit-switch
) button:hover,
.h27-portal.portal-shell-ready :is(
    .portal-working-office,
    .corr-unit-switch,
    .members-unit-switch,
    .discipline-unit-switch,
    .vp-unit-switch
) button:focus-visible {
    border-color: #e9b9b5;
    background: var(--mrc-portal-red-soft);
    transform: translateY(-1px);
}

/* ----------------------------------------------------------------------
   Global application navigation (server-rendered, injected into sidebar).
   ---------------------------------------------------------------------- */
.portal-global-navigation {
    padding: 8px 8px 2px;
    border-top: 1px solid var(--mrc-portal-line);
    border-bottom: 1px solid var(--mrc-portal-line);
    background: #fff;
}

.portal-global-nav-title,
.portal-local-nav-heading {
    display: flex;
    gap: 8px;
    align-items: center;
    min-height: 34px;
    padding: 5px 7px;
    color: var(--mrc-portal-muted);
    font-size: 0.68rem;
    font-weight: 850;
    letter-spacing: 0.01em;
}

.portal-global-nav-title-icon {
    display: inline-grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 7px;
    background: var(--mrc-portal-red-soft);
    color: var(--mrc-portal-red);
}

.portal-nav-groups {
    display: grid;
    gap: 5px;
    padding-bottom: 6px;
}

.portal-nav-group {
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: 10px;
    background: #fff;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.portal-nav-group.is-active,
.portal-nav-group:has(.portal-nav-item.is-active) {
    border-color: #f1d0cd;
    background: #fffafa;
}

.portal-nav-group-toggle {
    display: grid;
    width: 100%;
    min-height: 42px;
    grid-template-columns: 28px minmax(0, 1fr) 18px;
    gap: 8px;
    align-items: center;
    padding: 7px 8px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--mrc-portal-text);
    text-align: start;
    cursor: pointer;
    font: inherit;
    font-size: 0.76rem;
    font-weight: 820;
}

.portal-nav-group-toggle:hover,
.portal-nav-group-toggle:focus-visible {
    background: var(--mrc-portal-surface-soft);
    color: var(--mrc-portal-red);
    outline: 0;
}

.portal-nav-group-icon,
.portal-nav-item-icon {
    display: inline-grid;
    place-items: center;
    color: var(--mrc-portal-red);
    background: var(--mrc-portal-red-soft);
}

.portal-nav-group-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: 0.73rem;
}

.portal-nav-group-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-nav-group-chevron {
    display: inline-grid;
    place-items: center;
    color: var(--mrc-portal-muted-2);
    font-size: 0.62rem;
    transition: transform 0.18s ease;
}

.portal-nav-group[open] > .portal-nav-group-toggle .portal-nav-group-chevron {
    transform: rotate(180deg);
}

.portal-nav-group-items {
    display: grid;
    gap: 2px;
    padding: 0 7px 7px 43px;
}

[dir="rtl"] .portal-nav-group-items {
    padding-right: 43px;
    padding-left: 7px;
}


.portal-nav-item {
    display: grid;
    min-height: 38px;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    padding: 6px 8px;
    border-radius: 8px;
    color: #596273;
    font-size: 0.72rem;
    font-weight: 720;
    text-decoration: none !important;
    transition: background-color 0.14s ease, color 0.14s ease, transform 0.14s ease;
}

.portal-nav-item-icon {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    font-size: 0.66rem;
}

.portal-nav-item:hover,
.portal-nav-item:focus-visible,
.portal-nav-item.is-active {
    color: var(--mrc-portal-red);
    background: var(--mrc-portal-red-soft);
    outline: 0;
}

.portal-nav-item.is-active {
    font-weight: 850;
}

.portal-local-nav-heading {
    margin: 5px 8px 0;
    padding-top: 8px;
    border-top: 1px solid var(--mrc-portal-line);
}

/* Existing app navigation is retained for feature-completeness. Cross-app
   links are hidden by JS because the grouped global menu owns app switching. */
.h27-portal.portal-shell-ready .h27-nav {
    gap: 3px;
    padding: 7px 8px 9px;
}

.h27-portal.portal-shell-ready .h27-nav a {
    min-height: 40px;
    gap: 9px;
    padding: 7px 9px;
    border-radius: 9px;
    color: #596273;
    font-size: 0.76rem;
    font-weight: 740;
}

.h27-portal.portal-shell-ready .h27-nav a:hover,
.h27-portal.portal-shell-ready .h27-nav a:focus-visible,
.h27-portal.portal-shell-ready .h27-nav a.is-active {
    color: var(--mrc-portal-red);
    background: var(--mrc-portal-red-soft);
}

.h27-portal.portal-shell-ready .h27-nav-icon {
    width: 25px;
    height: 25px;
    flex: 0 0 25px;
    border-radius: 7px;
    font-size: 0.72rem;
}

.portal-nav-external-legacy,
.portal-nav-empty,
.portal-legacy-related-divider {
    display: none !important;
}

.h27-portal.portal-shell-ready .h27-sidebar-note {
    margin: 7px 9px 10px;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--mrc-portal-line);
    background: var(--mrc-portal-surface-soft);
    color: var(--mrc-portal-muted);
    font-size: 0.70rem;
    line-height: 1.65;
}

.h27-portal.portal-shell-ready .h27-sidebar-note strong {
    display: block;
    margin-bottom: 3px;
    color: var(--mrc-portal-text);
    font-size: 0.72rem;
}

/* Search blocks in app sidebars use the same geometry. */
.h27-portal.portal-shell-ready :is(
    .corr-sidebar-search,
    .training-sidebar-search,
    .h216-sidebar-search
) {
    margin: 8px 9px;
}

.h27-portal.portal-shell-ready :is(
    .corr-sidebar-search,
    .training-sidebar-search,
    .h216-sidebar-search
) form {
    display: flex;
    gap: 6px;
    align-items: stretch;
}

.h27-portal.portal-shell-ready :is(
    .corr-sidebar-search,
    .training-sidebar-search,
    .h216-sidebar-search
) input {
    min-width: 0;
    min-height: 38px;
    flex: 1 1 auto;
    border-radius: 9px;
    font-size: 0.74rem;
}

.h27-portal.portal-shell-ready :is(
    .corr-sidebar-search,
    .training-sidebar-search,
    .h216-sidebar-search
) button {
    width: 38px;
    min-width: 38px;
    border-radius: 9px;
}

/* Main surfaces: keep app design, normalize edge cases. */
.h27-portal.portal-shell-ready :is(.h27-card, .corr-card, .ops-card, .projects-card, .finance-card, .ga-card, .att-card) {
    max-width: 100%;
}

.h27-portal.portal-shell-ready :is(.table-responsive, .corr-table-wrap, .ops-table-wrap, .projects-table-wrap, .finance-table-wrap) {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.h27-portal.portal-shell-ready table {
    max-width: 100%;
}

.h27-portal.portal-shell-ready :is(input, select, textarea, button) {
    max-width: 100%;
}

/* ----------------------------------------------------------------------
   Desktop and wide-screen tuning.
   ---------------------------------------------------------------------- */
@media (min-width: 1480px) {
    .h27-portal.portal-shell-ready .h27-layout {
        grid-template-columns: 282px minmax(0, 1fr);
        gap: 24px;
    }

    .portal-nav-group-toggle {
        font-size: 0.78rem;
    }

    .portal-nav-item {
        font-size: 0.74rem;
    }
}

@media (max-width: 1279.98px) {
    .h27-portal.portal-shell-ready .h27-layout {
        grid-template-columns: 242px minmax(0, 1fr);
        gap: 16px;
    }

    .h27-portal.portal-shell-ready .h27-hero-grid {
        grid-template-columns: minmax(0, 1fr) 250px;
        gap: 20px;
    }
}

/* ----------------------------------------------------------------------
   Tablet: sidebar becomes an in-flow control panel above page content.
   ---------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    .h27-portal.portal-shell-ready .h27-hero.portal-shell-hero {
        padding-top: 116px;
        padding-bottom: 28px;
    }

    .h27-portal.portal-shell-ready .h27-hero-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .h27-portal.portal-shell-ready :is(
        .corr-hero-side,
        .members-mgmt-hero-side,
        .discipline-hero-side,
        .vp-hero-side
    ) {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .h27-portal.portal-shell-ready .h27-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .h27-portal.portal-shell-ready .h27-sidebar {
        position: relative;
        top: auto;
        width: 100%;
    }

    .portal-nav-groups {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    .portal-nav-group-items {
        padding-inline-start: 39px;
    }

    .portal-local-nav-heading {
        margin-top: 7px;
    }

    .h27-portal.portal-shell-ready .h27-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .h27-portal.portal-shell-ready .h27-sidebar-note {
        margin-bottom: 12px;
    }
}

/* ----------------------------------------------------------------------
   Phones.
   ---------------------------------------------------------------------- */
@media (max-width: 767.98px) {
    .h27-portal.portal-shell-ready .h27-hero.portal-shell-hero {
        padding-top: 104px;
        padding-bottom: 24px;
    }

    .h27-portal.portal-shell-ready .h27-hero > .container,
    .h27-portal.portal-shell-ready .h27-content-section > .container {
        width: min(100% - 24px, 1540px);
    }

    .h27-portal.portal-shell-ready .h27-title {
        font-size: clamp(1.38rem, 7vw, 1.85rem);
        line-height: 1.3;
    }

    .h27-portal.portal-shell-ready .h27-subtitle {
        font-size: 0.80rem;
        line-height: 1.7;
    }

    .h27-portal.portal-shell-ready :is(
        .corr-hero-side,
        .members-mgmt-hero-side,
        .discipline-hero-side,
        .vp-hero-side
    ) {
        grid-template-columns: 1fr;
    }

    .h27-portal.portal-shell-ready .h27-user-card {
        min-width: 0;
    }

    .h27-portal.portal-shell-ready .h27-content-section {
        padding-top: 16px;
        padding-bottom: 38px;
    }

    .h27-portal.portal-shell-ready .h27-sidebar {
        border-radius: 14px;
    }

    .portal-nav-groups,
    .h27-portal.portal-shell-ready .h27-nav {
        grid-template-columns: 1fr;
    }

    .portal-nav-group-toggle,
    .portal-nav-item,
    .h27-portal.portal-shell-ready .h27-nav a,
    .h27-portal.portal-shell-ready .h27-sidebar-action {
        min-height: 44px;
    }

    .portal-nav-group-items {
        padding-inline-start: 38px;
    }

    .h27-portal.portal-shell-ready :is(
        .portal-working-office,
        .corr-unit-switch,
        .members-unit-switch,
        .discipline-unit-switch,
        .vp-unit-switch
    ) {
        margin-inline: 8px;
    }

    .h27-portal.portal-shell-ready :is(
        .corr-unit-switch-row,
        .members-unit-switch-row,
        .discipline-unit-switch-row,
        .vp-unit-switch-row,
        .portal-working-office-row
    ) {
        gap: 6px;
    }

    .h27-portal.portal-shell-ready :is(
        .portal-working-office,
        .corr-unit-switch,
        .members-unit-switch,
        .discipline-unit-switch,
        .vp-unit-switch
    ) select {
        min-height: 44px;
        font-size: 0.78rem;
    }

    .h27-portal.portal-shell-ready :is(
        .portal-working-office,
        .corr-unit-switch,
        .members-unit-switch,
        .discipline-unit-switch,
        .vp-unit-switch
    ) button {
        width: 44px;
        min-width: 44px;
        min-height: 44px;
    }
}

@media (max-width: 575.98px) {
    .h27-portal.portal-shell-ready .h27-hero.portal-shell-hero {
        padding-top: 94px;
    }

    .h27-portal.portal-shell-ready .h27-hero > .container,
    .h27-portal.portal-shell-ready .h27-content-section > .container {
        width: min(100% - 18px, 1540px);
    }

    .h27-portal.portal-shell-ready .h27-sidebar-title {
        padding: 13px;
    }

    .portal-global-navigation {
        padding-inline: 6px;
    }

    .portal-nav-group-toggle {
        grid-template-columns: 27px minmax(0, 1fr) 18px;
        padding-inline: 7px;
    }

    .portal-nav-group-items,
    [dir="rtl"] .portal-nav-group-items {
        padding-inline-start: 34px;
        padding-inline-end: 5px;
    }

    .h27-portal.portal-shell-ready .h27-user-card {
        padding: 11px 12px;
    }

    .h27-portal.portal-shell-ready .h27-user-icon {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }
}

/* Arabic is finalized by akcel/css/arabic.css, loaded after this file. */
html[dir="rtl"] .portal-nav-group-toggle,
html[dir="rtl"] .portal-nav-item,
html[dir="rtl"] .portal-global-nav-title,
html[dir="rtl"] .portal-local-nav-heading {
    text-align: right;
}

html[dir="ltr"] .portal-nav-group-toggle,
html[dir="ltr"] .portal-nav-item,
html[dir="ltr"] .portal-global-nav-title,
html[dir="ltr"] .portal-local-nav-heading {
    text-align: left;
}

@media (prefers-reduced-motion: reduce) {
    .portal-nav-group-chevron,
    .portal-nav-item,
    .portal-nav-group-toggle,
    .h27-portal.portal-shell-ready .h27-nav a,
    .h27-portal.portal-shell-ready :is(.corr-unit-switch,.members-unit-switch,.discipline-unit-switch,.vp-unit-switch) button {
        transition: none !important;
    }
}


/* V3: server-rendered grouped navigation, visible without JavaScript. */
.portal-nav-group > summary {
    list-style: none;
}
.portal-nav-group > summary::-webkit-details-marker {
    display: none;
}
.portal-nav-group:not([open]) > .portal-nav-group-items {
    display: none;
}
.portal-nav-group[open] > .portal-nav-group-items {
    display: grid;
}
.portal-local-nav-heading-icon {
    display: inline-grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 7px;
    background: #f2f4f7;
    color: var(--mrc-portal-muted);
}

/* Make the structural redesign unmistakable and consistent across apps. */
.h27-portal.portal-shell-ready .h27-layout {
    align-items: start;
}
.h27-portal.portal-shell-ready .h27-sidebar {
    position: sticky;
    top: 96px;
    overflow: hidden;
    border: 1px solid var(--mrc-portal-line);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--mrc-portal-shadow-soft);
}
.h27-portal.portal-shell-ready .h27-sidebar-title {
    margin: 0;
    padding: 14px 14px 10px;
    border-bottom: 1px solid var(--mrc-portal-line);
    background: linear-gradient(180deg, #fff 0%, #fcfcfd 100%);
}
.h27-portal.portal-shell-ready .h27-sidebar-actions,
.h27-portal.portal-shell-ready .portal-working-office,
.h27-portal.portal-shell-ready .h216-sidebar-search,
.h27-portal.portal-shell-ready .corr-sidebar-search {
    margin-inline: 10px;
}
.h27-portal.portal-shell-ready .h27-sidebar > nav.h27-nav {
    padding: 6px 9px 10px;
}
.h27-portal.portal-shell-ready .h27-sidebar > nav.h27-nav a {
    border-radius: 10px;
}
.h27-portal.portal-shell-ready .h27-sidebar > nav.h27-nav a.is-active {
    background: var(--mrc-portal-red-soft);
    color: var(--mrc-portal-red);
}
.portal-nav-external-legacy,
.portal-nav-empty,
.portal-legacy-related-divider {
    display: none !important;
}

/* Correspondence-like working office selector contract. */
.h27-portal.portal-shell-ready .portal-working-office {
    margin-top: 10px;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid var(--mrc-portal-line);
    border-radius: 12px;
    background: var(--mrc-portal-surface-soft);
}
.h27-portal.portal-shell-ready .portal-working-office > label {
    display: block;
    margin: 0 0 7px;
    font-size: .72rem;
    font-weight: 800;
    color: var(--mrc-portal-muted);
}
.h27-portal.portal-shell-ready .portal-working-office-row {
    display: flex;
    gap: 7px;
    align-items: stretch;
}
.h27-portal.portal-shell-ready .portal-working-office-row select {
    min-width: 0;
    flex: 1 1 auto;
    min-height: 42px;
}
.h27-portal.portal-shell-ready .portal-working-office-row button {
    flex: 0 0 42px;
    width: 42px;
    min-height: 42px;
}

@media (max-width: 1199.98px) {
    .h27-portal.portal-shell-ready .h27-sidebar {
        top: 82px;
    }
}

@media (max-width: 991.98px) {
    .h27-portal.portal-shell-ready .h27-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }
    .h27-portal.portal-shell-ready .h27-sidebar {
        position: static;
        width: 100%;
    }
    .portal-nav-groups {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .portal-nav-group.is-active {
        grid-column: span 2;
    }
}

@media (max-width: 767.98px) {
    .h27-portal.portal-shell-ready .h27-hero.portal-shell-hero,
    .h27-portal.portal-shell-ready .h27-hero.corr-portal-hero {
        padding-top: 108px;
        padding-bottom: 26px;
    }
    .h27-portal.portal-shell-ready .h27-hero-grid {
        gap: 16px;
    }
    .portal-nav-groups {
        grid-template-columns: 1fr;
    }
    .portal-nav-group.is-active {
        grid-column: auto;
    }
    .portal-nav-group-toggle,
    .portal-nav-item,
    .h27-portal.portal-shell-ready .h27-nav a {
        min-height: 46px;
    }
}

@media (max-width: 575.98px) {
    .h27-portal.portal-shell-ready .h27-content-section > .container,
    .h27-portal.portal-shell-ready .h27-hero > .container {
        padding-inline: 14px;
    }
    .h27-portal.portal-shell-ready .h27-sidebar {
        border-radius: 14px;
    }
    .portal-global-navigation {
        padding-inline: 7px;
    }
}
