/* =========================================================================
   Module Contrats & embauches — compléments au design system (préfixe ct-)
   ========================================================================= */

.ct-block { display: block; margin-top: 2px; }
.ct-ico { width: 36px; height: 36px; border-radius: 10px; background: var(--gold-soft); color: var(--gold-2); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ct-ico .icon { width: 18px; height: 18px; }
.ct-ico-danger { background: var(--danger-soft); color: var(--danger); }
.ct-sub-label { display: block; margin-bottom: 6px; }
.ct-narrow { max-width: 720px; }

/* ---------- Vue d'ensemble ---------- */
.ct-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.ct-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 8px 7px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: .86rem; font-weight: 500; box-shadow: var(--shadow-sm); transition: border-color .15s, transform .15s var(--ease); }
.ct-chip .icon { width: 15px; height: 15px; color: var(--muted); }
.ct-chip b { min-width: 24px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--bg-2); color: var(--muted); font-size: .76rem; display: inline-flex; align-items: center; justify-content: center; }
.ct-chip.has-items { color: var(--ink); border-color: var(--line-strong); }
.ct-chip.has-items .icon { color: var(--gold-2); }
.ct-chip.has-items b { background: var(--espresso); color: var(--cream); }
.ct-chip:hover { color: var(--espresso); border-color: var(--gold); transform: translateY(-1px); }

