/* Elle Bible — tokens (voir DESIGN.md) */
@import url("https://fonts.googleapis.com/css2?family=Bodoni+Moda:opsz,wght@6..96,500;6..96,700&family=Source+Sans+3:wght@400;600;700&display=swap");

:root {
  --ink: #0a0a0a;
  --paper: #ffffff;
  --paper-warm: #f7f5f2;
  --rule: #d6d0c8;
  --muted: #6b6560;
  --elle-red: #e30613;
  --ok: #1b5e3b;
  --warn: #8a5a00;
  --danger: #8b1a1a;
  --font-display: "Bodoni Moda", "Didot", "Times New Roman", serif;
  --font-ui: "Source Sans 3", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

html {
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--paper-warm);
}

.font-display {
  font-family: var(--font-display);
}

.label-caps {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.btn-primary {
  background: var(--elle-red);
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary:hover {
  filter: brightness(0.95);
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 0.45rem 0.9rem;
  font-size: 0.875rem;
  cursor: pointer;
}

.input-line {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  padding: 0.5rem 0;
  outline: none;
}

.input-line:focus {
  border-bottom-color: var(--ink);
}

.rule {
  border-color: var(--rule);
}

.sidebar {
  background: var(--paper);
  border-right: 1px solid var(--rule);
  width: 14rem;
  position: sticky;
  top: 0;
  z-index: 40;
  height: 100vh;
  overflow-y: auto;
}

.sidebar > div > a {
  color: var(--ink);
  text-decoration: none;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  background: var(--paper-warm);
}

.sidebar nav a.active {
  border-left: 2px solid var(--elle-red);
  padding-left: calc(1rem - 2px);
}

.table-elle {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table-elle th {
  text-align: left;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--ink);
  padding: 0.5rem 0.75rem;
  font-weight: 600;
}

.table-elle td {
  border-bottom: 1px solid var(--rule);
  padding: 0.65rem 0.75rem;
}

.kpi-figure {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
}

.widget-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 1rem;
  min-height: 6rem;
}

.badge {
  display: inline-block;
  border: 1px solid var(--rule);
  padding: 0.1rem 0.45rem;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.badge-danger {
  border-color: var(--elle-red);
  color: var(--elle-red);
}

.badge-ok {
  border-color: var(--ok);
  color: var(--ok);
}

.badge-warn {
  border-color: var(--warn);
  color: var(--warn);
}

.btn-ghost {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  padding: 0.45rem 0.9rem;
  font-size: 0.875rem;
  cursor: pointer;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.25);
  z-index: 40;
}

.drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(28rem, 100%);
  background: var(--paper);
  border-left: 1px solid var(--rule);
  z-index: 50;
  overflow-y: auto;
  padding: 1.5rem;
}

.modal-box {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 10, 0.3);
}

.modal-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 1.5rem;
  width: min(24rem, 92vw);
}

.page-paper {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 1.25rem;
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.75rem;
}

.pipeline-col {
  background: var(--paper);
  border: 1px solid var(--rule);
  min-height: 12rem;
  padding: 0.75rem;
}

.pipeline-card {
  border-bottom: 1px solid var(--rule);
  padding: 0.6rem 0;
  cursor: pointer;
}

.pipeline-card:last-child {
  border-bottom: none;
}

.kanban {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 1rem;
}

.kanban-col {
  flex: 0 0 16rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  min-height: 20rem;
  padding: 0.75rem;
}

.kanban-card {
  border: 1px solid var(--rule);
  padding: 0.6rem;
  margin-bottom: 0.5rem;
  background: var(--paper-warm);
  cursor: grab;
}

.agenda-block {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 1rem;
}

.agenda-block + .agenda-block {
  margin-top: 1rem;
}

.tabs {
  display: flex;
  gap: 1rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 1rem;
}

.tabs button {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.5rem 0;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
}

.tabs button.active {
  color: var(--ink);
  border-bottom-color: var(--elle-red);
}

.row-click {
  cursor: pointer;
}

.row-click:hover td {
  background: var(--paper-warm);
}

.select-line,
.textarea-line {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  padding: 0.5rem 0;
  outline: none;
  font: inherit;
}

.textarea-line {
  border: 1px solid var(--rule);
  padding: 0.5rem;
  min-height: 5rem;
}

