/* ERP Maison — module Tâches & corvées (préfixe .tch-) */

/* ---------- En-tête, sous-onglets, filtres ---------- */
/* Une seule ligne : les segments gardent leur largeur et la barre défile (noyau) plutôt que de tronquer */
.tch .segmented{display:flex;width:100%;max-width:600px;margin-bottom:12px;flex-wrap:nowrap;}
.tch .segmented .seg-btn{flex:1 0 auto;padding:8px 10px;min-height:36px;}
.tch-badge{
  display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;margin-left:3px;
  border-radius:999px;background:var(--danger);color:#fff;font-size:11px;line-height:1;vertical-align:1px;
}
.tch-filters{display:flex;gap:6px;overflow-x:auto;padding-bottom:4px;margin:0 0 14px;scrollbar-width:none;}
.tch-filters::-webkit-scrollbar{display:none;}
.tch-filter{
  flex-shrink:0;display:inline-flex;align-items:center;gap:4px;border:1px solid var(--line);background:#fff;border-radius:999px;
  padding:6px 12px;min-height:36px;font-family:inherit;font-size:13px;font-weight:700;color:var(--ink-soft);cursor:pointer;
}
.tch-filter.on{background:var(--mc, var(--accent));border-color:var(--mc, var(--accent));color:#fff;}
.tch-filter[data-filter]:not([data-filter=""])::before{content:"";width:8px;height:8px;border-radius:50%;background:var(--mc);flex-shrink:0;}
.tch-filter.on::before{box-shadow:0 0 0 1.5px #fff;}
.tch-toolbar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:space-between;margin-bottom:4px;}
.tch .section-title.tch-g-late{color:var(--danger);}

/* ---------- Lignes de tâche ---------- */
.tch-hit{position:relative;}
.tch-hit::before{content:"";position:absolute;inset:-8px;}
.tch-item{min-height:52px;}
.tch-item .li-title{display:flex;align-items:center;gap:6px;flex-wrap:wrap;overflow-wrap:anywhere;}
.tch-item.tch-high{box-shadow:inset 4px 0 0 var(--danger);background:color-mix(in srgb, var(--danger-soft) 45%, white);}
.tch-sub{display:flex;flex-wrap:wrap;gap:3px 9px;align-items:center;}
.tch-cat{display:inline-flex;align-items:center;flex-shrink:0;}
.tch-meta{display:inline-flex;align-items:center;gap:4px;}
.tch-meta .ic{flex-shrink:0;color:var(--ink-faint);}
.tch-sub .pill{padding:1px 8px;font-size:11px;}
.tch-late .tch-date{color:var(--danger);font-weight:700;}
.tch-item .li-side .avatars .avatar{border-color:#fff;}
.tch-noone{background:#c9bfb5;font-size:13px;}

/* ---------- Par personne ---------- */
.tch-people{display:grid;grid-template-columns:repeat(auto-fill, minmax(290px, 1fr));gap:18px;}
.tch-person-head{display:flex;align-items:center;gap:8px;margin-bottom:8px;font-weight:700;}
.tch-person-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.tch-add{min-height:32px;}
.tch-person-empty{padding:12px 14px;border:1px dashed var(--line);border-radius:var(--radius);}

/* ---------- Corvées : semaine ---------- */
.tch-week-nav{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:12px;}
.tch-week-nav > .btn{min-width:40px;min-height:36px;justify-content:center;padding:4px 10px;}
.tch-week-lbl{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:6px;text-align:center;font-size:14px;}
.tch-kids{display:grid;grid-template-columns:repeat(auto-fill, minmax(104px, 1fr));gap:8px;margin-bottom:14px;}
.tch-kid{
  background:var(--card);border:1px solid var(--line);border-radius:12px;padding:10px;display:flex;flex-direction:column;gap:3px;
  border-top:3px solid var(--mc, var(--accent));
}
.tch-kid-head{display:flex;align-items:center;gap:6px;font-weight:700;font-size:13.5px;min-width:0;}
.tch-kid-head span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.tch-kid-pts{font-size:20px;font-weight:800;}
.tch-kid-money{font-size:13px;font-weight:700;color:var(--green);}
.tch-kid-bar{height:5px;border-radius:99px;background:var(--muted-bg);overflow:hidden;margin-top:2px;}
.tch-kid-bar span{display:block;height:100%;background:var(--mc, var(--green));border-radius:99px;}

.tch-grid-wrap{overflow-x:auto;background:var(--card);border:1px solid var(--line);border-radius:var(--radius);}
.tch-grid{width:100%;min-width:320px;border-collapse:collapse;table-layout:fixed;}
.tch-grid th, .tch-grid td{border-bottom:1px solid var(--line);padding:7px 0;text-align:center;vertical-align:middle;}
.tch-grid tr:last-child th, .tch-grid tr:last-child td{border-bottom:none;}
.tch-grid thead th{font-size:11px;font-weight:700;color:var(--ink-soft);text-transform:uppercase;letter-spacing:.02em;line-height:1.25;}
.tch-grid thead th span{font-size:13px;color:var(--ink);text-transform:none;}
.tch-grid .tch-g-day{width:34px;}
.tch-grid th.tch-g-title{text-align:left;padding:7px 6px 7px 10px;width:auto;}
.tch-grid tbody th.tch-g-title{cursor:pointer;}
.tch-g-name{font-size:13px;font-weight:600;line-height:1.25;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
.tch-g-who{display:flex;align-items:center;gap:5px;margin-top:3px;}
.tch-g-pts{font-size:11px;font-weight:700;color:var(--green);}
.tch-g-none{color:#d3c9be;}
.tch-grid .tch-today{background:var(--accent-soft);}
.tch-grid .tch-hit::before{inset:-8px -5px;}
.tch-grid thead th.tch-today span{color:var(--accent-dark);}
.tch-chores-foot{display:flex;justify-content:flex-end;margin-top:10px;}
.tch-money{
  display:flex;color:var(--ink);flex-wrap:wrap;align-items:center;gap:8px;margin-top:14px;padding:10px 12px;border-radius:12px;
  background:var(--muted-bg);font-size:13.5px;
}
.tch-done-sum{margin:0 0 4px;}

/* ---------- Modèles du formulaire ---------- */
.tch-sugg{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;}
.tch-sugg .btn{min-height:36px;}
.tch-sugg-cur{overflow-wrap:anywhere;}
.tch-sugg-list{display:flex;flex-direction:column;gap:6px;}
.tch-sugg-lbl{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:700;color:var(--ink-soft);margin-top:4px;}
.tch-empty-acts{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;}
.tch-sugg-chips{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:4px;}
.tch-sugg-chip{
  border:1px solid var(--line);background:var(--card);border-radius:999px;padding:6px 11px;min-height:36px;font-family:inherit;
  font-size:12.5px;font-weight:600;color:var(--ink);cursor:pointer;text-align:left;
}
.tch-sugg-chip.on{background:var(--accent);border-color:var(--accent);color:#fff;}

/* ---------- Carte du tableau de bord ---------- */
.tch-dash{display:flex;flex-direction:column;gap:10px;}
.tch-dash-group{display:flex;flex-direction:column;gap:2px;}
.tch-dash-who{display:flex;align-items:center;gap:7px;font-weight:700;font-size:13.5px;margin-bottom:2px;}
.tch-dash-item{display:flex;align-items:center;gap:10px;min-height:38px;padding:2px 0 2px 4px;border-radius:8px;}
.tch-dash-item.tch-high{background:var(--danger-soft);}
.tch-dash-title{
  flex:1;min-width:0;background:none;border:none;padding:6px 0;text-align:left;font-family:inherit;font-size:14px;color:var(--ink);
  cursor:pointer;overflow-wrap:anywhere;
}
.tch-dash-high{display:inline-flex;vertical-align:-2px;margin-right:5px;color:var(--danger);}
.tch-dash-item.is-done .tch-dash-title{text-decoration:line-through;color:var(--ink-soft);}
.tch-dash-late{
  display:inline-flex;align-items:center;gap:6px;align-self:flex-start;background:var(--warn-soft);color:#7a5212;border:none;border-radius:999px;padding:7px 14px;min-height:34px;
  font-family:inherit;font-size:13px;font-weight:700;cursor:pointer;
}

@media (max-width:420px){
  .tch .segmented .seg-btn{font-size:12.5px;padding:8px 8px;}
  .tch-grid .tch-g-day{width:31px;}
  .tch-grid th.tch-g-title{padding-left:8px;}
  .tch-grid .check{width:21px;height:21px;}
}
