/* Design « Demo 6 » violet pastel. Toutes les couleurs passent par les variables ci-dessous. */

:root, [data-theme='violet'] {
  --bg: #F4F0FD;
  --surface: #FFFFFF;
  --ink: #1E1736;
  --ink-1: #2E2648;
  --ink-2: #655E7C;
  --line: #EAE4F6;
  --line-soft: #F1ECFA;
  --field: #DDD5EF;
  --ring: #A999D8;
  --flat-bg: #F4F0FD;
  --th-bg: #FAF8FE;
  --dash: #A39BBC;
  --brand: #8E73DB;
  --primary: #6D4FC2;
  --primary-hover: #5F43B2;
  --accent: #5F43B2;
  --accent-bg: #EFE9FC;
  --mono: #1E1736;
  --good: #008236; --good-bg: #F0FDF4; --good-line: #B9F8CF; --good-ink: #016630;
  --bad: #C10007;  --bad-bg: #FEF2F2;  --bad-line: #FFC9C9;  --bad-ink: #9F0712;
  --shadow-xs: 0 1px 2px rgba(45, 30, 100, 0.06);
  --font: 'Inter Variable', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --code: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
[data-theme='bleu'] {
  --bg: #F4F4F5; --ink: #09090B; --ink-1: #18181B; --ink-2: #71717B;
  --line: #ECECEF; --line-soft: #F4F4F5; --field: #E4E4E7; --ring: #9F9FA9;
  --flat-bg: #F4F4F5; --th-bg: #FBFBFB; --dash: #9F9FA9;
  --brand: #2B7FFF; --primary: #2B7FFF; --primary-hover: #4089FF; --accent: #155DFC; --accent-bg: #EFF6FF;
  --mono: #09090B; --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
}

@font-face { font-family: 'Inter Variable'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/fonts/inter/inter-latin-wght-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter Variable'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/fonts/inter/inter-latin-ext-wght-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 20px; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--ink); } a:hover { color: var(--accent); }
h1, h2, h3 { margin: 0; font-weight: 600; text-wrap: balance; }
h1 { font-size: 18px; line-height: 28px; font-weight: 500; }
h2 { font-size: 16px; line-height: 20px; letter-spacing: -0.025em; }
h3 { font-size: 14px; line-height: 20px; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.muted { color: var(--ink-2); } .small { font-size: 13px; } .num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { flex: none; display: block; }
[hidden] { display: none !important; }

/* Structure */
.shell { display: flex; min-height: 100vh; }
.main { flex: 1 1 0; min-width: 0; margin: 15px 15px 15px 0; padding: 28px 30px 30px; display: flex; flex-direction: column; gap: 30px; background: var(--surface); border: 1px solid var(--field); border-radius: 12px; }
.main:focus { outline: none; }
.main > * { flex: none; }

/* Menu */
.side { width: 270px; flex: none; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.side-head { flex: none; height: 70px; padding: 0 14px; display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; color: var(--ink); text-decoration: none; font-size: 16px; font-weight: 500; line-height: 24px; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--field); color: var(--primary); font-size: 17px; font-weight: 700; }
.icon-btn { flex: none; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; border-radius: 6px; color: var(--ink-1); cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--surface); color: var(--ink); }
.icon-btn .ico { width: 18px; height: 18px; }
.main .icon-btn:hover { background: var(--flat-bg); }
.icon-btn.danger:hover { background: var(--bad-bg); color: var(--bad); }
.side-close { display: none; }
.side-project { flex: none; margin: 0 14px 14px; height: 34px; padding: 0 12px; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--field); border-radius: 6px; box-shadow: var(--shadow-xs); color: var(--ink); text-decoration: none; font-size: 13px; }
.side-project .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.dot-initial { display: none; }
.side-project .name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-project .chev .ico { width: 14px; height: 14px; color: var(--ink-2); }
.side-switch { flex: none; position: relative; z-index: 40; margin: 0 14px 14px; }
.side-switch > .side-project { margin: 0; cursor: pointer; list-style: none; user-select: none; }
.side-switch > .side-project::-webkit-details-marker { display: none; }
.side-switch > .side-project:hover { border-color: var(--primary); }
.side-switch > .side-project:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.side-switch .chev .ico { transition: transform .15s; }
.side-switch[open] .chev .ico { transform: rotate(180deg); }
.switch-panel { position: absolute; top: calc(100% + 6px); left: 0; width: max(100%, 240px); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(20, 10, 60, 0.14); padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.switch-search { height: 34px; margin: 2px 2px 4px; padding: 0 10px; border: 1px solid var(--field); border-radius: 6px; font: inherit; font-size: 13px; background: var(--surface); color: var(--ink); }
.switch-list { display: flex; flex-direction: column; gap: 2px; max-height: min(50vh, 360px); overflow-y: auto; scrollbar-width: thin; }
.switch-list a { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 6px 8px; border-radius: 6px; color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 500; }
.switch-list a:hover, .switch-list a:focus-visible { background: var(--flat-bg); outline: none; }
.switch-list a[aria-current] { background: var(--accent-bg); color: var(--primary); }
.switch-list a .ico { width: 16px; height: 16px; margin-left: auto; flex: none; }
.switch-initial { flex: none; width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; background: var(--accent-bg); border: 1px solid var(--field); color: var(--primary); font-size: 12px; font-weight: 700; }
.switch-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switch-empty { margin: 0; padding: 8px; font-size: 13px; color: var(--ink-2); }
.switch-foot { display: flex; gap: 4px; border-top: 1px solid var(--line); padding-top: 6px; }
.switch-foot a { flex: 1 1 auto; display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 6px; color: var(--ink-1); text-decoration: none; font-size: 13px; font-weight: 500; }
.switch-foot a:hover { background: var(--flat-bg); color: var(--ink); }
.switch-foot a .ico { width: 15px; height: 15px; }
.side-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 20px 0; padding: 0 14px; display: flex; flex-direction: column; gap: 10px; scrollbar-width: thin; scrollbar-color: var(--field) transparent; }
.side-nav { display: flex; flex-direction: column; gap: 6px; }
.side-nav + .side-nav { border-top: 1px solid var(--field); padding-top: 14px; margin-top: 4px; }
.side-nav a { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 8px 10px; border: 1px solid transparent; border-radius: 6px; color: var(--ink); text-decoration: none; font-weight: 500; }
.side-nav a .ico { width: 18px; height: 18px; color: var(--ink-1); }
.side-nav a:hover, .side-nav a[aria-current='page'] { background: var(--surface); border-color: var(--line); }
.side-nav a[aria-current='page'] .ico { color: var(--primary); }
.side-foot { flex: none; margin-bottom: 14px; padding: 0 14px 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; }
.side-foot form { display: flex; }
.side-user { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--ink); text-decoration: none; }
.avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--field); font-size: 12px; font-weight: 600; color: var(--ink-1); }
.who { display: flex; flex-direction: column; gap: 4px; min-width: 0; line-height: 1; }
.who-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-role { font-size: 12px; color: var(--ink-2); }
.side-backdrop, .topbar { display: none; }

