/* =========================================================
   MODULE PROJETS · Styles (type Monday/Asana)
   Chargé après styles.css. Utilise les tokens de charte
   (--color-*, --cr-*). Compatible mode nuit via
   html[data-theme="dark"] hérité.
   Préfixe .crp- pour tout isoler.
   ========================================================= */

.projets-main {
  padding: 0 0 80px;
  min-height: 60vh;
}
#crp-root {
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px clamp(12px, 3vw, 32px) 0;
}

/* ---------- Topbar / onglets projets ---------- */
.crp-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.crp-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.crp-eyebrow svg { width: 15px; height: 15px; }
.crp-page-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 3.2vw, 34px);
  margin: 4px 0 0;
  color: var(--color-text);
}
.crp-board-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.crp-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.crp-tab:hover { border-color: var(--color-primary); transform: translateY(-1px); }
.crp-tab--active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.crp-tab-emoji { font-size: 16px; }
.crp-tab-count {
  font-size: 11px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  padding: 1px 7px;
  font-weight: 700;
}
.crp-tab--active .crp-tab-count { background: rgba(255, 255, 255, 0.25); }
.crp-tab--add { padding: 8px 10px; color: var(--color-text-muted); }
.crp-tab--add svg { width: 16px; height: 16px; }

/* ---------- Toolbar (vues + outils) ---------- */
.crp-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 16px;
}
.crp-views { display: inline-flex; gap: 4px; background: var(--color-surface-alt); padding: 4px; border-radius: var(--radius-lg); }
.crp-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.crp-view-btn:hover { color: var(--color-text); }
.crp-view-btn--active { background: var(--color-surface); color: var(--color-primary); box-shadow: var(--shadow-sm); }
.crp-view-ico { font-size: 14px; }

