html {
    min-height: 100%;
    background: #EEF9FC;
}

.portal-page {
    position: relative;
    z-index: 0;
    isolation: isolate;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at 12% 10%, rgba(0, 163, 224, .34) 0, rgba(0, 163, 224, 0) 32%),
        radial-gradient(circle at 88% 12%, rgba(115, 201, 45, .26) 0, rgba(115, 201, 45, 0) 29%),
        radial-gradient(circle at 82% 86%, rgba(0, 163, 224, .17) 0, rgba(0, 163, 224, 0) 27%),
        radial-gradient(circle at 18% 88%, rgba(115, 201, 45, .13) 0, rgba(115, 201, 45, 0) 24%),
        linear-gradient(145deg, #EEF9FC 0%, #F8FBFC 42%, #F1F8F1 100%);
    background-attachment: fixed;
}

body::before,
body::after {
    position: fixed;
    z-index: -1;
    border-radius: 50%;
    filter: blur(12px);
    pointer-events: none;
    content: "";
    will-change: transform, opacity;
}

body::before {
    top: 11vh;
    left: -90px;
    width: 260px;
    height: 260px;
    background: rgba(0, 163, 224, .12);
    animation: ambientBlueFloat 18s cubic-bezier(.45, 0, .55, 1) infinite alternate;
}

body::after {
    right: -80px;
    bottom: 8vh;
    width: 220px;
    height: 220px;
    background: rgba(115, 201, 45, .12);
    animation: ambientGreenFloat 21s cubic-bezier(.45, 0, .55, 1) -6s infinite alternate;
}

@keyframes ambientBlueFloat {
    0%   { transform: translate3d(-30px, -25px, 0) scale(.82); opacity: .72; }
    25%  { transform: translate3d(70px, 30px, 0) scale(1.10); opacity: 1; }
    52%  { transform: translate3d(165px, -15px, 0) scale(1.30); opacity: .86; }
    76%  { transform: translate3d(75px, 85px, 0) scale(.94); opacity: .95; }
    100% { transform: translate3d(210px, 35px, 0) scale(1.22); opacity: .78; }
}

@keyframes ambientGreenFloat {
    0%   { transform: translate3d(30px, 25px, 0) scale(.88); opacity: .70; }
    24%  { transform: translate3d(-90px, -35px, 0) scale(1.18); opacity: .96; }
    50%  { transform: translate3d(-185px, 20px, 0) scale(1.34); opacity: .82; }
    74%  { transform: translate3d(-70px, -95px, 0) scale(.92); opacity: 1; }
    100% { transform: translate3d(-225px, -30px, 0) scale(1.24); opacity: .76; }
}

.portal-navbar {
    min-height: 68px;
    display: grid;
    grid-template-columns: auto minmax(260px, 620px) auto;
    align-items: center;
    gap: 18px;
    padding: 0 18px;
    flex: 0 0 auto;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    color: #fff;
    background: linear-gradient(120deg, #008cc5 0%, var(--blue) 42%, #4ebf70 74%, var(--green) 100%);
    border-bottom: 5px solid var(--c-green);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    z-index: 30;
}

.portal-navbar::after {
    content: "";
    position: absolute;
    width: 300px;
    height: 300px;
    right: -110px;
    bottom: -210px;
    border: 34px solid rgba(255, 255, 255, .12);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.portal-navbar > * {
    position: relative;
    z-index: 1;
}

.portal-nav-left,
.portal-nav-right {
    display: flex;
    align-items: center;
    gap: 9px;
}

.portal-nav-right {
    justify-content: flex-end;
}

.portal-title {
    font-size: 1.25rem;
    font-weight: 700;
    white-space: nowrap;
}

.icon-btn {
    width: 39px;
    height: 39px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.13);
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease;
}

.icon-btn:hover,
.icon-btn.is-active {
    background: rgba(255, 255, 255, 0.24);
    transform: translateY(-1px);
}

.portal-search-wrap {
    min-width: 0;
}

.portal-search {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border: 2px solid rgba(255, 255, 255, 0.55);
    border-radius: 22px;
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.015);
}

.portal-search > i {
    color: var(--c-grey);
}

.portal-search.is-disabled {
    border-color: rgba(145, 153, 159, 0.38);
    background: #e8edef;
    box-shadow: none;
    cursor: not-allowed;
}

