/* =====================================================================
   MAGIC COPIEUR — Fiche d'intervention (maintenance)
   ===================================================================== */
.fiche-head { border-radius: var(--r-lg); overflow: hidden; color: #fff; background: linear-gradient(120deg, var(--acc-3), var(--acc) 70%, var(--acc-1)); box-shadow: var(--shadow-lg); position: relative; }
.fiche-head::after { content: ""; position: absolute; right: -50px; top: -60px; width: 200px; height: 200px; border-radius: 50%; border: 30px solid rgba(245, 124, 0, .45); }
.fiche-head .fh-top { display: flex; align-items: center; gap: 12px; padding: 16px 16px 6px; position: relative; z-index: 1; }
.fiche-head .fh-top img { width: 44px; height: 44px; background: #fff; border-radius: 12px; padding: 4px; }
.fiche-head .fh-title { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; opacity: .85; font-weight: 600; }
.fiche-head .fh-num { font-size: 21px; font-weight: 800; letter-spacing: .01em; }
.fh-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: rgba(255, 255, 255, .18); margin-top: 10px; position: relative; z-index: 1; }
.fh-grid > div { background: rgba(0, 0, 0, .22); padding: 9px 16px; min-width: 0; }
.fh-grid small { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; opacity: .75; }
.fh-grid b { font-size: 13.5px; font-weight: 600; }
@media (min-width: 720px) { .fh-grid { grid-template-columns: repeat(4, 1fr); } }
.auto-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: rgba(255, 255, 255, .2); margin-left: 6px; vertical-align: middle; letter-spacing: 0; text-transform: none; }
.auto-tag .svg-i { width: 11px; height: 11px; }

.fsec { margin-top: 14px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); animation: up .4s both; }
.fsec-h { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.fsec-n { width: 28px; height: 28px; flex: none; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; background: linear-gradient(135deg, var(--orange-2), var(--orange)); box-shadow: 0 4px 10px -4px var(--orange); }
.fsec-n .svg-i { width: 16px; height: 16px; }
.fsec-h h3 { font-size: 15px; font-weight: 700; flex: 1; color: var(--navy); }
:root[data-theme="dark"] .fsec-h h3 { color: #fff; }
.fsec-h .fsec-hint { font-size: 11.5px; color: var(--muted); }
.fsec-b { padding: 14px 16px; }
.fsec-b > .field:last-child { margin-bottom: 0; }
.fiche-cols { display: grid; gap: 0 14px; }
.fiche-cols > * { min-width: 0; }
@media (min-width: 1024px) { .fiche-cols { grid-template-columns: 1fr 1fr; align-items: start; } }
.ro-box { padding: 10px 12px; border-radius: 10px; background: var(--card-2); border: 1px solid var(--line); font-size: 13.5px; white-space: pre-wrap; min-height: 42px; }

/* Puces à cocher (état de la machine, accessoires) */
.opts { display: flex; flex-wrap: wrap; gap: 7px; }
.opt { position: relative; cursor: pointer; user-select: none; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt span { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 10px; border: 1.5px solid var(--line-2); background: var(--card); font-size: 12.5px; font-weight: 500; color: var(--ink-2); transition: .15s; }
.opt span .svg-i { width: 14px; height: 14px; display: none; }
.opt input:checked + span { border-color: var(--c, var(--blue)); background: color-mix(in srgb, var(--c, var(--blue)) 12%, var(--card)); color: var(--c, var(--blue)); font-weight: 600; }
.opt input:checked + span .svg-i { display: inline; }
.opt input:focus-visible + span { box-shadow: var(--ring); }
.quick-txt { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 10px; }
.quick-txt button { font-size: 11.5px; padding: 4px 10px; border-radius: 99px; background: var(--card-2); border: 1px dashed var(--line-2); color: var(--ink-2); }
.quick-txt button:hover { border-color: var(--blue); color: var(--blue); }

/* Pavé de signature */
.sig-wrap { position: relative; border: 2px dashed var(--line-2); border-radius: 14px; background: #fff; overflow: hidden; }
.sig-wrap canvas { display: block; width: 100%; height: 190px; touch-action: none; cursor: crosshair; }
.sig-wrap .sig-line { position: absolute; left: 22px; right: 22px; bottom: 42px; border-bottom: 1px solid #cbd5e1; pointer-events: none; }
.sig-wrap .sig-ph { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; font-size: 11.5px; color: #94a3b8; pointer-events: none; }
.sig-wrap.signed .sig-ph { display: none; }
.sig-wrap.signed { border-color: var(--green); border-style: solid; }
.sig-img { max-height: 120px; background: #fff; border-radius: 10px; border: 1px solid var(--line); padding: 4px; }

/* Photos avant / après */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 560px) { .photo-grid { grid-template-columns: repeat(4, 1fr); } }
.ph { position: relative; aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden; background: var(--card-2); border: 1px solid var(--line); animation: pop .3s both; }
.ph img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.ph .ph-del { position: absolute; top: 5px; right: 5px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(15, 23, 42, .65); color: #fff; }
.ph .ph-del .svg-i { width: 15px; height: 15px; }
.ph-add { aspect-ratio: 1 / 1; border-radius: 12px; border: 2px dashed var(--line-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--blue); font-size: 11.5px; font-weight: 600; cursor: pointer; background: var(--card); transition: .15s; text-align: center; padding: 4px; }
.ph-add:hover { border-color: var(--blue); background: var(--tint-blue); }
.ph-add .svg-i { width: 26px; height: 26px; }
.ph-cols { display: grid; gap: 14px; }
@media (min-width: 720px) { .ph-cols { grid-template-columns: 1fr 1fr; } }
.ph-col-h { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.ph-col-h i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.lightbox { position: fixed; inset: 0; z-index: 130; background: rgba(2, 6, 23, .92); display: grid; place-items: center; padding: 16px; animation: fade .2s both; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 88vh; border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); animation: popIn .25s both; }
.lightbox .lb-cap { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: #fff; font-size: 13px; opacity: .85; }

/* Suivi du statut (frise) */
.flow { display: flex; align-items: flex-start; padding: 16px 6px 12px; position: relative; }
.flow-step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; z-index: 1; text-align: center; font-size: 10.5px; font-weight: 600; color: var(--muted); line-height: 1.2; }
.flow-step .fs-dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--card-2); border: 2px solid var(--line-2); color: var(--muted); transition: .3s; }
.flow-step .fs-dot .svg-i { width: 17px; height: 17px; }
.flow-step.done .fs-dot { background: var(--c); border-color: var(--c); color: #fff; }
.flow-step.done { color: var(--ink); }
.flow-step.cur .fs-dot { animation: pulse 1.8s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 25%, transparent); } 50% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--c) 6%, transparent); } }
.flow-step:not(:last-child)::after { content: ""; position: absolute; top: 17px; left: calc(50% + 19px); right: calc(-50% + 19px); height: 3px; border-radius: 3px; background: var(--line); z-index: -1; }
.flow-step.done:not(:last-child)::after { background: var(--c); }

/* Actions de statut */
.actions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.act-btn { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; color: #fff; font-weight: 600; font-size: 13.5px; text-align: left; background: linear-gradient(135deg, color-mix(in srgb, var(--c) 72%, #fff), var(--c)); box-shadow: 0 8px 18px -10px var(--c); transition: transform .12s; }
.act-btn:active { transform: scale(.97); }
.act-btn .svg-i { width: 22px; height: 22px; flex: none; }
.act-btn small { display: block; font-weight: 500; font-size: 11px; opacity: .88; }

/* Historique */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 14px; animation: up .3s both; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: -22px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--c, var(--blue)); box-shadow: 0 0 0 3px var(--card); }
.tl-item b { font-size: 13px; }
.tl-item .tl-s { font-size: 11.5px; color: var(--muted); }