.crp-tools { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.crp-search {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 6px 12px;
}
.crp-search svg { width: 15px; height: 15px; color: var(--color-text-muted); }
.crp-search input {
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--color-text);
  width: 160px;
}
.crp-select {
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 7px 10px;
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--color-text);
  cursor: pointer;
  max-width: 190px;
}
.crp-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.crp-btn svg { width: 15px; height: 15px; }
.crp-btn:hover { border-color: var(--color-primary); }
.crp-btn--primary { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.crp-btn--primary:hover { background: var(--color-primary-hover); }
.crp-btn--danger { background: var(--color-danger); border-color: var(--color-danger); color: #fff; }
.crp-btn--ghost { background: transparent; }
.crp-btn--ghost .crp-auto-count {
  font-size: 11px; font-weight: 700; background: var(--cr-yellow); color: #1a1a1a;
  border-radius: 20px; padding: 0 6px; min-width: 16px; text-align: center;
}
.crp-icon-btn {
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 5px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
}
.crp-icon-btn svg { width: 15px; height: 15px; }
.crp-icon-btn:hover { background: var(--color-surface-alt); color: var(--color-danger); }
.crp-linklike { border: none; background: none; color: var(--color-primary); cursor: pointer; font-weight: 600; text-decoration: underline; }
.crp-filter-note { font-size: 13px; color: var(--color-text-muted); margin: -8px 0 12px; }
.crp-muted { color: var(--color-text-muted); font-size: 13px; }

/* ---------- Avatars / chips ---------- */
.crp-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border: 2px solid var(--color-surface);
  margin-left: -6px;
}
.crp-avatar:first-child { margin-left: 0; }
.crp-avatar--sm { width: 22px; height: 22px; font-size: 9.5px; }
.crp-avatar--empty { background: var(--color-surface-alt); color: var(--color-text-muted); border-style: dashed; }
.crp-chip { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 700; }
.crp-tag { display: inline-block; padding: 2px 8px; border-radius: var(--radius-sm); font-size: 11.5px; font-weight: 600; background: var(--color-accent-purple-bg); color: var(--color-accent-purple-fg); margin-right: 3px; }

/* ---------- Vue Table ---------- */
.crp-table-view { display: flex; flex-direction: column; gap: 22px; }
.crp-group { }
.crp-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.crp-group-collapse { border: none; background: none; cursor: pointer; color: var(--color-text-muted); padding: 2px; display: inline-flex; }
.crp-group-collapse svg { width: 16px; height: 16px; transition: transform 0.15s; }
.crp-group--collapsed .crp-group-collapse svg { transform: rotate(-90deg); }
.crp-group--collapsed .crp-table { display: none; }
.crp-group-dot { width: 12px; height: 12px; border-radius: 3px; }
.crp-group-name {
  border: none; background: transparent; font-family: var(--font-display);
  font-size: 17px; font-weight: 600; color: var(--grp, var(--color-text));
  padding: 2px 4px; border-radius: var(--radius-sm); outline: none; min-width: 120px;
}
.crp-group-name:focus { background: var(--color-surface-alt); }
.crp-group-count { font-size: 12px; color: var(--color-text-muted); }
.crp-group-del { margin-left: 4px; opacity: 0; }
.crp-group-head:hover .crp-group-del { opacity: 1; }

.crp-table {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}
.crp-table--dropzone { outline: 2px dashed var(--color-primary); outline-offset: -2px; }
.crp-tr {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--color-border);
  min-width: max-content;
}
.crp-tr:last-child { border-bottom: none; }
.crp-tr--head { background: var(--color-surface-alt); position: sticky; top: 0; }
.crp-tr--dragging { opacity: 0.4; }
.crp-tr:not(.crp-tr--head):not(.crp-tr--add):hover { background: var(--color-primary-light); }
.crp-th, .crp-td {
  padding: 0;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  border-right: 1px solid var(--color-border);
}
.crp-th {
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  user-select: none;
  gap: 5px;
}
.crp-th:hover { color: var(--color-text); }
.crp-th-ico { opacity: 0.6; }
.crp-th--title, .crp-td--title { flex: 1 1 320px; min-width: 260px; position: sticky; left: 0; background: inherit; z-index: 1; }
.crp-tr--head .crp-th--title { background: var(--color-surface-alt); }
.crp-td--title { background: var(--color-surface); }
.crp-tr:hover .crp-td--title { background: var(--color-primary-light); }
.crp-th--add, .crp-td--add { flex: 0 0 44px; justify-content: center; border-right: none; }
.crp-td { padding: 4px 8px; min-height: 42px; }

.crp-row-open {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  border: none; background: none; cursor: pointer; text-align: left;
  width: 100%; padding: 6px 8px; color: var(--color-text); font-family: var(--font-body);
}
.crp-row-title { font-size: 14.5px; font-weight: 500; }
.crp-row-badge {
  font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 20px;
  background: var(--color-surface-alt); color: var(--color-text-muted);
}
.crp-row-badge--over { background: var(--color-danger-light); color: var(--color-danger-dark); }
.crp-row-del { opacity: 0; }
.crp-tr:hover .crp-row-del { opacity: 1; }

