/* GulApps - theme portail moderne GULDAGIL */

:root {
    --pg1510-blue-deep: #07507c;
    --pg1510-blue: #087eb5;
    --pg1510-blue-dark: #073f66;
    --pg1510-cyan: #18bfd0;
    --pg1510-cyan-soft: #e6f8fb;
    --pg1510-lime: #b8d936;
    --pg1510-lime-dark: #6f8f10;
    --pg1510-water: #f2fbfd;
    --pg1510-bg: #f4f8fa;
    --pg1510-card: #ffffff;
    --pg1510-text: #173042;
    --pg1510-muted: #61798a;
    --pg1510-border: #d8e8ee;
    --pg1510-warning: #c58a10;
    --pg1510-danger: #b6423c;
    --pg1510-radius: 18px;
    --pg1510-radius-sm: 12px;
    --pg1510-shadow: 0 18px 42px rgba(7, 80, 124, .11);
    --pg1510-soft-shadow: 0 8px 22px rgba(7, 80, 124, .08);
}

.pg-page-portal-v1510,
body.pg-page-admin {
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 8%, rgba(24, 191, 208, .18) 0 120px, transparent 121px),
        radial-gradient(circle at 86% 18%, rgba(184, 217, 54, .18) 0 86px, transparent 87px),
        linear-gradient(180deg, #eef9fb 0, var(--pg1510-bg) 320px, #f7fafb 100%);
    color: var(--pg1510-text);
}

/* Le header connecté est désormais défini uniquement par header-v2000.css. */

.pg1510-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: .84rem;
    font-weight: 900;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: transform .14s ease, box-shadow .14s ease, background .14s ease;
}

.pg1510-btn:hover {
    transform: translateY(-1px);
}

.pg1510-btn--primary {
    background: var(--pg1510-blue-deep);
    color: #fff;
    box-shadow: 0 8px 20px rgba(7, 80, 124, .18);
}

.pg1510-btn--accent {
    background: var(--pg1510-lime);
    color: #263400;
    box-shadow: 0 10px 22px rgba(111, 143, 16, .18);
}

.pg1510-btn--ghost {
    border-color: rgba(255, 255, 255, .34);
    color: #fff;
    background: rgba(255, 255, 255, .1);
}

.pg1510-btn--technical {
    opacity: .78;
}

.pg1510-btn--technical:hover {
    opacity: 1;
}

.pg1510-btn--secondary {
    background: #fff;
    border-color: #cbe5ee;
    color: var(--pg1510-blue-deep);
}

.pg1510-btn--disabled {
    background: #edf3f5;
    border-color: #d6e3e8;
    color: #8397a4;
    cursor: not-allowed;
}

.pg1510-shell {
    width: min(1380px, calc(100% - 36px));
    margin: 0 auto;
    padding: 30px 0 48px;
}

/* ── Admin Modern Shell — layout flex non superposé (V1.600-beta) ──────────── */
/*
 * Remplace l'ancien .pg1510-admin-sidebar { position:fixed } qui recouvrait
 * le contenu. Structure :
 *   .admin-modern-shell   — wrapper flex horizontal (ouvert par admin-sidebar-modern.php)
 *   .admin-modern-sidebar — colonne gauche sticky
 *   .admin-modern-main    — colonne droite, contenu de la page
 */
.admin-modern-shell {
    display: flex;
    align-items: flex-start;
    width: min(1380px, 100%);
    margin: 0 auto;
    padding: 0 18px;
    box-sizing: border-box;
}

.admin-modern-sidebar {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 66px; /* hauteur du header connecté canonique, bordure incluse */
    max-height: calc(100vh - 66px);
    overflow-y: auto;
    padding: 14px;
    border: 1px solid rgba(216, 232, 238, .95);
    border-radius: 18px;
    background: rgba(255, 255, 255, .92);
    box-shadow: var(--pg1510-soft-shadow);
    backdrop-filter: blur(8px);
    margin-top: 24px;
    margin-right: 24px;
    /* Scrollbar discrète */
    scrollbar-width: thin;
    scrollbar-color: rgba(7, 80, 124, .15) transparent;
}

