/* Composants */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.card h2 { margin-bottom: 12px; }
.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi .label { font-size: 0.8rem; color: var(--ink-3); font-weight: 500; }
.kpi .value { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; }
.kpi .sub { font-size: 0.78rem; color: var(--ink-3); }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 8px 14px; border-radius: 8px; font-weight: 600; cursor: pointer; }
.btn:hover { border-color: var(--ink-3); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-danger { color: var(--bad); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.input, .select, .textarea { width: 100%; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 8px 10px; }
.textarea { min-height: 80px; resize: vertical; }
.search { width: 260px; max-width: 100%; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 0.78rem; font-weight: 600; color: var(--ink-2); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.pill { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; background: var(--bg-soft); color: var(--ink-2); white-space: nowrap; }
.pill.s-froid { background: var(--bg-soft); color: var(--ink-2); }
.pill.s-cours { background: var(--warn-soft); color: var(--warn); }
.pill.s-chaud { background: var(--accent-soft); color: var(--accent); }
.pill.s-gagne { background: var(--ok-soft); color: var(--ok); }
.pill.s-perdu { background: var(--bad-soft); color: var(--bad); }
.owner { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.owner::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--ink-3)); }
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 0.75rem; color: var(--ink-3); font-weight: 600; background: var(--bg-soft); position: sticky; top: 0; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--bg-soft); }
tbody tr:last-child td { border-bottom: 0; }
.late { color: var(--bad); font-weight: 600; }
.today { color: var(--warn); font-weight: 600; }
.bar { height: 8px; border-radius: 4px; background: var(--bg-soft); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.bar.full > i { background: var(--ok); }
.funnel { display: flex; flex-direction: column; gap: 8px; }
.funnel-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 36px; gap: 10px; align-items: center; font-size: 0.85rem; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: 250px; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.col-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 0.85rem; padding: 2px 4px 4px; }
.col.drop { outline: 2px dashed var(--accent); }
.pcard { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: grab; display: flex; flex-direction: column; gap: 6px; }
.pcard:hover { border-color: var(--ink-3); }
.pcard .t { font-weight: 600; }
.pcard .m { display: flex; justify-content: space-between; gap: 8px; font-size: 0.78rem; color: var(--ink-3); }
.camp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.camp { cursor: pointer; display: flex; flex-direction: column; gap: 12px; }
.camp:hover { border-color: var(--ink-3); }
.camp-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stats div { background: var(--bg-soft); border-radius: 8px; padding: 8px; }
.stats b { display: block; font-size: 1rem; }
.stats span { font-size: 0.72rem; color: var(--ink-3); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.empty { text-align: center; padding: 36px 16px; color: var(--ink-3); }
.notice { padding: 10px 14px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-weight: 500; }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.list-row { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.list-row:last-child { border-bottom: 0; }
/* Fenêtre d'édition */
.overlay { position: fixed; inset: 0; background: rgba(11, 11, 15, .45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 50; overflow-y: auto; }
.modal { background: var(--panel); border-radius: 14px; width: 100%; max-width: 640px; padding: 22px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 30px 80px -30px rgba(0,0,0,.5); }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.dup { padding: 10px 12px; border-radius: 10px; background: var(--bad-soft); color: var(--bad); font-weight: 500; }
.toast { position: fixed; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 500; z-index: 60; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } .funnel-row { grid-template-columns: 110px minmax(0, 1fr) 30px; } }

/* ---------- Boutons et barres d'actions : jamais de texte qui dépasse ni de chevauchement ---------- */
.btn { white-space: nowrap; flex: none; line-height: 1.2; min-height: 38px; justify-content: center; }
.head { align-items: flex-start; }
.head > div:first-child { flex: 1 1 260px; min-width: 0; }
.head-actions { flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; max-width: 100%; }
.filters .input.search { flex: 1 1 220px; width: auto; min-width: 180px; max-width: 320px; }
.filters .select { width: auto; min-width: 150px; max-width: 220px; flex: 0 1 auto; }
.modal-foot { align-items: center; }
.modal-foot .head-actions { justify-content: flex-end; }
@media (max-width: 600px) {
  .head-actions { justify-content: flex-start; width: 100%; }
  .filters .input.search, .filters .select { flex: 1 1 100%; max-width: none; }
  .head-actions .btn { flex: 1 1 auto; }
}
.team-role { width: auto; }
