:root {
    --aeci-corporate-red: #C00000;
    --red: var(--aeci-corporate-red);
    font-family: Calibri, "Segoe UI", Arial, sans-serif;
}
html body {
    font-family: Calibri, "Segoe UI", Arial, sans-serif;
}
button, input, select, textarea {
    font-family: inherit;
}
body .hub-hero {
    background: linear-gradient(115deg, #8b0000, var(--aeci-corporate-red) 70%, #d40a0a);
}
body #app-grid .app-actions .launch {
    background: var(--aeci-corporate-red);
    color: white;
}
body #app-grid .app-actions .launch:disabled {
    opacity: .65;
}
.sap-environment-picker {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin: 1rem 0;
}
.sap-environment-picker select,
.rbac-admin select, .rbac-admin input:not([type=checkbox]) {
    padding: .55rem .65rem;
    border: 1px solid #bfb9b9;
    border-radius: .4rem;
    background: white;
    color: #222;
    min-width: 0;
}
.rbac-admin {
    margin: 1.75rem 0;
    padding: 1rem;
    border: 1px solid #dfd7d7;
    border-radius: .75rem;
    background: #fff;
}
.rbac-admin summary {
    cursor: pointer;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--aeci-corporate-red);
}
.rbac-forms {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 235px), 1fr));
    gap: 1rem;
}
.rbac-forms form {
    display: grid;
    align-content: start;
    gap: .75rem;
    min-width: 0;
}
.rbac-forms form label {
    display: grid;
    gap: .25rem;
}
.rbac-forms form .rbac-check {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.rbac-forms h4 { margin: .5rem 0 0; }
.rbac-admin button {
    cursor: pointer;
    border: 1px solid var(--aeci-corporate-red);
    border-radius: .45rem;
    padding: .5rem .7rem;
    color: white;
    background: var(--aeci-corporate-red);
}
.rbac-admin button:disabled { opacity: .65; }
#rbac-assignments {
    list-style: none;
    padding: 0;
}
#rbac-assignments li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .5rem 0;
    border-bottom: 1px solid #eee;
}
.sap-environment-badge {
    display: inline-block;
    margin-top: .3rem;
    color: var(--aeci-corporate-red);
    font-weight: 700;
}

.sidebar .admin-submenu[hidden],
#admin-view [data-admin-panel][hidden] {
    display: none;
}
.sidebar .admin-submenu {
    display: grid;
    gap: .2rem;
    margin: .25rem 0 .5rem .65rem;
    padding-left: .55rem;
    border-left: 2px solid var(--aeci-corporate-red);
}
.sidebar nav .admin-submenu button {
    display: flex;
    align-items: center;
    gap: .35rem;
    padding-inline: .45rem .25rem;
    text-align: left;
    font-size: .8rem;
    white-space: nowrap;
}
.sidebar nav .admin-submenu .menu-icon {
    flex-basis: 1.15em;
    width: 1.15em;
    margin-inline-end: 0;
}
#hub-overview[hidden], #apps-view[hidden], #sap-environment-field[hidden],
.directory-picker[hidden], #admin-form label[hidden] { display: none; }

#hub-overview { margin-top: 1.5rem; }
#hub-overview h2, #rbac-admin h3 { margin: 0; }
#hub-overview p, #rbac-admin form p { color: #56565c; }
.workspace-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
    gap: 1rem;
}
.workspace-links button {
    display: grid;
    text-align: left;
    gap: .5rem;
    padding: 1.25rem;
    border: 1px solid #e3dada;
    border-top: 3px solid #c00000;
    border-radius: .75rem;
    background: #fff;
    color: #242428;
    cursor: pointer;
}
.workspace-links button:hover, .workspace-links button:focus-visible { border-color: #c00000; }
.workspace-links strong { font-size: 1.18rem; }
#rbac-admin { border: 0; padding: 0; margin-top: 1rem; }
#rbac-admin .rbac-forms { grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); }
#rbac-admin .rbac-forms form {
    grid-template-rows: auto auto;
    align-content: start;
    padding: 1rem;
    border: 1px solid #e3dada;
    border-radius: .75rem;
    background: #fff;
}
#rbac-admin .rbac-forms form p { margin: 0 0 .2rem; min-height: 2.5em; }
#rbac-admin .rbac-forms button { justify-self: start; }
.directory-picker {
    display: grid;
    gap: .5rem;
    padding: .8rem;
    border: 1px solid #e8dede;
    border-radius: .55rem;
    background: #fffafa;
    min-width: 0;
}
.directory-picker button[data-directory-search] {
    justify-self: start;
    padding: .5rem .8rem;
    border: 1px solid #c00000;
    border-radius: .4rem;
    background: #fff;
    color: #a40000;
    cursor: pointer;
}
.directory-picker select { max-width: 100%; }
.directory-picker p { margin: 0; }
#admin-form .directory-picker { grid-column: 1 / -1; }