@media (min-width: 861px) {
  .shell { height: 100vh; min-height: 0; overflow: hidden; }
  .main { height: calc(100vh - 30px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--field) transparent; }
  .side-collapsed .side { width: 70px; }
  .side-collapsed .side .label { display: none; }
  .side-collapsed .side-head { height: auto; padding: 14px 0 10px; flex-direction: column; gap: 8px; }
  .side-collapsed .brand { flex: none; }
  .side-collapsed .side-switch { margin: 0 18px 14px; }
  .side-collapsed .side-switch .dot { width: 24px; height: 24px; border-radius: 6px; background: var(--accent-bg); display: grid; place-items: center; }
  .side-collapsed .dot-initial { display: block; color: var(--primary); font-size: 12px; font-weight: 700; line-height: 1; }
  .side-collapsed .switch-panel { left: 0; width: 260px; }
  .side-collapsed .side-project { padding: 0; justify-content: center; }
  .side-collapsed .side-scroll { padding: 0 16px; }
  .side-collapsed .side-nav a { justify-content: center; padding: 8px 0; }
  .side-collapsed .side-foot { flex-direction: column; padding: 0; gap: 6px; }
}
@media (max-width: 860px) {
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: 0; z-index: 30; height: 60px; padding: 0 16px 0 24px; background: var(--bg); }
  .topbar .logo { width: 34px; height: 34px; font-size: 14px; }
  .shell { min-height: 0; }
  .main { margin: 0 15px 15px; padding: 20px 24px 24px; gap: 20px; min-height: calc(100vh - 75px); }
  .side { position: fixed; top: 0; bottom: 0; left: 0; z-index: 50; width: min(280px, 86vw); height: auto; box-shadow: 0 0 40px rgba(20, 10, 60, 0.18); transform: translateX(-100%); visibility: hidden; transition: transform 0.2s ease, visibility 0s linear 0.2s; }
  .side-open .side { transform: none; visibility: visible; transition: transform 0.2s ease, visibility 0s; }
  .side-collapse { display: none; }
  .side-close { display: inline-flex; }
  .side-open .side-backdrop { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(20, 14, 40, 0.3); }
  .btn { height: 40px; padding: 0 14px; }
  .field input, .field select, .field .ui-select-btn { height: 40px; }
  .field input, .field select, .field textarea { font-size: 16px; }
  .icon-btn { width: 40px; height: 40px; }
  .side-nav a { min-height: 42px; }
  .kpis, .split, .grid-2 { gap: 20px; }
}
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }

/* Barre de titre et grilles */
.page-head { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; justify-content: space-between; min-height: 34px; }
.page-head > div:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.crumb { color: var(--ink-2); font-size: 13px; font-weight: 500; text-decoration: none; }
.actions-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.actions-row form { display: flex; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.between { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; }
.split { display: flex; flex-wrap: wrap; gap: 30px; align-items: flex-start; }
.split > .wide { flex: 3 1 420px; min-width: 0; } .split > .narrow { flex: 2 1 320px; min-width: 0; }
.split > .wide, .split > .narrow { display: flex; flex-direction: column; gap: 30px; }
@media (max-width: 860px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .split > .wide, .split > .narrow { gap: 20px; }
}

/* Cartes et chiffres clés */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-xs); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.card > h2:first-child, .card > .between:first-child { margin: -20px -20px 6px; padding: 10px 20px; min-height: 56px; border-bottom: 1px solid var(--line); }
.card > h2:first-child { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.card.flush { padding: 0; overflow-x: auto; position: relative; }
.card.flush > h2:first-child, .card.flush > .between:first-child { margin: 0; }
.card.flush { gap: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 30px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-xs); padding: 20px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kpi .label { color: var(--ink-1); }
.kpi .value { font-size: 30px; line-height: 36px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi .value small { font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--ink-2); }
.tone-good { color: var(--good); font-weight: 500; } .tone-bad { color: var(--bad); font-weight: 500; }
.empty { border: 1px dashed var(--field); border-radius: 12px; padding: 30px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid var(--field); border-radius: 6px; background: var(--surface); color: var(--ink-1); box-shadow: var(--shadow-xs); font: inherit; font-size: 13px; line-height: 1; font-weight: 500; text-decoration: none; white-space: nowrap; cursor: pointer; }
.btn:hover { background: var(--flat-bg); color: var(--ink); }
.btn:focus-visible, .field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 30%, transparent); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-quiet { background: transparent; border-color: transparent; box-shadow: none; }
.btn-quiet:hover { background: var(--flat-bg); }
.btn-danger { border-color: var(--bad-line); color: var(--bad); }
.btn-danger:hover { background: var(--bad-bg); color: var(--bad); }
.btn .ico { width: 16px; height: 16px; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* Champs */
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; font-weight: 500; }
.field input, .field select, .field textarea { width: 100%; height: 34px; padding: 0 12px; border: 1px solid var(--field); border-radius: 6px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); font: inherit; font-size: 13px; font-weight: 400; }
.field input[type='file'] { padding: 4px 6px; }
.field input[type='file']::file-selector-button { height: 24px; margin-right: 10px; padding: 0 8px; border: 1px solid var(--field); border-radius: 4px; background: var(--flat-bg); color: var(--ink-1); font: inherit; font-size: 12px; font-weight: 500; cursor: pointer; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--ring); }
.field select { appearance: none; padding-right: 30px; background-repeat: no-repeat; background-position: right 10px center; background-size: 14px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371717B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
.field textarea { height: auto; padding: 8px 12px; resize: vertical; line-height: 1.5; }
.field .hint { font-size: 12px; line-height: 16px; font-weight: 400; color: var(--ink-2); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.check input { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.form-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.form-row > .field { flex: 1 1 150px; }
.form-row.top { align-items: flex-start; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.form-grid .full { grid-column: 1 / -1; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
legend { padding: 0; margin-bottom: 8px; font-weight: 500; }
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 20px; }
.check-list .check { min-height: 28px; justify-content: flex-start; }
.check-list .count { margin-left: auto; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.inline { display: inline-flex; }

/* Messages et étiquettes */
.flash { border: 1px solid; border-radius: 8px; padding: 10px 14px; font-size: 13px; font-weight: 500; }
.flash-success { background: var(--good-bg); border-color: var(--good-line); color: var(--good-ink); }
.flash-error { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad-ink); }
.flashes { display: flex; flex-direction: column; gap: 10px; }
.note { background: var(--flat-bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; color: var(--ink-2); font-size: 13px; }
.note strong { color: var(--ink-1); font-weight: 500; }
.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 6px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; line-height: 1; font-weight: 500; white-space: nowrap; }
.pill-success { background: var(--good-bg); border-color: var(--good-line); color: var(--good); }
.pill-failure { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad); }
.pill-neutral { background: var(--flat-bg); color: var(--ink-1); }
.pill-pending { border-style: dashed; border-color: var(--dash); color: var(--ink-2); }
.pill-live { background: var(--accent-bg); border-color: var(--field); color: var(--primary); }
.pills { display: flex; flex-wrap: wrap; gap: 4px; }

/* Tableaux */
.table { width: 100%; border-collapse: collapse; text-align: left; }
.table th { height: 40px; padding: 0 16px; background: var(--th-bg); color: var(--ink-1); font-weight: 400; white-space: nowrap; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th + th, .table td + td { border-left: 1px solid var(--line); }
.table tr:last-child td { border-bottom: 0; }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table th, .table td { position: relative; } /* garde les libellés masqués (.sr-only) dans la zone qui défile */
.table .title { font-weight: 500; text-decoration: none; }
.table .sub { color: var(--ink-2); font-size: 13px; }
.table .right { text-align: right; }
.table td.num.right { white-space: nowrap; }
.table td.tools { padding-top: 5px; padding-bottom: 5px; white-space: nowrap; width: 1%; vertical-align: middle; }
.table td.tools > div { display: flex; gap: 2px; justify-content: flex-end; }
.table td.tools form { display: flex; }
.table td.wrap { overflow-wrap: anywhere; }
.table td.fit { width: 1%; white-space: nowrap; }
.table td.col-progress { min-width: 200px; vertical-align: middle; }
.card.flush > .table-foot { padding: 12px 20px; border-top: 1px solid var(--line); }
.card.flush > .pad { padding: 20px; display: flex; flex-direction: column; gap: 10px; }

/* Pagination */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.pager .links { display: flex; gap: 6px; }

/* Barre de progression */
.progress { height: 8px; border-radius: 4px; background: var(--flat-bg); border: 1px solid var(--line); overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: var(--primary); border-radius: 4px; transition: width 0.4s ease; }
.progress-row { display: flex; align-items: center; gap: 12px; }
.progress-row .progress { flex: 1 1 auto; }
.progress-row .num { flex: none; min-width: 52px; text-align: right; font-weight: 500; }

/* Paires libellé / valeur */
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 20px; margin: 0; }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

/* Étapes de mise en route */
.steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.steps li { display: flex; align-items: center; gap: 10px; }
.steps .mark { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 1px dashed var(--dash); color: var(--ink-2); font-size: 12px; font-weight: 500; }
.steps .done .mark { border: 1px solid var(--good-line); background: var(--good-bg); color: var(--good); }
.steps .mark .ico { width: 12px; height: 12px; }
.steps a { font-weight: 500; }

/* Code et exemples */
pre.code { margin: 0; padding: 14px 16px; background: var(--flat-bg); border: 1px solid var(--line); border-radius: 8px; font-family: var(--code); font-size: 12px; line-height: 18px; color: var(--ink-1); overflow-x: auto; white-space: pre; }
code { font-family: var(--code); font-size: 12px; background: var(--flat-bg); border: 1px solid var(--line); border-radius: 4px; padding: 1px 4px; }
details > summary { cursor: pointer; font-weight: 500; font-size: 13px; }
details[open] > summary { margin-bottom: 8px; }
.plain-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); }

/* Graphique */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line-soft); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--brand); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--surface); stroke: var(--brand); stroke-width: 2; }
.chart text { fill: var(--ink-2); font-size: 11px; font-family: var(--font); }