.step-pills {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.step-pill {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--rule);
  color: var(--muted);
}

.step-pill.active {
  border-color: var(--ink);
  color: var(--ink);
}

.step-pill.done {
  border-color: var(--ok);
  color: var(--ok);
}

/* ── Focus visible (DESIGN.md) ─────────────────────────── */
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

[x-cloak] {
  display: none !important;
}

/* ── Combobox à recherche ──────────────────────────────── */
.combo {
  position: relative;
  width: 100%;
}

.combo-trigger,
.combo-input {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border: none;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  padding: 0.5rem 1.4rem 0.5rem 0;
  font: inherit;
  text-align: left;
  color: var(--ink);
  outline: none;
  cursor: pointer;
}

.combo-input {
  cursor: text;
  border-bottom-color: var(--ink);
}

.combo-trigger:focus-visible {
  outline: none;
  border-bottom-color: var(--ink);
}

.combo-disabled .combo-trigger {
  cursor: not-allowed;
  color: var(--muted);
}

.combo-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combo-placeholder {
  color: var(--muted);
}

.combo-caret {
  color: var(--muted);
  font-size: 0.7rem;
}

.combo-clear {
  position: absolute;
  right: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.combo-list {
  z-index: 80;
  overflow-y: auto;
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 0 6px 18px rgba(10, 10, 10, 0.08);
  padding: 0.25rem 0;
  margin: 0;
  list-style: none;
}

.combo-option {
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
}

.combo-option.active {
  background: var(--paper-warm);
}

.combo-option.selected .combo-label {
  font-weight: 600;
}

.combo-option mark {
  background: none;
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--elle-red);
  text-underline-offset: 2px;
}

.combo-sub {
  font-size: 0.75rem;
  color: var(--muted);
}

.combo-create {
  color: var(--elle-red);
  border-top: 1px solid var(--rule);
}

