.perf-account-summary {display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:16px;margin-bottom:24px}
.perf-account-summary article {background:var(--panel);border:1px solid var(--line);border-top:3px solid var(--blue);border-radius:12px;padding:20px;display:flex;flex-direction:column;gap:8px}
.perf-account-summary strong {font-size:30px;line-height:1.2}
.perf-account-summary small,.perf-result-count {color:var(--muted)}
.perf-filters {display:flex;flex-wrap:wrap;gap:12px;align-items:flex-end;margin-bottom:12px}
.perf-filters label {display:flex;flex:1 1 150px;flex-direction:column;gap:6px;font-weight:600}
.perf-filters label:first-child {flex:2 1 220px}
.perf-publications table {min-width:1150px}
.perf-publications td:first-child {min-width:280px;max-width:380px}
.perf-publication-meta {display:block;margin-top:6px;line-height:1.5}
.perf-empty {text-align:center;padding:30px!important;color:var(--muted)}
@media(max-width:640px){.perf-account-summary {grid-template-columns:1fr}.perf-filters label {flex-basis:100%}}
:root {
  --font: Inter, "Segoe UI", Arial, sans-serif;
  --blue: #1746d1;
  --cyan: #31b9cc;
  --magenta: #d91b5c;
  --yellow: #ffc928;
  --ink: #172033;
  --muted: #667085;
  --line: #dce2eb;
  --surface: #f6f8fb;
  --panel: #ffffff;
  --soft-blue: #eef4ff;
  --soft-yellow: #fff7d6;
  --soft-green: #eaf7ef;
  --soft-red: #fdecec;
  --green: #17814f;
  --red: #b42318;
  --sidebar: 252px;
  --shadow: 0 14px 36px rgba(23, 32, 51, .10);
}