.crp-tr--add { background: var(--color-surface); }
.crp-add-row {
  border: none; background: none; cursor: pointer; color: var(--color-text-muted);
  font-family: var(--font-body); font-size: 13.5px; font-weight: 600;
  padding: 10px 14px; display: inline-flex; align-items: center; gap: 6px; width: 100%;
}
.crp-add-row svg { width: 14px; height: 14px; }
.crp-add-row:hover { color: var(--color-primary); }
.crp-add-group {
  align-self: flex-start;
  border: 1.5px dashed var(--color-border); background: transparent;
  color: var(--color-text-muted); font-weight: 600; font-size: 13.5px;
  padding: 10px 16px; border-radius: var(--radius-lg); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.crp-add-group svg { width: 15px; height: 15px; }
.crp-add-group:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* Cellules éditables */
.crp-status {
  width: 100%; height: 34px; border: none; border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 12.5px; font-weight: 700; cursor: pointer;
  padding: 0 8px; transition: filter 0.12s;
}
.crp-status:hover { filter: brightness(0.94); }
.crp-person-cell { border: none; background: none; cursor: pointer; display: flex; align-items: center; padding: 4px; width: 100%; }
.crp-date-input, .crp-num-input, .crp-text-input {
  border: 1px solid transparent; background: transparent; border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 13.5px; color: var(--color-text);
  padding: 6px 8px; width: 100%; outline: none;
}
.crp-date-input:focus, .crp-num-input:focus, .crp-text-input:focus { border-color: var(--color-primary); background: var(--color-surface); }
.crp-date-input--over { color: var(--color-danger-dark); font-weight: 700; }
.crp-timeline-cell { border: none; background: none; cursor: pointer; font-size: 13px; color: var(--color-text); padding: 6px; width: 100%; text-align: left; }
.crp-tags-cell { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; padding: 4px; }
.crp-tag-add { border: none; background: var(--color-surface-alt); color: var(--color-text-muted); border-radius: var(--radius-sm); cursor: pointer; width: 20px; height: 20px; font-weight: 700; }
.crp-check-cell { display: flex; align-items: center; justify-content: center; width: 100%; cursor: pointer; }
.crp-check-cell input { width: 18px; height: 18px; cursor: pointer; accent-color: var(--color-primary); }

/* ---------- Menus contextuels ---------- */
.crp-menu {
  position: absolute;
  z-index: 9000;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
  padding: 6px;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: crp-pop 0.12s ease;
}
@keyframes crp-pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.crp-menu-opt {
  border: none; border-radius: var(--radius-sm); padding: 8px 10px; cursor: pointer;
  font-family: var(--font-body); font-size: 13px; font-weight: 700; text-align: left;
}
.crp-menu-opt:hover { filter: brightness(0.94); }
.crp-menu-opt--clear { background: var(--color-surface-alt); color: var(--color-text-muted); }
.crp-menu-add { border: 1px dashed var(--color-border); background: none; color: var(--color-text-muted); border-radius: var(--radius-sm); padding: 7px 10px; cursor: pointer; font-size: 12.5px; font-weight: 600; }
.crp-menu-add:hover { border-color: var(--color-primary); color: var(--color-primary); }
.crp-menu-person {
  display: flex; align-items: center; gap: 8px; border: none; background: none;
  padding: 6px 8px; border-radius: var(--radius-sm); cursor: pointer;
  font-family: var(--font-body); font-size: 13px; color: var(--color-text); text-align: left;
}
.crp-menu-person:hover { background: var(--color-surface-alt); }
.crp-menu-person--on { background: var(--color-primary-light); }
.crp-menu-check { margin-left: auto; color: var(--color-primary); display: inline-flex; }
.crp-menu-check svg { width: 14px; height: 14px; }

/* ---------- Vue Kanban ---------- */
.crp-kanban-groupby { font-size: 13px; color: var(--color-text-muted); margin-bottom: 12px; }
.crp-kanban-groupby select { border: 1.5px solid var(--color-border); background: var(--color-surface); border-radius: var(--radius-md); padding: 5px 8px; font-family: var(--font-body); color: var(--color-text); }
.crp-kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.crp-lane { flex: 0 0 288px; background: var(--color-surface-alt); border-radius: var(--radius-lg); padding: 10px; }
.crp-lane-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; }
.crp-lane-dot { width: 10px; height: 10px; border-radius: 3px; }
.crp-lane-label { font-weight: 700; font-size: 14px; color: var(--color-text); }
.crp-lane-count { font-size: 12px; color: var(--color-text-muted); background: var(--color-surface); border-radius: 20px; padding: 1px 8px; font-weight: 700; }
.crp-lane-body { display: flex; flex-direction: column; gap: 9px; min-height: 40px; border-radius: var(--radius-md); transition: background 0.12s; }
.crp-lane-body--over { background: var(--color-primary-light); outline: 2px dashed var(--color-primary); }
.crp-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: 11px; cursor: grab;
  box-shadow: var(--shadow-sm); transition: transform 0.12s, box-shadow 0.12s;
}
.crp-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.crp-card--dragging { opacity: 0.4; }
.crp-card-title { border: none; background: none; cursor: pointer; font-family: var(--font-body); font-size: 14px; font-weight: 600; color: var(--color-text); text-align: left; width: 100%; padding: 0; }
.crp-card-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.crp-card-due { font-size: 11.5px; font-weight: 600; color: var(--color-text-muted); }
.crp-card-due--over { color: var(--color-danger); }
.crp-card-sub { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.crp-card-subbar { flex: 1; height: 5px; background: var(--color-surface-alt); border-radius: 3px; overflow: hidden; }
.crp-card-subbar span { display: block; height: 100%; background: var(--cr-green); }
.crp-card-subtxt { font-size: 10.5px; color: var(--color-text-muted); font-weight: 700; }
.crp-card-foot { display: flex; margin-top: 9px; }
.crp-lane-add { border: none; background: none; color: var(--color-text-muted); cursor: pointer; font-size: 13px; font-weight: 600; padding: 8px 6px; display: inline-flex; align-items: center; gap: 5px; text-align: left; }
.crp-lane-add svg { width: 13px; height: 13px; }
.crp-lane-add:hover { color: var(--color-primary); }

/* ---------- Vue Calendrier ---------- */
.crp-cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.crp-cal-title { font-family: var(--font-display); font-size: 20px; margin: 0; min-width: 200px; }
.crp-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.crp-cal-dow { font-size: 11.5px; font-weight: 700; text-transform: uppercase; color: var(--color-text-muted); text-align: center; padding: 4px; }
.crp-cal-cell { min-height: 96px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.crp-cal-cell--empty { background: transparent; border: none; }
.crp-cal-cell--today { border-color: var(--color-primary); box-shadow: inset 0 0 0 1px var(--color-primary); }
.crp-cal-num { font-size: 12.5px; font-weight: 700; color: var(--color-text-muted); }
.crp-cal-cell--today .crp-cal-num { color: var(--color-primary); }
.crp-cal-evt { border: none; border-radius: var(--radius-sm); padding: 3px 6px; font-size: 11px; font-weight: 600; cursor: pointer; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Vue Timeline ---------- */
.crp-tl-view { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; }
.crp-tl-header, .crp-tl-row { display: flex; align-items: stretch; }
.crp-tl-header { border-bottom: 1px solid var(--color-border); background: var(--color-surface-alt); }
.crp-tl-label { flex: 0 0 220px; padding: 10px 14px; font-size: 13.5px; font-weight: 600; color: var(--color-text); border-right: 1px solid var(--color-border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crp-tl-label--head { font-size: 12px; text-transform: uppercase; color: var(--color-text-muted); font-weight: 700; }
.crp-tl-track { position: relative; flex: 1; min-height: 42px; min-width: 500px; }
.crp-tl-track--head { min-height: 34px; }
.crp-tl-tick { position: absolute; top: 0; bottom: 0; border-left: 1px dashed var(--color-border); }
.crp-tl-tick span { position: absolute; top: 8px; left: 4px; font-size: 10.5px; color: var(--color-text-muted); white-space: nowrap; }
.crp-tl-today { position: absolute; top: 0; bottom: 0; border-left: 2px solid var(--color-danger); z-index: 2; }
.crp-tl-today span { position: absolute; top: 2px; left: 4px; font-size: 10px; font-weight: 700; color: var(--color-danger); background: var(--color-surface); padding: 0 3px; }
.crp-tl-row { border-bottom: 1px solid var(--color-border); }
.crp-tl-row:last-child { border-bottom: none; }
.crp-tl-bar { position: absolute; top: 8px; height: 26px; border-radius: 13px; display: flex; align-items: center; padding: 0 10px; cursor: pointer; box-shadow: var(--shadow-sm); transition: filter 0.12s; min-width: 30px; }
.crp-tl-bar:hover { filter: brightness(0.95); }
.crp-tl-bar--over { outline: 2px solid var(--color-danger); }
.crp-tl-bar-txt { font-size: 11px; font-weight: 700; white-space: nowrap; }

/* ---------- Vue Dashboard ---------- */
.crp-dash { display: flex; flex-direction: column; gap: 20px; }
.crp-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.crp-kpi { background: var(--color-surface); border: 1px solid var(--color-border); border-left: 4px solid var(--kpi); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-sm); }
.crp-kpi-value { font-family: var(--font-display); font-size: 32px; font-weight: 600; color: var(--color-text); line-height: 1; }
.crp-kpi-label { font-size: 13px; font-weight: 700; color: var(--color-text); margin-top: 6px; }
.crp-kpi-sub { font-size: 12px; color: var(--color-text-muted); margin-top: 2px; }
.crp-dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.crp-dash-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-sm); }
.crp-dash-card h4 { margin: 0 0 14px; font-size: 14px; font-weight: 700; color: var(--color-text); }
.crp-donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.crp-donut { width: 130px; height: 130px; border-radius: 50%; position: relative; flex: 0 0 auto; }
.crp-donut-hole { position: absolute; inset: 26px; background: var(--color-surface); border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.crp-donut-hole span { font-family: var(--font-display); font-size: 26px; font-weight: 600; color: var(--color-text); }
.crp-donut-hole small { font-size: 10.5px; color: var(--color-text-muted); }
.crp-legend { display: flex; flex-direction: column; gap: 7px; }
.crp-legend-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--color-text); }
.crp-legend-dot { width: 11px; height: 11px; border-radius: 3px; }
.crp-wl { display: flex; flex-direction: column; gap: 9px; }
.crp-wl-row { display: flex; align-items: center; gap: 10px; }
.crp-wl-name { flex: 0 0 130px; font-size: 13px; color: var(--color-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crp-wl-bar { flex: 1; height: 10px; background: var(--color-surface-alt); border-radius: 6px; overflow: hidden; }
.crp-wl-bar span { display: block; height: 100%; border-radius: 6px; }
.crp-wl-n { flex: 0 0 auto; font-weight: 700; font-size: 13px; color: var(--color-text); min-width: 20px; text-align: right; }
.crp-progress-big { height: 16px; background: var(--color-surface-alt); border-radius: 8px; overflow: hidden; }
.crp-progress-fill { height: 100%; background: linear-gradient(90deg, var(--cr-blue), var(--cr-green)); border-radius: 8px; transition: width 0.4s; }
.crp-progress-caption { font-size: 13px; color: var(--color-text-muted); margin: 10px 0 0; }

/* ---------- Panneaux (réglages / automatisations) ---------- */
.crp-panel { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); margin-bottom: 16px; box-shadow: var(--shadow-md); overflow: hidden; }
.crp-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--color-border); background: var(--color-surface-alt); }
.crp-panel-head h3 { margin: 0; font-size: 15px; display: inline-flex; align-items: center; gap: 8px; }
.crp-panel-head h3 svg { width: 17px; height: 17px; }
.crp-panel-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.crp-panel-body h4 { margin: 6px 0 0; font-size: 13px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--color-text-muted); }
.crp-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--color-text); }
.crp-field input { border: 1.5px solid var(--color-border); background: var(--color-surface); border-radius: var(--radius-md); padding: 8px 10px; font-family: var(--font-body); font-size: 14px; color: var(--color-text); }
.crp-set-cols { display: flex; flex-direction: column; gap: 6px; }
.crp-set-col { display: flex; align-items: center; gap: 8px; padding: 6px; background: var(--color-surface-alt); border-radius: var(--radius-md); }
.crp-set-col-ico { width: 22px; text-align: center; color: var(--color-text-muted); }
.crp-set-col-name { flex: 1; border: 1px solid transparent; background: transparent; border-radius: var(--radius-sm); padding: 6px; font-family: var(--font-body); font-size: 14px; color: var(--color-text); }
.crp-set-col-name:focus { border-color: var(--color-primary); background: var(--color-surface); outline: none; }
.crp-set-col-type { font-size: 12px; color: var(--color-text-muted); }
.crp-add-col { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crp-add-col input { flex: 1; min-width: 160px; border: 1.5px solid var(--color-border); background: var(--color-surface); border-radius: var(--radius-md); padding: 8px 10px; font-family: var(--font-body); font-size: 14px; color: var(--color-text); }
.crp-add-col select { border: 1.5px solid var(--color-border); background: var(--color-surface); border-radius: var(--radius-md); padding: 8px 10px; font-family: var(--font-body); color: var(--color-text); }
.crp-panel-danger { margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--color-border); }

