/* ============================================================================
   courtesy.css — « Véhicules de courtoisie » (2.16): the board of cars, the
   two-week calendar, the attention list and the card on the work order.
   ========================================================================== */

/* ---- The board: one tile per car ---------------------------------------- */
.ctboard { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: var(--s-4); }
.cttile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-2); border-left-width: 4px; }
.cttile--free { border-left-color: var(--success); }
.cttile--reserved { border-left-color: var(--info); }
.cttile--out { border-left-color: var(--warning); }
.cttile--overdue { border-left-color: var(--danger); }
.cttile--down { border-left-color: var(--border); opacity: .85; }
.cttile__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.cttile__car { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: inherit; text-decoration: none; font-size: var(--fs-md); }
.cttile__car:hover { color: var(--accent); }
.cttile__sub { color: var(--ink-3); font-size: var(--fs-sm); }
.cttile__who { display: flex; align-items: center; gap: var(--s-2); margin-top: 2px; min-height: 34px; }
.cttile__who a { color: inherit; text-decoration: none; }
.cttile__who a:hover { color: var(--accent); }
.cttile__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: var(--s-2); }

/* ---- Attention list -------------------------------------------------------- */
.ctatts { display: flex; flex-direction: column; }
.ctatt { display: grid; grid-template-columns: minmax(200px, 320px) minmax(0, 1fr) auto; gap: var(--s-4); align-items: center; padding: 10px var(--s-5); border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; }
.ctatt:last-child { border-bottom: 0; }
.ctatt:hover { background: var(--accent-soft); }
.ctatt__why { display: flex; gap: 6px; align-items: center; font-weight: 650; }
.ctatt__what { color: var(--ink-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 700px) { .ctatt { grid-template-columns: minmax(0, 1fr) auto; } .ctatt__what { grid-column: 1; } }

/* ---- The two-week calendar --------------------------------------------- */
.ctcal { overflow-x: auto; padding-bottom: var(--s-2); }
.ctcal__row { display: grid; grid-template-columns: minmax(150px, 190px) repeat(var(--ctcal-days, 14), minmax(44px, 1fr)); border-bottom: 1px solid var(--border); min-width: 760px; }
.ctcal__row:last-of-type { border-bottom: 0; }
.ctcal__row--head { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.ctcal__car { display: flex; flex-direction: column; justify-content: center; padding: 8px var(--s-4); color: inherit; text-decoration: none; min-width: 0; border-right: 1px solid var(--border); }
.ctcal__car b { font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctcal__car small { color: var(--ink-3); font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctcal__car:hover b { color: var(--accent); }
.ctcal__day { display: flex; flex-direction: column; align-items: center; padding: 6px 2px; font-size: var(--fs-xs); color: var(--ink-3); border-left: 1px solid var(--border); }
.ctcal__day b { font-size: var(--fs-sm); color: var(--ink); }
.ctcal__day.is-weekend { background: var(--surface-2); }
.ctcal__day.is-today b { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 0 7px; }
.ctcal__cell { position: relative; border: 0; border-left: 1px solid var(--border); background: transparent; min-height: 40px; padding: 0; cursor: pointer; font: inherit; color: inherit; text-align: left; }
.ctcal__cell.is-today { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.ctcal__cell.is-free:hover { background: var(--success-soft); }
.ctcal__cell.is-free:hover::after { content: '+'; position: absolute; inset: 0; display: grid; place-items: center; color: var(--success-ink); font-weight: 700; }
.ctcal__cell.is-reserved { background: var(--info-soft); }
.ctcal__cell.is-out { background: var(--warning-soft); }
.ctcal__cell.is-overdue { background: var(--danger-soft); }
.ctcal__cell.is-down { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--surface-2) 6px 12px); cursor: not-allowed; }
.ctcal__cell[disabled] { cursor: default; }
.ctcal__cell.is-first { border-left: 3px solid currentColor; }
.ctcal__cell.is-reserved.is-first { color: var(--info); }
.ctcal__cell.is-out.is-first { color: var(--warning); }
.ctcal__cell.is-overdue.is-first { color: var(--danger); }
.ctcal__name { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); font-size: var(--fs-xs); font-weight: 650; white-space: nowrap; z-index: 1; pointer-events: none; color: var(--ink); max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.ctcal__legend { display: flex; flex-wrap: wrap; gap: var(--s-4); padding: var(--s-3) var(--s-4) 0; font-size: var(--fs-xs); color: var(--ink-3); }
.ctcal__legend span { display: inline-flex; align-items: center; gap: 6px; }
.ctcal__legend i { width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--border); display: inline-block; }
.ctcal__legend i.is-free { background: var(--surface); }
.ctcal__legend i.is-reserved { background: var(--info-soft); }
.ctcal__legend i.is-out { background: var(--warning-soft); }
.ctcal__legend i.is-overdue { background: var(--danger-soft); }
.ctcal__legend i.is-down { background: repeating-linear-gradient(135deg, transparent 0 4px, var(--surface-2) 4px 8px); }

/* ---- The card on the work order, the unit, the customer -------------------- */
.ctrows { display: flex; flex-direction: column; }
.ctrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s-3); align-items: center; padding: 10px var(--s-4); border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; }
.ctrow:last-child { border-bottom: 0; }
.ctrow:hover { background: var(--accent-soft); }
.ctrow__icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--purple-soft); color: var(--purple-ink); }
.ctrow__main { display: flex; flex-direction: column; min-width: 0; }
.ctrow__main b { font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctrow__main small { color: var(--ink-3); font-size: var(--fs-xs); }
.ctcard__foot { display: flex; flex-wrap: wrap; gap: 6px; padding: var(--s-3) var(--s-4); border-top: 1px solid var(--border); }

/* ---- Print: the agreement's terms ------------------------------------------- */
.ctprint__terms { padding-left: 5mm; font-size: 9pt; margin: 0; }
.ctprint__terms li { margin-bottom: 1.5mm; }
