 :root{--green:#167b50;--green2:#20a36a;--ink:#1d2a25;--muted:#64736b;--line:#dce7e0;--bg:#f3f7f4;--white:#fff;--red:#b42318}
*{box-sizing:border-box}html{font-family:system-ui,-apple-system,"Segoe UI",sans-serif;background:var(--bg);color:var(--ink)}body{margin:0;min-width:300px}.topbar{display:flex;align-items:center;gap:12px;background:#fff;border-bottom:1px solid var(--line);padding:12px 18px;position:sticky;top:0;z-index:5}.brandmark{height:42px;width:42px;border-radius:12px;background:linear-gradient(135deg,#9bd33f,#08764a);color:#fff;display:grid;place-items:center;font-weight:900;font-size:25px}.brand{font-weight:850;letter-spacing:.06em;font-size:17px}.subbrand{font-size:10px;letter-spacing:.08em;color:#56635c}.status{margin-left:auto;font-size:12px;color:var(--green);background:#e7f6ec;padding:7px 10px;border-radius:20px;white-space:nowrap}main{max-width:1000px;margin:auto;padding:16px}.intro{padding:12px 4px 18px}.eyebrow{font-size:11px;letter-spacing:.16em;font-weight:800;color:var(--green)}h1{font-size:clamp(25px,4vw,36px);line-height:1.1;margin:7px 0}h2{font-size:22px;margin:0 0 5px}h3{font-size:17px;margin:0 0 5px}p{margin:5px 0}.muted{color:var(--muted);font-size:13px}.tabs{display:flex;gap:8px;overflow:auto;padding-bottom:12px}.tab{border:1px solid var(--line);background:#fff;color:var(--muted);border-radius:12px;padding:13px 16px;font-weight:700;white-space:nowrap;min-height:48px}.tab.active{background:#e4f5eb;border-color:#8dcbaa;color:#0c6841}.panel{background:#fff;border:1px solid var(--line);border-radius:18px;padding:18px;margin-bottom:16px;box-shadow:0 4px 18px #143a1d08}.hidden{display:none!important}.section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}.primary,.secondary,.danger,.import-button{display:inline-flex;align-items:center;justify-content:center;gap:7px;border:0;border-radius:12px;padding:13px 16px;min-height:48px;font-weight:750;font-size:15px;cursor:pointer;text-align:center}.primary{background:var(--green);color:#fff}.secondary{background:#edf3ef;color:#233d30;border:1px solid var(--line)}.danger{background:#fff0ef;color:var(--red);border:1px solid #f2c7c4}.project-list{display:grid;gap:10px}.project-card{border:1px solid var(--line);border-radius:14px;padding:15px;display:grid;grid-template-columns:1fr auto;gap:10px;align-items:center}.project-card h3{margin:0}.project-card p{font-size:13px;color:var(--muted)}.project-buttons{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end}.smallbtn{border:1px solid var(--line);background:#f5f8f6;border-radius:9px;padding:10px;font-weight:700;color:var(--ink)}.empty{padding:30px;text-align:center;color:var(--muted);border:1px dashed #c8d8ce;border-radius:14px;line-height:1.7}form label{display:block;font-size:14px;font-weight:700;margin:0 0 14px}input,select,textarea{display:block;width:100%;margin-top:7px;padding:13px;border:1px solid #cbd8cf;border-radius:11px;font:inherit;color:var(--ink);background:#fff;min-height:48px}textarea{resize:vertical}input:focus,select:focus,textarea:focus{outline:3px solid #bce6ce;border-color:var(--green)}.grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px}.gpsbox{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:14px;background:#f3f8f5;border:1px solid var(--line);border-radius:13px;margin-bottom:20px}.photo-head{align-items:center;margin-top:8px}.file-button,.import-button{position:relative;overflow:hidden}.photos{display:grid;grid-template-columns:repeat(auto-fill,minmax(135px,1fr));gap:10px;margin:12px 0 20px}.photo-card{border:1px solid var(--line);border-radius:12px;overflow:hidden;background:#fff}.photo-card img{width:100%;height:125px;object-fit:cover;display:block;background:#edf2ee}.photo-caption{padding:8px}.photo-caption input{font-size:12px;padding:8px;min-height:38px}.photo-caption button{margin-top:6px;width:100%}.form-actions{display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap;margin-top:18px}.action-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:18px 0}.action-grid>*{width:100%}.notice{background:#f1f8f3;border:1px solid #d4e8da;border-radius:12px;padding:14px;line-height:1.55;margin:12px 0;font-size:14px}.warning{background:#fff8e9;border-color:#f1dfb3}.danger-zone{border-top:1px solid var(--line);margin-top:24px;padding-top:18px}footer{max-width:1000px;margin:auto;padding:8px 18px 28px;color:var(--muted);font-size:12px;display:flex;justify-content:space-between;gap:8px}dialog{border:0;border-radius:18px;width:min(600px,calc(100% - 24px));padding:22px;box-shadow:0 20px 80px #0003}dialog::backdrop{background:#14251dcc}dialog h2{margin-bottom:18px}.toast{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);background:#1d2a25;color:#fff;padding:12px 18px;border-radius:12px;z-index:20;max-width:90vw;opacity:0;pointer-events:none;transition:opacity .2s}.toast.show{opacity:1}.project-card .project-meta{color:var(--green);font-size:12px;font-weight:700}.file-button input{position:absolute;inset:0;opacity:0;width:100%;height:100%;cursor:pointer}
@media(max-width:600px){main{padding:10px}.panel{padding:14px}.grid2{grid-template-columns:1fr;gap:0}.section-head{align-items:flex-start}.section-head .primary{padding:12px}.project-card{grid-template-columns:1fr}.project-buttons{justify-content:flex-start}.action-grid{grid-template-columns:1fr}.photo-head{flex-direction:column}.photo-head>*{width:100%}.form-actions>*{flex:1}footer{flex-direction:column}}
@media print{body{background:#fff}.topbar,.intro,.tabs,footer,.no-print{display:none!important}main{max-width:none;padding:0}.panel{border:0;box-shadow:none;padding:0}.report-page{page-break-after:always;padding:18mm 14mm}.report-cover{min-height:240mm;display:flex;flex-direction:column;justify-content:space-between}.report-title{font-size:34px;color:#167b50}.report-table{width:100%;border-collapse:collapse;margin-top:16px}.report-table th,.report-table td{border:1px solid #cbd8cf;padding:8px;text-align:left;font-size:11px;vertical-align:top}.report-photo-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}.report-photo-grid img{width:100%;max-height:75mm;object-fit:contain}.report-sheet{page-break-after:always}.report-small{font-size:11px;color:#444} }
/* Fiche terrain structurée : cadres clairement identifiés */
.form-section{border:1px solid #b9d9c5;border-radius:14px;padding:16px;margin:0 0 18px;min-width:0;background:#fbfdfb}
.form-section legend{padding:0 9px;font-size:16px;font-weight:850;color:#116b43}
.form-section .gpsbox{margin:4px 0 2px}
.layers-list{display:grid;gap:12px;margin:12px 0}
.layer-card{border:1px solid #d6e2da;border-left:5px solid var(--green);border-radius:12px;padding:13px;background:#fff}
.layer-card-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px;color:#116b43}
.layer-card label{margin-bottom:10px}
.layer-card label:last-child{margin-bottom:0}
.layer-card .grid2{gap:10px}
#addLayer{width:100%;border-style:dashed}
.report-section-title{background:#edf5ef;font-weight:800}
.nested-table{margin:0!important;width:100%}
@media(max-width:600px){.form-section{padding:12px}.layer-card{padding:10px}}
@media print{.report-table{page-break-inside:auto}.report-table tr{page-break-inside:avoid;page-break-after:auto}.nested-table th,.nested-table td{font-size:9px!important;padding:5px!important}}
.gps-map-box{border:1px solid #b9d9c5;border-radius:12px;padding:10px;margin-top:12px;background:#fff}.gps-map-title{display:flex;align-items:center;justify-content:space-between;gap:8px;font-weight:800;margin-bottom:8px}.map-number,.report-map-label{display:inline-block;background:#c92525;color:#fff;font-weight:900;border-radius:5px;padding:5px 9px;letter-spacing:.03em}.gps-map-box iframe{width:100%;height:230px;border:0;border-radius:8px;display:block}.gps-map-box a{display:inline-block;margin-top:8px;color:#116b43;font-weight:700;font-size:13px}.report-map{position:relative;border:1px solid #b9c9bd;padding:8px;margin:10px 0 18px;page-break-inside:avoid}.report-map iframe{width:100%;height:260px;border:0;display:block}.report-map .report-map-label{position:absolute;z-index:2;top:14px;left:14px;box-shadow:0 1px 4px #0004}.report-map a{color:#116b43}
@media print{.report-map iframe{height:220px;print-color-adjust:exact;-webkit-print-color-adjust:exact}.report-map-label{print-color-adjust:exact;-webkit-print-color-adjust:exact}}
.gps-map-box{border:1px solid #b9d9c5;border-radius:12px;padding:10px;margin-top:12px;background:#fff}.gps-map-title{display:flex;align-items:center;justify-content:space-between;gap:8px;font-weight:800;margin-bottom:8px}.map-number,.report-map-label{display:inline-block;background:#c92525;color:#fff;font-weight:900;border-radius:5px;padding:5px 9px;letter-spacing:.03em}.gps-map-box iframe{width:100%;height:230px;border:0;border-radius:8px;display:block}.gps-map-box a{display:inline-block;margin-top:8px;color:#116b43;font-weight:700;font-size:13px}.report-map{position:relative;border:1px solid #b9c9bd;padding:8px;margin:10px 0 18px;page-break-inside:avoid}.report-map iframe{width:100%;height:260px;border:0;display:block}.report-map .report-map-label{position:absolute;z-index:2;top:14px;left:14px;box-shadow:0 1px 4px #0004}.report-map a{color:#116b43}
@media print{.report-map iframe{height:220px;print-color-adjust:exact;-webkit-print-color-adjust:exact}.report-map-label{print-color-adjust:exact;-webkit-print-color-adjust:exact}}

/* TECHNILEC v1.1 — photos catégorisées et statut HAP */
.photo-upload-block{border:1px dashed #b9d9c5;border-radius:13px;padding:13px;margin:12px 0;background:#fff}
.photo-upload-block>.primary,.photo-upload-block>.secondary{margin-top:8px}
.hap-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:14px 0}
.hap-option{display:flex;align-items:center;gap:9px;padding:13px 10px;border:1px solid #d3ded7;border-radius:12px;background:#fff;cursor:pointer;margin:0}
.hap-option input{width:20px;height:20px;min-height:20px;accent-color:var(--green);flex-shrink:0}
.hap-option span{display:flex;flex-direction:column;gap:4px}.hap-option small{font-size:12px;line-height:1.3}
.hap-yes{border-color:#f3b4b4;background:#fff5f5}.hap-yes input{accent-color:#dc2626}
.hap-no{border-color:#9dd8bd;background:#f2fbf6}.hap-no input{accent-color:#16a34a}
.hap-pending{border-color:#f3d18b;background:#fffaf0}.hap-pending input{accent-color:#d97706}
.report-photo-empty{border:1px dashed #b9c9bd;border-radius:8px;padding:18px;color:#6b786f;font-size:11px;text-align:center;margin:8px 0}
.hap-report-status{font-weight:900;border:1px solid #b9d9c5;border-radius:8px;padding:10px;background:#f1f8f3}
.report-two-photos{display:grid;grid-template-columns:1fr 1fr;gap:12px}.report-two-photos h4{margin:8px 0}
.report-sheet h3{margin:18px 0 8px;padding:7px 9px;background:#edf5ef;color:#116b43;border-left:4px solid #167b50;font-size:15px}
.report-sheet h4{margin:10px 0 6px;color:#174b35;font-size:12px}
@media(max-width:600px){.hap-options{grid-template-columns:1fr}.report-two-photos{grid-template-columns:1fr}}
@media print{.photo-upload-block{break-inside:avoid}.report-two-photos{grid-template-columns:1fr 1fr}.report-photo-grid{break-inside:avoid}.hap-report-status{print-color-adjust:exact;-webkit-print-color-adjust:exact}}