/* Aperçu d'un mail */
.preview-frame { width: 100%; height: 70vh; min-height: 420px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); display: block; }
.preview-narrow { max-width: 390px; margin: 0 auto; }

/* Connexion et pages publiques : une carte centrée sur le fond */
.login { min-height: 100vh; padding: 24px 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; }
.login-form { width: 100%; max-width: 370px; }
.login-form form, .login-form .box { padding: 40px; display: flex; flex-direction: column; gap: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-xs); }
.login-form h1 { font-size: 18px; line-height: 24px; font-weight: 600; text-align: center; }
.login-form .btn { width: 100%; }
.login-form .center { text-align: center; }
.login-form .box form { padding: 0; border: 0; box-shadow: none; background: none; }
.login-form > .stack { padding: 40px; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-xs); text-align: center; }
.login-form p { margin: 0; text-align: center; }
.login-alt { align-self: center; font-size: 13px; color: var(--primary); }
@media (max-width: 480px) { .login-form form, .login-form > .stack { padding: 28px 20px; } }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Éditeur de mails : page plein écran, hors du menu du back-office ---------- */
body.ed { overflow: hidden; }
.ed-app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
.ed-top { flex: none; min-height: 64px; padding: 0 15px; display: flex; align-items: center; gap: 10px; }
.ed-top .icon-btn[disabled] { opacity: 0.4; cursor: default; }
.ed-top .icon-btn[disabled]:hover { background: none; }
.ed-top .icon-btn[aria-pressed='true'] { background: var(--accent-bg); color: var(--primary); }
.ed-kind { flex: none; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.ed-name { flex: 0 1 260px; }
.ed-toolset { flex: none; display: flex; align-items: center; gap: 2px; padding-left: 8px; border-left: 1px solid var(--field); }
.ed-fill { flex: 1 1 0; min-width: 0; }
.ed-state { flex: 0 1 auto; min-width: 0; font-size: 13px; color: var(--ink-2); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-state.bad { color: var(--bad); }
.ed-warning, .ed-draft { flex: none; margin: 0 15px 12px; }
.ed-draft { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ed-draft span { flex: 1 1 240px; }
.ed-body { flex: 1 1 auto; min-height: 0; display: flex; padding: 0 15px 15px 0; }
.ed-left { flex: none; width: 250px; overflow-y: auto; padding: 0 14px 4px; scrollbar-width: thin; scrollbar-color: var(--field) transparent; }
.ed-stage { flex: 1 1 0; min-width: 0; display: flex; justify-content: center; background: var(--surface); border: 1px solid var(--field); border-radius: 12px; overflow: hidden; }
#ed-frame { display: block; width: 100%; height: 100%; border: 0; background: var(--surface); }
.ed-app[data-device='tablet'] .ed-stage, .ed-app[data-device='mobile'] .ed-stage { background: var(--line-soft); }
.ed-app[data-device='tablet'] #ed-frame, .ed-app[data-device='mobile'] #ed-frame { flex: none; max-width: 100%; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.ed-app[data-device='tablet'] #ed-frame { width: 768px; }
.ed-app[data-device='mobile'] #ed-frame { width: 390px; }
.ed-right { flex: none; width: 340px; overflow-y: auto; padding: 0 2px 4px 15px; display: flex; flex-direction: column; gap: 12px; scrollbar-width: thin; scrollbar-color: var(--field) transparent; }
.ed-right > * { flex: none; }
.ed-panel-head { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding-top: 2px; }
.ed-panel-head .actions-row { gap: 2px; margin-left: -8px; }
.ed-panel-head .btn { padding: 0 8px; }
.ed-tabs { display: none; }
.is-preview .ed-left, .is-preview .ed-right { display: none; }
.is-preview .ed-body { padding-left: 15px; }

/* Onglets du panneau de gauche */
.ed-tablist { position: sticky; top: 0; z-index: 2; display: flex; margin: 0 0 12px; padding-bottom: 2px; background: var(--bg); }
.ed-tablist button { flex: 1 1 0; height: 34px; border: 1px solid var(--field); background: var(--surface); color: var(--ink-1); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; box-shadow: var(--shadow-xs); }
.ed-tablist button:first-child { border-radius: 6px 0 0 6px; }
.ed-tablist button:last-child { border-radius: 0 6px 6px 0; border-left: 0; }
.ed-tablist button:hover { background: var(--flat-bg); }
.ed-tablist button[aria-selected='true'] { background: var(--accent-bg); color: var(--primary); }
.ed-tablist button:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }

/* Palette */
.ed-group { margin: 14px 2px 8px; font-size: 13px; line-height: 20px; font-weight: 500; letter-spacing: 0; color: var(--ink-2); }
.ed-group:first-child { margin-top: 2px; }
.ed-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ed-tile { position: relative; min-height: 66px; padding: 10px 6px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-xs); color: var(--ink-1); font: inherit; font-size: 12px; line-height: 16px; font-weight: 500; text-align: center; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; overflow-wrap: anywhere; }
.ed-tile:hover { border-color: var(--ring); color: var(--primary); }
.ed-tile:focus-visible { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 30%, transparent); }
.ed-tile[disabled] { opacity: 0.5; cursor: not-allowed; color: var(--ink-2); border-color: var(--line); }
.ed-cols { display: flex; gap: 3px; width: 46px; height: 20px; }
.ed-cols i { border: 1.5px solid currentColor; border-radius: 3px; }
.ed-forget { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 4px; color: var(--ink-2); cursor: pointer; opacity: 0; }
.ed-tile:hover .ed-forget, .ed-tile:focus-within .ed-forget, .ed-forget:focus-visible { opacity: 1; }
.ed-forget:hover { background: var(--bad-bg); color: var(--bad); }
.ed-hint { margin: 14px 2px 0; font-size: 12px; line-height: 16px; color: var(--ink-2); }
.ed-tiles .ed-hint { margin: 0 2px; }
.ed-wide { grid-column: 1 / -1; }
.ed-ghost { position: fixed; left: -999px; top: -999px; z-index: 100; padding: 7px 10px; background: var(--primary); border-radius: 6px; color: #fff; font-size: 12px; line-height: 1; font-weight: 500; pointer-events: none; }
.is-dragging, .is-dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }

/* Calques */
.ed-layers { display: flex; flex-direction: column; gap: 2px; padding-bottom: 12px; }
.ed-layers[hidden] { display: none; }
.ed-layer { min-height: 32px; padding: 0 4px 0 6px; display: flex; align-items: center; gap: 6px; border: 1px solid transparent; border-radius: 6px; color: var(--ink-1); cursor: pointer; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.ed-layer .ico { flex: none; color: var(--ink-2); }
.ed-layer:hover { background: var(--surface); border-color: var(--line); }
.ed-layer[aria-selected='true'] { background: var(--surface); border-color: var(--ring); }
.ed-layer[aria-selected='true'] > .ico:first-child { color: var(--primary); }
.ed-layer:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
.ed-layer-name { flex: none; font-size: 13px; font-weight: 500; }
.ed-layer-sub { flex: 1 1 0; min-width: 0; font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-layer-dev { flex: none; display: grid; color: var(--ink-2); }
.ed-layer-eye { flex: none; margin-left: auto; width: 24px; height: 24px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 4px; background: none; color: var(--ink-2); cursor: pointer; }
.ed-layer-eye:hover { background: var(--flat-bg); color: var(--ink); }
.ed-layer.is-off .ed-layer-name, .ed-layer.is-off .ed-layer-sub { opacity: 0.5; text-decoration: line-through; }
.ed-layer.is-moving { opacity: 0.4; }
.ed-layer.drop-before { box-shadow: inset 0 2px 0 var(--primary); }
.ed-layer.drop-after { box-shadow: inset 0 -2px 0 var(--primary); }
.ed-layer.drop-in { border-color: var(--primary); background: var(--accent-bg); }

/* Secteurs du panneau de réglages */
.ed-sector { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-xs); }
.ed-sector > summary { min-height: 44px; margin: 0; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; line-height: 20px; font-weight: 600; letter-spacing: -0.01em; cursor: pointer; list-style: none; border-radius: 12px; }
.ed-sector > summary::-webkit-details-marker { display: none; }
.ed-sector > summary::after { content: ''; flex: none; width: 14px; height: 14px; background: var(--ink-2); -webkit-mask: var(--chev) center / contain no-repeat; mask: var(--chev) center / contain no-repeat; --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
.ed-sector[open] > summary { margin: 0; border-bottom: 1px solid var(--line); border-radius: 12px 12px 0 0; }
.ed-sector[open] > summary::after { transform: rotate(180deg); }
.ed-sector > summary:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
.ed-sector-body { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.ed-inline { display: flex; flex-wrap: wrap; gap: 8px 18px; }
p.hint { font-size: 12px; line-height: 16px; color: var(--ink-2); }
.ed-top .ed-seg { align-self: center; }
.ed-seg { display: inline-flex; align-self: flex-start; border: 1px solid var(--field); border-radius: 6px; overflow: hidden; box-shadow: var(--shadow-xs); }
.ed-seg button { height: 32px; min-width: 40px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: var(--surface); color: var(--ink-1); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.ed-seg button + button { border-left: 1px solid var(--field); }
.ed-seg button:hover { background: var(--flat-bg); }
.ed-seg button[aria-pressed='true'] { background: var(--accent-bg); color: var(--primary); }
.ed-seg button:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
.ed-color { display: flex; gap: 8px; }
.ed-swatch { flex: none; width: 34px !important; height: 34px !important; padding: 3px !important; border: 1px solid var(--field); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow-xs); cursor: pointer; }
.ed-pad { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.ed-pad label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; line-height: 14px; font-weight: 400; color: var(--ink-2); text-align: center; }
.ed-pad input { padding: 0 4px !important; text-align: center; }
.ed-items { display: flex; flex-direction: column; gap: 6px; }
.ed-item { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) 34px; gap: 6px; align-items: center; }
.field .ed-code { font-family: var(--code); font-size: 12px; line-height: 18px; white-space: pre; }
.ed-preview { min-height: 84px; padding: 8px; display: grid; place-items: center; background: var(--flat-bg); border: 1px dashed var(--field); border-radius: 8px; }
.ed-preview img { display: block; max-width: 100%; max-height: 150px; border-radius: 4px; }

/* Fenêtres : images, code, import */
.ed-dialog { width: min(640px, calc(100vw - 30px)); max-height: calc(100vh - 60px); padding: 0; border: 1px solid var(--field); border-radius: 12px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); }
.ed-dialog.is-large { width: min(900px, calc(100vw - 30px)); }
.ed-dialog::backdrop { background: rgba(20, 14, 40, 0.3); }
.ed-dialog-head { padding: 10px 12px 10px 20px; min-height: 56px; border-bottom: 1px solid var(--line); }
.ed-dialog-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.ed-dialog .ed-code { height: min(52vh, 480px); }
.ed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; max-height: 300px; overflow-y: auto; }
.ed-thumb { aspect-ratio: 1; padding: 4px; background: var(--flat-bg); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.ed-thumb:hover, .ed-thumb:focus-visible { border-color: var(--primary); outline: none; }
.ed-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }

@media (max-width: 1280px) and (min-width: 861px) {
  .ed-left { width: 214px; }
  .ed-right { width: 300px; }
  .ed-name { flex-basis: 150px; }
  .ed-kind { display: none; }
}
@media (max-width: 860px) {
  .ed-top { flex-wrap: wrap; padding: 10px 15px; gap: 8px; }
  .ed-kind, .ed-device, .ed-toolset, .ed-fill { display: none; }
  .ed-name { flex: 1 1 140px; }
  .ed-state { order: 5; flex: 1 1 100%; text-align: left; }
  .ed-body { padding: 0 15px; }
  .ed-left, .ed-right { display: none; width: auto; flex: 1 1 0; padding: 0 0 15px; }
  .ed-app[data-view='blocks'] .ed-left { display: block; }
  .ed-app[data-view='props'] .ed-right { display: flex; }
  .ed-app[data-view='blocks'] .ed-stage, .ed-app[data-view='props'] .ed-stage { display: none; }
  .ed-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ed-tabs { flex: none; display: flex; gap: 8px; padding: 10px 15px 12px; }
  .ed-tabs .btn { flex: 1 1 0; }
  .ed-tabs .btn[aria-pressed='true'] { background: var(--accent-bg); border-color: var(--ring); color: var(--primary); }
  .ed-seg button, .ed-tablist button { height: 40px; }
  .ed-swatch { width: 40px !important; height: 40px !important; }
  .ed-layer { min-height: 40px; }
  .ed-forget { opacity: 1; }
}


/* Prospection */
.seg { display: inline-flex; border: 1px solid var(--field); border-radius: 6px; overflow: hidden; box-shadow: var(--shadow-xs); }
.seg-btn { height: 32px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; background: var(--surface); color: var(--ink-1); font-size: 13px; font-weight: 500; text-decoration: none; }
.seg-btn + .seg-btn { border-left: 1px solid var(--field); }
.seg-btn .ico { width: 16px; height: 16px; }
.seg-btn:hover { background: var(--flat-bg); }
.seg-btn[aria-current] { background: var(--accent-bg); color: var(--primary); }
.select { height: 34px; padding: 0 30px 0 12px; border: 1px solid var(--field); border-radius: 6px; background: var(--surface) no-repeat right 10px center / 14px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371717B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); color: var(--ink); box-shadow: var(--shadow-xs); font: inherit; font-size: 13px; font-weight: 500; appearance: none; }
.select:hover { border-color: var(--ring); }
.pill .ico { width: 12px; height: 12px; margin-right: 4px; }
a.pill { text-decoration: none; }
.text-bad { color: var(--bad); }
.field.is-invalid input { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-bg); }
.btn.is-done { background: var(--good); border-color: var(--good); }

