/* Coque, navigation et accueil du Portail client. */
body.portal-page-authenticated {
    background: #f7f7f8 !important;
}

.portal-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(15, 23, 42, .985) !important;
    color: #fff !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .05), 0 12px 32px rgba(15, 23, 42, .2) !important;
    backdrop-filter: blur(14px);
}

.portal-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: min(100% - 2rem, 1440px);
    min-height: 72px;
    margin-inline: auto;
}

.portal-brand,
.portal-brand:hover,
.portal-brand:focus {
    color: #fff !important;
    text-decoration: none;
}

.portal-brand-logo {
    display: block;
    width: auto;
    max-width: 260px;
    max-height: 44px;
}

.portal-topbar-actions {
    display: flex;
    align-items: center;
    gap: .55rem;
    min-height: 2.45rem;
}

body.portal-page .portal-main-site-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: .45rem;
    min-height: 2.45rem;
    color: #111827 !important;
    background: #fff !important;
    border-color: rgba(255, 255, 255, .9) !important;
    line-height: 1.15;
    font-weight: 650;
    white-space: nowrap;
    box-shadow: none;
}

body.portal-page .portal-main-site-link:hover,
body.portal-page .portal-main-site-link:focus {
    color: var(--portal-brand-red-dark) !important;
    background: #fff1f3 !important;
    border-color: #fff1f3 !important;
    transform: translateY(-1px);
}

.portal-topbar-icon {
    width: 2.45rem;
    height: 2.45rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, .9) !important;
    background: rgba(255, 255, 255, .1) !important;
    border: 1px solid rgba(255, 255, 255, .08);
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease, transform .15s ease;
}

.portal-topbar-icon:hover,
.portal-topbar-icon:focus {
    color: #fff !important;
    background: rgba(237, 27, 52, .92) !important;
    border-color: rgba(237, 27, 52, .92);
    transform: translateY(-1px);
}

body.portal-page .portal-sidebar {
    box-shadow: none !important;
}

body.portal-page .portal-side-link.active {
    background: #fff1f3 !important;
    color: var(--portal-brand-red-dark) !important;
    transform: translateX(2px);
}

.portal-home-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.65rem 1.8rem;
    border: 1px solid var(--portal-border);
    border-left: .3rem solid var(--portal-brand-red);
    border-radius: 1.35rem;
    background: #fff;
}

.portal-eyebrow,
.portal-priority-label,
.portal-simple-card-label {
    color: var(--portal-brand-red);
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.portal-home-title {
    font-size: clamp(1.65rem, 3vw, 2.25rem);
    font-weight: 760;
    letter-spacing: -.035em;
}

.portal-home-lead {
    color: var(--portal-muted);
    font-size: 1rem;
}

.portal-status-ok {
    color: var(--portal-success);
}

.portal-home-site-btn {
    white-space: nowrap;
}

.portal-priority-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding: 1.15rem 1.25rem;
    border: 1px solid rgba(237, 27, 52, .16);
    border-radius: 1.2rem;
    background: #fff;
}

.portal-priority-icon {
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--portal-brand-red);
}

.portal-priority-card h2 {
    margin: .12rem 0 .2rem;
    font-size: 1.15rem;
    font-weight: 750;
}

.portal-priority-card p {
    margin: 0;
    color: var(--portal-muted);
}

.portal-priority-warning {
    border-color: rgba(181, 71, 8, .22);
}

.portal-priority-warning .portal-priority-icon {
    background: var(--portal-warning);
}

.portal-priority-warning .portal-priority-label {
    color: var(--portal-warning);
}

.portal-home-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.portal-simple-card {
    display: flex;
    gap: .95rem;
    min-width: 0;
    padding: 1.2rem;
    border: 1px solid var(--portal-border);
    border-radius: 1.2rem;
    background: #fff;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.portal-simple-card:hover {
    transform: translateY(-2px);
    border-color: rgba(237, 27, 52, .18);
    box-shadow: 0 14px 30px rgba(17, 24, 39, .06);
}

.portal-simple-card-icon {
    width: 2.55rem;
    height: 2.55rem;
    flex: 0 0 auto;
    border-radius: .9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--portal-brand-red);
    background: #fff1f3;
}

.portal-simple-card-body {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
}

.portal-simple-card-value {
    margin-top: .22rem;
    color: #111827;
    font-size: 1.55rem;
    line-height: 1.15;
    letter-spacing: -.025em;
}

.portal-simple-card-value-text {
    font-size: 1.02rem;
    line-height: 1.35;
    letter-spacing: -.01em;
}

.portal-simple-card-note {
    margin-top: .35rem;
    color: var(--portal-muted);
    font-size: .87rem;
    line-height: 1.42;
}

.portal-simple-link {
    margin-top: auto;
    padding-top: .75rem;
    color: var(--portal-brand-red);
    font-size: .88rem;
    font-weight: 750;
    text-decoration: none;
}

