/*
 * Styléo Design System
 * Charte graphique unifiée (couleurs, typo, ombres, gradients)
 * Inspirée par https://www.styleo.fr
 */

:root {
    /* Palette neutre (encre & papier) */
    --ink: #0b0b0c;
    --ink-2: #242429;
    --muted: #6e6e76;
    --paper: #f3f2ee;
    --white: #fff;

    /* Lignes & bordures */
    --line: rgba(11, 11, 12, .13);
    --line-strong: rgba(11, 11, 12, .24);

    /* Palette d'accent (couleurs primaires & états) */
    --coral: #ff2f63;      /* Corail — RÉSERVÉ au dégradé & lueurs de fond (jamais en aplat d'UI) */
    --orange: #f8784d;     /* Orange chaud — accent d'UI (index, liens, focus, états) */
    --yellow: #ffc43d;     /* Or — hover boutons, alertes */
    --green: #2da56f;      /* Vert — succès, positif */
    --success: var(--green);  /* alias sémantique (badges « ✓ configurée », etc.) */
    --danger: #c53b45;     /* Rouge — erreurs, danger */

    /* Accent de travail (UI). Le corail ne sert QUE dans le dégradé/lueurs (charte Styléo). */
    --accent: var(--orange);
    --accent-soft: rgba(248, 120, 77, .10);
    --accent-line: rgba(248, 120, 77, .30);
    --accent-text: #b5531f;   /* orange foncé lisible pour texte sur fond clair */

    /* Gradient signature (corail → orange → or) : moments expressifs uniquement */
    --gradient: linear-gradient(120deg, var(--coral), var(--orange) 55%, var(--yellow));

    /* Ombre standard */
    --shadow: 0 24px 70px rgba(11, 11, 12, .12);
    --shadow-sm: 0 8px 24px rgba(11, 11, 12, .08);

    /* Échelle de rayons (cohérence visuelle) */
    --radius-sm: 10px;     /* inputs, petits boutons, stepper */
    --radius: 14px;        /* cartes internes, alertes, tables, propositions */
    --radius-lg: 18px;     /* cartes principales, modale */
    --radius-pill: 999px;  /* boutons pilule, tags */

    /* Courbe de transition partagée */
    --ease: .18s ease;

    /* Typographie */
    --font-display: "New Amsterdam", Haettenschweiler, "Arial Narrow", sans-serif;
    --font-body: "Open Sans", sans-serif;

    /* Spacing */
    --gap: 1rem;
    --gap-lg: 2rem;
    --gap-xl: 3rem;
}

/* Réinitialisation & normes */
* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
    min-width: 320px;
    background: var(--paper);
}

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 5% 8%, rgba(255, 196, 61, .12), transparent 20rem),
        radial-gradient(circle at 95% 18%, rgba(255, 47, 99, .08), transparent 23rem),
        var(--paper);
    font: 15px/1.55 var(--font-body);
}

button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, select { cursor: pointer; }

/* Focus visible (accessibilité) */
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid rgba(248, 120, 77, .35);
    outline-offset: 2px;
}

/* Noise pattern (texture subtile) */
.noise {
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: .07;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
}

/* ============================================================ */
/* LAYOUT PRINCIPAL                                             */
/* ============================================================ */

.app-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
    gap: 0;
}

.app-sidebar {
    background: var(--white);
    border-right: 1px solid var(--line);
    overflow-y: auto;
    padding: var(--gap-lg) var(--gap);
}

.app-main {
    display: flex;
    flex-direction: column;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(255, 255, 255, .84);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
    min-height: 72px;
    padding: var(--gap) var(--gap-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-header h2 { font-family: var(--font-display); letter-spacing: .03em; margin: 0; font-size: 20px; }

/* Bouton hamburger (mobile) + conteneur du titre + contrôles de droite */
.header-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.header-controls { display: flex; align-items: center; gap: 1rem; }
.header-provider { font-size: 12px; }
.nav-burger {
    display: none;
    align-items: center; justify-content: center;
    width: 38px; height: 38px; flex-shrink: 0;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--white); cursor: pointer;
}
.nav-burger .lc { width: 20px; height: 20px; }
.sidebar-backdrop { display: none; }

.app-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--gap-lg);
}

/* Fondu d'apparition au changement de vue / d'étape (re-déclenché par display none→block) */
@keyframes viewIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

#view-new, #view-drafts, #view-calendar, #view-history,
#step1, #step2, #step3, #step4 {
    animation: viewIn .25s ease;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}

/* ============================================================ */
/* NAVIGATION                                                   */
/* ============================================================ */

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--ink);
    margin-bottom: var(--gap-xl);
}

.brand strong {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 400;
    letter-spacing: .04em;
}

.brand img {
    height: 38px;
    width: auto;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.brand-divider {
    width: 1px;
    height: 24px;
    background: var(--line-strong);
}

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--gap-lg);
}

.nav-section {
    margin: var(--gap-lg) 0 var(--gap) 0;
}

.nav-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    font-weight: 600;
    margin: 0 0 var(--gap) 0;
}

.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--gap);
    padding: var(--gap) var(--gap-lg);
    background: transparent;
    border: none;
    border-radius: 10px;
    color: var(--muted);
    text-decoration: none;
    cursor: pointer;
    transition: background var(--ease), color var(--ease);
    font-weight: 600;
    font-size: 14px;
}

.nav-link:hover { background: rgba(11, 11, 12, .045); color: var(--ink); }

.nav-link.active { background: rgba(11, 11, 12, .05); color: var(--ink); }

/* Marqueur dégradé (au lieu d'un aplat rose) */
.nav-link.active::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 18px;
    border-radius: 3px;
    background: var(--gradient);
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: var(--gap);
    font-size: 13px;
    color: var(--muted);
    margin-bottom: var(--gap-lg);
}

.breadcrumbs a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity .2s;
}

.breadcrumbs a:hover {
    opacity: .8;
}

.breadcrumb-divider {
    opacity: .5;
}

/* ============================================================ */
/* WORKFLOW MULTI-ÉTAPES                                       */
/* ============================================================ */

.workflow-container {
    margin-bottom: var(--gap-xl);
}

.workflow-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--gap);
    margin-bottom: var(--gap-xl);
}

.workflow-step {
    position: relative;
    padding: var(--gap);
    background: var(--white);
    border: 2px solid var(--line);
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all .2s ease;
}

.workflow-step.active {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.workflow-step.completed {
    border-color: var(--green);
    background: rgba(45, 165, 111, .05);
}

.workflow-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--line);
    color: var(--ink);
    font-weight: 600;
    font-size: 16px;
    margin: 0 auto var(--gap) auto;
}

.workflow-step.active .workflow-step-number {
    background: var(--ink);
    color: var(--white);
}

.workflow-step.completed .workflow-step-number {
    background: var(--green);
    color: var(--white);
}