.combo-empty {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ── Glisser-déposer ───────────────────────────────────── */
.drag-ghost {
  opacity: 0.35;
  background: var(--paper-warm) !important;
  border-style: dashed !important;
}

.drag-chosen {
  box-shadow: 0 8px 20px rgba(10, 10, 10, 0.12);
}

.drag-dragging {
  transform: rotate(1.5deg);
}

body.is-dragging,
body.is-dragging * {
  cursor: grabbing !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

.drag-handle {
  cursor: grab;
  color: var(--muted);
  user-select: none;
  letter-spacing: -0.15em;
  font-size: 0.85rem;
  line-height: 1;
  padding: 0.15rem 0.25rem;
}

/* ── Éditeur WYSIWYG (Quill, thème snow aux couleurs Elle) ── */
.wysiwyg {
  position: relative;
  background: var(--paper);
}

.wysiwyg .ql-toolbar.ql-snow {
  border: 1px solid var(--rule);
  background: var(--paper-warm);
  font-family: var(--font-ui);
  padding: 0.3rem 0.4rem;
}

.wysiwyg .ql-container.ql-snow {
  border: 1px solid var(--rule);
  border-top: 0;
  font-family: var(--font-ui);
  font-size: 0.9rem;
}

.wysiwyg .ql-editor {
  min-height: 8rem;
  line-height: 1.5;
  color: var(--ink);
}

.wysiwyg.is-compact .ql-editor {
  min-height: 3.5rem;
  max-height: 16rem;
}

.wysiwyg .ql-editor.ql-blank::before {
  color: var(--muted);
  font-style: normal;
}

.wysiwyg .ql-container:focus-within {
  border-color: var(--ink);
}

.wysiwyg .ql-snow .ql-stroke {
  stroke: var(--ink);
}

.wysiwyg .ql-snow .ql-fill {
  fill: var(--ink);
}

.wysiwyg .ql-snow button:hover .ql-stroke,
.wysiwyg .ql-snow button.ql-active .ql-stroke {
  stroke: var(--elle-red);
}

.wysiwyg .ql-snow button:hover .ql-fill,
.wysiwyg .ql-snow button.ql-active .ql-fill {
  fill: var(--elle-red);
}

.wysiwyg .ql-snow .ql-tooltip {
  z-index: 5;
  border-color: var(--ink);
  box-shadow: 0 8px 20px rgba(10, 10, 10, 0.12);
}

.wysiwyg .ql-snow .ql-tooltip[data-mode="link"]::before {
  content: "Lien :";
}

.wysiwyg .ql-snow .ql-tooltip.ql-editing a.ql-action::after {
  content: "Enregistrer";
}

.wysiwyg .ql-snow .ql-tooltip a.ql-action::after {
  content: "Modifier";
}

.wysiwyg .ql-snow .ql-tooltip a.ql-remove::before {
  content: "Retirer";
}

.wysiwyg .ql-snow .ql-tooltip::before {
  content: "Ouvrir :";
}

/* Mentions (éditeur et rendu) */
.mention {
  display: inline-block;
  padding: 0 0.25rem;
  background: #fbe3e4;
  color: var(--ink);
  font-weight: 600;
  border-radius: 2px;
}

.mention-list {
  position: absolute;
  z-index: 20;
  width: 15rem;
  max-height: 16rem;
  overflow-y: auto;
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 0 10px 24px rgba(10, 10, 10, 0.16);
}

.mention-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.mention-list li.is-active {
  background: var(--paper-warm);
  box-shadow: inset 2px 0 0 var(--elle-red);
}

.mention-avatar,
.comment-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
}

.mention-role {
  margin-left: auto;
  font-size: 0.68rem;
  color: var(--muted);
}

/* HTML assaini rendu (descriptions, commentaires) */
.rich-text {
  font-size: 0.9rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.rich-text p + p {
  margin-top: 0.4rem;
}

.rich-text h2,
.rich-text h3 {
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0.5rem 0 0.25rem;
}

.rich-text h2 { font-size: 1.25rem; }
.rich-text h3 { font-size: 1.1rem; }

.rich-text ul,
.rich-text ol {
  margin: 0.35rem 0 0.35rem 1.25rem;
}

.rich-text ul { list-style: disc; }
.rich-text ol { list-style: decimal; }

.rich-text blockquote {
  border-left: 2px solid var(--rule);
  padding-left: 0.75rem;
  color: var(--muted);
}

.rich-text a {
  color: var(--elle-red);
  text-decoration: underline;
}

/* ── Commentaires & historique ────────────────────────── */
.comment-list {
  margin-bottom: 1rem;
}

.comment {
  display: flex;
  gap: 0.65rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rule);
}

.comment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: baseline;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.comment-meta strong {
  color: var(--ink);
  font-size: 0.85rem;
}

.comment-actions {
  margin-top: 0.25rem;
  display: flex;
  gap: 0.25rem;
}

.history-list {
  border-left: 1px solid var(--rule);
  margin-left: 0.4rem;
}

.history-item {
  position: relative;
  padding: 0 0 0.9rem 1rem;
  font-size: 0.85rem;
}

.history-item::before {
  content: "";
  position: absolute;
  left: -0.25rem;
  top: 0.35rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--ink);
}

.history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: baseline;
}

.history-changes {
  margin-top: 0.25rem;
  display: grid;
  gap: 0.15rem;
}