.portal-simple-link:hover {
    color: var(--portal-brand-red-dark);
    text-decoration: underline;
}

.portal-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.portal-document-list {
    display: grid;
    gap: .15rem;
}

.portal-document-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: .85rem;
    padding: .8rem .25rem;
    border-top: 1px solid rgba(17, 24, 39, .07);
}

.portal-document-row:first-child {
    border-top: 0;
}

.portal-document-symbol {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: .75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--portal-brand-red);
    background: #fff1f3;
}

.portal-document-copy {
    display: grid;
    min-width: 0;
}

.portal-document-copy strong {
    overflow: hidden;
    color: #111827;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-document-copy span {
    color: var(--portal-muted);
    font-size: .84rem;
}

.portal-document-open {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    background: #f4f4f5;
    text-decoration: none;
}

.portal-document-open:hover {
    color: #fff;
    background: var(--portal-brand-red);
}

.portal-account-details {
    margin-bottom: 1.5rem;
    padding: 1rem 1.15rem;
    border: 1px solid var(--portal-border);
    border-radius: 1.15rem;
    background: #fff;
}

.portal-account-details summary {
    cursor: pointer;
    color: #374151;
    font-weight: 700;
}

.portal-account-details-content {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .9rem;
    margin-top: 1rem;
}

.portal-account-details-content > div {
    display: grid;
    gap: .15rem;
}

.portal-account-details-content span {
    color: var(--portal-muted);
    font-size: .78rem;
}

.portal-account-details-content strong {
    overflow-wrap: anywhere;
    font-weight: 600;
}

@media (max-width: 991.98px) {
    .portal-topbar-inner {
        width: min(100% - 1.4rem, 1440px);
        min-height: 68px;
    }

    .portal-brand-logo {
        max-width: 230px;
        max-height: 40px;
    }

    .portal-home-grid {
        grid-template-columns: 1fr 1fr;
    }

    .portal-simple-card:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 767.98px) {
    body.portal-page-authenticated {
        padding-bottom: calc(5.2rem + env(safe-area-inset-bottom));
    }

    .portal-topbar-inner {
        width: min(100% - 1.1rem, 1440px);
        min-height: 64px;
    }

    .portal-brand-logo {
        max-width: 176px;
        max-height: 32px;
    }

    .portal-main-site-link span,
    .portal-main-site-link .me-1 {
        display: none;
    }

    .portal-main-site-link {
        width: 2.45rem;
        height: 2.45rem;
        padding: 0 !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    body.portal-page .portal-app-shell {
        width: min(100% - 1rem, 1440px) !important;
        margin: .75rem auto 1rem !important;
    }

    body.portal-page .portal-sidebar {
        position: fixed;
        z-index: 1060;
        left: .55rem;
        right: .55rem;
        bottom: max(.55rem, env(safe-area-inset-bottom));
        min-height: 0;
        margin: 0;
        padding: .4rem;
        border-radius: 1.15rem !important;
        background: rgba(255, 255, 255, .97) !important;
        box-shadow: 0 14px 38px rgba(17, 24, 39, .18) !important;
        backdrop-filter: blur(16px);
        overflow: visible;
    }

    .portal-side-nav {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        min-width: 0;
        gap: .2rem;
    }

    body.portal-page .portal-side-link {
        min-width: 0;
        min-height: 3.55rem;
        padding: .45rem .2rem;
        gap: .18rem;
        flex-direction: column;
        justify-content: center;
        border-radius: .85rem;
        font-size: .67rem;
        line-height: 1.12;
        text-align: center;
        white-space: normal;
        transform: none !important;
    }

    .portal-side-link i {
        width: auto;
        font-size: 1rem;
    }

    .portal-nav-count {
        position: absolute;
        top: .15rem;
        right: .25rem;
        min-width: 1.15rem;
        height: 1.15rem;
        padding: 0 .28rem;
        font-size: .61rem;
    }

    .portal-side-link {
        position: relative;
    }

    .portal-home-hero,
    .portal-priority-card {
        grid-template-columns: 1fr;
        align-items: flex-start;
    }

    .portal-home-hero {
        padding: 1.25rem;
    }

    .portal-home-site-btn,
    .portal-priority-button {
        width: 100%;
    }

    .portal-home-grid {
        grid-template-columns: 1fr;
    }

    .portal-simple-card:last-child {
        grid-column: auto;
    }

    .portal-section-heading {
        align-items: flex-start;
    }

    .portal-document-row {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .portal-document-row .badge {
        grid-column: 2 / 3;
        justify-self: start;
    }

    .portal-document-open {
        grid-column: 3;
        grid-row: 1 / 3;
    }

    .portal-account-details-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 380px) {
    .portal-brand-logo { max-width: 148px; }
    .portal-topbar-actions { gap: .3rem; }
    .portal-topbar-icon { width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
    .portal-simple-card,
    .portal-topbar-icon,
    .portal-document-open {
        transition: none;
    }
}