.workflow-step-label {
    font-weight: 600;
    font-size: 13px;
}

/* ============================================================ */
/* FORMULAIRES                                                  */
/* ============================================================ */

.form-group {
    margin-bottom: var(--gap-lg);
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--ink-2);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.form-group .help-text {
    font-size: 12px;
    color: var(--muted);
    margin-top: 6px;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    min-height: 48px;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--ink);
    font-size: 15px;
    transition: border-color .2s, box-shadow .2s;
}

.form-input:hover, .form-select:hover, .form-textarea:hover { border-color: var(--line-strong); }

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 4px rgba(248, 120, 77, .09);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--gap-lg);
}

.checkbox-group, .radio-group {
    display: flex;
    flex-direction: column;
    gap: var(--gap);
}

.checkbox-item, .radio-item {
    display: flex;
    align-items: center;
    gap: var(--gap);
}

.checkbox-item input, .radio-item input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-item label, .radio-item label {
    flex: 1;
    margin: 0;
    cursor: pointer;
    /* Réinitialise l'héritage de .form-group label (MAJ/11px/800) pour un texte lisible */
    text-transform: none;
    letter-spacing: normal;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
}

/* Étape 2 : sélection des réseaux (configurés vs à configurer) */
.net-row {
    display: flex;
    align-items: center;
    gap: var(--gap);
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
}
.net-row.configured { background: var(--paper); }
.net-row.unconfigured { background: transparent; border-style: dashed; }
.net-row input[type=checkbox] { width: 18px; height: 18px; cursor: pointer; flex-shrink: 0; }
.net-row.unconfigured input[type=checkbox] { cursor: not-allowed; }
.net-row label {
    flex: 1;
    margin: 0;
    text-transform: none;
    letter-spacing: normal;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
    cursor: pointer;
}
.net-row label.net-disabled { color: var(--muted); cursor: default; }
.net-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(45, 165, 111, .12);
    color: var(--green);
    white-space: nowrap;
}
.net-config-link {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-text);
    background: var(--accent-soft);
    border: 1px solid var(--orange);
    border-radius: 8px;
    padding: 4px 10px;
    cursor: pointer;
    white-space: nowrap;
}
.net-config-link:hover { filter: brightness(.97); }
.net-empty {
    font-size: 12px;
    color: var(--muted);
    padding: 8px 2px;
    line-height: 1.5;
}
.net-badge.todo {
    background: rgba(255, 196, 61, .16);
    color: #8a6d0b;
}

/* Picto « coût » cliquable (réseaux payants) + table de tarifs de la modale */
.cost-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 9px 2px 7px;
    border-radius: 999px;
    background: rgba(255, 196, 61, .16);
    color: #8a6d0b;
    border: 1px solid rgba(255, 196, 61, .5);
    cursor: pointer;
    white-space: nowrap;
    transition: filter var(--ease);
}
.cost-badge:hover { filter: brightness(.96); }
.cost-badge .lc { width: 13px; height: 13px; }

/* Indicateur budget/dépense IA dans l'en-tête (à côté du fournisseur) */
.budget-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
    border: 1px solid transparent;
    transition: filter var(--ease);
}
.budget-chip[hidden] { display: none; }
.budget-chip:hover { filter: brightness(.97); }
.budget-chip .bc-inf { font-size: 14px; line-height: 1; font-weight: 800; }
.budget-chip.is-ok     { color: var(--green);  background: rgba(45, 165, 111, .12); border-color: rgba(45, 165, 111, .35); }
.budget-chip.is-warn   { color: #8a6d0b;       background: rgba(255, 196, 61, .16); border-color: rgba(255, 196, 61, .5); }
.budget-chip.is-danger { color: var(--danger); background: rgba(197, 59, 69, .12);  border-color: rgba(197, 59, 69, .4); }
.budget-chip.is-payg   { color: var(--ink-2);  background: rgba(11, 11, 12, .05);   border-color: rgba(11, 11, 12, .12); }
.cost-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 14px;
}
.cost-table td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--line);
}
.cost-table td:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cost-table tr:last-child td { border-bottom: none; }

/* Icônes de marque des réseaux (sprite SVG) */
.ni {
    width: 1.05em;
    height: 1.05em;
    display: inline-block;
    vertical-align: -0.16em;
    fill: currentColor;
    flex-shrink: 0;
}
/* Icônes UI (Lucide, sprite SVG) — héritent la couleur du texte */
.lc {
    width: 1.05em;
    height: 1.05em;
    display: inline-block;
    vertical-align: -0.16em;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}
.ni-facebook  { color: #1877F2; }
.ni-linkedin  { color: #0A66C2; }
.ni-instagram { color: #E4405F; }
.ni-x         { color: #0f0f0f; }
.ni-tiktok    { color: #0f0f0f; }

/* Header : logos des réseaux configurés à côté du switch de profil */
.header-networks {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 0 2px;
}
.header-networks .hn-ico { display: inline-flex; align-items: center; }
.header-networks .ni { width: 18px; height: 18px; vertical-align: middle; transition: transform .12s ease; }
.header-networks:hover .ni { transform: translateY(-1px); }
.header-networks-empty { font-size: 12px; color: var(--muted); font-style: italic; }

/* Panneau unifié d'un profil (identité + réseaux) */
.profile-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
    margin-bottom: 16px;
}
.profile-head-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 16px;
}
.profile-head-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.profile-head-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.section-subtitle { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--ink); margin: 4px 0 6px; }
.net-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
}
.net-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.net-card-title { font-weight: 700; }
.acct-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 6px;
    background: var(--paper);
}
.acct-line-name { font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.acct-tag { font-size: 11px; color: var(--green); font-weight: 600; }
.acct-line-actions { display: flex; gap: 6px; flex-shrink: 0; }
.net-card-add { margin-top: 2px; }

/* Page de configuration : Profils & réseaux */
.profiles-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}
.profile-card { margin-bottom: 18px; padding: 18px; }
.profile-card.active { border-color: var(--orange); box-shadow: 0 0 0 1px var(--orange) inset; }
.profile-card .profile-head { background: transparent; border: none; padding: 0; margin-bottom: 12px; }
.profile-card .section-subtitle { margin-top: 4px; }
.net-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
}
@media (max-width: 720px) {
    .profiles-toolbar { flex-direction: column; align-items: stretch; }
    .net-grid { grid-template-columns: 1fr; }
}

/* Volet repliable d'options (simplifie l'écran par défaut) */
.options-block {
    margin: var(--gap-lg) 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fafaf8;
}
.options-block > summary {
    padding: 14px 18px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ink-2);
    cursor: pointer;
    list-style: none;
}
.options-block > summary::after { content: " ▾"; color: var(--muted); }
.options-block[open] > summary { border-bottom: 1px solid var(--line); }
.options-block[open] > summary::after { content: " ▴"; }
.options-block > .form-row { margin: 0 18px 4px; }
/* Corps de bloc dépliable contenant des champs empilés (ex. config solde Grok) */
.options-block-body { padding: 14px 18px 16px; }