.portal-search.is-disabled > i,
.portal-search.is-disabled input,
.portal-search.is-disabled .search-clear {
    color: #98a2a8;
}

.portal-search input:disabled,
.search-clear:disabled {
    cursor: not-allowed;
}

.portal-search input:disabled {
    opacity: 1;
    -webkit-text-fill-color: #98a2a8;
}

.search-clear:disabled:hover {
    background: transparent;
    color: #98a2a8;
}

.portal-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--c-text);
}

.search-clear {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #a0a9ae;
    cursor: pointer;
}

.search-clear:hover {
    background: #f0f3f4;
    color: #66737a;
}

.portal-content {
    flex: 1;
    min-height: 0;
    position: relative;
}

.dashboard-view,
.module-view,
.admin-portal-view,
.maintenance-view {
    position: absolute;
    inset: 0;
}


.admin-portal-view {
    overflow: hidden;
    background: #f3f6f7;
}

.admin-portal-view[hidden] {
    display: none !important;
}

.admin-portal-frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #f3f6f7;
}

.dashboard-view {
    overflow-y: auto;
}

.dashboard-inner {
    width: min(100%, 1380px);
    margin: 0 auto;
    padding: 28px 26px 50px;
}

.dashboard-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.category-filter {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border: 1px solid #dce4e7;
    border-radius: 999px;
    background: #fff;
    color: #65727a;
    font-weight: 700;
    font-size: 0.76rem;
    cursor: pointer;
    transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.category-filter:hover,
.category-filter.is-active {
    color: #fff;
    background: var(--c-blue);
    border-color: var(--c-blue);
}

.category-sections,
.recent-section {
    display: grid;
    gap: 28px;
}

.recent-section {
    margin-bottom: 28px;
    padding-bottom: 26px;
    border-bottom: 1px solid rgba(145, 153, 159, .22);
}

.category-section[hidden],
.recent-section[hidden],
.portal-empty[hidden] {
    display: none;
}

.category-section.is-empty-filtered {
    display: none;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 13px;
}

.category-heading-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 12px;
    color: var(--c-blue);
    background: rgba(0, 163, 224, 0.09);
}

.category-header h2 {
    margin: 0;
    color: #2d383e;
    font-size: 1.02rem;
}

.category-header p {
    margin: 3px 0 0;
    color: var(--c-muted);
    font-size: 0.74rem;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.module-card {
    min-width: 0;
    position: relative;
    overflow: hidden;
    border: 1px solid #dfe6e9;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 4px 15px rgba(33, 52, 61, 0.045);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.module-card:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 163, 224, 0.34);
    box-shadow: 0 10px 25px rgba(33, 52, 61, 0.085);
}

.module-card.is-filtered {
    display: none;
}

.favorite-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid #e1e6e8;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.94);
    color: #9aa4aa;
    cursor: pointer;
}

.favorite-btn:hover,
.favorite-btn.is-favorite {
    color: #e0a100;
    background: #fff9e9;
    border-color: #f3d98c;
}

.module-launch {
    width: 100%;
    min-height: 156px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 13px;
    padding: 14px 48px 42px 16px;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.module-card.has-publication .module-launch {
    min-height: 122px;
}

.module-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 15px;
    color: var(--c-blue);
    background: linear-gradient(135deg, rgba(0, 163, 224, 0.09), rgba(115, 201, 45, 0.12));
    font-size: 1.15rem;
}

.module-card-content {
    min-width: 0;
    display: block;
}

.module-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    margin-bottom: 6px;
}

.module-version,
.module-maintenance-badge,
.module-access-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 20px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(0, 163, 224, 0.08);
    color: var(--c-blue);
    font-size: 0.61rem;
    font-weight: 700;
}

.module-version {
    color: #707c83;
    background: #f0f3f4;
}

.module-maintenance-badge {
    color: #a96806;
    background: #fff5df;
}