.ct-board { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.ct-board .card + .card { margin-top: 0; }
.ct-panel { scroll-margin-top: 90px; }
.ct-panel.is-clear { box-shadow: var(--shadow-sm); }
.ct-panel.is-clear .card-head { border-bottom-color: transparent; }
.ct-panel.is-clear .ct-ico { background: var(--bg-2); color: var(--muted); }
.ct-clear { display: flex; align-items: center; gap: 10px; padding: 0 24px 20px; color: var(--success); font-weight: 500; font-size: .92rem; }
.ct-clear-ico { width: 24px; height: 24px; border-radius: 50%; background: var(--success-soft); display: inline-flex; align-items: center; justify-content: center; }
.ct-clear-ico .icon { width: 14px; height: 14px; stroke-width: 2.4; }

.ct-list { list-style: none; margin: 0; padding: 6px 0; }
.ct-row { display: flex; align-items: center; gap: 12px; padding: 10px 24px; color: var(--ink); transition: background .12s; }
.ct-row:hover { background: #FCF8F0; color: var(--ink); }
.ct-row:hover .person-name { color: var(--gold-2); }
.ct-row-main { flex: 1; min-width: 0; }
.ct-row-main .person-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-row-go { width: 16px; height: 16px; color: var(--line-strong); }
.ct-row:hover .ct-row-go { color: var(--gold-2); }
.ct-due { font-size: .76rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.ct-due-warning { background: var(--warning-soft); color: var(--warning); }
.ct-due-danger { background: var(--danger-soft); color: var(--danger); }

/* ---------- Assistant d'embauche ---------- */
.ct-wizard .card-head { background: linear-gradient(180deg, var(--surface-2), var(--surface)); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.ct-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); counter-reset: none; }
.ct-step { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface-2); }
.ct-step.is-ok { background: var(--surface); border-color: #D7E7DA; }
.ct-step.is-todo { border-style: dashed; border-color: var(--line-strong); }
.ct-step-mark { width: 26px; height: 26px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; color: var(--muted); background: var(--surface); border: 1.5px solid var(--line-strong); }
.ct-step.is-ok .ct-step-mark { background: var(--success); border-color: var(--success); color: #fff; }
.ct-step-mark .icon { width: 14px; height: 14px; stroke-width: 2.6; }
.ct-step-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ct-step-label { font-weight: 600; font-size: .9rem; color: var(--ink); line-height: 1.3; }
.ct-step.is-ok .ct-step-label { color: var(--ink-2); }
.ct-step-detail { font-size: .78rem; color: var(--muted); }
.ct-step-action { display: inline-flex; align-items: center; gap: 2px; font-size: .82rem; font-weight: 600; margin-top: 4px; }
.ct-step-action .icon { width: 14px; height: 14px; }

/* ---------- Mise en page de l'onglet ---------- */
.ct-layout { grid-template-columns: minmax(0, 1fr) 380px; }
.ct-layout .card { scroll-margin-top: 90px; }
.ct-fix { border-color: #EBC4BF; }

/* ---------- Chaînes de contrats ---------- */
.ct-chain { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; background: var(--surface-2); display: flex; flex-direction: column; gap: 14px; }
.ct-chain-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.ct-chain-head h3 { margin: 0 0 2px; font-size: 1.15rem; }
.ct-check { font-size: .88rem; }
.ct-timeline { margin-left: 8px; gap: 18px; }
.ct-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; scroll-margin-top: 90px; }
.ct-timeline li.ct-item::before { top: 18px; }
.ct-item.is-current { border-color: #E3CFA7; box-shadow: 0 0 0 3px rgba(184,132,58,.10); }
.ct-item:target { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184,132,58,.22); }
.ct-item-head { display: flex; align-items: flex-start; gap: 10px; }
.ct-kind { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-2); font-weight: 600; }
.ct-current { color: var(--success); }
.ct-period { font-family: var(--font-display); font-size: 1.05rem; color: var(--espresso); margin-top: 2px; }
.ct-period .text-danger { font-family: var(--font); font-size: .85rem; }
.ct-item-actions { display: inline-flex; gap: 2px; margin: -6px -8px 0 0; }
.ct-facts { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0; font-size: .88rem; }
.ct-facts dt { color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; }
.ct-facts dd { margin: 0; font-weight: 500; }
.ct-notes { margin: 0; padding-left: 10px; border-left: 2px solid var(--line); }
.ct-proposal { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--gold-soft); color: #6b4a1b; font-size: .86rem; }
.ct-proposal > .icon { color: var(--gold-2); align-self: flex-start; margin-top: 2px; }
.ct-proposal .muted { color: #8f6c3a; }

.ct-flow { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: .8rem; color: var(--muted); }
.ct-flow li { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--bg-2); }
.ct-flow li span { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface); font-weight: 700; font-size: .72rem; }
.ct-flow li.is-done { background: var(--success-soft); color: #2b5a3a; }
.ct-flow li.is-done span { background: var(--success); color: #fff; }
.ct-flow .icon { width: 12px; height: 12px; stroke-width: 2.8; }

.ct-transitions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ct-inline-form { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ct-inline-form .input { width: auto; min-height: 34px; padding: 5px 10px; font-size: .86rem; }
.ct-doc .doc-item { border-color: var(--line); background: var(--surface-2); }
.ct-carence { font-size: .88rem; }
.ct-idcc { color: var(--gold-2); }
dialog.modal.ct-modal-wide { width: min(680px, calc(100vw - 32px)); }

/* ---------- DPAE : récapitulatif ---------- */
.ct-recap-box { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: var(--r); background: var(--surface-2); border: 1px dashed var(--line-strong); }
.ct-recap-box > .btn { align-self: flex-start; }
.ct-recap { display: flex; flex-direction: column; gap: 10px; }
.ct-recap-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.ct-recap-list { margin: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.ct-recap-row { display: grid; grid-template-columns: minmax(110px, 42%) 1fr; gap: 8px; align-items: center; padding: 6px 6px 6px 12px; border-bottom: 1px solid var(--line); font-size: .85rem; }
.ct-recap-row:last-child { border-bottom: 0; }
.ct-recap-row dt { color: var(--muted); }
.ct-recap-row dd { margin: 0; display: flex; align-items: center; justify-content: space-between; gap: 4px; font-weight: 500; min-width: 0; word-break: break-word; font-variant-numeric: tabular-nums; }
.ct-recap-row.is-missing { background: var(--warning-soft); }
.ct-recap-row.is-missing dd a { font-weight: 600; }
.ct-copy { width: 28px; height: 28px; flex: none; opacity: .6; }
.ct-copy .icon { width: 15px; height: 15px; }
.ct-recap-row:hover .ct-copy { opacity: 1; }

@media (max-width: 1180px) {
  .ct-layout { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .ct-board { grid-template-columns: 1fr; }
  .ct-row { padding: 10px 18px; }
  .ct-clear { padding: 0 18px 18px; }
  .ct-chain { padding: 14px; }
  .ct-item-head { flex-wrap: wrap; }
}
@media print {
  .ct-item-actions, .ct-transitions, .ct-doc form, .ct-recap-box { display: none; }
}

/* La frise (.timeline) ne doit pas décorer les listes imbriquées */
.timeline .ct-flow li::before { content: none; display: none; }
/* Cartes de l'onglet : espacement régulier (le .dl du design system annule la marge de .stack) */
.ct-layout .card-body.stack { display: flex; flex-direction: column; gap: 16px; }
.ct-layout .card-body.stack > * { margin-top: 0; }
.ct-recap-box .ct-inline-form .input { width: 120px; }
.ct-board > * { min-width: 0; }