.history-changes li {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.history-field {
  display: inline-block;
  min-width: 8rem;
  color: var(--muted);
}

.history-changes del {
  color: var(--muted);
}

/* ── Gantt digital (planning) ─────────────────────────── */
.gantt {
  --gantt-label: 240px;
  border: 1px solid var(--rule);
  background: var(--paper);
  overflow-x: auto;
  min-width: 0;
}

.gantt-head,
.gantt-row {
  display: grid;
  grid-template-columns: var(--gantt-label) minmax(720px, 1fr);
}

.gantt-head {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
}

.gantt-label {
  position: sticky;
  left: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0 0.75rem;
  min-width: 0;
  background: var(--paper);
  border-right: 1px solid var(--rule);
  font-size: 0.85rem;
}

.gantt-label-sub {
  padding-left: 1.5rem;
  color: var(--muted);
}

.gantt-corner {
  height: 2.25rem;
}

.gantt-track {
  position: relative;
  min-height: 2.1rem;
}

.gantt-month {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  padding-left: 0.4rem;
  border-left: 1px solid var(--rule);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.gantt-grid {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px solid #ece7e0;
  pointer-events: none;
}

.gantt-row {
  border-bottom: 1px solid #ece7e0;
}

.gantt-group-head {
  background: var(--paper-warm);
}

.gantt-group-head .gantt-label {
  background: var(--paper-warm);
}

.gantt-periods .gantt-track {
  min-height: 2.75rem;
}

.gantt-period {
  position: absolute;
  top: 0.35rem;
  bottom: 0.35rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 0.4rem;
  overflow: hidden;
  border: 1px solid var(--ink);
  border-left-width: 3px;
  background: var(--paper);
  font-size: 0.72rem;
  line-height: 1.15;
}

.gantt-period-name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gantt-period-meta {
  color: var(--muted);
  white-space: nowrap;
}

.gantt-period-fill {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  background: var(--ok);
}

.gantt-bar {
  position: absolute;
  top: 0.3rem;
  bottom: 0.3rem;
  display: flex;
  align-items: center;
  padding: 0 0.45rem;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 1;
}

.gantt-bar.is-won {
  background: var(--ink);
  color: #fff;
}

.gantt-bar.is-pipe {
  background: repeating-linear-gradient(135deg, var(--paper) 0 6px, #ece7e0 6px 12px);
  border: 1px dashed var(--ink);
  color: var(--ink);
}

.gantt-bar.cut-left {
  border-top-left-radius: 0;
  border-left: 3px solid var(--elle-red);
}

.gantt-bar.cut-right {
  border-right: 3px solid var(--elle-red);
}

.gantt-bar:focus-visible {
  outline: 2px solid var(--elle-red);
  outline-offset: 1px;
}

.gantt-bar.is-dragging {
  cursor: grabbing;
  opacity: 0.85;
  box-shadow: 0 6px 16px rgba(10, 10, 10, 0.2);
}

.gantt-bar-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.gantt-today {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 2px solid var(--elle-red);
  z-index: 0;
  pointer-events: none;
}

.gantt-drag-tip {
  position: absolute;
  top: -1.4rem;
  z-index: 4;
  padding: 0.1rem 0.4rem;
  background: var(--elle-red);
  color: #fff;
  font-size: 0.7rem;
  white-space: nowrap;
  pointer-events: none;
}

.drag-handle:hover {
  color: var(--ink);
}

/* ── Tableau type Trello (leads, planning, kanban) ─────── */
.board {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  align-items: flex-start;
  min-height: 60vh;
}

.board-col {
  flex: 0 0 17rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 13rem);
}

.board-col-head {
  padding: 0.65rem 0.75rem 0.5rem;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.board-col-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.board-col-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

.board-count {
  font-size: 0.7rem;
  color: var(--muted);
  border: 1px solid var(--rule);
  padding: 0 0.4rem;
  white-space: nowrap;
}

.board-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  min-height: 4rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.board-col.is-won .board-col-head {
  border-bottom-color: var(--ok);
}

.board-col.is-lost {
  background: var(--paper-warm);
}

.board-drop-hint {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  padding: 0.75rem 0.25rem;
  border: 1px dashed var(--rule);
}

.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 0.55rem 0.6rem;
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.card:hover {
  border-color: var(--ink);
}

.card-title {
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.3;
}

.card-sub {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-top: 0.45rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.card-figure {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
}

.card-chip {
  display: inline-block;
  white-space: nowrap;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--rule);
  padding: 0 0.3rem;
  color: var(--muted);
}

.card-chip.is-late {
  border-color: var(--elle-red);
  color: var(--elle-red);
}

.card-chip.is-ok {
  border-color: var(--ok);
  color: var(--ok);
}

.chip-toggle {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  border: 1px solid var(--rule);
  padding: 0.2rem 0.55rem;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.chip-toggle.is-on {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.card-action {
  white-space: nowrap;
  border: 1px solid var(--rule);
  background: var(--paper);
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  cursor: pointer;
  color: var(--ink);
}

.card-action:hover {
  border-color: var(--ink);
}

.add-card {
  padding: 0.4rem 0.5rem 0.6rem;
}

.add-card-btn {
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0.35rem 0.25rem;
  cursor: pointer;
}

.add-card-btn:hover {
  color: var(--ink);
  background: var(--paper-warm);
}

.add-card textarea {
  width: 100%;
  border: 1px solid var(--ink);
  padding: 0.4rem;
  font: inherit;
  font-size: 0.875rem;
  resize: none;
  background: var(--paper);
}

.col-add {
  flex: 0 0 15rem;
  border: 1px dashed var(--rule);
  padding: 0.6rem;
}

.progress-line {
  height: 3px;
  background: var(--rule);
  margin-top: 0.35rem;
  position: relative;
}

.progress-line > span {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--ink);
}

.progress-line.is-full > span {
  background: var(--ok);
}

/* ── Barre de filtres ──────────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.filter-bar > div {
  min-width: 11rem;
}

.filter-bar .grow {
  flex: 1;
  min-width: 14rem;
}

/* ── Modal large (détail de carte) ─────────────────────── */
.modal-wide {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4vh 1rem;
  background: rgba(10, 10, 10, 0.3);
  overflow-y: auto;
}

.modal-wide-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  width: min(56rem, 100%);
  padding: 1.5rem;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.9rem;
  border: none;
  background: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 1.5rem;
}

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

.inline-title {
  width: 100%;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  border: none;
  border-bottom: 1px solid transparent;
  background: transparent;
  padding: 0.1rem 0;
  outline: none;
}

.inline-title:hover,
.inline-title:focus {
  border-bottom-color: var(--rule);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
}

.activity-item {
  border-bottom: 1px solid var(--rule);
  padding: 0.5rem 0;
  font-size: 0.85rem;
}

/* ── Dashboard drag ────────────────────────────────────── */
.widget-card .widget-tools {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  background: var(--paper);
  padding-left: 0.5rem;
  opacity: 0;
  transition: opacity 120ms ease;
}

.widget-card:hover .widget-tools,
.widget-card:focus-within .widget-tools {
  opacity: 1;
}

.size-btn {
  border: 1px solid var(--rule);
  background: var(--paper);
  font-size: 0.65rem;
  padding: 0 0.35rem;
  cursor: pointer;
  color: var(--muted);
}

.size-btn.active {
  border-color: var(--ink);
  color: var(--ink);
}

@media (max-width: 900px) {
  .dashboard-grid > section {
    grid-column: span 12 / span 12 !important;
  }
}

/* ── Lignes répétables (contacts, produits) ────────────── */
.repeat-row {
  border: 1px solid var(--rule);
  padding: 0.75rem;
  margin-bottom: 0.6rem;
  position: relative;
}

.repeat-remove {
  position: absolute;
  top: 0.35rem;
  right: 0.5rem;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
}

/* ── Toasts ────────────────────────────────────────────── */
.toast-host {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(26rem, calc(100vw - 2rem));
}

.toast {
  background: var(--ink);
  color: var(--paper);
  padding: 0.65rem 2rem 0.65rem 0.85rem;
  font-size: 0.875rem;
  position: relative;
  border-left: 3px solid var(--paper);
}

.toast-ok {
  border-left-color: #6fbf8f;
}

.toast-error {
  border-left-color: var(--elle-red);
}

.toast-link {
  color: var(--paper);
  text-decoration: underline;
  margin-left: 0.5rem;
}

.toast-close {
  position: absolute;
  right: 0.5rem;
  top: 0.4rem;
  border: none;
  background: none;
  color: var(--paper);
  cursor: pointer;
  font-size: 1rem;
}

/* ── Tableaux d'administration ─────────────────────────── */
.table-elle input.cell-input {
  width: 100%;
  border: none;
  border-bottom: 1px solid transparent;
  background: transparent;
  font: inherit;
  padding: 0.15rem 0;
}

.table-elle input.cell-input:focus {
  outline: none;
  border-bottom-color: var(--ink);
}

.settings-layout {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr);
  gap: 2rem;
}

.settings-nav button {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  padding: 0.45rem 0.75rem;
  font-size: 0.9rem;
  cursor: pointer;
  border-left: 2px solid transparent;
  color: var(--ink);
}

.settings-nav button.active {
  border-left-color: var(--elle-red);
  background: var(--paper);
}

@media (max-width: 760px) {
  .settings-layout {
    grid-template-columns: 1fr;
  }
}

.list-editor li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--rule);
  padding: 0.35rem 0;
}