/* Automatisations */
.crp-auto-list { display: flex; flex-direction: column; gap: 8px; }
.crp-auto-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--color-surface-alt); border-radius: var(--radius-md); }
.crp-auto-row--off { opacity: 0.55; }
.crp-auto-text { flex: 1; display: flex; flex-direction: column; }
.crp-auto-text b { font-size: 13.5px; color: var(--color-text); }
.crp-auto-text span { font-size: 12.5px; color: var(--color-text-muted); }
.crp-switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: 0 0 auto; }
.crp-switch input { opacity: 0; width: 0; height: 0; }
.crp-switch span { position: absolute; inset: 0; background: var(--color-border); border-radius: 22px; cursor: pointer; transition: 0.2s; }
.crp-switch span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: 0.2s; }
.crp-switch input:checked + span { background: var(--cr-green); }
.crp-switch input:checked + span::before { transform: translateX(18px); }
.crp-auto-builder { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1.5px dashed var(--color-border); border-radius: var(--radius-md); }
.crp-auto-builder input, .crp-auto-builder select { border: 1.5px solid var(--color-border); background: var(--color-surface); border-radius: var(--radius-md); padding: 7px 10px; font-family: var(--font-body); font-size: 13.5px; color: var(--color-text); }
.crp-auto-builder-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.crp-auto-builder-row > span { font-weight: 700; font-size: 13px; color: var(--color-text-muted); min-width: 40px; }
.crp-auto-builder-row select { flex: 1; min-width: 150px; }

