/* ================= Alma Social Club ================= */
:root {
  /* Palette Alma Social Club : sable, doré, bleu nuit, olive */
  --bg: #f6f3e8;
  --surface: #fffefa;
  --surface-2: #efe9d6;
  --ink: #2b2321;
  --ink-2: #4f4542;
  --muted: #7d7766;
  --line: #e3dcc4;
  --accent: #936b64;
  --accent-hover: #7d5953;
  --accent-soft: #e8e3ca;
  --accent-ink: #936b64;
  --gold: #a8996e;
  --gold-ink: #7a6c42;
  --on-accent: #fff;
  --logo-bg: transparent;
  --c-posts: #a8996e;
  --c-tasks: #5f6f3e;
  --c-invoices: #d0705f;
  --c-relances: #8b6a8e;
  --st-brouillon: #9a9384;
  --st-a_valider: #c08a2a;
  --st-valide: #5f7a3e;
  --st-modif: #c2453a;
  --st-publie: #5e8a86;
  --danger: #b83a2f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(80, 55, 50, .05), 0 4px 16px rgba(80, 55, 50, .06);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Poppins', 'Inter', system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1817; --surface: #262120; --surface-2: #332c2a; --ink: #f1eee4; --ink-2: #d2cdbf;
    --muted: #9b9586; --line: #3f3633; --accent: #c99b93; --accent-hover: #d8afa8; --accent-soft: #3d3230; --accent-ink: #e2bdb6;
    --gold: #c9b98a; --gold-ink: #d6c79a; --on-accent: #1c1817; --logo-bg: #e8e3ca;
    --c-posts: #c9b98a; --c-tasks: #9db37a; --c-invoices: #e8907f; --c-relances: #c4a3c7;
    --st-brouillon: #8f8a7e; --st-a_valider: #e0ab4a; --st-valide: #9db37a; --st-modif: #e8786d; --st-publie: #8fbfb9;
    --danger: #e8786d; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25); color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--bg); }
body.no-scroll { overflow: hidden; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
h1 { font-family: var(--display); font-weight: 600; font-size: clamp(24px, 3.6vw, 32px); letter-spacing: .01em; color: var(--accent-ink); }
a { color: var(--gold-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
p { margin: 0 0 .6em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grow { flex: 1; }
.row { display: flex; align-items: center; }
.row.end { justify-content: flex-end; margin-bottom: 12px; }
.row.between { justify-content: space-between; }
.gap-s { gap: 8px; }
.wrap { flex-wrap: wrap; }
.late { color: var(--danger); font-weight: 500; }
.boot { display: grid; place-items: center; min-height: 100vh; color: var(--muted); }

/* ---------- Boutons & champs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 500; text-decoration: none; color: var(--ink); white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost-danger { border-color: transparent; color: var(--danger); background: transparent; }
.btn-sm { min-height: 32px; padding: 0 11px; font-size: 14px; }
.btn-xs { min-height: 28px; padding: 0 9px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 18px; line-height: 1; display: inline-grid; place-items: center; }
.icon-btn.small { width: 28px; height: 28px; font-size: 15px; border-radius: 8px; }
.icon-btn:hover { border-color: var(--muted); }
.link { background: none; border: 0; padding: 0; color: var(--gold-ink); cursor: pointer; text-decoration: none; font-weight: 500; }
.link:hover { text-decoration: underline; }
input, select, textarea { width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type=checkbox] { width: auto; min-height: 0; accent-color: var(--accent); }
select { width: auto; max-width: 100%; }
.field select { width: 100%; }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 14px; }

/* ---------- Mise en page ---------- */
.layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.demo-bar ~ .layout { min-height: calc(100vh - 44px); }
.sidebar { position: sticky; top: 0; align-self: start; height: 100vh; display: flex; flex-direction: column; padding: 22px 14px; border-right: 1px solid var(--line); background: var(--surface); }
.demo-bar ~ .layout .sidebar { top: 44px; height: calc(100vh - 44px); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--display); font-weight: 600; font-size: 19px; padding: 0 8px; }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-family: var(--display); font-size: 18px; }
.brand-mark.big { width: 52px; height: 52px; font-size: 26px; border-radius: 14px; }
.brand-logo { display: block; width: 120px; height: auto; padding: 6px 8px; border-radius: 10px; background: var(--logo-bg); }
.brand-logo.big { width: 170px; margin: 0 auto; }
.role-tag { margin: 6px 0 18px 8px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 500; }
.nav a svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav a .lbl-s { display: none; }
.nav a:hover { background: var(--surface-2); }
.nav a.on { background: var(--accent-soft); color: var(--accent-ink); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 0 8px; word-break: break-all; }
.main { padding: 28px clamp(16px, 3vw, 40px) 60px; max-width: 1400px; width: 100%; outline: none; min-width: 0; }

.demo-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; min-height: 44px; padding: 6px 16px;
  background: #936b64; color: #f6f3e8; font-size: 13px; }
.demo-bar select { min-height: 28px; padding: 2px 8px; font-size: 13px; background: #f6f3e8; color: #2b2321; border: 0; margin-left: 6px; }
.demo-bar label { display: flex; align-items: center; }
.demo-bar .btn { background: transparent; color: #f6f3e8; border-color: rgba(255,255,255,.3); }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.eyebrow { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--gold-ink); font-weight: 600; }
.lead { color: var(--ink-2); max-width: 70ch; margin-bottom: 18px; }
.section-title { font-family: var(--display); font-weight: 600; font-size: 19px; color: var(--accent-ink); margin: 30px 0 14px; }
.back { display: inline-block; margin-bottom: 10px; text-decoration: none; font-size: 14px; font-weight: 500; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card + .card { margin-top: 16px; }
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.card-title-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.card-title-row .card-title { margin: 0; }
.card.narrow { max-width: 640px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.two-col .card + .card { margin-top: 0; }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.kpi span { font-size: 13px; color: var(--muted); }
.kpi strong { font-family: var(--display); font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi em { font-style: normal; font-size: 12px; color: var(--muted); }
a.kpi:hover { border-color: var(--muted); }
.kpi-alert { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.kpi-alert strong { color: var(--danger); }
.kpi-warn strong { color: var(--st-a_valider); }

/* ---------- Tableau de bord ---------- */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.dash-side .card + .card { margin-top: 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); font-size: 13px; cursor: pointer; user-select: none; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.pill:has(input:not(:checked)) { opacity: .45; }
.pill:has(input:focus-visible) { outline: 2px solid var(--accent); }
.pill-posts { --c: var(--c-posts); } .pill-tasks { --c: var(--c-tasks); } .pill-invoices { --c: var(--c-invoices); } .pill-relances { --c: var(--c-relances); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: -4px -4px 12px; overflow-x: auto; }
.tab { flex: 1; background: none; border: 0; padding: 8px 4px; cursor: pointer; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-size: 13.5px; }
.tab.on { color: var(--ink); border-color: var(--gold); }
.count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--surface-2); font-size: 12px; text-align: center; color: var(--ink-2); font-weight: 600; }
.quick-add { display: flex; gap: 6px; margin-bottom: 8px; }
.todo-list { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow: auto; }
.todo-list li { display: flex; align-items: flex-start; gap: 8px; padding: 7px 2px; border-bottom: 1px solid var(--line); }
.todo-list li:last-child { border: 0; }
.todo-list li.empty { color: var(--muted); font-size: 14px; border: 0; padding: 12px 2px; }
.todo-check { position: relative; padding-top: 2px; cursor: pointer; }
.todo-check input { position: absolute; opacity: 0; }
.todo-check .box { display: block; width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--muted); }
.todo-check input:checked + .box { background: var(--c-tasks); border-color: var(--c-tasks); box-shadow: inset 0 0 0 3px var(--surface); }
.todo-check input:focus-visible + .box { outline: 2px solid var(--accent); }
.todo-title { flex: 1; text-align: left; background: none; border: 0; padding: 0; cursor: pointer; font-size: 14px; }
.todo-title small { display: block; color: var(--muted); font-size: 12px; }
li.done .todo-title { color: var(--muted); text-decoration: line-through; }

.mini-list { list-style: none; margin: 0 0 8px; padding: 0; }
.mini-list li > a, .mini-list li > button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 4px; border: 0; background: none; text-align: left; text-decoration: none; color: var(--ink); cursor: pointer; border-radius: 8px; }
.mini-list li > *:hover { background: var(--surface-2); }
.mini-list li span:not(.badge):not(.date-tag):not(.dot) { flex: 1; min-width: 0; }
.mini-list small { display: block; color: var(--muted); font-size: 12px; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot-posts { background: var(--c-posts); } .dot-tasks { background: var(--c-tasks); } .dot-invoices { background: var(--c-invoices); } .dot-relances { background: var(--c-relances); }
.date-tag { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 56px; padding: 4px 6px; border-radius: 9px; background: var(--surface-2); font-size: 12px; font-weight: 600; text-transform: capitalize; flex: none; }
.date-tag small { font-weight: 400; color: var(--muted); }

.goal { margin-bottom: 14px; }
.goal-head { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; margin-bottom: 5px; }
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-bottom: 4px; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--c-tasks); }
.goal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.goal-grid .card + .card { margin-top: 0; }
.goal-card input { width: 110px; }

/* ---------- Calendrier ---------- */
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cal-head h3 { font-family: var(--display); font-weight: 600; font-size: 18px; color: var(--accent-ink); text-transform: capitalize; min-width: 170px; text-align: center; }
.cal-head .btn { margin-left: auto; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.leg { display: inline-flex; align-items: center; gap: 5px; }
.leg i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); text-align: center; padding: 4px 0; font-weight: 600; }
.cal-cell { display: flex; flex-direction: column; align-items: stretch; gap: 3px; min-height: 96px; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; text-align: left; min-width: 0; }
.cal-cell:hover { border-color: var(--muted); }
.cal-cell.out { background: transparent; opacity: .5; }
.cal-cell.sel { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-num { font-size: 13px; font-weight: 600; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.cal-cell.today .cal-num { background: var(--accent); color: var(--on-accent); }
.cal-evs { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-ev { font-size: 11.5px; line-height: 1.35; padding: 1px 6px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: color-mix(in srgb, var(--c) 15%, transparent); color: var(--ink); border-left: 3px solid var(--c); }
.cal-more { font-size: 11px; color: var(--muted); padding-left: 4px; }
.cal-dots { display: none; gap: 3px; flex-wrap: wrap; justify-content: center; }
.cal-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.cal-agenda { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.cal-agenda h4 { font-size: 15px; margin-bottom: 8px; text-transform: capitalize; }
.agenda-item { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; padding: 7px 8px; border: 0; background: none; border-radius: 8px; cursor: pointer; }
.agenda-item:hover { background: var(--surface-2); }
.agenda-item i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); margin-top: 6px; flex: none; }
.agenda-time { width: 44px; flex: none; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.agenda-item small { display: block; color: var(--muted); font-size: 12px; }
.cal-agenda .btn { margin-top: 8px; }
.ev-posts { --c: var(--c-posts); } .ev-tasks { --c: var(--c-tasks); } .ev-invoices { --c: var(--c-invoices); } .ev-relances { --c: var(--c-relances); }
.ev-st-brouillon { --c: var(--st-brouillon); } .ev-st-a_valider { --c: var(--st-a_valider); } .ev-st-valide { --c: var(--st-valide); } .ev-st-modif { --c: var(--st-modif); } .ev-st-publie { --c: var(--st-publie); }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: color-mix(in srgb, var(--c, var(--muted)) 16%, transparent); color: color-mix(in srgb, var(--c, var(--muted)) 75%, var(--ink)); }
.badge-brouillon { --c: var(--st-brouillon); } .badge-a_valider { --c: var(--st-a_valider); } .badge-valide { --c: var(--st-valide); }
.badge-modif { --c: var(--st-modif); } .badge-publie { --c: var(--st-publie); } .badge-payee { --c: var(--st-valide); }
.badge-envoyee { --c: var(--st-publie); } .badge-retard { --c: var(--st-modif); } .badge-cat { --c: var(--c-relances); }
.net { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); }
.net-instagram { color: #b8407a; } .net-facebook { color: #3b5fae; } .net-linkedin { color: #2a6ea8; } .net-tiktok { color: var(--ink); } .net-pinterest { color: #b5262e; } .net-youtube { color: #c22; } .net-google { color: #2f7d4a; }
@media (prefers-color-scheme: dark) { .net-instagram { color: #e57aae; } .net-facebook, .net-linkedin { color: #8fb1ea; } .net-pinterest, .net-youtube { color: #ec7d7d; } .net-google { color: #7fc79a; } }
.new-dot { font-size: 11px; font-weight: 600; color: var(--st-modif); margin-left: 6px; }

/* ---------- Publications ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface-2); gap: 2px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .seg { margin: 0; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; cursor: pointer; font-weight: 500; color: var(--ink-2); font-size: 14px; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg-lg { margin-bottom: 18px; }
.week-group { margin-bottom: 22px; }
.week-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.post-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.post-card { display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px 14px 10px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-align: left; cursor: pointer; }
.post-card:hover { border-color: var(--muted); }
.post-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.post-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-main small { color: var(--muted); font-size: 13px; }
.comment-inline { color: var(--st-modif) !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.flags { font-size: 12px; color: var(--muted); }
.post-detail h3 { font-family: var(--display); font-size: 21px; font-weight: 600; margin: 10px 0 4px; color: var(--accent-ink); }
.caption { background: var(--surface-2); padding: 12px 14px; border-radius: 10px; margin: 12px 0; }
.caption p:last-child { margin: 0; }
.feedback { color: var(--st-valide); font-size: 14px; font-weight: 500; }
.comment-box { background: color-mix(in srgb, var(--st-modif) 10%, transparent); border-left: 3px solid var(--st-modif); padding: 10px 12px; border-radius: 8px; margin: 10px 0; font-size: 14px; }
.change-form { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.change-form label { font-weight: 600; font-size: 14px; }

/* ---------- CRM ---------- */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kcol { background: var(--surface-2); border-radius: var(--radius); padding: 12px; min-height: 200px; }
.kcol h3 { font-size: 14px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.kcol .count { background: var(--surface); }
.kcard { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; margin-bottom: 8px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; }
.kcard:hover { border-color: var(--muted); }
.kcard small { font-size: 12.5px; color: var(--muted); }
.kcard small.late { color: var(--danger); }
.kmove { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 16px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); font-weight: 600; white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr[data-open] { cursor: pointer; }
.table tbody tr[data-open]:hover { background: var(--surface-2); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.actions { white-space: nowrap; text-align: right; }
.actions .btn + .btn { margin-left: 4px; }
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.subtabs button { background: none; border: 0; padding: 10px 12px; cursor: pointer; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.subtabs button.on { color: var(--ink); border-color: var(--gold); }
.dl { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; margin: 0 0 12px; font-size: 14px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.notes { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.act-form { display: grid; grid-template-columns: auto auto 1fr auto; gap: 6px; margin-bottom: 12px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 8px 32px 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.timeline .tl-type { font-weight: 600; margin-right: 8px; }
.timeline .tl-date { color: var(--muted); font-size: 13px; }
.timeline p { margin: 2px 0 0; }
.timeline .icon-btn { position: absolute; right: 0; top: 8px; }
.ticks { padding-left: 20px; }
.ticks li { margin-bottom: 4px; }

/* ---------- Documents ---------- */
.upload-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.doc-group { margin-bottom: 20px; }
.doc-list { list-style: none; padding: 0; margin: 0; }
.doc-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.doc-list li:last-child { border: 0; }
.doc-ico { width: 40px; height: 40px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-size: 10.5px; font-weight: 700; flex: none; }
.doc-name { flex: 1; min-width: 0; }
.doc-name strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.doc-name small { color: var(--muted); font-size: 12px; }
.dropzone { text-align: center; border: 2px dashed var(--line); box-shadow: none; padding: 28px 18px; margin-bottom: 16px; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- Ressources ---------- */
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 10px; }
.res-grid-wide { grid-template-columns: 1fr; }
.res-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.res-card h3 { font-family: var(--display); font-weight: 600; font-size: 17px; color: var(--accent-ink); margin: 10px 0 8px; }
.res-strategie { border-top: 4px solid var(--gold); }
.rich { font-size: 14.5px; color: var(--ink-2); }
.rich ul, .rich ol { margin: 0 0 .6em; padding-left: 20px; }
.rich p:last-child { margin-bottom: 0; }

/* ---------- Graphique facturation ---------- */
.bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; height: 170px; align-items: end; }
.bar-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; min-width: 0; }
.bar-col i { display: block; width: 100%; max-width: 34px; min-height: 2px; border-radius: 6px 6px 2px 2px; background: var(--c-tasks); }
.bar-col:last-child i { background: var(--gold); }
.bar-col small { font-size: 11px; color: var(--muted); }
.bar-val { font-size: 10px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.card + .seg { margin-top: 18px; }

/* ---------- Modale & formulaires ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(30, 20, 12, .45); display: grid; place-items: center; padding: 16px; overflow-y: auto; animation: fade .15s; }
.modal { position: relative; width: 100%; max-width: 600px; background: var(--surface); border-radius: 18px; padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,.25); max-height: calc(100vh - 32px); overflow-y: auto; }
.modal-wide { max-width: 760px; }
.modal > h3 { font-family: var(--display); font-weight: 600; font-size: 21px; color: var(--accent-ink); margin-bottom: 16px; padding-right: 30px; }
.modal-x { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--surface-2); font-size: 20px; cursor: pointer; line-height: 1; }
@keyframes fade { from { opacity: 0; } }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { grid-column: span 2; display: flex; flex-direction: column; gap: 4px; margin-bottom: 4px; }
.field.half { grid-column: span 1; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field small { color: var(--muted); font-size: 12px; }
.form-grid .check { grid-column: span 2; }
.form-grid .check.half { grid-column: span 1; align-self: end; padding-bottom: 10px; }
.form-actions { grid-column: span 2; display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice-grid .btn { min-height: 64px; }

.empty-state { text-align: center; padding: 50px 20px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-state .btn { margin-top: 8px; }

#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow); transition: opacity .4s, transform .4s; max-width: calc(100vw - 32px); }
.toast-error { background: var(--danger); color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- Connexion ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 32px 28px; box-shadow: var(--shadow); text-align: center; }
.login-card h1 { margin: 12px 0 8px; }
.login-card form { text-align: left; display: flex; flex-direction: column; gap: 8px; margin: 18px 0 10px; }
.login-card label { font-size: 13px; font-weight: 600; margin-top: 4px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 84px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 600; padding: 5px 9px; border-radius: 7px; cursor: pointer; }
.login-links { display: flex; flex-direction: column; gap: 8px; align-items: center; margin-top: 6px; font-size: 14px; }
.msg-error { color: var(--danger); }
.msg-ok { color: var(--st-valide); }
.sidebar-foot .link { text-align: left; font-size: 13px; }
.notice { background: var(--accent-soft); padding: 10px 12px; border-radius: 10px; font-size: 14px; }

/* ---------- Visuels, formats, feed ---------- */
.fmt { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-ink); vertical-align: middle; }
.fmt svg, .pp-fmt svg, .feed-fmt svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.post-thumb { width: 46px; height: 58px; border-radius: 8px; overflow: hidden; background: var(--surface-2); flex: none; }
.post-thumb:empty { display: none; }
.post-thumb img, .post-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 12px 0; padding-bottom: 4px; }
.gallery > * { flex: none; scroll-snap-align: start; }
.gallery img, .gallery video { height: 260px; width: auto; max-width: 80vw; border-radius: 10px; display: block; background: var(--surface-2); }
.hashtags { font-size: 13.5px; color: var(--c-relances); overflow-wrap: anywhere; white-space: pre-line; }
.note-box { background: color-mix(in srgb, var(--st-a_valider) 14%, transparent); border-left: 3px solid var(--st-a_valider); padding: 9px 12px; border-radius: 8px; margin: 10px 0; font-size: 14px; }
.vis-editor { border: 1.5px dashed var(--line); border-radius: 12px; padding: 8px; }
.vis-editor.over { border-color: var(--gold); background: var(--accent-soft); }
.vis-list { display: flex; flex-wrap: wrap; gap: 8px; }
.vis-item, .vis-add { position: relative; width: 84px; height: 105px; border-radius: 9px; overflow: hidden; background: var(--surface-2); flex: none; }
.vis-item img, .vis-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.vis-tools { position: absolute; inset: auto 0 0 0; display: flex; justify-content: center; gap: 3px; padding: 3px; background: linear-gradient(transparent, rgba(0,0,0,.55)); }
.vis-tools button { width: 24px; height: 24px; border-radius: 6px; border: 0; background: rgba(255,255,255,.9); color: #2b2321; cursor: pointer; font-size: 14px; line-height: 1; padding: 0; }
.vis-cover { position: absolute; top: 4px; left: 4px; font-size: 10px; font-weight: 600; padding: 1px 5px; border-radius: 5px; background: rgba(255,255,255,.9); color: #2b2321; }
.vis-loading { display: grid; place-items: center; font-size: 12px; color: var(--muted); }
.vis-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; border: 1px solid var(--line); background: var(--surface); text-align: center; }
.vis-add span { font-size: 26px; color: var(--gold-ink); line-height: 1; }
.vis-add small { font-size: 10.5px; color: var(--muted); padding: 0 4px; }
.vis-add:hover { border-color: var(--gold); }
.logo-slot { width: 64px; height: 44px; border-radius: 8px; border: 1px dashed var(--line); display: grid; place-items: center; cursor: pointer; font-size: 11px; color: var(--muted); background: var(--logo-bg); overflow: hidden; }
.logo-slot img { max-width: 90%; max-height: 90%; }
.media-missing { display: block; width: 100%; height: 100%; background: var(--surface-2); }

.feed-card { padding: 16px; }
.pub-split { grid-template-columns: minmax(0, 1fr) minmax(0, 380px); align-items: start; }
.feed { max-width: 470px; margin: 0 auto; }
.feed-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.feed-head strong { display: block; }
.feed-head small { color: var(--muted); font-size: 12.5px; }
.feed-avatar { width: 54px; height: 54px; border-radius: 50%; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; overflow: hidden; flex: none; }
.feed-avatar img { width: 78%; height: 78%; object-fit: contain; }
.feed-avatar-txt { font-family: var(--display); font-weight: 600; font-size: 22px; color: #936b64; background: #e8e3ca; }
.feed-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.feed-tile { position: relative; aspect-ratio: 3 / 4; padding: 0; border: 0; background: var(--surface-2); cursor: pointer; overflow: hidden; }
.feed-tile img, .feed-tile video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.feed-tile:hover img { transform: scale(1.03); }
.feed-tile.is-draft { outline: 2px dashed var(--st-brouillon); outline-offset: -2px; }
.feed-tile.is-draft img { opacity: .6; }
.feed-fmt { position: absolute; top: 6px; right: 6px; color: #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.feed-fmt svg { width: 18px; height: 18px; }
.feed-date { position: absolute; left: 4px; bottom: 4px; font-size: 10.5px; font-weight: 600; padding: 1px 6px; border-radius: 5px; background: rgba(255,255,255,.88); color: #2b2321; }
.feed-tile.is-future .feed-date { background: #936b64; color: #fff; }
.feed-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 8px; font-size: 12px; text-align: center; color: var(--ink-2); background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 8px, var(--accent-soft) 8px, var(--accent-soft) 16px); }
.feed-empty small { color: var(--muted); font-size: 11px; }

.feed-bar { background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 13.5px; }
.feed-bar p { margin-bottom: 8px; }
.feed-grid.is-editing .feed-tile.is-movable { cursor: grab; }
.feed-grid.is-editing .feed-tile.is-locked { cursor: not-allowed; }
.feed-grid.is-editing .feed-tile.is-locked img { opacity: .45; }
.feed-tile.is-selected { outline: 3px solid var(--gold); outline-offset: -3px; }
.feed-tile.is-over { outline: 3px dashed var(--accent); outline-offset: -3px; }
.feed-tile.is-dragging { opacity: .4; }
.feed-tile.is-moved .feed-date { background: var(--gold); color: #2b2321; }
.feed-lock { position: absolute; top: 6px; left: 6px; font-size: 13px; }
.feed-grid.is-editing .feed-tile:hover img { transform: none; }

.checks { border: 0; padding: 0; margin: 0 0 4px; min-width: 0; }
.checks legend { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; padding: 0; }
.check-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-check { position: relative; cursor: pointer; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check span { display: inline-block; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: 13.5px; font-weight: 500; user-select: none; }
.chip-check input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip-check input:checked + span::before { content: '✓ '; }
.chip-check input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

#print-root { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1150px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-side { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .dash-side .card + .card { margin-top: 0; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: auto !important; bottom: 0; left: 0; right: 0; height: auto !important; z-index: 40; flex-direction: row; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); }
  .brand, .role-tag, .sidebar-foot { display: none; }
  .nav { flex-direction: row; width: 100%; justify-content: space-around; gap: 0; }
  .nav a { flex-direction: column; gap: 2px; padding: 6px 4px; font-size: 10.5px; flex: 1; text-align: center; min-width: 0; }
  .nav a .lbl { display: none; }
  .nav a .lbl-s { display: block !important; }
  .nav a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
  .main { padding-bottom: 100px; }
  .two-col, .dash-side, .pub-split { grid-template-columns: 1fr; }
  .gallery img, .gallery video { height: 200px; }
  .two-col .card + .card, .dash-side .card + .card { margin-top: 0; }
  .two-col { gap: 16px; }
  .cal-cell { min-height: 54px; align-items: center; padding: 4px 2px; }
  .cal-evs { display: none; }
  .cal-dots { display: flex; }
  .cal-head h3 { min-width: 0; font-size: 17px; flex: 1; }
  .act-form { grid-template-columns: 1fr 1fr; }
  .act-form input[name=note] { grid-column: span 2; }
  .act-form .btn { grid-column: span 2; }
  .dl { grid-template-columns: 1fr; gap: 0; }
  .dl dd { margin-bottom: 8px; }
  .bar-val { display: none; }
  #toasts { bottom: 86px; }
}
@media (max-width: 520px) {
  .form-grid { grid-template-columns: 1fr; }
  .field, .field.half, .form-grid .check, .form-grid .check.half, .form-actions { grid-column: span 1; }
  .post-card { gap: 10px; padding: 8px 10px 8px 8px; }
  .post-side .flags { display: none; }
  .post-thumb { width: 38px; height: 48px; }
  .modal { padding: 20px 16px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi strong { font-size: 22px; }
  .demo-bar { font-size: 12px; gap: 8px; }
  .demo-bar > span { display: none; }
  .cal-head .btn { display: none; }
}

/* =========================================================
   Export PDF du planning (impression)
   ========================================================= */
@page { size: A4 portrait; margin: 14mm 14mm 16mm; @bottom-right { content: "PAGE " counter(page, decimal-leading-zero); font: 600 8pt Poppins, sans-serif; color: #fff; background: #a8996e; padding: 0 3mm; height: 6mm; margin-top: 7mm; } }
@page :first { margin: 0; @bottom-right { content: none; background: none; } }
@media print {
  body.printing > *:not(#print-root) { display: none !important; }
  body.printing { background: #fff; color: #2b2321; }
  body.printing #print-root { display: block; }
}
#print-root { font-family: 'Inter', system-ui, sans-serif; font-size: 9.5pt; line-height: 1.45; color: #2b2321; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
#print-root img { display: block; }
.pp-cover { position: relative; height: 297mm; width: 210mm; overflow: hidden; display: flex; flex-direction: column; break-after: page; background: #fff; }
.pp-cover-band { background: #e8e3ca; color: #7a6c42; font: 600 10pt Poppins, sans-serif; text-transform: uppercase; letter-spacing: .08em; padding: 7mm 16mm 6mm; }
.pp-cover h1 { font: 600 40pt/1.1 Poppins, sans-serif; color: #936b64; margin: 22mm 16mm 4mm; letter-spacing: .01em; }
.pp-period { font: 500 11pt Poppins, sans-serif; color: #a8996e; margin: 0 16mm; letter-spacing: .04em; }
.pp-cover-logo { flex: 1; display: grid; place-items: center; padding: 10mm 30mm; }
.pp-cover-logo img { max-width: 120mm; max-height: 110mm; object-fit: contain; }
.pp-cover-logo span { font: 600 26pt Poppins, sans-serif; color: #936b64; text-align: center; }
.pp-cover-foot { display: grid; grid-template-columns: 1.3fr 1fr auto; gap: 8mm; align-items: center; padding: 9mm 16mm 11mm; background: #e8e3ca; color: #7a6c42; font-size: 9pt; }
.pp-cover-foot span, .pp-cover-foot strong { display: block; }
.pp-cover-foot strong { color: #7a6c42; margin-bottom: 1mm; }
.pp-up { text-transform: uppercase; letter-spacing: .06em; }
.pp-brand img { width: 34mm; }
.pp-page { break-before: page; }
.pp-band { background: #e8e3ca; color: #a8996e; text-align: center; font: 500 15pt Poppins, sans-serif; letter-spacing: .08em; text-transform: uppercase; padding: 4mm; margin-bottom: 6mm; }
.pp-feed { display: grid; grid-template-columns: repeat(3, 40mm); gap: 1mm; justify-content: center; }
.pp-tile { position: relative; width: 40mm; height: 53mm; overflow: hidden; background: #efe9d6; }
.pp-tile img { width: 100%; height: 100%; object-fit: cover; }
.pp-tile span { position: absolute; top: 1.5mm; right: 1.5mm; color: #fff; }
.pp-tile svg { width: 4mm; height: 4mm; fill: none; stroke: currentColor; stroke-width: 2; filter: drop-shadow(0 0 1px rgba(0,0,0,.6)); }
.pp-post { break-inside: avoid; margin-bottom: 8mm; }
.pp-post h2 { font: 600 17pt Poppins, sans-serif; color: #936b64; margin: 0; display: flex; align-items: center; gap: 2.5mm; letter-spacing: .02em; }
.pp-fmt svg { width: 6mm; height: 6mm; stroke: #936b64; stroke-width: 1.7; }
.pp-post hr { border: 0; border-top: 1.2mm solid #e8e3ca; margin: 2mm 0 4mm; }
.pp-split { display: grid; grid-template-columns: 60mm 1fr; gap: 6mm; align-items: start; }
.pp-single img { width: 60mm; max-height: 85mm; object-fit: cover; }
.pp-strip { display: flex; gap: 2mm; justify-content: center; margin-top: 3mm; flex-wrap: wrap; }
.pp-strip img { width: 27mm; height: 36mm; object-fit: cover; }
.pp-video { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 27mm; height: 36mm; background: #936b64; color: #fff; font-size: 14pt; }
.pp-split .pp-video { width: 60mm; height: 80mm; }
.pp-video small { font-size: 6.5pt; padding: 1mm; text-align: center; overflow-wrap: anywhere; }
.pp-caption p { margin: 0 0 2mm; }
.pp-caption ul, .pp-caption ol { margin: 0 0 2mm; padding-left: 5mm; }
.pp-tags { margin: 2mm 0 0; color: #2b2321; overflow-wrap: anywhere; }
.pp-muted { color: #7d7766; font-size: 8.5pt; margin: 1.5mm 0 0; }