.admin-modern-sidebar::-webkit-scrollbar { width: 4px; }
.admin-modern-sidebar::-webkit-scrollbar-thumb {
    background: rgba(7, 80, 124, .15);
    border-radius: 2px;
}

.admin-modern-main {
    flex: 1;
    min-width: 0;
}

/* Styles visuels internes sidebar — réutilisés via .pg1510-admin-sidebar__* */
.pg1510-admin-sidebar {
    /* Plus de position:fixed — le positionnement est géré par .admin-modern-sidebar */
}

.pg1510-admin-sidebar__title {
    margin: 0 0 10px;
    padding: 0 4px 10px;
    border-bottom: 1px solid #e4f0f4;
    color: var(--pg1510-blue-deep);
    font-size: .78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.pg1510-admin-sidebar__nav {
    display: grid;
    gap: 6px;
}

.pg1510-admin-sidebar__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 52px;
    padding: 9px 11px;
    border: 1px solid transparent;
    border-radius: 14px;
    color: var(--pg1510-text);
    text-decoration: none;
}

.pg1510-admin-sidebar__item:hover,
.pg1510-admin-sidebar__item.is-active {
    border-color: #cbe5ee;
    background: #eef9fb;
    color: var(--pg1510-blue-deep);
}

.pg1510-admin-sidebar__item strong,
.pg1510-admin-sidebar__item small {
    display: block;
}

.pg1510-admin-sidebar__item strong {
    font-size: .86rem;
    line-height: 1.2;
}

.pg1510-admin-sidebar__item small {
    margin-top: 3px;
    color: var(--pg1510-muted);
    font-size: .7rem;
    font-weight: 800;
}

.pg1510-admin-sidebar__item.is-planned {
    opacity: .64;
    cursor: not-allowed;
}

.pg1510-admin-sidebar__item em {
    padding: 3px 7px;
    border-radius: 999px;
    background: #eef3f5;
    color: #6d8392;
    font-size: .66rem;
    font-style: normal;
    font-weight: 900;
}

/* .pg1510-admin-sidebar ~ .pg-admin-layout — supprimé V1.600-beta :
   remplacé par .admin-modern-shell/.admin-modern-main (layout flex propre). */

.adr-local-nav {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 0 0 1.25rem;
}

.adr-local-nav__link {
    display: inline-flex;
    align-items: center;
    min-height: 2.35rem;
    padding: .55rem .85rem;
    border: 1px solid rgba(26, 79, 122, .14);
    border-radius: 999px;
    background: #fff;
    color: var(--gul-blue);
    font-size: .9rem;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 5px 14px rgba(7, 80, 124, .05);
}

.adr-local-nav__link:hover,
.adr-local-nav__link.is-active {
    background: #eaf3fb;
    border-color: rgba(26, 79, 122, .28);
    color: #073f66;
}

.pg-admin-roadmap-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}

.pg-admin-roadmap-list li {
    padding: 7px 10px;
    border: 1px solid #dbeaf0;
    border-radius: 999px;
    background: #f8fcfd;
    color: var(--pg1510-muted);
    font-size: .82rem;
    font-weight: 800;
}

.pg1510-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(290px, .8fr);
    gap: 20px;
    align-items: stretch;
    margin-bottom: 24px;
}

.pg1510-panel,
.pg1510-card {
    background: rgba(255, 255, 255, .94);
    border: 1px solid var(--pg1510-border);
    border-radius: var(--pg1510-radius);
    box-shadow: var(--pg1510-shadow);
}

.pg1510-panel {
    padding: 26px;
}

.pg1510-hero > .pg1510-panel:first-child {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 94% 18%, rgba(24, 191, 208, .18) 0 84px, transparent 86px),
        radial-gradient(circle at 84% 78%, rgba(184, 217, 54, .16) 0 64px, transparent 66px),
        #fff;
}