.sortable-fallback {
  opacity: 0.95 !important;
  box-shadow: 0 10px 24px rgba(10, 10, 10, 0.18);
}

/* Le contenu principal doit pouvoir rétrécir : les tableaux kanban défilent dans leur cadre. */
body > div > main.flex-1 {
  min-width: 0;
}

/* ── Squelettes de chargement ─────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--paper-warm) 25%, #efebe5 50%, var(--paper-warm) 75%);
  background-size: 200% 100%;
  animation: skeleton-shine 1.2s ease-in-out infinite;
}

@keyframes skeleton-shine {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
}

.link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 2px;
}

.link:hover {
  text-decoration-color: var(--elle-red);
}

.tabs.tabs-compact {
  border-bottom: none;
  gap: 0.9rem;
}

.filter-bar > .tabs {
  min-width: 0;
}

/* ── Notifications (cloche + panneau) ─────────────────── */
.notif-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid transparent;
  background: none;
  color: var(--ink);
  cursor: pointer;
}

.notif-bell:hover,
.notif-bell[aria-expanded="true"] {
  border-color: var(--rule);
  background: var(--paper-warm);
}

.notif-bell:focus-visible {
  outline: 2px solid var(--elle-red);
  outline-offset: 1px;
}

.notif-badge {
  position: absolute;
  top: 0.05rem;
  right: 0.05rem;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: var(--elle-red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.1rem;
  text-align: center;
}

.notif-panel {
  position: fixed;
  top: 1rem;
  left: calc(14rem + 0.5rem);
  z-index: 70;
  display: flex;
  flex-direction: column;
  width: min(26rem, calc(100vw - 15rem));
  max-height: calc(100vh - 2rem);
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 0 16px 40px rgba(10, 10, 10, 0.16);
}

.notif-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1rem 0.5rem;
}

