/* 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=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; }