.mobile-brand-bar { display: none; }
.media-upload-preview:has(.media-picker-item) { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.media-picker-item { min-width: 0; }
.media-picker-item img, .media-picker-item video { width: 100%; height: 150px; object-fit: cover; border-radius: 8px; }
.media-picker-item > div { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }

.workspace-tabs { display:flex; gap:8px; flex-wrap:wrap; padding:0 0 22px; border-bottom:1px solid var(--line); margin-bottom:24px; }
.data-tools { display:flex; align-items:end; flex-wrap:wrap; gap:12px; margin-bottom:20px; }
.data-tools label { display:flex; flex-direction:column; gap:6px; min-width:160px; flex:1; font-size:12px; font-weight:600; color:var(--muted); }
.data-tools label:first-child { flex:2; min-width:220px; }
.data-summary { display:flex; align-items:center; flex-wrap:wrap; gap:10px; padding:12px 0; color:var(--muted); font-size:12px; }
.data-summary span { margin-right:auto; }
.grid-sort { background:none; border:0; padding:0; text-align:left; font-weight:700; cursor:pointer; white-space:nowrap; }
.grid-selected { background:var(--soft-blue); }
.lead-name { font-size:15px; font-weight:750; white-space:nowrap; }
.lead-contact { font-size:14px; font-weight:600; color:var(--blue); text-decoration:none; white-space:nowrap; }
.lead-contact:hover { text-decoration:underline; }
.lead-missing { color:var(--muted); font-size:12px; }
.lead-status { min-width:124px; padding:8px 10px; border:1px solid var(--line); border-radius:8px; font-weight:600; font-size:12px; }
.lead-status--rdv { background:var(--soft-green); color:var(--green); }
.lead-status--refus { background:var(--soft-red); color:var(--red); }
.lead-status--reporte { background:var(--soft-blue); color:var(--blue); }
.lead-status--attente { background:var(--soft-yellow); color:var(--ink); }
.lead-status:disabled { opacity:.6; cursor:wait; }
.lead-details { min-width:210px; max-width:360px; }
.lead-details summary { color:var(--muted); cursor:pointer; font-weight:600; font-size:12px; }
.lead-details dl { margin:12px 0 0; padding:12px; background:var(--surface); border-radius:8px; }
.lead-details dl div { margin-bottom:10px; }
.lead-details dt { color:var(--muted); font-size:11px; }
.lead-details dd { margin:3px 0 0; font-size:13px; overflow-wrap:anywhere; }
.grid-row-clickable { cursor:pointer; }
.grid-row-clickable:hover { background:var(--soft-blue); }
.lead-sheet__identity { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:20px; }
.lead-sheet__identity h3 { margin:6px 0 0; font-size:23px; }
.lead-sheet__contacts { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:28px; }
.lead-sheet__contacts > div { padding:14px; background:var(--soft-blue); border-radius:10px; min-width:0; }
.lead-sheet__contacts span { display:block; color:var(--muted); font-size:11px; margin-bottom:6px; }
.lead-sheet__contacts a,.lead-sheet__contacts strong { font-size:15px; font-weight:650; color:var(--ink); overflow-wrap:anywhere; }
.lead-sheet h4 { font-size:15px; margin:0 0 14px; }
.lead-sheet h4 span { color:var(--muted); font-weight:400; }
.lead-sheet__answers { display:grid; gap:12px; margin:0; }
.lead-sheet__answers > div { padding:14px 16px; border:1px solid var(--line); border-radius:8px; }
.lead-sheet__answers dt { display:flex; align-items:center; gap:10px; color:var(--muted); font-size:12px; }
.lead-sheet__answers dt span { color:var(--blue); font-size:10px; font-weight:700; }
.lead-sheet__answers dd { margin:8px 0 0; font-size:14px; white-space:pre-wrap; overflow-wrap:anywhere; }
.lead-sheet__origin { border-top:1px solid var(--line); margin-top:24px; padding-top:18px; }
.lead-sheet__origin summary { font-size:12px; color:var(--muted); cursor:pointer; }
.lead-sheet__origin dl > div { display:grid; grid-template-columns:110px 1fr; gap:12px; margin-top:12px; font-size:12px; }
.lead-sheet__origin dt { color:var(--muted); }
.lead-sheet__origin dd { margin:0; overflow-wrap:anywhere; }
@media(max-width:540px) { .lead-sheet__contacts { grid-template-columns:1fr; } .lead-sheet__identity { align-items:flex-start; } }
.data-table td { user-select:text; }
.login-shell { min-height:100vh; display:grid; grid-template-columns:minmax(0,1.05fr) minmax(0,1fr); background:var(--panel); }
.login-story { position:relative; padding:64px clamp(32px,6vw,96px); background:linear-gradient(135deg,#11295a,#1746a5); color:#fff; display:flex; flex-direction:column; justify-content:center; overflow:hidden; }
.login-story::after { content:''; position:absolute; right:-180px; bottom:-220px; width:560px; height:560px; border:80px solid #ffffff08; border-radius:50%; pointer-events:none; }
.login-logo { width:230px; padding:16px 20px; border-radius:12px; background:#fff; margin-bottom:52px; }
.login-logo img { display:block; width:100%; height:auto; }
.login-eyebrow { font-size:11px; font-weight:700; letter-spacing:.18em; color:#b9d7ff; }
.login-story h1 { font-size:clamp(32px,4vw,54px); letter-spacing:-.045em; line-height:1.13; margin:20px 0; }
.login-story > p { max-width:450px; color:#d6e4ff; font-size:16px; line-height:1.7; }
.login-features { display:grid; gap:18px; margin:38px 0 52px; }
.login-features div { display:flex; align-items:center; gap:16px; font-size:14px; }
.login-features strong { color:#98dbe6; border:1px solid #ffffff30; padding:8px; border-radius:8px; font-size:12px; }
.login-story footer { font-size:10px; letter-spacing:.15em; color:#b9d7ff; }
.login-access { display:flex; flex-direction:column; justify-content:center; align-items:center; padding:48px 32px; }
.login-card { max-width:410px; width:100%; }
.login-card h2 { font-size:30px; letter-spacing:-.035em; margin:12px 0; }
.login-card > p { color:var(--muted); margin:0 0 32px; }
.login-card .form-group { margin-bottom:20px; }
.login-card .form-control { min-height:48px; }
.login-card small { display:block; color:var(--muted); margin-top:24px; font-size:12px; }
.login-submit { width:100%; min-height:48px; }
.password-field { position:relative; }
.password-field input { padding-right:85px; }
.password-field button { position:absolute; right:12px; top:15px; font-size:12px; border:0; background:none; cursor:pointer; color:var(--blue); }
#login-error { color:var(--red); font-size:13px; }
.login-access footer { margin-top:64px; color:var(--muted); font-size:12px; }
@media(max-width:760px) { .login-shell { grid-template-columns:1fr; } .login-story { padding:28px; } .login-logo { width:180px; margin-bottom:20px; } .login-story h1 { font-size:30px; } .login-features,.login-story footer { display:none; } .login-access { padding:32px 24px; } .login-access footer { margin-top:28px; } .data-tools label { min-width:140px; } }
[data-theme="dark"] {
  --ink: #f2f4f7;
  --muted: #aab2c0;
  --line: #344054;
  --surface: #111827;
  --panel: #1d2939;
  --soft-blue: #1e315f;
  --soft-yellow: #4c3b0a;
  --soft-green: #163c2b;
  --soft-red: #4a2020;
}
* { box-sizing: border-box; }
html { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }
body { margin: 0; min-width: 320px; min-height: 100vh; font-family: var(--font); color: var(--ink); background: var(--surface); line-height: 1.45; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -60px; left: 12px; z-index: 1200; padding: 10px 14px; color: #fff; background: var(--blue); text-decoration: none; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid rgba(49, 185, 204, .55); outline-offset: 2px; }

.app-layout { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; padding: 20px 16px 14px; background: var(--panel); border-right: 1px solid var(--line); z-index: 30; }
.sidebar__brand { display: flex; flex-direction: column; gap: 2px; padding: 0 4px 16px; border-bottom: 1px solid var(--line); }
.sidebar__logo-img { width: 100%; max-width: 200px; height: auto; max-height: 56px; object-fit: contain; object-position: left center; display: block; margin-bottom: 6px; }
[data-theme="dark"] .sidebar__logo-img { background: #ffffff; padding: 4px 6px; border-radius: 4px; }
.sidebar__brand strong { margin-top: 6px; color: var(--blue); font-size: 19px; font-weight: 800; }
.sidebar__brand span { color: var(--muted); font-size: 12px; }
.brand-switch-label { margin-top: 12px; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.brand-switch { width: 100%; min-height: 34px; margin-top: 4px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: var(--panel); font-size: 12px; font-weight: 600; cursor: pointer; }
.sidebar__nav { display: flex; flex-direction: column; gap: 2px; margin-top: 18px; }
.nav-item { min-height: 40px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; border: 0; border-left: 3px solid transparent; background: transparent; color: var(--muted); cursor: pointer; text-align: left; font-size: 13px; font-weight: 500; border-radius: 0 4px 4px 0; }
.nav-item b { color: #98a2b3; font-size: 11px; font-weight: 500; }
.nav-item:hover { color: var(--ink); background: var(--soft-blue); }
.nav-item.active { color: var(--ink); background: transparent; border-left-color: var(--blue); }
.nav-item.active span { font-weight: 800; color: var(--ink); font-size: 13px; }
.nav-item.active b { color: var(--blue); font-weight: 600; }
.sidebar__character { display: flex; align-items: flex-end; padding: 12px 6px 0; margin-top: auto; pointer-events: none; }
.sidebar__character img { width: 82px; height: 104px; object-fit: contain; object-position: left bottom; }
.sidebar__footer { position: relative; margin-top: 8px; padding-top: 10px; background: var(--panel); border-top: 1px solid var(--line); }
.theme-toggle { width: 100%; min-height: 32px; display: flex; align-items: center; gap: 8px; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; background: transparent; cursor: pointer; font-size: 11px; color: var(--muted); }
.brand-links { display: none; }

.main-content { min-width: 0; max-width: 1560px; padding: 28px 34px 50px; overflow-x: hidden; }
.view-panel { display: none; }
.view-panel.active { display: block; animation: enter .24s ease both; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.view__header { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-bottom: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.view__title { margin: 3px 0 0; font-size: 25px; line-height: 1.15; }
.view__subtitle { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.section-kicker { color: var(--blue); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.header-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-heading h2 { margin: 3px 0 0; font-size: 18px; }

.btn { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 14px; border: 1px solid transparent; border-radius: 5px; font-weight: 750; font-size: 12px; cursor: pointer; text-decoration: none; }
.btn--primary { color: #fff; background: var(--blue); }
.btn--primary:hover { background: #1039b4; }
.btn--secondary { color: var(--ink); background: var(--panel); border-color: var(--line); }
.btn--secondary:hover { color: var(--blue); border-color: var(--blue); }
.btn--danger { color: #fff; background: var(--red); }
.btn--danger-text { color: var(--red); }
.btn--sm { min-height: 32px; padding: 0 9px; font-size: 10px; }
.btn--icon { min-height: 32px; padding: 0 8px; background: transparent; border-color: var(--line); }
.btn--block { width: 100%; }
.text-button { border: 0; background: none; color: var(--blue); font-size: 12px; font-weight: 750; cursor: pointer; }

.kpi-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.kpi-item { position: relative; min-width: 0; padding: 22px 20px 22px 0; }
.kpi-item + .kpi-item { padding-left: 20px; border-left: 1px solid var(--line); }
.kpi-item::after { content: ""; position: absolute; top: 22px; right: 14px; width: 8px; height: 8px; background: var(--kpi-color); }
.kpi-item span, .kpi-item small { display: block; color: var(--muted); font-size: 11px; }
.kpi-item strong { display: block; margin: 7px 0 6px; font-size: 28px; line-height: 1; }
.dashboard-main-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(285px, .72fr); gap: 30px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.dashboard-analysis { min-width: 0; }
.status-bars { display: grid; gap: 13px; }
.status-bar-row { display: grid; grid-template-columns: 110px 1fr 26px; gap: 12px; align-items: center; font-size: 12px; }
.status-track { height: 10px; background: var(--line); overflow: hidden; }
.status-track i { display: block; height: 100%; min-width: 0; animation: grow .5s ease both; }
@keyframes grow { from { transform: scaleX(0); transform-origin: left; } }
.priority-panel { min-height: 250px; display: flex; flex-direction: column; padding: 22px; color: #fff; background: #172033; border-top: 5px solid var(--yellow); }
.priority-panel .section-kicker { color: var(--yellow); }
.priority-panel h2 { margin: 7px 0 10px; font-size: 20px; }
.priority-panel p { margin: 0; color: #d0d5dd; font-size: 12px; line-height: 1.55; }
.priority-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: auto 0 17px; }
.priority-meta span { padding: 5px 7px; border: 1px solid #475467; font-size: 9px; }
.dashboard-lower-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.analysis-panel { min-width: 0; }
.chart-wrapper { min-height: 240px; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; }
.chart-wrapper--mix { align-items: stretch; justify-content: flex-start; }
.chart { width: 100%; max-height: 260px; overflow: visible; }
.chart__grid { stroke: var(--line); stroke-dasharray: 3 3; }
.chart__axis-label, .chart__center-label { fill: var(--muted); font-size: 11px; }
.chart__value, .chart__center-value { fill: var(--ink); font-size: 12px; font-weight: 700; }
.chart__center-value { font-size: 24px; font-weight: 800; }
.chart__legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 14px; margin-top: 14px; }
.chart__legend-item { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11.5px; }
.chart__legend-color { width: 10px; height: 10px; border-radius: 2px; }

/* ── Mix de contenus (Barres horizontales ultra-lisibles) ── */
.mix-container { width: 100%; display: flex; flex-direction: column; gap: 12px; padding: 4px 0; }
.mix-summary-header { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--muted); }
.mix-summary-caption strong { color: var(--ink); }
.mix-distribution-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--line); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .06); }
.mix-distribution-segment { height: 100%; transition: width .35s ease; position: relative; }
.mix-distribution-segment:hover { filter: brightness(1.15); }
.mix-items-list { display: flex; flex-direction: column; gap: 9px; }
.mix-row { display: grid; grid-template-columns: 145px 1fr 78px; align-items: center; gap: 12px; padding: 6px 8px; border-radius: 5px; transition: background .15s ease; }
.mix-row:hover { background: var(--surface); }
.mix-row--muted { opacity: .68; }
.mix-row__label { display: flex; align-items: center; gap: 7px; min-width: 0; }
.mix-row__dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.mix-row__icon { font-size: 14px; line-height: 1; flex-shrink: 0; }
.mix-row__name { font-size: 12.5px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mix-row__track { height: 9px; background: var(--line); border-radius: 5px; overflow: hidden; position: relative; }
.mix-row__bar { height: 100%; border-radius: 5px; transition: width .4s ease; min-width: 0; }
.mix-row__meta { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.mix-row__val { font-size: 13px; font-weight: 800; color: var(--ink); }
.mix-row__pct { font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--surface); color: var(--muted); border: 1px solid var(--line); }
.mix-zero-section { margin-top: 4px; padding-top: 10px; border-top: 1px dashed var(--line); }
.mix-zero-summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.mix-zero-badge { font-weight: 750; padding: 2px 7px; border-radius: 4px; background: var(--surface); border: 1px solid var(--line); font-size: 10px; color: var(--muted); }
.mix-zero-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 140px; }
.mix-toggle-btn { background: transparent; border: 1px solid var(--line); border-radius: 4px; padding: 2px 8px; font-size: 10.5px; font-weight: 750; color: var(--blue); cursor: pointer; transition: all .15s ease; }
.mix-toggle-btn:hover { background: var(--soft-blue); border-color: var(--blue); }
.mix-zero-details { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.chart-empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; text-align: center; color: var(--muted); }

.week-overview { padding: 28px 0; }
.week-lines { border-top: 1px solid var(--ink); }
.week-line { width: 100%; display: grid; grid-template-columns: 85px minmax(220px, 1.4fr) minmax(150px, .8fr) 100px 105px 24px; gap: 14px; align-items: center; padding: 14px 10px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; border-radius: 4px; font-size: 12.5px; }
.week-line:hover { background: var(--panel); }
.week-line__date strong, .week-line__date small, .week-line__main strong, .week-line__main small { display: block; }
.week-line small, .week-line__level { color: var(--muted); font-size: 11px; }
.week-line__main strong { font-size: 13.5px; font-weight: 750; }
.week-line__arrow { color: var(--blue); font-size: 20px; }

.badge, .control-badge { display: inline-flex; width: fit-content; min-height: 24px; align-items: center; padding: 0 8px; border-radius: 4px; font-size: 10.5px; font-style: normal; font-weight: 800; white-space: nowrap; }
.badge--planifie { color: #475467; background: #eef2f7; }
.badge--brouillon { color: #8a6500; background: var(--soft-yellow); }
.badge--en-production { color: var(--blue); background: var(--soft-blue); }
.badge--pret { color: #08735c; background: #e9f8f4; }
.badge--publie, .control--conforme { color: var(--green); background: var(--soft-green); }
.badge--suspendu, .control--alerte { color: var(--red); background: var(--soft-red); }
.control--pret { color: #8a6500; background: var(--soft-yellow); }

.planning { padding: 20px; background: var(--panel); border-top: 3px solid var(--blue); }
.planning__nav { display: grid; grid-template-columns: 38px 1fr 38px auto; align-items: center; gap: 8px; margin-bottom: 20px; }
.planning__nav h2 { margin: 0; text-align: center; font-size: 18px; }
.planning__weekdays, .planning__days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.planning__weekdays { color: var(--muted); font-size: 10px; font-weight: 750; text-align: center; }
.planning__weekdays div { padding: 8px; }
.planning__days { gap: 3px; }
.planning__day { min-width: 0; min-height: 104px; display: flex; flex-direction: column; padding: 7px; border: 1px solid var(--line); border-radius: 3px; background: var(--panel); text-align: left; cursor: pointer; }
.planning__day:hover { border-color: var(--blue); }
.planning__day--empty { border-color: transparent; background: transparent; cursor: default; }
.planning__day--today { border: 2px solid var(--blue); }
.planning__day-number { font-size: 11px; font-weight: 800; }
.planning__day-items { display: grid; gap: 3px; margin-top: 7px; }
.planning__day-items span { overflow: hidden; padding: 3px 4px; border-left: 3px solid var(--item-color); background: var(--surface); font-size: 8px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.planning__detail { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.planning__detail h3 { font-size: 14px; }
.planning__legend { display: flex; flex-wrap: wrap; gap: 15px; margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
.planning__legend span { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; }
.planning__legend i { width: 8px; height: 8px; }
.day-content-list { display: grid; gap: 5px; }
.day-content-list button { display: grid; grid-template-columns: 6px 1fr auto; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); background: var(--surface); text-align: left; cursor: pointer; }
.day-content-list button > span { width: 6px; height: 34px; background: var(--item-color); }
.day-content-list strong, .day-content-list small { display: block; }
.day-content-list small { color: var(--muted); font-size: 9px; }

.contents-toolbar { display: grid; grid-template-columns: minmax(260px, 1fr) repeat(3, minmax(145px, auto)); gap: 8px; margin-bottom: 16px; }
.search-input, .select-input, .form-control { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); background: var(--panel); }
.table-responsive { overflow-x: auto; background: var(--panel); border-top: 3px solid var(--blue); border-radius: 4px; box-shadow: 0 1px 3px rgba(23, 32, 51, .04); }
.data-table { width: 100%; min-width: 880px; border-collapse: collapse; text-align: left; font-size: 12.5px; }
.data-table th { padding: 13px 14px; color: var(--muted); background: var(--surface); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; }
.data-table td { padding: 14px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr { transition: background .12s ease; }
.data-table tbody tr:hover { background: var(--surface); }
.data-table td strong { font-size: 13.5px; font-weight: 750; color: var(--ink); }
.data-table td small { max-width: 360px; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.actions-column { text-align: right; white-space: nowrap; }
.summary-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 26px; border: 1px solid var(--line); background: var(--line); gap: 1px; }
.summary-strip article { padding: 18px; background: var(--panel); }
.summary-strip span { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.summary-strip strong { display: block; margin-top: 5px; font-size: 24px; font-weight: 800; color: var(--ink); }
.progress-track { min-width: 140px; height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.progress-track i { display: block; height: 100%; background: var(--blue); border-radius: 4px; }

.quality-list { overflow-x: auto; border-top: 3px solid var(--blue); background: var(--panel); border-radius: 4px; }
.quality-head, .quality-row { min-width: 980px; display: grid; grid-template-columns: minmax(260px, 1.6fr) repeat(4, 95px) 110px 100px 75px; gap: 10px; align-items: center; padding: 13px 14px; }
.quality-head { color: var(--muted); background: var(--surface); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; }
.quality-row { border-top: 1px solid var(--line); font-size: 12.5px; transition: background .12s ease; }
.quality-row:hover { background: var(--surface); }
.quality-row > span:first-child strong { font-size: 13.5px; font-weight: 750; color: var(--ink); }
.quality-row > span:first-child small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.quality-mark { font-size: 14px; font-weight: 800; }
.quality-mark--yes { color: var(--green); }
.quality-mark--no { color: var(--red); }
.quality-mark small { display: none; }
.data-tools { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 28px; padding: 22px; background: var(--panel); border-top: 3px solid var(--yellow); }
.data-tools h2 { margin: 3px 0 5px; font-size: 17px; }
.data-tools p { margin: 0; color: var(--muted); font-size: 11px; }
.data-tools__actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }

.connection-pill { min-height: 28px; display: inline-flex; align-items: center; padding: 0 9px; border: 1px solid var(--line); font-size: 10px; font-weight: 800; }
.connection-pill--ok { color: var(--green); background: var(--soft-green); }
.connection-pill--off { color: var(--red); background: var(--soft-red); }
.agent-layout { display: grid; grid-template-columns: minmax(320px, .85fr) minmax(0, 1.15fr); gap: 24px; }
.agent-brief, .agent-output { padding: 22px; background: var(--panel); border-top: 3px solid var(--blue); }
.agent-brief h2, .agent-output h2, .sync-panel h2, .integration-panel h2 { margin: 3px 0 16px; font-size: 18px; }
.agent-output { border-top-color: var(--magenta); }
.agent-output__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.agent-output__head > div:last-child { display: flex; gap: 6px; flex-wrap: wrap; }
.agent-result { min-height: 430px; padding-top: 14px; color: var(--muted); }
.agent-result pre { margin: 0; color: var(--ink); font-family: var(--font); font-size: 12px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }

/* Sélecteur des deux agents éditoriaux */
.agents-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.agent-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--panel); border: 2px solid var(--line); border-radius: 6px; cursor: pointer; text-align: left; transition: all .18s ease; }
.agent-card:hover { border-color: var(--cyan); transform: translateY(-1px); }
.agent-card.active { border-color: var(--blue); background: var(--soft-blue); box-shadow: 0 4px 14px rgba(23, 70, 209, .08); }
.agent-card.agent-card--junior.active { border-color: var(--magenta); background: #fdf2f7; }
.agent-card__avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: contain; background: #ffffff; padding: 3px; border: 1px solid var(--line); flex-shrink: 0; }
.agent-card__info strong { display: block; font-size: 14px; color: var(--ink); line-height: 1.25; }
.agent-card__info small { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); line-height: 1.3; }

/* Onglets du studio de génération */
.agent-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; padding-bottom: 4px; }
.agent-tab-btn { padding: 8px 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; font-size: 11px; font-weight: 700; color: var(--muted); cursor: pointer; white-space: nowrap; }
.agent-tab-btn:hover { color: var(--ink); }
.agent-tab-btn.active { color: var(--blue); border-bottom-color: var(--blue); }

/* Cartes storyboard minuté */
.storyboard-timeline { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.storyboard-card { padding: 14px 16px; background: var(--surface); border-left: 4px solid var(--yellow); border-radius: 4px; font-size: 11px; line-height: 1.6; }
.storyboard-card__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-weight: 800; color: var(--ink); }
.storyboard-card__badge { background: var(--yellow); color: #4c3b0a; padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.storyboard-field { margin-bottom: 4px; }
.storyboard-field strong { color: var(--ink); margin-right: 4px; }

/* Boîte de révision rapide */
.revision-panel { margin-top: 14px; padding: 12px; background: var(--surface); border: 1px dashed var(--line); border-radius: 4px; }
.revision-panel textarea { width: 100%; box-sizing: border-box; }

/* Historique des générations */
.history-strip { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); }
.history-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; background: var(--surface); border-radius: 4px; margin-bottom: 6px; font-size: 11px; cursor: pointer; }
.history-item:hover { background: var(--soft-blue); }

/* Barre de configuration du moteur IA */
.ai-engine-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; margin-bottom: 18px; font-size: 11.5px; flex-wrap: wrap; }
.ai-engine-bar__info { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-engine-bar__badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 4px; background: var(--soft-blue); color: var(--blue); font-weight: 700; font-size: 10.5px; }
.format-tip { margin-top: 6px; padding: 6px 10px; background: #f0fdf4; border-left: 3px solid var(--green); border-radius: 3px; font-size: 10.5px; color: #166534; line-height: 1.4; }
.format-tip--reel { background: #fdf4ff; border-left-color: var(--magenta); color: #86198f; }
.format-tip--carrousel { background: #eff6ff; border-left-color: var(--blue); color: #1e40af; }

.insight-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(270px, .6fr); gap: 28px; }
.sync-panel, .integration-panel { padding: 22px; background: var(--panel); border-top: 3px solid var(--cyan); }
.sync-panel p, .integration-panel p, .sync-panel > small, .form-help { color: var(--muted); font-size: 10px; }
.sync-panel > small { display: block; margin-top: 10px; }
.integration-panel { border-top-color: var(--yellow); }
.integration-status { display: grid; margin: 16px 0; border-top: 1px solid var(--line); }
.integration-status div { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.status-ok { color: var(--green); }
.status-muted { color: var(--muted); }
.ads-section { margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--line); }
.empty-inline { padding: 26px; color: var(--muted); background: var(--panel); font-size: 11px; text-align: center; }

.modal-overlay { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(23, 32, 51, .62); backdrop-filter: blur(3px); }
.modal { width: min(900px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; overflow: hidden; background: var(--panel); box-shadow: var(--shadow); }
.modal__header, .modal__footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal__footer { justify-content: flex-end; border-top: 1px solid var(--line); border-bottom: 0; }
.modal__title { margin: 2px 0 0; font-size: 19px; }
.modal__close { width: 34px; height: 34px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 21px; cursor: pointer; }
.modal__body { padding: 20px; overflow-y: auto; }
.form-section + .form-section { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.form-section h3 { margin: 0 0 14px; font-size: 13px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-row--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-row--four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-group { margin-bottom: 12px; }
.form-group label, .check-item { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; font-weight: 750; }
.form-control { min-height: 38px; font-size: 11px; }
textarea.form-control { resize: vertical; }
.check-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
.check-item { display: flex; align-items: center; gap: 8px; min-height: 38px; margin: 0; padding: 8px; border: 1px solid var(--line); }
.check-item input { width: 16px; height: 16px; }
.toast-container { position: fixed; right: 20px; bottom: 20px; z-index: 1200; display: grid; gap: 7px; }
.toast { min-width: 300px; max-width: min(460px, calc(100vw - 28px)); display: grid; grid-template-columns: 30px 1fr 24px; gap: 10px; align-items: start; padding: 13px 14px; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--blue); border-radius: 9px; box-shadow: 0 14px 34px rgba(18, 34, 66, .16); font-size: 11px; opacity: 0; transform: translateY(10px); transition: .2s ease; }
.toast--visible { opacity: 1; transform: none; }
.toast--success { border-left-color: var(--green); background: linear-gradient(180deg, #f3fff9 0%, var(--panel) 100%); }
.toast--error { border-left-color: var(--red); background: linear-gradient(180deg, #fff6f6 0%, var(--panel) 100%); }
.toast--info { border-left-color: var(--blue); }
.toast--warning { border-left-color: #d97706; }
.toast__icon { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--surface); font-size: 14px; font-weight: 900; }
.toast--success .toast__icon { background: #dcfce7; color: #047857; }
.toast--error .toast__icon { background: #fee2e2; color: #b91c1c; }
.toast__content { display: grid; gap: 3px; line-height: 1.45; }
.toast__title { font-size: 11px; color: var(--ink); }
.toast__message { color: var(--muted); }
.toast__close { width: 22px; height: 22px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; }
.empty-copy { color: var(--muted); font-size: 11px; }
.empty-state { display: flex; align-items: center; justify-content: center; gap: 15px; min-height: 130px; padding: 20px; color: var(--muted); text-align: left; }
.empty-state img { width: 72px; height: 92px; object-fit: contain; }
.empty-state p { margin: 4px 0 8px; font-size: 11px; }
.mobile-nav { display: none; }

@media (max-width: 1100px) {
  :root { --sidebar: 215px; }
  .main-content { padding-inline: 24px; }
  .kpi-strip { grid-template-columns: repeat(3, 1fr); }
  .kpi-item:nth-child(4) { padding-left: 0; border-left: 0; }
  .dashboard-main-grid { grid-template-columns: 1fr; }
  .priority-panel { min-height: 210px; }
  .contents-toolbar { grid-template-columns: 1fr 1fr; }
  .week-line { grid-template-columns: 76px 1fr 110px 24px; }
  .week-line__level, .week-line > span:nth-child(4) { display: none; }
}

@media (max-width: 720px) {
  .app-layout { display: block; }
  .sidebar { display: none; }
  .main-content { padding: 18px 14px 84px; }
  .view__header { align-items: flex-start; flex-direction: column; min-height: 0; }
  .header-actions { width: 100%; justify-content: flex-start; }
  .kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .kpi-item { padding: 17px 12px 17px 0; }
  .kpi-item + .kpi-item { padding-left: 12px; }
  .kpi-item:nth-child(3), .kpi-item:nth-child(5) { padding-left: 0; border-left: 0; }
  .kpi-item strong { font-size: 23px; }
  .dashboard-lower-grid { grid-template-columns: 1fr; }
  .agent-layout, .insight-grid { grid-template-columns: 1fr; }
  .week-line { grid-template-columns: 66px 1fr 24px; }
  .week-line > .badge { display: none; }
  .contents-toolbar { grid-template-columns: 1fr; }
  .planning { padding: 10px; }
  .planning__day { min-height: 66px; padding: 4px; }
  .planning__day-items span { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%; background: var(--item-color); color: transparent; }
  .planning__nav { grid-template-columns: 34px 1fr 34px; }
  .planning__nav .btn--secondary { grid-column: 1 / -1; }
  .summary-strip { grid-template-columns: repeat(2, 1fr); }
  .data-tools { align-items: flex-start; flex-direction: column; }
  .data-tools__actions { justify-content: flex-start; }
  .form-row, .form-row--three, .form-row--four { grid-template-columns: 1fr; }
  .check-grid { grid-template-columns: 1fr; }
  .mobile-nav { position: fixed; inset: auto 0 0 0; z-index: 100; height: 62px; display: flex; overflow-x: auto; background: var(--panel); border-top: 1px solid var(--line); }
  .mobile-nav__item { min-width: 74px; flex: 1; }
  .mobile-nav__item { border: 0; border-top: 3px solid transparent; background: transparent; color: var(--muted); font-size: 9px; cursor: pointer; }
  .mobile-nav__item.active { color: var(--blue); border-top-color: var(--blue); font-weight: 800; }
}

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

.connection-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--panel); color: var(--muted); border: 1px solid var(--line); }
.connection-pill--ok { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.connection-pill--pending { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.connection-pill--off { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.status-pending { color: #d97706; }

/* Grille des Objectifs Stratégiques KPI & ETA */
.kpi-goals-section { margin-bottom: 26px; }
.kpi-goals-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.kpi-goals-grid--dashboard { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .kpi-goals-grid--dashboard { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1024px) { .kpi-goals-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .kpi-goals-grid, .kpi-goals-grid--dashboard { grid-template-columns: 1fr; } }

.kpi-goal-card {
  display: flex; flex-direction: column;
  padding: 18px 20px; background: var(--panel);
  border: 1px solid var(--line); border-top: 4px solid var(--goal-color, var(--blue));
  border-radius: 6px; box-shadow: 0 2px 8px rgba(23, 32, 51, .04);
  transition: transform .18s ease, box-shadow .18s ease;
}
.kpi-goal-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(23, 32, 51, .08); }
.kpi-goal-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.kpi-goal-card__title { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 13px; color: var(--ink); }
.kpi-goal-card__title span.icon { font-size: 18px; }
.kpi-goal-card__body { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.kpi-goal-card__values strong { font-size: 24px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.kpi-goal-card__values span.target { font-size: 12px; color: var(--muted); margin-left: 4px; }
.kpi-goal-card__pct { font-size: 13px; font-weight: 800; padding: 2px 8px; border-radius: 999px; }
.kpi-goal-card__pct--green { background: #ecfdf5; color: #047857; }
.kpi-goal-card__pct--blue { background: #eff6ff; color: #1d4ed8; }
.kpi-goal-card__pct--yellow { background: #fffbeb; color: #b45309; }
.kpi-goal-card__pct--red { background: #fef2f2; color: #b91c1c; }

.progress-track--lg { height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; margin-bottom: 12px; }
.progress-track--lg i { display: block; height: 100%; border-radius: 5px; background: var(--goal-color, var(--blue)); transition: width .4s ease; }

.kpi-goal-card__footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; font-size: 10.5px; }
.kpi-goal-card__remaining { color: var(--muted); }

/* Badges Échéance (ETA) */
.eta-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 4px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.eta-badge--ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.eta-badge--urgent { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; animation: pulse-soft 2s infinite; }
.eta-badge--overdue { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.eta-badge--done { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.eta-badge--muted { background: var(--surface); color: var(--muted); border: 1px solid var(--line); }

@keyframes pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: .75; }
}

/* Modale de réglage des KPI et ETA */
.kpi-target-edit-row { display: grid; grid-template-columns: 32px 140px 1fr 1fr 130px; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.kpi-target-edit-row:last-child { border-bottom: 0; }
@media (max-width: 680px) {
  .kpi-target-edit-row { grid-template-columns: 1fr; gap: 6px; padding: 14px 0; }
}

/* ============================================================================
   CARTES POST PRÊT À PUBLIER & PROMPT IMAGE IA
   ============================================================================ */
.post-preview-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.post-preview-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 2px 8px rgba(23, 32, 51, 0.04);
}

.post-preview-card__head,
.image-prompt-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.post-preview-icon,
.image-prompt-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 18px;
  background: #eff6ff;
}

.image-prompt-icon {
  background: #fdf2f8;
}

.post-preview-title,
.image-prompt-title {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}

.post-preview-subtitle,
.image-prompt-subtitle {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--muted);
}

.post-caption-box {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink);
  white-space: pre-wrap;
  margin-bottom: 12px;
}

.post-preview-card__tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.post-tags-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.post-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.image-prompt-card {
  background: #fdf8fb;
  border: 1px solid #f5d0e6;
  border-left: 4px solid var(--magenta);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 2px 8px rgba(217, 27, 92, 0.04);
}

.image-prompt-box {
  background: #1e293b;
  color: #f8fafc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.65;
  padding: 14px 16px;
  border-radius: 6px;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid #334155;
}

.image-prompt-footer {
  margin-top: 10px;
}

.image-prompt-tips {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}

.calendar-posts-section {
  margin-top: 8px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.calendar-posts-header h3 {
  margin: 4px 0 12px;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}

.calendar-posts-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.calendar-post-item {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
}

.calendar-post-item__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--blue);
}

.calendar-post-item__body {
  white-space: pre-wrap;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ink);
  margin-bottom: 10px;
}

.calendar-post-item__prompt {
  background: #f8fafc;
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 11px;
}

.calendar-post-item__prompt code {
  display: block;
  white-space: pre-wrap;
  color: #334155;
  line-height: 1.5;
}

/* ── Login page ───────────────────────────────────────────────────── */
.login-page {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--surface, #f6f8fb);
}

[data-theme="dark"] .login-page {
  background: #0f1117;
}

/* ── Sidebar user badge ───────────────────────────────────────────── */
.sidebar__user-badge {
  padding: 4px 8px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar__user-badge:empty {
  display: none;
}

/* ── Export/import button row ──────────────────────────────────────── */
.action-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}


/* ── Meta Live professional social cards ─────────────────────────── */
.meta-live-panel {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(23, 32, 51, 0.05);
}

.meta-live-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 18px;
}

.meta-live-panel__header h2 {
  margin: 3px 0 4px;
  font-size: 19px;
}

.meta-live-panel__header p {
  margin: 0;
  max-width: 680px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.meta-live-panel__sync {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 290px;
}

.meta-live-panel__sync small {
  color: var(--muted);
  font-size: 11px;
}

.meta-live-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid #b7e4c7;
  border-radius: 999px;
  background: #f0fbf4;
  color: #157347;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.meta-live-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22a06b;
  box-shadow: 0 0 0 3px rgba(34, 160, 107, 0.12);
}

.social-platform-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.social-platform-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff 0%, #fbfcfe 100%);
}

.social-platform-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
}

.social-platform-card--instagram::before {
  background: linear-gradient(90deg, #feda75 0%, #d62976 48%, #4f5bd5 100%);
}

.social-platform-card--facebook::before {
  background: #1877f2;
}

.social-platform-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 14px;
}

.social-platform-card__identity {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.social-platform-card__identity > div:last-child {
  min-width: 0;
}

.social-platform-card__avatar-wrap {
  position: relative;
  flex: 0 0 auto;
}

.social-platform-card__avatar {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--surface);
}

.social-platform-card__avatar--placeholder {
  display: block;
  background: linear-gradient(135deg, var(--surface), #e9eef5);
}

.social-platform-card__brand {
  position: absolute;
  right: -5px;
  bottom: -4px;
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border: 2px solid #fff;
  border-radius: 7px;
  box-shadow: 0 3px 8px rgba(23, 32, 51, 0.16);
}

.social-platform-card__brand img {
  width: 13px;
  height: 13px;
  display: block;
}

.social-platform-card__brand--instagram {
  background: linear-gradient(135deg, #feda75, #d62976 55%, #4f5bd5);
}

.social-platform-card__brand--instagram img {
  filter: brightness(0) invert(1);
}

.social-platform-card__brand--facebook {
  background: #1877f2;
}

.social-platform-card__brand--facebook img {
  filter: brightness(0) invert(1);
}

.social-platform-card__eyebrow {
  display: block;
  margin-bottom: 2px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.social-platform-card__identity h3 {
  margin: 0;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
  color: var(--ink);
}

.social-platform-card__identity p {
  margin: 3px 0 0;
  max-width: 270px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
}

.social-platform-card__link {
  flex: 0 0 auto;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-size: 10px;
  font-weight: 800;
  text-decoration: none;
}

.social-platform-card__link:hover {
  border-color: #b9c4d4;
  background: var(--surface);
}

.social-metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.social-metric {
  min-width: 0;
  padding: 15px 14px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.social-metric:nth-child(3n) {
  border-right: none;
}

.social-metric:nth-last-child(-n + 3) {
  border-bottom: none;
}

.social-metric span {
  display: block;
  min-height: 28px;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
}

.social-metric strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 23px;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.social-metric small {
  display: block;
  min-height: 27px;
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.social-platform-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 45px;
  padding: 11px 16px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.35;
}

.social-platform-card__footer span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .social-platform-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .meta-live-panel {
    padding: 14px;
    border-radius: 14px;
  }

  .meta-live-panel__header {
    flex-direction: column;
  }

  .meta-live-panel__sync {
    justify-content: flex-start;
    min-width: 0;
  }

  .social-platform-card__head {
    align-items: flex-start;
  }

  .social-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .social-metric:nth-child(3n) {
    border-right: 1px solid var(--line);
  }

  .social-metric:nth-child(2n) {
    border-right: none;
  }

  .social-metric:nth-last-child(-n + 3) {
    border-bottom: 1px solid var(--line);
  }

  .social-metric:nth-last-child(-n + 2) {
    border-bottom: none;
  }
}


/* ── Audience visual analytics ───────────────────────────────────── */
.audience-empty {
  display: grid;
  place-items: center;
  min-height: 190px;
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: var(--surface);
  font-size: 11px;
  text-align: center;
}

.audience-chart-panel {
  min-height: 330px;
  overflow: hidden;
}

.audience-chart-panel .chart-wrapper {
  min-height: 245px;
}

.audience-gender-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.audience-gender-pill {
  position: relative;
  overflow: hidden;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.audience-gender-pill::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #94a3b8;
}

.audience-gender-pill--female::before { background: #d91b5c; }
.audience-gender-pill--male::before { background: #1746d1; }
.audience-gender-pill--unknown::before { background: #94a3b8; }

.audience-gender-pill span,
.audience-gender-pill small {
  display: block;
  color: var(--muted);
  font-size: 9.5px;
}

.audience-gender-pill strong {
  display: block;
  margin: 3px 0;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.audience-age-bars {
  display: grid;
  gap: 12px;
}

.audience-age-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.audience-age-row__label strong {
  display: block;
  color: var(--ink);
  font-size: 12px;
}

.audience-age-row__label small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.audience-stack {
  display: flex;
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf4;
  box-shadow: inset 0 0 0 1px rgba(23,32,51,.05);
}

.audience-stack i {
  display: block;
  min-width: 0;
  height: 100%;
}

.audience-stack__female { background: #d91b5c; }
.audience-stack__male { background: #1746d1; }
.audience-stack__unknown { background: #94a3b8; }

.audience-region-list {
  display: grid;
  gap: 10px;
}

.audience-region-card {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.audience-region-card__rank {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--soft-blue);
  color: var(--blue);
  font-size: 10px;
  font-weight: 900;
}

.audience-region-card__head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.audience-region-card__head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.audience-region-card__head b {
  color: var(--ink);
  font-size: 12px;
}

.audience-region-bar {
  height: 7px;
  overflow: hidden;
  margin: 6px 0 5px;
  border-radius: 999px;
  background: #e8edf4;
}

.audience-region-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1746d1, #31b9cc);
}

.audience-region-card__meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 8.5px;
}

@media (max-width: 720px) {
  .audience-gender-summary {
    grid-template-columns: 1fr;
  }

  .audience-age-row {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .audience-chart-panel {
    min-height: 280px;
  }
}


/* ── Audience / campagnes visuelles ─────────────────────────────── */
.campaign-performance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.campaign-performance-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--panel), var(--surface));
}

.campaign-performance-card__head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.campaign-performance-card__head > div {
  min-width: 0;
}

.campaign-performance-card__head span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.campaign-performance-card__head strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 12px;
}

.campaign-performance-card__head b {
  color: var(--blue);
  font-size: 16px;
  white-space: nowrap;
}

.campaign-performance-card__bar {
  height: 7px;
  margin: 11px 0 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf4;
}

.campaign-performance-card__bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1746d1, #31b9cc);
}

.campaign-performance-card__metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.campaign-performance-card__metrics div {
  min-width: 0;
}

.campaign-performance-card__metrics span {
  display: block;
  color: var(--muted);
  font-size: 8.5px;
}

.campaign-performance-card__metrics strong {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 12px;
}

.audience-details {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.audience-details summary {
  cursor: pointer;
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
  user-select: none;
}

.audience-details[open] summary {
  margin-bottom: 12px;
}

.audience-empty {
  min-height: 120px;
  display: grid;
  place-items: center;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: var(--surface);
  font-size: 11px;
  text-align: center;
}

@media (max-width: 900px) {
  .campaign-performance-grid {
    grid-template-columns: 1fr;
  }

  .campaign-performance-card__metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* ── Publication / programmation depuis la création de contenu ───── */
.publish-choice-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 16px;
  align-items: center;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid #bfd0ff;
  border-radius: 12px;
  background: linear-gradient(135deg, #f7faff, #eef4ff);
}

.publish-choice-panel strong {
  display: block;
  margin: 3px 0 2px;
  color: var(--ink);
  font-size: 13px;
}

.publish-choice-panel small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.publish-choice-panel__select {
  min-width: 0;
  font-weight: 750;
}

.bulk-create {
  display: grid;
  gap: 16px;
}

.bulk-create__defaults {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.bulk-create__toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.bulk-create__toolbar strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 13px;
}

.bulk-post-list {
  display: grid;
  gap: 12px;
  max-height: 58vh;
  overflow-y: auto;
  padding-right: 4px;
}

.bulk-post-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 34px;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.bulk-post-row__number {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--soft-blue);
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
}

.bulk-post-row__fields {
  min-width: 0;
}

/* ── Classement des meilleurs contenus ───────────────────────────── */
.top-content-rank-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.top-content-rank-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.top-content-rank-item__rank {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--surface);
  color: var(--blue);
  font-size: 10px;
  font-weight: 900;
}

.top-content-rank-item__body {
  min-width: 0;
}

.top-content-rank-item__body strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 10.5px;
}

.top-content-rank-item__body small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 8.5px;
}

.top-content-rank-item > a {
  color: var(--blue);
  font-size: 9px;
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 720px) {
  .publish-choice-panel,
  .bulk-create__defaults {
    grid-template-columns: 1fr;
  }

  .bulk-create__toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .bulk-post-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .bulk-post-row > [data-remove-bulk] {
    grid-column: 2;
    justify-self: end;
  }

  .top-content-rank-item {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .top-content-rank-item > a {
    grid-column: 2;
  }
}


/* ── Upload média pour publication Meta ─────────────────────────── */
.media-upload-box {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px dashed #aab7c8;
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfcfe, #f6f8fb);
}

.media-upload-box__status {
  color: var(--muted);
  font-size: 10px;
}

.media-upload-box__url {
  font-size: 10px;
  color: var(--muted);
  background: #fff;
}

.media-upload-preview {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 0;
}

.media-upload-preview:empty {
  display: none;
}

.media-upload-preview img,
.media-upload-preview video {
  display: block;
  max-width: 220px;
  max-height: 180px;
  border-radius: 10px;
  border: 1px solid var(--line);
  object-fit: cover;
  background: #fff;
}

.bulk-post-row input[type="file"] {
  padding: 7px;
  font-size: 10px;
  background: #fff;
}

.bulk-post-row__number {
  text-transform: capitalize;
}

@media (max-width: 720px) {
  .media-upload-preview img,
  .media-upload-preview video {
    max-width: 100%;
  }
}


/* ── Performance : KPI Facebook séparés ─────────────────────────── */
.kpi-goals-section--facebook {
  padding: 18px;
  border: 1px solid #dbe7ff;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fbff, #f3f7ff);
}

.kpi-goals-grid--facebook {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.kpi-goal-card--facebook {
  border-top-color: #1877f2;
  background: #ffffff;
}

.kpi-goal-card--facebook .kpi-goal-card__title > .icon {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 5px;
  border-radius: 7px;
  background: #1877f2;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.kpi-live-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 5px;
  border-radius: 999px;
  background: #e9f2ff;
  color: #1264d6;
  font-size: 7.5px;
  font-weight: 900;
  letter-spacing: .05em;
  white-space: nowrap;
}

.kpi-goal-card__pct--muted {
  background: var(--surface);
  color: var(--muted);
}

.kpi-target-group-title {
  margin: 16px 0 2px;
  padding: 7px 10px;
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.kpi-target-group-title:first-of-type {
  margin-top: 6px;
}

.kpi-current-source {
  display: block;
  margin-top: 3px;
  color: #1877f2;
  font-size: 8.5px;
  font-weight: 800;
}

@media (max-width: 1350px) {
  .kpi-goals-grid--facebook {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .kpi-goals-grid--facebook {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .kpi-goals-grid--facebook {
    grid-template-columns: 1fr;
  }
}


/* ── Social composer simplifié (style Facebook / Instagram) ───────── */
.modal:has(.social-composer-form) {
  width: min(1180px, 100%);
}

.social-composer-form {
  display: grid;
  gap: 14px;
}

.social-composer {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, .65fr);
  gap: 18px;
  align-items: start;
}

.social-composer__main,
.composer-side-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.social-composer__main {
  padding: 18px;
}

.social-composer__identity {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-bottom: 14px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.social-composer__identity img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
}

.social-composer__identity strong,
.social-composer__identity small {
  display: block;
}

.social-composer__identity strong {
  font-size: 13px;
  color: var(--ink);
}

.social-composer__identity small {
  margin-top: 2px;
  font-size: 10px;
  color: var(--muted);
}

.social-composer__caption label {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.social-composer__caption textarea {
  min-height: 260px;
  padding: 14px;
  border: 0;
  border-radius: 10px;
  background: var(--surface);
  font-size: 14.5px;
  line-height: 1.65;
}

.composer-help {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 9.5px;
}

.social-composer__media {
  margin-top: 12px;
  border-style: solid;
  background: var(--surface);
}

.social-composer__media-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.social-composer__preview {
  justify-content: center;
}

.social-composer__preview img,
.social-composer__preview video {
  width: 100%;
  max-width: 540px;
  max-height: 420px;
  object-fit: contain;
}

.social-composer__sidebar {
  display: grid;
  gap: 12px;
  position: sticky;
  top: 0;
}

.composer-side-card {
  padding: 16px;
}

.composer-side-card > strong {
  display: block;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--ink);
}

.composer-action-note {
  padding: 14px;
  border-radius: 12px;
  background: #eef4ff;
  border: 1px solid #cddcff;
}

.composer-action-note strong,
.composer-action-note small {
  display: block;
}

.composer-action-note strong {
  color: var(--blue);
  font-size: 11.5px;
}

.composer-action-note small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.45;
}

.composer-details,
.agent-advanced {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  overflow: hidden;
}

.composer-details > summary,
.agent-advanced > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 15px;
  font-size: 11px;
  font-weight: 850;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.composer-details > summary::-webkit-details-marker,
.agent-advanced > summary::-webkit-details-marker {
  display: none;
}

.composer-details > summary span,
.agent-advanced > summary span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.composer-details[open] > summary,
.agent-advanced[open] > summary {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.composer-details__body,
.agent-advanced__body {
  padding: 14px 15px;
}

.composer-details__body h4 {
  margin: 8px 0 10px;
  font-size: 11px;
  color: var(--ink);
}

.composer-inline-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 5px;
}

.composer-checks {
  margin-top: 12px;
}

/* ── Agents IA : brief ultra simple ───────────────────────────────── */
.agent-layout {
  grid-template-columns: minmax(300px, .52fr) minmax(0, 1.48fr);
  gap: 22px;
}

.agent-brief--simple {
  padding: 18px;
  border-radius: 12px;
  position: sticky;
  top: 12px;
  align-self: start;
}

.agent-simple-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.agent-simple-head h2 {
  margin: 3px 0 4px;
  font-size: 18px;
}

.agent-simple-head p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.agent-topic-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.agent-topic-toolbar label {
  margin: 0;
  color: var(--ink);
  font-size: 11px;
}

.compact-select {
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 9.5px;
  font-weight: 800;
}

.agent-topic-input {
  min-height: 170px;
  padding: 13px;
  font-size: 13px;
  line-height: 1.55;
}

.agent-topic-group > small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
}

.agent-quick-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.agent-generate-btn {
  min-height: 46px;
  margin-top: 14px;
  border-radius: 10px;
  font-size: 12px;
}

.agent-output {
  min-width: 0;
  border-radius: 12px;
}

.post-caption-box {
  min-height: 240px;
  max-height: none;
  padding: 20px;
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.post-preview-card {
  padding: 20px;
  border-radius: 12px;
}

.image-prompt-card {
  border-radius: 12px;
}

@media (max-width: 1024px) {
  .social-composer,
  .agent-layout {
    grid-template-columns: 1fr;
  }

  .social-composer__sidebar,
  .agent-brief--simple {
    position: static;
  }
}

@media (max-width: 720px) {
  .social-composer__caption textarea {
    min-height: 210px;
  }

  .modal:has(.social-composer-form) {
    width: 100%;
  }
}


/* ── Professional strategy planner ─────────────────────────────── */
.pro-strategy-panel {
  margin: 0 0 22px;
  padding: 20px;
  border: 1px solid #cfe0ff;
  border-radius: 16px;
  background:
    radial-gradient(circle at top right, rgba(23,70,209,.09), transparent 32%),
    linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
  box-shadow: 0 8px 30px rgba(18, 49, 115, .06);
}

.pro-strategy-panel__copy {
  max-width: 820px;
}

.pro-strategy-panel__copy h2 {
  margin: 4px 0 7px;
  font-size: 20px;
  color: var(--ink);
}

.pro-strategy-panel__copy p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.pro-strategy-panel__controls {
  display: grid;
  grid-template-columns: 150px minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 17px;
}

.pro-strategy-panel__controls label {
  display: grid;
  gap: 5px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
}

.pro-strategy-panel__controls .btn {
  min-height: 42px;
  white-space: nowrap;
}

.pro-strategy-panel__features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
}

.pro-strategy-panel__features span {
  padding: 5px 8px;
  border: 1px solid #dce7fb;
  border-radius: 999px;
  background: #fff;
  color: #31558c;
  font-size: 9px;
  font-weight: 750;
}

@media (max-width: 900px) {
  .pro-strategy-panel__controls {
    grid-template-columns: 1fr 1fr;
  }

  .pro-strategy-panel__controls .btn {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .pro-strategy-panel {
    padding: 15px;
  }

  .pro-strategy-panel__controls {
    grid-template-columns: 1fr;
  }

  .pro-strategy-panel__controls .btn {
    grid-column: auto;
    width: 100%;
  }
}


/* ── Strategy analysis result ─────────────────────────────────── */
.strategy-analysis-view {
  display: grid;
  gap: 16px;
}

.strategy-analysis-hero,
.strategy-plan-output,
.strategy-social-card,
.strategy-audit-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.strategy-analysis-hero {
  padding: 18px;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.strategy-analysis-hero h3 {
  margin: 4px 0 6px;
  font-size: 18px;
}

.strategy-analysis-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.6;
}

.strategy-audit-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.strategy-audit-card {
  padding: 14px;
}

.strategy-audit-card small,
.strategy-audit-card span {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.strategy-audit-card strong {
  display: block;
  margin: 5px 0 3px;
  color: var(--ink);
  font-size: 20px;
}

.strategy-social-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.strategy-social-card {
  padding: 15px;
  font-size: 11px;
  line-height: 1.8;
}

.strategy-social-card > strong {
  display: block;
  margin-bottom: 4px;
  color: var(--blue);
  font-size: 12px;
}

.strategy-plan-output {
  overflow: hidden;
}

.strategy-plan-output__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
}

.strategy-plan-output__head h3 {
  margin: 3px 0 0;
  font-size: 15px;
}

.strategy-plan-output pre {
  margin: 0;
  padding: 18px;
  max-height: 720px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.7;
  background: var(--surface);
}

@media (max-width: 1100px) {
  .strategy-audit-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .strategy-audit-grid,
  .strategy-social-grid {
    grid-template-columns: 1fr 1fr;
  }

  .strategy-plan-output__head {
    align-items: flex-start;
    flex-direction: column;
  }
}


/* ── Professional daily strategy cards ───────────────────────── */
.strategy-social-card--ads {
  border-color: #f0d9ff;
  background: linear-gradient(180deg, #fffaff 0%, #ffffff 100%);
}

.strategy-calendar-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
}

.strategy-calendar-head h3 {
  margin: 4px 0 4px;
  color: var(--ink);
  font-size: 16px;
}

.strategy-calendar-head p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.strategy-calendar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.strategy-day-list {
  display: grid;
  gap: 14px;
}

.strategy-day-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 13px;
  background: var(--panel);
  box-shadow: 0 5px 18px rgba(29, 53, 87, .05);
}

.strategy-day-card__head {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: start;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.strategy-day-number {
  display: inline-flex;
  padding: 3px 7px;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--blue);
  font-size: 9px;
  font-weight: 900;
}

.strategy-day-card__head h3 {
  margin: 6px 0 5px;
  color: var(--ink);
  font-size: 15px;
}

.strategy-day-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.strategy-day-meta span {
  padding: 3px 6px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 750;
}

.strategy-day-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 13px 0;
}

.strategy-day-grid > div,
.strategy-content-block {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}

.strategy-day-grid small,
.strategy-content-block small {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 850;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.strategy-day-grid p {
  margin: 0;
  color: var(--ink);
  font-size: 10px;
  line-height: 1.5;
}

.strategy-content-block {
  margin-top: 9px;
}

.strategy-content-block > strong {
  display: block;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.55;
}

.strategy-caption,
.strategy-prompt {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.7;
}

.strategy-prompt {
  padding: 9px;
  border-radius: 7px;
  background: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9.5px;
}

.strategy-content-block--video {
  border-left: 3px solid var(--magenta);
}

.strategy-storyboard-mini {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.strategy-storyboard-mini > div {
  padding: 8px 9px;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 9.5px;
  line-height: 1.5;
}

.strategy-storyboard-mini span {
  color: var(--muted);
}

.strategy-day-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 11px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .strategy-calendar-head,
  .strategy-day-card__head {
    align-items: stretch;
    flex-direction: column;
  }

  .strategy-calendar-actions {
    justify-content: flex-start;
  }

  .strategy-day-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .strategy-day-grid {
    grid-template-columns: 1fr;
  }

  .strategy-day-footer {
    flex-direction: column;
  }

  .strategy-calendar-actions .btn {
    width: 100%;
  }
}


/* ── Editable AI workspace ────────────────────────────────────── */
.generated-edit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0 10px;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid #dce7fb;
  background: #f7faff;
  color: #31558c;
  font-size: 9.5px;
  font-weight: 750;
}

.generated-edit-status {
  white-space: nowrap;
  color: #0f8871;
  font-size: 8.5px;
}

.generated-title-field {
  margin-bottom: 10px;
}

.post-caption-box--editable,
.image-prompt-box--editable {
  width: 100%;
  resize: vertical;
  cursor: text;
}

.post-caption-box--editable {
  min-height: 280px;
}

.image-prompt-box--editable {
  min-height: 170px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  line-height: 1.65;
}

.generated-tags-edit {
  margin-top: 6px;
  font-size: 10.5px;
}

[data-plan-edit] {
  outline: none;
  cursor: text;
  transition: box-shadow .15s ease, background .15s ease;
}

[data-plan-edit]:hover {
  background: rgba(23, 70, 209, .035);
}

[data-plan-edit]:focus {
  border-radius: 5px;
  box-shadow: 0 0 0 2px rgba(23, 70, 209, .16);
  background: #fff;
}

[data-plan-edit].is-edited {
  box-shadow: inset 3px 0 0 #31b9cc;
}

.strategy-day-card__head h3[contenteditable="true"]::after {
  content: "  ✎";
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

@media (max-width: 640px) {
  .generated-edit-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .post-caption-box--editable {
    min-height: 230px;
  }
}


/* ── Agent task progress ──────────────────────────────────────── */
.agent-task-progress {
  margin: 0 0 18px;
  padding: 16px 18px;
  border: 1px solid #cfe0ff;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
  box-shadow: 0 6px 20px rgba(23, 70, 209, .06);
}

.agent-task-progress[hidden] {
  display: none !important;
}

.agent-task-progress__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.agent-task-progress__head strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 13px;
}

.agent-task-progress__head b {
  color: var(--blue);
  font-size: 13px;
}

.agent-task-progress__track {
  height: 9px;
  margin: 12px 0 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef8;
}

.agent-task-progress__track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #31b9cc);
  transition: width .45s ease;
  position: relative;
}

.agent-task-progress__track i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent);
  animation: agent-progress-shimmer 1.4s linear infinite;
}

.agent-task-progress p {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 700;
}

.agent-task-progress small {
  color: var(--muted);
  font-size: 9px;
}

.agent-task-progress[data-state="success"] {
  border-color: #a7f3d0;
  background: linear-gradient(180deg, #f1fff8 0%, #ffffff 100%);
}

.agent-task-progress[data-state="success"] .agent-task-progress__track i {
  background: var(--green);
}

.agent-task-progress[data-state="error"] {
  border-color: #fecaca;
  background: linear-gradient(180deg, #fff6f6 0%, #ffffff 100%);
}

.agent-task-progress[data-state="error"] .agent-task-progress__track i {
  background: var(--red);
}

.agent-form-actions {
  display: grid;
  grid-template-columns: minmax(170px, .75fr) minmax(220px, 1.25fr);
  gap: 9px;
}

@keyframes agent-progress-shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

@media (max-width: 640px) {
  .toast-container { right: 12px; left: 12px; bottom: 76px; }
  .toast { min-width: 0; width: 100%; max-width: none; }
  .agent-form-actions { grid-template-columns: 1fr; }
  .agent-task-progress__head { align-items: flex-start; }
}


/* ── AI provider connectivity diagnostics ─────────────────────── */
.ai-provider-test-result {
  margin: 0 18px 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.ai-provider-test-result--success {
  border-color: #a7f3d0;
  background: #f0fdf4;
  color: #047857;
  font-weight: 750;
}

.ai-provider-test-result--error {
  border-color: #fecaca;
  background: #fff7f7;
  color: #b91c1c;
  font-weight: 700;
}

/* Mobile: readable cards, reachable navigation and touch-friendly controls. */
@media (max-width: 720px) {
  .main-content { padding: 14px 14px calc(132px + env(safe-area-inset-bottom)); }
  .mobile-brand-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
  .mobile-brand-bar > span { font-size: 13px; font-weight: 750; }
  .mobile-brand-bar .brand-switch { width: auto; max-width: 58%; margin: 0; min-height: 44px; font-size: 16px; }
  .mobile-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); height: auto; overflow: visible; padding: 4px 8px calc(4px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 18px rgba(23,32,51,.08); }
  .mobile-nav__item { min-width: 0; min-height: 48px; font-size: 12px; border-radius: 6px; }
  .mobile-nav__item.active { background: var(--soft-blue); }
  .view__header { gap: 14px; }
  .view__title { font-size: 24px; }
  .view__subtitle { line-height: 1.5; overflow-wrap: anywhere; }
  .header-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .header-actions .btn { width: 100%; padding: 8px; white-space: normal; }
  .header-actions .btn--primary { grid-column: 1 / -1; }
  .btn, .btn--sm, .btn--icon, .text-button { min-height: 44px; font-size: 13px; }
  .form-control, .lead-status { min-height: 44px; font-size: 16px; max-width: 100%; }
  .section-heading { flex-wrap: wrap; align-items: flex-start; gap: 10px; }
  .section-heading > div { min-width: 0; }
  .section-heading h2 { font-size: 17px; overflow-wrap: anywhere; }
  .section-kicker { font-size: 11px; }
  .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; border: 0; }
  .kpi-item, .kpi-item + .kpi-item, .kpi-item:nth-child(3), .kpi-item:nth-child(5) { padding: 16px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
  .kpi-item::after { top: 12px; right: 10px; }
  .kpi-item span { padding-right: 10px; font-size: 12px; line-height: 1.4; }
  .kpi-item small { font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
  .kpi-item strong { font-size: 27px; }
  .dashboard-main-grid { gap: 18px; padding: 20px 0; }
  .social-platform-grid, .social-platform-card { min-width: 0; }
  .meta-live-panel { padding: 12px; }
  .social-platform-card__head { padding: 14px 12px; gap: 8px; flex-wrap: wrap; }
  .social-platform-card__identity { gap: 10px; max-width: 100%; }
  .social-platform-card__identity h3 { overflow-wrap: anywhere; white-space: normal; }
  .social-metric { padding: 12px 10px; }
  .social-metric span, .social-metric small { font-size: 12px; line-height: 1.4; min-height: 0; }
  .social-metric strong { font-size: 23px; white-space: normal; overflow-wrap: anywhere; }
  .social-platform-card__footer { flex-wrap: wrap; gap: 8px; font-size: 12px; }
  .meta-live-panel__sync { flex-wrap: wrap; }
  .data-tools { width: 100%; gap: 10px; }
  .data-tools label, .data-tools label:first-child { width: 100%; min-width: 0; }
  .data-tools > .btn { width: 100%; }
  .table-responsive { max-width: 100%; overflow-x: auto; }
  .workspace-tabs { gap: 8px; padding-bottom: 14px; margin-bottom: 18px; }
  .workspace-tabs .btn { flex: 1 1 140px; }
  .modal-overlay { padding: 8px; }
  .modal { max-height: calc(100dvh - 16px); border-radius: 12px; }
  .modal__header, .modal__body, .modal__footer { padding: 14px; }
  .modal__close { width: 44px; height: 44px; flex-shrink: 0; }
  .modal__footer { flex-wrap: wrap; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .modal__footer .btn { flex: 1 1 120px; }
  .toast-container { bottom: calc(124px + env(safe-area-inset-bottom)); }
  .lead-sheet__identity { flex-wrap: wrap; }
  .lead-sheet__origin dl > div { grid-template-columns: 1fr; gap: 4px; }
  #leads-table .data-table { min-width: 0; }
  #leads-table .data-table thead { display: none; }
  #leads-table .data-table, #leads-table .data-table tbody { display: block; }
  #leads-table .data-table tbody tr { display: block; margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
  #leads-table .data-table td { display: block; padding: 8px 0; border: 0; overflow-wrap: anywhere; }
  #leads-table .data-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 5px; font-size: 12px; color: var(--muted); }
  #leads-table .data-table td:first-child { text-align: right; }
  #leads-table .data-table input[type="checkbox"] { width: 24px; height: 24px; }
  #leads-table .lead-name, #leads-table .lead-contact { white-space: normal; overflow-wrap: anywhere; }
  #leads-table .lead-details { min-width: 0; max-width: 100%; }
  #leads-table .lead-details summary { min-height: 44px; display: flex; align-items: center; font-size: 13px; }
}

@media (max-width: 360px) {
  .main-content { padding-left: 10px; padding-right: 10px; }
  .social-metric-grid { grid-template-columns: 1fr; }
  .social-metric { border-right: 0 !important; border-bottom: 1px solid var(--line) !important; }
  .social-metric:last-child { border-bottom: 0 !important; }
  .header-actions { grid-template-columns: 1fr; }
}