.notif-list {
  overflow-y: auto;
  border-top: 1px solid var(--rule);
}

.notif-list > li {
  position: relative;
  border-bottom: 1px solid var(--rule);
}

.notif-item {
  display: grid;
  gap: 0.15rem;
  padding: 0.7rem 2.25rem 0.7rem 1rem;
  color: var(--ink);
  text-decoration: none;
}

.notif-item:hover {
  background: var(--paper-warm);
}

.notif-item.is-unread {
  border-left: 3px solid var(--elle-red);
  padding-left: calc(1rem - 3px);
}

.notif-item.is-unread .notif-title {
  font-weight: 600;
}

.notif-kind {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.notif-title {
  font-size: 0.875rem;
  line-height: 1.3;
}

.notif-excerpt {
  font-size: 0.8rem;
  color: var(--muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.notif-time {
  font-size: 0.72rem;
  color: var(--muted);
}

.notif-mark {
  position: absolute;
  top: 0.7rem;
  right: 0.75rem;
  border: none;
  background: none;
  color: var(--elle-red);
  font-size: 0.7rem;
  cursor: pointer;
}

/* Libellés FR du sélecteur de titres Quill */
.wysiwyg .ql-snow .ql-picker.ql-header .ql-picker-label::before,
.wysiwyg .ql-snow .ql-picker.ql-header .ql-picker-item::before {
  content: "Texte";
}

.wysiwyg .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before,
.wysiwyg .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before {
  content: "Titre";
}

.wysiwyg .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before,
.wysiwyg .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before {
  content: "Sous-titre";
}

/* ── Actions du shell (recherche, todo) ───────────────── */
.shell-action {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  text-align: left;
}

.shell-action:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.shell-action span {
  flex: 1;
}

kbd {
  display: inline-block;
  min-width: 1.3rem;
  padding: 0 0.3rem;
  border: 1px solid var(--rule);
  border-bottom-width: 2px;
  background: var(--paper-warm);
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.68rem;
  line-height: 1.35rem;
  text-align: center;
}

.nav-badge {
  min-width: 1.2rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--elle-red);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.2rem;
  text-align: center;
}

.notif-mark.is-read {
  color: var(--rule);
}

.notif-mark.is-read:hover {
  color: var(--muted);
}

/* ── Recherche plein écran (Spotlight) ────────────────── */
.spotlight-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(10, 10, 10, 0.45);
  backdrop-filter: blur(2px);
}

.spotlight,
.quick-todo {
  position: fixed;
  z-index: 91;
  left: 50%;
  top: 9vh;
  transform: translateX(-50%);
  width: min(46rem, calc(100vw - 2rem));
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 0 30px 80px rgba(10, 10, 10, 0.3);
}

.spotlight {
  display: flex;
  flex-direction: column;
  max-height: 78vh;
}

.spotlight-input {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
}

.spotlight-input input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.6rem;
}

