/**
 * Profil des pages d'accueil des applications : sectorisation, prévision des ventes,
 * lignes de traitement. Elles présentent toutes une liste de projets ou de
 * scénarios, et adoptent la mise en page du portail applications clients
 * (module-selection.html) : pas de barre latérale, un en-tête à pastille, et une grille
 * de cartes à vignette dont l'action principale est « Ouvrir → ».
 *
 * Les valeurs sont reprises de la feuille interne de module-selection.html, mais les
 * classes portent le préfixe pl- : les trois applications définissent déjà leurs propres
 * .btn-primary, .header-actions ou .card, et les écraser aurait touché leurs pages
 * internes. tools/check-listes.mjs compare les styles calculés des quatre pages et
 * signale toute dérive entre cette feuille et celle du portail.
 */

.pl-body {
    background: #f8fafc;
    color: #0f172a;
    min-height: 100vh;
}

/* La barre latérale a disparu de ces pages : plus de décalage à réserver à gauche.
   La règle est nécessaire parce que les feuilles partagées des applications posent une
   marge sur .main pour la loger, et qu'elles servent aussi aux pages internes. */
.pl-body .main,
.pl-body .app { margin-left: 0; padding: 0; display: block; }

.pl-container { max-width: 1320px; margin: 0 auto; padding: 2.5rem 1.5rem; }

/* ---------------------------------------------------------------- en-tête */

.pl-header {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 1rem; margin-bottom: 1.6rem; flex-wrap: wrap;
}
.pl-titlewrap { display: flex; flex-direction: column; gap: 0.3rem; }
.pl-badge {
    display: inline-flex; align-items: center; gap: 0.4rem;
    background: rgba(0, 117, 201, 0.10); color: #0075c9;
    font-size: 0.66rem; font-weight: 800; letter-spacing: 0.16em;
    text-transform: uppercase; padding: 0.28rem 0.6rem; border-radius: 999px; width: fit-content;
    margin-bottom: 0.85rem;
}
.pl-badge::before {
    content: ""; width: 0.4rem; height: 0.4rem; border-radius: 50%;
    background: #0075c9; box-shadow: 0 0 0 3px rgba(0, 117, 201, 0.18);
}
.pl-title {
    font-size: 1.6rem; font-weight: 800; color: #0c2a55; margin: 0;
    letter-spacing: -0.02em; line-height: 1.2;
}
.pl-subtitle {
    font-size: 0.9rem; color: #64748b; margin: 0; max-width: 780px; line-height: 1.45;
}
.pl-actions { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }

/* Retour vers l'accueil du dashboard, qui remplace le « Vers Memento Pharma » que
   portait le pied de la barre latérale. */