.board { display: flex; gap: 14px; overflow-x: auto; align-items: flex-start; padding-bottom: 6px; scrollbar-width: thin; scrollbar-color: var(--field) transparent; }
.board-col { flex: 0 0 272px; min-width: 0; display: flex; flex-direction: column; background: var(--flat-bg); border: 1px solid var(--line); border-radius: 12px; max-height: calc(100vh - 290px); min-height: 180px; }
.board-col-head { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 6px 6px 6px 14px; border-bottom: 1px solid var(--line); }
.board-col-head h2 { font-size: 14px; letter-spacing: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-col-head .count { color: var(--ink-2); font-size: 13px; }
.board-col-head .board-amount { margin-left: auto; }
.board-col-head .board-add { margin-left: auto; width: 30px; height: 30px; }
.board-col-head .board-amount + .board-add { margin-left: 0; }
.board-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.board-dot.dot-won { background: var(--good); } .board-dot.dot-lost { background: var(--dash); }
.board-list { flex: 1 1 auto; display: flex; flex-direction: column; gap: 8px; padding: 10px; overflow-y: auto; min-height: 60px; border-radius: 0 0 12px 12px; transition: background 0.12s; }
.board-col.is-over .board-list { background: var(--accent-bg); }
.board-card { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-xs); cursor: grab; }
.board-card:hover { border-color: var(--field); }
.board-card.is-dragging { opacity: 0.45; }
.board-title { font-weight: 500; text-decoration: none; overflow-wrap: anywhere; }
.board-meta { display: flex; flex-wrap: wrap; gap: 4px; }
.board-meta:empty { display: none; }
.board-next { color: var(--ink-1); overflow-wrap: anywhere; }

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { display: flex; gap: 12px; position: relative; padding-bottom: 16px; }
.timeline li:not(:last-child)::before { content: ''; position: absolute; left: 13px; top: 30px; bottom: 2px; width: 1px; background: var(--line); }
.tl-mark { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--flat-bg); border: 1px solid var(--line); color: var(--ink-2); }
.tl-mark .ico { width: 14px; height: 14px; }
.tl-stage .tl-mark, .tl-created .tl-mark { background: var(--accent-bg); color: var(--primary); }
.tl-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding-top: 4px; }
.tl-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.tl-head form { margin-left: auto; }
.tl-del { width: 28px; height: 28px; opacity: 0; }
.timeline li:hover .tl-del, .tl-del:focus-visible { opacity: 1; }
.tl-text { white-space: pre-wrap; overflow-wrap: anywhere; }

nav.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
nav.tabs a { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--ink-2); font-weight: 500; text-decoration: none; }
nav.tabs a .num { font-size: 12px; color: var(--ink-2); }
nav.tabs a:hover { color: var(--ink); }
nav.tabs a[aria-current] { color: var(--primary); border-bottom-color: var(--primary); }