#rbac-admin #principal-display-name[hidden] { display: none; }

.directory-results[hidden] { display: none; }
.directory-results {
    display: grid;
    gap: .35rem;
    margin: .15rem 0;
    padding: 0;
    list-style: none;
}
#rbac-admin .directory-results button {
    display: grid;
    gap: .2rem;
    width: 100%;
    padding: .6rem .75rem;
    text-align: left;
    overflow-wrap: anywhere;
    color: #242428;
    background: #fff;
    border: 1px solid #e3dada;
}
#rbac-admin .directory-results button:hover,
#rbac-admin .directory-results button[aria-pressed="true"] {
    border-color: #c00000;
    background: #fff0f0;
}
#rbac-admin .directory-results button[aria-pressed="true"] {
    box-shadow: inset 3px 0 #c00000;
}
.directory-results span { font-size: .9em; }

#admin-form .fixed-launch-access:disabled {
    background: #f0f1f3;
    color: #56565c;
    opacity: 1;
    cursor: default;
}

#toast-stack {
    right: 1rem;
    bottom: 1rem;
    width: min(24rem, calc(100vw - 2rem));
}
#toast-stack .premium-toast {
    border: 1px solid #e7dada;
    border-left: 4px solid var(--aeci-corporate-red);
    border-radius: .65rem;
    color: #242428;
    background: #fff;
    overflow-wrap: anywhere;
}
#toast-stack .premium-toast.error { background: #fff4f4; }
@media (prefers-reduced-motion: reduce) {
    #toast-stack .toast-out { transition: none; }
}

.hub-hero .welcome-heading {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .12em .26em;
}
.hub-hero .welcome-heading .welcome-label {
    margin: 0;
    letter-spacing: normal;
}
.sidebar .menu-icon {
    display: inline-block;
    width: 1.4em;
    flex: 0 0 1.4em;
    margin-inline-end: .35rem;
    text-align: center;
    line-height: 1;
    font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif;
}

#overview-welcome[hidden] { display: none; }
#app-grid .clickable-app-card { cursor: pointer; }
#app-grid .clickable-app-card:focus-within { border-color: var(--aeci-corporate-red); }

