/* =====================================================================
   Espace Client API Studio — Design System
   Base partagée par tous les écrans. Inspiré de la maquette de référence.
   ===================================================================== */

/* ---------- Tokens ---------- */
:root {
    /* Couleurs de marque */
    --brand-600: #2563eb;
    --brand-700: #1d4ed8;
    --brand-500: #3b82f6;
    --brand-50:  #eff6ff;

    /* Neutres */
    --ink-900: #0f172a;   /* titres */
    --ink-700: #334155;
    --ink-600: #475569;
    --ink-500: #64748b;   /* texte secondaire */
    --ink-400: #94a3b8;   /* labels */
    --line:    #e5e7eb;   /* bordures */
    --surface: #ffffff;   /* cartes */
    --bg:      #f4f6fa;   /* fond appli */
    --bg-soft: #f8fafc;

    /* Sémantique */
    --green-bg: #d1fae5; --green-tx: #065f46; --green-dot: #22c55e;
    --blue-bg:  #dbeafe; --blue-tx:  #1e40af;
    --amber:    #f59e0b;
    --danger:   #dc2626; --danger-bg: #fef2f2; --danger-bd: #fecaca;
    --success:  #16a34a; --success-bg: #f0fdf4; --success-bd: #bbf7d0;

    /* Élévation & rayons */
    --radius:    16px;
    --radius-sm: 10px;
    --shadow:    0 1px 2px rgba(16,24,40,.04), 0 4px 16px rgba(16,24,40,.06);
    --shadow-sm: 0 1px 2px rgba(16,24,40,.06);

    --sidebar-w: 273px; /* 248px + 5 % + 5 % */
    --topbar-h:  64px;

    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
            Helvetica, Arial, sans-serif;
}