.snip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; align-items: start; }
.snip { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-xs); padding: 16px; min-width: 0; }
.snip-head { display: flex; align-items: center; gap: 8px; padding-right: 0; }
.snip-head h3 { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.snip-pin { color: var(--primary); } .snip-pin .ico { width: 16px; height: 16px; }
.snip-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.55; color: var(--ink-1); max-height: 220px; overflow-y: auto; padding: 10px 12px; background: var(--flat-bg); border: 1px solid var(--line); border-radius: 8px; }
.snip-vars { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.snip-vars .field { font-size: 12px; gap: 4px; }
.snip-vars .field input { height: 30px; }
.snip-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.snip-foot .snip-copy { margin-left: auto; }
.snip-body mark { background: var(--accent-bg); color: var(--primary); border: 1px dashed var(--ring); border-radius: 4px; padding: 0 3px; font-weight: 500; }
.snip-tools { display: flex; gap: 0; margin-left: -8px; }
.snip-tools form { display: flex; }
.snip-tools .icon-btn.is-on { color: var(--primary); }
.snip-list { display: flex; flex-direction: column; gap: 12px; }
.snip-compact { padding: 12px; box-shadow: none; }
.snip-compact .snip-body { max-height: 140px; }
.var-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chip { height: 26px; padding: 0 8px; border: 1px solid var(--field); border-radius: 13px; background: var(--surface); color: var(--primary); font-family: var(--code); font-size: 12px; cursor: pointer; }
.chip:hover { background: var(--accent-bg); }
.counts { display: flex; flex-direction: column; gap: 6px; }

.token-new { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; background: var(--good-bg); border: 1px solid var(--good-line); border-radius: 8px; }
.token-new code { font-size: 13px; overflow-wrap: anywhere; background: var(--surface); }


/* ---------- CRM ---------- */
.side-title { padding: 0 10px 2px; font-size: 12px; font-weight: 500; color: var(--ink-2); letter-spacing: 0.02em; text-transform: uppercase; }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 600; line-height: 20px; text-align: center; }
.side-collapsed .side .nav-badge { position: absolute; margin: -20px 0 0 18px; min-width: 16px; height: 16px; line-height: 16px; font-size: 10px; padding: 0 4px; }
.side-collapsed .side-nav a { position: relative; }
.side-collapsed .side-title { display: none; }
.input { height: 34px; padding: 0 12px; border: 1px solid var(--field); border-radius: 6px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); font: inherit; font-size: 13px; }
.input:focus-visible, .select:focus-visible { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 30%, transparent); }
.btn-good { background: var(--good); border-color: var(--good); color: #fff; }
.btn-good:hover { background: var(--good-ink); border-color: var(--good-ink); color: #fff; }
.text-warn { color: var(--ink-2); font-style: italic; }
h1 .pill { vertical-align: 3px; margin-left: 4px; }
.card-summary { list-style: none; display: flex; align-items: center; gap: 8px; margin: -20px; padding: 18px 20px; font-size: 16px; font-weight: 600; letter-spacing: -0.025em; }
.card-summary::-webkit-details-marker { display: none; }
.card-summary::after { content: ''; margin-left: auto; width: 14px; height: 14px; background: var(--ink-2); -webkit-mask: var(--chev) center / contain no-repeat; mask: var(--chev) center / contain no-repeat; --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
details[open] > .card-summary { margin-bottom: 6px; border-bottom: 1px solid var(--line); }
details[open] > .card-summary::after { transform: rotate(180deg); }
.card-summary .ico { width: 16px; height: 16px; }
.kpis-sm { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 20px; }
.kpis-sm .kpi { padding: 16px; }
.kpis-sm .kpi .value { font-size: 22px; line-height: 28px; }
.mini-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mini-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mini-list li:first-child { padding-top: 0; } .mini-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.mini-list .title { font-weight: 500; text-decoration: none; overflow-wrap: anywhere; }
.mini-list .small { grid-column: 1; }
.mini-list .pill { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.tl-subject { font-weight: 500; overflow-wrap: anywhere; }
.tl-mail { max-height: 240px; overflow-y: auto; padding: 8px 10px; background: var(--flat-bg); border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.tl-deal .tl-mark, .tl-task .tl-mark { background: var(--good-bg); color: var(--good); border-color: var(--good-line); }
.tl-email_in .tl-mark { background: var(--accent-bg); color: var(--primary); }
.act-form { padding-bottom: 6px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.form-grid.compact { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }

p > .ico, .note > .ico, .small > .ico { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; }
.stats-filters { flex: 1 1 460px; justify-content: flex-end; }
.stats-filters .field { flex: 0 1 200px; }

/* Tâches */
.task-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.task-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.task-row:last-child { border-bottom: 0; }
.task-row form { display: flex; }
.task-check { flex: none; width: 28px; height: 28px; margin: -3px 0 0 -4px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--ink-2); cursor: pointer; }
.task-check:hover { background: var(--good-bg); color: var(--good); }
.task-check .ico { width: 20px; height: 20px; }
.task-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.task-title { font-weight: 500; text-decoration: none; overflow-wrap: anywhere; }
.task-links { display: inline; overflow-wrap: anywhere; }
.task-links a { color: var(--ink-2); }
.task-links .ico { display: inline-block; width: 12px; height: 12px; vertical-align: -1px; margin-right: 3px; }
.task-type { white-space: nowrap; }
.task-notes { color: var(--ink-1); white-space: pre-wrap; overflow-wrap: anywhere; }
.task-due { flex: none; font-size: 12px; color: var(--ink-2); white-space: nowrap; padding-top: 1px; }
.task-due.due-late { color: var(--bad); font-weight: 500; }
.task-due.due-today { color: var(--primary); font-weight: 500; }
.task-row.is-done .task-title { text-decoration: line-through; color: var(--ink-2); }
.task-row.is-done .task-check { color: var(--good); }
.task-row.is-changed { transition: opacity 0.3s; }
.task-list-lg .task-row { padding: 12px 20px; }
.task-add > summary { color: var(--primary); }
.task-quick { gap: 14px; }

/* Agenda : semaine */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.week-day { min-width: 0; display: flex; flex-direction: column; background: var(--flat-bg); border: 1px solid var(--line); border-radius: 12px; min-height: 180px; }
.week-day header { display: flex; align-items: center; gap: 4px; padding: 6px 4px 6px 12px; border-bottom: 1px solid var(--line); }
.week-head { display: flex; flex-direction: column; min-width: 0; line-height: 16px; }
.week-name { font-weight: 600; text-transform: capitalize; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.week-date { color: var(--ink-2); font-size: 12px; }
.week-day header .icon-btn { margin-left: auto; width: 28px; height: 28px; }
.week-day.is-today { background: var(--accent-bg); border-color: var(--ring); }
.week-day .task-list { padding: 4px 10px; }
.week-day .task-row { padding: 6px 0; gap: 6px; }
.week-day .task-check { width: 24px; height: 24px; }
.week-day .task-check .ico { width: 18px; height: 18px; }
.week-day .task-title { font-size: 13px; }
.week-empty { padding: 10px 12px; }
@media (max-width: 1100px) { .week { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }

/* Actions groupées */
.table-select .sel { width: 1%; padding-left: 16px !important; padding-right: 16px; vertical-align: middle; }
.table-select .sel + th, .table-select .sel + td { border-left: 0; padding-left: 0; }
.table-select .sel .check { min-height: 20px; }
.table-select tr.is-selected td { background: var(--accent-bg); }
.bulk-bar { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--ring); border-radius: 12px; box-shadow: 0 10px 30px rgba(30, 20, 70, 0.14); }
.bulk-count { font-weight: 500; }
.bulk-params { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bulk-params:empty { display: none; }

/* Affaires */
.board-col-head-2 { flex-direction: column; align-items: stretch; gap: 2px; padding: 6px 6px 8px 14px; }
.board-col-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.board-col-title .board-add { margin-left: auto; width: 30px; height: 30px; }
.board-sum { padding-right: 8px; }
.board-next .ico { display: inline-block; width: 12px; height: 12px; vertical-align: -1px; }
.pipeline { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: thin; }
.pipe-step { flex: 1 1 0; min-width: 110px; height: 38px; padding: 0 18px 0 22px; border: 0; background: var(--flat-bg); color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%); white-space: nowrap; }
.pipe-step:first-child { clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%); border-radius: 6px 0 0 6px; }
.pipe-step span { display: block; overflow: hidden; text-overflow: ellipsis; }
.pipe-step:hover { background: var(--accent-bg); color: var(--primary); }
.pipe-step.is-past { background: color-mix(in srgb, var(--brand) 30%, var(--surface)); color: var(--ink-1); }
.pipe-step.is-current { background: var(--primary); color: #fff; }
.pipe-step:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }

/* Statistiques */
.bars, .funnel { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.bars li, .funnel li { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(80px, 2fr) auto; gap: 4px 12px; align-items: center; }
.bar-label { display: flex; flex-direction: column; min-width: 0; }
.bar-label > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-label a { text-decoration: none; font-weight: 500; }
.bar-track { position: relative; height: 12px; border-radius: 6px; background: var(--flat-bg); overflow: hidden; }
.bar { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: color-mix(in srgb, var(--brand) 35%, var(--surface)); }
.bar-weighted { background: var(--primary); }
.bar-bad { background: color-mix(in srgb, var(--bad) 55%, var(--surface)); }
.bar-good { background: color-mix(in srgb, var(--good) 60%, var(--surface)); }
.bar-muted { background: var(--dash); }
.bar-value { font-weight: 500; text-align: right; white-space: nowrap; }
.funnel li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
.funnel .bar-label { flex-direction: row; justify-content: space-between; gap: 10px; }
.funnel .bar { background: var(--primary); }
.funnel .is-won .bar { background: var(--good); }
.funnel-rate { padding-left: 2px; }
.legend { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; }
.legend-full { background: color-mix(in srgb, var(--brand) 35%, var(--surface)); }
.legend-weighted { background: var(--primary); }
.columns-chart { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; height: 220px; align-items: end; padding-top: 10px; }
.columns-chart .col { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; }
.col-bar { width: 100%; max-width: 34px; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--primary); }
.col-value { font-size: 11px; color: var(--ink-1); white-space: nowrap; }
.col-label { font-size: 11px; color: var(--ink-2); white-space: nowrap; }

/* Fusion et doublons */
.merge-table th[scope='row'] { background: var(--th-bg); white-space: nowrap; font-weight: 500; }
.merge-table thead th { vertical-align: top; padding-top: 10px; padding-bottom: 10px; height: auto; }
.merge-table thead th .check { font-weight: 500; }
.merge-table tr.is-diff td { background: color-mix(in srgb, var(--accent-bg) 50%, var(--surface)); }
.merge-table td .check { align-items: flex-start; }
.dup-group > .between h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.split.single > .narrow { flex-basis: 100%; }

/* Utilisateurs du site */
.kpi-link { color: inherit; text-decoration: none; transition: border-color .15s, background-color .15s; }
.kpi-link:hover { border-color: var(--field); }
.kpi-link[aria-current] { border-color: var(--primary); background: var(--accent-bg); }
.kpi-link[aria-current] .label { color: var(--primary); }
.site-kpis { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.plain-list.numbered { list-style: decimal; gap: 8px; font-size: 14px; color: var(--ink-1); }


/* Réglages : menu de la page, une page par réglage */
.settings-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 30px; align-items: start; }
.settings-nav { position: sticky; top: 0; display: flex; flex-direction: column; gap: 18px; padding: 14px; background: var(--flat-bg); border: 1px solid var(--line); border-radius: 12px; }
.settings-group { display: flex; flex-direction: column; gap: 2px; }
.settings-title { padding: 0 10px 6px; font-size: 12px; font-weight: 500; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.settings-nav a { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 7px 10px; border: 1px solid transparent; border-radius: 6px; color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 500; }
.settings-nav a .ico { width: 16px; height: 16px; flex: none; color: var(--ink-1); }
.settings-nav a:hover { background: var(--surface); }
.settings-nav a[aria-current] { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow-xs); color: var(--primary); }
.settings-nav a[aria-current] .ico { color: var(--primary); }
.settings-other { margin-top: 2px; border-top: 1px solid var(--line) !important; border-radius: 0 0 6px 6px !important; padding-top: 12px !important; color: var(--ink-1) !important; }
.settings-body { min-width: 0; display: flex; flex-direction: column; gap: 30px; }
.access-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.access-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; padding: 12px 14px; cursor: pointer; }
.access-row + .access-row { border-top: 1px solid var(--line); }
.access-row:hover { background: var(--flat-bg); }
.access-row input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); flex: none; }
.access-who { display: flex; flex-direction: column; gap: 2px; min-width: 180px; flex: 1 1 200px; }
.access-row .pills { flex: 2 1 260px; }
.brand-preview { display: flex; align-items: center; gap: 10px; padding: 14px; background: var(--bg); border-radius: 10px; font-size: 16px; font-weight: 500; }
.logo.has-img { padding: 0; overflow: hidden; background: var(--surface); }
.logo img { width: 100%; height: 100%; object-fit: contain; display: block; }


/* Modules d'un compte */
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.module-card { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--field); border-radius: 8px; background: var(--surface); cursor: pointer; transition: border-color .15s, background-color .15s; }
.module-card:hover { border-color: var(--primary); }
.module-card input { margin: 2px 0 0; width: 16px; height: 16px; flex: none; accent-color: var(--primary); }
.module-card:has(input:checked) { border-color: var(--primary); background: var(--accent-bg); }
.module-ico { flex: none; width: 28px; height: 28px; border-radius: 6px; display: grid; place-items: center; background: var(--flat-bg); color: var(--primary); }
.module-ico .ico { width: 16px; height: 16px; }
.module-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }


/* Onglets : un seul bloc par page, le contenu change d'onglet en onglet */
.tabs[data-tabs] { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-xs); min-width: 0; }
.tab-list { display: flex; gap: 4px; padding: 0 14px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.tab-list::-webkit-scrollbar { display: none; }
.tab-list [role='tab'] { flex: none; position: relative; display: inline-flex; align-items: center; gap: 8px; height: 52px; padding: 0 12px; border: 0; background: none; color: var(--ink-1); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; scroll-snap-align: start; }
.tab-list [role='tab'] .ico { width: 16px; height: 16px; color: var(--ink-2); }
.tab-list [role='tab']:hover { color: var(--ink); }
.tab-list [role='tab']::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px 2px 0 0; background: transparent; }
.tab-list [role='tab'][aria-selected='true'] { color: var(--primary); }
.tab-list [role='tab'][aria-selected='true'] .ico { color: var(--primary); }
.tab-list [role='tab'][aria-selected='true']::after { background: var(--primary); }
.tab-list [role='tab']:focus-visible { outline: 2px solid var(--primary); outline-offset: -4px; border-radius: 8px; }
.tab-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-grid; place-items: center; background: var(--flat-bg); color: var(--ink-1); font-size: 12px; font-variant-numeric: tabular-nums; }
[aria-selected='true'] .tab-count { background: var(--accent-bg); color: var(--primary); }
.tab-panel { padding: 24px; display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.tab-panel.flush { padding: 0; gap: 0; }
.tab-panel.flush > .pad { padding: 20px 24px; }
.tabs[data-ready] .tab-panel:not(.is-active) { display: none; }
.tabs:not([data-ready]) .tab-panel + .tab-panel { display: none; }
.tab-panel > h3, .panel-title { margin: 0; font-size: 15px; font-weight: 600; }
.panel-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.tab-panel > .panel-section + .panel-section, .settings-body .panel-section + .panel-section, .stack > .panel-section + .panel-section { border-top: 1px solid var(--line); padding-top: 24px; }
.table-box { border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; }
.table-box .table { margin: 0; }
.tab-panel.flush .table-box { border: 0; border-radius: 0; }
.tab-panel .grid-2 { gap: 24px; }
.panel-section { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.tab-panel .table { border-radius: 0; }
.tab-panel > .table-wrap, .tab-panel > .table { margin: 0 -24px; width: calc(100% + 48px); }
.tab-panel.flush > .table { margin: 0; width: 100%; }
.danger-zone .panel-title { color: var(--bad); }
.narrow-form { max-width: 560px; }
.panel-block { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.panel-foot { padding-top: 4px; }
.reveal { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border: 1px solid var(--good-line); background: var(--good-bg); border-radius: 10px; }
.reveal-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.reveal code { flex: 1 1 260px; min-width: 0; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; font-size: 13px; overflow-wrap: anywhere; user-select: all; }
.module-card.is-off { opacity: .55; cursor: default; background: var(--flat-bg); }
.module-card.is-on { border-color: var(--primary); background: var(--accent-bg); cursor: default; }
/* Résumé sous le titre d'une fiche (à la place d'une carte « En bref ») */
.summary { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; padding: 0; }
.summary > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.summary dt { font-size: 12px; color: var(--ink-2); }
.summary dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }


/* Cases à cocher et boutons radio maison */
input[type='checkbox'], input[type='radio'] { appearance: none; -webkit-appearance: none; flex: none; width: 18px; height: 18px; margin: 0; display: inline-block; vertical-align: middle; border: 1.5px solid var(--field); border-radius: 5px; background: var(--surface) no-repeat center / 12px; box-shadow: var(--shadow-xs); cursor: pointer; transition: background-color .12s, border-color .12s, box-shadow .12s; }
input[type='radio'] { border-radius: 50%; }
input[type='checkbox']:hover, input[type='radio']:hover { border-color: var(--primary); }
input[type='checkbox']:checked { background-color: var(--primary); border-color: var(--primary); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E"); }
input[type='checkbox']:indeterminate { background-color: var(--primary); border-color: var(--primary); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round'%3E%3Cpath d='M6 12h12'/%3E%3C/svg%3E"); }
input[type='radio']:checked { border-color: var(--primary); background-image: radial-gradient(circle, var(--primary) 0 4px, transparent 4.5px); }
input[type='checkbox']:focus-visible, input[type='radio']:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 35%, transparent); }
input[type='checkbox']:disabled, input[type='radio']:disabled { opacity: .45; cursor: not-allowed; }
.check input, .access-row input, .module-card input { width: 18px; height: 18px; }
.table-select td.sel { vertical-align: top; }
.table-select th.sel { vertical-align: middle; }
.table-select th.sel .check { height: auto; }
.table-select .sel .check { min-height: 20px; height: 20px; align-items: center; }

/* Listes déroulantes maison (public/js/select.js) */
.ui-select { position: relative; display: inline-block; vertical-align: middle; max-width: 100%; }
.field .ui-select { display: block; width: 100%; }
.ui-select > select, .field .ui-select > select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; margin: 0; padding: 0; border: 0; }
.ui-select-btn { width: 100%; height: 34px; padding: 0 10px 0 12px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--field); border-radius: 6px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); font: inherit; font-size: 13px; font-weight: 400; text-align: left; cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.ui-select-btn.is-select { font-weight: 500; }
.ui-select-btn:hover { border-color: var(--ring); }
.ui-select-btn:focus-visible, .ui-select.is-open .ui-select-btn { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 30%, transparent); }
.ui-select-btn:disabled { opacity: .55; cursor: not-allowed; background: var(--flat-bg); }
.ui-select-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-select.is-placeholder .ui-select-text { color: var(--ink-2); }
.ui-select-chev { flex: none; width: 14px; height: 14px; fill: none; stroke: var(--ink-2); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.ui-select.is-open .ui-select-chev { transform: rotate(180deg); }
.ui-select-panel { position: fixed; z-index: 300; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 14px 36px rgba(20, 10, 60, 0.16); padding: 6px; overflow: hidden; animation: ui-pop .12s ease-out; }
.ui-select-panel[hidden] { display: none; }
.ui-select-panel.is-up { animation-name: ui-pop-up; }
@keyframes ui-pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes ui-pop-up { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.ui-select-search { flex: none; height: 34px; margin: 0 0 6px; padding: 0 10px; border: 1px solid var(--field); border-radius: 6px; font: inherit; font-size: 13px; color: var(--ink); background: var(--surface); }
.ui-select-search:focus { outline: none; border-color: var(--ring); }
.ui-select-search[hidden] { display: none; }
.ui-select-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; outline: none; scrollbar-width: thin; }
.ui-select-option { flex: none; display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 6px 8px 6px 10px; border-radius: 6px; font-size: 13px; color: var(--ink); cursor: pointer; }
.ui-select-option > span { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.ui-select-option.is-empty { color: var(--ink-2); }
.ui-select-option.is-active { background: var(--flat-bg); }
.ui-select-option[aria-selected='true'] { color: var(--primary); font-weight: 500; }
.ui-select-option[aria-selected='true'].is-active { background: var(--accent-bg); }
.ui-select-option[aria-disabled='true'] { opacity: .45; cursor: not-allowed; }
.ui-select-tick { flex: none; width: 15px; height: 15px; fill: none; stroke: var(--primary); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; visibility: hidden; }
.ui-select-option[aria-selected='true'] .ui-select-tick { visibility: visible; }
.ui-select-group { flex: none; padding: 8px 10px 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
.ui-select-none { padding: 10px; font-size: 13px; color: var(--ink-2); }
@media (prefers-reduced-motion: reduce) { .ui-select-panel { animation: none; } }
@media (pointer: coarse) { .ui-select-option { min-height: 42px; } }


/* Formulaires en popup : réglages à gauche, aperçu à droite */
.form-studio { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); gap: 30px; align-items: start; }
.form-preview { position: sticky; top: 0; display: flex; flex-direction: column; gap: 8px; }
.preview-chrome { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; background: var(--flat-bg); border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0; }
.preview-chrome span { width: 9px; height: 9px; border-radius: 50%; background: var(--field); }
.preview-chrome em { margin-left: 8px; font-style: normal; font-size: 12px; color: var(--ink-2); }
.preview-stage { position: relative; height: 520px; overflow: hidden; border: 1px solid var(--line); border-radius: 0 0 12px 12px; background: #fff; }
.fake-page { padding: 26px; display: flex; flex-direction: column; gap: 12px; }
.fake-page i { display: block; height: 12px; border-radius: 6px; background: #EEEBF6; }
.fake-page i.short { width: 60%; }
.form-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.color-row { display: flex; align-items: center; gap: 10px; }
.color-row input[type=color] { width: 46px; height: 34px; padding: 2px; border: 1px solid var(--field); border-radius: 6px; background: var(--surface); cursor: pointer; }
.check-row { display: flex; flex-wrap: wrap; gap: 10px 24px; }
@media (max-width: 1100px) { .form-studio { grid-template-columns: minmax(0, 1fr); } .form-preview { position: static; } .preview-stage { height: 480px; } }


/* Fenêtres d'ajout */
.modal { width: min(600px, calc(100vw - 24px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: 0 24px 60px rgba(20, 10, 60, 0.22); overflow: visible; }
.modal.is-wide { width: min(1040px, calc(100vw - 24px)); }
.modal[open] { display: flex; flex-direction: column; animation: ui-pop .16s ease-out; }
.modal::backdrop { background: rgba(20, 14, 40, 0.38); }
.modal-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 58px; padding: 10px 12px 10px 22px; border-bottom: 1px solid var(--line); }
.modal-title { margin: 0; font-size: 16px; font-weight: 600; }
.modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 22px; border-radius: 0 0 14px 14px; }
.modal-form { display: flex; flex-direction: column; gap: 18px; margin: 0; padding: 0; border: 0; box-shadow: none; background: none; }
.modal .split { margin: 0; }
.modal .split .card { box-shadow: none; }
.modal-form .form-row > .field { flex: 1 1 180px; }
@media (max-width: 860px) {
  .modal, .modal.is-wide { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: 16px 16px 0 0; border-bottom: 0; }
  .modal-body { padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); border-radius: 0; }
}


/* Confirmation et suppression */
.modal-confirm { width: min(480px, calc(100vw - 24px)); }
.modal-confirm .modal-body { display: flex; flex-direction: column; gap: 16px; }
.confirm-message { margin: 0; font-size: 14px; color: var(--ink); }
.confirm-extra:empty { display: none; }
.confirm-form { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; border: 0; }
.confirm-form p { margin: 0; }
.confirm-typed input { text-transform: uppercase; letter-spacing: .04em; }
.confirm-typed strong { color: var(--bad); letter-spacing: .04em; }
.confirm-actions { justify-content: flex-end; }
.btn-danger-soft { color: var(--bad); border-color: var(--bad-line, var(--field)); background: var(--surface); }
.btn-danger-soft:hover { background: var(--bad-bg, #FDECEF); border-color: var(--bad); color: var(--bad); }
.btn-danger-soft .ico { color: var(--bad); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Infobulles (menu réduit, boutons-icônes, pastilles) */
.tip { position: fixed; z-index: 200; max-width: 260px; padding: 6px 10px; border-radius: 6px; background: #1E1B2E; color: #fff; font-size: 12px; line-height: 16px; font-weight: 500; box-shadow: 0 6px 18px rgba(20, 10, 60, 0.22); pointer-events: none; opacity: 0; transform: translateY(2px); transition: opacity .12s, transform .12s; }
.tip.on { opacity: 1; transform: none; }
.tip::before { content: ''; position: absolute; width: 8px; height: 8px; background: inherit; transform: rotate(45deg); }
.tip[data-side='right']::before { left: -4px; top: calc(50% - 4px); }
.tip[data-side='top']::before { bottom: -4px; left: var(--arrow, calc(50% - 4px)); }
.tip[data-side='bottom']::before { top: -4px; left: var(--arrow, calc(50% - 4px)); }
@media (prefers-reduced-motion: reduce) { .tip { transition: none; } }

/* Mobile : derniers ajustements (placés en fin de feuille pour l'emporter sur les règles générales) */
@media (max-width: 860px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 16px; }
  .kpi .value { font-size: 24px; line-height: 30px; }
  .table td:first-child { min-width: 190px; }
  .board-col { flex-basis: 260px; max-height: none; }
  .snip-grid { grid-template-columns: minmax(0, 1fr); }
  .tl-del { opacity: 1; }
  .select, .seg-btn, .input, .ui-select-btn { height: 40px; }
  .ui-select-btn, .ui-select-search { font-size: 16px; }
  .bulk-bar { margin: 0 -10px; border-radius: 10px; }
  .table-select td.sel, .table-select th.sel { min-width: 0; width: 1%; padding-left: 14px !important; padding-right: 12px; }
  .table-select td:nth-child(2) { min-width: 190px; }
  .week-day { min-height: 0; }
  .stats-filters { justify-content: flex-start; }
  .stats-filters .field { flex: 1 1 140px; }
  .kpis-sm .kpi .value { font-size: 18px; line-height: 24px; }
  .bars li { grid-template-columns: minmax(0, 1fr) auto; }
  .bars li .bar-track { grid-column: 1 / -1; grid-row: 2; }
  .columns-chart { height: 180px; gap: 3px; }
  .col-value { display: none; }
  .task-list-lg .task-row { padding: 12px 16px; flex-wrap: wrap; }
  .task-row .task-due { white-space: normal; }
  .pipe-step { min-width: 96px; padding: 0 14px 0 18px; }
  .tab-panel { padding: 18px 16px; gap: 20px; }
  .tab-panel.flush > .pad { padding: 16px; }
  .tab-panel > .table-wrap, .tab-panel > .table { margin: 0 -16px; width: calc(100% + 32px); }
  .tab-list { padding: 0 6px; }
  .tab-list [role='tab'] { height: 48px; padding: 0 10px; }
  .summary { gap: 8px 18px; }
  .settings-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .settings-nav { position: static; flex-direction: row; gap: 6px; padding: 6px; margin: 0 -4px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
  .settings-nav::-webkit-scrollbar { display: none; }
  .settings-group { flex-direction: row; gap: 6px; flex: none; }
  .settings-group + .settings-group { border-left: 1px solid var(--field); padding-left: 6px; }
  .settings-title { display: none; }
  .settings-other { margin: 0; border-top: 0 !important; border-left: 1px solid var(--field) !important; border-radius: 0 !important; padding: 7px 10px !important; flex: none; }
  .settings-nav a { white-space: nowrap; min-height: 40px; scroll-snap-align: start; }
  .switch-panel { width: 100%; }
  .switch-list a { min-height: 44px; }
}