.hub-main .hub-top {
    justify-content: space-between;
    gap: .75rem;
    border-bottom: 1px solid #ebe4e5;
}
.workspace-location {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-width: 0;
}
.workspace-location-icon {
    display: grid;
    place-items: center;
    flex: 0 0 2.6rem;
    height: 2.6rem;
    border-left: 3px solid var(--aeci-corporate-red);
    border-radius: .55rem;
    background: #fff0f1;
    font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif;
}
.workspace-location-text { display: grid; gap: .06rem; min-width: 0; }
.workspace-location-parent { font-size: .78rem; color: #56565c; }
.workspace-location-text strong {
    color: #242428;
    font-size: clamp(1rem, 2vw, 1.25rem);
    line-height: 1.15;
    overflow-wrap: anywhere;
}
.hub-top .top-actions { flex-shrink: 0; }

.direct-access {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr);
    gap: 1rem;
}
.direct-access-panel {
    display: grid;
    align-content: start;
    gap: .7rem;
    min-width: 0;
    padding: 1rem;
    border: 1px solid #e5dada;
    border-top: 3px solid var(--aeci-corporate-red);
    border-radius: .7rem;
}
.direct-access-panel label:not(.rbac-check, .direct-access-list label) {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: .35rem;
    min-width: 0;
}
.direct-access-panel label > :is(select, input:not([type="checkbox"])) {
    width: 100%;
    min-width: 0;
    margin: 0;
}
.direct-access-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .7rem;
    margin-bottom: .65rem;
}
.direct-access-filters label:first-child { grid-column: 1 / -1; }
.direct-access-panel h3 { margin: 0; }
#direct-access-selected { overflow-wrap: anywhere; }
#direct-access-selected small { display: block; font-weight: 400; color: #56565c; }
.direct-access-panel p { margin: 0; }
.direct-access-panel p:empty { display: none; }
.direct-access-panel .rbac-check,
.direct-access-list label { display: flex; align-items: center; gap: .5rem; }
.direct-access-list {
    padding: 0;
    margin: .5rem 0;
    max-height: 16rem;
    overflow-y: auto;
    list-style: none;
}
.direct-access-list li {
    padding: .45rem .6rem;
    border-bottom: 1px solid #efe7e7;
}
#direct-access-direct-grants > small { display: block; margin-top: .45rem; }
.advanced-access { margin-top: 1.1rem; }
.advanced-access > summary { cursor: pointer; }
.advanced-access[open] > summary { margin-bottom: .75rem; }
@media (max-width: 850px) {
    .direct-access { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
    .direct-access-filters { grid-template-columns: minmax(0, 1fr); }
}

.sidebar nav button[data-menu-description] { position: relative; }
.sidebar nav button[data-view="discover"] { font-size: .85rem; }
.sidebar nav button[data-menu-description]:is(:hover, :focus-visible) { z-index: 2; }
.sidebar nav button[data-menu-description]:is(:hover, :focus-visible)::after {
    content: attr(data-menu-description);
    position: absolute;
    inset-inline-start: 100%;
    top: 50%;
    transform: translateY(-50%);
    width: max-content;
    max-width: min(14rem, 34vw);
    padding: .45rem .65rem;
    border-radius: .4rem;
    border-inline-start: 3px solid var(--aeci-corporate-red);
    background: #262326;
    color: white;
    box-shadow: 0 5px 16px #0002;
    font-size: .8rem;
    line-height: 1.3;
    text-align: left;
    white-space: normal;
    pointer-events: none;
}

.hub-main #app-grid.compact-catalogue {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.35rem;
}
.compact-catalogue-group h2 {
    margin: 0 0 .55rem;
    padding-inline-start: .55rem;
    border-inline-start: 3px solid var(--aeci-corporate-red);
    font-size: 1.15rem;
}
.compact-catalogue-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 280px));
    gap: .65rem;
}
.compact-catalogue.list-layout .compact-catalogue-tiles { grid-template-columns: minmax(0, 1fr); }
.hub-main #app-grid.compact-catalogue .app-card {
    display: grid;
    grid-template-rows: 1fr auto;
    align-items: center;
    gap: .5rem;
    padding: .65rem .75rem;
    min-height: 0;
    max-width: none;
    height: 100%;
    border-radius: .7rem;
}
#app-grid.compact-catalogue .app-card-head {
    min-width: 0;
    margin: 0;
    gap: .6rem;
}
#app-grid.compact-catalogue .app-card-details h3 { margin-bottom: .15rem; }
#app-grid.compact-catalogue .app-card .category { display: none; }
#app-grid.compact-catalogue .app-actions {
    width: 100%;
    min-width: 0;
    gap: .4rem;
    margin: 0;
}
#app-grid.compact-catalogue .app-actions button:not(.launch) {
    flex-basis: 2rem;
    width: 2rem;
    height: 2rem;
    min-height: 2rem;
}
@media (min-width: 641px) {
    .hub-main #app-grid.compact-catalogue.list-layout .app-card {
        grid-template: auto / minmax(0, 1fr) auto;
        align-items: center;
        gap: 1rem;
    }
}

body #app-grid.compact-catalogue .app-actions .launch {
    height: auto;
    min-height: 2rem;
    padding: .4rem .65rem;
    color: #990014;
    background: #fff4f5;
    border: 1px solid #e9c8cd;
    box-shadow: none;
}
body #app-grid.compact-catalogue .app-actions .launch:not(:disabled):hover { background: #ffe5e8; }

.sidebar nav button[data-menu-description] {
    font-size: .78rem;
    white-space: nowrap;
    padding-inline: .45rem;
}
.sidebar nav button[data-menu-description] .menu-icon { margin-inline-end: .2rem; }
.sidebar nav button[data-menu-description]:is(:hover, :focus-visible)::after {
    color: #38292c;
    background: rgba(255, 247, 248, .92);
    backdrop-filter: blur(8px);
    box-shadow: 0 3px 12px #4d122020;
}

body #app-grid.compact-catalogue .app-card .app-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 2.75rem;
    width: 2.75rem;
    height: 2.75rem;
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
}
body #app-grid.compact-catalogue .app-card .app-icon img {
    display: block;
    flex: 0 0 auto;
    width: 2.5rem;
    height: 2.5rem;
    max-width: none;
    max-height: none;
    padding: 0;
    border-radius: 0;
    object-fit: contain;
    mix-blend-mode: normal;
}