.pg1510-hero > .pg1510-panel:first-child::after {
    content: "";
    position: absolute;
    right: 28px;
    bottom: 26px;
    width: 92px;
    height: 92px;
    border: 16px solid rgba(24, 191, 208, .12);
    border-radius: 50%;
    /* Purement décoratif : sans ceci, cet anneau positionné peint AU-DESSUS
       du contenu statique du panneau (règles de stacking CSS — un élément
       positionné sans z-index passe après le contenu en flux normal, même
       sans z-index explicite ni rapport avec l'ordre dans le DOM), et
       intercepte les clics sur tout ce qu'il recouvre visuellement. Repéré
       en production : le bouton « Plus » ne reste sur la même ligne que le
       titre qu'à partir d'une certaine largeur (fin de l'empilement du flex
       `.adr-head`), où il finit par chevaucher cette zone. */
    pointer-events: none;
}

.pg1510-eyebrow {
    margin: 0 0 9px;
    color: var(--pg1510-blue);
    font-size: .78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.pg1510-title {
    max-width: 760px;
    margin: 0;
    color: var(--pg1510-blue-dark);
    font-size: 2rem;
    line-height: 1.12;
    font-weight: 900;
}

.pg1510-copy {
    max-width: 780px;
    margin: 12px 0 0;
    color: var(--pg1510-muted);
    font-size: .97rem;
    line-height: 1.6;
}

.pg1510-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.pg1510-kpi {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.pg1510-kpi__item {
    min-height: 112px;
    padding: 18px;
    background:
        linear-gradient(180deg, #fff 0%, #f8fdfe 100%);
    border: 1px solid var(--pg1510-border);
    border-radius: var(--pg1510-radius-sm);
    box-shadow: var(--pg1510-soft-shadow);
}

.pg1510-kpi__value {
    display: block;
    color: var(--pg1510-blue-deep);
    font-size: 1.55rem;
    font-weight: 900;
    line-height: 1.1;
    word-break: break-word;
}

.pg1510-kpi__label {
    display: block;
    margin-top: 8px;
    color: var(--pg1510-muted);
    font-size: .78rem;
    font-weight: 800;
}

.pg1510-section {
    margin-top: 26px;
}

.pg1510-section__head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.pg1510-section__head h2,
.pg1510-result-card h2 {
    margin: 0;
    color: var(--pg1510-blue-dark);
    font-size: 1.1rem;
    font-weight: 900;
}

.pg1510-section__head p {
    margin: 5px 0 0;
    color: var(--pg1510-muted);
    font-size: .88rem;
}

.pg1510-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.pg1510-card {
    min-height: 204px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 13px;
    position: relative;
    overflow: hidden;
    transition: transform .16s ease, box-shadow .16s ease;
}

.pg1510-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 48px rgba(7, 80, 124, .14);
}

.pg1510-card::after {
    content: "";
    position: absolute;
    right: -30px;
    top: -30px;
    width: 112px;
    height: 112px;
    border-radius: 50%;
    background: rgba(24, 191, 208, .1);
    /* Purement décoratif — voir .pg1510-hero > .pg1510-panel:first-child::after
       ci-dessus : un élément positionné sans z-index peint au-dessus du
       contenu en flux normal de la carte et intercepterait les clics sur
       tout bouton/lien placé dans son coin. */
    pointer-events: none;
}

.pg1510-card--cyan::after { background: rgba(24, 191, 208, .16); }
.pg1510-card--lime::after { background: rgba(184, 217, 54, .18); }
.pg1510-card--muted::after { background: rgba(97, 121, 138, .12); }

.pg1510-card.is-disabled {
    opacity: .72;
}

.pg1510-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.pg1510-card__icon {
    display: inline-flex;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: var(--pg1510-cyan-soft);
    color: var(--pg1510-blue-deep);
    font-size: .92rem;
    font-weight: 900;
    box-shadow: inset 0 0 0 1px rgba(24, 191, 208, .18);
}

.pg1510-card--lime .pg1510-card__icon {
    background: #f0f8ce;
    color: var(--pg1510-lime-dark);
}

.pg1510-card--muted .pg1510-card__icon {
    background: #eef3f5;
    color: #6d8392;
}

.pg1510-card h3 {
    margin: 0;
    color: var(--pg1510-text);
    font-size: 1.02rem;
    font-weight: 900;
    position: relative;
    z-index: 1;
}

.pg1510-card p {
    margin: 0;
    color: var(--pg1510-muted);
    font-size: .86rem;
    line-height: 1.5;
    flex: 1;
    position: relative;
    z-index: 1;
}

.pg1510-card__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.pg1510-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #eef6f8;
    color: var(--pg1510-muted);
    font-size: .72rem;
    font-weight: 900;
    white-space: nowrap;
}

.pg1510-pill--ready {
    background: #edf8cd;
    color: var(--pg1510-lime-dark);
}

.pg1510-pill--soon {
    background: #e6f8fb;
    color: var(--pg1510-blue);
}

.pg1510-preview .pg1510-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, .7fr);
    gap: 22px;
    align-items: center;
}

