/* PREVENTER — Suivi clients */
:root {
  --navy: #134F5C; --blue: #168289; --teal: #10958F; --orange: #ED7D31;
  --bg: #F4F6FA; --card: #FFFFFF; --text: #1E2633; --muted: #5F6B7D; --line: #E1E6EE;
  --red: #C0392B; --red-bg: #FDECEA; --amber: #9A5B00; --amber-bg: #FFF3E0;
  --green: #1E7B4C; --green-bg: #E6F4EC; --grey-bg: #EEF1F5; --blue-bg: #E4F3F3;
  --radius: 10px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 15px; color: var(--text); background: var(--bg); line-height: 1.45; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; margin: 0; color: var(--navy); }
h2 { font-size: 17px; margin: 0; color: var(--navy); }
h3 { font-size: 15px; margin: 0 0 8px; color: var(--navy); }
small, .muted { color: var(--muted); }

/* Mise en page */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; background: linear-gradient(to right, var(--navy) 236px, var(--bg) 236px); }
.sidebar { background: linear-gradient(180deg, #0F4652 0%, #145A66 100%); color: #fff; padding: 20px 14px; position: sticky; top: 0; height: 100vh; align-self: start; display: flex; flex-direction: column; }
.brand { font-weight: 800; letter-spacing: .5px; font-size: 19px; padding: 4px 10px 18px; }
.brand span { color: var(--orange); }
.brand small { display: block; color: #AFC3E3; font-weight: 400; font-size: 12px; letter-spacing: 0; }
.nav a { display: flex; align-items: center; gap: 10px; color: #D9EEEE; padding: 9px 12px; border-radius: 8px; margin-bottom: 2px; }
.nav a:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.nav a.active { background: var(--teal); color: #fff; }
.nav .ico { width: 18px; text-align: center; opacity: .9; }
.sidebar .bottom { margin-top: auto; font-size: 13px; color: #A9D3D3; padding: 10px; }
.sidebar .bottom form { margin-top: 6px; }
.sidebar .bottom button { background: none; border: 0; color: #fff; padding: 0; cursor: pointer; font: inherit; text-decoration: underline; }
.main { padding: 26px 32px 60px; min-width: 0; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Cartes */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); display: block; color: inherit; }
.kpi:hover { text-decoration: none; border-color: var(--blue); }
.kpi .v { font-size: 28px; font-weight: 700; color: var(--navy); line-height: 1.1; }
.kpi .l { color: var(--muted); font-size: 13px; margin-top: 4px; }
.kpi.alert .v { color: var(--red); }
.kpi.warn .v { color: var(--amber); }

/* Tableaux */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 600; background: #FAFBFD; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #FAFCFF; }
.table-wrap { overflow-x: auto; }
td.nowrap, th.nowrap { white-space: nowrap; }
.row-link { color: var(--text); font-weight: 600; }

/* Badges */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--grey-bg); color: var(--muted); }
.badge-retard { background: var(--red-bg); color: var(--red); }
.badge-a_lancer { background: var(--red-bg); color: var(--red); }
.badge-bientot { background: var(--amber-bg); color: var(--amber); }
.badge-a_planifier { background: var(--amber-bg); color: var(--amber); }
.badge-ok { background: var(--green-bg); color: var(--green); }
.badge-libre, .badge-info { background: var(--blue-bg); color: var(--blue); }
.badge-hors_suivi, .badge-na { background: var(--grey-bg); color: var(--muted); }
.tag { display: inline-block; font-size: 12px; padding: 1px 7px; border-radius: 6px; background: var(--grey-bg); color: var(--muted); }
.tag-orange { background: #FDEBDD; color: #A4511B; }

/* Boutons */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--navy); padding: 7px 13px; border-radius: 8px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--blue); text-decoration: none; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: #126C72; }
.btn-accent { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn-danger { color: var(--red); }
.btn-danger:hover { border-color: var(--red); }
.btn-sm { padding: 4px 9px; font-size: 13px; }
.btn-link { background: none; border: 0; color: var(--blue); cursor: pointer; padding: 0; font: inherit; }
form.inline { display: inline; }

/* Formulaires */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: 14px; }
.field .help { font-size: 12.5px; color: var(--muted); }
.field .err { font-size: 13px; color: var(--red); }
input[type=text], input[type=url], input[type=tel], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=search], select, textarea {
  font: inherit; padding: 8px 10px; border: 1px solid #CBD3DF; border-radius: 8px; background: #fff; color: var(--text); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(22,130,137,.25); border-color: var(--blue); }
textarea { min-height: 90px; resize: vertical; }
.check { flex-direction: row; align-items: center; gap: 8px; }
.check input { width: 18px; height: 18px; }
.form-heading { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 4px; color: var(--navy); font-weight: 700; }
.has-err input, .has-err select, .has-err textarea { border-color: var(--red); }
.form-actions { display: flex; gap: 10px; margin-top: 20px; }

/* Messages */
.flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 14px; font-weight: 500; }
.flash-success { background: var(--green-bg); color: var(--green); }
.flash-error { background: var(--red-bg); color: var(--red); }
.flash-info { background: var(--blue-bg); color: var(--navy); }

/* Fiche client */
.client-head { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 18px; border-left: 5px solid var(--navy); }
.client-head .meta { display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--muted); margin-top: 8px; font-size: 14px; }
.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.sum { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.sum .t { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 600; }
.sum .v { font-size: 16px; font-weight: 700; color: var(--navy); margin: 6px 0 6px; }
.sum a { color: inherit; }
.site { border: 1px solid var(--line); border-radius: 9px; padding: 14px 16px; margin-bottom: 12px; }
.site-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.site-name { font-weight: 700; color: var(--navy); }
.kv { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 16px; margin: 12px 0 6px; font-size: 14px; }
.kv .k { color: var(--muted); font-size: 12px; }
details summary { cursor: pointer; color: var(--blue); font-size: 14px; margin-top: 6px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { border-left: 3px solid var(--blue); padding: 4px 0 14px 14px; margin-left: 4px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 8px; width: 11px; height: 11px; border-radius: 50%; background: #fff; border: 3px solid var(--blue); }
.timeline .when { font-weight: 700; color: var(--navy); }
.timeline .cr { white-space: pre-wrap; margin-top: 6px; font-size: 14px; }
.timeline .next { background: var(--amber-bg); border-radius: 6px; padding: 6px 10px; margin-top: 6px; font-size: 14px; white-space: pre-wrap; }
.empty { color: var(--muted); font-style: italic; padding: 6px 0; }
.mailbox { white-space: pre-wrap; background: #FAFBFD; border: 1px solid var(--line); border-radius: 8px; padding: 14px; font-size: 14px; max-height: 520px; overflow: auto; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar input[type=search] { max-width: 320px; }
.toolbar select { width: auto; }
.pill-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.pill-nav a { padding: 5px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--navy); font-size: 14px; }
.pill-nav a.on { background: var(--navy); color: #fff; border-color: var(--navy); }

/* Connexion / installation */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 30px 16px; background: linear-gradient(160deg, #0F4652, #10958F); }
.auth .box { background: #fff; border-radius: 14px; padding: 30px 32px; width: 100%; max-width: 420px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.auth .box.wide { max-width: 720px; }
.auth .brand { color: var(--navy); padding: 0 0 6px; font-size: 22px; }
.auth .brand small { color: var(--muted); }
.auth .field { margin-bottom: 14px; }

@media (max-width: 1100px) {
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .app { grid-template-columns: 1fr; background: var(--bg); }
  .sidebar { position: static; height: auto; }
  .main { padding: 18px 14px 40px; }
  .form-grid { grid-template-columns: 1fr; }
}
@media print {
  .sidebar, .actions, .btn, form { display: none !important; }
  .app { display: block; }
  body { background: #fff; }
  .card, .sum, .client-head { box-shadow: none; }
}

/* ===== DUERP éditable (v1.1) ===== */
.prio { color: #fff; }
.prio-1 { background: #D93025; color: #fff; }
.prio-2 { background: #E8710A; color: #fff; }
.prio-3 { background: #F2C94C; color: #4A3B00; }
.prio-4 { background: #34A853; color: #fff; }
.kpi-prio-1 .v { color: #D93025; } .kpi-prio-2 .v { color: #E8710A; } .kpi-prio-3 .v { color: #B08800; } .kpi-prio-4 .v { color: #1E7B4C; }
table.matrix { width: auto; }
table.matrix th, table.matrix td { text-align: center; border: 1px solid #fff; min-width: 64px; }
table.matrix td { font-weight: 700; font-size: 17px; height: 46px; }
table.matrix td small { display: block; font-size: 10px; font-weight: 400; opacity: .7; }
.cell-prio-1 { background: #F8C9C5; } .cell-prio-2 { background: #FCD9B8; } .cell-prio-3 { background: #FBEDB6; } .cell-prio-4 { background: #CDEBD5; }
table.risques td.num { text-align: center; white-space: nowrap; }
.mesures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; background: #FAFBFD; border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-top: 6px; font-size: 13px; }
.cotation { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 220px; gap: 14px; align-items: end; }
.calc-out { background: var(--blue-bg); border-radius: 10px; padding: 10px 14px; display: grid; gap: 4px; font-size: 14px; }
.calc-out strong { font-size: 18px; color: var(--navy); }
form.quick { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
form.quick select, form.quick input { width: auto; padding: 5px 6px; font-size: 13px; }
.btn-ia { background: linear-gradient(135deg, #5B3DF5, #2E75B6); border-color: transparent; color: #fff; }
.btn-ia:hover { filter: brightness(1.08); border-color: transparent; }
.btn-ia:disabled { opacity: .7; cursor: wait; }
.ia-panel { border: 1px solid #C9C1FB; background: #FAF9FF; }
.ia-wait { padding: 10px 12px; border-radius: 8px; background: #EFEBFF; color: #4B32C8; margin-top: 10px; font-size: 14px; }
.ia-justif { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: #EFEBFF; font-size: 14px; }
.ia-filled { background: #F4F1FF !important; border-color: #8C79F8 !important; }
.ia-choice { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 8px 0; background: #fff; cursor: pointer; }
.ia-choice input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.chat { display: flex; flex-direction: column; gap: 10px; margin: 10px 0 14px; max-height: 60vh; overflow: auto; }
.msg { padding: 10px 14px; border-radius: 12px; max-width: 85%; font-size: 14.5px; line-height: 1.5; }
.msg-user { align-self: flex-end; background: var(--blue); color: #fff; }
.msg-assistant { align-self: flex-start; background: #F4F1FF; border: 1px solid #E1DAFE; }
.bloc { padding: 12px 14px; }
.bloc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.bloc textarea { min-height: 38px; resize: vertical; }
.bloc textarea.in-titre { font-weight: 700; color: var(--navy); font-size: 16px; }
.bloc-table { margin-bottom: 6px; }
.bloc-table th, .bloc-table td { padding: 3px; border-bottom: 0; background: none !important; }
.bloc-table th textarea { font-weight: 600; background: #F6F8FB; }
.bloc-table td:last-child { width: 30px; text-align: center; }
.bloc-kv .bloc-table th { width: 32%; }
.bloc-foot { display: flex; gap: 6px; }
.add-bloc { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.doc-preview { border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; background: #fff; max-height: 520px; overflow: auto; margin-top: 10px; }
.doc-preview h3 { margin-top: 12px; }
table.kvp { margin: 6px 0; }
table.kvp th, table.kvp td { border: 1px solid var(--line); font-size: 13px; padding: 5px 7px; text-transform: none; letter-spacing: 0; }
@media (max-width: 1100px) { .cotation, .mesures { grid-template-columns: 1fr 1fr; } }

/* ===== v1.2 : sinistralité, vérifications, notifications ===== */
.nav .count { margin-left: auto; background: var(--orange); color: #fff; border-radius: 999px; padding: 0 8px; font-size: 12px; font-weight: 700; line-height: 20px; }
.nav .count-alert { background: #D93025; }
table.bars td { border: 0; padding: 4px 6px; font-size: 13px; }
table.bars td.bar { width: 45%; }
table.bars td.bar span { display: block; height: 12px; border-radius: 6px; background: var(--blue); min-width: 2px; }
table.bars td.num, table.kvt td:last-child { text-align: right; white-space: nowrap; }
table.kvt td { font-size: 14px; padding: 6px 8px; }
table.kvt.prop td:last-child, table.kvt.diff td:last-child { text-align: left; white-space: normal; }
table.kvt.diff td.del { background: #FDECEA; } table.kvt.diff td.add { background: #E6F4EC; }
table.edit-grid th, table.edit-grid td { padding: 4px; font-size: 13px; }
table.edit-grid textarea { min-height: 34px; font-size: 13px; }
table.edit-grid td.num { text-align: right; white-space: nowrap; }
.avap { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; font-size: 14px; }
.avap > div { background: #FAFBFD; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.avap > div:last-child { background: #F4F1FF; border-color: #E1DAFE; }
.calc-card { background: var(--blue-bg); border-color: #CFE0F2; }
.notif { display: block; padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--text); }
.notif:hover { background: #FAFCFF; text-decoration: none; }
.notif.unread { border-left: 4px solid var(--orange); background: #FFFBF7; }
.mod .card-head { align-items: flex-start; }
.ia-choice.conflict { border-color: #F2C94C; background: #FFFBEB; }

.beta-banner { background: repeating-linear-gradient(45deg, #ED7D31, #ED7D31 12px, #F08F4D 12px, #F08F4D 24px); color: #fff; font-weight: 800; letter-spacing: .5px; text-align: center; padding: 6px; border-radius: 8px; margin-bottom: 14px; }

/* Logo */
.brand-logo { display: block; background: #fff; border-radius: 12px; padding: 10px 14px; margin: 0 4px 18px; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.brand-logo img { width: 100%; max-width: 168px; height: auto; display: inline-block; }
.brand-logo:hover { text-decoration: none; filter: brightness(1.02); }
.brand-sub { color: #A9D3D3; font-size: 12px; text-align: center; margin: 0 0 16px; }
.auth-logo { text-align: center; margin-bottom: 4px; }
.auth-logo img { width: 190px; height: auto; }
.auth-sub { text-align: center; color: var(--muted); margin: 0 0 6px; font-size: 14px; }
@media (max-width: 800px) { .brand-logo img { max-width: 120px; } }

/* Annexes du DUERP (rendu du document à l'écran) */
.doc-view { font-size: 14px; }
.doc-view h3 { margin: 16px 0 6px; color: var(--navy); }
.doc-view table { width: 100%; border-collapse: collapse; margin: 6px 0 12px; }
.doc-view table th, .doc-view table td { border: 1px solid var(--line); padding: 6px 8px; vertical-align: top; text-align: left; }
.doc-view table.kv th { width: 34%; background: var(--grey-bg); }
.doc-view table.grid thead th { background: var(--navy); color: #fff; }
.doc-view ul { margin: 4px 0 8px; padding-left: 20px; }

/* Vue entreprise */
.progress { height: 8px; background: var(--grey-bg); border-radius: 6px; overflow: hidden; margin-bottom: 3px; }
.progress span { display: block; height: 100%; background: var(--teal); }
tr.total-row td { background: var(--blue-bg); border-top: 2px solid var(--line); }
.kpis .kpi { text-decoration: none; }

.sin-lies { margin-top: 6px; font-size: 12px; color: #9A3B00; background: #FFF3E0; border-radius: 6px; padding: 4px 8px; }
/* Parcours d'intégration */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-top: 12px; }
.photo { border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: grid; gap: 6px; background: #fff; }
.photo img { width: 100%; height: 130px; object-fit: cover; border-radius: 6px; }
.photo .doc { display: block; padding: 40px 8px; text-align: center; background: var(--grey-bg); border-radius: 6px; font-size: 13px; }
ol.quiz > li { margin-bottom: 14px; }
ol.quiz ul { margin: 6px 0 0; padding-left: 18px; }
ol.quiz .bonne { color: var(--green); font-weight: 600; }
ol.quiz .fausse { color: #C0392B; text-decoration: line-through; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px 18px; }

/* ===== v1.6 : outils de l'entreprise ===== */
.client-tabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 2px solid var(--line); margin: -4px 0 16px; }
.client-tabs a { padding: 8px 12px; font-size: 13.5px; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; text-decoration: none; white-space: nowrap; }
.client-tabs a:hover { color: var(--navy); }
.client-tabs a.on { color: var(--navy); font-weight: 700; border-bottom-color: var(--orange); }
.client-tabs .n { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--blue-bg); color: var(--blue); font-size: 11.5px; text-align: center; }
.outils-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.outil-tile { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; color: var(--text); text-decoration: none; background: #fff; }
.outil-tile:hover { border-color: var(--blue); text-decoration: none; }
.outil-tile strong { color: var(--navy); } .outil-tile span { font-size: 13px; color: var(--blue); font-weight: 600; } .outil-tile small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #B7C1CF; vertical-align: 0; margin-right: 4px; }
.dot-ok { background: var(--green); } .dot-warn { background: var(--orange); } .dot-na { background: #B7C1CF; }
ol.cles-auto { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 14px; }
.cle { border-left: 5px solid var(--line); }
.cle-oui { border-left-color: var(--green); } .cle-non { border-left-color: var(--red); }
.cle-head { display: flex; gap: 12px; align-items: flex-start; }
.cle-n { flex: 0 0 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.cle-head > div { flex: 1; }
.ouinon { display: flex; gap: 6px; }
.ouinon label { border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; font-weight: 700; cursor: pointer; display: flex; gap: 6px; align-items: center; }
.ouinon label:has(input:checked) { background: var(--navy); color: #fff; border-color: var(--navy); }
.info-card { background: var(--blue-bg); border-color: #CBE6E6; }
.box-info { background: #fff; border: 1px solid #CBE6E6; border-radius: 8px; padding: 10px 12px; }
.inline-fields { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-fields input, .inline-fields select { width: auto; flex: 1 1 120px; }
table.rows td { padding: 4px; vertical-align: top; } table.rows input, table.rows select, table.rows textarea { width: 100%; min-width: 80px; }
table.rows tr.on td { background: #F2FAF9; }
.ck-autre { margin-top: 6px; font-size: 13px; }
.photo-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.photo-card { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.photo-card img { width: 100%; height: 140px; object-fit: cover; display: block; background: var(--grey-bg); }
.photo-card .doc-ico { height: 140px; display: flex; align-items: center; justify-content: center; background: var(--grey-bg); color: var(--muted); font-weight: 700; }
.pc-body { padding: 8px; display: grid; gap: 6px; font-size: 13px; }
.pc-form { display: flex; gap: 4px; flex-wrap: wrap; } .pc-form input { flex: 1 1 100%; } .pc-form select { flex: 1; }
ul.files { padding-left: 4px; list-style: none; margin: 0 0 10px; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.pick { border: 2px solid var(--line); border-radius: 8px; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; font-size: 12.5px; position: relative; }
.pick img { width: 100%; height: 100px; object-fit: cover; } .pick span { padding: 4px 6px; }
.pick input { position: absolute; top: 6px; left: 6px; width: 18px; height: 18px; }
.pick:has(input:checked) { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-bg); }
.sig-add { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; } .sig-add input { flex: 1 1 160px; width: auto; }
.mail-box { white-space: pre-wrap; background: #FAFBFC; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; font: 13.5px/1.5 inherit; font-family: inherit; max-height: 420px; overflow: auto; }
.pp-cas { border-left: 5px solid var(--blue); } .pp-cas.pp-ecrit { border-left-color: var(--orange); background: #FFF8F2; }
.rse-q { border-top: 1px solid var(--line); padding: 12px 0; } .rse-q:first-of-type { border-top: 0; }
.rse-q-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.rse-q-head select { width: auto; }
.odd-n { display: inline-block; width: 22px; height: 22px; line-height: 22px; text-align: center; border-radius: 4px; color: #fff; font-weight: 700; font-size: 12px; background: #19486A; }
.odd-1{background:#E5243B}.odd-2{background:#DDA63A}.odd-3{background:#4C9F38}.odd-4{background:#C5192D}.odd-5{background:#FF3A21}.odd-6{background:#26BDE2}.odd-7{background:#FCC30B}.odd-8{background:#A21942}.odd-9{background:#FD6925}.odd-10{background:#DD1367}.odd-11{background:#FD9D24}.odd-12{background:#BF8B2E}.odd-13{background:#3F7E44}.odd-14{background:#0A97D9}.odd-15{background:#56C02B}.odd-16{background:#00689D}.odd-17{background:#19486A}
.hbars { display: grid; gap: 6px; } .hbar { display: grid; grid-template-columns: minmax(140px, 260px) 1fr 90px; gap: 10px; align-items: center; font-size: 13.5px; }
.hb { background: var(--grey-bg); border-radius: 4px; height: 14px; overflow: hidden; } .hb span { display: block; height: 100%; background: var(--teal); border-radius: 4px; }
.hv { text-align: right; font-weight: 700; color: var(--navy); }
table.carb .sub-row td { background: var(--blue-bg); color: var(--navy); font-weight: 700; font-size: 13px; }
table.carb input { width: 100%; } td.num { text-align: right; font-variant-numeric: tabular-nums; }
.btn-trash { background: none; border: 1px solid transparent; border-radius: 6px; cursor: pointer; font-size: 16px; padding: 2px 6px; opacity: .7; }
.btn-trash:hover { opacity: 1; border-color: var(--red); background: var(--red-bg); }
.periode-form input[type=date] { width: auto; }
/* Pages publiques : signature, questionnaire */
.public-page { background: var(--bg); }
.public-wrap { max-width: 720px; margin: 0 auto; padding: 20px 14px 40px; }
.public-logo { display: block; width: 150px; margin: 6px auto 16px; }
.signpad { position: relative; border: 2px dashed #9CC3C6; border-radius: 10px; background: #fff; touch-action: none; }
.signpad canvas { display: block; width: 100%; height: 200px; cursor: crosshair; }
.signpad [data-signclear] { position: absolute; right: 8px; bottom: 8px; }
.qopt { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-top: 6px; cursor: pointer; font-size: 15px; }
.qopt input { width: 20px; height: 20px; flex: 0 0 20px; margin-top: 1px; }
.qopt:has(input:checked) { border-color: var(--blue); background: var(--blue-bg); }
ol.quiz > li { margin-bottom: 18px; }
.qrep { padding: 4px 8px; border-radius: 6px; margin-top: 3px; font-size: 14px; } .qrep.good { background: var(--green-bg); color: var(--green); font-weight: 700; } .qrep.bad { background: var(--red-bg); color: var(--red); }
.quiz-score { display: flex; align-items: center; gap: 14px; font-size: 18px; font-weight: 700; padding: 14px; border-radius: 10px; margin-bottom: 12px; }
.quiz-score span { font-size: 34px; } .quiz-score.ok { background: var(--green-bg); color: var(--green); } .quiz-score.ko { background: var(--red-bg); color: var(--red); }
@media (max-width: 700px) { .hbar { grid-template-columns: 1fr 70px; } .hbar .hb { display: none; } .cle-head { flex-wrap: wrap; } }

/* ===== v1.7 ===== */
.client-groups { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 6px; }
.client-groups a { padding: 6px 12px; border-radius: 16px; background: var(--grey-bg); color: var(--navy); font-size: 13px; font-weight: 600; text-decoration: none; }
.client-groups a:hover { background: var(--blue-bg); }
.client-groups a.on { background: var(--navy); color: #fff; }
.client-groups .n, .client-tabs .n.n-alert { background: var(--red); color: #fff; border-radius: 9px; padding: 0 6px; font-size: 11px; }
.picto { display: inline-block; vertical-align: middle; flex: 0 0 auto; }
.picto-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 10px; }
.picto-pick label { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; cursor: pointer; font-size: 13px; line-height: 1.2; }
.picto-pick label:has(input:checked) { border-color: var(--blue); background: var(--blue-bg); }
.picto-pick input { width: auto; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; text-decoration: none; color: var(--text); display: block; }
.kpi strong { display: block; font-size: 24px; color: var(--navy); } .kpi span { font-size: 12.5px; color: var(--muted); }
.kpi.alert strong { color: var(--red); } a.kpi:hover { border-color: var(--blue); text-decoration: none; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.cal .h { background: var(--grey-bg); font-size: 12px; font-weight: 700; color: var(--muted); padding: 6px; text-align: center; }
.cal .d { min-height: 92px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); padding: 4px; font-size: 12px; background: #fff; }
.cal .d:nth-child(7n+1) { border-left: 0; } .cal .d.out { background: #FAFBFC; color: #B0B8C4; } .cal .d.today { background: #FFF8F2; }
.cal .d .num { font-weight: 700; color: var(--navy); }
.cal .ev { display: block; margin-top: 3px; padding: 2px 5px; border-radius: 4px; font-size: 11.5px; line-height: 1.25; color: #fff; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-vgp { background: #1C5FA8; } .ev-maintenance { background: #168289; } .ev-travaux, .ev-intervention { background: #ED7D31; } .ev-formation { background: #6B4FA0; } .ev-cse { background: #134F5C; } .ev-audit { background: #9A5B00; } .ev-autre { background: #5F6B7D; }
.ev.fait { opacity: .55; text-decoration: line-through; } .ev.annule { opacity: .4; }
.agenda-links { display: flex; gap: 8px; flex-wrap: wrap; }
.recep td { vertical-align: top; } .recep .opts { display: flex; gap: 10px; white-space: nowrap; } .recep .opts label { display: inline-flex; gap: 4px; align-items: center; }
.vgp-row.retard td:first-child { border-left: 4px solid var(--red); } .vgp-row.bientot td:first-child { border-left: 4px solid var(--orange); } .vgp-row.na { opacity: .6; }
.vgp-edit { background: #FAFBFC; } .vgp-edit .form-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.lock-note { display: flex; gap: 8px; align-items: flex-start; background: var(--amber-bg); color: var(--amber); padding: 10px 12px; border-radius: 8px; font-size: 13.5px; }
.manque { color: var(--red); font-size: 13.5px; } .manque li { margin-bottom: 2px; }
@media (max-width: 800px) { .cal { grid-template-columns: 1fr; } .cal .h { display: none; } .cal .d.out { display: none; } .cal .d { min-height: 0; border-left: 0; } }
.cal-leg { margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px; } .cal-leg span { color: #fff; font-size: 11.5px; padding: 2px 7px; border-radius: 4px; }

/* ===== v1.8 : téléphone et tablette ===== */
.mtop, .menu-veil { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; background: var(--bg); }
  .mtop { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 30; background: var(--navy); padding: 8px 10px; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
  .mtop-logo { justify-self: center; background: #fff; border-radius: 8px; padding: 4px 10px; line-height: 0; }
  .mtop-logo img { height: 28px; width: auto; }
  .mtop-menu { width: 44px; height: 40px; border: 0; background: none; display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 0 9px; cursor: pointer; }
  .mtop-menu span { display: block; height: 3px; background: #fff; border-radius: 2px; }
  .mtop-notif { color: #fff; font-size: 20px; position: relative; text-align: center; text-decoration: none !important; }
  .mtop-notif span { position: absolute; top: -4px; right: 0; background: #D93025; color: #fff; font-size: 11px; font-weight: 700; border-radius: 9px; padding: 0 5px; line-height: 17px; }
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: 280px; max-width: 86vw; height: 100%; z-index: 50; transform: translateX(-105%); transition: transform .22s ease; overflow-y: auto; box-shadow: 4px 0 24px rgba(0,0,0,.3); }
  body.menu-open .sidebar { transform: none; }
  body.menu-open .menu-veil { display: block; position: fixed; inset: 0; background: rgba(10,25,35,.45); z-index: 40; }
  body.menu-open { overflow: hidden; }
  .nav a { padding: 12px 12px; font-size: 16px; }
  .main { padding: 16px 12px 48px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .summary { grid-template-columns: 1fr 1fr; gap: 10px; }
}
@media (max-width: 700px) {
  body { font-size: 15.5px; }
  h1 { font-size: 21px; }
  .page-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .page-head .actions { justify-content: flex-start; }
  .card { padding: 14px 14px; border-radius: 9px; margin-bottom: 14px; }
  .form-grid, .kv { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 10px 12px; } .kpi strong, .kpi .v { font-size: 22px; }
  .summary { grid-template-columns: 1fr; }
  /* champs : 16 px pour éviter le zoom automatique de l'iPhone */
  input[type=text], input[type=url], input[type=tel], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=search], select, textarea { font-size: 16px; padding: 10px; }
  .btn { padding: 10px 14px; font-size: 15px; }
  .btn-sm { padding: 7px 11px; font-size: 14px; }
  .form-actions { flex-wrap: wrap; }
  .form-actions .btn { flex: 1 1 auto; justify-content: center; }
  .toolbar input[type=search] { max-width: none; }
  /* onglets : défilement horizontal au doigt */
  .client-groups, .client-tabs, .pill-nav { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 4px; }
  .client-groups a, .client-tabs a, .pill-nav a { flex: 0 0 auto; white-space: nowrap; }
  .client-groups::-webkit-scrollbar, .client-tabs::-webkit-scrollbar, .pill-nav::-webkit-scrollbar { display: none; }
  /* tableaux : une carte par ligne, intitulé de colonne devant chaque valeur */
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { border: 1px solid var(--line); border-radius: 9px; margin-bottom: 10px; padding: 6px 10px; background: #fff; }
  table.stack td { border: 0; padding: 5px 0; display: grid; grid-template-columns: minmax(90px, 38%) 1fr; gap: 8px; align-items: start; }
  table.stack td[data-label=""], table.stack td:not([data-label]) { grid-template-columns: 1fr; }
  table.stack td::before { content: attr(data-label); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); }
  table.stack td[data-label=""]::before, table.stack td:not([data-label])::before { display: none; }
  table.stack tbody tr:hover td { background: none; }
  table.stack td.nowrap { white-space: normal; }
  .table-wrap { overflow: visible; }
  .table-wrap:has(> table:not(.stack)) { overflow-x: auto; }
  .client-head { padding: 14px; }
  .client-head .meta { gap: 4px 14px; font-size: 13.5px; }
  .msg { max-width: 95%; }
  .picto-pick { grid-template-columns: 1fr 1fr; }
  .lock-note { font-size: 13px; }
}
@media (min-width: 701px) and (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .form-grid { grid-template-columns: 1fr 1fr; }
}
@media print { .mtop, .menu-veil { display: none !important; } }
@media (max-width: 900px) { .grid[style*="grid-template-columns"] { grid-template-columns: 1fr !important; } }
@media (max-width: 700px) { table.stack .badge { white-space: normal; } td { overflow-wrap: anywhere; } }

/* v1.8 : synthèse modifiable, versions, CRM, médiathèque */
.sum .t { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.sum-edit { border: 0; background: none; color: var(--blue); font: inherit; font-size: 12px; text-transform: none; letter-spacing: 0; cursor: pointer; padding: 0; font-weight: 600; }
.sum-form { border-color: var(--blue); }
.versions .motifs { margin: 4px 0; padding-left: 16px; font-size: 12.5px; }
.versions tr.v-warn > td:first-child { border-left: 4px solid var(--orange); }
.v-alerts { margin-top: 4px; font-size: 12.5px; color: var(--amber); background: var(--amber-bg); border-radius: 6px; padding: 4px 7px; }
.v-edit > td { background: #FAFBFD; }
.v-del { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 10px; }
.checks-1 { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 14px; }
.checks-1 .check { display: flex; font-weight: 400; font-size: 13.5px; align-items: flex-start; }
.lock { color: var(--navy); font-weight: 600; }
.coffre { border-left: 5px solid var(--navy); }
.tag-green { background: var(--green-bg); color: var(--green); }
.sig-current { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; background: #FAFBFD; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin-bottom: 10px; font-size: 14px; }
.sig-current img { width: 200px; max-height: 80px; object-fit: contain; background: #fff; border-bottom: 1px solid var(--line); }
.sig-old img { opacity: .5; }
table.comptes code { font-size: 13px; background: var(--grey-bg); padding: 1px 6px; border-radius: 5px; }
.opp { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin-bottom: 6px; }
.opp summary { color: var(--text); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.media-grid figure { margin: 0; text-align: center; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: #fff; }
.media-grid img, .media-grid svg { width: 90px; height: 90px; object-fit: contain; }
.media-grid figcaption { font-size: 12px; margin-top: 4px; }
@media (max-width: 700px) {
  .main { overflow-x: hidden; }
  table.matrix, table.kvp, table.bars, table.edit-grid, .doc-view table { display: block; overflow-x: auto; max-width: 100%; }
  .cotation, .mesures { grid-template-columns: 1fr; }
}
@media (max-width: 700px) { .page-head .sub, .page-head h1 { overflow-wrap: anywhere; } }

/* ---------- v1.9 : risque routier, flotte ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.chips .check { font-weight: 400; }
.inline-pair { display: flex; gap: 6px; } .inline-pair input { min-width: 0; }
code.wrap { overflow-wrap: anywhere; white-space: normal; font-size: 12px; }
.kvd { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0 0 12px; font-size: 14px; }
.kvd dt { color: var(--muted); } .kvd dd { margin: 0; }
.sig-img { max-width: 280px; max-height: 120px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.attest-txt { background: #F6FAFA; border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; font-size: 14px; margin-bottom: 14px; }
.attest-txt ol { padding-left: 20px; } .attest-txt li { margin-bottom: 6px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.photo-grid img { width: 100%; height: 110px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.damage { display: grid; grid-template-columns: minmax(160px, 240px) 1fr; gap: 14px; align-items: start; margin-bottom: 12px; }
.damage svg { width: 100%; height: auto; }
.damage rect { fill: #EEF4F5; stroke: #8FB3B7; stroke-width: 1.4; }
.damage[data-damage] rect { cursor: pointer; }
.damage rect.connu { fill: #F6E3D3; stroke-dasharray: 3 2; }
.damage rect.on { fill: #E74C3C; stroke: #A93226; }
.damage .dmg-lab { font-size: 10px; fill: #5B6B7B; font-weight: 600; }
.dmg-list { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13.5px; align-content: start; }
.dmg-list .check { min-width: 45%; }
.rt-theme h3 { margin: 16px 0 8px; font-size: 16px; color: var(--navy); }
.rt-pct { font-size: 12px; padding: 1px 8px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }
.rt-pct.ok { background: #DDF3E6; color: #1E7B4C; } .rt-pct.mid { background: #FDF1D6; color: #8A6100; } .rt-pct.ko { background: #FBE1DE; color: #A93226; }
.rt-q { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: #fff; }
.rt-q.r-non { border-left: 4px solid #E74C3C; } .rt-q.r-partiel { border-left: 4px solid #F39C12; } .rt-q.r-oui { border-left: 4px solid #2E9E5B; }
.rt-txt { font-size: 14px; } .rt-rep { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13.5px; } .rt-rep label { display: inline-flex; align-items: center; gap: 4px; }
.rt-com { grid-column: 1 / -1; font-size: 13px; }
.bud td { vertical-align: middle; } .bud-bar { width: 40%; } .bud-bar span { display: block; height: 10px; border-radius: 5px; background: var(--teal, #168289); min-width: 2px; }
.desig { margin-top: 12px; }
/* Fiche conducteur sur téléphone */
.veh-public .public-wrap { max-width: 640px; }
.veh-top { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; } .veh-top .public-logo { margin: 0; max-height: 40px; }
.veh-immat { font-size: 26px; font-weight: 800; letter-spacing: 1px; color: var(--navy); }
.veh-choix { display: grid; gap: 12px; margin: 16px 0; }
.veh-choix .btn { display: flex; flex-direction: column; align-items: flex-start; padding: 18px 20px; font-size: 20px; font-weight: 700; text-align: left; }
.veh-choix .btn small { font-size: 13px; font-weight: 400; opacity: .9; }
.veh-form h1 { font-size: 20px; margin: 0 0 12px; } .veh-form h2 { font-size: 16px; margin: 18px 0 8px; color: var(--navy); }
.veh-check { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.vc-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.vc-row:last-child { border-bottom: 0; }
.vc-opt { display: flex; gap: 4px; flex-shrink: 0; }
.vc-opt label { display: inline-flex; align-items: center; gap: 3px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; cursor: pointer; }
.vc-opt label:has(input:checked).ok { background: #DDF3E6; border-color: #2E9E5B; } .vc-opt label:has(input:checked).ko { background: #FBE1DE; border-color: #E74C3C; } .vc-opt label:has(input:checked).na { background: #EEF0F2; }
.btn-big { width: 100%; padding: 14px; font-size: 18px; }
.veh-done h1 { font-size: 22px; margin-top: 0; color: #1E7B4C; } .veh-done.ko h1 { color: #A4511B; }
.veh-stop { background: #FBE1DE; color: #A93226; padding: 10px 12px; border-radius: 8px; font-weight: 700; }
@media (max-width: 700px) {
  .damage { grid-template-columns: 1fr; } .damage svg { max-width: 260px; margin: 0 auto; display: block; }
  .rt-q { grid-template-columns: 1fr; }
  .vc-row { flex-direction: column; align-items: flex-start; }
}
@media print { .no-print, .sidebar, .mtop, .client-groups, .client-tabs { display: none !important; } }
/* v1.9 : questionnaire illustré, vidéos */
.q-media { margin: 8px 0; max-width: 520px; }
.q-media img, .q-media video { max-width: 100%; max-height: 320px; border-radius: 8px; border: 1px solid var(--line); display: block; background: #000; }
.q-media img { background: #fff; }
.q-embed { position: relative; aspect-ratio: 16 / 9; } .q-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 8px; }
.quiz-edit > li { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.q-tools { margin-top: 8px; display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start; } .q-tools details { flex: 1 1 100%; }
.q-add { margin-top: 12px; }
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.video-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: #fff; display: flex; flex-direction: column; gap: 6px; }
.video-item .q-media { max-width: none; margin: 0; }
.video-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; } .video-tools input[type=text] { flex: 1 1 140px; }
.vg-list { display: grid; gap: 10px; margin: 12px 0; }
.vg-row { display: grid; grid-template-columns: 24px 1fr 280px; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #FAFCFC; }
.vg-col { display: flex; flex-direction: column; gap: 6px; } .vg-tools { display: flex; gap: 4px; flex-wrap: wrap; }
.vg-preview canvas { width: 100%; max-width: 640px; aspect-ratio: 16 / 9; border-radius: 10px; border: 1px solid var(--line); display: block; }
[data-vg-result] video { width: 100%; max-width: 640px; border-radius: 10px; margin-top: 12px; }
@media (max-width: 700px) { .vg-row { grid-template-columns: 1fr; } }

/* v1.9 : affiches */
.aff-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.aff-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; background: #fff; }

/* v2.0 : options, CSE, certification */
.opt-line { align-items: flex-start; margin: 8px 0; } .opt-line input { margin-top: 3px; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.guide-fiche { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: #fff; }
.guide-fiche p { font-size: 14px; } .guide-fiche.hors { opacity: .65; }
.row-alert td { background: #FDECEA; } .row-me td { background: #EAF6F4; }
.dem { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; background: #fff; }
.inline-det { display: inline-block; margin: 2px 0; } .inline-det summary { font-size: 12.5px; color: var(--blue, #168289); cursor: pointer; }
.inline-det form { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; min-width: 240px; }
.etape-f { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; } .etape-f input[type=date] { width: 140px; } .etape-f input[type=text] { width: 140px; }
.res-box { border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: #FAFCFC; display: flex; flex-direction: column; gap: 6px; }
.res-box .inline-pair label { display: flex; flex-direction: column; font-size: 12.5px; flex: 1; }
.res-liste { display: grid; grid-template-columns: 1fr 90px; gap: 4px; } .res-liste textarea { grid-column: 1 / -1; }
.res-calc { border-left: 4px solid var(--teal, #168289); padding: 6px 10px; margin: 8px 0; background: #F6FAFA; }
table.bilan td:first-child { min-width: 260px; }

/* v2.1 : éditeur de plans */
.plan-editor { display: grid; grid-template-columns: 230px 1fr; gap: 14px; align-items: start; margin-bottom: 16px; }
.plan-pal { background: var(--card, #fff); border: 1px solid #D9E1E7; border-radius: 10px; padding: 10px; position: sticky; top: 10px; max-height: 88vh; overflow: auto; }
.pal-t { font-weight: 700; margin-bottom: 4px; }
.pal-grid { display: grid; grid-template-columns: 1fr; gap: 4px; }
.pal-b { display: flex; align-items: center; gap: 8px; text-align: left; border: 1px solid transparent; background: none; border-radius: 6px; padding: 3px 5px; cursor: pointer; font-size: 12.5px; color: inherit; }
.pal-b:hover { background: #F1F5F8; } .pal-b.on { border-color: #134F5C; background: #E3F0F2; }
.pal-b .sym { width: 26px; height: 26px; flex: 0 0 auto; }
.plan-zone { min-width: 0; }
.plan-zone .plan-stage { width: 100%; border: 1px solid #C9D2DA; border-radius: 6px; overflow: hidden; touch-action: none; }
.plan-zone .plan-stage.placing { cursor: crosshair; }
.plan-zone .pl-el { cursor: grab; }
.plan-zone .pl-el.on { outline: 2px dashed #E0A800; outline-offset: 2px; }
.plan-zone .pl-l { font-size: calc(10px * var(--z, 1)); } .plan-zone .pl-t { font-size: calc(12px * var(--z, 1)); }
.plan-sel { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; padding: 8px 10px; background: #FFF8E6; border: 1px solid #F0C36D; border-radius: 8px; font-size: 13px; }
.plan-sel label { display: flex; align-items: center; gap: 5px; }
@media (max-width: 820px) { .plan-editor { grid-template-columns: 1fr; } .plan-pal { position: static; max-height: 40vh; } .pal-grid { grid-template-columns: 1fr 1fr; } }