/* ============================================================ */
/* BOUTONS                                                      */
/* ============================================================ */

/* Bouton Styléo : pilule encre → hover jaune */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 22px;
    background: var(--ink);
    color: var(--white);
    border: 1px solid var(--ink);
    border-radius: var(--radius-pill);
    font-weight: 800;
    font-size: 12px;
    cursor: pointer;
    transition: transform .2s, background .2s, box-shadow .2s, color .2s, border-color .2s;
    text-decoration: none;
    box-shadow: 0 10px 22px rgba(11, 11, 12, .16);
}

.btn:hover {
    color: var(--ink);
    background: var(--yellow);
    border-color: var(--yellow);
    transform: translateY(-1px);
}

.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }

.btn-secondary {
    background: var(--white);
    color: var(--ink);
    border: 1px solid var(--line-strong);
    box-shadow: none;
}

.btn-secondary:hover {
    background: var(--white);
    color: var(--ink);
    border-color: var(--ink);
}

.btn-success {
    background: var(--green);
    border-color: var(--green);
    box-shadow: 0 10px 22px rgba(45, 165, 111, .18);
}

.btn-success:hover {
    background: #259162;
    border-color: #259162;
    color: var(--white);
}

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    box-shadow: none;
}

.btn-danger:hover {
    background: #b03239;
    border-color: #b03239;
    color: var(--white);
}

.btn-sm {
    min-height: 38px;
    padding: 0 14px;
    font-size: 11px;
    box-shadow: none;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-group {
    display: flex;
    gap: var(--gap);
    flex-wrap: wrap;
}

/* Bouton icône carré (édition, suppression…) — homogène et discret */
.btn-icon {
    min-height: 38px;
    width: 38px;
    padding: 0;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--ink);
    border: 1px solid var(--line-strong);
    box-shadow: none;
    font-size: 14px;
}

.btn-icon:hover {
    background: var(--white);
    color: var(--ink);
    border-color: var(--ink);
    transform: translateY(-1px);
}

.btn-icon.danger { color: var(--danger); }

.btn-icon.danger:hover {
    background: rgba(197, 59, 69, .08);
    border-color: var(--danger);
    color: var(--danger);
}

/* ============================================================ */
/* CARTES & PANNEAUX                                            */
/* ============================================================ */

.card {
    background: rgba(255, 255, 255, .92);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: var(--gap-lg);
    box-shadow: var(--shadow-sm);
}

.card.elevated {
    box-shadow: var(--shadow);
}

.card-header {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--line);
}

.card-header h3 {
    margin: 0;
    font-size: 32px;
    line-height: .98;
    letter-spacing: .02em;
    color: var(--ink);
}

/* Sous-titre optionnel sous un titre de carte */
.card-header > p {
    margin: 8px 0 0;
    font-size: 13px;
}

/* Eyebrow / kicker — petit sur-titre orange + barre dégradé (charte Styléo) */
.kicker {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 10px;
    color: var(--accent-text);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.kicker::before {
    content: "";
    width: 28px;
    height: 4px;
    border-radius: 9px;
    background: var(--gradient);
}

.card-body {
    margin-bottom: var(--gap-lg);
}

.card-body:last-child { margin-bottom: 0; }

.card-footer {
    padding-top: var(--gap-lg);
    border-top: 1px solid var(--line);
    display: flex;
    gap: var(--gap);
    justify-content: flex-end;
}

.panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--gap-lg);
}

.panel-item {
    background: var(--white);
    border-left: 4px solid var(--accent);
    padding: var(--gap-lg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.panel-item.success {
    border-left-color: var(--green);
}

.panel-item.warning {
    border-left-color: var(--yellow);
}

/* ============================================================ */
/* TABLEAU DE DONNÉES                                           */
/* ============================================================ */

.table-container {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead {
    background: var(--paper);
    border-bottom: 1px solid var(--line-strong);
}

th {
    padding: var(--gap-lg) var(--gap);
    text-align: left;
    font-weight: 600;
    color: var(--ink);
}

td {
    padding: var(--gap) var(--gap-lg);
    border-bottom: 1px solid var(--line);
}

tbody tr:hover {
    background: rgba(11, 11, 12, .025);
}

tbody tr:last-child {
    background: rgba(255, 196, 61, .05);
    font-weight: 600;
}

.table-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.table-status.success {
    background: rgba(45, 165, 111, .15);
    color: var(--green);
}

.table-status.pending {
    background: rgba(255, 196, 61, .15);
    color: #b8860b;
}

.table-status.draft {
    background: rgba(110, 110, 118, .15);
    color: var(--muted);
}

/* ============================================================ */
/* PROPOSITION (DRAFT CARD)                                     */
/* ============================================================ */

.proposition-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: var(--gap-lg);
    margin-bottom: var(--gap-lg);
    transition: border-color var(--ease), box-shadow var(--ease), transform var(--ease);
}

.proposition-card:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.proposition-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--gap-lg);
    padding-bottom: var(--gap-lg);
    border-bottom: 1px solid var(--line);
}

.proposition-platform {
    display: flex;
    align-items: center;
    gap: var(--gap);
}

.proposition-icon {
    width: 32px;
    height: 32px;
    background: var(--paper);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--accent);
}

.proposition-meta {
    display: flex;
    gap: var(--gap-lg);
    font-size: 12px;
    color: var(--muted);
}

.proposition-content {
    margin-bottom: var(--gap-lg);
    line-height: 1.6;
}

.proposition-content textarea {
    width: 100%;
    min-height: 100px;
    padding: var(--gap);
    border: 1px solid var(--line);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 14px;
}

.proposition-stats {
    display: flex;
    gap: var(--gap-lg);
    padding: var(--gap-lg) 0;
    margin: var(--gap-lg) 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
}