.pg1510-result-card {
    background:
        linear-gradient(135deg, #fff 0%, #f1fbfd 100%);
}

.pg1510-result {
    padding: 18px;
    border-radius: var(--pg1510-radius-sm);
    background: #fff;
    border: 1px solid var(--pg1510-border);
    box-shadow: var(--pg1510-soft-shadow);
}

.pg1510-result__price {
    display: block;
    margin: 14px 0 12px;
    color: var(--pg1510-blue-deep);
    font-size: 2rem;
    line-height: 1;
    font-weight: 900;
}

.pg1510-result dl {
    display: grid;
    gap: 8px;
    margin: 0;
}

.pg1510-result dl div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-top: 8px;
    border-top: 1px solid #e9f2f5;
}

.pg1510-result dt {
    color: var(--pg1510-muted);
    font-size: .82rem;
    font-weight: 800;
}

.pg1510-result dd {
    margin: 0;
    color: var(--pg1510-text);
    font-size: .86rem;
    font-weight: 900;
    text-align: right;
}

.pg1510-two-col {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, .85fr);
    gap: 16px;
}

.pg1510-two-col > .pg1510-note:only-child {
    grid-column: 1 / -1;
}

.pg1510-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pg1510-list li {
    display: grid;
    grid-template-columns: 130px 1fr auto;
    gap: 12px;
    align-items: center;
    min-height: 50px;
    padding: 11px 13px;
    border: 1px solid var(--pg1510-border);
    border-radius: 14px;
    background: #fff;
    color: var(--pg1510-muted);
    font-size: .84rem;
}

.pg1510-list strong {
    color: var(--pg1510-text);
}