/* Documents et paiement */
.docs-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.doc-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 12.5px; font-weight: 600; color: var(--ink-2); transition: transform .15s, border-color .15s; text-align: center; }
.doc-btn:hover { transform: translateY(-2px); border-color: var(--c, var(--blue)); }
.doc-btn .svg-i { width: 26px; height: 26px; color: var(--c, var(--blue)); }
.pay-banner { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; font-weight: 600; }
.pay-banner .svg-i { width: 24px; height: 24px; flex: none; }
.pay-banner.non_payee { background: var(--tint-red); color: var(--red); }
.pay-banner.partielle { background: var(--tint-amber); color: var(--amber); }
.pay-banner.payee { background: var(--tint-green); color: var(--green); }
.pay-banner.sans_frais { background: var(--card-2); color: var(--muted); }
.inter-card { display: block; color: inherit; }
.inter-card .ic-photo { width: 58px; height: 58px; border-radius: 12px; object-fit: cover; flex: none; background: var(--card-2); }
.new-inter-cta { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--r-lg); color: #fff; background: linear-gradient(120deg, #c2410c, var(--orange) 55%, #ffa53a); box-shadow: 0 14px 26px -14px var(--orange); margin-bottom: 14px; transition: transform .15s; }
.new-inter-cta:hover { transform: translateY(-2px); }
.new-inter-cta .nic-ic { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; background: rgba(255, 255, 255, .22); flex: none; }
.new-inter-cta .nic-ic .svg-i { width: 28px; height: 28px; }
.new-inter-cta b { font-size: 16px; display: block; }
.new-inter-cta small { opacity: .9; font-size: 12px; }
.plist > * { min-width: 0; }
.inter-card .row-between { flex-wrap: wrap; row-gap: 6px; }
.form-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-top: 16px; }
.form-actions .btn { white-space: normal; text-align: center; line-height: 1.2; }