#access-phase-notice {
    box-sizing: border-box;
    width: min(28rem, calc(100% - 2rem));
    padding: 1.4rem;
    border: 1px solid #e7dada;
    border-top: 3px solid var(--aeci-corporate-red);
    border-radius: .85rem;
    color: #242428;
    background: #fff;
    box-shadow: 0 18px 50px #0003;
}
#access-phase-notice::backdrop { background: #17131866; }
.access-phase-logo { display: block; width: 6rem; height: auto; }
#access-phase-title { margin: .85rem 0 .4rem; font-size: 1.2rem; }
#access-phase-message { margin: 0; line-height: 1.5; }
.access-phase-actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; margin-top: 1rem; }
.access-phase-actions button {
    padding: .55rem .95rem;
    border: 1px solid var(--aeci-corporate-red);
    border-radius: .45rem;
    background: var(--aeci-corporate-red);
    color: #fff;
    cursor: pointer;
}
.access-phase-actions button:focus-visible { outline: 2px solid #272329; outline-offset: 2px; }
.access-phase-actions .access-phase-dismiss { background: #fff; color: var(--aeci-corporate-red); }

/* Use a lighter hierarchy across the signed-in Hub. */
body .hub-layout :is(h1, h2, h3, h4, strong, b) {
    font-weight: 500;
}
body .hub-layout :is(button, label, th, summary),
body .hub-layout .app-card .category {
    font-weight: 400;
}
body .hub-layout .welcome-heading .welcome-label { font-weight: 400; }
body .hub-layout #welcome-name { font-weight: 500; }
body :is(dialog, #toast-stack) :is(h1, h2, h3, h4, strong, b) { font-weight: 500; }
body :is(dialog, #toast-stack) :is(button, label, th, summary, .premium-toast) { font-weight: 400; }

.aeci-confirm-panel .aeci-confirm-logo { margin-bottom: .75rem; }
.aeci-confirm-panel .aeci-confirm-items {
    max-height: min(12rem, 30vh);
    overflow: auto;
    margin: 0 0 1rem;
    padding-inline-start: 1.3rem;
    color: #48424a;
    overflow-wrap: anywhere;
}

#app-grid.compact-catalogue .app-card-head {
    justify-content: center;
    text-align: center;
}
#app-grid.compact-catalogue .app-card-details { flex: 0 1 auto; }
#app-grid.compact-catalogue .app-actions { justify-content: center; }
body #app-grid.compact-catalogue .app-actions .launch { flex: 0 1 auto; }
.hub-main #app-grid.compact-catalogue:not(.list-layout) .app-card {
    grid-template-columns: minmax(0, 1fr);
    justify-items: stretch;
}
.hub-main #app-grid.compact-catalogue:not(.list-layout) .app-card-head {
    width: 100%;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: .55rem;
    text-align: left;
}
.hub-main #app-grid.compact-catalogue:not(.list-layout) .app-card-details {
    flex: 0 1 auto;
    min-width: 0;
    text-align: left;
}
.hub-main #app-grid.compact-catalogue .app-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}
body #app-grid.compact-catalogue .app-actions :is(.launch, .app-favourite) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    box-sizing: border-box;
}
body #app-grid.compact-catalogue .app-actions .app-favourite {
    padding: 0;
    align-self: stretch;
    height: auto;
    line-height: 1;
    font-size: 1rem;
}
body #app-grid.compact-catalogue .app-actions .app-favourite[hidden] { display: none; }
body #app-grid.compact-catalogue .app-actions .app-favourite[aria-pressed="true"] {
    color: var(--aeci-corporate-red);
    border-color: #e9c8cd;
    background: #fff4f5;
}

body .hub-main #overview-welcome.hub-hero {
    box-sizing: border-box;
    height: auto;
    min-height: 9.5rem;
    padding: .9rem clamp(1rem, 3vw, 2rem);
}
#overview-welcome.hub-hero[hidden] { display: none; }
#overview-welcome .welcome-heading { margin: 0 0 .25rem; font-size: clamp(1.45rem, 3vw, 2rem); }
#overview-welcome .welcome-label { font-size: .8em; }
#overview-welcome .hero-greeting { margin: 0 0 .3rem; font-size: .95rem; }
#overview-welcome .hero-meta { gap: .35rem .65rem; }
#overview-welcome .hero-orbit {
    width: 7.5rem;
    height: 7.5rem;
}
#overview-welcome .orbit-core { inset: 25%; width: auto; height: auto; }
#overview-welcome .orbit-core img { width: 80%; }