.pg1510-note {
    border: 1px solid color-mix(in srgb, var(--pg1510-cyan) 55%, var(--gul-border, #D6E4EC));
}

.pg1510-note p {
    margin: 0;
    color: var(--pg1510-muted);
    font-size: .9rem;
    line-height: 1.62;
}

@media (max-width: 1160px) {
    .pg1510-hero,
    .pg1510-two-col,
    .pg1510-preview .pg1510-panel {
        grid-template-columns: 1fr;
    }

    /* Admin modern shell — passage en colonne sur tablette/mobile */
    .admin-modern-shell {
        flex-direction: column;
        padding: 0 12px;
    }

    .admin-modern-sidebar {
        width: 100%;
        position: static;
        max-height: none;
        margin-top: 12px;
        margin-right: 0;
        margin-bottom: 0;
    }

    .admin-modern-sidebar .pg1510-admin-sidebar__nav {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .admin-modern-sidebar .pg1510-admin-sidebar__item {
        flex: 0 0 210px;
    }
}

@media (max-width: 820px) {
    .pg1510-shell {
        width: min(100% - 22px, 1380px);
    }

    .pg1510-btn--ghost {
        order: 4;
    }

    .pg1510-title {
        font-size: 1.48rem;
    }

    .pg1510-panel,
    .pg1510-card {
        border-radius: 16px;
    }

    .pg1510-grid,
    .pg1510-kpi {
        grid-template-columns: 1fr;
    }

    .pg1510-list li,
    .pg1510-result dl div {
        grid-template-columns: 1fr;
        display: grid;
    }

    .pg1510-result dd {
        text-align: left;
    }
}

/* Application du theme aux pages existantes quand le theme moderne est actif */

.pg-layout {
    background:
        radial-gradient(circle at 9% 12%, rgba(24, 191, 208, .14) 0 112px, transparent 113px),
        linear-gradient(180deg, #eef9fb 0, #f7fafb 420px, #f4f8fa 100%);
}

.pg-main {
    padding: 28px 18px 46px;
    align-items: flex-start;
}

.pg-main .pg-card {
    max-width: 980px;
    border: 1px solid var(--pg1510-border);
    border-radius: 22px;
    box-shadow: var(--pg1510-shadow);
    background:
        radial-gradient(circle at 94% 5%, rgba(24, 191, 208, .1) 0 78px, transparent 80px),
        #fff;
}

.pg-card__title,
.pg-tech__titre,
.pg-resultat-retenu__titre {
    color: var(--pg1510-blue-dark);
}

.pg-card__title {
    border-bottom-color: #dff2f7;
}

.pg-input,
.pg-select,
.pg-form-field input[type="number"],
.pg-form-field input[type="text"],
.pg-form-field input[type="date"],
.pg-form-field select {
    border-color: #cde4ec;
    border-radius: 12px;
    background-color: #fbfeff;
}

.pg-input:focus,
.pg-select:focus,
.pg-form-field input:focus,
.pg-form-field select:focus {
    border-color: var(--pg1510-cyan);
    box-shadow: 0 0 0 4px rgba(24, 191, 208, .16);
}

.pg-btn,
.pg-btn-submit {
    border-radius: 999px;
}

.pg-btn--primary,
.pg-btn-submit {
    background: var(--pg1510-lime);
    color: #263400;
    box-shadow: 0 10px 22px rgba(111, 143, 16, .16);
}

.pg-btn--primary:hover,
.pg-btn-submit:hover {
    background: #c8e64b;
}

.pg-alert--success,
.pg-resultat-retenu {
    background: #f3f9d7;
    border-color: color-mix(in srgb, var(--pg1510-lime) 55%, var(--gul-border, #D6E4EC));
    color: #40580a;
}

.pg-alert--info {
    background: var(--pg1510-cyan-soft);
    border-color: color-mix(in srgb, var(--pg1510-cyan) 55%, var(--gul-border, #D6E4EC));
    color: var(--pg1510-blue-deep);
}

.pg-badge,
.pg-admin-status-badge,
.pg-badge-action {
    border-radius: 999px;
}

.pg-admin-layout {
    max-width: 1380px;
    padding: 30px 18px 48px;
}

.pg-admin-page-title {
    color: var(--pg1510-blue-dark);
}

.pg-admin-hero,
.pg-admin-card,
.pg-admin-status-card,
.pg-admin-module,
.pg-transporter-card {
    border-color: var(--pg1510-border);
    border-radius: var(--pg1510-radius);
    box-shadow: var(--pg1510-soft-shadow);
    background: rgba(255, 255, 255, .96);
}

.pg-admin-hero {
    background:
        radial-gradient(circle at 92% 18%, rgba(24, 191, 208, .14) 0 80px, transparent 82px),
        #fff;
}

.pg-admin-hero__eyebrow,
.pg-admin-section-title,
.pg-admin-module__title,
.pg-transporter-card__name {
    color: var(--pg1510-blue-deep);
}

.pg-admin-module:hover,
.pg-admin-status-card:hover {
    border-color: #b7dfe9;
    box-shadow: var(--pg1510-shadow);
}

.pg-admin-module__link {
    border-radius: 999px;
    background: var(--pg1510-blue);
}

.pg-admin-module__link:hover {
    background: var(--pg1510-blue-deep);
}

.pg-footer--admin,
.pg-footer {
    border-top-color: var(--pg1510-border);
    background: rgba(255, 255, 255, .9);
}

@media (max-width: 640px) {
    .pg-main {
        padding: 18px 10px 34px;
    }

    .pg-main .pg-card,
    .pg-admin-card,
    .pg-admin-hero {
        border-radius: 16px;
    }
}
.pg-icon {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: -.12em;
}

.pg-icon--sm { font-size: .78em; }
.pg-icon--md { font-size: 1.15em; }
.pg-icon--lg { font-size: 1.85em; }
