.tasks-tab { padding: 0; height: 100%; display: flex; flex-direction: column; }

/* ===== Layout sidebar + main ===== */
.tasks-layout { display: grid; grid-template-columns: 260px 1fr; flex: 1; min-height: 0; transition: grid-template-columns .2s; }
.tasks-layout.sidebar-hidden { grid-template-columns: 0 1fr; }
.tasks-layout.sidebar-hidden #tasks-sidebar { visibility: hidden; border-right: none; }

#tasks-sidebar {
  background: rgba(20, 20, 23, .25);
  border-right: 1px solid rgba(255, 255, 255, .1);
  overflow-y: auto;
  backdrop-filter: blur(24px) saturate(180%);
}
#tasks-tree { list-style: none; margin: 0; padding: .4rem 0; }
#tasks-tree .tree-cat {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .85rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, .03);
  transition: background .12s;
  font-size: .82rem;
}
#tasks-tree .tree-cat:hover { background: rgba(var(--p-base-rgb), .07); }
#tasks-tree .tree-cat.active {
  background: rgba(var(--p-glow-rgb), .12);
  box-shadow: inset 2px 0 0 var(--p-base);
}
#tasks-tree .tree-cat.active .tc-label { color: var(--p-base); font-weight: 500; }
#tasks-tree .tc-icon {
  flex-shrink: 0; opacity: .75;
  width: 22px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--p-base);
}
#tasks-tree .tree-cat:hover .tc-icon { opacity: .95; }
#tasks-tree .tree-cat.active .tc-icon { opacity: 1; }
#tasks-tree .tc-label { color: #e4e4e7; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#tasks-tree .tc-badges { display: flex; gap: .22rem; align-items: center; flex-shrink: 0; }
#tasks-tree .tc-b {
  font-size: .6rem; font-weight: 700;
  padding: .05rem .32rem; border-radius: 3px; border: 1px solid;
  min-width: 18px; text-align: center; line-height: 1.2;
}
#tasks-tree .tc-b.overdue { color: var(--v2); border-color: var(--v2); background: rgba(var(--v2-rgb),.12); }
#tasks-tree .tc-b.due     { color: #fb923c; border-color: #fb923c; background: rgba(251,146,60,.12); }
#tasks-tree .tc-b.never   { color: #94a3b8; border-color: #64748b; background: rgba(100,116,139,.1); }
#tasks-tree .tc-count { color: #64748b; font-size: .7rem; font-family: 'Menlo','Consolas',monospace; }

#tasks-main { display: flex; flex-direction: column; background: transparent; position: relative; overflow: hidden; min-height: 0; }
#tasks-main .sidebar-handle {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 12px; height: 64px;
  background: rgba(39, 39, 42, .55);
  border: 1px solid rgba(255, 255, 255, .08); border-left: none;
  border-radius: 0 6px 6px 0;
  color: var(--p-light);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: .9rem; line-height: 1; padding: 0; z-index: 10;
  backdrop-filter: blur(15px);
}
#tasks-main .sidebar-handle:hover { background: rgba(var(--p-base-rgb), .18); color: var(--p-base); }
#tasks-main #tasks-list { flex: 1; overflow-y: auto; padding: .5rem .9rem; }

