/* warranty.css — « Garanties et réclamations ». Owned by one module; reads the
   design tokens only, so dark mode follows. */

.wty-toolbar { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-3); }
.wty-toolbar .segmented { max-width: 100%; overflow-x: auto; }

/* ---- Repairs to claim ------------------------------------------------------- */
.wty-list { display: flex; flex-direction: column; }
.wty-row {
  display: grid; grid-template-columns: 38px minmax(0, 1fr) auto auto; gap: var(--s-2) var(--s-4);
  align-items: center; padding: var(--s-3) var(--s-4); border-top: 1px solid var(--border-subtle);
}
.wty-row:first-child { border-top: 0; }
.wty-row__icon {
  width: 38px; height: 38px; border-radius: var(--r-md); display: inline-flex; align-items: center; justify-content: center;
  background: var(--warning-soft); color: var(--warning-ink);
}
.wty-row[data-tone="purple"] .wty-row__icon { background: var(--purple-soft); color: var(--purple-ink); }
.wty-row[data-tone="accent"] .wty-row__icon { background: var(--accent-soft); color: var(--accent-ink-on-soft, var(--accent)); }
.wty-row__body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.wty-row__title { font-weight: var(--fw-semi); color: var(--ink); display: flex; gap: 8px; align-items: baseline; min-width: 0; }

.wty-row__title > a { flex: none; white-space: nowrap; }
.wty-row__title > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.wty-row__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: var(--fs-sm); color: var(--ink-3); }
.wty-row__meta > span { display: inline-flex; align-items: center; gap: 4px; }
.wty-row__meta svg { opacity: .7; flex: none; }
.wty-row__reason { display: flex; gap: 6px; align-items: flex-start; font-size: var(--fs-sm); color: var(--ink-2); overflow-wrap: anywhere; }
.wty-row__reason svg { flex: none; margin-top: 2px; color: var(--muted); }
.wty-row__amount { display: flex; flex-direction: column; align-items: flex-end; text-align: right; font-variant-numeric: tabular-nums; }
.wty-row__amount strong { font-size: var(--fs-lg); color: var(--ink); white-space: nowrap; }
.wty-row__amount small { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
.wty-row__actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }

/* ---- Claims pipeline -------------------------------------------------------- */
.wty-pipe { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--s-2); margin-bottom: var(--s-4); }
.wty-pipe__step {
  display: flex; flex-direction: column; gap: 2px; padding: var(--s-3); min-width: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  border-top: 3px solid var(--border-strong); text-decoration: none; color: var(--ink-2);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.wty-pipe__step:hover { box-shadow: var(--shadow-sm); }
.wty-pipe__step.is-on { box-shadow: 0 0 0 2px var(--ring, var(--accent)); }
.wty-pipe__step[data-tone="info"] { border-top-color: var(--info); }
.wty-pipe__step[data-tone="accent"] { border-top-color: var(--accent); }
.wty-pipe__step[data-tone="warning"] { border-top-color: var(--warning); }
.wty-pipe__step[data-tone="success"] { border-top-color: var(--success); }
.wty-pipe__step[data-tone="danger"] { border-top-color: var(--danger); }
.wty-pipe__label { display: flex; align-items: center; gap: 5px; font-size: var(--fs-xs); font-weight: var(--fw-semi); color: var(--ink-3); text-transform: uppercase; letter-spacing: .03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wty-pipe__label svg { flex: none; }
.wty-pipe__count { font-size: var(--fs-xl); font-weight: var(--fw-bold); color: var(--ink); font-variant-numeric: tabular-nums; }
.wty-pipe__amount { font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Coverages -------------------------------------------------------------- */
.wty-clip { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wty-contact { font-size: var(--fs-xs); margin-top: 2px; }
.wty-contact a { display: flex; align-items: center; gap: 5px; color: var(--ink-2); white-space: nowrap; }
.wty-contact svg { flex: none; opacity: .7; }

/* ---- Claim dialog ----------------------------------------------------------- */
.wty-claimhead { padding: var(--s-3); margin-bottom: var(--s-4); border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border-subtle); overflow-wrap: anywhere; }
.wty-claimhead svg { vertical-align: -2px; color: var(--muted); }
.wty-photos { margin-top: var(--s-4); display: flex; flex-direction: column; gap: var(--s-2); }
.wty-photos .row-tight { justify-content: space-between; }

/* ---- Hooks: work-order banner, unit card ------------------------------------ */
.wty-banner { align-items: flex-start; flex-wrap: wrap; }
.wty-banner__body { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.wty-banner__actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.wty-covlist { display: flex; flex-direction: column; }
.wty-cov { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2) 0; border-top: 1px solid var(--border-subtle); }
.wty-cov:first-child { border-top: 0; padding-top: 0; }
.wty-cov__icon { width: 30px; height: 30px; flex: none; border-radius: var(--r-md); display: inline-flex; align-items: center; justify-content: center; background: var(--surface-3); color: var(--ink-3); }
.wty-cov__body { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.wty-unit-todo {
  display: flex; align-items: center; gap: 8px; padding: var(--s-2) var(--s-3); margin-bottom: var(--s-3);
  border-radius: var(--r-md); background: var(--warning-soft); color: var(--warning-ink); font-weight: var(--fw-semi); font-size: var(--fs-sm); text-decoration: none;
}
.wty-unit-todo span { flex: 1 1 auto; min-width: 0; }

/* ---- Phone ------------------------------------------------------------------ */
@media (max-width: 900px) {
  .wty-pipe { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .wty-row { grid-template-columns: 32px minmax(0, 1fr); padding: var(--s-3); align-items: start; }
  .wty-row__amount { grid-column: 2; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; text-align: left; }
  .wty-row__amount small { white-space: normal; }
  .wty-row__icon { width: 32px; height: 32px; }
  .wty-row__title { flex-wrap: wrap; }
  .wty-row__title > span { white-space: normal; }
  .wty-row__actions { grid-column: 2 / -1; justify-content: flex-start; flex-wrap: wrap; }
  .wty-pipe { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wty-toolbar { flex-wrap: wrap; }
  .wty-clip { max-width: 200px; }
}
@media print {
  .wty-row__actions, .wty-toolbar { display: none; }
}
.wty-limits { min-width: 180px; max-width: 260px; }