/* ---------- Reset léger ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink-900);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    font-size: 15px;
    line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

/* ---------- Layout applicatif ---------- */
.app {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    padding: 22px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
}
.sidebar__logo { height: 75px; width: auto; display: block; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    color: var(--ink-600); font-weight: 500; font-size: 14.5px;
    transition: background .15s, color .15s;
}
.nav__item:hover { background: var(--bg-soft); color: var(--ink-900); }
.nav__item.is-active { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.nav__item i { font-size: 17px; width: 22px; text-align: center; flex: none; }

/* Groupe repliable (Performances) */
.nav__group { display: block; }
.nav__toggle { cursor: pointer; list-style: none; user-select: none; }
.nav__toggle::-webkit-details-marker { display: none; }
.nav__label { flex: 1; }
.nav__caret { font-size: 12px !important; transition: transform .15s; color: var(--ink-400); }
.nav__group[open] .nav__caret { transform: rotate(180deg); }
.nav__sub { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 4px; padding-left: 34px; }
.nav__subitem {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; border-radius: var(--radius-sm);
    color: var(--ink-600); font-weight: 500; font-size: 14px;
    transition: background .15s, color .15s;
}
.nav__subitem i { font-size: 15px; width: 18px; text-align: center; flex: none; color: var(--ink-400); }
.nav__subitem:hover i,
.nav__subitem.is-active i { color: inherit; }
.nav__subitem:hover { background: var(--bg-soft); color: var(--ink-900); }
.nav__subitem.is-active { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }

.sidebar__spacer { flex: 1; }
.sidebar__footer { display: flex; flex-direction: column; gap: 2px; padding-top: 10px; }

/* ---------- Topbar ---------- */
.topbar {
    height: var(--topbar-h);
    background: var(--surface);
    display: flex; align-items: center;
    padding: 0 32px; gap: 16px;
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 5;
}
.topbar__spacer { flex: 1; }
.topbar__icons { display: flex; align-items: center; gap: 14px; }
.icon-btn {
    position: relative; width: 38px; height: 38px;
    display: grid; place-items: center; border-radius: 10px;
    color: var(--ink-500); background: transparent; border: none;
}
.icon-btn:hover { background: #eef1f7; color: var(--ink-700); }
.icon-btn i { font-size: 18px; }
.icon-btn__dot {
    position: absolute; top: 8px; right: 9px; width: 7px; height: 7px;
    background: var(--danger); border-radius: 50%; border: 2px solid var(--surface);
}
.topbar__sep { width: 1px; height: 28px; background: var(--line); }

/* Menus d'administration (rouge) dans la topbar */
.topbar__admin { display: flex; align-items: center; gap: 8px; }
.topbar__admin-label {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11.5px; font-weight: 800; letter-spacing: .04em;
    text-transform: uppercase; color: var(--danger);
}
.admin-link {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 12px; border-radius: 8px;
    background: var(--danger-bg); color: var(--danger);
    border: 1px solid var(--danger-bd); font-weight: 600; font-size: 13.5px;
    white-space: nowrap;
}
.admin-link i { font-size: 13px; }
.admin-link:hover { background: #fde3e3; }
.admin-link.is-active { background: var(--danger); color: #fff; border-color: var(--danger); }
@media (max-width: 860px) {
    .topbar__admin-label { display: none; }
    /* La topbar passe sur plusieurs lignes au lieu d'élargir la page
       (sinon tout le viewport est étiré et les modales sortent de l'écran). */
    .topbar { flex-wrap: wrap; height: auto; min-height: var(--topbar-h); padding: 10px 16px; row-gap: 8px; }
    .topbar__admin { flex-wrap: wrap; }
    .topbar__sep { display: none; }
}
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip__meta { text-align: right; line-height: 1.2; }
.user-chip__name { font-weight: 700; font-size: 14px; color: var(--ink-900); }
.user-chip__role { font-size: 12px; color: var(--ink-500); }
.user-chip__avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.avatar-fallback {
    width: 38px; height: 38px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--brand-600); color: #fff; font-weight: 700; font-size: 14px;
}

/* ---------- Zone de contenu ---------- */
.main { display: flex; flex-direction: column; min-width: 0; }
.content { padding: 32px; flex: 1; }
.page-head { margin: 4px 0 28px; }
.page-title {
    font-size: 30px; font-weight: 800; letter-spacing: -.02em;
    display: inline-block; padding-bottom: 10px;
    border-bottom: 3px solid var(--brand-600);
}
.page-sub { margin: 12px 0 0; color: var(--ink-500); font-size: 15px; max-width: 720px; }

/* ===================== Page Services (catalogue) ==================== */
.svc-section { margin-bottom: 44px; }
.svc-section__title { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 800; margin: 0 0 20px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.svc-section__title i { font-size: 18px; }
.svc-section__title--blue   i { color: #2563eb; }
.svc-section__title--green  i { color: #16a34a; }
.svc-section__title--amber  i { color: #f59e0b; }
.svc-section__title--purple i { color: #8b5cf6; }

.svc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 1200px) { .svc-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px)  { .svc-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .svc-grid { grid-template-columns: 1fr; } }

.svc-card {
    display: flex; flex-direction: column; gap: 12px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 24px;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.svc-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(15, 23, 42, .10); }
.svc-card__icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: #fff; font-size: 20px; flex: none; }
.svc-card__icon--blue   { background: #2563eb; }
.svc-card__icon--green  { background: #16a34a; }
.svc-card__icon--amber  { background: #f59e0b; }
.svc-card__icon--purple { background: #8b5cf6; }
.svc-card__title { font-size: 17px; font-weight: 700; margin: 0; color: var(--ink-900); }
.svc-card__desc { font-size: 13.5px; color: var(--ink-500); line-height: 1.5; margin: 0; }
.svc-card__price { font-size: 14px; font-weight: 700; color: var(--brand-700); }
.svc-card__args { display: flex; flex-wrap: wrap; gap: 6px; }
.svc-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: #d6f0e0; color: #166534; font-size: 12px; font-weight: 600; }
.svc-badge i { color: #16a34a; font-size: 11px; }
.svc-card__cta { margin-top: auto; justify-content: center; }

/* Carte d'un service déjà souscrit */
.svc-card.is-subscribed { background: #f1f3f5; border-color: #dde1e6; }
.svc-card__icon--subscribed { background: #166534; }
.svc-card__cta--subscribed { background: #16a34a; border-color: #16a34a; color: #fff; cursor: default; pointer-events: none; }

/* ---------- Cartes ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card__head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 22px 26px; border-bottom: 1px solid var(--line);
}
.card__title { font-size: 19px; font-weight: 700; }
.card__body { padding: 26px; }

/* ---------- Grille de la page compte ---------- */
.account-grid {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 24px;
    align-items: start;
}

/* Carte profil */
.profile { padding: 30px 26px; text-align: center; }
.profile__avatar-wrap { position: relative; width: 116px; margin: 6px auto 18px; }
.profile__avatar {
    width: 116px; height: 116px; border-radius: 50%;
    object-fit: cover; border: 4px solid var(--brand-500);
    box-shadow: 0 0 0 4px var(--surface);
}
.profile__status {
    position: absolute; right: 6px; bottom: 6px;
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--green-dot); border: 3px solid var(--surface);
    display: grid; place-items: center;
}
.profile__status i { font-size: 11px; color: #fff; }
.profile__name { font-size: 22px; font-weight: 800; margin: 0; }
.profile__role { color: var(--brand-600); font-weight: 700; margin: 4px 0 2px; }
.profile__company { color: var(--ink-500); font-size: 14px; }
.profile__lastlogin { color: var(--ink-400); font-size: 13px; margin-top: 12px; }
.profile__badges { display: flex; gap: 8px; justify-content: center; margin: 16px 0 0; }
.profile__divider { height: 1px; background: var(--line); margin: 22px 0; }
.profile__stats { display: flex; justify-content: center; gap: 56px; }
.stat { text-align: center; }
.stat__num { font-size: 20px; font-weight: 800; }
.stat__label { font-size: 13px; color: var(--ink-500); }

/* Badges */
.badge {
    display: inline-flex; align-items: center;
    padding: 5px 12px; border-radius: 999px;
    font-size: 12px; font-weight: 700; letter-spacing: .03em;
}
.badge--green { background: var(--green-bg); color: var(--green-tx); }
.badge--blue  { background: var(--blue-bg);  color: var(--blue-tx); }

/* Champs coordonnées */
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 32px; }
.field__label {
    display: flex; align-items: center; gap: 7px;
    font-size: 12px; font-weight: 700; letter-spacing: .04em;
    text-transform: uppercase; color: var(--ink-400); margin-bottom: 6px;
}
.field__label i { font-size: 13px; width: 16px; text-align: center; }
.field__value { font-size: 15.5px; color: var(--ink-900); font-weight: 500; }
.field--full { grid-column: 1 / -1; }

/* Carte sécurité */
.security {
    margin-top: 24px;
    display: flex; align-items: center; gap: 18px;
    padding: 22px 26px;
    background: #eef2fb;
    border: 1px solid #dce4f5;
    border-radius: var(--radius);
}
.security__icon {
    width: 46px; height: 46px; border-radius: 12px; flex: none;
    background: var(--amber); color: #fff; display: grid; place-items: center;
}
.security__icon i { font-size: 21px; }
.security__title { font-weight: 700; font-size: 16px; }
.security__text { color: var(--ink-500); font-size: 14px; }
.security__link {
    margin-left: auto; color: var(--brand-700); font-weight: 700;
    display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
}

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 11px 18px; border-radius: 10px; border: 1px solid transparent;
    font-weight: 600; font-size: 14.5px; transition: background .15s, box-shadow .15s;
}
.btn i { font-size: 15px; }
.btn--primary { background: var(--brand-600); color: #fff; }
.btn--primary:hover { background: var(--brand-700); }
.btn--ghost { background: var(--surface); border-color: var(--line); color: var(--ink-700); }
.btn--ghost:hover { background: var(--bg-soft); }
.btn--block { width: 100%; justify-content: center; }
.btn--sm { padding: 7px 14px; font-size: 13px; }

/* ---------- Footer ---------- */
.footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 32px; border-top: 1px solid var(--line);
    color: var(--ink-500); font-size: 13.5px; background: var(--bg);
}
.footer a:hover { color: var(--ink-700); }
.footer__brand strong { color: var(--brand-600); }
.footer__links { display: flex; gap: 22px; }
.footer__links a { text-decoration: underline; }

/* ---------- Messages flash ---------- */
.alert {
    padding: 13px 16px; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 500; margin-bottom: 18px;
    border: 1px solid transparent;
}
.alert--error   { background: var(--danger-bg);  color: var(--danger);  border-color: var(--danger-bd); }
.alert--warning { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.alert--warning i { margin-right: 6px; }
.alert--success { background: var(--success-bg); color: var(--success); border-color: var(--success-bd); }

/* ---------- Page d'authentification ---------- */
.auth {
    min-height: 100vh;
    display: grid; place-items: center;
    background:
        radial-gradient(1200px 500px at 80% -10%, #e7eefc 0%, transparent 60%),
        var(--bg);
    padding: 24px;
}
.auth__card {
    width: 100%; max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 38px 34px;
}
.auth__brand { text-align: center; margin-bottom: 26px; }
.auth__logo { width: auto; display: inline-block; }
.auth__brand-name { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.auth__brand-sub { font-size: 13px; color: var(--ink-400); font-weight: 600; }
.auth__title { font-size: 20px; font-weight: 700; margin: 0 0 4px; }
.auth__subtitle { color: var(--ink-500); font-size: 14px; margin: 0 0 24px; }

.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 7px; color: var(--ink-700); }
.form-control {
    width: 100%; padding: 12px 14px; font-size: 15px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
    color: var(--ink-900); transition: border-color .15s, box-shadow .15s;
}
.form-control:focus {
    outline: none; border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.form-hint { font-size: 12.5px; color: var(--ink-400); margin-top: 14px; text-align: center; }

/* ---------- Page de connexion (split-screen) ---------- */
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background-color: #fbfcfe;
    background-image: radial-gradient(circle, #dfe5ef 1px, transparent 1.4px);
    background-size: 22px 22px;
}
.login {
    width: 100%;
    max-width: 1040px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #fff;
    border: 1.5px solid #c7d2fe;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(30, 58, 138, .10);
}

/* Panneau gauche illustré */
.login__left {
    position: relative;
    padding: 60px 52px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #fff;
    background: linear-gradient(160deg, #3b5bdb 0%, #2f6bed 55%, #1d4ed8 100%);
    overflow: hidden;
}
.login__left::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url(/assets/img/login-pattern.svg);
    background-size: 64px auto;
    pointer-events: none;
}
.login__left > * { position: relative; z-index: 1; }
.login__headline { font-size: 38px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 18px; }
.login__lead {
    font-size: 15.5px; line-height: 1.7;
    color: rgba(255, 255, 255, .85); max-width: 430px; margin: 0;
}

/* Illustration "mockup" en verre */
.mock {
    margin-top: 44px; max-width: 380px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .20);
    border-radius: 16px; padding: 20px 22px;
    backdrop-filter: blur(3px);
}
.mock__dots { display: flex; gap: 7px; margin-bottom: 20px; }
.mock__dots span { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .5); }
.mock__bar { height: 12px; border-radius: 6px; background: rgba(255, 255, 255, .26); margin-bottom: 12px; }
.mock__bar--80 { width: 80%; }
.mock__bar--65 { width: 65%; }
.mock__bar--72 { width: 72%; }
.mock__row { display: flex; align-items: center; justify-content: space-between; margin-top: 24px; }
.mock__circle { width: 58px; height: 58px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .4); }
.mock__btn { width: 110px; height: 36px; border-radius: 9px; background: rgba(255, 255, 255, .20); }

/* Panneau droit (formulaire) */
.login__right { display: flex; align-items: center; justify-content: center; padding: 56px 48px; }
.login__panel { width: 100%; max-width: 360px; }
.login__brand { display: flex; align-items: center; justify-content: center; margin-bottom: 26px; }
.login__brand-img { width: auto; display: block; }
.login__title { text-align: center; font-size: 24px; font-weight: 800; margin: 0 0 6px; }
.login__subtitle { text-align: center; color: var(--ink-500); font-size: 14px; margin: 0 0 28px; }
.login__notice {
    display: flex; align-items: center; gap: 8px;
    background: #fef3c7; color: #92400e; border: 1px solid #fde68a;
    border-radius: 10px; padding: 10px 12px; margin: 0 0 18px;
    font-size: 13px; font-weight: 600;
}
.login__notice i { font-size: 14px; }

.login__options {
    display: flex; align-items: center; justify-content: space-between;
    margin: 4px 0 20px; gap: 12px;
}
.remember { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-600); font-size: 14px; cursor: pointer; }
.remember input { width: 16px; height: 16px; accent-color: var(--brand-600); cursor: pointer; }
.login__magic { color: var(--brand-600); font-weight: 600; font-size: 14px; }
.login__magic:hover { text-decoration: underline; }
.remember--center { display: flex; justify-content: center; margin: 0 0 18px; }

@media (max-width: 860px) {
    .login { grid-template-columns: 1fr; max-width: 440px; }
    .login__left { display: none; }
    .login__right { padding: 44px 30px; }
}

/* ---------- Modale ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: none; }
.modal.is-open { display: block; }
body.modal-open { overflow: hidden; }
.modal__overlay { position: absolute; inset: 0; background: rgba(15, 23, 42, .5); }
.modal__dialog {
    position: relative; z-index: 1;
    width: min(560px, calc(100% - 32px));
    /* marges 40+40 comprises dans le viewport ; dvh = hauteur RÉELLEMENT
       visible sur mobile (la barre d'adresse fausse 100vh) */
    max-height: calc(100vh - 80px); max-height: calc(100dvh - 80px);
    overflow: auto;
    margin: 40px auto; background: var(--surface);
    border-radius: var(--radius); box-shadow: 0 20px 60px rgba(15, 23, 42, .28);
    animation: modalIn .18s ease;
}
@media (max-width: 640px) {
    .modal__dialog {
        margin: 12px auto;
        max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px);
    }
    .modal__body { padding: 18px 16px; }
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(12px) scale(.98); }
    to   { opacity: 1; transform: none; }
}
.modal__dialog--wide { width: min(880px, calc(100% - 32px)); }
.modal__head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px; border-bottom: 1px solid var(--line);
}
.modal__title { font-size: 18px; font-weight: 700; margin: 0; }
.modal__close {
    width: 34px; height: 34px; display: grid; place-items: center;
    border: none; background: transparent; border-radius: 8px; color: var(--ink-500);
}
.modal__close:hover { background: var(--bg-soft); color: var(--ink-700); }
.modal__close i { font-size: 18px; }
.modal__body { padding: 24px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding-top: 8px; }
.modal__error { color: var(--danger); font-size: 14px; margin: 0; }

/* Grille de formulaire */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.form-group--full { grid-column: 1 / -1; }
.field-error { color: var(--danger); font-size: 12.5px; margin: 6px 0 0; }
.field-hint { color: var(--ink-400); font-size: 12px; margin: 6px 0 0; }
.form-control--readonly { background: var(--bg-soft); color: var(--ink-500); }
.form-control.has-error {
    border-color: var(--danger); box-shadow: 0 0 0 3px rgba(220, 38, 38, .12);
}

/* Édition d'avatar */
.avatar-edit { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.avatar-edit__preview {
    width: 76px; height: 76px; border-radius: 50%; overflow: hidden;
    flex: none; border: 3px solid var(--brand-500);
}
.avatar-edit__preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-edit__fallback { width: 76px; height: 76px; font-size: 26px; }
.avatar-edit__hint { font-size: 12px; color: var(--ink-400); margin: 8px 0 0; }

/* Toast */
.toast {
    position: fixed; right: 24px; bottom: 24px; z-index: 60;
    background: var(--ink-900); color: #fff; padding: 13px 18px;
    border-radius: 10px; font-size: 14px; font-weight: 500;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .25);
    opacity: 0; transform: translateY(10px); transition: opacity .25s, transform .25s;
}
.toast.is-visible { opacity: 1; transform: none; }
.toast--success { background: var(--success); }
.toast--error { background: var(--danger); }

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

/* ---------- Page Sécurité ---------- */
.security-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
    max-width: 1248px;
}
.security-col { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
@media (max-width: 860px) {
    .security-grid { grid-template-columns: 1fr; }
}
.muted-text { color: var(--ink-500); font-size: 14px; line-height: 1.6; margin: 0 0 18px; }
.table-wrap { overflow-x: auto; }
.history { width: 100%; border-collapse: collapse; font-size: 14px; }
.history th {
    text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
    color: var(--ink-400); font-weight: 700; padding: 0 14px 10px 0; border-bottom: 1px solid var(--line);
}
.history td { padding: 11px 14px 11px 0; border-bottom: 1px solid var(--line); color: var(--ink-700); }
.history tr:last-child td { border-bottom: none; }

/* Champ code OTP + lien de renvoi */
.otp-input { letter-spacing: 10px; text-align: center; font-size: 24px; font-weight: 700; }
.otp-resend { text-align: center; margin-top: 14px; }
.link-button {
    background: none; border: none; color: var(--brand-600);
    font-weight: 600; font-size: 14px; cursor: pointer; padding: 0;
}
.link-button:hover { text-decoration: underline; }
.link-button--danger { color: var(--danger); }

/* Disposition admin : pile pleine largeur */
.admin-stack { display: flex; flex-direction: column; gap: 24px; max-width: none; }
.row-actions { display: flex; align-items: center; gap: 14px; }
.edit-actions { display: flex; align-items: center; gap: 10px; }

/* ---------- Documents : blocs catégories ---------- */
.file-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 28px; }
.file-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); padding: 20px 22px; display: flex; flex-direction: column;
    transition: box-shadow .15s, border-color .15s, transform .1s;
}
.file-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.file-card.is-active { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(59, 130, 246, .14); }
.file-card__top { display: flex; justify-content: center; padding: 8px 0 14px; }
.file-card__icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; }
.file-card__icon i { font-size: 23px; color: #fff; }
.file-card__icon--documents { background: var(--brand-600); }
.file-card__icon--images    { background: #16a34a; }
.file-card__icon--rapports  { background: #8b5cf6; }
.file-card__icon--divers    { background: #f59e0b; }
.file-card__name { text-align: center; font-weight: 700; font-size: 16px; }
.file-card__meta { text-align: center; font-size: 13px; color: var(--ink-500); margin-top: 4px; }
.file-card__size { color: var(--ink-400); }
.file-card__foot {
    display: flex; justify-content: space-between; margin-top: 16px; padding-top: 14px;
    border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-400);
}

/* ---------- Documents : icônes de format ---------- */
.ficon { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.ficon i { font-size: 17px; color: #fff; }
.ficon--pdf     { background: #ef4444; }
.ficon--word    { background: #2563eb; }
.ficon--excel   { background: #16a34a; }
.ficon--ppt     { background: #f59e0b; }
.ficon--txt     { background: #64748b; }
.ficon--image   { background: #8b5cf6; }
.ficon--archive { background: #0891b2; }
.ficon--file    { background: #94a3b8; }

/* ---------- Documents : panneau liste ---------- */
.docs-panel { padding: 22px 24px 8px; }
.docs-toolbar { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.docs-search { position: relative; flex: 1; max-width: 320px; }
.docs-search__icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-size: 15px; color: var(--ink-400); }
.docs-search__input { padding-left: 38px; }
.docs-active-filter { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.docs-active-filter a { color: var(--brand-600); font-weight: 600; }
.docs-active-filter a:hover { text-decoration: underline; }

/* Journal admin : filtres par type d'évènement */
.journal-filters { display: flex; gap: 8px; flex-wrap: wrap; }

/* Admin Espace : carte « passage d'année » des prestations */
.esp-roll-text { color: var(--ink-700); font-size: 14px; line-height: 1.6; margin: 0 0 22px; }

/* Mon Compte : préférences de notification par e-mail */
.notif-prefs { margin-top: 24px; }
.notif-prefs__hint { color: var(--ink-700); font-size: 14px; line-height: 1.6; margin: 0 0 20px; }
.notif-prefs__list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 22px; }

.docs-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.docs-table th {
    text-align: left; font-size: 12.5px; font-weight: 700; color: var(--ink-500);
    background: var(--bg-soft); padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.docs-table th:first-child { border-top-left-radius: 8px; }
.docs-table th:last-child { border-top-right-radius: 8px; }
.docs-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--ink-700); vertical-align: middle; }
.docs-table tbody tr:hover { background: var(--bg-soft); }
.docs-empty { text-align: center; color: var(--ink-400); padding: 28px 16px; }
.doc-name { display: inline-flex; align-items: center; gap: 12px; color: var(--ink-900); font-weight: 600; }
.doc-name:hover .doc-name__text { color: var(--brand-700); text-decoration: underline; }

.docs-foot { display: flex; align-items: center; justify-content: space-between; padding: 16px 0 18px; flex-wrap: wrap; gap: 12px; }
.docs-count { font-size: 13.5px; color: var(--ink-500); }
.pagination { display: flex; gap: 6px; }
.page-btn {
    min-width: 34px; height: 34px; padding: 0 8px; border-radius: 8px;
    display: inline-grid; place-items: center; font-size: 14px; font-weight: 600;
    border: 1px solid var(--line); color: var(--ink-600); background: var(--surface);
}
.page-btn:hover { background: var(--bg-soft); color: var(--ink-900); }
.page-btn.is-current { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.page-btn.is-disabled { color: #cbd5e1; pointer-events: none; opacity: .6; }

@media (max-width: 980px) { .file-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .file-cards { grid-template-columns: 1fr; } }

/* ---------- SEA : cartes statistiques ---------- */
.sea-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 28px; }
.sea-card { border-radius: 16px; padding: 22px 24px; }
.sea-card__icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: #fff; margin-bottom: 18px; }
.sea-card__icon i { font-size: 21px; }
.sea-card__num { font-size: 28px; font-weight: 800; color: var(--ink-900); letter-spacing: -.01em; }
.sea-card__label { font-size: 14px; color: var(--ink-500); margin-top: 2px; }
.sea-card--blue   { background: #eef4ff; } .sea-card--blue   .sea-card__icon { background: #2f6bed; }
.sea-card--green  { background: #ecfaf1; } .sea-card--green  .sea-card__icon { background: #16a34a; }
.sea-card--amber  { background: #fff6e9; } .sea-card--amber  .sea-card__icon { background: #f59e0b; }
.sea-card--purple { background: #f4f0fe; } .sea-card--purple .sea-card__icon { background: #8b5cf6; }

/* ============================== SEO — Résumé ========================= */
.seo-page { display: flex; flex-direction: column; gap: 80px; }
.seo-row { display: grid; gap: 20px; }
.seo-row > * { min-width: 0; } /* le contenu large (canvas, tableau) reste DANS la carte */
.seo-row--stats { grid-template-columns: 2fr 1fr 1fr 1fr 1fr; }
.seo-row--2 { grid-template-columns: 1fr 1fr; }

/* Entête de carte avec sous-titre empilé */
.card__head--stack { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* Compteur de quota (Check position) */
.check-quota { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: var(--brand-50); color: var(--brand-700); font-size: 13px; font-weight: 600; white-space: nowrap; }
.check-quota i { font-size: 14px; }
.check-quota.is-empty { background: #fdeaea; color: #dc2626; }
.card__sub { margin: 4px 0 0; font-size: 13px; font-weight: 500; color: var(--ink-500); }

/* Carte taux d'indexation : donut + texte */
.seo-index { display: flex; align-items: center; gap: 24px; padding: 24px 26px; }
.seo-index__chart { position: relative; width: 150px; height: 150px; flex: none; }
.seo-index__center { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.seo-index__pct { font-size: 26px; font-weight: 800; color: var(--ink-900); letter-spacing: -.01em; }
.seo-index__title { font-size: 17px; font-weight: 700; margin: 0 0 6px; }
.seo-index__desc { font-size: 13.5px; color: var(--ink-500); line-height: 1.55; margin: 0; }

/* Cartes stats : nombre à gauche, libellé dessous, icône à droite + hover */
.seo-stat {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 22px 24px; border: 1.5px solid transparent;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.seo-stat:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(15, 23, 42, .10); }
.seo-stat__num { font-size: 30px; font-weight: 800; color: var(--ink-900); letter-spacing: -.02em; line-height: 1; }
.seo-stat__label { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 14px; font-weight: 600; }
.seo-stat__icon { flex: none; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; color: #fff; font-size: 22px; }
.seo-stat--blue   .seo-stat__icon { background: #2f6bed; } .seo-stat--blue   .seo-stat__label { color: #2f6bed; }
.seo-stat--green  .seo-stat__icon { background: #16a34a; } .seo-stat--green  .seo-stat__label { color: #16a34a; }
.seo-stat--purple .seo-stat__icon { background: #8b5cf6; } .seo-stat--purple .seo-stat__label { color: #8b5cf6; }
.seo-stat--blue:hover   { border-color: #2f6bed; }
.seo-stat--green:hover  { border-color: #16a34a; }
.seo-stat--purple:hover { border-color: #8b5cf6; }

/* Nom du concurrent en bleu */
.seo-url strong { color: var(--brand-600); }

/* Tooltip d'info (pur CSS, accessible au clavier) */
.tip {
    position: relative; flex: none; width: 40px; height: 40px; border: 0;
    border-radius: 50%; background: transparent; color: var(--ink-400);
    cursor: help; padding: 0; line-height: 1; font-size: 30px;
    transition: color .15s;
}
.tip--sm { width: 18px; height: 18px; font-size: 13px; }
.tip:hover, .tip:focus-visible { color: var(--brand-600, #2563eb); }
.tip::after {
    content: attr(data-tip);
    position: absolute; top: calc(100% + 8px); left: 0; z-index: 30;
    width: 210px; padding: 10px 12px; border-radius: 10px;
    background: var(--ink-900, #0f172a); color: #fff;
    font-size: 12.5px; font-weight: 500; line-height: 1.45; text-align: left;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .18);
    opacity: 0; visibility: hidden; transform: translateY(-4px);
    transition: opacity .15s, transform .15s, visibility .15s;
}
.tip:hover::after, .tip:focus-visible::after { opacity: 1; visibility: visible; transform: translateY(0); }

/* Conteneur des courbes (hauteur fixe pour Chart.js responsive) */
.seo-chart-card .card__body { padding: 20px 22px; }
.seo-chart { position: relative; height: 280px; }
.seo-chart--wide { height: 340px; }

/* Liens/URL dans les tableaux SEO */
.seo-url { display: inline-flex; align-items: center; gap: 8px; }
.seo-url i { color: var(--ink-400); font-size: 13px; }

@media (max-width: 1100px) {
    .seo-row--stats { grid-template-columns: 1fr 1fr; }
    .seo-index { grid-column: 1 / -1; }
}
/* Rangées 50/50 : pleine largeur dès la tablette (desktop reste en 2 colonnes) */
@media (max-width: 1024px) {
    .seo-row--2 { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .seo-row--stats { grid-template-columns: 1fr; }
    .seo-index { flex-direction: column; text-align: center; }
    .tip::after { width: 180px; }
}
@media (max-width: 980px) { .sea-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .sea-cards { grid-template-columns: 1fr; } }

/* ===================== Suivi de positions (Monitorank) ============== */
/* Widget SEMrush : description à gauche, iframe à droite */
.pos-sensor { display: grid; grid-template-columns: 1fr 1.4fr; gap: 28px; align-items: start; }
.pos-sensor__widget iframe { display: block; width: 100%; border: 0; border-radius: 12px; }
@media (max-width: 900px) { .pos-sensor { grid-template-columns: 1fr; } }

/* Badges « type de résultat » (style bootstrap) */
.rb { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.rb--primary   { background: #2563eb; color: #fff; }
.rb--secondary { background: #6b7280; color: #fff; }
.rb--success   { background: #16a34a; color: #fff; }
.rb--danger    { background: #ef4444; color: #fff; }
.rb--warning   { background: #f59e0b; color: #1f2937; }
.rb--info      { background: #3b9fd8; color: #fff; }
.rb--light     { background: #e5e9f2; color: #1f2937; }
.rb--dark      { background: #1f2937; color: #fff; }

/* Onglets Desktop / Mobile (pur CSS, sans JS) */
.postabs__radio { position: absolute; opacity: 0; pointer-events: none; }
.postabs__nav { display: flex; gap: 8px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.postabs__tab {
    display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
    padding: 10px 16px; font-size: 14px; font-weight: 600; color: var(--ink-500);
    border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s;
}
.postabs__tab:hover { color: var(--ink-900); }
.postabs__panel { display: none; }
#postab-desktop:checked ~ .postabs__nav .postabs__tab[for="postab-desktop"],
#postab-mobile:checked  ~ .postabs__nav .postabs__tab[for="postab-mobile"] {
    color: var(--brand-700); border-bottom-color: var(--brand-600);
}
#postab-desktop:checked ~ .postabs__panel--desktop,
#postab-mobile:checked  ~ .postabs__panel--mobile { display: block; }

/* Onglets de thématiques (groupes Monitorank) */
.pos-themes { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.pos-themes__label { font-size: 13px; font-weight: 600; color: var(--ink-500); margin-right: 4px; }
.pos-theme {
    padding: 7px 16px; border-radius: 999px; font-size: 14px; font-weight: 600;
    color: var(--ink-600); background: var(--bg-soft); border: 1px solid var(--line);
    transition: background .15s, color .15s, border-color .15s;
}
.pos-theme:hover { color: var(--ink-900); }
.pos-theme.is-active { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }

/* État de rechargement AJAX (changement de thématique) */
#positionsContent.is-loading { opacity: .55; pointer-events: none; transition: opacity .15s; }

/* Barre d'outils : recherche + filtre */
.pos-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.pos-filter-wrap { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-600); }
.pos-filter { width: auto; min-width: 180px; }

/* Légende : badges souples (style DataTable) */
.pos-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.tbadge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; line-height: 1.5; }

/* Palette par type : badge souple (légende) + couleur de position */
.tbadge--blue   { background: #e8f0fe; color: #2563eb; } .pos-val--blue   { color: #2563eb; }
.tbadge--orange { background: #fff0e6; color: #ea580c; } .pos-val--orange { color: #ea580c; }
.tbadge--yellow { background: #fdf6e3; color: #b7791f; } .pos-val--yellow { color: #b7791f; }
.tbadge--green  { background: #e7f7ee; color: #16a34a; } .pos-val--green  { color: #16a34a; }
.tbadge--red    { background: #fdeaea; color: #dc2626; } .pos-val--red    { color: #dc2626; }
.tbadge--purple { background: #f1ebfd; color: #7c3aed; } .pos-val--purple { color: #7c3aed; }
.tbadge--gray   { background: #eef1f6; color: #64748b; } .pos-val--gray   { color: #64748b; }
.tbadge--dark   { background: #e5e7eb; color: #1f2937; } .pos-val--dark   { color: #1f2937; }
.tbadge--teal   { background: #e3f6f4; color: #0d9488; } .pos-val--teal   { color: #0d9488; }

/* Icônes device (entête + description) */
.pos-ico-d { color: #2f6bed; }
.pos-ico-m { color: #d6489a; }

/* Tri sur l'entête mot-clé */
.pos-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.pos-sort:hover { color: var(--ink-900); }
.pos-sort__icon { margin-left: 6px; color: var(--ink-400); font-size: 12px; }

/* Tableau de positions fusionné (desktop+mobile) — style « DataTable » */
.pos-table { border-collapse: separate; border-spacing: 0; }
.pos-table thead th { background: #eef4ff; color: var(--ink-900); font-weight: 600; border-bottom: 0; padding-top: 14px; padding-bottom: 14px; }
.pos-table thead tr:first-child th:first-child { border-top-left-radius: 10px; }
.pos-table thead tr:first-child th:last-child { border-top-right-radius: 10px; }
.pos-table tbody td { font-size: 15px; border-bottom: 1px solid #eef1f6; padding-top: 14px; padding-bottom: 14px; }
.pos-table tbody tr:hover { background: #f8fafc; }
.pos-table .pos-sort:hover { color: var(--brand-700); }

.pos-table .pos-kw-col { white-space: nowrap; vertical-align: middle; min-width: 260px; padding-right: 24px; }
.pos-table .pos-date { text-align: center; font-size: 13.5px; border-left: 1px solid #dbe4f5; }
.pos-table .pos-dev { text-align: center; }
.pos-table .pos-col { text-align: center; width: 92px; padding-left: 20px; padding-right: 20px; }
.pos-table thead tr:last-child .pos-col:nth-child(odd),
.pos-table tbody .pos-col:nth-child(2n) { border-left: 1px solid #eef1f6; } /* séparateur entre dates */
.pos-table .pos-url-col { width: 99%; }
.pos-kw { font-weight: 600; white-space: nowrap; font-size: 15px; }
.pos-stack { display: flex; flex-direction: column; gap: 6px; }
.pos-stack__item { display: flex; align-items: center; min-height: 26px; }
.pos-stack__item[hidden] { display: none; }
.pos-col .pos-stack { align-items: center; }

/* Positions colorées selon le type de résultat (palette ci-dessus) */
.pos-val { justify-content: center; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 16px; }
.pos-val.is-na { color: var(--ink-300, #cbd5e1); font-weight: 500; }

/* Pied de tableau : info + pagination */
.pos-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; flex-wrap: wrap; }
.pos-pageinfo { font-size: 14px; color: var(--ink-500); }

/* Colonne URL */
.pos-url { max-width: 440px; }
.pos-url__link { color: var(--ink-900); font-size: 14px; text-decoration: none; word-break: break-all; }
.pos-url__link:hover { text-decoration: underline; }
.pos-url__map { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: #ea580c; }
.pos-url__map i { color: #ea580c; }

/* ===================== SEO — Check position ========================= */
.check-form__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr auto; gap: 16px; align-items: end; }
.field__opt { color: var(--ink-400); font-weight: 400; font-size: 12px; }
@media (max-width: 860px) { .check-form__grid { grid-template-columns: 1fr; } }

.check-status { display: flex; align-items: center; gap: 10px; margin-top: 18px; font-size: 14px; color: var(--ink-600); }
.check-status--error { color: var(--danger, #dc2626); }
.check-spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--brand-600); animation: cc-spin .7s linear infinite; flex: none; }
.check-status--error .check-spinner { display: none; }
@keyframes cc-spin { to { transform: rotate(360deg); } }
.check-form.is-busy { opacity: .85; }

.check-results { margin-top: 22px; }
.check-banner { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; font-size: 14px; margin-bottom: 18px; }
.check-banner i { font-size: 18px; }
.check-banner__lines { display: flex; flex-direction: column; gap: 4px; }
.check-banner--found { background: #e7f7ee; color: #15803d; align-items: flex-start; }
.check-banner--found i { margin-top: 1px; }
.check-banner--miss { background: #eef1f6; color: var(--ink-600); }

.check-table .cc-num { text-align: center; width: 92px; }
.check-table .cc-url { max-width: 420px; }
.check-table .cc-title { max-width: 360px; }
.cc-link { color: var(--ink-900); font-size: 13.5px; text-decoration: none; word-break: break-all; }
.cc-link:hover { text-decoration: underline; }
.check-table tbody tr.is-match { background: #e7f7ee; }
.check-table tbody tr.is-match:hover { background: #d6f0e0; }
.check-table tbody tr.is-match td { font-weight: 600; }

/* ======================= Statistiques (Matomo) ====================== */
/* Sélecteur de période (réutilise les pilules .pos-theme) */
.stats-periods { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.stats-periods__label { font-size: 13px; font-weight: 600; color: var(--ink-500); margin-right: 4px; }

/* Onglets Audience / Comportement / Acquisition (pur CSS, sans JS) */
.stabs__radio { position: absolute; opacity: 0; pointer-events: none; }
.stabs__nav { display: flex; gap: 8px; margin-bottom: 24px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.stabs__tab {
    display: inline-flex; align-items: center; cursor: pointer; padding: 10px 18px;
    font-size: 14px; font-weight: 600; color: var(--ink-500);
    border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s;
}
.stabs__tab:hover { color: var(--ink-900); }
.stabs__panel { display: none; }
#stab-audience:checked ~ .stabs__nav .stabs__tab[for="stab-audience"],
#stab-comportement:checked ~ .stabs__nav .stabs__tab[for="stab-comportement"],
#stab-acquisition:checked ~ .stabs__nav .stabs__tab[for="stab-acquisition"],
#stab-performances:checked ~ .stabs__nav .stabs__tab[for="stab-performances"] {
    color: var(--brand-700); border-bottom-color: var(--brand-600);
}
#stab-audience:checked ~ .stabs__panel--audience,
#stab-comportement:checked ~ .stabs__panel--comportement,
#stab-acquisition:checked ~ .stabs__panel--acquisition,
#stab-performances:checked ~ .stabs__panel--performances { display: block; }

/* Mêmes onglets sur la carte d'intro du suivi de positions */
#ptab-info:checked ~ .stabs__nav .stabs__tab[for="ptab-info"],
#ptab-sensor:checked ~ .stabs__nav .stabs__tab[for="ptab-sensor"] {
    color: var(--brand-700); border-bottom-color: var(--brand-600);
}
#ptab-info:checked ~ .stabs__panel--info,
#ptab-sensor:checked ~ .stabs__panel--sensor { display: block; }
.stabs__panel--info .card__title { margin: 0 0 20px; }

/* Cartes KPI (4 colonnes) */
.stats-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 28px; }
@media (max-width: 980px) { .stats-kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .stats-kpis { grid-template-columns: 1fr; } }

/* Carte KPI : variante ambre (4e carte) */
.seo-stat--amber .seo-stat__icon { background: #f59e0b; }
.seo-stat--amber .seo-stat__label { color: #b45309; }
.seo-stat--amber:hover { border-color: #f59e0b; }

/* Statistiques en vitrine (service non souscrit) : badge rouge sous chaque carte */
.stats-demo .stabs .card::after {
    content: 'Données de démonstration';
    display: block; width: fit-content;
    margin: 0 auto 16px;
    background: var(--danger-bg); color: var(--danger);
    font-size: 12px; font-weight: 700; letter-spacing: .01em;
    padding: 4px 12px; border-radius: 999px;
}
.stats-demo .stabs .seo-stat { flex-wrap: wrap; }
.stats-demo .stabs .seo-stat::after { margin: 0 auto; flex: none; }

/* Conteneurs de graphiques */
.stat-chart { position: relative; height: 300px; }
.stat-chart canvas { max-width: 100%; }
.stats-kpis > * { min-width: 0; }
.stats-noinfo {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 32px 0; margin: 0; font-size: 14px; color: var(--ink-500);
}
.stats-noinfo i { color: var(--brand-600); }
.stat-chart--wide { height: 340px; }

/* Espacement généreux entre les blocs/cartes des onglets */
.stabs__panel > * { margin-bottom: 80px; }
.stabs__panel > *:last-child { margin-bottom: 0; }

/* Filtre de période : presets + datepicker */
.stats-filter { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.stats-presets { display: flex; gap: 8px; flex-wrap: wrap; }
.stats-dates { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stats-dates__field { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-600); }
.stats-dates__field .form-control { width: auto; }

/* Tooltip dans l'entête de carte */
.card__head .tip--sm { vertical-align: middle; }

/* État de rechargement AJAX du contenu stats */
#statsContent.is-loading { opacity: .55; pointer-events: none; transition: opacity .15s; }
.pos-url--none { color: var(--ink-300, #cbd5e1); }

/* ---------- Notifications : badge cloche ---------- */
.icon-btn.is-active { background: var(--brand-50); color: var(--brand-700); }
.icon-btn__badge {
    position: absolute; top: 2px; right: 1px;
    min-width: 17px; height: 17px; padding: 0 4px;
    background: var(--danger); color: #fff;
    border-radius: 999px; font-size: 10px; font-weight: 800;
    display: grid; place-items: center; line-height: 1;
    border: 2px solid var(--surface);
}

/* ---------- Notifications : boîte mail 2 volets ---------- */
.mailbox { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; min-height: 480px; }
.mailbox__list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; }
.mailbox__read { min-width: 0; position: relative; }

.notif-toolbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.notif-selectall { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-600); cursor: pointer; }
.notif-selectall input { width: 16px; height: 16px; accent-color: var(--brand-600); }
.notif-bulk { display: flex; gap: 4px; }
.icon-btn--bulk { width: 34px; height: 34px; }
.icon-btn--bulk i { font-size: 15px; }

.notif-list { flex: 1; overflow-y: auto; }
.notif-item { display: flex; align-items: flex-start; gap: 8px; padding: 0 10px 0 14px; border-bottom: 1px solid var(--line); }
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-soft); }
.notif-item.is-open { background: var(--brand-50); }
.notif-check { padding-top: 16px; }
.notif-check input { width: 15px; height: 15px; accent-color: var(--brand-600); }
.notif-open { display: flex; align-items: flex-start; gap: 10px; flex: 1; min-width: 0; padding: 11px 2px; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: transparent; flex: none; margin-top: 5px; }
.notif-item.is-unread .notif-dot { background: var(--brand-600); }
.notif-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notif-title { font-weight: 600; color: var(--ink-700); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-item.is-unread .notif-title { font-weight: 800; color: var(--ink-900); }
.notif-snippet { font-size: 12.5px; color: var(--ink-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-date { font-size: 11.5px; color: var(--ink-400); white-space: nowrap; flex: none; padding-top: 1px; }

.notif-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px; border-top: 1px solid var(--line); }
.notif-pageinfo { font-size: 13px; color: var(--ink-500); }

/* Volet de lecture */
.notif-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--ink-400); padding: 40px; text-align: center; }
.notif-empty i { font-size: 34px; margin-bottom: 12px; opacity: .45; }
.notif-empty p { margin: 0; font-size: 14px; }
.notif-detail { padding: 26px 30px; }
.notif-detail__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.notif-detail__title { font-size: 21px; font-weight: 800; margin: 0; }
.notif-detail__date { font-size: 13px; color: var(--ink-400); white-space: nowrap; }
.notif-detail__body { color: var(--ink-700); line-height: 1.7; font-size: 15px; }
.notif-detail__actions { display: flex; align-items: center; gap: 10px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }

/* Page de lecture autonome (fallback sans JS) */
.notif-read__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.notif-read__title { font-size: 20px; font-weight: 800; margin: 0; }
.notif-read__date { font-size: 13px; color: var(--ink-400); }
.notif-read__body { color: var(--ink-700); line-height: 1.7; font-size: 15px; }
.notif-read__actions { display: flex; align-items: center; gap: 12px; margin-top: 26px; }
.btn--danger-text { color: var(--danger); }

@media (max-width: 860px) {
    .mailbox { grid-template-columns: 1fr; }
    .mailbox__list { border-right: none; border-bottom: 1px solid var(--line); }
    .notif-list { max-height: 340px; }
}

/* ---------- Calendrier ---------- */
.cal-card { padding: 22px 24px; margin-bottom: 24px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.cal-nav { display: flex; align-items: center; gap: 10px; }
.cal-year { font-size: 20px; font-weight: 800; color: var(--ink-900); min-width: 64px; text-align: center; }
.cal-range { font-size: 15.5px; font-weight: 800; color: var(--ink-900); white-space: nowrap; padding: 0 4px; }
.cal-legend { display: flex; gap: 18px; flex-wrap: wrap; }
.cal-legend__item { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--ink-600); }

.cat-dot { width: 11px; height: 11px; border-radius: 3px; display: inline-block; flex: none; }
.cat-dot--event { background: #0d9488; } /* jour de renouvellement (couleur unique) */

.month-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.mini-month { border: 1px solid var(--line); border-radius: 12px; padding: 12px 10px 14px; }
.mini-month__title { text-align: center; font-weight: 700; font-size: 13.5px; color: var(--ink-700); margin-bottom: 10px; }
.mini-month__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.mini-month__dow { text-align: center; font-size: 10px; font-weight: 700; color: var(--ink-400); }
.mini-month__day { text-align: center; font-size: 11.5px; color: var(--ink-600); aspect-ratio: 1; display: grid; place-items: center; border-radius: 6px; }
.mini-month__day.is-today { outline: 1.5px solid var(--brand-500); outline-offset: -1.5px; font-weight: 700; }
/* Jour à événement : couleur unique (le type est détaillé dans la popup) */
.mini-month__day.is-event { color: #fff; font-weight: 800; cursor: pointer; background: #0d9488; }
.mini-month__day.is-event:hover { filter: brightness(.92); }

.svc-name { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; color: var(--ink-900); }
.badge--amber { background: #fef3c7; color: #92400e; }
.badge--red   { background: var(--danger-bg); color: var(--danger); }
.badge--gray  { background: var(--bg-soft); color: var(--ink-600); }

/* Détail d'une date (modale) */
.svc-detail { padding: 16px 0; border-bottom: 1px solid var(--line); }
.svc-detail:first-child { padding-top: 0; }
.svc-detail:last-child { border-bottom: none; padding-bottom: 0; }
.svc-detail__name { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; margin-bottom: 12px; }
.svc-detail__list { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; margin: 0; }
.svc-detail__list dt { color: var(--ink-500); font-size: 13.5px; }
.svc-detail__list dd { margin: 0; color: var(--ink-900); font-size: 14px; font-weight: 500; }

@media (max-width: 1180px) { .month-strip { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px)  { .month-strip { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px)  { .month-strip { grid-template-columns: 1fr; } }

/* ---------- Utilitaires ---------- */
.text-muted  { color: var(--ink-400); }
.text-center { text-align: center; }

/* Variantes ponctuelles (évitent tout style inline, CSP stricte) */
.profile__avatar.avatar-fallback { width: 116px; height: 116px; font-size: 38px; }
.security__link i { font-size: 13px; }
.topbar__logout { margin-left: 8px; }
.welcome-title { margin: 0 0 8px; font-size: 20px; }
.welcome-text  { color: var(--ink-500); margin: 0; }

/* ============================== FAQ ============================== */
/* Deux colonnes : menu vertical des sections à gauche, contenu à droite.
   Onglets pilotés par JS/data-panel : le nombre de sections peut varier. */
.faq { display: grid; grid-template-columns: 250px 1fr; gap: 32px; align-items: start; }

/* Menu vertical des sections (pilule bleue = section active) */
.faq__nav { display: flex; flex-direction: column; gap: 6px; }
.ftabs__tab {
    display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
    padding: 12px 16px; border: none; background: none; border-radius: 10px;
    font-family: inherit; font-size: 14px; font-weight: 600; color: var(--ink-600);
    cursor: pointer; transition: background .15s, color .15s;
}
.ftabs__tab:hover { background: var(--bg-soft); color: var(--ink-900); }
.ftabs__tab.is-active { background: var(--brand-600); color: #fff; }
.ftabs__tab.is-active:hover { background: var(--brand-600); color: #fff; }
.ftabs__panel { display: none; }
.ftabs__panel.is-active { display: block; }

/* En-tête de la section active (icône + titre + sous-titre) */
.faq__head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.faq__head-icon {
    width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0;
    background: var(--brand-50); color: var(--brand-600);
    display: grid; place-items: center; font-size: 19px;
}
.faq__head-title { font-size: 18px; font-weight: 800; margin: 0; color: var(--ink-900); }
.faq__head-sub { margin: 3px 0 0; font-size: 13.5px; color: var(--ink-500); }

/* Accordéon question/réponse (cartes) */
.faq-acc { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; background: var(--surface); overflow: hidden; }
.faq-acc__q {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 16px 20px; cursor: pointer; font-size: 14.5px; font-weight: 600; color: var(--ink-900);
    list-style: none; user-select: none;
}
.faq-acc__q::-webkit-details-marker { display: none; }
.faq-acc__q:hover { color: var(--brand-700); }
.faq-acc__caret { font-size: 12px; color: var(--ink-500); transition: transform .2s; flex-shrink: 0; }
.faq-acc[open] .faq-acc__caret { transform: rotate(90deg); }
.faq-acc__a { padding: 0 20px 16px; font-size: 14px; color: var(--ink-500); line-height: 1.6; }

@media (max-width: 900px) {
    .faq { grid-template-columns: 1fr; gap: 20px; }
    .faq__nav { flex-direction: row; flex-wrap: wrap; }
    .ftabs__tab { width: auto; }
}

/* ========================= Veille marketing ========================= */
.veille__week { margin-bottom: 36px; }
.veille__title {
    display: flex; align-items: center; gap: 10px;
    font-size: 17px; font-weight: 800; color: var(--brand-600); margin: 0 0 16px;
}
.veille__title i { color: var(--brand-600); }

.veille__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 1100px) { .veille__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px)  { .veille__grid { grid-template-columns: 1fr; } }

/* Carte article : image en tête, contenu, source, CTA externe */
.veille-card {
    display: flex; flex-direction: column; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); overflow: hidden;
    transition: transform .15s, box-shadow .15s;
}
.veille-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.veille-card__img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: fill; }
.veille-card__body { display: flex; flex-direction: column; flex: 1; padding: 18px 20px 20px; }
.veille-card__title { font-size: 15.5px; font-weight: 700; color: var(--ink-900); margin: 0 0 8px; line-height: 1.35; }
.veille-card__desc { font-size: 13.5px; color: var(--ink-500); line-height: 1.55; margin: 0 0 14px; }
.veille-card__source { font-size: 13px; font-style: italic; color: var(--ink-500); margin: auto 0 10px; }
.veille-card__cta { align-self: flex-start; }
.veille-card__cta i { font-size: 12px; }

/* ========================= Tableau de bord ========================= */
.dash-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 80px 24px; margin-bottom: 80px; align-items: start; }
.dash-row > * { min-width: 0; } /* un tableau large défile DANS la carte au lieu d'élargir la page */
.dash-row--3 { grid-template-columns: repeat(3, 1fr); }
.dash-row--3 .dash-col { gap: 50px; }
.dash-col { display: flex; flex-direction: column; gap: 80px; min-width: 0; }
@media (max-width: 1280px) { .dash-row--3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 1100px) { .dash-row, .dash-row--3 { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
    .dash-row { gap: 40px 24px; margin-bottom: 40px; }
    .dash-col, .dash-row--3 .dash-col { gap: 40px; }
}

.dash-card .card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card__more { font-size: 13px; font-weight: 600; color: var(--brand-600); white-space: nowrap; }
.card__more:hover { text-decoration: underline; }
.card__more i { font-size: 11px; }
.dash-title-ico { color: var(--brand-600); margin-right: 6px; }
.dash-empty { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-500); margin: 0; padding: 8px 0; }
.dash-empty i { color: var(--brand-600); font-size: 16px; }

/* --- Carte site : capture + liste icône / libellé / valeur --- */
.dash-site { overflow: hidden; }
.dash-site__shot { display: block; width: 100%; max-height: 400px; object-fit: fill; border-bottom: 1px solid var(--line); }
.dash-list { list-style: none; margin: 0; padding: 0; }
.dash-list__row { display: flex; align-items: center; gap: 14px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.dash-list__row:last-child { border-bottom: none; }
.dash-list__ico {
    width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
    display: grid; place-items: center; font-size: 15px;
}
.dash-ico--blue   { background: var(--brand-50); color: var(--brand-600); }
.dash-ico--green  { background: #e7f7ee; color: #16a34a; }
.dash-ico--amber  { background: #fef3c7; color: #d97706; }
.dash-ico--purple { background: #f3e8ff; color: #7c3aed; }
.dash-ico--teal   { background: #ccfbf1; color: #0d9488; }
.dash-ico--red    { background: var(--danger-bg); color: var(--danger); }
.dash-ico--gray   { background: var(--bg-soft); color: var(--ink-600); }
.dash-list__label { font-size: 14px; font-weight: 600; color: var(--ink-900); }
.dash-list__value { margin-left: auto; text-align: right; }
.dash-list__value--text { font-size: 14px; font-weight: 600; color: var(--ink-600); }
.dash-site__url { font-size: 14px; font-weight: 600; color: var(--ink-900); }
.dash-site__url:hover { color: var(--brand-700); text-decoration: underline; }

/* --- Avis Google : badge à gauche, boutons + QR à droite --- */
.dash-embed { display: block; width: 100%; border: none; border-radius: 10px; }
.dash-embed--reviews { height: 100px; }
.dash-embed--feed { height: 600px; }
.dash-gmb { display: flex; flex-direction: column; align-items: stretch; gap: 16px; }
/* Sous le widget : boutons à gauche, QR code à droite — le tout centré */
.dash-gmb__side { display: flex; align-items: center; justify-content: center; gap: 28px; }
.dash-gmb__actions { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.dash-gmb__actions .btn { justify-content: center; width: max-content; }
.dash-gmb__pitch { margin: 0 0 2px; font-size: 13.5px; color: var(--ink-500); line-height: 1.5; text-align: center; }
.dash-gmb__qr { flex-shrink: 0; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.dash-gmb__qr-img { display: block; width: 140px; height: 140px; object-fit: contain; }
@media (max-width: 640px) {
    /* Boutons + QR empilés et centrés (sinon le QR déborde de la carte) */
    .dash-gmb__side { flex-direction: column; gap: 18px; }
    .dash-gmb__actions .btn { width: 100%; max-width: 280px; }
}

/* Panneau Espace : catalogue services (catégories + blocs service) */
.presta-row--cat { grid-template-columns: 2fr 1fr 1fr auto; }
.esp-gap { margin-top: 26px; }
.esp-svc {
    border: 1px solid var(--line); border-radius: 12px; padding: 16px;
    display: flex; flex-direction: column; gap: 12px; background: var(--surface);
}
.esp-svc__grid {
    display: grid; grid-template-columns: 1fr 2fr 1fr 1.5fr auto;
    gap: 10px; align-items: end;
}
@media (max-width: 900px) { .esp-svc__grid { grid-template-columns: 1fr 1fr; } }

/* Pages éditoriales (politique de confidentialité, changelog) */
.page-doc--guest { max-width: 860px; margin: 48px auto; padding: 0 20px; }
.page-doc__body { font-size: 14.5px; line-height: 1.7; color: var(--ink-700); }
.page-doc__body p { margin: 0 0 10px; }
.page-doc__body ul, .page-doc__body ol { padding-left: 22px; margin: 8px 0; }
.page-doc__body a { color: var(--brand-600); text-decoration: underline; }
.page-doc__body h3, .page-doc__body h4 { color: var(--ink-900); margin: 18px 0 8px; }
.page-doc__back { margin-top: 16px; }
.page-doc__back a { color: var(--brand-600); font-weight: 600; font-size: 14px; }
.wys__editor--tall { min-height: 220px; }

/* Mini éditeur WYSIWYG (réponses FAQ du panneau Espace) */
.esp-svc__grid--faq { grid-template-columns: 1fr 2.5fr auto; }
.wys { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.wys__bar {
    display: flex; align-items: center; gap: 2px; padding: 6px 8px;
    background: var(--bg-soft); border-bottom: 1px solid var(--line);
}
.wys-btn {
    width: 30px; height: 30px; display: grid; place-items: center;
    border: none; background: none; border-radius: 6px; cursor: pointer;
    color: var(--ink-600); font-size: 13px;
}
.wys-btn:hover { background: var(--line); color: var(--ink-900); }
.wys__sep { width: 1px; height: 18px; background: var(--line); margin: 0 6px; }
.wys__editor {
    min-height: 96px; padding: 12px 14px; font-size: 14px; line-height: 1.6;
    color: var(--ink-900); outline: none;
}
.wys__editor:focus { box-shadow: inset 0 0 0 2px var(--brand-50); }
.wys__editor ul, .wys__editor ol { padding-left: 22px; margin: 6px 0; }
.wys__editor a { color: var(--brand-600); text-decoration: underline; }

/* Réponses FAQ côté client : listes/liens du HTML riche */
.faq-acc__a p { margin: 0 0 8px; }
.faq-acc__a p:last-child { margin-bottom: 0; }
.faq-acc__a ul, .faq-acc__a ol { padding-left: 22px; margin: 6px 0; }
.faq-acc__a a { color: var(--brand-600); text-decoration: underline; }

/* Panneau admin Veille */
.veille-admin__thumb { margin-top: 8px; width: 120px; height: 68px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.veille-admin__line { font-size: 13px; padding: 2px 0; }
.veille-admin__actions { display: flex; gap: 8px; align-items: center; }
.veille-admin__actions form { margin: 0; }

/* Aperçu du QR dans le panneau admin Espace */
.espace-qr { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.espace-qr__img { width: 110px; height: 110px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px; }

/* --- Listes compactes (veille, documents, échéances) --- */
.dash-veille__week { font-size: 13px; font-weight: 700; color: var(--brand-700); margin: 0 0 12px; }
.dash-feed { list-style: none; margin: 0; padding: 0; }
.dash-feed__row { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.dash-feed__row:last-child { border-bottom: none; }
.dash-feed__thumb { width: 64px; height: 40px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.dash-feed__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dash-feed__title { font-size: 14px; font-weight: 600; color: var(--ink-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.dash-feed__title:hover { color: var(--brand-700); }
.dash-feed__meta { font-size: 12.5px; color: var(--ink-500); }
.dash-feed__date { margin-left: auto; flex-shrink: 0; white-space: nowrap; }

/* ======================= Administration : clients ==================== */
.admin-client__mail { font-size: 12.5px; color: var(--ink-500); margin-top: 2px; }

/* Sections du formulaire (séparateur + sous-titre) */
.form-section {
    grid-column: 1 / -1; display: flex; align-items: center;
    margin-top: 10px; padding-top: 20px; border-top: 1px solid var(--line);
}
.form-section--first { margin-top: 0; padding-top: 0; border-top: none; }
.form-section__title {
    display: flex; align-items: center; gap: 10px; margin: 0;
    font-size: 15px; font-weight: 700; color: var(--ink-900);
}
.form-section__title i { color: var(--brand-600); font-size: 14px; }
.form-subsection { grid-column: 1 / -1; margin-top: 4px; }
.form-subsection__title { margin: 0; font-size: 13px; font-weight: 700; color: var(--ink-500); text-transform: uppercase; letter-spacing: .4px; }

/* Accordéon de formulaire (panneau admin Clients) */
.form-acc {
    border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
    margin-bottom: 14px; overflow: hidden;
}
.form-acc__head {
    display: flex; align-items: center; gap: 10px;
    padding: 15px 18px; cursor: pointer; user-select: none;
    font-size: 15px; font-weight: 700; color: var(--ink-900); list-style: none;
}
.form-acc__head::-webkit-details-marker { display: none; }
.form-acc__head > i:first-child { color: var(--brand-600); font-size: 14px; }
.form-acc__head:hover { background: var(--bg-soft); }
.form-acc__caret { margin-left: auto; font-size: 12px; color: var(--ink-500); transition: transform .2s; }
.form-acc[open] > .form-acc__head .form-acc__caret { transform: rotate(180deg); }
.form-acc__body { padding: 6px 18px 18px; border-top: 1px solid var(--line); }
.form-acc-submit { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }

/* SEA : zone de dépôt + lignes de nouveaux rapports + liste existante */
.sea-drop {
    display: flex; align-items: center; gap: 12px; justify-content: center;
    padding: 22px 16px; border: 2px dashed var(--line); border-radius: 12px;
    color: var(--ink-500); cursor: pointer; text-align: center;
    transition: border-color .15s, background .15s;
}
.sea-drop:hover, .sea-drop.is-over { border-color: var(--brand-600); background: var(--brand-50); color: var(--brand-700); }
.sea-drop i { font-size: 20px; }
.sea-drop p { margin: 0; font-size: 13.5px; }
.sea-new-list { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.sea-row {
    display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto;
    gap: 10px; align-items: end;
}
.sea-row--doc { grid-template-columns: 1.5fr 2fr 1.5fr auto; }
.sea-row--doc-exist { grid-template-columns: 2.5fr 1.5fr auto; }
.sea-row__file {
    display: flex; align-items: center; gap: 8px; min-width: 0;
    font-size: 13.5px; font-weight: 600; color: var(--ink-900); padding-bottom: 10px;
}
.sea-row__file i { color: var(--brand-600); }
.sea-row__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sea-row-remove { color: var(--danger); margin-bottom: 3px; }
.sea-row-remove:hover { background: var(--danger-bg); }
@media (max-width: 900px) {
    .sea-row { grid-template-columns: 1fr 1fr; }
    .sea-row__file { grid-column: 1 / -1; }
}

/* Prestations : lignes dynamiques (nom, type, dates, rythme, retirer) */
.presta-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }
.presta-row {
    display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto;
    gap: 10px; align-items: end;
}
.presta-field .form-label { font-size: 12.5px; margin-bottom: 5px; }
.presta-remove { color: var(--danger); margin-bottom: 3px; }
.presta-remove:hover { background: var(--danger-bg); }
@media (max-width: 900px) {
    .presta-row { grid-template-columns: 1fr 1fr; }
    .presta-field--name { grid-column: 1 / -1; }
}

/* Interrupteurs oui/non (cases à cocher stylisées) */
.switch-row { display: flex; flex-wrap: wrap; gap: 14px 22px; padding-top: 8px; }
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__track {
    position: relative; width: 40px; height: 22px; border-radius: 999px;
    background: var(--line); transition: background .15s; flex-shrink: 0;
}
.switch__track::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
    border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, .25);
    transition: transform .15s;
}
.switch input:checked + .switch__track { background: var(--success); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--brand-600); outline-offset: 2px; }
.switch__label { font-size: 13.5px; font-weight: 600; color: var(--ink-600); }

/* ============================ Mode sombre ============================ */
/* Activé via data-theme="dark" sur <html> (bouton lune de la topbar,
   persisté en localStorage par assets/js/theme.js). */
:root[data-theme="dark"] {
    --brand-50:  #1e2a47;

    --ink-900: #f1f5f9;
    --ink-700: #cbd5e1;
    --ink-600: #b6c2d2;
    --ink-500: #94a3b8;
    --ink-400: #64748b;
    --line:    #2b3850;
    --surface: #16202f;
    --bg:      #0d1320;
    --bg-soft: #1c2738;

    --green-bg: #11362a; --green-tx: #6ee7b7;
    --blue-bg:  #1b2c4f; --blue-tx:  #93c5fd;
    --danger-bg: #3a1a1d; --danger-bd: #6b2228;
    --success-bg: #11331f; --success-bd: #1d5a35;

    --shadow:    0 1px 2px rgba(0,0,0,.35), 0 4px 16px rgba(0,0,0,.35);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
}
:root[data-theme="dark"] body { color-scheme: dark; }

/* Pastilles/badges ambre + variantes codées en dur */
:root[data-theme="dark"] .badge--amber,
:root[data-theme="dark"] .dash-ico--amber { background: #3a2c10; color: #fbbf24; }
:root[data-theme="dark"] .dash-ico--green { background: #11362a; color: #4ade80; }
:root[data-theme="dark"] .dash-ico--purple { background: #2c2150; color: #c4b5fd; }
:root[data-theme="dark"] .dash-ico--teal { background: #0e3330; color: #5eead4; }
:root[data-theme="dark"] .svc-badge { background: #11362a; color: #6ee7b7; }
:root[data-theme="dark"] .svc-card.is-subscribed { background: #1b2433; border-color: #324158; }
:root[data-theme="dark"] .login__notice { background: #3a2c10; border-color: #5b4513; color: #fbbf24; }
:root[data-theme="dark"] .alert--warning { background: #3a2c10; border-color: #5b4513; color: #fbbf24; }

/* Tableaux : en-têtes clairs codés en dur */
:root[data-theme="dark"] .pos-table thead th { background: #1b2c4f; }

/* Le QR code doit rester sur fond blanc pour être scannable */
:root[data-theme="dark"] .dash-gmb__qr { background: #fff; border-color: #fff; }

/* Topbar / divers */
:root[data-theme="dark"] .icon-btn:hover { background: var(--bg-soft); }

/* Écran de connexion */
:root[data-theme="dark"] .login { background: var(--surface); border-color: var(--line); }

/* Encart « sécurité » bleu clair (page Compte) */
:root[data-theme="dark"] .security { background: #1b2c4f; border-color: #2b3d63; }

/* Cartes SEA pastel */
:root[data-theme="dark"] .sea-card--blue   { background: #1b2c4f; }
:root[data-theme="dark"] .sea-card--green  { background: #11362a; }
:root[data-theme="dark"] .sea-card--amber  { background: #3a2c10; }
:root[data-theme="dark"] .sea-card--purple { background: #2c2150; }

/* Badges de type (tableaux positions/SERP) */
:root[data-theme="dark"] .tbadge--blue   { background: #1b2c4f; color: #93c5fd; }
:root[data-theme="dark"] .tbadge--orange { background: #3a2410; color: #fdba74; }
:root[data-theme="dark"] .tbadge--yellow { background: #3a2c10; color: #fde047; }
:root[data-theme="dark"] .tbadge--green  { background: #11362a; color: #6ee7b7; }
:root[data-theme="dark"] .tbadge--red    { background: #3a1a1d; color: #fca5a5; }
:root[data-theme="dark"] .tbadge--purple { background: #2c2150; color: #c4b5fd; }
:root[data-theme="dark"] .tbadge--gray   { background: #273245; color: #b6c2d2; }
:root[data-theme="dark"] .tbadge--dark   { background: #38465e; color: #e2e8f0; }
:root[data-theme="dark"] .tbadge--teal   { background: #0e3330; color: #5eead4; }

/* Quota check position + pilule claire */
:root[data-theme="dark"] .check-quota.is-empty { background: #3a1a1d; }
:root[data-theme="dark"] .rb--light { background: #38465e; color: #e2e8f0; }

/* ---------- Responsive ---------- */
/* Menu hamburger (mobile/tablette) : la sidebar devient un tiroir off-canvas.
   Pendant admin : bouton rouge -> tiroir des liens admin depuis la droite. */
.nav-burger { display: none; }
.nav-overlay { display: none; }
.nav__logout { display: none; }
.nav__item--btn { width: 100%; background: none; border: 0; cursor: pointer; font: inherit; text-align: left; }
.nav-burger--admin { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-bd); }
.nav-burger--admin:hover { background: #fde3e3; color: var(--danger); }
.admin-drawer { display: none; }
@media (max-width: 980px) {
    .app { grid-template-columns: 1fr; }
    .nav-burger { display: inline-flex; }
    .topbar__admin { display: none; }
    .admin-drawer {
        display: flex; flex-direction: column; gap: 6px;
        position: fixed; inset: 0 0 0 auto;
        width: min(300px, 84vw); height: 100vh; height: 100dvh;
        z-index: 70; overflow-y: auto; padding: 22px 16px;
        background: var(--surface); border-left: 1px solid var(--line);
        transform: translateX(105%); transition: transform .2s ease;
        box-shadow: 0 0 40px rgba(15, 23, 42, .25);
    }
    .admin-drawer__head {
        display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
        font-size: 12px; font-weight: 800; letter-spacing: .04em;
        text-transform: uppercase; color: var(--danger);
    }
    .admin-drawer .admin-link { justify-content: flex-start; padding: 11px 12px; font-size: 14.5px; }
    body.adminnav-open .admin-drawer { transform: translateX(0); }
    body.adminnav-open .nav-overlay { display: block; }
    body.adminnav-open { overflow: hidden; }
    /* Déconnexion : dans le tiroir (sous Sécurité) au lieu de la topbar */
    .nav__logout { display: block; }
    .topbar__logout { display: none; }
    .sidebar {
        position: fixed; inset: 0 auto 0 0;
        width: min(300px, 84vw); height: 100vh; height: 100dvh;
        z-index: 70; overflow-y: auto;
        transform: translateX(-105%); transition: transform .2s ease;
        box-shadow: 0 0 40px rgba(15, 23, 42, .25);
    }
    body.nav-open .sidebar { transform: translateX(0); }
    .nav-overlay { position: fixed; inset: 0; z-index: 65; background: rgba(15, 23, 42, .45); }
    body.nav-open .nav-overlay { display: block; }
    body.nav-open { overflow: hidden; }
    .account-grid { grid-template-columns: 1fr; }
    .fields { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .content { padding: 20px 14px; }
    .page-title { font-size: 24px; }
}
