:root {
  --lin: #F6EFE6; --lin2: #EFE5D8; --lin3: #EADFCF; --cream: #FFF9F2;
  --terra: #C0643F; --terra-d: #A33C1D; --terra-l: #E3C4A8;
  --sable: #E8D9C4; --rose: #EBD3C4;
  --olive: #6B7A4B; --olive-l: #DDE2CC;
  --moutarde: #D9A441; --moutarde-l: #F3D8A2; --moutarde-d: #6E3F07;
  --noyer: #3B2A20; --muted: #8A7563; --line: rgba(59, 42, 32, .1);
  --r: 16px; --r-sm: 10px;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Nunito', system-ui, -apple-system, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--lin); color: var(--noyer); font-family: var(--sans); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
body.no-scroll { overflow: hidden; }
h1, h2, h3, .serif { font-family: var(--serif); font-weight: 500; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 26px; line-height: 1.2; } h2 { font-size: 19px; } h3 { font-size: 16px; }
a { color: inherit; }
p { margin: 0 0 .6em; }
button { font-family: inherit; font-size: inherit; color: inherit; }
.loading { display: grid; place-items: center; height: 100vh; font-size: 20px; color: var(--muted); }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .tiny { font-size: 11.5px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.wrap-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.right { text-align: right; } .nowrap { white-space: nowrap; }
.hide { display: none !important; }

/* ---------- Coquille ---------- */
.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: var(--lin2); padding: 22px 14px; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; background: var(--terra); color: var(--cream); display: grid; place-items: center; font-size: 20px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: var(--noyer); opacity: .75; font-weight: 600; font-size: 14px; }
.nav-link i { font-size: 20px; }
.nav-link:hover { background: var(--lin3); opacity: 1; }
.nav-link.on { background: var(--terra); color: var(--cream); opacity: 1; }
.side .spacer { flex: 1; }
.main { padding: 26px 30px 60px; max-width: 1180px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.kicker { font-size: 12.5px; color: var(--muted); margin-bottom: 2px; }
.bottom-nav, .fab { display: none; }

@media (max-width: 899px) {
  .shell { display: block; }
  .side { display: none; }
  .main { padding: 18px 16px calc(110px + var(--safe-b)); }
  h1 { font-size: 24px; }
  .bottom-nav { display: flex; position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; background: var(--cream); border-top: 1px solid var(--line);
    padding: 8px 6px calc(10px + var(--safe-b)); justify-content: space-around; }
  .bottom-nav a { flex: 1; text-align: center; text-decoration: none; font-size: 11px; font-weight: 600; opacity: .6; }
  .bottom-nav a i { display: block; font-size: 23px; }
  .bottom-nav a.on { color: var(--terra); opacity: 1; }
  .bottom-nav .fab-slot { flex: 1; }
  .fab { display: grid; place-items: center; position: fixed; z-index: 21; left: 50%; transform: translateX(-50%); bottom: calc(26px + var(--safe-b));
    width: 56px; height: 56px; border-radius: 50%; border: 4px solid var(--lin); background: var(--terra); color: var(--cream); font-size: 26px; cursor: pointer; }
}

/* ---------- Éléments ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; border: none; border-radius: 12px; padding: 9px 15px; background: var(--terra); color: var(--cream); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--terra-d); }
.btn.ghost { background: var(--lin3); color: var(--noyer); }
.btn.ghost:hover { background: var(--sable); }
.btn.light { background: var(--cream); color: var(--noyer); border: 1px solid var(--line); }
.btn.danger { background: var(--terra-d); }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 10px; }
.btn i { font-size: 17px; }
.icon-btn { border: none; background: transparent; width: 36px; height: 36px; border-radius: 10px; display: inline-grid; place-items: center; cursor: pointer; font-size: 19px; color: var(--noyer); }
.icon-btn:hover { background: var(--lin3); }
.bar { height: 8px; border-radius: 8px; background: rgba(59, 42, 32, .1); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 8px; transition: width .4s; }
.bar.light { background: rgba(255, 247, 238, .28); }
.panel { background: var(--cream); border-radius: var(--r); padding: 16px 18px; }
.panel + .panel { margin-top: 14px; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 7px; background: var(--lin3); white-space: nowrap; }
.tag.warn { background: var(--moutarde-l); color: var(--moutarde-d); }
.tag.danger { background: #F4C9B8; color: var(--terra-d); }
.tag.ok { background: var(--olive-l); color: #3F4B25; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs a { padding: 7px 13px; border-radius: 10px; background: var(--lin3); text-decoration: none; font-size: 13.5px; font-weight: 600; }
.tabs a.on { background: var(--noyer); color: var(--lin); }
.empty { text-align: center; padding: 30px 16px; color: var(--muted); }
.empty i { font-size: 34px; display: block; margin-bottom: 6px; color: var(--terra-l); }

/* ---------- Tableau de bord ---------- */
.hello { margin-bottom: 18px; }
.overall { display: flex; align-items: center; gap: 12px; margin-top: 10px; max-width: 620px; }
.overall .bar { flex: 1; height: 10px; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.card { border-radius: 22px; padding: 16px 18px; min-height: 150px; cursor: pointer; transition: transform .18s; position: relative; text-align: left; border: none; width: 100%; font: inherit; color: inherit; display: block; }
.card:hover { transform: translateY(-3px); }
.card .lt { font-size: 12.5px; font-weight: 600; opacity: .8; }
.card .big { font-family: var(--serif); font-weight: 500; font-size: 30px; line-height: 1.1; margin: 10px 0 2px; }
.card .mid { font-family: var(--serif); font-weight: 500; font-size: 19px; line-height: 1.2; margin: 10px 0 8px; }
.card ul { margin: 0; padding: 0; list-style: none; font-size: 13.5px; line-height: 1.75; }
.card li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-terra { background: var(--terra); color: #FFF7EE; }
.c-sable { background: var(--sable); }
.c-moutarde { background: var(--moutarde-l); }
.c-olive { background: var(--olive); color: #F4F1E6; }
.c-cream { background: var(--cream); }
.c-rose { background: var(--rose); }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0 8px; }
.thumbs span { aspect-ratio: 1; border-radius: 10px; background: rgba(244, 241, 230, .22) center/cover; display: grid; place-items: center; font-size: 13px; }
.dash-gantt { margin-top: 16px; cursor: pointer; }
.dots { display: none; }
@media (max-width: 899px) {
  .cards { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; margin: 0 -16px; padding: 4px 16px 6px; scrollbar-width: none; }
  .cards::-webkit-scrollbar { display: none; }
  .card { flex: 0 0 78%; scroll-snap-align: center; min-height: 190px; }
  .dots { display: flex; justify-content: center; align-items: center; gap: 6px; padding: 6px 0 12px; }
  .dots .icon-btn { width: 32px; height: 32px; font-size: 18px; opacity: .6; }
  .dots span { width: 7px; height: 7px; border-radius: 7px; background: var(--noyer); opacity: .2; transition: all .2s; cursor: pointer; }
  .cards { cursor: grab; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; touch-action: pan-x pan-y; }
  .card:hover { transform: none; }
  .dots span.on { opacity: .8; width: 18px; }
}

/* Panneau latéral (ordinateur) */
.drawer-wrap { position: fixed; inset: 0; z-index: 40; background: rgba(59, 42, 32, .18); animation: fade .2s; }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: var(--cream); padding: 22px; overflow: auto; animation: slide .25s ease-out; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

/* ---------- Listes et tableaux ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { border-radius: 16px; padding: 12px 14px; }
.kpi .v { font-family: var(--serif); font-size: 23px; font-weight: 500; line-height: 1.2; }
.kpi .l, .kpi .s { font-size: 12px; opacity: .8; }
@media (max-width: 899px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.reserve-band { display: flex; height: 14px; border-radius: 7px; overflow: hidden; gap: 2px; margin: 8px 0; background: rgba(59,42,32,.06); }
.reserve-band i { display: block; min-width: 3px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; }
.legend b { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }

.lot-head, .lot-row { display: grid; grid-template-columns: minmax(130px, 1.2fr) minmax(120px, 2fr) 90px 80px 70px; gap: 12px; align-items: center; padding: 10px 10px; }
.lot-head { font-size: 11.5px; color: var(--muted); padding-bottom: 2px; }
.lot-row { border-radius: 12px; cursor: pointer; }
.lot-row:hover { background: var(--cream); }
.lot-row .name { font-weight: 700; font-size: 14px; }
.stack { position: relative; height: 13px; border-radius: 7px; background: rgba(59, 42, 32, .08); overflow: hidden; }
.stack i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 7px; }
.stack b { position: absolute; top: 0; bottom: 0; width: 2px; }
.lot-detail { margin: 0 10px 10px; padding: 12px 14px; background: var(--cream); border-radius: 12px; font-size: 13.5px; }
.pos { color: var(--terra-d); } .neg { color: var(--olive); }
@media (max-width: 899px) {
  .lot-head { display: none; }
  .lot-row { grid-template-columns: 1fr auto; grid-template-areas: "n e" "s s" "d a"; row-gap: 6px; background: var(--cream); margin-bottom: 8px; }
  .lot-row > :nth-child(1) { grid-area: n; } .lot-row > :nth-child(2) { grid-area: s; }
  .lot-row > :nth-child(3) { grid-area: d; text-align: left !important; } .lot-row > :nth-child(4) { grid-area: e; }
  .lot-row > :nth-child(5) { grid-area: a; }
}
.list { display: grid; gap: 8px; }
.item { background: var(--cream); border-radius: 14px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; }
.item .grow { flex: 1; min-width: 0; }
.item.done { opacity: .55; }
.item.done .label { text-decoration: line-through; }
table.simple { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.simple th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); padding: 6px 8px; }
table.simple td { padding: 8px; border-top: 1px solid var(--line); }
table.simple td.num, table.simple th.num { text-align: right; white-space: nowrap; }

/* ---------- Gantt ---------- */
.gantt { position: relative; }
.g-row { display: grid; grid-template-columns: var(--gl, 240px) minmax(0, 1fr); align-items: stretch; border-bottom: 1px solid var(--line); min-height: 34px; }
.g-row.head { min-height: 22px; border-bottom: none; font-size: 11.5px; color: var(--muted); }
.g-label { padding: 7px 10px 7px 0; min-width: 0; cursor: pointer; }
.g-label .t { font-size: 13.5px; font-weight: 600; line-height: 1.3; display: flex; gap: 6px; align-items: flex-start; overflow-wrap: anywhere; }
.g-label .t .ti { font-size: 15px; opacity: .55; flex: none; margin-top: 1px; }
.g-label .sub { font-size: 11.5px; color: var(--muted); line-height: 1.35; margin-top: 1px; }
.g-note { grid-column: 1 / -1; padding: 0 0 10px; }
.g-note .row { margin-top: 4px; flex-wrap: wrap; }
.g-note textarea { width: 100%; min-height: 0; font-size: 13px; line-height: 1.4; resize: none; overflow: hidden; }
.g-track { position: relative; min-height: 34px; }
.g-grid { position: absolute; inset: 0; pointer-events: none; }
.g-grid i { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(59, 42, 32, .07); }
.g-bar { position: absolute; top: 50%; height: 13px; margin-top: -6.5px; border-radius: 7px; cursor: pointer; transition: left .35s, width .35s; min-width: 4px; }
.g-bar .prog { position: absolute; inset: 0; border-radius: 7px; background: rgba(59,42,32,.28); }
.g-ms { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; transform: rotate(45deg); border-radius: 2px; transition: left .35s; }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--terra); opacity: .75; pointer-events: none; z-index: 2; }
.g-today span { position: absolute; top: -16px; left: -12px; font-size: 10.5px; color: var(--terra); font-weight: 700; }
.g-row.compact { min-height: 24px; }
.g-row.compact .g-label { padding: 3px 8px 3px 0; }
.g-row.compact .g-label .t { font-size: 12px; font-weight: 600; }
.g-row.compact .g-track { min-height: 24px; }
.g-row.compact .g-bar { height: 10px; margin-top: -5px; }
.sim { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sim input[type=range] { flex: 1; min-width: 140px; accent-color: var(--terra); }
@media (max-width: 899px) { .gantt { --gl: 140px !important; } .g-label .sub { display: none; } .g-label.open .sub { display: block; } .g-label .t { font-size: 12.5px; } }

/* ---------- Journal ---------- */
.entries { display: grid; gap: 12px; }
.entry { background: var(--cream); border-radius: 16px; padding: 14px 16px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; margin-top: 10px; }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; cursor: zoom-in; display: block; background: var(--lin3); }
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(30, 20, 14, .92); display: grid; place-items: center; padding: 20px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }

/* ---------- Formulaires et fenêtres ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(59, 42, 32, .28); display: grid; place-items: center; padding: 20px; animation: fade .18s; }
.modal-wrap.closing { opacity: 0; transition: opacity .18s; }
.modal { background: var(--lin); border-radius: 22px; width: min(520px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 18px 20px 20px; }
.modal.wide { width: min(760px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; position: sticky; top: -18px; background: var(--lin); padding-top: 2px; z-index: 1; }
@media (max-width: 899px) {
  .modal-wrap { place-items: end stretch; padding: 0; }
  .modal, .modal.wide { width: 100%; border-radius: 22px 22px 0 0; max-height: 92vh; padding-bottom: calc(24px + var(--safe-b)); animation: up .22s ease-out; }
  @keyframes up { from { transform: translateY(40px); } }
}
.field { display: grid; gap: 4px; margin-bottom: 12px; font-size: 13px; font-weight: 600; }
.field small { font-weight: 400; color: var(--muted); font-size: 12px; }
input, select, textarea { font: inherit; font-weight: 400; font-size: 15px; color: var(--noyer); background: var(--cream); border: 1px solid rgba(59, 42, 32, .16); border-radius: 11px; padding: 9px 11px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--terra); box-shadow: 0 0 0 3px rgba(192, 100, 63, .15); }
textarea { min-height: 80px; resize: vertical; }
input[type=checkbox] { width: 19px; height: 19px; accent-color: var(--terra); flex: none; margin: 0; }
input[type=range] { padding: 0; border: none; background: transparent; accent-color: var(--terra); }
.check { display: flex; gap: 9px; align-items: center; font-size: 14px; font-weight: 500; margin-bottom: 10px; cursor: pointer; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 12px; }
@media (max-width: 560px) { .grid3 { grid-template-columns: 1fr 1fr; } }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.actions .left { margin-right: auto; }
.sub-list { display: grid; gap: 6px; margin-bottom: 8px; }
.sub-line { display: grid; grid-template-columns: 1fr 110px 36px; gap: 6px; align-items: center; }
.sub-line.pay { grid-template-columns: 1fr 100px 132px 96px 36px; }
@media (max-width: 560px) { .sub-line.pay { grid-template-columns: 1fr 1fr; } }
.section-title { font-family: var(--serif); font-size: 15px; font-weight: 500; margin: 16px 0 8px; }
.toast { position: fixed; z-index: 70; left: 50%; bottom: 100px; transform: translateX(-50%); background: var(--noyer); color: var(--lin); padding: 10px 18px; border-radius: 12px; font-size: 14px; transition: opacity .3s; }
.toast.out { opacity: 0; }

/* ---------- Pages d'impression ---------- */
.print-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.print-opts { background: var(--cream); border-radius: 16px; padding: 14px 16px; margin-bottom: 16px; }
.sheet { background: #fff; color: var(--noyer); margin: 0 auto 20px; padding: 14mm 14mm; box-shadow: 0 1px 0 var(--line), 0 6px 24px rgba(59,42,32,.08); border-radius: 4px; font-size: 11.5px; }
.sheet.landscape { width: 297mm; max-width: 100%; }
.sheet.portrait { width: 210mm; max-width: 100%; }
.sheet .s-head { border-bottom: 2px solid var(--terra); padding-bottom: 6px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.sheet h1 { font-size: 20px; }
.sheet .meta { color: var(--muted); font-size: 11px; }
.sheet table { width: 100%; border-collapse: collapse; font-size: 11px; }
.sheet th, .sheet td { padding: 5px 6px; border-bottom: 1px solid #EFE5D8; text-align: right; font-weight: 400; vertical-align: top; }
.sheet th { color: var(--muted); }
.sheet th:first-child, .sheet td:first-child { text-align: left; }
.sheet tr.total td { font-weight: 700; border-top: 1.5px solid var(--noyer); }
.sheet .boxes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 12px; }
.sheet .boxes div { background: var(--lin); border-radius: 6px; padding: 7px 9px; }
.sheet .boxes .v { font-family: var(--serif); font-size: 15px; font-weight: 500; }
.sheet .h2 { font-family: var(--serif); font-size: 13px; font-weight: 500; margin: 14px 0 4px; }
.sheet .ask { border: 1.5px solid var(--terra); border-radius: 8px; padding: 9px 12px; margin-top: 14px; }
.sheet .g-row { min-height: 0; border-bottom: 1px solid #EFE5D8; break-inside: avoid; }
.sheet .g-label { cursor: default; padding: 4px 8px 4px 0; }
.sheet .g-label .t { font-size: 11.5px; }
.sheet .g-label .sub { font-size: 10.5px; white-space: normal; display: block; color: #5F4A3C; }
.sheet .g-track { min-height: 26px; }
.sheet .g-bar { height: 10px; margin-top: -5px; }
.sheet .contacts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 14px; font-size: 10.5px; margin-top: 10px; }
.sheet .foot { color: var(--muted); font-size: 10.5px; margin-top: 10px; }
.sheet .hl .g-label .t { color: var(--terra-d); }
.sheet .dim { opacity: .45; }

/* ---------- Sélection pour le compte rendu ---------- */
.entry.pick { cursor: pointer; border: 2px solid var(--terra-l); }
.entry.pick.off { opacity: .45; border-color: transparent; }
.pick-box { font-size: 22px; color: var(--terra); }
.pick-photo { position: relative; }
.pick-photo span { position: absolute; top: 4px; right: 4px; background: var(--cream); border-radius: 6px; font-size: 18px; color: var(--terra); line-height: 1; }
.pick-photo.off img { opacity: .3; }

/* ---------- Compte rendu ---------- */
.print-only { display: none; }
.cr-sheet .cr-parts th, .cr-sheet .cr-parts td { text-align: left; }
.cr-pres { border: none; background: none; font: inherit; color: inherit; padding: 0; cursor: pointer; min-width: 30px; text-align: left; }
.cr-sec { margin-top: 12px; }
.cr-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-family: var(--serif); font-size: 13.5px; font-weight: 500; border-bottom: 1.5px solid var(--terra); padding-bottom: 3px; margin: 14px 0 6px; }
.cr-h.sub { font-size: 12px; border-bottom: 1px solid #EFE5D8; margin-top: 10px; }
.cr-item { position: relative; padding: 6px 0 8px 14px; border-bottom: 1px dotted #EADFCF; break-inside: avoid; }
.cr-item::before { content: ''; position: absolute; left: 2px; top: 13px; width: 5px; height: 5px; border-radius: 50%; background: var(--terra); }
.cr-item.imp::before { background: var(--terra-d); width: 7px; height: 7px; left: 1px; top: 12px; }
.cr-item.imp .cr-text { font-weight: 700; }
.cr-item.done .cr-text, .cr-item.done .cr-ta { text-decoration: line-through; color: var(--muted); }
.cr-meta { display: flex; flex-wrap: wrap; gap: 4px; }
.cr-meta:not(:empty) { margin-bottom: 3px; }
.cr-meta .tag { font-size: 9.5px; padding: 1px 6px; }
.cr-text { white-space: pre-wrap; font-size: 11.5px; }
.cr-ta { width: 100%; min-height: 0; border: 1px dashed rgba(59,42,32,.22); background: transparent; border-radius: 6px; padding: 4px 6px; font-size: 13px; resize: none; overflow: hidden; line-height: 1.4; }
.cr-ta:focus { background: #FFFDF9; border-style: solid; }
.cr-photos { display: grid; gap: 6px; margin-top: 6px; grid-template-columns: repeat(var(--pc, 3), minmax(0, 1fr)); }
.cr-sheet.ps-s { --pc: 4; } .cr-sheet.ps-l { --pc: 2; }
.cr-photos figure { margin: 0; position: relative; }
.cr-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; display: block; background: var(--lin); }
.cr-photos figcaption { font-size: 9.5px; color: var(--muted); margin-top: 2px; }
.cr-photos .icon-btn { position: absolute; top: 3px; right: 3px; width: 28px; height: 28px; background: rgba(255,249,242,.9); }
.cr-ctrl { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-top: 6px; font-size: 12px; color: var(--muted); }
.cr-ctrl select, .cr-ctrl input[type=date] { width: auto; padding: 3px 6px; font-size: 12px; border-radius: 8px; }
.cr-ctrl label { display: inline-flex; gap: 5px; align-items: center; }
.cr-ctrl input[type=checkbox] { width: 15px; height: 15px; }
.cr-ctrl .icon-btn { width: 28px; height: 28px; font-size: 16px; }
.cr-empty { color: var(--muted); font-style: italic; padding: 4px 0 4px 14px; }
.cr-add { margin: 6px 0 0 10px; }
.cr-next { margin-top: 14px; }

@media print {
  .print-only { display: block; }
  .cr-item { padding-bottom: 6px; }
  html, body { background: #fff; }
  .side, .bottom-nav, .fab, .no-print, .toast { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; max-width: none; }
  .sheet { box-shadow: none; margin: 0; padding: 0; width: auto !important; border-radius: 0; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Devis et factures */
.spin { display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
table.cmp th:first-child, table.cmp td:first-child { text-align: left; position: sticky; left: 0; background: var(--cream); z-index: 1; }
table.cmp tr > th:first-child { color: var(--muted); font-weight: 600; }
.cmp-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; align-items: start; }
@media (max-width: 899px) { .cmp-notes { grid-template-columns: 1fr; } }

/* Plans : visionneuse */
.plan-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 0; }
.plan-bar .icon-btn[disabled] { opacity: .3; }
.plan-stage { overflow: auto; height: calc(100vh - 230px); min-height: 320px; background: var(--lin3); border-radius: var(--r); position: relative; touch-action: none; cursor: grab; overscroll-behavior: contain; }
.plan-page { position: relative; margin: 0 auto; will-change: transform; }
.plan-page canvas { position: absolute; inset: 0; width: 100%; height: 100%; box-shadow: 0 1px 6px rgba(59, 42, 32, .12); }
.v-help { margin-top: 6px; }
.v-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }
.viewer.full { position: fixed; inset: 0; z-index: 60; background: var(--lin); display: flex; flex-direction: column; padding: 6px 10px calc(6px + env(safe-area-inset-bottom)); }
.viewer.full .v-head, .viewer.full .v-help { display: none; }
.viewer.full .plan-stage { flex: 1; height: auto; border-radius: 10px; }
body.viewer-full .bottom-nav, body.viewer-full .fab { display: none; }
@media (max-width: 899px) { .plan-stage { height: calc(100vh - 290px); } }