#overview-welcome .orbit-one { inset: 8%; }
#overview-welcome .orbit-two { inset: 20%; }
#overview-welcome .orbit-three { inset: 0; }
#overview-welcome .orbit-point { width: .36rem; height: .36rem; }
#overview-welcome .p1 { inset: 9% 21% auto auto; }
#overview-welcome .p2 { inset: 49% auto auto 4%; }
#overview-welcome .p3 { inset: auto 10% 16% auto; }

.sidebar .menu-icon, .workspace-location-icon { color: var(--aeci-corporate-red); }
.sidebar .menu-icon svg, .workspace-location-icon svg {
    display: block;
    width: 1em;
    height: 1em;
    margin-inline: auto;
}
.workspace-location-icon svg { width: 1.15rem; height: 1.15rem; }

.sidebar nav button[data-menu-description]:not([hidden]) {
    display: flex;
    align-items: center;
    gap: .45rem;
}
.sidebar nav button[data-menu-description] .menu-icon {
    display: grid;
    place-items: center;
    width: 1.15rem;
    flex: 0 0 1.15rem;
    margin-inline-end: 0;
}
.sidebar .menu-icon .brand-menu-badge { width: 1.15rem; height: 1.15rem; }
.workspace-location-icon .brand-menu-badge { width: 1.55rem; height: 1.55rem; }

#apps-view .hub-toolbar { gap: .5rem; margin-bottom: .65rem; }
#apps-view .hub-toolbar .search-box {
    min-height: 0;
    height: auto;
    padding-block: 0;
    border-radius: .65rem;
}
#apps-view .hub-toolbar .search-box input {
    min-height: 2.25rem;
    height: auto;
    padding-block: .2rem;
}
body #apps-view .hub-toolbar button[data-category] {
    min-height: 2rem;
    height: auto;
    padding: .34rem .75rem;
    line-height: 1.2;
}
body #apps-view .hub-toolbar button[data-category].active {
    background: linear-gradient(90deg, #ed002d 50%, #b50018 50%);
    border-color: #b50018;
    color: #fff;
}

.sidebar .side-bottom {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-inline: .65rem;
    padding: .75rem .25rem;
    border-top: 1px solid #e9dfe1;
}
.side-footer-badge {
    display: grid;
    place-items: center;
    flex: 0 0 1.8rem;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(90deg, #ed002d 50%, #b50018 50%);
}
.side-footer-badge svg { width: .95rem; height: .95rem; }
.side-footer-copy { display: grid; gap: .15rem; min-width: 0; line-height: 1.2; }
.side-footer-name { color: #262326; font-size: .85rem; }
.sidebar .side-footer-copy small { margin: 0; color: #5e565a; font-size: .75rem; }
.sidebar .side-footer-copy strong { color: var(--aeci-corporate-red); }

.hub-top .hub-updates-button[hidden], .hub-updates-dot[hidden] { display: none; }
.hub-top .hub-updates-button {
    position: relative;
    display: grid;
    place-items: center;
    width: 2.35rem;
    height: 2.35rem;
    border: 1px solid #eadcdf;
    border-radius: .65rem;
    color: var(--aeci-corporate-red);
    background: #fff4f5;
}
.hub-updates-button svg { width: 1.15rem; height: 1.15rem; }
.hub-updates-dot {
    position: absolute;
    top: .25rem;
    right: .25rem;
    width: .45rem;
    height: .45rem;
    border-radius: 50%;
    background: var(--aeci-corporate-red);
}
#hub-updates {
    box-sizing: border-box;
    width: min(30rem, calc(100% - 2rem));
    padding: 1.4rem;
    border: 1px solid #e7dada;
    border-top: 3px solid var(--aeci-corporate-red);
    border-radius: .85rem;
    color: #242428;
    background: #fff;
    box-shadow: 0 18px 50px #0003;
}
#hub-updates::backdrop { background: #17131866; }
#hub-updates h2 { font-size: 1.3rem; }
#hub-updates li { margin-bottom: .5rem; line-height: 1.4; }

body .hub-main #overview-welcome.hub-hero {
    background: linear-gradient(130deg, #b50018 55%, #ed002d 55%);
}
#overview-welcome.hub-hero::before { content: none; }

.hub-top .hub-updates-button {
    border-color: #b50018;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(90deg, #ed002d 50%, #b50018 50%);
}
.hub-top .hub-updates-button:hover { filter: brightness(.93); }
.hub-top .hub-updates-button:focus-visible { outline: 2px solid #b50018; outline-offset: 3px; }
.hub-updates-button .hub-updates-dot {
    top: .1rem;
    right: .1rem;
    background: #fff;
    box-shadow: 0 0 0 1px #b50018;
}
