/* ==========================================================================
   PatrimoniaCD by MPS CORP — compléments au système WMSLOG (style.css)
   ========================================================================== */
:root { --violet: #6449b8; --violet-bg: #f1eefb; --doc-font: Cambria, "Book Antiqua", Georgia, "Times New Roman", serif; }

/* Marque : « PatrimoniaCD » puis, en dessous, « by MPS CORP » en italique */
.brand-text b { letter-spacing: .01em; text-transform: none; font-size: 17px; font-weight: 750; }
.brand-text .brand-by { display: block; margin-top: 2px; font-style: italic; font-size: 11.5px; font-weight: 500; letter-spacing: .03em; color: #8fa7bd; }
.auth-visual .brand-text .brand-by { color: #b5c8da; }
.simple-brand { display: flex; justify-content: center; margin-bottom: 18px; }
.simple-brand .brand { border: 0; padding: 0; margin: 0; }
.simple-brand .brand-text b { color: var(--text); }
.simple-brand .brand-text .brand-by { color: var(--muted); }
.auth-space { display: block; color: #fff; font-size: 13px; margin-bottom: 2px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.pager-links { display: flex; gap: 4px; flex-wrap: wrap; }
.pager-links a, .pager-links span { min-width: 34px; height: 32px; padding: 0 9px; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); font-weight: 600; color: var(--text-2); }
.pager-links a:hover { border-color: var(--primary); color: var(--primary); }
.pager-links .on { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager-links .gap { border: 0; min-width: 16px; }

.nav-link .nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }

/* KPI couleurs métier */
.kpi.land .kpi-icon { background: var(--wh-bg); color: var(--wh); }
.kpi.home .kpi-icon { background: var(--in-bg); color: var(--in); }
.kpi.rent .kpi-icon { background: var(--out-bg); color: var(--out); }
.kpi.late .kpi-icon { background: var(--danger-bg); color: var(--danger); }
.kpi-value { white-space: nowrap; }
.pill.violet { background: var(--violet-bg); border-color: #dcd4f3; color: var(--violet); }
.pill.land { background: var(--wh-bg); border-color: #c4e6d6; color: #146a48; }
.pill.warn { background: var(--warning-bg); border-color: #f0dcb2; color: #8a5a07; }
.recent-row .dot.red { background: var(--danger-bg); color: var(--danger); }
.recent-row .dot.wh { background: var(--wh-bg); color: var(--wh); }
.txt-danger { color: var(--danger) !important; }
.hint { font-size: 12.5px; margin: 10px 0 0; }
.small-code { font-size: 12px; font-weight: 600; }
a.occ-row { color: inherit; border-radius: 8px; }
a.occ-row:hover span:first-child { color: var(--primary); }
.occ-row span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aging-row.occ-row { grid-template-columns: minmax(0, 190px) 1fr 56px; }
.alert.warn { background: var(--warning-bg); border-color: #f0dcb2; color: #7a4f06; }

/* Cartes parcelles */
.land-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.land-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; transition: box-shadow .2s var(--ease), transform .2s var(--ease), border-color .2s; }
.land-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--line-strong); }
.land-top { padding: 16px 18px 12px; display: flex; flex-direction: column; gap: 8px; }
.land-top .row1 { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.land-top h3 { font-size: 16px; font-weight: 700; }
.land-top .addr { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.land-top .addr .icon { width: 14px; height: 14px; }
.houses { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 18px 14px; flex: 1; align-content: flex-start; }
.house { min-width: 28px; height: 22px; padding: 0 4px; border-radius: 5px; display: grid; place-items: center; font-size: 10px; font-weight: 700; }
.house.occ { background: var(--primary); color: #fff; }
.house.free { background: var(--surface-2); border: 1px dashed var(--line-strong); color: var(--subtle); }
.land-foot { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); background: var(--surface-2); }
.land-foot div { padding: 10px 14px; border-right: 1px solid var(--line); min-width: 0; }
.land-foot div:last-child { border-right: 0; }
.land-foot span { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--subtle); }
.land-foot b { font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.add-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 200px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius); background: transparent; color: var(--muted); font-weight: 600; }
.add-card:hover { border-color: var(--primary); background: var(--primary-50); color: var(--primary); }
.add-card .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); }

/* Éditeur de maisons */
.count-box { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.built-total { padding-bottom: 10px; font-size: 13px; }
.stepper-num { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; height: 40px; background: #fff; width: max-content; }
.stepper-num button { width: 40px; height: 100%; border: 0; background: var(--surface-2); font-size: 18px; font-weight: 600; color: var(--text-2); }
.stepper-num button:hover { background: var(--primary-50); color: var(--primary); }
.field .stepper-num input { width: 60px; height: 100%; border: 0; border-inline: 1px solid var(--line); border-radius: 0; text-align: center; font-weight: 700; font-size: 15px; padding: 0; box-shadow: none; }
.houses-editor { border: 1px solid var(--line); border-radius: 12px; overflow: auto; }
.houses-editor table { border-collapse: collapse; width: 100%; min-width: 760px; font-size: 13px; }
.houses-editor th { background: #f5f7fa; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.houses-editor td { padding: 7px 8px; border-bottom: 1px solid #edf1f5; vertical-align: middle; }
.houses-editor tr:last-child td { border-bottom: 0; }
.houses-editor input, .houses-editor select { width: 100%; height: 34px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; font-size: 13px; outline: none; }
.houses-editor input:focus, .houses-editor select:focus { border-color: var(--primary); box-shadow: var(--ring); }
.houses-editor input.is-invalid { border-color: var(--danger); background: var(--danger-bg); }
.houses-editor input.code-in { width: 64px; font-weight: 700; color: var(--primary); }
.houses-editor .code { font-weight: 700; color: var(--primary); padding-left: 12px; }
.houses-editor .surf { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.houses-editor .row-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }

/* Assistant */
.stepper { display: flex; gap: 8px; padding: 14px 24px; border-bottom: 1px solid var(--line); background: var(--surface-2); flex-wrap: wrap; align-items: center; }
.stp { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--subtle); }
.stp i { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-style: normal; font-size: 12px; font-weight: 700; background: #fff; border: 1px solid var(--line-strong); }
.stp.on { color: var(--text); }
.stp.on i { background: var(--primary); border-color: var(--primary); color: #fff; }
.stp.done { color: var(--success); }
.stp.done i { background: var(--success-bg); border-color: #c4e6d6; color: var(--success); }
.stp-sep { flex: 0 0 28px; height: 1px; background: var(--line-strong); }
.house-info { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--primary-100); background: var(--primary-50); border-radius: 12px; overflow: hidden; margin-top: 12px; }
.house-info:empty { display: none; }
.house-info div { padding: 10px 14px; border-right: 1px solid var(--primary-100); min-width: 0; }
.house-info div:last-child { border-right: 0; }
.house-info span { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--primary-600); }
.house-info b { font-size: 14px; font-variant-numeric: tabular-nums; }
.review-title { font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 16px 0 10px; }
.field.has-error input, .field.has-error select { border-color: var(--danger); }
.field .err { color: var(--danger); font-size: 12px; }
.btn.success-btn { background: var(--success); border-color: var(--success); }
.btn.success-btn:hover:not(:disabled) { background: #15724e; border-color: #15724e; }
.btn.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-solid:hover { background: #a52f2f !important; border-color: #a52f2f !important; }

/* Zones d'action dans la fiche locataire */
.action-zone { margin-top: 16px; animation: fadeUp .25s var(--ease) both; }
.zone-form { margin: 0; }
.zone-body { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.zone-row { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.zone-row .field { min-width: 160px; }
.zone-row .field label { color: inherit; }

/* Divers */
.month-nav { display: flex; align-items: center; gap: 6px; }
.month-nav span { min-width: 130px; text-align: center; font-weight: 650; }
.month-nav .btn { width: 40px; padding: 0; }
.panel-form { padding: 18px; }
.form-actions { display: flex; justify-content: flex-end; margin-top: 16px; }
.auth-card.wide { width: min(560px, 100%); }
.auth-card .switch { margin: 4px 0 14px; }
.auth-card .form-section { margin-bottom: 18px; }
.auth-panel { overflow-y: auto; }
.data-table tbody tr[data-href]:focus-visible td { background: var(--primary-50); }

/* Document A4 (contrat, quittance) */
.doc-stage { background: #e9edf2; border-radius: var(--radius); padding: 28px; overflow: auto; }
.doc { width: 210mm; max-width: 100%; min-height: 297mm; margin: 0 auto; background: #fff; color: #111; box-shadow: 0 4px 18px rgba(16,39,61,.14); padding: 20mm 18mm; font-family: var(--doc-font); font-size: 11.5pt; line-height: 1.55; }
.doc.short { min-height: 0; }
.doc-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid #13273b; padding-bottom: 10px; margin-bottom: 18px; font-family: var(--font); font-size: 9pt; color: #3c5368; }
.doc-head b { display: block; color: #13273b; font-size: 11pt; }
.doc-head .r { text-align: right; }
.doc h1 { font-family: var(--doc-font); font-size: 17pt; text-align: center; letter-spacing: .04em; text-transform: uppercase; margin: 6px 0 2px; }
.doc .doc-ref { text-align: center; font-family: var(--font); font-size: 9pt; color: #5d7186; margin-bottom: 18px; }
.doc h4 { font-size: 11.5pt; font-weight: 700; margin: 14px 0 4px; break-after: avoid; }
.doc p { margin: 0 0 6px; text-align: justify; }
.doc .parties { border: 1px solid #cbd5df; border-radius: 4px; padding: 10px 14px; margin: 8px 0 6px; }
.doc .parties p { margin: 0 0 4px; }
.doc .between { text-align: center; font-style: italic; margin: 6px 0; }
.doc table.terms { border-collapse: collapse; width: 100%; font-size: 10.5pt; margin: 6px 0 8px; }
.doc table.terms td { border: 1px solid #cbd5df; padding: 5px 9px; }
.doc table.terms td:first-child { width: 45%; color: #3c5368; }
.doc .done-at { margin-top: 14px; }
.doc .signs { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 22px; break-inside: avoid; }
.doc .signs div { border-top: 1px solid #13273b; padding-top: 6px; min-height: 80px; font-size: 10.5pt; }
.doc .signs div.blank { border: 0; }
.doc .signs small { display: block; color: #5d7186; font-size: 9pt; }
.doc .doc-foot { margin-top: 18px; border-top: 1px solid #cbd5df; padding-top: 6px; font-family: var(--font); font-size: 8pt; color: #8a9aab; display: flex; justify-content: space-between; gap: 12px; }
.doc .receipt-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.doc .receipt-title h1 { text-align: left; margin: 0; }
.doc .stamp { display: inline-block; border: 2px solid #1b8a5f; color: #1b8a5f; font-family: var(--font); font-weight: 800; font-size: 9pt; letter-spacing: .16em; padding: 4px 10px; border-radius: 4px; transform: rotate(-4deg); }
.doc .stamp.part { border-color: #b8770f; color: #b8770f; }

@media (max-width: 1024px) {
  .house-info { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .house-info { grid-template-columns: 1fr; }
  .house-info div { border-right: 0; border-bottom: 1px solid var(--primary-100); }
  .doc-stage { padding: 10px; }
  .doc { padding: 10mm 7mm; font-size: 10.5pt; }
  .doc .signs { grid-template-columns: 1fr; }
  .stp-sep { display: none; }
  .month-nav { width: 100%; justify-content: space-between; }
  .kpi-value { white-space: normal; }
}

/* Impression : seul le document sort sur la feuille A4 */
@media print {
  @page { size: A4; margin: 0; }
  body.doc-page { background: #fff; }
  body.doc-page .sidebar, body.doc-page .sidebar-scrim, body.doc-page .topbar, body.doc-page .page-header,
  body.doc-page .alert, body.doc-page .toast-stack, body.doc-page .skip-link { display: none !important; }
  body.doc-page .app-shell { display: block; }
  body.doc-page .content { padding: 0; max-width: none; animation: none; }
  body.doc-page .doc-stage { background: none; padding: 0; border-radius: 0; }
  body.doc-page .doc { box-shadow: none; margin: 0; width: auto; min-height: 0; }
}

/* L'attribut hidden l'emporte toujours (boutons de l'assistant, zones d'action). */
[hidden] { display: none !important; }

/* ---------- Utilisateurs et rôles ---------- */
.admin-layout > div { min-width: 0; }
.row-off td { opacity: .6; }
.role-editor-head { align-items: flex-end; }
.role-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; margin-bottom: 6px; }
.role-meta small { font-size: 12px; color: var(--muted); }
.perm-groups { display: flex; flex-direction: column; gap: 12px; }
.perm-group-title { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--subtle); margin-bottom: 6px; }
.role-actions { gap: 8px; }
.role-editor:target { background: var(--primary-50); }
.form-section-head .step .icon { width: 14px; height: 14px; }
.pwd-section { margin-top: 20px; }
.radio-cards { display: grid; gap: 8px; margin-bottom: 12px; }
.radio-card { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; transition: background .15s, border-color .15s; }
.radio-card:hover { background: var(--surface-2); }
.radio-card:has(input:checked) { border-color: var(--primary-100); background: var(--primary-50); }
.radio-card input { margin-top: 3px; accent-color: var(--primary); }
.radio-card b { display: block; font-size: 13.5px; font-weight: 600; }
.radio-card small { display: block; font-size: 12.5px; color: var(--muted); }
.manual-pwd { align-items: end; }
.manual-pwd .switch { height: 40px; }
.secret-value { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 15px; letter-spacing: .04em; user-select: all; }
.confirm-icon.warn-icon { background: var(--warning-bg); color: var(--warning); box-shadow: 0 0 0 8px rgba(184,119,15,.08); font-size: 28px; font-weight: 800; }
select[aria-disabled="true"] { background: var(--surface-2); color: var(--muted); }
.form-actions { gap: 8px; }

/* ---------- Impayés et relances ---------- */
.relance-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; padding: 16px 18px; position: relative; }
.relance-step { display: flex; align-items: center; gap: 12px; position: relative; padding-right: 12px; }
.relance-step:not(:last-child)::after { content: ""; position: absolute; left: 44px; right: 8px; top: 50%; height: 1px; background: var(--line-strong); z-index: 0; display: none; }
.rs-num { width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center; font-weight: 700; color: #fff; }
.relance-step:nth-child(1) .rs-num { background: var(--primary); }
.relance-step:nth-child(2) .rs-num { background: var(--warning); }
.relance-step:nth-child(3) .rs-num { background: var(--out); }
.relance-step:nth-child(4) .rs-num { background: var(--danger); }
.relance-step b { display: block; font-size: 13.5px; }
.relance-step small { display: block; font-size: 12px; color: var(--muted); }
.data-table td.t-wrap { white-space: normal; max-width: 240px; }
.month-pill { height: 22px; font-size: 11.5px; margin: 2px 4px 2px 0; background: var(--danger-bg); border-color: #f2cccc; color: #9b2c2c; }
.sub-line { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.relance-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid #f2cccc; background: var(--danger-bg); border-radius: 12px; overflow: hidden; margin: 14px 0 16px; }
.relance-summary:empty { display: none; }
.relance-summary div { padding: 10px 14px; border-right: 1px solid #f2cccc; min-width: 0; }
.relance-summary div:nth-child(3) { border-right: 0; }
.relance-summary div.wide { grid-column: 1 / -1; border-right: 0; border-top: 1px solid #f2cccc; }
.relance-summary span { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #9b2c2c; }
.relance-summary b { font-size: 13.5px; }
#rl_msg { min-height: 180px; line-height: 1.5; }
.message-preview { padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; line-height: 1.55; max-height: 220px; overflow: auto; margin-bottom: 16px; }
.send-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.send-btn { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); text-align: left; color: var(--text); transition: background .15s, border-color .15s; }
.send-btn:hover { background: var(--surface-2); border-color: var(--subtle); }
.send-btn .icon { width: 22px; height: 22px; color: var(--primary); }
.send-btn.wa .icon { color: #1b8a5f; }
.send-btn b { display: block; font-size: 13.5px; }
.send-btn small { display: block; font-size: 12px; color: var(--muted); }
.send-btn.is-main { border-color: var(--primary); box-shadow: var(--ring); }
/* Lettre de relance */
.doc .letter-addr { margin: 6px 0 18px auto; width: 55%; font-size: 11pt; line-height: 1.45; }
.doc .letter-date { text-align: right; margin-bottom: 14px; }
.doc .letter-mode { margin-bottom: 8px; text-transform: uppercase; font-size: 10pt; letter-spacing: .06em; }
.doc .letter-object { margin-bottom: 14px; }
.doc .letter-body { text-align: justify; line-height: 1.6; }
.doc .letter-sign { margin: 28px 0 0 auto; width: 45%; text-align: center; min-height: 90px; }
.doc .letter-sign small { display: block; color: #5d7186; font-size: 9pt; }
.doc .letter-ack { margin-top: 24px; border: 1px dashed #8a9aab; padding: 10px 14px; font-size: 10pt; display: flex; flex-direction: column; gap: 6px; min-height: 80px; }
@media (max-width: 1100px) { .relance-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 14px; } }
@media (max-width: 720px) {
  .relance-steps, .send-grid, .relance-summary { grid-template-columns: 1fr; }
  .relance-summary div { border-right: 0; border-bottom: 1px solid #f2cccc; }
  .doc .letter-addr { width: 100%; }
}

/* ==========================================================================
   Version 4 : bailleurs, pièces jointes, garantie, états des lieux, travaux,
   comptabilité, maisons libres, paramètres, rapports.
   ========================================================================== */
.nav-link .nav-badge.info { background: var(--primary); }
.chip-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.chip { display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--text-2); }
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.owner-card .row1 .avatar { width: 40px; height: 40px; font-size: 14px; }
.owner-link { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--primary); }
.owner-link:hover { background: var(--primary-50); }
.owner-link .icon { width: 15px; height: 15px; }
.section-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.total-row td { background: var(--primary-50) !important; font-weight: 700; color: var(--text) !important; }
.note-row td { white-space: normal !important; font-size: 12.5px; color: var(--muted) !important; background: var(--surface-2) !important; padding-top: 6px !important; }
.kpi-value.small-value { font-size: 20px; }
.kpi-value.txt-danger { color: var(--danger); }
.mini-title { font-size: 13px; font-weight: 700; margin: 16px 0 4px; }
.code-box { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; background: var(--nav-900); color: #d7e8f7; padding: 10px 12px; border-radius: 9px; word-break: break-all; margin: 8px 0; user-select: all; }
.test-form { border-top: 1px dashed var(--line); padding-top: 14px; }
.steps-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }

/* Actions à mener (tableau de bord) */
.todo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; padding: 12px; }
.todo-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); transition: background .15s, border-color .15s; }
.todo-item:hover { background: var(--surface-2); border-color: var(--line-strong); }
.todo-item > span:nth-child(2) { flex: 1; min-width: 0; }
.todo-item b { display: block; font-size: 13.5px; }
.todo-item small { display: block; font-size: 12px; color: var(--muted); }
.todo-item .dot { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; flex: none; }
.todo-item .dot .icon { width: 17px; height: 17px; }
.todo-item .dot.red { background: var(--danger-bg); color: var(--danger); }
.todo-item .dot.in { background: var(--in-bg); color: var(--in); }
.todo-item .dot.wh { background: var(--wh-bg); color: var(--wh); }
.todo-go { width: 16px; height: 16px; color: var(--subtle); }

/* Pièces jointes */
.attachment-item .pj-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.pj-form { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.pj-form .dropzone { padding: 16px; }
.pj-row { display: flex; gap: 8px; }
.pj-row input { flex: 1; height: 34px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 9px; font-size: 13px; outline: none; }
.pj-row input:focus { border-color: var(--primary); box-shadow: var(--ring); }

/* États des lieux */
.edl-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.edl-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px dashed var(--line-strong); border-radius: 12px; color: var(--text); }
.edl-card .icon { width: 20px; height: 20px; color: var(--primary); flex: none; }
.edl-card b { display: block; font-size: 13.5px; }
.edl-card small { display: block; font-size: 12px; color: var(--muted); }
a.edl-card:hover { border-color: var(--primary); background: var(--primary-50); }
.edl-card.done { border-style: solid; border-color: #c4e6d6; background: var(--success-bg); }
.edl-card.done .icon { color: var(--success); }
.edl-card.muted { opacity: .7; }
.edl-editor table { min-width: 820px; }
.edl-editor td:nth-child(1) { width: 20%; } .edl-editor td:nth-child(2) { width: 26%; } .edl-editor td:nth-child(3) { width: 15%; } .edl-editor td:nth-child(5) { width: 44px; }
.doc .edl-table td { font-size: 10pt; }
.doc .edl-table .edl-piece td { background: #f2f5f8; font-family: var(--font); font-size: 9.5pt; }
.doc .edl-table .edl-worse td { color: #9b2c2c; background: #fdf0f0; }
.retenues { width: 100%; border-collapse: collapse; margin: 10px 0 6px; }
.retenues td { padding: 3px 4px 3px 0; }
.retenues td:last-child { width: 40px; }
.retenues input { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; font-size: 13px; }
.retenues td:nth-child(2) { width: 120px; }

/* Travaux : onglets et tableau de suivi */
.tabs { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tab { padding: 10px 14px; font-size: 13.5px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--primary); border-bottom-color: var(--primary); }
.tab-filters { margin-left: auto; display: flex; gap: 8px; align-items: center; padding-bottom: 6px; }
.tab-filters select { height: 34px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 9px; background: #fff; font-size: 13px; }
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
.board-col { background: #eaeef3; border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 120px; }
.board-col h3 { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.board-col h3 > span:last-child { font-size: 12px; font-weight: 700; color: var(--muted); background: #fff; border-radius: 99px; padding: 1px 9px; }
.ticket { display: flex; flex-direction: column; gap: 5px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--primary); border-radius: 10px; padding: 11px 12px; color: var(--text); box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .15s; }
.ticket:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.ticket.prio-urgente { border-left-color: var(--danger); }
.ticket.prio-basse { border-left-color: var(--line-strong); }
.ticket b { font-size: 13.5px; line-height: 1.35; }
.ticket small { font-size: 12px; color: var(--muted); }
.ticket-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); align-items: center; }
.ticket-meta b { font-size: 12.5px; color: var(--text); }
.board-empty { font-size: 12.5px; text-align: center; padding: 12px 4px; }
.record-field.wide { grid-column: 1 / -1; border-right: 0; }

/* E-mail des relances */
.send-form { display: contents; }
.send-form .send-btn { width: 100%; font: inherit; cursor: pointer; }
.send-btn.is-done { border-color: #c4e6d6; background: var(--success-bg); }
.send-btn.is-done .icon { color: var(--success); }
.send-btn.is-off { opacity: .6; }

/* Rapports imprimables (paysage) */
.doc.report { width: 297mm; min-height: 0; padding: 14mm 12mm; font-family: var(--font); font-size: 9.5pt; }
.report-title { font-size: 13pt; margin: 14px 0 2px; color: #0d2a45; }
.report-sub { color: #5d7186; font-size: 9pt; margin: 0 0 8px; }
.report-table { width: 100%; border-collapse: collapse; margin-bottom: 14px; font-size: 9pt; }
.report-table th { background: #1d6fb0; color: #fff; text-align: left; padding: 5px 7px; font-weight: 600; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.report-table td { border-bottom: 1px solid #e2e8ee; padding: 4px 7px; }
.report-table tbody tr:nth-child(even) td { background: #f8fafc; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.report-table tfoot td { font-weight: 700; background: #edf5fc; border-top: 1.5px solid #1d6fb0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.report-table .num { text-align: right; white-space: nowrap; }
@media print { body.report-page { } @page { size: A4; margin: 0; } body.report-page .doc.report { width: auto; } }
@media print { .no-print { display: none !important; } }
@media (max-width: 1200px) { .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .board, .edl-cards { grid-template-columns: 1fr; }
  .tab-filters { margin-left: 0; width: 100%; }
  .doc.report { padding: 8mm 5mm; }
}