.tasks-toolbar button.t-btn.danger { background: rgba(239, 68, 68, .12); border-color: rgba(var(--v2-rgb), .4); color: #fecaca; }
.tasks-toolbar button.t-btn.danger:hover:not(:disabled) { background: rgba(239, 68, 68, .22); }

.tasks-toolbar {
  display: flex; gap: .7rem; align-items: center;
  padding: .55rem .9rem;
  background: rgba(24, 24, 27, .22);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  flex-wrap: wrap;
  backdrop-filter: blur(24px) saturate(180%);
}
.tasks-toolbar label { font-size: .82rem; color: #d4d4d8; display: flex; align-items: center; gap: .3rem; }
.tasks-toolbar select,
.tasks-toolbar input:not([type="checkbox"]):not([type="radio"]),
.tasks-toolbar button {
  background: rgba(39, 39, 42, .45); color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 6px; padding: .22rem .55rem; font-size: .82rem;
}
.tasks-toolbar input[type="search"] { min-width: 200px; font-family: inherit; }
.tasks-toolbar .tasks-stats {
  margin-left: auto;
  font-family: 'Menlo','Consolas',monospace;
  font-size: .8rem; font-weight: 600;
  display: flex; gap: .4rem;
}
.tasks-toolbar .tasks-stats .stat { padding: .1rem .45rem; border-radius: 3px; border: 1px solid; }
.tasks-toolbar .tasks-stats .stat.idle    { color: #94a3b8; border-color: #64748b; background: rgba(100,116,139,.1); }
.tasks-toolbar .tasks-stats .stat.running { color: var(--p-base); border-color: var(--p-base); background: rgba(var(--p-base-rgb),.12); animation: t-pulse 1.6s ease-in-out infinite; }
.tasks-toolbar .tasks-stats .stat.ok      { color: var(--v4); border-color: var(--v4); background: rgba(var(--v4-rgb),.1); }
.tasks-toolbar .tasks-stats .stat.error   { color: var(--v2); border-color: var(--v2); background: rgba(var(--v2-rgb),.12); }
@keyframes t-pulse { 0%,100%{opacity:1;} 50%{opacity:.5;} }

.tasks-list { flex: 1; overflow-y: auto; padding: .85rem 1.1rem; display: flex; flex-direction: column; gap: .6rem; }
.tasks-empty { color: #64748b; font-style: italic; text-align: center; padding: 2rem 0; }

/* Groupe */
.tasks-group { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .6rem; }
.tasks-group-header {
  display: flex; align-items: baseline; gap: .5rem;
  width: 100%; background: transparent; border: none;
  border-bottom: 1px solid rgba(var(--p-base-rgb), .18);
  cursor: pointer;
  font-size: .72rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--p-light); padding: .1rem .2rem .3rem;
  text-align: left; font-family: inherit;
  transition: background .12s;
}
.tasks-group-header:hover { background: rgba(var(--p-base-rgb), .06); }
.tasks-group-header .g-chevron {
  display: inline-block; width: 12px;
  color: var(--p-base); font-size: .72rem;
  transition: transform .15s; line-height: 1;
}
.tasks-group.collapsed .g-chevron { transform: rotate(-90deg); }
.tasks-group-header .g-name { font-weight: 600; color: var(--p-base); }
.tasks-group-header .g-count { color: #64748b; font-size: .68rem; margin-left: auto; }
.tasks-group-items { display: flex; flex-direction: column; gap: .6rem; }
.tasks-group.collapsed .tasks-group-items { display: none; }

/* Card — chrome .card-pri (ref design Vincent 2026-04-29)
   Inactivé (disabled) → --p-base éteint .5. Activé non-running → --p-base plein.
   Running → vert pulsé. Error → rouge. Killed → orange. */
.task-card {
  --card-rgb: var(--p-base-rgb);
  display: flex; flex-direction: column;
  border-radius: 8px;
  border-top:    1px solid rgba(var(--card-rgb), .4);
  border-right:  1px solid rgba(var(--card-rgb), .4);
  border-bottom: 1px solid rgba(var(--card-rgb), .4);
  border-left:   2px solid rgba(var(--card-rgb), .9);
  background:
    radial-gradient(circle at top right, rgba(var(--card-rgb), .14), transparent 60%),
    linear-gradient(135deg, rgba(var(--card-rgb), .1) 0%, rgba(var(--card-rgb), .03) 50%, rgba(24, 24, 27, .55) 100%);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  box-shadow: inset 8px 0 14px -8px rgba(var(--card-rgb), .55), inset 0 1px 0 rgba(255, 255, 255, .08), 0 4px 18px rgba(0, 0, 0, .28);
  transition: opacity .2s, border-color .2s, box-shadow .2s;
}
/* Phase D : task running pulse en couleur principale (rosé) — luminosité+border */
.task-card.state-running { animation: card-pulse-running 1.6s ease-in-out infinite; }
@keyframes card-pulse-running {
  0%, 100% { box-shadow: 0 0 6px rgba(var(--p-base-rgb), .45), 0 0 12px rgba(var(--p-glow-rgb), .25); border-color: rgba(var(--p-base-rgb), .55); background-color: rgba(var(--p-base-rgb), .04); }
  50%      { box-shadow: 0 0 14px rgba(var(--p-base-rgb), .9), 0 0 24px rgba(var(--p-glow-rgb), .55); border-color: rgba(var(--p-base-rgb), 1); background-color: rgba(var(--p-base-rgb), .12); }
}
.task-card.state-error   { --card-rgb: var(--c-state-alarm-rgb); }
.task-card.state-killed  { --card-rgb: var(--c-state-alert-rgb); }
.task-card.disabled      { opacity: .5; }
.task-card.paused        { opacity: .6; border-style: dashed; }

.tk-row {
  display: grid;
  grid-template-columns: 36px auto auto auto 1fr auto auto auto;
  align-items: center;
  gap: .55rem;
  padding: .4rem .7rem;
  cursor: pointer;
}

.tk-state {
  font-size: .62rem; text-transform: uppercase; font-weight: 700; letter-spacing: .04em;
  padding: .1rem .4rem; border-radius: 3px; border: 1px solid; font-family: 'Menlo','Consolas',monospace;
  min-width: 68px; text-align: center; box-sizing: border-box; line-height: 1.3;
}
.tk-state.idle    { color: #94a3b8; border-color: #64748b; background: rgba(100,116,139,.1); }
.tk-state.running { color: var(--p-base); border-color: var(--p-base); background: rgba(var(--p-base-rgb),.12); }
.tk-state.ok      { color: var(--v4); border-color: var(--v4); background: rgba(var(--v4-rgb),.1); }
.tk-state.error   { color: var(--v2); border-color: var(--v2); background: rgba(var(--v2-rgb),.12); }
.tk-state.killed  { color: #fb923c; border-color: #fb923c; background: rgba(251,146,60,.12); }

.tk-ref { color: #64748b; font-family: 'Menlo','Consolas',monospace; font-size: .7rem; font-weight: 600; letter-spacing: .02em; }

.tk-dry {
  font-size: .58rem; text-transform: uppercase; font-weight: 700;
  padding: .06rem .35rem; border-radius: 3px;
  background: rgba(251,146,60,.12); color: #fb923c; border: 1px solid #fb923c;
  font-family: 'Menlo','Consolas',monospace;
}

.tk-title { color: #e4e4e7; font-weight: 500; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tk-title .tk-cat { color: var(--p-light); font-size: .7rem; font-family: 'Menlo','Consolas',monospace; margin-right: .4rem; padding: 0 .3rem; border-radius: 3px; background: rgba(var(--p-base-rgb),.08); border: 1px solid rgba(var(--p-base-rgb),.2); }

.tk-next, .tk-last { color: #94a3b8; font-family: 'Menlo','Consolas',monospace; font-size: .72rem; min-width: 84px; text-align: right; }
.tk-next .l { color: #64748b; margin-right: .25rem; text-transform: uppercase; font-size: .62rem; }
.tk-last .l { color: #64748b; margin-right: .25rem; text-transform: uppercase; font-size: .62rem; }

.tk-spark { width: 64px; height: 22px; flex-shrink: 0; }

/* ===== Toggle switch activation permanente ===== */
.tk-toggle {
  -webkit-appearance: none; appearance: none;
  background: transparent; border: none; padding: 0;
  cursor: pointer;
  display: inline-flex; align-items: center;
  width: 32px; height: 18px;
  outline: none;
}
.tk-toggle .tg-track {
  position: relative;
  width: 32px; height: 18px;
  border-radius: 999px;
  background: rgba(24, 24, 27, .65);
  border: 1px solid rgba(100, 116, 139, .45);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .4);
  transition: background .18s, border-color .18s, box-shadow .18s;
}
.tk-toggle .tg-knob {
  position: absolute;
  top: 50%; left: 3px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #64748b;
  transform: translateY(-50%);
  transition: left .18s cubic-bezier(.4, 0, .2, 1), background .18s, box-shadow .18s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}
.tk-toggle.on .tg-track {
  background: linear-gradient(135deg, rgba(var(--p-base-rgb), .35), rgba(var(--p-glow-rgb), .22));
  border-color: var(--p-base);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35), 0 0 6px rgba(var(--p-glow-rgb), .35);
}
.tk-toggle.on .tg-knob {
  left: 17px;
  background: var(--p-base);
  box-shadow: 0 0 6px rgba(var(--p-glow-rgb), .7), 0 1px 2px rgba(0, 0, 0, .4);
}
.tk-toggle:hover:not(:disabled) .tg-track { border-color: rgba(var(--p-base-rgb), .7); }
.tk-toggle:hover:not(:disabled).on .tg-track { box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35), 0 0 10px rgba(var(--p-glow-rgb), .55); }
.tk-toggle:focus-visible .tg-track { box-shadow: 0 0 0 2px rgba(var(--p-base-rgb), .4); }
.tk-toggle:active .tg-knob { width: 14px; }

/* ===== Expand ===== */
.tk-expand {
  display: none;
  padding: .7rem .9rem 1rem;
  border-top: 1px solid rgba(255,255,255,.08);
  gap: .7rem; flex-direction: column;
  font-size: .84rem;
}
.task-card.expanded .tk-expand { display: flex; }

.tk-sec h4 { margin: 0 0 .3rem; font-size: .7rem; color: var(--p-light); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.tk-desc { color: #d4d4d8; line-height: 1.5; white-space: pre-wrap; }
.tk-advice {
  color: #fed7aa; font-size: .82rem; line-height: 1.5;
  padding: .4rem .6rem; background: rgba(251, 146, 60, .08);
  border-left: 2px solid #fb923c; border-radius: 0 4px 4px 0;
}
.tk-script {
  padding: .4rem .6rem; background: rgba(0,0,0,.25);
  border-left: 2px solid rgba(255,255,255,.08); border-radius: 0 4px 4px 0;
  font-family: 'Menlo','Consolas',monospace; font-size: .76rem; color: #cbd5e1;
  white-space: pre-wrap; word-break: break-word;
}

.tk-meta-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .3rem .8rem; font-size: .76rem; font-family: 'Menlo','Consolas',monospace;
}
.tk-meta-grid .k { color: #64748b; }
.tk-meta-grid .v { color: #d4d4d8; }
.tk-meta-grid .v.mono { color: var(--p-light); }

/* Triggers */
.tk-triggers { display: flex; flex-direction: column; gap: .3rem; }
.tk-trigger {
  display: grid; grid-template-columns: auto auto 1fr auto auto;
  gap: .45rem; align-items: center;
  padding: .3rem .55rem;
  background: rgba(0, 0, 0, .22);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 5px; font-family: 'Menlo','Consolas',monospace; font-size: .74rem;
}
.tk-trigger.off { opacity: .5; }
.tk-trigger .tr-type {
  padding: .1rem .4rem; border-radius: 3px;
  font-size: .64rem; text-transform: uppercase; font-weight: 700; letter-spacing: .04em;
  min-width: 64px; text-align: center; border: 1px solid;
  color: var(--p-light); background: rgba(var(--p-base-rgb),.1); border-color: rgba(var(--p-base-rgb),.3);
}
.tk-trigger .tr-params { color: #cbd5e1; }
.tk-trigger .tr-fired { color: #64748b; font-size: .66rem; }

/* Actions */
.tk-actions { display: flex; flex-wrap: wrap; gap: .4rem; padding-top: .4rem; border-top: 1px dashed rgba(255, 255, 255, .06); }
.tk-actions .t-btn {
  background: rgba(39, 39, 42, .5); color: #e4e4e7;
  border: 1px solid rgba(255, 255, 255, .1); border-radius: 6px;
  padding: .3rem .65rem; font-size: .78rem; cursor: pointer;
}
.tk-actions .t-btn:hover:not(:disabled) { background: rgba(63, 63, 70, .65); border-color: rgba(var(--p-base-rgb), .3); }
.tk-actions .t-btn:disabled { opacity: .4; cursor: not-allowed; }
.tk-actions .t-btn.primary {
  background: linear-gradient(135deg, rgba(var(--p-base-rgb), .85), rgba(var(--p-glow-rgb), .75));
  color: var(--p-text-on); border-color: rgba(var(--p-soft-rgb), .8); font-weight: 600;
}
.tk-actions .t-btn.danger { color: #fca5a5; border-color: rgba(239, 68, 68, .3); }
.tk-actions .t-btn.danger:hover:not(:disabled) { background: rgba(239, 68, 68, .15); }

/* Live logs viewer */
.tk-logviewer {
  padding: .4rem .6rem;
  background: #0a0a0c;
  border: 1px solid rgba(var(--p-base-rgb), .2);
  border-radius: 6px;
  font-family: 'Menlo','Consolas',monospace; font-size: .72rem;
  color: #cbd5e1;
  white-space: pre-wrap; word-break: break-word;
  max-height: 280px; overflow-y: auto;
  line-height: 1.45;
}
.tk-logviewer .l-out { color: #cbd5e1; }
.tk-logviewer .l-err { color: #fca5a5; }

/* Runs history compact */
.tk-runs { display: flex; flex-direction: column; gap: .2rem; font-family: 'Menlo','Consolas',monospace; font-size: .74rem; }
.tk-runs .run {
  display: grid; grid-template-columns: auto auto 70px 1fr;
  gap: .5rem; padding: .2rem .4rem;
  border-left: 2px solid transparent;
}
.tk-runs .run.s-ok     { border-left-color: var(--v4); }
.tk-runs .run.s-error  { border-left-color: var(--v2); }
.tk-runs .run.s-killed { border-left-color: #fb923c; }
.tk-runs .run .s-ts  { color: #64748b; font-size: .7rem; }
.tk-runs .run .s-dur { color: #94a3b8; font-size: .7rem; text-align: right; }
.tk-runs .run .s-by  { color: var(--p-light); font-size: .68rem; }

/* Modal édition task : large + scrollable, layout 2 col + taille fixe */
.surv-modal .modal {
  max-width: 880px !important;
  width: 94vw !important;
  height: 88vh !important;
  max-height: 90vh !important;
  display: flex; flex-direction: column;
  padding: 1.2rem 1.3rem !important;
}
.surv-modal .modal > h2 { flex-shrink: 0; margin: 0 0 .8rem; }
.surv-modal .modal .todo-modal {
  flex: 1 1 auto;
  overflow-y: auto;
  padding-right: .4rem;
  margin-right: -.4rem;
}
.surv-modal .modal .todo-modal::-webkit-scrollbar { width: 8px; }
.surv-modal .modal .todo-modal::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 4px; }
.surv-modal .modal .todo-modal::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.22); }

/* Grid 2 colonnes pour les champs */
.surv-modal .todo-modal .tm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem .85rem;
  margin-bottom: .7rem;
}
.surv-modal .todo-modal .tm-grid .tm-row { margin: 0; }
.surv-modal .todo-modal .tm-full { grid-column: 1 / -1; }
.surv-modal .todo-modal .tm-row { display: flex; flex-direction: column; gap: .2rem; margin-bottom: .55rem; }
.surv-modal .todo-modal .tm-row > label {
  font-size: .7rem; color: #94a3b8;
  text-transform: uppercase; letter-spacing: .05em;
}
.surv-modal .todo-modal .tm-row input[type="text"],
.surv-modal .todo-modal .tm-row input[type="number"],
.surv-modal .todo-modal .tm-row input:not([type]),
.surv-modal .todo-modal .tm-row select,
.surv-modal .todo-modal .tm-row textarea {
  background: rgba(39, 39, 42, .5);
  color: #e4e4e7;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 5px;
  padding: .35rem .55rem;
  font-size: .83rem;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}
.surv-modal .todo-modal .tm-row textarea { resize: vertical; min-height: 48px; font-size: .8rem; line-height: 1.45; }
.surv-modal .todo-modal .tm-row input:focus,
.surv-modal .todo-modal .tm-row select:focus,
.surv-modal .todo-modal .tm-row textarea:focus {
  outline: none; border-color: var(--p-base);
  box-shadow: 0 0 0 2px rgba(var(--p-base-rgb), .18);
}
.surv-modal .todo-modal .tm-check {
  flex-direction: row !important;
  align-items: center; gap: .45rem;
  padding: .35rem 0;
}
.surv-modal .todo-modal .tm-check > label {
  color: #d4d4d8 !important; font-size: .82rem !important;
  text-transform: none !important; letter-spacing: normal !important;
}
/* Override explicite : annule les styles génériques .todo-modal input qui forçaient
   width:100% + padding sur les checkboxes (→ rendu "barre orange") */
.surv-modal .todo-modal input[type="checkbox"],
.surv-modal .todo-modal input[type="radio"] {
  width: 14px !important;
  height: 14px !important;
  padding: 0 !important;
  margin: 0 !important;
  flex-shrink: 0;
}
.surv-modal .todo-modal input[type="checkbox"] { border-radius: 3px !important; }
.surv-modal .todo-modal input[type="radio"]    { border-radius: 50% !important; }
.surv-modal .todo-modal h3.tm-section {
  margin: 1rem 0 .5rem;
  padding-top: .7rem;
  border-top: 1px solid rgba(255, 255, 255, .08);
  color: var(--p-light); font-size: .8rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
}
.surv-modal .todo-modal h3.tm-section:first-child { border-top: none; padding-top: 0; margin-top: 0; }

/* Barre d'actions fixe en bas */
.surv-modal .modal .tm-actions {
  flex-shrink: 0;
  display: flex; gap: .5rem; justify-content: flex-end; align-items: center;
  padding-top: .8rem; margin-top: .6rem;
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.surv-modal .modal .tm-err {
  flex-shrink: 0;
  color: #fecaca; font-size: .8rem;
  padding: .4rem .6rem; margin-top: .5rem;
  background: rgba(239,68,68,.1);
  border-left: 2px solid var(--v2);
  border-radius: 0 4px 4px 0;
}

/* ===== Expand — header riche (style runbook repris d'Actions) ===== */
.task-card .tk-hero {
  padding: .9rem 1rem;
  margin: -.3rem -.75rem .8rem;
  border-bottom: 1px solid rgba(var(--p-base-rgb), .22);
  background: linear-gradient(180deg, rgba(var(--p-base-rgb), .05), transparent);
}
.task-card .tk-h-meta {
  display: flex; gap: .4rem; flex-wrap: wrap; align-items: center;
  font-size: .7rem; font-family: 'Menlo','Consolas',monospace;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--p-light); margin-bottom: .35rem;
}
.task-card .tk-h-cat { color: var(--p-base); font-weight: 600; }
.task-card .tk-h-ref { color: #64748b; font-weight: 500; }
.task-card .tk-h-due {
  padding: .12rem .45rem; border-radius: 3px; border: 1px solid;
  font-weight: 700; font-size: .66rem; min-width: 64px; text-align: center;
}
.task-card .tk-h-due.ok         { color: var(--v4); border-color: var(--v4); background: rgba(var(--v4-rgb), .1); }
.task-card .tk-h-due.due        { color: #fb923c; border-color: #fb923c; background: rgba(251,146,60,.12); }
.task-card .tk-h-due.overdue    { color: var(--v2); border-color: var(--v2); background: rgba(var(--v2-rgb), .12); }
.task-card .tk-h-due.never_run  { color: #94a3b8; border-color: #64748b; background: rgba(100,116,139,.1); }
.task-card .tk-h-due.on_demand  { color: var(--p-light); border-color: rgba(var(--p-light-rgb),.4); }
.task-card .tk-h-due.scheduled  { color: var(--v3); border-color: var(--v3); background: rgba(var(--v3-rgb),.1); }
.task-card .tk-h-mode {
  padding: .1rem .4rem; border-radius: 3px; border: 1px solid;
  font-size: .64rem; font-weight: 600;
}
.task-card .tk-h-mode.inter { color: var(--p-light); border-color: rgba(var(--p-light-rgb),.5); }
.task-card .tk-h-mode.admin { color: var(--v2); border-color: var(--v2); background: rgba(var(--v2-rgb),.08); }
.task-card .tk-h-off {
  color: #94a3b8; border: 1px solid #64748b;
  padding: .08rem .38rem; border-radius: 3px; font-size: .64rem; font-weight: 600;
}
.task-card .tk-h-title {
  margin: .15rem 0 .5rem; color: var(--p-base);
  font-size: 1.15rem; font-weight: 700; line-height: 1.25;
  display: flex; align-items: center; gap: .45rem;
}
.task-card .tk-h-icon { font-size: 1.05rem; }
.task-card .tk-h-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .2rem .7rem; font-size: .74rem; font-family: 'Menlo','Consolas',monospace;
}
.task-card .tk-h-grid .k { color: #64748b; }
.task-card .tk-h-grid .v { color: #d4d4d8; }
.task-card .tk-h-grid .v.mono { color: var(--p-light); }

/* ===== Sections narratives ===== */
.task-card .tk-section { margin: 0 0 .9rem; }
.task-card .tk-section > h4 {
  margin: 0 0 .4rem;
  font-size: .75rem; color: var(--p-light);
  text-transform: uppercase; letter-spacing: .08em; font-weight: 600;
}
.task-card .tk-desc { color: #d4d4d8; line-height: 1.55; font-size: .85rem; white-space: pre-wrap; }
.task-card .tk-risks {
  color: #fecaca; font-size: .85rem; line-height: 1.5;
  padding: .6rem .9rem;
  background: rgba(239, 68, 68, .08);
  border-left: 3px solid var(--v2);
  border-radius: 0 5px 5px 0; white-space: pre-wrap;
}
.task-card .tk-prereq {
  color: #fed7aa; font-size: .82rem; line-height: 1.5;
  padding: .5rem .8rem;
  background: rgba(251, 146, 60, .08);
  border-left: 3px solid #fb923c;
  border-radius: 0 5px 5px 0; white-space: pre-wrap;
}
.task-card .tk-advice {
  color: #bae6fd; font-size: .82rem; line-height: 1.5;
  padding: .45rem .75rem;
  background: rgba(56, 189, 248, .07);
  border-left: 3px solid var(--v3);
  border-radius: 0 4px 4px 0;
}

/* Config technique en accordéon discret */
.task-card details.tk-tech {
  border: 1px dashed rgba(255,255,255,.08);
  border-radius: 5px;
  padding: .4rem .7rem;
  background: rgba(0,0,0,.12);
}
.task-card details.tk-tech summary {
  cursor: pointer; list-style: none;
  padding: .1rem 0; user-select: none;
  color: var(--p-light);
}
.task-card details.tk-tech summary::-webkit-details-marker { display: none; }
.task-card details.tk-tech summary::before {
  content: '▸'; margin-right: .4rem; display: inline-block;
  transition: transform .15s; color: var(--p-light);
}
.task-card details.tk-tech[open] summary::before { transform: rotate(90deg); }
.task-card details.tk-tech summary h4 { margin: 0; display: inline-block; }
.task-card .tk-subsec { margin: .5rem 0 .3rem; }
.task-card .tk-subsec .k-label {
  font-size: .68rem; color: #64748b; text-transform: uppercase;
  letter-spacing: .06em; margin-bottom: .25rem; font-weight: 600;
}

/* Bouton primary en état "blocked" (runbook doc / mode insuffisant / script missing) */
.tk-actions .t-btn.is-blocked {
  opacity: .45; cursor: help;
  background: rgba(39, 39, 42, .35);
  color: #a1a1aa;
  border-style: dashed;
  box-shadow: none;
}
.tk-actions .t-btn.is-blocked:hover { opacity: .6; background: rgba(39, 39, 42, .55); }


/* Phase D — Modale DECLENCHEUR (copie depuis sante.css) */
.acm-trigger-list {
  display: flex; flex-direction: column; gap: .1rem;
}
.acm-trigger-head {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .04em;
  color: #94a3b8; margin-bottom: .4rem;
}
.acm-sub-row {
  margin: .2rem 0 .6rem 1.7rem;
  padding: .5rem .7rem;
  background: rgba(255, 255, 255, .03);
  border-left: 2px solid rgba(var(--p-base-rgb), .35);
  border-radius: 0 6px 6px 0;
}
.acm-sub-row label { margin-bottom: .3rem; }
.std-pane[data-pane="trigger"] .std-check {
  display: flex; align-items: center; gap: .5rem;
  padding: .35rem .55rem; border-radius: 5px;
  cursor: pointer; user-select: none;
  transition: background .15s;
}
.std-pane[data-pane="trigger"] .std-check:hover {
  background: rgba(var(--p-base-rgb), .06);
}
.std-pane[data-pane="trigger"] .std-check input[type="radio"] {
  margin: 0; flex-shrink: 0;
}
.std-pane[data-pane="trigger"] .std-check span {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .85rem;
}




/* Phase D — icones d'action inline dans tk-title (style audit cards) */
.tk-title {
  display: inline-flex; align-items: center; gap: .5rem;
  min-width: 0;
}
.tk-name-text {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tk-inline-actions {
  display: inline-flex; align-items: center; gap: .2rem;
  margin-left: .4rem;
  flex-shrink: 0;
}
/* Phase D : tasks inline actions reutilisent le standard global .icon-action-btn (portal.css)
 * Override taille pour compacite dans tk-row (default 32px -> 24px) */
.tk-row .tk-inline-actions .icon-action-btn { width: 24px; height: 24px; }
.tk-row .tk-inline-actions .icon-action-btn.bs-kill-btn { color: #ef4444; }
.tk-row .tk-inline-actions .icon-action-btn.bs-kill-btn:hover:not(:disabled) {
  color: #f87171; filter: drop-shadow(0 0 6px rgba(239, 68, 68, .85)) drop-shadow(0 0 14px rgba(239, 68, 68, .45));
}

/* bs-spinner running : icone qui tourne + s'allume (cohérent audit cards) */
@keyframes bs-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.tk-row .tk-inline-actions .icon-action-btn.bs-spinner.is-running {
  opacity: 1 !important; cursor: default;
  animation: bs-spin 1.4s linear infinite;
  color: var(--p-base) !important;
  filter: drop-shadow(0 0 6px rgba(var(--p-base-rgb), .5)) drop-shadow(0 0 12px rgba(var(--p-base-rgb), .3));
}
.tk-row .tk-inline-actions .icon-action-btn.bs-spinner.is-running:hover { transform: none; }

/* ============================================================================
   STANDARD TOOLBAR — uniforme reference Biometrie sante (Vincent 2026-05-10)
   Zone figee (min-height 3.15rem) + controls cohérents (bg .45, radius 6, h 28).
   ============================================================================ */
.tasks-toolbar {
  min-height: 3.15rem !important;
  box-sizing: border-box !important;
}
.tasks-toolbar input[type="search"],
.tasks-toolbar input[type="text"],
.tasks-toolbar input[type="date"],
.tasks-toolbar input[type="number"],
.tasks-toolbar select,
.tasks-toolbar button.t-btn {
  background: rgba(39, 39, 42, .45);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 6px;
  padding: .22rem .55rem;
  font-size: .82rem;
  font-family: 'Menlo','Consolas',monospace;
  height: 28px;
  box-sizing: border-box;
  line-height: 1.2;
}
.tasks-toolbar button.t-btn:hover:not(:disabled) {
  background: rgba(var(--p-base-rgb), .18);
  color: var(--p-base);
  border-color: rgba(var(--p-base-rgb), .35);
}
.tasks-toolbar label {
  font-size: .82rem;
  color: #d4d4d8;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  line-height: 1.2;
}