.module-access-badge.is-public { color: #287744; background: #edf9f0; }
.module-access-badge.is-private { color: #6a4a8b; background: #f5effb; }
.module-access-badge.is-subscription { color: #8b6500; background: #fff8df; }
.module-access-badge.is-admin { color: #8a2f3d; background: #fdeff1; }

.module-name,
.module-description {
    display: block;
}

.module-name {
    color: #2b363c;
    font-size: 0.96rem;
    font-weight: 700;
}

.module-description {
    margin-top: 6px;
    overflow: hidden;
    color: var(--c-muted);
    font-size: 0.75rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.module-open-icon {
    position: absolute;
    z-index: 3;
    left: 16px;
    bottom: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #b1babf;
    font-size: 0.8rem;
    line-height: 1;
}

.module-card.has-publication .module-open-icon {
    bottom: 51px;
}

.module-publication {
    min-height: 34px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 15px;
    border-top: 1px solid #edf0f2;
    color: var(--c-blue);
    background: #fbfcfd;
    text-decoration: none;
    font-size: 0.68rem;
    font-weight: 700;
}

.module-publication:hover {
    background: #f3f9fb;
}

.portal-empty {
    display: grid;
    justify-items: center;
    padding: 60px 20px;
    color: var(--c-muted);
    text-align: center;
}

.portal-empty i {
    margin-bottom: 10px;
    color: #b7c0c5;
    font-size: 2rem;
}

.portal-empty h2 {
    margin: 0;
    color: #526068;
    font-size: 1.05rem;
}

.portal-empty p {
    margin: 6px 0 0;
    font-size: 0.78rem;
}

.module-view,
.maintenance-view {
    display: none;
    background: #fff;
}

.module-view[hidden],
.module-view[aria-hidden="true"] {
    display: none !important;
}

.module-view.is-active,
.maintenance-view.is-active {
    display: flex;
}

.module-view {
    flex-direction: column;
}

.module-view-bar {
    min-height: 46px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    border-bottom: 1px solid #e2e8ea;
    background: #fafcfc;
}

.module-view-bar strong {
    overflow: hidden;
    color: #38444a;
    font-size: 0.8rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.module-back {
    min-height: 33px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    border: 1px solid #dfe5e8;
    border-radius: 8px;
    background: #fff;
    color: #5c6971;
    font-size: 0.72rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.module-back:hover {
    color: var(--c-blue);
    border-color: rgba(0, 163, 224, 0.4);
}

#mainFrame {
    width: 100%;
    flex: 1;
    min-height: 0;
    border: 0;
    background: #fff;
}

.maintenance-view {
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at top left, rgba(0, 163, 224, 0.09), transparent 35%),
        radial-gradient(circle at bottom right, rgba(115, 201, 45, 0.1), transparent 30%),
        #f6f8f9;
}

/* Les écrans de droits réutilisent le fond animé de l'accueil du portail. */
#accessView {
    background: transparent;
}

.maintenance-card {
    width: min(100%, 520px);
    padding: 34px;
    border: 1px solid #e1e7e9;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(33, 52, 61, 0.12);
    text-align: center;
}

.maintenance-icon {
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    margin: 0 auto 13px;
    border-radius: 18px;
    color: #a96806;
    background: #fff4dd;
    font-size: 1.45rem;
}

.maintenance-label {
    display: block;
    color: #a96806;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.maintenance-card h2 {
    margin: 7px 0 0;
    color: #2f3b41;
    font-size: 1.35rem;
}

.maintenance-card p {
    margin: 9px auto 20px;
    color: var(--c-muted);
    line-height: 1.55;
    font-size: 0.84rem;
}

@media (max-width: 1100px) {
    .module-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .portal-navbar {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 10px;
        padding: 0 10px;
    }

    .portal-title {
        display: none;
    }

    .module-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-inner {
        padding: 20px 16px 40px;
    }
}

@media (max-width: 560px) {
    .portal-navbar {
        min-height: 62px;
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .portal-nav-right {
        gap: 5px;
    }

    .portal-nav-right .icon-btn {
        width: 36px;
        height: 36px;
    }

    .portal-nav-right a[title="Administration"] {
        display: none;
    }

    .portal-search {
        min-height: 38px;
    }

    .portal-search input {
        font-size: 0.78rem;
    }

    .module-grid {
        grid-template-columns: 1fr;
    }

    .module-launch {
        min-height: 150px;
    }

    .module-card.has-publication .module-launch {
        min-height: 116px;
    }

    .module-view-bar {
        grid-template-columns: auto minmax(0, 1fr);
    }

}

.portal-modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: none;
    place-items: center;
    padding: 20px;
    overflow-y: auto;
    background: rgba(26, 36, 42, .62);
}

.portal-modal.is-open {
    display: grid;
}

.portal-modal-open {
    overflow: hidden;
}

.portal-modal-dialog {
    width: min(100%, 620px);
}

.portal-modal-card {
    overflow: hidden;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(0, 0, 0, .28);
}

.portal-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    color: #fff;
    background: linear-gradient(135deg, var(--c-blue), #128bc2);
}

.portal-modal-header h2 {
    margin: 0;
    font-size: 1.05rem;
}

.portal-modal-header p {
    margin: 5px 0 0;
    color: rgba(255, 255, 255, .82);
    font-size: .78rem;
}

.portal-modal-close {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 0;
    border-radius: 9px;
    color: #fff;
    background: rgba(255, 255, 255, .14);
    cursor: pointer;
}

.feedback-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 20px;
}

.feedback-form label {
    display: grid;
    gap: 7px;
    color: #4d5a61;
    font-size: .76rem;
    font-weight: 700;
}

.feedback-form label small {
    color: var(--c-muted);
    font-weight: 400;
}

.feedback-form input,
.feedback-form select,
.feedback-form textarea {
    width: 100%;
    border: 1px solid #dce4e7;
    border-radius: 10px;
    outline: 0;
    background: #fff;
    color: var(--c-text);
    font: inherit;
}

.feedback-form input,
.feedback-form select {
    min-height: 42px;
    padding: 0 11px;
}

.feedback-form textarea {
    min-height: 135px;
    padding: 11px;
    resize: vertical;
    line-height: 1.45;
}

.feedback-form input:focus,
.feedback-form select:focus,
.feedback-form textarea:focus {
    border-color: rgba(0, 163, 224, .65);
    box-shadow: 0 0 0 3px rgba(0, 163, 224, .09);
}

.feedback-form-wide {
    grid-column: 1 / -1;
}

.feedback-status {
    min-height: 18px;
    grid-column: 1 / -1;
    color: var(--c-muted);
    font-size: .76rem;
}

.feedback-status.is-success {
    color: #4e8d1f;
}

.feedback-status.is-error {
    color: #b53b3b;
}

.feedback-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
}

.feedback-submit {
    min-height: 35px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: var(--c-green);
    font-weight: 700;
    cursor: pointer;
}

.feedback-submit:disabled,
.favorite-btn:disabled {
    opacity: .55;
    cursor: wait;
}

@media (max-width: 560px) {
    .feedback-form {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .feedback-form-wide {
        grid-column: auto;
    }

    .feedback-status {
        grid-column: auto;
    }
}


/* Compte unifié my.ceg.gy */
.account-chip {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid var(--c-line);
    border-radius: 999px;
    color: var(--c-text);
    background: rgba(255, 255, 255, .9);
    text-decoration: none;
    font-weight: 700;
    font-size: .86rem;
}
.account-chip:hover { border-color: rgba(0, 163, 224, .45); color: var(--c-blue); }
.account-chip i { color: var(--c-blue); font-size: 1rem; }
.account-chip.is-login { color: var(--c-blue); }
.portal-toast {
    transition: opacity .25s ease, transform .25s ease;
    position: fixed;
    z-index: 80;
    top: 74px;
    left: 50%;
    transform: translateX(-50%);
    max-width: min(92vw, 640px);
    padding: 11px 16px;
    border: 1px solid rgba(115, 201, 45, .3);
    border-radius: 12px;
    background: rgba(255,255,255,.96);
    box-shadow: var(--shadow-md);
    font-weight: 700;
}
.portal-toast.is-error { border-color: rgba(217, 67, 67, .35); }
.access-icon { background: linear-gradient(135deg, var(--c-blue), var(--c-green)); }
.access-view-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.module-card.is-access-locked {
    border-color: #d9dfe2;
    background: #f5f7f8;
    box-shadow: none;
}

.module-card.is-access-locked:hover {
    transform: none;
    border-color: #cfd6da;
    box-shadow: none;
}

.module-card.is-access-locked .module-launch {
    opacity: .64;
    filter: grayscale(.92);
}

.module-card.is-access-locked .module-icon {
    color: #7f8a90;
    background: #e8edef;
}

.module-card.is-access-locked .module-open-icon {
    color: var(--c-muted);
}

.module-card.is-access-locked .module-name,
.module-card.is-access-locked .module-description {
    color: #7b858a;
}
@media (max-width: 720px) { .account-chip span { display: none; } .account-chip { width: 40px; justify-content: center; padding: 0; } }

/* V4.6 — tri, personnalisation et accès my.ceg.gy */
.toolbar-spacer {
    flex: 1 1 24px;
}

.portal-sort-control {
    width: max-content;
    min-width: max-content;
    min-height: 38px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    white-space: nowrap;
    text-align: left;
    padding: 5px 9px 5px 11px;
    border: 1px solid #dce4e7;
    border-radius: 999px;
    background: #fff;
    color: #65727a;
    font-size: .76rem;
    font-weight: 700;
}

.portal-sort-control span {
    flex: 0 0 auto;
    text-align: left;
}

.portal-sort-control select {
    min-height: 28px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #49565d;
    font: inherit;
    cursor: pointer;
    text-align: left;
    text-align-last: left;
}

.portal-option-button {
    margin-left: 0;
}

.personal-category-sections:empty {
    display: none;
}

.personal-category-sections {
    margin-bottom: 28px;
}

.personal-category-heading {
    min-width: 0;
    flex: 1;
}

.personal-category-delete {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    margin-left: auto;
    border: 1px solid #e4e8ea;
    border-radius: 9px;
    color: #a45a65;
    background: #fff;
    cursor: pointer;
}

.personal-category-delete:hover {
    color: #fff;
    background: #b84a5b;
    border-color: #b84a5b;
}

.categories-hidden .category-header {
    display: none;
}

.categories-hidden .category-sections,
.categories-hidden .personal-category-sections {
    gap: 14px;
}

.portal-manual-order .module-card.is-draggable {
    cursor: grab;
}

.portal-manual-order .module-card.is-draggable:active {
    cursor: grabbing;
}

.module-card.is-dragging {
    opacity: .42;
    transform: scale(.985);
}

.module-grid.is-drag-over {
    min-height: 86px;
    border-radius: 16px;
    outline: 2px dashed rgba(0, 163, 224, .45);
    outline-offset: 6px;
    background: rgba(0, 163, 224, .025);
}

.module-access-badge.is-user,
.module-access-badge.is-private {
    color: #6a4a8b;
    background: #f5effb;
}

.module-access-badge.is-tester {
    color: #315f8c;
    background: #edf5fc;
}

.feedback-honeypot {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

@media (max-width: 820px) {
    .toolbar-spacer {
        display: none;
    }
}

.flat-module-grid[hidden] { display: none; }
.categories-hidden #categorySections,
.categories-hidden #personalCategorySections { display: none; }
.categories-hidden .flat-module-grid:not([hidden]) { display: grid; }


/* V4.8 — maintenance globale et accès Premium */
.portal-global-maintenance { min-height: calc(100vh - 78px); }
.access-icon.is-premium {
    color: #fff;
    background:
        radial-gradient(circle at 30% 20%, rgba(255,255,255,.48), transparent 32%),
        linear-gradient(135deg, #d7a51d 0%, #f3d66d 42%, #7b5ac8 100%);
    box-shadow: 0 12px 28px rgba(123, 90, 200, .22), 0 5px 16px rgba(215, 165, 29, .22);
}
.access-icon.is-premium i { filter: drop-shadow(0 2px 4px rgba(0,0,0,.16)); }

.portal-toast.is-hiding { opacity: 0; transform: translate(-50%, -6px); }
.access-view-actions [hidden] { display: none !important; }

/* V5.0 — visibilité maintenance administrateur */
.admin-maintenance-banner {
    width: min(1180px, calc(100% - 32px));
    margin: 16px auto 0;
    padding: 13px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #efcc7d;
    border-radius: 16px;
    background: #fff8e8;
    box-shadow: 0 10px 28px rgba(129, 89, 17, .10);
    color: #6f4b08;
}
.admin-maintenance-banner-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #f2b53b;
    color: #fff;
}
.admin-maintenance-banner div { display: grid; gap: 2px; min-width: 0; }
.admin-maintenance-banner strong { font-size: .94rem; }
.admin-maintenance-banner span { font-size: .82rem; line-height: 1.4; }
.admin-maintenance-banner-link {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 11px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #e4c16e;
    color: #76500a;
    text-decoration: none;
    font-size: .82rem;
    font-weight: 700;
    white-space: nowrap;
}
@media (max-width: 720px) {
    .admin-maintenance-banner { align-items: flex-start; flex-wrap: wrap; }
    .admin-maintenance-banner-link { margin-left: 50px; }
}

/* V4.22 — applications personnelles */
.personal-apps-section {
    margin-top: 34px;
    padding-top: 26px;
    border-top: 1px solid rgba(145, 153, 159, .22);
}

.personal-apps-header {
    align-items: center;
}

.personal-apps-heading {
    min-width: 0;
}

.personal-app-add {
    min-height: 38px;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 12px;
    border: 1px solid rgba(0, 163, 224, .26);
    border-radius: 11px;
    color: #087ea9;
    background: rgba(0, 163, 224, .07);
    font: inherit;
    font-size: .76rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.personal-app-add:hover {
    color: #fff;
    border-color: var(--c-blue);
    background: var(--c-blue);
}

.personal-app-frame-note {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 0 0 14px;
    padding: 10px 12px;
    border: 1px solid rgba(0, 163, 224, .15);
    border-radius: 12px;
    color: #5f6e76;
    background: rgba(255, 255, 255, .62);
    font-size: .72rem;
    line-height: 1.45;
}

.personal-app-frame-note i {
    margin-top: 2px;
    color: var(--c-blue);
}

.personal-app-card .module-launch {
    padding-right: 88px;
}

.personal-app-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    display: flex;
    gap: 5px;
}

.personal-app-action {
    width: 31px;
    height: 31px;
    display: grid;
    place-items: center;
    border: 1px solid #e1e6e8;
    border-radius: 9px;
    color: #7c898f;
    background: rgba(255, 255, 255, .96);
    cursor: pointer;
}

.personal-app-action:hover {
    color: var(--c-blue);
    border-color: rgba(0, 163, 224, .32);
    background: #f4fbfe;
}

.personal-app-action.is-danger:hover {
    color: #fff;
    border-color: #b84a5b;
    background: #b84a5b;
}

.module-access-badge.is-personal {
    color: #56636a;
    background: #eef2f3;
}

.personal-app-empty {
    min-height: 86px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px dashed #d8e0e3;
    border-radius: 14px;
    color: #879298;
    background: rgba(255, 255, 255, .5);
    font-size: .78rem;
}

.personal-app-empty[hidden] {
    display: none;
}

.personal-app-warning {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 13px;
    border: 1px solid #f0d495;
    border-radius: 12px;
    color: #72520d;
    background: #fff9e9;
    font-size: .73rem;
    line-height: 1.45;
}

.personal-app-warning > i {
    margin-top: 2px;
    color: #c58a0d;
}

.personal-app-warning div {
    display: grid;
    gap: 3px;
}

.personal-app-warning strong,
.personal-app-warning span {
    display: block;
}

@media (max-width: 720px) {
    .personal-apps-header {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .personal-app-add {
        width: 100%;
        margin-left: 54px;
    }

    .personal-app-card .module-launch {
        padding-right: 82px;
    }
}

.categories-hidden .personal-apps-section .category-header {
    display: flex;
}

.personal-frame-hint {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-self: end;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid rgba(0, 163, 224, .14);
    border-radius: 10px;
    color: #647279;
    background: rgba(255, 255, 255, .74);
    font-size: .68rem;
    line-height: 1.3;
}

.personal-frame-hint span {
    min-width: 0;
}

.personal-frame-hint i {
    flex: 0 0 auto;
    color: var(--c-blue);
}

.personal-frame-hint[hidden] {
    display: none;
}

.personal-app-new-tab {
    display: flex !important;
    align-items: center;
    gap: 11px;
    padding: 11px 12px;
    border: 1px solid #dfe6e8;
    border-radius: 12px;
    color: #4d5a60;
    background: rgba(255, 255, 255, .72);
    cursor: pointer;
}

.personal-app-new-tab input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    margin: 0;
    accent-color: var(--c-blue);
}

.personal-app-new-tab span {
    display: grid;
    gap: 2px;
}

.personal-app-new-tab strong {
    font-size: .78rem;
}

.personal-app-new-tab small {
    color: #7d898f;
    font-size: .68rem;
    line-height: 1.35;
}

/* V4.29 — Sites ceg.gy */
.ceggy-sites-section {
    margin-top: 34px;
    padding-top: 26px;
    border-top: 1px solid rgba(145, 153, 159, .22);
}

.ceggy-sites-header {
    align-items: center;
}

.ceggy-sites-heading {
    min-width: 0;
}

.ceggy-sites-header .personal-app-add {
    text-decoration: none;
}

.ceggy-site-card .module-access-badge.is-public {
    color: #087ea9;
    background: rgba(0, 163, 224, .08);
}

.categories-hidden .ceggy-sites-section .category-header {
    display: flex;
}

/* V4.30 — gestion directe des Sites ceg.gy depuis le portail */
.ceggy-sites-section .ceggy-sites-admin-note {
    margin-bottom: 14px;
}

.ceggy-sites-grid-placeholder {
    min-height: 1px;
}

#ceggySitesGrid.is-ceggy-sortable .ceggy-site-card {
    cursor: grab;
}

#ceggySitesGrid.is-ceggy-sortable .ceggy-site-card:active {
    cursor: grabbing;
}

.ceggy-site-card.is-site-disabled {
    opacity: .62;
}

.ceggy-site-card.is-site-disabled:hover {
    opacity: .82;
}

.ceggy-drag-handle {
    cursor: grab;
}

.ceggy-drag-handle:active {
    cursor: grabbing;
}

#ceggySitesGrid.is-drag-over {
    outline: 2px dashed rgba(0, 163, 224, .34);
    outline-offset: 7px;
    border-radius: 18px;
}

.module-access-badge.is-muted { color: #667078; background: #eef1f3; }


/* V4.40 — préférences d’affichage du portail */
.portal-display-popover {
    position: fixed;
    z-index: 115;
    top: 76px;
    right: 18px;
    width: min(390px, calc(100vw - 28px));
    overflow: hidden;
    border: 1px solid rgba(145, 153, 159, .22);
    border-radius: 16px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 20px 55px rgba(35, 54, 64, .20);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
.portal-display-popover[hidden] { display: none !important; }
.portal-display-popover-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 15px 16px 13px;
    color: #fff;
    background: linear-gradient(120deg, #008cc5 0%, var(--c-blue) 42%, #4ebf70 74%, var(--c-green) 100%);
}
.portal-display-popover-head > div { min-width: 0; display: grid; gap: 3px; }
.portal-display-popover-head strong { font-size: .92rem; }
.portal-display-popover-head span { color: rgba(255,255,255,.86); font-size: .7rem; line-height: 1.35; }
.portal-display-close {
    width: 31px;
    height: 31px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 0;
    border-radius: 9px;
    color: #fff;
    background: rgba(255,255,255,.15);
    cursor: pointer;
}
.portal-display-close:hover { background: rgba(255,255,255,.25); }
.portal-display-options { display: grid; gap: 0; padding: 6px 0; }
.portal-display-option {
    min-height: 66px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
}
.portal-display-option + .portal-display-option { border-top: 1px solid #edf1f2; }
.portal-display-option:hover { background: #f8fbfc; }
.portal-display-option-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: var(--c-blue);
    background: rgba(0,163,224,.08);
}
.portal-display-option.is-premium .portal-display-option-icon {
    color: #8058b5;
    background: linear-gradient(135deg, rgba(244,196,73,.16), rgba(128,88,181,.12));
}
.portal-display-option-copy { min-width: 0; display: grid; gap: 2px; }
.portal-display-option-copy strong { color: #344149; font-size: .78rem; }
.portal-display-option-copy small { color: #819097; font-size: .67rem; line-height: 1.35; }
.portal-display-option input[type="checkbox"] {
    width: 19px;
    height: 19px;
    margin: 0;
    accent-color: var(--c-blue);
}
@media (max-width: 560px) {
    .portal-display-popover { top: 68px; right: 10px; width: min(370px, calc(100vw - 20px)); }
}


/* V4.53 — badge IA à droite, icône d’ouverture à gauche */
.module-ai-badge {
    position: absolute;
    z-index: 4;
    right: 16px;
    left: auto;
    bottom: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 29px;
    padding: 6px 11px;
    border: 1px solid rgba(255, 255, 255, .38);
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(120deg, #008cc5 0%, var(--c-blue) 46%, #4ebf70 76%, var(--c-green) 100%);
    box-shadow: 0 7px 16px rgba(0, 163, 224, .22);
    font-size: .7rem;
    font-weight: 900;
    letter-spacing: .045em;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
    opacity: .88;
}

.module-ai-badge i {
    color: #fff;
    font-size: .74rem;
}

.module-card.has-publication .module-ai-badge {
    bottom: 43px;
}

.module-card.is-access-locked .module-ai-badge {
    opacity: .88;
    filter: none;
}


/* V4.44 — espacement compact de la section Récemment utilisés */
.recent-section {
    gap: 10px;
}

.recent-section > .category-header {
    margin-bottom: 0;
}