.stat-label {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

.proposition-footer {
    display: flex;
    gap: var(--gap);
    justify-content: space-between;
}

/* ============================================================ */
/* BADGES & TAGS                                                */
/* ============================================================ */

.badge {
    display: inline-block;
    padding: 5px 11px;
    background: var(--paper);
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.badge.primary {
    background: var(--accent-soft);
    border-color: var(--accent-line);
    color: var(--accent-text);
}

.badge.success {
    background: rgba(45, 165, 111, .07);
    border-color: rgba(45, 165, 111, .25);
    color: var(--green);
}

.badge.warning {
    background: rgba(255, 196, 61, .14);
    border-color: rgba(255, 196, 61, .5);
    color: #8a6d0b;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color .2s, transform .2s;
}

.tag:hover { border-color: var(--line-strong); transform: translateY(-1px); }

.tag.selected {
    background: var(--ink);
    color: var(--white);
    border-color: var(--ink);
}

.tag-list {
    display: flex;
    gap: var(--gap);
    flex-wrap: wrap;
    margin: var(--gap) 0;
}

/* ============================================================ */
/* ALERTES & MESSAGES                                           */
/* ============================================================ */

.alert {
    padding: var(--gap-lg);
    border-radius: var(--radius);
    border-left: 4px solid var(--line);
    margin-bottom: var(--gap-lg);
    display: flex;
    gap: var(--gap);
    align-items: flex-start;
}

.alert-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.alert-content {
    flex: 1;
}

.alert.info {
    background: var(--accent-soft);
    border-left-color: var(--orange);
    color: var(--accent-text);
}

.alert.success {
    background: rgba(45, 165, 111, .08);
    border-left-color: var(--green);
    color: #1e6d4a;
}

.alert.warning {
    background: rgba(255, 196, 61, .12);
    border-left-color: var(--yellow);
    color: #b8860b;
}

.alert.error {
    background: rgba(197, 59, 69, .08);
    border-left-color: var(--danger);
    color: #7d3d46;
}

/* ============================================================ */
/* TYPOGRAPHIE                                                  */
/* ============================================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 400;
    margin: 0 0 var(--gap-lg) 0;
    letter-spacing: .04em;
}

h1 {
    font-size: 32px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: 26px;
    color: var(--ink);
}

h3 {
    font-size: 20px;
    color: var(--ink);
}

p {
    margin: 0 0 var(--gap-lg) 0;
    line-height: 1.6;
}

strong {
    font-weight: 600;
    color: var(--ink);
}

/* ============================================================ */
/* UTILITAIRES                                                  */
/* ============================================================ */

/* État vide cohérent (listes sans contenu) */
.empty-state {
    text-align: center;
    color: var(--muted);
    padding: 2.5rem 1rem;
    font-size: 14px;
    margin: 0;
}

.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--green); }
.text-warning { color: #b8860b; }

.mt { margin-top: var(--gap); }
.mt-lg { margin-top: var(--gap-lg); }
.mt-xl { margin-top: var(--gap-xl); }
.mb { margin-bottom: var(--gap); }
.mb-lg { margin-bottom: var(--gap-lg); }
.mb-xl { margin-bottom: var(--gap-xl); }

.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; }
.flex-center { display: flex; align-items: center; }
.flex-gap { gap: var(--gap); }
.flex-gap-lg { gap: var(--gap-lg); }

.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.hidden { display: none; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ============================================================ */
/* WORKFLOW SHELL + ONGLETS (façon quotes/mails)               */
/* ============================================================ */

.workflow-shell {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(255, 255, 255, .94);
    box-shadow: var(--shadow);
}

/* Bande d'onglets connectée en haut du shell */
.stepper {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    margin: 0;
    border-bottom: 1px solid var(--line);
}

.stepper-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 64px;
    padding: 0 22px;
    border: 0;
    border-right: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-align: left;
    text-transform: uppercase;
    cursor: pointer;
    transition: background var(--ease), color var(--ease);
}
.stepper-item:last-child { border-right: 0; }
.stepper-item:hover { background: rgba(11, 11, 12, .025); }

/* Numéro en police display (pas de pastille ronde) */
.stepper-num {
    width: auto;
    height: auto;
    border-radius: 0;
    background: none;
    color: #b3b3b8;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 400;
    flex-shrink: 0;
}

