/* ============================================================
   MAPi · plateforme ADMIN (équipes internes)
   L'Admin est une plateforme à part entière, choisie dans le
   sélecteur en pied de navbar (js/platform.js → ?app=admin →
   shell.js pose body.is-admin). Par client : un seul bouton
   discret .adm-btn qui ouvre un popover d'outils internes
   (Drive, HubSpot, Notion, fiche données). Préfixe adm-.
   ============================================================ */

/* ---------- Bouton outils internes, par client ---------- */
.adm-btn {
    display: none; position: relative; flex-shrink: 0;
    align-items: center; justify-content: center;
    vertical-align: middle; margin-left: 4px;
    width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid #FFD9BE;
    background: var(--orange-soft); color: var(--orange-ink); cursor: pointer; padding: 0;
    transition: background .15s, border-color .15s, transform .16s cubic-bezier(.22, 1, .36, 1);
}
.adm-btn::after { content: ''; position: absolute; inset: -8px; }
body.is-admin .adm-btn { display: inline-flex; }
.adm-btn:hover { background: #FFE4D1; border-color: var(--orange); }
.adm-btn:active { transform: scale(.94); }
.adm-btn svg { width: 14px; height: 14px; }

/* ---------- Popover d'outils internes ---------- */
.adm-pop {
    position: fixed; z-index: 60; width: 288px;
    background: var(--surface); border: 1px solid var(--gray-200); border-radius: 16px;
    box-shadow: var(--shadow-lg); padding: 8px; display: none;
}
.adm-pop.is-open { display: block; }
@media (prefers-reduced-motion: no-preference) {
    .adm-pop.is-open { animation: adm-pop-in .22s cubic-bezier(.22, 1, .36, 1) both; }
    @keyframes adm-pop-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}
.adm-pop-h {
    display: flex; align-items: center; gap: 8px; padding: 8px 10px 9px;
    border-bottom: 1px solid var(--gray-200); margin-bottom: 6px;
}
.adm-pop-h .adm-k {
    font-size: 9.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
    background: var(--orange-soft); color: var(--orange-ink); border-radius: var(--radius-pill); padding: 2px 8px;
}
.adm-pop-h b { font-size: 13px; font-weight: 800; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-it {
    display: flex; align-items: center; gap: 11px; width: 100%; min-height: 46px; padding: 5px 10px;
    border: none; background: none; border-radius: 11px; cursor: pointer; text-align: left;
    text-decoration: none; transition: background .13s;
}
.adm-it:hover { background: var(--gray-100); }
.adm-it .adm-g {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 30px; height: 30px; border-radius: 9px; background: var(--blue-pale); color: var(--blue-dark);
}
.adm-it .adm-g svg { width: 16px; height: 16px; }
.adm-it .adm-tx { flex: 1; min-width: 0; }
.adm-it .adm-tx b { display: block; font-size: 13px; font-weight: 700; color: var(--text-primary); line-height: 1.3; }
.adm-it .adm-tx span { display: block; font-size: 11.5px; color: var(--text-secondary); line-height: 1.35; }
.adm-it .adm-ext { flex-shrink: 0; color: var(--text-muted); }

/* ---------- Modale fiche données ---------- */
.adm-modal .ovl-panel { width: min(620px, 100%); padding: 0; }
.adm-m-h {
    position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px;
    background: var(--surface); padding: 20px 24px 14px; border-bottom: 1px solid var(--gray-200);
}
.adm-m-h h2 { font-family: 'Museo Sans', 'Mukta Mahee', sans-serif; font-weight: 900; font-size: 19px; color: var(--text-primary); flex: 1; min-width: 0; }
.adm-m-close {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--gray-300);
    background: var(--surface); color: var(--text-secondary); cursor: pointer;
}
.adm-m-close:hover { border-color: var(--blue); color: var(--blue-dark); background: var(--blue-pale); }
.adm-m-body { padding: 16px 24px 22px; }
.adm-m-sec {
    font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
    color: var(--text-secondary); margin: 16px 0 8px;
}
.adm-m-sec:first-child { margin-top: 0; }
.adm-dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 18px; margin: 0; }
.adm-dl > div { min-width: 0; }
.adm-dl dt { font-size: 11.5px; font-weight: 700; color: var(--text-secondary); }
.adm-dl dd { font-size: 14px; font-weight: 600; color: var(--text-primary); margin: 0; overflow-wrap: break-word; }
.adm-m-foot { display: flex; gap: 10px; flex-wrap: wrap; padding: 4px 24px 22px; }
.adm-copy.is-ok { background: var(--green); color: #fff; border-color: var(--green); }
@media (max-width: 560px) { .adm-dl { grid-template-columns: 1fr; } }

/* ---------- Thème Sombre (chrome d) ---------- */
/* Bouton outils internes : le liseré et le survol pêche pastel passent en
   ambrés nuit de la même famille que --orange-soft sombre (aucun jeton de
   bordure orange n'existe). Le sélecteur Admin orange plein reste tel quel. */
html[data-chrome="d"] .adm-btn { border-color: #74472A; }
html[data-chrome="d"] .adm-btn:hover { background: #4A331F; border-color: var(--orange); }
