/* Console MS-CRM : même charte que le CRM (beige, blanc, accent bleu). */
:root { --fond: #efeae2; --surface: #fff; --surface-2: #f6f3ee; --bordure: #e0d9ce; --texte: #111b21; --texte-2: #54656f; --accent: #0a66c2; --accent-fort: #084f96; --doux: rgba(10, 102, 194, .1); --vert: #166534; --vert-fond: #dcf5e4; --orange: #9a4b06; --orange-fond: #fdf0d8; --rouge: #b91c1c; --rouge-fond: #fde2e2; --nuit: #0d1b2a; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { min-height: 100vh; background: var(--fond); color: var(--texte); font: 14px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; }
h1 { margin: 0; font-size: 1.5rem; line-height: 1.2; }
h2 { margin: 0 0 .85rem; font-size: 1.05rem; }
p { margin: 0 0 .7rem; }
.discret { color: var(--texte-2); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bouton { min-height: 40px; padding: .5rem 1rem; border: 1px solid var(--bordure); border-radius: 9px; background: var(--surface-2); color: var(--texte); font: 600 14px inherit; font-family: inherit; cursor: pointer; }
.bouton:hover { border-color: var(--accent); }
.bouton:disabled { opacity: .55; cursor: wait; }
.bouton.principal { border-color: var(--accent); background: var(--accent); color: #fff; }
.bouton.principal:hover { background: var(--accent-fort); }
.bouton.discret { border-color: transparent; background: transparent; color: var(--texte-2); }
.bouton.petit { min-height: 32px; padding: .25rem .7rem; font-size: 13px; }
.carte { background: var(--surface); border: 1px solid var(--bordure); border-radius: 12px; padding: 1.1rem 1.2rem; margin-bottom: .9rem; }
label { display: grid; gap: .25rem; font-size: 13px; font-weight: 600; min-width: 0; }
input, select, textarea { width: 100%; min-width: 0; min-height: 38px; padding: .4rem .6rem; border: 1px solid var(--bordure); border-radius: 8px; background: var(--surface-2); color: var(--texte); font: 400 14px inherit; font-family: inherit; }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; flex: none; accent-color: var(--accent); }
textarea { resize: vertical; }
label.case { display: flex; align-items: center; gap: .5rem; font-weight: 500; font-size: 14px; }
.centre { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.connexion { display: grid; gap: .8rem; width: min(100%, 370px); }
.marque { display: flex; align-items: center; gap: .55rem; }
.marque b { font-size: 1.05rem; }
.marque small { color: var(--texte-2); }
.logo { width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 21V5a1 1 0 0 1 1-1h9a1 1 0 0 1 1 1v16'/%3E%3Cpath d='M15 9h4a1 1 0 0 1 1 1v11'/%3E%3Cpath d='M8 8h3M8 12h3M8 16h3M3 21h18'/%3E%3C/svg%3E") center / 18px no-repeat; }
.barre { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 1.2rem; padding: .55rem 1.2rem; background: var(--nuit); color: #fff; }
.barre .marque small { color: #9fd0ff; }
.barre nav { display: flex; gap: .25rem; flex: 1; }
.barre nav button, .lien-quitter { min-height: 34px; padding: .25rem .8rem; border: 0; border-radius: 7px; background: transparent; color: #d6e8fa; font: 600 14px inherit; font-family: inherit; cursor: pointer; }
.barre nav button.actif { background: var(--accent); color: #fff; }
.essai { padding: .35rem 1.2rem; background: var(--orange-fond); color: var(--orange); font-size: 13px; }
.page { max-width: 1240px; margin: 0 auto; padding: 1.2rem; }
.titre { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: 1rem; }
.titre p { margin: .15rem 0 0; }
.retour { padding: 0; margin-bottom: .2rem; border: 0; background: none; color: var(--accent); font: 600 13px inherit; font-family: inherit; cursor: pointer; }
.actions-fiche { display: flex; align-items: center; gap: .5rem; }
.etat-sauvegarde { color: var(--texte-2); font-size: 13px; }
.table { overflow-x: auto; background: var(--surface); border: 1px solid var(--bordure); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .6rem .8rem; border-bottom: 1px solid var(--bordure); text-align: left; }
th { background: var(--surface-2); color: var(--texte-2); font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr[data-client] { cursor: pointer; }
tbody tr[data-client]:hover td { background: var(--surface-2); }
.fleche { color: var(--texte-2); font-size: 1.2rem; }
.vide { padding: 2.5rem; text-align: center; color: var(--texte-2); background: var(--surface); border-radius: 10px; }
.pastille { display: inline-block; padding: .12rem .6rem; border-radius: 999px; background: var(--surface-2); font-size: 12px; font-weight: 700; white-space: nowrap; }
.pastille.vert { background: var(--vert-fond); color: var(--vert); }
.pastille.orange { background: var(--orange-fond); color: var(--orange); }
.pastille.bleu { background: var(--doux); color: var(--accent-fort); }
.fiche { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1rem; align-items: start; }
.colonne-resume { position: sticky; top: 66px; }
.resume { display: grid; gap: .55rem; max-height: calc(100vh - 82px); overflow-y: auto; margin: 0; }
.resume h2 { margin: 0; }
dl { display: grid; grid-template-columns: 1fr auto; gap: .2rem .6rem; margin: 0; }
dt { color: var(--texte-2); }
dd { margin: 0; font-weight: 700; }
.manque { padding: .6rem .75rem; border-radius: 8px; background: var(--orange-fond); color: var(--orange); font-size: 13px; }
.manque ul { margin: .25rem 0 0; padding-left: 1.05rem; }
.pret { padding: .6rem .75rem; margin-bottom: .6rem; border-radius: 8px; background: var(--vert-fond); color: var(--vert); font-weight: 700; }
.docs { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.docs .bouton { padding-inline: .4rem; font-size: 13px; }
.grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .7rem; margin-bottom: .7rem; }
.sous { margin: .65rem 0 .35rem; color: var(--texte-2); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.coches { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; margin-bottom: .55rem; }
.etab { padding: .8rem; margin-bottom: .7rem; border: 1px solid var(--bordure); border-radius: 9px; background: var(--surface-2); }
.etab input { background: var(--surface); }
.etab-tete { display: flex; justify-content: space-between; margin-bottom: .5rem; }
.retirer { border: 0; background: none; color: var(--rouge); font: 600 13px inherit; font-family: inherit; cursor: pointer; }
.option { padding: .4rem 0; border-bottom: 1px solid var(--bordure); }
.option:last-child { border-bottom: 0; }
.option .grille, .quantite { margin: .45rem 0 .25rem 1.65rem; max-width: 420px; }
.piece { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .35rem .5rem; border-radius: 7px; }
.piece.recu { background: var(--vert-fond); }
.verif { margin-top: .3rem; }
.etat-iban.ok { color: var(--vert); }
.etat-iban.ko { color: var(--rouge); }
.actions-page { display: flex; justify-content: flex-end; }
.apercu-signature { min-height: 54px; margin-bottom: .6rem; }
.apercu-signature img { display: block; max-width: 240px; max-height: 90px; }
.fond { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; background: rgba(13, 27, 42, .55); }
.fenetre { display: flex; flex-direction: column; width: min(100%, 880px); max-height: calc(100vh - 32px); background: var(--surface); border-radius: 12px; }
.fenetre header, .fenetre footer { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .75rem 1rem; }
.fenetre header h2 { margin: 0; }
.fenetre footer { justify-content: flex-end; border-top: 1px solid var(--bordure); }
.fenetre-corps { flex: 1; min-height: 0; overflow: auto; padding: 0 1rem .9rem; }
.fermer { width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--surface-2); font-size: 1.2rem; cursor: pointer; }
iframe.apercu { display: block; width: 100%; height: 68vh; border: 1px solid var(--bordure); border-radius: 8px; background: #fff; }
.notif { position: fixed; right: 16px; bottom: 16px; z-index: 50; max-width: calc(100vw - 32px); padding: .7rem 1rem; border-radius: 9px; background: var(--vert-fond); color: var(--vert); font-weight: 600; box-shadow: 0 6px 20px rgba(17, 27, 33, .2); }
.notif.erreur { background: var(--rouge-fond); color: var(--rouge); }
.page-client { max-width: 860px; }
iframe.lecture { display: block; width: 100%; height: 60vh; border: 1px solid var(--bordure); border-radius: 8px; background: #fff; margin-bottom: .8rem; }
iframe.bienvenue { height: 70vh; margin: 0; }
.page-client label:not(.case) { margin-top: .7rem; }
canvas.signature { display: block; width: 100%; max-width: 640px; aspect-ratio: 640 / 220; border: 1px dashed var(--texte-2); border-radius: 9px; background: #fff; touch-action: none; }
.actions-signature { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .7rem; }
.erreur { margin: .5rem 0 0; color: var(--rouge); font-weight: 600; }
.erreur:empty { display: none; }
.signe { border-left: 4px solid var(--vert); }
@media (max-width: 900px) {
  .fiche { grid-template-columns: minmax(0, 1fr); }
  .colonne-resume { position: static; grid-row: 2; }
  .resume { max-height: none; margin-bottom: .9rem; }
  .barre { flex-wrap: wrap; gap: .4rem .7rem; padding-inline: 16px; }
  .page { padding: 1rem 16px; }
  .piece { align-items: flex-start; flex-direction: column; }
}