.stepper-item.active { color: var(--ink); background: #fff; }
.stepper-item.active .stepper-num { color: var(--ink); }
/* Souligné dégradé de l'onglet actif (collé au filet inférieur) */
.stepper-item.active::after {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: -1px;
    height: 4px;
    border-radius: 4px 4px 0 0;
    background: var(--gradient);
}

.stepper-item.done { color: var(--ink-2); }
.stepper-item.done .stepper-num { color: var(--green); }

/* Corps du shell : les cartes deviennent des panneaux à plat (le shell porte le cadre) */
.workflow-body { background: transparent; }
.workflow-body .card {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    padding: clamp(24px, 3.5vw, 46px);
    margin: 0;
}
.workflow-body .card + .card { border-top: 1px solid var(--line); }
/* Pied d'étape posé directement dans le panneau (ex. étape 3) : aligne le padding horizontal */
.workflow-body > div > .card-footer {
    margin-top: 0;
    padding: clamp(20px, 2.5vw, 30px) clamp(24px, 3.5vw, 46px);
}

/* Ligne de titre : index orange + grand titre display (façon quotes) */
.title-row { display: flex; align-items: baseline; gap: 13px; }
.panel-index {
    flex-shrink: 0;
    color: var(--accent);
    font-family: var(--font-display);
    font-size: 24px;
    line-height: 1;
}

@media (max-width: 720px) {
    .stepper { grid-template-columns: repeat(5, 1fr); }
    .stepper-item { flex-direction: column; gap: 2px; justify-content: center; padding: 0 8px; font-size: 9px; letter-spacing: .04em; text-align: center; }
}

/* ============================================================ */
/* COMPTEUR DE CARACTÈRES                                        */
/* ============================================================ */

.char-count.ok    { color: var(--green, #2da56f); }
.char-count.warn  { color: #b8860b; }
.char-count.over  { color: var(--danger); }

/* ============================================================ */
/* TOASTS (empilés)                                             */
/* ============================================================ */

#toast-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 390px;
}

/* Toast Styléo : fond encre, texte blanc (lisible), accent couleur à gauche */
#toast-container .alert {
    margin: 0;
    padding: 13px 18px;
    color: #fff;
    background: var(--ink);
    border: 0;
    border-left: 4px solid var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    animation: toastIn .25s ease;
}
#toast-container .alert .alert-content,
#toast-container .alert .alert-content strong { color: #fff; }
#toast-container .alert.success { border-left-color: #43d493; }
#toast-container .alert.error   { border-left-color: var(--danger); }
#toast-container .alert.warning { border-left-color: var(--yellow); }
#toast-container .alert.info    { border-left-color: var(--orange); }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================ */
/* CALENDRIER ÉDITORIAL                                         */
/* ============================================================ */

.cal-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: var(--gap);
}
.cal-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border: 1px solid var(--line);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    background: var(--white);
}
.cal-filter input { cursor: pointer; }

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}
.cal-dow {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
    padding: 4px 0;
}
.cal-cell {
    min-height: 92px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 6px;
    background: var(--white);
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}
.cal-cell.empty { background: transparent; border: none; }
.cal-cell.today { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(248,120,77,.15); }
.cal-daynum { font-size: 12px; font-weight: 700; color: var(--ink); }
.cal-event {
    font-size: 11px;
    background: rgba(255, 196, 61, .18);
    color: #8a6d0b;
    border-radius: 5px;
    padding: 1px 5px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cal-event:hover { filter: brightness(.97); }
/* Couleur par catégorie de marronnier */
.cal-event.cat-commercial { background: rgba(248, 120, 77, .16);  color: #9a4a1f; }
.cal-event.cat-journee    { background: rgba(8, 145, 178, .14);   color: #0a6c86; }
.cal-event.cat-fete       { background: rgba(139, 92, 246, .14);  color: #6d3fc4; }
.cal-event.cat-saison     { background: rgba(45, 165, 111, .15);  color: #1f7a4d; }
/* Pastilles de filtre par catégorie */
.cal-filter-cat.cat-commercial { border-color: #f8784d; }
.cal-filter-cat.cat-journee    { border-color: #0891b2; }
.cal-filter-cat.cat-fete       { border-color: #8b5cf6; }
.cal-filter-cat.cat-saison     { border-color: #2da56f; }
.cal-post {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    border-radius: 5px;
    padding: 1px 4px;
    cursor: pointer;
}
.cal-post.scheduled { background: rgba(248, 120, 77, .15); color: #9a4a23; }
.cal-post.published { background: rgba(45, 165, 111, .15); color: #1e6d4a; }
.cal-post-label { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-post-media { position: relative; flex-shrink: 0; line-height: 0; }
.cal-post-thumb { width: 20px; height: 20px; border-radius: 4px; object-fit: cover; display: block; }
.cal-post-mcount { position: absolute; right: -4px; bottom: -4px; background: var(--ink); color: #fff; border-radius: 999px; font-size: 8px; font-weight: 700; padding: 0 3px; line-height: 1.5; }

@media (max-width: 768px) {
    .cal-cell { min-height: 64px; font-size: 10px; }
}

/* ============================================================ */
/* APERÇU FAÇON RÉSEAU                                          */
/* ============================================================ */

.preview-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--white);
    max-width: 480px;
    margin: 0 auto;
}
.preview-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid var(--line);
}
.preview-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    color: var(--white);
    flex-shrink: 0;
}
.preview-name { font-weight: 700; font-size: 14px; }
.preview-sub { font-size: 12px; color: var(--muted); }
.preview-body { padding: 12px; white-space: pre-wrap; line-height: 1.5; font-size: 14px; }
.preview-media { position: relative; background: #000; }
.preview-cell { position: relative; overflow: hidden; background: #000; }
.preview-cell img { display: block; }
.preview-media-one .preview-cell { aspect-ratio: var(--cell-ratio, 1.91 / 1); }
.preview-media-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.preview-media-grid .preview-cell { aspect-ratio: 1 / 1; }
.preview-crop-btn {
    position: absolute; right: 8px; bottom: 8px;
    display: inline-flex; align-items: center; gap: 5px;
    background: rgba(0,0,0,.62); color: #fff; border: 0;
    font-size: 12px; font-weight: 600; cursor: pointer;
    padding: 5px 10px; border-radius: var(--radius-pill);
    transition: background var(--ease);
}
.preview-crop-btn:hover { background: rgba(0,0,0,.85); }
.preview-crop-btn .lc { width: 14px; height: 14px; }
.preview-media-more {
    position: absolute; right: 6px; bottom: 6px;
    background: rgba(0,0,0,.65); color: #fff;
    font-size: 12px; font-weight: 700;
    padding: 2px 8px; border-radius: var(--radius-pill);
}
.preview-media-fmt {
    padding: 6px 12px;
    font-size: 11px; color: var(--muted);
    border-bottom: 1px solid var(--line);
}
/* Scène de recadrage (Cropper.js) */
.cropper-stage { max-height: 60vh; background: var(--ink, #111); border-radius: var(--radius-sm); }
.cropper-stage img { display: block; max-width: 100%; }

/* ============================================================ */
/* STUDIO MÉDIAS (étape 2)                                      */
/* ============================================================ */
.studio-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.studio-tab {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 14px; border: 1px solid var(--line); background: #fff;
    border-radius: var(--radius-pill); cursor: pointer; font-weight: 600; font-size: 13px;
    color: var(--ink-2); transition: all var(--ease);
}
.studio-tab:hover { border-color: var(--ink-2); }
.studio-tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.studio-tab .ni, .studio-tab svg { width: 15px; height: 15px; }

.studio-formats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.studio-formats-label { font-size: 12px; color: var(--muted); font-weight: 700; margin-right: 4px; }
.fmt-chip {
    display: inline-flex; flex-direction: column; align-items: center; line-height: 1.1;
    padding: 7px 13px; border: 1px solid var(--line); background: #fff;
    border-radius: var(--radius-sm); cursor: pointer; font-weight: 700; font-size: 13px;
    color: var(--ink); transition: all var(--ease);
}
.fmt-chip span { font-size: 10px; font-weight: 500; color: var(--muted); }
.fmt-chip:hover { border-color: var(--accent); }
.fmt-chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.fmt-chip.active span { color: var(--accent-text); }

.studio-main { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.studio-cropper .studio-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.studio-side { display: flex; flex-direction: column; gap: 14px; }
.studio-thumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.studio-thumb { width: 48px; height: 48px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; background: #000; }
.studio-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.studio-thumb.active { border-color: var(--accent); }
.studio-preview .preview-card { max-width: 100%; }
@media (max-width: 900px) { .studio-main { grid-template-columns: 1fr; } }
.preview-actions {
    display: flex; gap: 18px;
    padding: 8px 12px;
    border-top: 1px solid var(--line);
    color: var(--muted); font-size: 13px;
}

/* ============================================================ */
/* MODALES                                                      */
/* ============================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 11, 12, .7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: var(--gap);
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

/* Modale élargie (ex. configuration de compte avec tutoriel illustré) */
.modal-content.modal-wide { max-width: 820px; }

.modal-header { padding: var(--gap-lg); border-bottom: 1px solid var(--line); }
.confirm-message { margin: 0; white-space: pre-line; }

/* Indicateur de chargement : anneau tournant au dégradé de marque + libellé.
   Bloc (.loader-box) pour les zones de contenu ; .loader-ring.sm pour l'intérieur d'un bouton. */
.loader-box {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    padding: 28px 16px;
    color: var(--muted); font-size: 14px;
}
.loader-ring {
    width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
    background: conic-gradient(from 0deg, rgba(248, 120, 77, 0) 8%, var(--orange, #f8784d) 60%, #ff2f63 100%);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
            mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
    animation: loader-spin .8s linear infinite;
}
.loader-ring.sm { width: 15px; height: 15px; display: inline-block; vertical-align: -2px; margin-right: 6px; }
.btn .loader-ring.sm { background: conic-gradient(from 0deg, rgba(255, 255, 255, 0) 8%, #fff 100%); }
.btn-secondary .loader-ring.sm { background: conic-gradient(from 0deg, rgba(248, 120, 77, 0) 8%, var(--orange, #f8784d) 60%, #ff2f63 100%); }
@keyframes loader-spin { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) { .loader-ring { animation-duration: 1.2s !important; } }
.modal-header h2 { margin: 0; }
.modal-body { padding: var(--gap-lg); overflow-y: auto; }
.modal-footer { padding: var(--gap-lg); border-top: 1px solid var(--line); display: flex; gap: var(--gap); justify-content: flex-end; }

/* Aperçu plein écran (lightbox) — clic sur une vignette d'image.
   Au-dessus des modales (.modal-overlay à 9999) : une vignette peut être ouverte depuis une modale. */
.lightbox-overlay {
    position: fixed; inset: 0; z-index: 10000;
    background: rgba(0, 0, 0, .85);
    display: flex; align-items: center; justify-content: center;
    padding: 24px; cursor: zoom-out;
}
.lightbox-img {
    max-width: 95vw; max-height: 92vh;
    object-fit: contain; cursor: default;
    border-radius: 8px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}
.lightbox-close {
    position: fixed; top: 16px; right: 20px;
    width: 40px; height: 40px; border: none; border-radius: 50%;
    background: rgba(255, 255, 255, .15); color: #fff;
    font-size: 26px; line-height: 1; cursor: pointer;
}
.lightbox-close:hover { background: rgba(255, 255, 255, .3); }
.lightbox-actions { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 10001; }
.lightbox-edit { box-shadow: 0 4px 16px rgba(0, 0, 0, .45); }

/* Modale « Modifier l'image (IA) » : aperçu de l'image source */
.imgedit-preview { text-align: center; margin-bottom: var(--gap-lg); }
.imgedit-preview img { max-height: 240px; max-width: 100%; border-radius: 8px; border: 1px solid var(--line); }

/* Configuration agence (Profils & réseaux) : clés IA par défaut + état des apps OAuth */
.agency-card { margin-top: var(--gap-lg); }
.agency-key-row label { display: flex; align-items: center; gap: 8px; }
.agency-apps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.key-agency-badge { color: var(--ink-2); font-weight: 600; font-size: 12px; }

/* Page « Comment ça marche » : cartes de principes empilées */
.help-page { display: flex; flex-direction: column; gap: var(--gap); max-width: 860px; }
.help-page h3 { margin: 0 0 10px; }
.help-page p { margin: 0 0 10px; line-height: 1.65; }
.help-page p:last-child { margin-bottom: 0; }
.help-steps { margin: 0 0 10px; padding-left: 1.3rem; line-height: 1.7; }
.help-steps li { margin-bottom: 6px; }

/* Historique : texte tronqué, vignettes cliquables, lien et statut d'échec */
.hist-text { max-width: 340px; }
.hist-media { display: inline-flex; align-items: center; gap: 4px; }
.hist-thumb { width: 28px; height: 28px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); cursor: zoom-in; }
.hist-thumb:hover { border-color: var(--accent, #f8784d); }
.hist-more { font-size: 11px; color: var(--ink-2); }
.hist-link { color: var(--coral); }
.hist-failed { background: rgba(197, 59, 69, .15); color: var(--danger); cursor: help; }

/* Vignettes d'images enregistrées dans un brouillon */
.draft-media { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.draft-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); cursor: zoom-in; }
.draft-thumb:hover { border-color: var(--accent, #f8784d); }

/* Indice visuel : les vignettes FilePond sont cliquables (zoom) */
.filepond--image-preview-wrapper { cursor: zoom-in; }

/* Sélecteur d'environnement (header) */
.env-select {
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    color: var(--ink);
    font-weight: 600;
    font-size: 13px;
    max-width: 200px;
}

/* Liste de gestion des environnements */
.env-row {
    display: flex;
    align-items: center;
    gap: var(--gap);
    padding: var(--gap) var(--gap-lg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: var(--gap);
    transition: border-color var(--ease), box-shadow var(--ease);
}
.env-row:hover { border-color: var(--line-strong); }
.env-row.active {
    border-color: var(--ink);
    background: #fafaf8;
    box-shadow: 0 0 0 1px var(--ink);
}
.env-row .env-dot { font-size: 11px; vertical-align: 1px; margin-right: 4px; }

/* ============================================================ */
/* TUTORIEL D'OBTENTION DES IDENTIFIANTS (modale compte)        */
/* ============================================================ */

.tuto { margin: .75rem 0 .25rem; font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.tuto h4 {
    margin: 20px 0 6px;
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ink);
}
.tuto h4:first-child { margin-top: 4px; }
.tuto p { margin: 0 0 8px; }
.tuto ol, .tuto ul { margin: 6px 0 10px; padding-left: 1.2rem; }
.tuto li { margin: 5px 0; }
.tuto code {
    padding: 1px 6px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--paper);
    font-size: 12px;
}
.tuto-copy {
    display: flex;
    align-items: stretch;
    gap: 6px;
    margin: 6px 0 10px;
}
.tuto-copy code {
    flex: 1;
    min-width: 0;
    padding: 7px 10px;
    overflow-x: auto;
    white-space: nowrap;
    font-size: 12px;
}
.tuto-copy-btn {
    flex-shrink: 0;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--accent-soft);
    color: var(--accent-text);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.tuto-copy-btn:hover { filter: brightness(.97); }
.tuto figure { margin: 8px 0 14px; }
.tuto-shot {
    display: block;
    width: 100%;
    margin: 6px 0;
    border: 1px solid var(--line);
    border-radius: 10px;
}
.tuto figcaption { margin-top: 4px; color: var(--muted); font-size: 11px; }
/* Emplacement de capture à ajouter (pas d'image cassée) */
.tuto-shot-todo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
    padding: 12px 14px;
    border: 1px dashed var(--line-strong);
    border-radius: 10px;
    background: var(--paper);
    color: var(--muted);
    font-size: 12px;
}
.tuto-shot-todo::before { content: "🖼"; font-size: 14px; }

/* ============================================================ */
/* MÉDIAS — FilePond (charte) + bande de vignettes publication */
/* ============================================================ */

.filepond--root { font-family: var(--font-body); margin-bottom: 0; }
.filepond--panel-root {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.filepond--drop-label { color: var(--muted); }
.filepond--label-action {
    color: var(--accent-text);
    text-decoration-color: var(--accent-line);
}
.filepond--item-panel { border-radius: 10px; }
.filepond--drip-blob { background: var(--ink); }
.filepond--credits { display: none; }

/* Vignettes des images jointes (étape Publication) */
.pub-media {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 var(--gap);
}
.pub-media img {
    width: 54px;
    height: 54px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
}
/* Vignette recadrée (montre la zone réellement publiée pour le réseau) */
.pub-cell {
    position: relative;
    width: 88px;
    aspect-ratio: var(--cell-ratio, 1.91 / 1);
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #000;
}
.pub-cell img { border: 0 !important; border-radius: 0 !important; }
.pub-crop-btn {
    position: absolute; right: 4px; bottom: 4px;
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; padding: 0;
    background: rgba(0,0,0,.6); color: #fff; border: 0; cursor: pointer;
    border-radius: 6px; transition: background var(--ease);
}
.pub-crop-btn:hover { background: rgba(0,0,0,.85); }
.pub-crop-btn .lc { width: 14px; height: 14px; }
.pub-media-hint { font-size: 11px; color: var(--muted); }

/* ============================================================ */
/* ÉCRAN DE CONNEXION (gate Odoo) + chip utilisateur           */
/* ============================================================ */

.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--gap-lg);
}
.login-card {
    width: 100%;
    max-width: 440px;
    animation: viewIn .3s ease;
}
.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: var(--gap-lg);
}
.login-brand img { height: 40px; width: auto; object-fit: contain; mix-blend-mode: multiply; }
.login-brand strong {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 400;
    letter-spacing: .04em;
}
.login-target {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    font-size: 11px;
}

.user-chip {
    max-width: 180px;
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--white);
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tuto-note {
    margin: 10px 0;
    padding: 10px 12px;
    border-left: 4px solid var(--orange);
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent-text);
    font-size: 12px;
}
.tuto-warn {
    border-left-color: var(--yellow);
    background: rgba(255, 196, 61, .14);
    color: #8a6d0b;
}
/* Toggle Personne / Page dans le tuto */
.tuto-toggle {
    display: flex;
    gap: 6px;
    margin: 12px 0 10px;
}
.tuto-toggle button {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    color: var(--ink-2);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.tuto-toggle button.active {
    background: var(--accent-soft);
    border-color: var(--orange);
    color: var(--accent-text);
}
.tuto-pane { display: none; }
.tuto-pane.active { display: block; }

/* Bloc connexion OAuth dans la modale de compte */
.oauth-box {
    margin-top: 14px;
    padding: 12px;
    border: 1px dashed var(--line);
    border-radius: 12px;
    background: var(--paper);
}
.oauth-title { font-weight: 700; margin-bottom: 2px; }
.oauth-desc { font-size: 12px; color: var(--muted); margin: 0 0 10px; }
.oauth-target { display: flex; gap: 16px; font-size: 13px; flex-wrap: wrap; }
.oauth-target label { display: flex; align-items: center; gap: 6px; font-weight: 500; cursor: pointer; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* Parcours guidé de configuration LinkedIn */
.li-step {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
}
.li-step-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    margin-bottom: 8px;
}
.li-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--orange);
    color: #fff;
    font-size: 12px;
    flex-shrink: 0;
}
.li-reco {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-text);
    background: var(--accent-soft);
    padding: 1px 8px;
    border-radius: 999px;
}
.li-manual summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
.li-manual[open] summary { margin-bottom: 8px; }
.env-row .env-info { flex: 1; min-width: 0; }
.env-row .env-name { font-weight: 600; }
.env-row .env-meta { font-size: 12px; color: var(--muted); }
.env-row .env-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ============================================================ */
/* GRILLE DES PROPOSITIONS (3 colonnes, responsive)            */
/* ============================================================ */

.proposition-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap-lg);
}

@media (max-width: 1200px) {
    .proposition-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================================ */
/* RESPONSIVE                                                   */
/* ============================================================ */

@media (max-width: 768px) {
    .app-container {
        grid-template-columns: 1fr;
    }

    /* Sidebar en TIROIR : ouverte par le bouton hamburger, fermée au clic sur le fond ou à la navigation */
    .app-sidebar {
        position: fixed;
        top: 0; bottom: 0; left: 0;
        width: 280px;
        z-index: 6000;
        transform: translateX(-100%);
        transition: transform .22s ease;
        box-shadow: none;
    }
    body.sidebar-open .app-sidebar {
        transform: none;
        box-shadow: 0 0 40px rgba(11, 11, 12, .25);
    }
    .sidebar-backdrop {
        position: fixed; inset: 0;
        z-index: 5999;
        background: rgba(11, 11, 12, .45);
    }
    body.sidebar-open .sidebar-backdrop { display: block; }

    .nav-burger { display: inline-flex; }

    /* En-tête sur DEUX lignes : titre (+ burger) puis contrôles essentiels.
       Le fournisseur, les logos réseaux et l'email passent à la trappe (accessibles ailleurs). */
    .app-header {
        flex-wrap: wrap;
        row-gap: 8px;
        padding: 10px var(--gap);
        min-height: 0;
    }
    .header-title { flex: 1 1 100%; }
    .app-header h2 { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .header-controls { flex: 1 1 100%; gap: 8px; }
    .header-controls .env-select { flex: 1; min-width: 0; }
    .header-networks, .header-provider, .user-chip { display: none; }

    .form-row {
        grid-template-columns: 1fr;
    }

    .panel {
        grid-template-columns: 1fr;
    }

    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }

    .proposition-grid {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 24px;
    }

    .app-content {
        padding: var(--gap-lg) var(--gap);
    }
}

/* Recherche d'images libres de droits (modale) */
.img-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    max-height: 56vh;
    overflow-y: auto;
    padding: 2px;
}
.img-tile {
    margin: 0;
    position: relative;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    background: var(--surface, #fff);
    transition: var(--ease);
}
.img-tile:hover { border-color: var(--accent); box-shadow: 0 2px 10px rgba(0,0,0,.1); }
.img-tile img { display: block; width: 100%; height: 120px; object-fit: cover; }
.img-tile figcaption {
    font-size: 11px;
    color: var(--muted);
    padding: 5px 7px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.img-tile.importing { opacity: .5; pointer-events: none; }
.img-tile.added { border-color: var(--success); }
.img-tile.added::after {
    content: "✓ ajoutée";
    position: absolute;
    top: 6px; right: 6px;
    background: var(--success);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: var(--radius-pill);
}

/* Bandeau licence/crédit sous une image (Studio, étape 2) */
.studio-credit {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--muted);
    margin-top: 8px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    background: var(--bg, #f6f6f7);
    border: 1px solid var(--line);
}
.studio-credit .lc { width: 15px; height: 15px; flex-shrink: 0; }
.studio-credit.warn {
    color: var(--accent-text, #9a4a1f);
    background: var(--accent-soft, #fff7f2);
    border-color: var(--accent-line, #f3d3bf);
}

/* Insights — analyse des posts existants d'un client */
.insights-controls {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.insights-controls .form-group { flex: 1 1 220px; margin: 0; }
.insights-controls .insights-limit-group { flex: 0 1 110px; }
.insights-controls .btn { min-height: 48px; }
.insights-summary { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}
.insights-tile {
    margin: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface, #fff);
    display: flex;
    flex-direction: column;
}
.insights-media { width: 100%; aspect-ratio: 1 / 1; background: var(--bg, #f6f6f7); }
.insights-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.insights-media-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}
.insights-media-empty .lc { width: 28px; height: 28px; }
.insights-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.insights-text {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-wrap;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.insights-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 12px;
    margin-top: auto;
}
.insights-stats { color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.insights-stats .lc { width: 13px; height: 13px; }
.insights-link { display: inline-flex; align-items: center; gap: 3px; color: var(--accent); text-decoration: none; }
.insights-link .lc { width: 13px; height: 13px; }
.insights-link:hover { text-decoration: underline; }

/* Banque d'idées */
.idea-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.idea-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.idea-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--surface, #fff); display: flex; flex-direction: column; gap: 10px; border-left: 4px solid var(--line); }
.idea-card.status-todo { border-left-color: var(--accent, #f06a25); }
.idea-card.status-scheduled { border-left-color: #2d7ff9; }
.idea-card.status-published { border-left-color: var(--success, #1a7f37); }
.idea-card.status-rejected { border-left-color: var(--muted, #999); opacity: .7; }
.idea-text { font-size: 14px; line-height: 1.45; outline: none; border-radius: var(--radius-sm); padding: 2px 4px; }
.idea-text:focus { background: var(--bg, #f6f6f7); box-shadow: 0 0 0 2px var(--accent-line, #f3d3bf); }
.idea-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.idea-meta .idea-status { padding: 3px 6px; font-size: 12px; }
.idea-notes-wrap summary { font-size: 12px; cursor: pointer; }
.idea-notes { margin-top: 6px; }
.idea-actions { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.idea-actions .btn:first-child { flex: 1; }
.idea-li-actions { display: inline-flex; gap: 6px; flex-shrink: 0; }

/* Dashboard statistiques (Insights — Tier 1) */
.insights-stats-panel { margin-bottom: 18px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--surface, #fff); text-align: center; }
.stat-num { font-size: 22px; font-weight: 700; color: var(--ink, #1a1a1a); line-height: 1.1; }
.stat-lbl { font-size: 11px; color: var(--muted); margin-top: 4px; }
.charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-bottom: 14px; }
.chart-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--surface, #fff); }
.chart-card h4 { margin: 0 0 12px; font-size: 13px; color: var(--muted); }

/* Barres verticales */
.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 150px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.bar-val { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.bar-track { width: 100%; max-width: 38px; flex: 1; display: flex; align-items: flex-end; }
.bar-fill { width: 100%; min-height: 2px; background: var(--accent, #f06a25); border-radius: 4px 4px 0 0; transition: height var(--ease); }
.bar-lbl { font-size: 10px; color: var(--muted); margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* Barres horizontales (top posts) */
.hbar-chart { display: flex; flex-direction: column; gap: 8px; }
.hbar-row { display: grid; grid-template-columns: minmax(110px, 1.4fr) 3fr auto; align-items: center; gap: 10px; font-size: 12px; }
.hbar-label { color: var(--ink, #333); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { background: var(--bg, #f0f0f1); border-radius: var(--radius-pill); height: 14px; overflow: hidden; }
.hbar-fill { height: 100%; min-width: 2px; background: var(--accent, #f06a25); border-radius: var(--radius-pill); }
.hbar-val { font-weight: 600; color: var(--muted); min-width: 28px; text-align: right; }

/* Analyse IA des posts (Insights) */
.insights-analysis { border: 1px solid var(--accent-line, #f3d3bf); background: var(--accent-soft, #fff7f2); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.insights-analysis h3, .insights-analysis h4 { color: var(--accent-text, #9a4a1f); }
.insights-ideas { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.insights-ideas li { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--surface, #fff); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 13px; }
.insights-ideas li button { flex-shrink: 0; }

/* Direction artistique (analyse vision) */
.da-row { margin: .5rem 0; font-size: 14px; }
.da-palette { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; vertical-align: middle; }
.da-swatch { display: inline-block; width: 16px; height: 16px; border-radius: 4px; border: 1px solid rgba(11,11,12,.2); background: repeating-linear-gradient(45deg,#eee,#eee 4px,#fafafa 4px,#fafafa 8px); }
.da-swatch-label { font-size: 12px; color: var(--ink-2); margin-right: 6px; }
.da-tag { display: inline-block; background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: 12px; margin: 2px 4px 2px 0; }

/* Proposition de direction artistique en attente de validation (rien n'est enregistré tant que non validé) */
.da-panel.da-pending { border: 1px dashed var(--accent-line, #f8784d); border-radius: var(--radius-sm); padding: 12px 14px; }
.da-pending-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

/* Éditeur de palette : sélecteurs de couleur (modale profil → Direction artistique) */
.da-palette-editor { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.da-color-item { position: relative; display: inline-flex; }
.da-color-input { width: 42px; height: 34px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.da-color-del { position: absolute; top: -6px; right: -6px; width: 16px; height: 16px; border-radius: 50%; border: none; background: var(--ink); color: #fff; font-size: 12px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.da-color-add { display: inline-flex; align-items: center; gap: 4px; background: var(--accent-soft); color: var(--accent-text); border: 1px dashed var(--accent-line); border-radius: 8px; padding: 7px 12px; font-size: 12px; font-weight: 600; cursor: pointer; }
.da-color-add .lc { width: 14px; height: 14px; }

/* Onglets de l'espace Insights (Posts / Statistiques / Analyse éditoriale / Direction artistique) */
.insights-tabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.insights-tab { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; border-bottom: 2px solid transparent; padding: 10px 14px; font-size: 12.5px; font-weight: 700; color: var(--muted); cursor: pointer; margin-bottom: -1px; transition: color var(--ease); white-space: nowrap; }
.insights-tab:hover { color: var(--ink); }
.insights-tab.active { color: var(--ink); border-bottom-color: var(--accent); }
.insights-tab .lc { width: 15px; height: 15px; }
.itab-count { background: var(--accent-soft); color: var(--accent-text); border-radius: 999px; padding: 0 7px; font-size: 11px; font-weight: 800; }
.itab-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); display: inline-block; }
.insights-panel[hidden] { display: none; }

/* Sélecteur de Pages après OAuth Facebook */
.fb-pick-list { display: flex; flex-direction: column; gap: 10px; max-height: 56vh; overflow-y: auto; }
.fb-pick-row { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.fb-pick-main { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.fb-pick-sub { font-size: 12px; margin: 4px 0 0 24px; }
.fb-pick-extra { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 8px 0 0 24px; cursor: pointer; }

/* Publication automatique 24/7 (cron) — panneau discret sous le calendrier */
.cron-panel { margin-top: var(--gap); }
.cron-details {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px 14px;
    background: var(--surface, #fff);
}
.cron-details > summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.cron-details > summary::-webkit-details-marker { display: none; }
.cron-help { margin-top: 6px; }
.cron-cmd { margin: 10px 0; }
.cron-cmd > label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; }
.cron-code-row { display: flex; gap: 8px; align-items: center; }
.cron-code-row code {
    flex: 1;
    background: var(--bg, #f6f6f7);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    font-size: 12px;
    overflow-x: auto;
    white-space: nowrap;
}