.spotlight-input input::-webkit-search-cancel-button {
  display: none;
}

.spotlight-results {
  overflow-y: auto;
  padding: 0.25rem 0 0.5rem;
}

.spotlight-group {
  padding: 0.75rem 1.25rem 0.25rem;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.spotlight-hit {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 1rem;
  padding: 0.55rem 1.25rem;
  color: var(--ink);
  text-decoration: none;
  border-left: 3px solid transparent;
}

.spotlight-hit.is-active {
  background: var(--paper-warm);
  border-left-color: var(--elle-red);
}

.spotlight-hit-title {
  font-size: 1rem;
}

.spotlight-hit-title mark {
  background: #fbe3e4;
  color: inherit;
}

.spotlight-hit-sub {
  grid-column: 1;
  font-size: 0.8rem;
  color: var(--muted);
}

.spotlight-hit-enter {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  color: var(--muted);
  opacity: 0;
}

.spotlight-hit.is-active .spotlight-hit-enter {
  opacity: 1;
}

.spotlight-empty {
  padding: 1.5rem 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.spotlight-foot {
  display: flex;
  gap: 1.25rem;
  padding: 0.5rem 1.25rem;
  border-top: 1px solid var(--rule);
  background: var(--paper-warm);
  font-size: 0.72rem;
  color: var(--muted);
}

.spotlight-foot kbd {
  margin-right: 0.2rem;
}

/* ── Création rapide de todo ──────────────────────────── */
.quick-todo {
  width: min(36rem, calc(100vw - 2rem));
  padding: 1.5rem;
  max-height: 84vh;
  overflow-y: auto;
}

.modal-close-inline {
  border: none;
  background: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}

.modal-close-inline:hover {
  color: var(--ink);
}

.chip-btn {
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--rule);
  background: var(--paper);
  font-size: 0.72rem;
  cursor: pointer;
}

.chip-btn:hover {
  border-color: var(--ink);
}

/* ── Todos ─────────────────────────────────────────────── */
.todo-card.is-done .card-title {
  color: var(--muted);
  text-decoration: line-through;
}

.card-chip.is-today {
  border-color: var(--warn);
  color: var(--warn);
}

/* ── Facturation ───────────────────────────────────────── */
.billing-bucket {
  border: 1px solid var(--rule);
  cursor: pointer;
}

.billing-bucket:hover {
  border-color: var(--ink);
}

.billing-bucket.is-active {
  border-color: var(--ink);
  box-shadow: inset 0 -3px 0 var(--elle-red);
}

.billing-order {
  border: 1px solid var(--rule);
  background: var(--paper);
  margin-bottom: 0.75rem;
}

.billing-order-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
}

.billing-order .table-elle {
  border-top: 1px solid var(--rule);
}

.billing-toggle {
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid var(--rule);
  background: var(--paper);
  cursor: pointer;
  font-size: 0.8rem;
}

/* Montants et pourcentages alignés à droite : jamais coupés */
.table-elle td.text-right,
.table-elle th.text-right {
  white-space: nowrap;
}

/* ── Dashboard : période par widget, tendances ─────────── */
.widget-period {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
  margin-top: 0.25rem;
  font-size: 0.72rem;
  color: var(--muted);
}

.widget-period-pop {
  position: absolute;
  top: 2.4rem;
  right: 0.75rem;
  z-index: 20;
  width: min(20rem, calc(100% - 1.5rem));
  padding: 0.85rem;
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 0 12px 30px rgba(10, 10, 10, 0.16);
}

.trend-up {
  color: var(--ok);
}

.trend-down {
  color: var(--elle-red);
}

/* Tableau de bord sur écran étroit : un widget par ligne */
@media (max-width: 900px) {
  .dashboard-grid > .widget-card {
    grid-column: span 12 / span 12 !important;
  }
}