.pl-home {
    display: inline-flex; align-items: center; gap: 0.45rem;
    background: #f6f8fb; color: #475569; border: 1px solid #eef2f7;
    text-decoration: none; font-family: inherit;
    font-size: 0.85rem; font-weight: 600; padding: 0.6rem 1rem; border-radius: 10px;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.pl-home:hover { background: #eaf3fc; border-color: #cfe3f6; color: #0075c9; }
.pl-home svg { width: 16px; height: 16px; }

.pl-btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    background: #fff; color: #334155; border: 1px solid #e5e7eb; cursor: pointer;
    font-family: inherit; text-decoration: none;
    font-size: 0.85rem; font-weight: 600; padding: 0.6rem 1rem; border-radius: 10px;
    transition: border-color 0.2s ease, color 0.2s ease;
}
.pl-btn:hover { border-color: #cbd5e1; color: #0075c9; }
.pl-btn--primary {
    background: #0075c9; color: #fff; border: none;
    font-weight: 700; padding: 0.65rem 1.15rem; border-radius: 12px;
    box-shadow: 0 10px 22px -12px rgba(0,117,201,0.7);
    transition: transform 0.2s ease, background 0.2s ease;
}
.pl-btn--primary:hover { background: #005fa3; color: #fff; transform: translateY(-1px); }
.pl-btn svg { width: 16px; height: 16px; }

/* ---------------------------------------------------------------- grille */

.pl-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem;
}

.pl-card {
    position: relative;
    background: #fff;
    border-radius: 20px; border: 1px solid #eef2f7;
    display: flex; flex-direction: column; overflow: hidden;
    text-decoration: none; color: inherit;
    transition: transform 0.3s cubic-bezier(.2,.9,.3,1), box-shadow 0.35s ease, border-color 0.25s ease;
    box-shadow: 0 14px 36px -26px rgba(15,23,42,0.30);
    min-height: 100%;
}
.pl-card:hover {
    transform: translateY(-5px);
    border-color: #dbe7f3;
    box-shadow: 0 28px 48px -28px rgba(15,23,42,0.35);
}
/* Sectorisation et prévisions ouvrent leur projet par une fonction, pas par une URL :
   leurs cartes sont des div. D'où le curseur et le focus posés ici plutôt que hérités
   du lien, pour qu'elles se comportent comme les cartes du portail. */
.pl-card[data-open] { cursor: pointer; }
.pl-card:focus-visible { outline: 2px solid #0075c9; outline-offset: 3px; }

.pl-cover {
    position: relative;
    height: 140px;
    background: linear-gradient(135deg, #e8f4fc 0%, #f1f5f9 55%, #dceaf6 100%);
    overflow: hidden;
    flex-shrink: 0;
}
/* Une image de couverture posée sur le projet, comme les cartes du portail. Le léger
   agrandissement au survol reprend celui de .accueil-app-card:hover .app-cover img. */
.pl-cover img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transition: transform 0.45s cubic-bezier(.2,.9,.3,1);
}
.pl-card:hover .pl-cover img { transform: scale(1.04); }

/* Faute d'image, la vignette porte l'initiale du projet, comme le repli du portail. */
.pl-cover-initiale {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.4rem; font-weight: 800; color: rgba(12, 42, 85, 0.22);
    letter-spacing: -0.03em;
    background:
        radial-gradient(circle at 30% 30%, rgba(0,117,201,0.18), transparent 55%),
        linear-gradient(135deg, #e8f4fc 0%, #f8fafc 100%);
}

.pl-tag {
    position: absolute; top: 12px; left: 12px; z-index: 2;
    background: #fff; color: #475569;
    font-size: 0.6rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
    padding: 0.24rem 0.55rem; border-radius: 999px;
    box-shadow: 0 6px 14px -8px rgba(15,23,42,0.45);
}

/* Supprimer, renommer, dupliquer, partager : quatre intitulés sous chaque carte
   pesaient plus que la carte elle-même. Ils sont devenus des icônes posées sur la
   vignette, comme les actions d'administration du portail, et se nomment à l'infobulle. */
.pl-card-actions {
    position: absolute; top: 10px; right: 10px; z-index: 3;
    display: flex; gap: 0.35rem;
}
.pl-icon-btn {
    width: 34px; height: 34px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.65);
    background: rgba(255,255,255,0.92); color: #334155; cursor: pointer; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 14px -8px rgba(15,23,42,0.45);
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.pl-icon-btn:hover { background: #fff; color: #0075c9; transform: translateY(-1px); }
.pl-icon-btn--danger:hover { color: #dc2626; }
.pl-icon-btn svg { width: 15px; height: 15px; }

.pl-card-body {
    padding: 1.15rem 1.25rem 1.2rem;
    display: flex; flex-direction: column; flex: 1; gap: 0.35rem;
}
.pl-card-title { font-size: 1.05rem; font-weight: 800; color: #0f172a; margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
.pl-card-desc { font-size: 0.78rem; color: #64748b; margin: 0; line-height: 1.45; }
.pl-card-meta {
    margin-top: 0.5rem;
    display: flex; flex-direction: column; gap: 0.2rem;
    font-size: 0.72rem; color: #94a3b8; line-height: 1.4;
}

.pl-open {
    margin-top: auto; padding-top: 0.95rem;
    display: inline-flex; align-items: center; gap: 0.35rem;
    font-size: 0.78rem; font-weight: 700; color: #0075c9;
    transition: gap 0.2s ease;
}
.pl-card:hover .pl-open { gap: 0.7rem; }
.pl-open svg { width: 15px; height: 15px; }

/* ------------------------------------------------- états vide et chargement */

.pl-state {
    grid-column: 1/-1; text-align: center; background: #fff; border: 1px solid #eef2f7;
    border-radius: 22px; padding: 3rem 1.5rem; box-shadow: 0 14px 36px -26px rgba(15,23,42,0.30);
}
.pl-state h3 { font-size: 1.05rem; color: #0f172a; margin: 0 0 0.4rem; }
.pl-state p { font-size: 0.85rem; color: #64748b; margin: 0 0 1.2rem; }
.pl-skeleton {
    height: 260px; border-radius: 20px; border: 1px solid #eef2f7;
    background: linear-gradient(100deg, #f1f5f9 30%, #f8fafc 50%, #f1f5f9 70%);
    background-size: 200% 100%; animation: pl-shimmer 1.3s infinite;
}
@keyframes pl-shimmer { to { background-position: -200% 0; } }

@media (max-width: 640px) {
    .pl-container { padding: 1.5rem 1rem; }
    .pl-grid { grid-template-columns: 1fr; }
    .pl-title { font-size: 1.3rem; }
}