/* ---------- Drawer (détail tâche) ---------- */
.crp-drawer-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0); z-index: 9500; transition: background 0.25s; pointer-events: none; }
.crp-drawer-overlay--open { background: rgba(0, 0, 0, 0.4); pointer-events: auto; }
.crp-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 96vw);
  background: var(--color-bg); z-index: 9600; box-shadow: -12px 0 40px rgba(0, 0, 0, 0.2);
  transform: translateX(100%); transition: transform 0.28s cubic-bezier(0.3, 0.9, 0.3, 1);
  display: flex; flex-direction: column;
}
.crp-drawer--open { transform: translateX(0); }
.crp-dw-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--color-border); background: var(--color-surface); }
.crp-dw-title { flex: 1; border: 1px solid transparent; background: transparent; font-family: var(--font-display); font-size: 20px; font-weight: 600; color: var(--color-text); padding: 4px 8px; border-radius: var(--radius-sm); outline: none; }
.crp-dw-title:focus { border-color: var(--color-primary); background: var(--color-bg); }
.crp-dw-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 22px; }
.crp-dw-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.crp-dw-field { display: flex; flex-direction: column; gap: 5px; }
.crp-dw-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--color-text-muted); }
.crp-dw-ico { opacity: 0.6; }
.crp-dw-value { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); min-height: 40px; display: flex; align-items: center; padding: 2px 4px; }
.crp-dw-value .crp-status { height: 30px; }
.crp-dw-section h4 { font-size: 14px; font-weight: 700; color: var(--color-text); margin: 0 0 10px; display: flex; align-items: center; gap: 7px; }
.crp-dw-section h4 svg { width: 16px; height: 16px; }
.crp-dw-progress { margin-left: auto; font-size: 12px; color: var(--cr-green); font-weight: 700; }
.crp-sub-bar { height: 6px; background: var(--color-surface-alt); border-radius: 3px; overflow: hidden; margin-bottom: 10px; }
.crp-sub-bar span { display: block; height: 100%; background: var(--cr-green); transition: width 0.3s; }
.crp-subs { display: flex; flex-direction: column; gap: 4px; }
.crp-sub-row { display: flex; align-items: center; gap: 8px; padding: 4px; border-radius: var(--radius-sm); }
.crp-sub-row:hover { background: var(--color-surface); }
.crp-sub-title { flex: 1; border: 1px solid transparent; background: transparent; font-family: var(--font-body); font-size: 14px; color: var(--color-text); padding: 5px 7px; border-radius: var(--radius-sm); outline: none; }
.crp-sub-title:focus { border-color: var(--color-primary); background: var(--color-surface); }
.crp-sub-title--done { text-decoration: line-through; color: var(--color-text-muted); }
.crp-sub-add { display: flex; gap: 6px; margin-top: 8px; }
.crp-sub-add input { flex: 1; border: 1.5px solid var(--color-border); background: var(--color-surface); border-radius: var(--radius-md); padding: 8px 10px; font-family: var(--font-body); font-size: 14px; color: var(--color-text); }
.crp-cm-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.crp-cm { background: var(--color-surface); border-radius: var(--radius-md); padding: 10px 12px; }
.crp-cm-head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.crp-cm-head b { font-size: 13px; color: var(--color-text); }
.crp-cm-ts { margin-left: auto; font-size: 11px; color: var(--color-text-muted); }
.crp-cm-body { font-size: 13.5px; color: var(--color-text); white-space: pre-wrap; line-height: 1.45; }
.crp-cm-add { display: flex; flex-direction: column; gap: 8px; }
.crp-cm-add textarea { border: 1.5px solid var(--color-border); background: var(--color-surface); border-radius: var(--radius-md); padding: 10px; font-family: var(--font-body); font-size: 14px; color: var(--color-text); min-height: 70px; resize: vertical; outline: none; }
.crp-cm-add textarea:focus { border-color: var(--color-primary); }
.crp-cm-add .crp-btn { align-self: flex-end; }
.crp-act { display: flex; flex-direction: column; gap: 8px; }
.crp-act-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.crp-act-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--color-primary); flex: 0 0 auto; }
.crp-act-text { color: var(--color-text); }
.crp-act-ts { margin-left: auto; color: var(--color-text-muted); white-space: nowrap; }

/* ---------- États vides ---------- */
.crp-empty, .crp-empty-view { text-align: center; padding: 60px 20px; color: var(--color-text-muted); }
.crp-empty-icon { font-size: 48px; margin-bottom: 12px; }
.crp-empty h2 { font-family: var(--font-display); color: var(--color-text); margin: 0 0 8px; }
.crp-empty-view { background: var(--color-surface); border: 1.5px dashed var(--color-border); border-radius: var(--radius-lg); }

.crp-fallback-header { padding: 14px 20px; border-bottom: 1px solid var(--color-border); }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .crp-dw-fields { grid-template-columns: 1fr; }
  .crp-toolbar { flex-direction: column; align-items: stretch; }
  .crp-tools { justify-content: space-between; }
  .crp-search input { width: 100%; }
  .crp-th--title, .crp-td--title { min-width: 200px; flex-basis: 200px; }
}

/* ---------- Mode nuit : ajustements fins ---------- */
html[data-theme="dark"] .crp-tab-count { background: rgba(255, 255, 255, 0.12); }
html[data-theme="dark"] .crp-donut-hole { background: var(--color-surface); }
html[data-theme="dark"] .crp-menu { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
html[data-theme="dark"] .crp-avatar { border-color: var(--color-surface); }
