/* CV Chantier — charte Coray Vallat : Scandia, noir pur, gris neutres */
@font-face { font-family: Scandia; src: url(../fonts/Scandia-Light.woff2) format('woff2'); font-weight: 300; font-display: swap; }
@font-face { font-family: Scandia; src: url(../fonts/Scandia-Regular.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Scandia; src: url(../fonts/Scandia-Medium.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: Scandia; src: url(../fonts/Scandia-Bold.woff2) format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --ink: #000;
  --grey: #6e6e6e;
  --line: #d0d0d0;
  --soft: #f3f3f3;
  --bg: #fff;
  --danger: #a3281d;
  --rail: 78px;
  --top: 56px;
  --radius: 6px;
  font-family: Scandia, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-size: 15px; font-weight: 400; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-weight: 700; margin: 0; letter-spacing: .01em; }
a { color: inherit; }
.muted { color: var(--grey); }
.hidden { display: none !important; }

/* ---------- Coque ---------- */
#app { display: grid; grid-template-columns: var(--rail) 1fr; height: 100dvh; }
.rail { background: #000; color: #fff; display: flex; flex-direction: column; align-items: stretch; padding: 10px 0; overflow-y: auto; }
.rail .brand { display: grid; place-items: center; height: 64px; margin-bottom: 6px; }
.rail .brand img { height: 36px; width: auto; }
.rail a.nav { color: #bdbdbd; text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 4px; font-size: 11px; letter-spacing: .02em; border-left: 3px solid transparent; }
.rail a.nav:hover { color: #fff; }
.rail a.nav.active { color: #fff; border-left-color: #fff; background: #1a1a1a; }
.rail .spacer { flex: 1; }
.main { display: grid; grid-template-rows: var(--top) 1fr; min-width: 0; min-height: 0; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line); background: #fff; min-width: 0; }
.topbar .title { font-weight: 700; font-size: 16px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .sub { color: var(--grey); font-weight: 400; margin-left: 8px; }
.content { overflow: auto; min-height: 0; position: relative; }
.pad { padding: 20px 24px 60px; max-width: 1500px; }

.ico { display: inline-flex; vertical-align: middle; }

/* ---------- Boutons & champs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border: 1px solid #000; border-radius: var(--radius); background: #fff; color: #000; cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn:hover { background: var(--soft); }
.btn.primary { background: #000; color: #fff; }
.btn.primary:hover { background: #2b2b2b; }
.btn.ghost { border-color: var(--line); }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.danger.fill { background: var(--danger); color: #fff; }
.btn.small { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; background: transparent; border-radius: 50%; cursor: pointer; color: inherit; }
.icon-btn:hover { background: var(--soft); }
.icon-btn.mic.on { background: var(--danger); color: #fff; }
.fab { position: fixed; right: 22px; bottom: 22px; z-index: 20; }

.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; min-width: 0; }
.field > span { font-size: 12px; color: var(--grey); letter-spacing: .02em; }
.field small { color: var(--grey); font-size: 12px; }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=url], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; font-size: 16px;
}
textarea { min-height: 84px; resize: vertical; line-height: 1.4; }
input:focus, select:focus, textarea:focus { outline: 2px solid #000; outline-offset: -1px; border-color: #000; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: #000; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.right { justify-content: flex-end; }
.with-mic { position: relative; }
.with-mic textarea { padding-right: 48px; }
.with-mic .icon-btn { position: absolute; right: 4px; top: 4px; }

.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 26px 0 10px; padding-bottom: 8px; border-bottom: 1px solid #000; }
.section-title h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { position: sticky; top: 0; background: var(--soft); text-align: left; font-weight: 500; font-size: 12px; color: var(--grey); padding: 9px 12px; white-space: nowrap; border-bottom: 1px solid var(--line); user-select: none; }
table.t th.sort { cursor: pointer; }
table.t th.sort:hover { color: #000; }
table.t td { padding: 9px 12px; border-bottom: 1px solid #ececec; vertical-align: middle; }
table.t tr.clickable { cursor: pointer; }
table.t tr.clickable:hover td { background: #fafafa; }
table.t tr.sel td { background: #efefef; }
table.t td.wrap { white-space: normal; min-width: 220px; }
.num { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px; color: #fff; font-weight: 700; font-size: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.chip i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.tag { display: inline-block; padding: 1px 8px; border: 1px solid var(--line); border-radius: 10px; font-size: 12px; color: var(--grey); }
.tag.urgent { border-color: var(--danger); color: var(--danger); }

/* ---------- Barre d'outils de liste ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .search { position: relative; flex: 1 1 220px; max-width: 360px; }
.toolbar .search .ico { position: absolute; left: 10px; top: 10px; color: var(--grey); }
.toolbar .search input { padding-left: 38px; }
.toolbar select { width: auto; min-width: 150px; }

/* ---------- Cartes projets ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.card { border: 1px solid var(--line); border-radius: 8px; padding: 18px; background: #fff; cursor: pointer; display: flex; flex-direction: column; gap: 6px; min-height: 140px; }
.card:hover { border-color: #000; }
.card h3 { font-size: 17px; }
.card .meta { color: var(--grey); font-size: 13px; }
.card .stats { margin-top: auto; display: flex; gap: 14px; font-size: 13px; }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.hero img { height: 54px; }

/* ---------- Liste plans ---------- */
.plan-card { display: grid; grid-template-columns: 96px 1fr auto; align-items: center; gap: 14px; padding: 10px 12px; border-bottom: 1px solid #ececec; cursor: pointer; }
.plan-card:hover { background: #fafafa; }
.plan-card .thumb { width: 96px; height: 68px; object-fit: contain; background: var(--soft); border: 1px solid var(--line); border-radius: 4px; }
.plan-card .name { font-weight: 500; }

/* ---------- Tiroir / panneaux ---------- */
.split { display: grid; grid-template-columns: 1fr; height: 100%; }
.split.with-drawer { grid-template-columns: 1fr 440px; }
.drawer { border-left: 1px solid var(--line); background: #fff; overflow-y: auto; display: flex; flex-direction: column; min-height: 0; }
.drawer-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 2; }
.drawer-head h3 { flex: 1; font-size: 16px; }
.drawer-body { padding: 16px; flex: 1; }
.drawer-foot { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 10px 14px; display: flex; gap: 10px; justify-content: flex-end; }
.photos { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.photos .ph { position: relative; width: 84px; height: 84px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); cursor: pointer; background: var(--soft); }
.photos .ph img { width: 100%; height: 100%; object-fit: cover; }
.photos .ph button { position: absolute; top: 2px; right: 2px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.7); color: #fff; cursor: pointer; display: grid; place-items: center; padding: 0; }
.photos .add { display: grid; place-items: center; width: 84px; height: 84px; border: 1px dashed #000; border-radius: 6px; background: #fff; cursor: pointer; font-size: 12px; gap: 2px; align-content: center; }
.history { border-top: 1px solid var(--line); margin-top: 6px; }
.history .item { padding: 8px 0; border-bottom: 1px solid #ececec; font-size: 13px; }
.history .item small { color: var(--grey); display: block; }

/* ---------- Visites / présences ---------- */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 7px 12px; cursor: pointer; font-size: 13px; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: #000; color: #fff; }
.listcol { border-right: 1px solid var(--line); overflow-y: auto; min-height: 0; }
.listcol .item { padding: 12px 16px; border-bottom: 1px solid #ececec; cursor: pointer; }
.listcol .item:hover { background: #fafafa; }
.listcol .item.on { background: var(--soft); border-left: 3px solid #000; padding-left: 13px; }
.listcol .item b { display: block; }
.twocol { display: grid; grid-template-columns: 300px 1fr; height: 100%; }
.twocol > .detail { overflow-y: auto; padding: 20px 24px 60px; min-width: 0; }
.attend { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid #ececec; }

/* ---------- Remarques ---------- */
.rem-chap { font-size: 15px; text-transform: uppercase; letter-spacing: .05em; margin: 26px 0 4px; padding-bottom: 6px; border-bottom: 2px solid #000; }
.rem-sub { font-weight: 700; margin: 16px 0 4px; }
.rem { display: grid; grid-template-columns: 28px 1fr 84px 34px auto; gap: 10px; align-items: start; padding: 8px 0; border-bottom: 1px solid #ececec; }
.row-head { display: flex; align-items: center; gap: 8px; }
.gen-text { color: var(--grey); font-size: 13px; line-height: 1.45; white-space: pre-wrap; margin: 0 0 6px; max-height: 3.0em; overflow: hidden; }
.gen-item { border-bottom: 1px solid #ececec; padding: 10px 0 12px; }
.ini { display: inline-block; min-width: 26px; text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .02em; padding: 1px 4px; border: 1px solid var(--line); border-radius: 4px; color: #000; }
.rem .ini:empty { border: 0; }
.nowrap { white-space: nowrap; font-size: 13px; }
.cfc-btn { white-space: nowrap; }
.cfc-list { max-height: 52vh; overflow: auto; border-top: 1px solid var(--line); }
.cfc-row { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid #f0f0f0; }
.cfc-row .cfc-tw { width: 32px; height: 32px; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.cfc-row .cfc-pick { flex: 1; display: flex; gap: 10px; align-items: baseline; text-align: left; padding: 9px 8px; border: 0; background: transparent; cursor: pointer; font: inherit; min-width: 0; }
.cfc-row .cfc-code { min-width: 52px; font-variant-numeric: tabular-nums; }
.cfc-row.l1 { background: #000; color: #fff; }
.cfc-row.l1 .cfc-pick, .cfc-row.l1 .icon-btn { color: #fff; }
.cfc-row.l2 { background: #f1f1f1; font-weight: 500; }
.cfc-row.on { outline: 2px solid #000; outline-offset: -2px; }
.cfc-row .cfc-pick:hover { background: #f6f6f6; }
.cfc-row.l1 .cfc-pick:hover { background: #222; }
.rem.done .txt { text-decoration: line-through; color: var(--grey); }
.rem.urgent .txt { color: var(--danger); }
.rem .date { color: var(--grey); font-size: 13px; padding-top: 2px; }
.rem .txt { cursor: pointer; line-height: 1.4; }

/* ---------- Tableau de bord ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 8px; }
.kpi { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; cursor: pointer; }
.kpi:hover { border-color: #000; }
.kpi b { display: block; font-size: 34px; line-height: 1.1; font-weight: 700; }
.kpi span { font-size: 13px; color: var(--grey); display: flex; align-items: center; gap: 6px; }
.kpi i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 24px; }
.chart h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }
.bar-row { display: grid; grid-template-columns: 170px 1fr 34px; gap: 10px; align-items: center; margin: 5px 0; font-size: 13px; }
.bar-row .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .bar { display: flex; height: 16px; background: var(--soft); border-radius: 2px; overflow: hidden; }
.bar-row .bar i { display: block; height: 100%; box-shadow: inset -2px 0 0 #fff; }
.only-mobile { display: none !important; }
@media (max-width: 900px) { .only-mobile { display: inline-flex !important; } }
.bar-row .n { text-align: right; color: var(--grey); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; margin-bottom: 8px; color: var(--grey); }

/* ---------- Modales, toasts ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal { background: #fff; border-radius: 10px; width: min(520px, 100%); max-height: 92dvh; display: flex; flex-direction: column; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.modal.wide { width: min(760px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 20px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: #000; color: #fff; padding: 11px 20px; border-radius: 8px; opacity: 0; transition: .25s; z-index: 200; max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.photo-full { max-width: 100%; max-height: 74dvh; display: block; margin: 0 auto; }
.empty { text-align: center; color: var(--grey); padding: 60px 20px; }

/* ---------- Visionneuse de plan ---------- */
.viewer { display: grid; grid-template-rows: auto 1fr; height: 100%; background: #e9e9e9; position: relative; }
.viewer-bar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.viewer-bar .name { font-weight: 700; flex: 1; min-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vp { position: relative; overflow: hidden; touch-action: none; cursor: grab; min-height: 0; }
.vp.placing { cursor: crosshair; outline: 3px solid #000; outline-offset: -3px; }
.vp:active { cursor: grabbing; }
.stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; background: #fff; box-shadow: 0 2px 16px rgba(0,0,0,.25); }
.stage canvas, .stage img.plan-img { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.pin { position: absolute; width: 32px; height: 32px; margin: -16px 0 0 -16px; border-radius: 50%; transform: scale(calc(1 / var(--k, 1))); transform-origin: 50% 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; border: 2px solid #fff; box-shadow: 0 1px 6px rgba(0,0,0,.45); cursor: pointer; }
.pin.focus { outline: 3px solid #000; outline-offset: 3px; z-index: 5; }
.pin.draft { background: #fff !important; color: #000; border: 3px solid #000; }
.place-hint { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); background: #000; color: #fff; padding: 9px 16px; border-radius: 20px; font-size: 14px; z-index: 6; pointer-events: none; }
.zoom-ctl { position: absolute; right: 14px; top: 14px; display: flex; flex-direction: column; gap: 6px; z-index: 6; }
.zoom-ctl button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: #fff; cursor: pointer; display: grid; place-items: center; font-size: 20px; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 10; background: #fff; border-top: 1px solid #000; box-shadow: 0 -8px 30px rgba(0,0,0,.2); max-height: 78%; display: flex; flex-direction: column; }
.sheet .drawer-body { overflow-y: auto; }
@media (min-width: 901px) {
  .viewer .sheet { left: auto; top: 0; width: 400px; max-height: none; border-top: 0; border-left: 1px solid #000; box-shadow: -8px 0 30px rgba(0,0,0,.15); }
}
.viewer .side { position: absolute; right: 0; top: 0; bottom: 0; width: 340px; background: #fff; border-left: 1px solid var(--line); z-index: 9; overflow-y: auto; }

/* ---------- Rapport (aperçu + impression A4) ---------- */
.report-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 24px; border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 5; }
.report-bar label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.sheet-a4 { width: 210mm; min-height: 297mm; margin: 24px auto; padding: 14mm; background: #fff; box-shadow: 0 2px 16px rgba(0,0,0,.18); font-size: 10pt; line-height: 1.35; }
.rp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; border-bottom: 1.5px solid #000; padding-bottom: 8px; margin-bottom: 12px; }
.rp-head h1 { font-size: 20pt; margin: 0 0 2px; }
.rp-head .s1 { font-size: 11pt; }
.rp-head .s2 { color: #6e6e6e; font-size: 9pt; margin-top: 2px; }
.rp-head img { height: 18mm; width: auto; }
.rp h2 { font-size: 11pt; text-transform: uppercase; letter-spacing: .08em; margin: 16px 0 6px; padding-bottom: 3px; border-bottom: 1px solid #000; break-after: avoid; }
.rp h3 { font-size: 10pt; margin: 12px 0 4px; break-after: avoid; }
.rp table { width: 100%; border-collapse: collapse; font-size: 9pt; }
.rp th { text-align: left; color: #6e6e6e; font-weight: 500; font-size: 8pt; padding: 3px 6px; border-bottom: 1px solid #000; }
.rp td { padding: 4px 6px; border-bottom: 1px solid #d0d0d0; vertical-align: top; }
.rp tr { break-inside: avoid; }
.rp .pn { display: inline-block; min-width: 5mm; padding: 0 1.5mm; border-radius: 3mm; color: #fff; text-align: center; font-weight: 700; font-size: 8pt; }
.rp .thumbs { display: flex; gap: 2mm; margin-top: 2mm; }
.rp .thumbs img { height: 20mm; border: .3pt solid #d0d0d0; }
.rp .planimg { width: 100%; border: .3pt solid #d0d0d0; margin-bottom: 4mm; break-inside: avoid; }
.rp .remline { padding: 3px 0; border-bottom: .3pt solid #d0d0d0; break-inside: avoid; }
.rp .pvtxt { font-size: 9pt; line-height: 1.4; margin: 0 0 3mm; }
.rp table.pt { margin-bottom: 2mm; }
.rp table.pt td { border-bottom: .3pt solid #d0d0d0; }
.rp td.d { width: 34mm; font-size: 8pt; color: #000; }
.date-row { display: grid; grid-template-columns: 170px 1fr; gap: 8px; margin-bottom: 8px; }
.rp td.r { width: 11mm; font-weight: 700; text-align: right; }
.rp .subsec { font-size: 8pt; text-transform: uppercase; letter-spacing: .06em; color: #6e6e6e; margin: 3mm 0 1mm; break-after: avoid; }
.rp .entt { padding-left: 2.5mm; margin-top: 6mm; }
.rp tr.urg td { color: #c00000; font-weight: 700; }
.rp .coord { font-size: 8pt; color: #6e6e6e; font-weight: 400; }
.rp .late { font-size: 8pt; color: #c00000; font-weight: 700; }
.rp .chg { font-size: 8pt; font-weight: 400; color: #a3281d; border: .3pt solid #a3281d; border-radius: 2mm; padding: 0 1.5mm; }
.rp tr.entrow td { background: #f4f4f4; padding-top: 2mm; }

/* ---------- Entreprises, PV de chantier, planning ---------- */
.ent-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 14px; background: #fff; }
.colorpick { width: 38px; height: 38px; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: #fff; flex: none; cursor: pointer; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex: none; }
.tabs { margin: 0 0 8px; }
.tabs button[disabled] { opacity: .35; cursor: default; }
.att-group { display: flex; align-items: center; gap: 4px; margin-top: 14px; padding: 6px 10px; background: #f4f4f4; border-left: 6px solid #000; }
.urgent-toggle { display: flex; align-items: center; gap: 8px; margin: 4px 0 14px; cursor: pointer; }
.urgent-toggle span { font-weight: 700; color: var(--danger); }
.urgent-toggle small { color: var(--grey); }
.banner-late { background: #fdeceb; border: 1px solid #c00000; color: #c00000; padding: 10px 14px; border-radius: var(--radius); margin-bottom: 12px; }
.pvc-sec { border-left: 6px solid #999; padding: 4px 0 8px 14px; margin: 0 0 18px; }
.pvc-sec.empty { opacity: .7; }
.pvc-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.pvc-head h3 { margin: 0; font-size: 15px; flex: 1; min-width: 200px; }
.pvc-add { display: flex; gap: 6px; flex-wrap: wrap; }
.pvc-subsec { margin: 8px 0 4px; }
.pvc-sublabel { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--grey); margin-bottom: 2px; }
.pvc-none { font-size: 13px; padding-left: 4px; }
.pvi { display: grid; grid-template-columns: 28px 1fr; gap: 8px; padding: 7px 8px; border-bottom: 1px solid #ececec; align-items: start; }
.pvi-text { cursor: pointer; line-height: 1.4; display: flex; gap: 8px; align-items: flex-start; }
.pvi-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; color: var(--grey); font-size: 12px; margin-top: 3px; }
.pvi.urgent .pvi-text, .pvi.urgent .pvi-text * { color: #c00000; font-weight: 700; }
.pvi.echu { background: #fff6e8; outline: 2px solid #c07a1a; outline-offset: -2px; border-radius: 6px; }
.pvi.done .pvi-text { color: var(--grey); text-decoration: line-through; }
.pvi-act { display: flex; gap: 8px; margin-top: 6px; }
.pastille { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; color: #fff; font-size: 12px; font-weight: 700; flex: none; }
.tag.coord { color: #000; }
.tag.late { border-color: #c00000; color: #c00000; font-weight: 700; }
tr.urgent-row td { color: #c00000; font-weight: 700; }
.pin.late { box-shadow: 0 0 0 3px #fff, 0 0 0 6px #c00000; }
.pin.closed { opacity: .45; }
.nc-row { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-bottom: 1px solid #ececec; cursor: pointer; }
.nc-row:hover { background: #f6f6f6; }
.nc-box { max-height: 52vh; overflow: auto; border-top: 1px solid var(--line); }
.g-scroll { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); max-height: 72vh; background: #fff; }
.gantt { width: max-content; min-width: 100%; }
.g-row { display: flex; border-bottom: 1px solid #f0f0f0; min-height: 30px; align-items: stretch; }
.g-label { position: sticky; left: 0; z-index: 2; width: 270px; flex: none; background: #fff; padding: 6px 10px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-right: 1px solid var(--line); }
.g-group .g-label { font-weight: 700; background: #f1f1f1; }
.g-group .g-track { background: #f7f7f7; }
.g-item.urgent { color: #c00000; font-weight: 700; }
.g-head { position: sticky; top: 0; z-index: 3; background: #fff; border-bottom: 1px solid #000; min-height: 44px; }
.g-head .g-label { z-index: 4; font-weight: 700; display: flex; align-items: center; }
.g-track { position: relative; flex: none; background-image: linear-gradient(90deg, #eee 1px, transparent 1px); background-size: 77px 100%; }
.g-headtrack { background: none; }
.g-month { position: absolute; top: 0; height: 22px; line-height: 22px; font-size: 12px; font-weight: 700; padding-left: 6px; border-left: 1px solid #999; text-transform: capitalize; white-space: nowrap; overflow: hidden; }
.g-wk { position: absolute; top: 24px; font-size: 10px; color: var(--grey); padding-left: 2px; border-left: 1px solid #ddd; height: 18px; }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: #000; z-index: 1; }
.g-bar { position: absolute; top: 6px; height: 18px; border-radius: 4px; cursor: pointer; color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: flex-end; padding: 0 4px; z-index: 1; }
.g-bar.late { box-shadow: 0 0 0 2px #c00000; background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.3) 0 4px, transparent 4px 8px); }
.g-n { font-weight: 700; }
.lock-screen { position: fixed; inset: 0; z-index: 9999; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; text-align: center; }
.pin-dots { display: flex; gap: 12px; margin: 18px 0 4px; }
.pin-dots span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #000; }
.pin-dots span.on { background: #000; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 76px); gap: 12px; margin-top: 14px; }
.pin-key { height: 62px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: inherit; font-size: 22px; cursor: pointer; }
.pin-key:active { background: #000; color: #fff; }
.pin-key.alt { font-size: 16px; color: var(--grey); }

/* ---------- Divers ---------- */
.sync-dot { width: 9px; height: 9px; border-radius: 50%; background: #c8c8c8; display: inline-block; }
.sync-dot.ok { background: #5f7a52; }
.sync-dot.err { background: var(--danger); }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--grey); }
.kv dd { margin: 0; }

/* ---------- Tablette portrait / mobile ---------- */
@media (max-width: 900px) {
  .split.with-drawer { grid-template-columns: 1fr; }
  .split.with-drawer .drawer { position: fixed; inset: var(--top) 0 0 0; z-index: 30; border-left: 0; }
  .twocol { grid-template-columns: 1fr; }
  .twocol .listcol { max-height: 34dvh; border-right: 0; border-bottom: 1px solid var(--line); }
  .twocol.has-sel .listcol { display: none; }
  .pad { padding: 16px 14px 90px; }
  .grid3 { grid-template-columns: 1fr; }
  .charts { grid-template-columns: 1fr; }
  .viewer .side { width: 100%; top: auto; height: 50%; border-left: 0; border-top: 1px solid #000; }
}
@media (max-width: 720px) {
  #app { grid-template-columns: 1fr; grid-template-rows: 1fr 58px; }
  .rail { order: 2; flex-direction: row; padding: 0; overflow-x: auto; overflow-y: hidden; }
  .rail .brand, .rail .spacer { display: none; }
  .rail a.nav { flex: 1 0 auto; min-width: 54px; border-left: 0; border-top: 3px solid transparent; padding: 7px 4px; font-size: 10px; }
  .rail a.nav.active { border-top-color: #fff; }
  .main { order: 1; }
  .grid2 { grid-template-columns: 1fr; }
  .rem { grid-template-columns: 28px 1fr auto; }
  .rem .txt { grid-column: 2 / 4; }
  .rem .nowrap { grid-column: 2; }
  .rem .ini { grid-column: 3; justify-self: end; }
  .rem > .tag { grid-column: 2; justify-self: start; }
  .bar-row { grid-template-columns: 110px 1fr 28px; }
  .sheet-a4 { width: auto; margin: 0; padding: 12px; box-shadow: none; min-height: 0; }
}

/* ---------- Impression : rapport A4 ---------- */
@page { size: A4; margin: 14mm 14mm 16mm; @bottom-right { content: counter(page) " / " counter(pages); font-family: Scandia, sans-serif; font-size: 8pt; color: #6e6e6e; } }
@media print {
  html, body, #app, .main, .content { height: auto !important; overflow: visible !important; display: block !important; }
  .rail, .topbar, .report-bar, .toast, .noprint { display: none !important; }
  .sheet-a4 { width: auto; margin: 0; padding: 0; box-shadow: none; min-height: 0; }
  body { font-size: 10pt; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
