/* Nuage QC — logiciel léger. Couleurs de la marque (site nuageqc.com). */
:root {
  --blanc: #fff; --fond: #f4faff; --ciel-100: #e6f4fd; --ciel-200: #cbe8fa; --ciel: #8fd0f4; --ciel-fort: #3aa5e0;
  --encre: #0f2a43; --encre-douce: #46627a; --lien: #0a6aa8; --bordure: #d6e9f6;
  --ombre: 0 8px 28px rgba(58,165,224,.14); --rayon: 16px;
  --revenus: #2b8fd0; --depenses: #e07b39;
  --bon: #1f8a4c; --attention: #b7791f; --critique: #c0392b;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fond); color: var(--encre); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--lien); }
button, input, select { font: inherit; }
.barre { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; padding: 10px 24px;
  background: var(--blanc); border-bottom: 1px solid var(--bordure); }
.barre .logo { height: 30px; }
.barre .entreprise { font-weight: 600; color: var(--encre-douce); padding-left: 16px; border-left: 1px solid var(--bordure);
  min-width: 0; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barre nav { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.barre nav a, .barre nav button { text-decoration: none; color: var(--encre); padding: 6px 12px; border-radius: 999px; border: 0; background: none; cursor: pointer; white-space: nowrap; }
/* menu « Plus » : ce qui ne tient pas dans la barre (recalculé à chaque changement de largeur) */
.barre .menu-plus { position: relative; }
.barre .menu-plus-liste { display: none; position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; flex-direction: column; gap: 2px;
  background: var(--blanc); border: 1px solid var(--bordure); border-radius: 14px; box-shadow: 0 10px 30px rgba(20, 50, 80, .14); padding: 6px; z-index: 20; }
.barre .menu-plus.ouvert .menu-plus-liste { display: flex; }
.barre .menu-plus-liste a, .barre .menu-plus-liste button { display: block; text-align: left; border-radius: 10px; padding: 8px 12px; width: 100%; box-sizing: border-box; }
.barre nav a:hover, .barre nav button:hover { background: var(--ciel-100); }
.barre nav .actif { background: var(--ciel-100); color: var(--lien); font-weight: 600; }
.moi { display: inline-flex; align-items: center; gap: 8px; color: var(--encre-douce); font-size: 14px; }
.pastille-init { width: 30px; height: 30px; border-radius: 50%; background: var(--ciel-fort); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
main { max-width: 1240px; margin: 0 auto; padding: 28px 24px 60px; }
h1 { font-size: 26px; margin: 0 0 4px; } h2 { font-size: 17px; margin: 0 0 14px; }
.sous { color: var(--encre-douce); margin: 0 0 24px; }
.carte { background: var(--blanc); border: 1px solid var(--bordure); border-radius: var(--rayon); padding: 20px; box-shadow: var(--ombre); }
.grille { display: grid; gap: 18px; }
.g-kpi { grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); margin-bottom: 18px; }
.g-2 { grid-template-columns: 2fr 1fr; } .g-2b { grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .g-2, .g-2b { grid-template-columns: 1fr; } .barre .entreprise { display: none; } }
.kpi .etiq { color: var(--encre-douce); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.kpi .val { font-size: 26px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .note { font-size: 12.5px; color: var(--encre-douce); margin-top: 2px; }
.etat { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; }
.etat.bon { color: var(--bon); } .etat.attention { color: var(--attention); } .etat.critique { color: var(--critique); }
/* Pastilles du tableau de bord */
.pastilles { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.pastille { position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 170px; text-decoration: none; color: inherit;
  background: var(--blanc); border: 1px solid var(--bordure); border-radius: 20px; padding: 20px; box-shadow: var(--ombre); transition: transform .12s, box-shadow .12s; }
a.pastille:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(58,165,224,.24); }
.pastille .icone { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--ciel-100); color: var(--lien); }
.pastille .icone svg { width: 24px; height: 24px; }
.pastille .titre { font-weight: 700; font-size: 16.5px; }
.pastille .desc { color: var(--encre-douce); font-size: 13.5px; }
.pastille .chiffre { margin-top: auto; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pastille.bientot { opacity: .72; box-shadow: none; background: rgba(255,255,255,.6); }
.badge { position: absolute; top: 16px; right: 16px; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--ciel-100); color: var(--lien); }
.badge.gris { background: #eef2f5; color: var(--encre-douce); }
/* Boutons et formulaires */
.bouton { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 9px 16px; cursor: pointer; font-weight: 600;
  background: var(--ciel-fort); color: #fff; } .bouton:hover { background: var(--lien); }
.bouton.second { background: var(--blanc); color: var(--lien); border: 1px solid var(--bordure); } .bouton.second:hover { background: var(--ciel-100); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.entete { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; justify-content: space-between; margin-bottom: 20px; }
label.champ { display: block; font-size: 13px; color: var(--encre-douce); margin-bottom: 12px; }
label.champ input, label.champ select { display: block; width: 100%; margin-top: 4px; padding: 9px 12px; border: 1px solid var(--bordure); border-radius: 10px; background: #fff; color: var(--encre); }
label.coche { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; font-size: 14px; }
.erreur { color: var(--critique); font-size: 13.5px; min-height: 20px; }
dialog { border: 0; border-radius: 20px; padding: 26px; width: min(460px, 94vw); box-shadow: 0 30px 80px rgba(15,42,67,.35); }
dialog::backdrop { background: rgba(15,42,67,.35); }
/* Onglets et tableaux */
.onglets { display: flex; gap: 4px; border-bottom: 1px solid var(--bordure); margin-bottom: 16px; }
.onglets button { border: 0; background: none; padding: 10px 14px; cursor: pointer; color: var(--encre-douce); border-bottom: 2px solid transparent; }
.onglets button.actif { color: var(--lien); border-bottom-color: var(--ciel-fort); font-weight: 600; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #eef4fa; }
th { font-size: 12.5px; color: var(--encre-douce); font-weight: 600; }
td.m, th.m { text-align: right; white-space: nowrap; }
tr.groupe td { font-weight: 700; background: var(--fond); }
tr.total td { font-weight: 700; border-top: 2px solid var(--bordure); }
tr.grand td { font-weight: 800; font-size: 16px; border-top: 2px solid var(--encre); }
/* Opérations récentes */
.ops { list-style: none; margin: 0; padding: 0; }
.ops li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #eef4fa; }
.ops .rond { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 700; }
.ops .vente .rond, .ops .encaissement .rond { background: #e3f1fb; color: var(--revenus); }
.ops .depense .rond { background: #fcebdf; color: #b35a1f; }
.ops .ecriture .rond { background: #eef2f5; color: var(--encre-douce); }
.ops .txt { flex: 1; min-width: 0; } .ops .txt div:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.ops .txt div + div { font-size: 12.5px; color: var(--encre-douce); }
.ops .montant { font-weight: 700; font-variant-numeric: tabular-nums; }
.ops .annulee { text-decoration: line-through; opacity: .55; }
/* Graphiques */
.graph { position: relative; } .graph svg { display: block; width: 100%; height: auto; overflow: visible; }
.legende { display: flex; gap: 16px; font-size: 13px; color: var(--encre-douce); margin-bottom: 8px; }
.legende i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.bulle { position: absolute; pointer-events: none; background: var(--encre); color: #fff; padding: 8px 10px; border-radius: 10px; font-size: 12.5px; white-space: nowrap; transform: translate(-50%, -110%); opacity: 0; transition: opacity .1s; }
.barres-h .ligne { display: grid; grid-template-columns: minmax(110px, 1.2fr) 2fr auto; gap: 10px; align-items: center; margin-bottom: 9px; font-size: 13.5px; }
.barres-h .piste { height: 12px; background: var(--ciel-100); border-radius: 6px; overflow: hidden; }
.barres-h .rempli { height: 100%; background: var(--depenses); border-radius: 0 6px 6px 0; }
.barres-h .nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barres-h .m { font-variant-numeric: tabular-nums; font-weight: 600; }
.vide { color: var(--encre-douce); text-align: center; padding: 30px 10px; }
.connexion { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(160deg, var(--ciel-100), var(--fond) 60%); }
.connexion .carte { width: min(400px, 92vw); padding: 32px; }
.source { font-size: 12px; color: var(--encre-douce); margin-top: 14px; }
.cache { display: none !important; }
/* ---------- Cellulaire d'abord : barre d'onglets en bas, cartes compactes ---------- */
.g-3 { grid-template-columns: 1fr 2fr; }
.onglets-bas { display: none; }
@media (max-width: 700px) {
  main { padding: 18px 14px 96px; }
  h1 { font-size: 22px; }
  .barre { padding: 10px 14px; }
  .barre nav a, .barre nav button { display: none; }
  .onglets-bas { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--blanc);
    border-top: 1px solid var(--bordure); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .onglets-bas a, .onglets-bas button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px;
    color: var(--encre-douce); text-decoration: none; background: none; border: 0; padding: 4px 0; cursor: pointer; }
  .onglets-bas svg { width: 22px; height: 22px; }
  .onglets-bas .actif { color: var(--lien); font-weight: 600; }
  .g-kpi { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px; } .kpi .val { font-size: 19px; } .kpi .note { font-size: 11.5px; }
  .g-2, .g-2b, .g-3 { grid-template-columns: 1fr; }
  .carte { padding: 16px; }
  .pastilles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .pastille { min-height: 0; padding: 14px; gap: 6px; border-radius: 16px; }
  .pastille.bientot .desc { display: none; }
  .pastille .icone { width: 38px; height: 38px; }
  .pastille .titre { font-size: 14.5px; }
  .pastille.large { grid-column: 1 / -1; }
  .badge { top: 10px; right: 10px; font-size: 10.5px; padding: 2px 7px; }
  .entete { flex-direction: column; align-items: stretch; }
  .entete .actions .bouton { flex: 1; justify-content: center; }
  dialog { padding: 20px; }
  th, td { padding: 7px 6px; font-size: 13.5px; }
  .onglets button { padding: 10px 8px; font-size: 14px; }
}
@media (max-width: 700px) {
  #boutons:not(.cache) { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  #boutons .bouton { white-space: nowrap; padding: 11px 6px; font-size: 14px; justify-content: center; }
  .long { display: none; }
}
/* Fiches d'utilisateurs (toutes tailles) */
.fiches { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.fiche { display: flex; flex-direction: column; gap: 10px; }
.fiche.inactive { opacity: .6; }
.fiche-tete { display: flex; gap: 12px; align-items: center; }
.fiche-tete .pastille-init { width: 40px; height: 40px; font-size: 15px; flex: none; }
.fiche-nom { display: flex; flex-direction: column; min-width: 0; } .fiche-nom small { color: var(--encre-douce); overflow: hidden; text-overflow: ellipsis; }
.puces { display: flex; flex-wrap: wrap; gap: 6px; }
.puce { font-size: 12.5px; padding: 3px 10px; border-radius: 999px; background: var(--ciel-100); color: var(--lien); }
.puce.lecture { background: #eef2f5; color: var(--encre-douce); }
.fiche .bouton { align-self: flex-start; }
dialog { max-height: 90vh; overflow-y: auto; }
@media (max-width: 700px) {
  .large-seul { display: none; }
  .fiches { grid-template-columns: 1fr; }
  dialog { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: 20px 20px 0 0; }
}
/* Sous-navigation de la comptabilité (segments) */
.segments { display: flex; gap: 4px; background: var(--ciel-100); padding: 4px; border-radius: 999px; margin: 0 0 18px; width: max-content; max-width: 100%; overflow-x: auto; }
.segments a { padding: 7px 16px; border-radius: 999px; text-decoration: none; color: var(--encre-douce); font-weight: 600; font-size: 14px; white-space: nowrap; }
.segments a.actif { background: var(--blanc); color: var(--lien); box-shadow: 0 1px 4px rgba(15,42,67,.1); }
.segments .court { display: none; } @media (max-width: 700px) { .segments .court { display: inline; } }
.segments .compte { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--depenses); color: #fff; font-size: 12px; text-align: center; }
/* Cartes à traiter (reçus, lignes du relevé) */
.atraiter { display: grid; gap: 14px; }
.item { display: grid; grid-template-columns: 120px 1fr; gap: 16px; }
.item .apercu { width: 120px; height: 150px; border-radius: 12px; background: var(--ciel-100); overflow: hidden; display: grid; place-items: center; color: var(--lien); font-weight: 700; text-decoration: none; }
.item .apercu img { width: 100%; height: 100%; object-fit: cover; }
.item .champs { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.item .champs .plein { grid-column: 1 / -1; }
.indice { font-size: 12.5px; color: var(--encre-douce); margin: -6px 0 10px; }
.rappel { background: #fff8ec; border: 1px solid #f3dcb3; border-radius: 12px; padding: 10px 12px; font-size: 13.5px; margin-bottom: 12px; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.depot { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px; border: 2px dashed var(--ciel); border-radius: var(--rayon); background: var(--blanc); cursor: pointer; text-align: center; color: var(--encre-douce); }
.depot:hover, .depot.survol { background: var(--ciel-100); }
.depot svg { width: 40px; height: 40px; color: var(--ciel-fort); }
.depot b { color: var(--encre); font-size: 16px; }
.ligne-releve { display: flex; flex-direction: column; gap: 10px; }
.ligne-releve .tete { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.ligne-releve .lib { font-weight: 600; word-break: break-word; }
.montant.entree { color: var(--revenus); } .montant.sortie { color: #b35a1f; }
.montant { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.barre-prog { height: 8px; background: var(--ciel-100); border-radius: 4px; overflow: hidden; display: flex; gap: 2px; }
.barre-prog i { display: block; height: 100%; }
.message { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--encre); color: #fff; padding: 12px 18px; border-radius: 14px; z-index: 30; max-width: 92vw; box-shadow: 0 10px 30px rgba(15,42,67,.3); }
details.carte summary { cursor: pointer; font-weight: 700; }
@media (max-width: 700px) {
  .item { grid-template-columns: 1fr; }
  .item .apercu { width: 100%; height: 160px; }
  .item .champs { grid-template-columns: 1fr 1fr; }
  .message { bottom: 84px; }
  .segments { width: 100%; } .segments a { flex: 1 1 auto; text-align: center; padding: 7px 4px; font-size: 12.5px; } .segments .compte { margin-left: 3px; min-width: 16px; padding: 0 4px; font-size: 11px; }
  .segments .long { display: none; }
}
.erreur:empty { display: none; }
/* ---------- CRM : kanban ---------- */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.colonne { flex: 0 0 280px; background: var(--ciel-100); border-radius: 18px; padding: 10px; display: flex; flex-direction: column; gap: 10px; scroll-snap-align: start; min-height: 220px; }
.colonne.survol { outline: 2px dashed var(--ciel-fort); outline-offset: -4px; }
.colonne .tete-col { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 6px; }
.colonne .tete-col b { font-size: 14px; } .colonne .tete-col small { color: var(--encre-douce); font-variant-numeric: tabular-nums; }
.colonne.gagnee { background: #e8f5ee; } .colonne.perdue { background: #f1f3f5; }
.occasion { background: var(--blanc); border-radius: 14px; padding: 12px; box-shadow: 0 2px 8px rgba(15,42,67,.08); cursor: pointer; border: 1px solid transparent; }
.occasion:hover { border-color: var(--ciel); }
.occasion.glisse { opacity: .4; }
.occasion .n { font-weight: 700; margin-bottom: 2px; } .occasion .q { color: var(--encre-douce); font-size: 13px; }
.occasion .bas { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 13px; }
.occasion .m { font-weight: 700; font-variant-numeric: tabular-nums; }
.puce.retard { background: #fcebdf; color: #b35a1f; }
.etapes-choix { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 14px; }
.etapes-choix button { border: 1px solid var(--bordure); background: var(--blanc); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 13px; }
.etapes-choix button.actif { background: var(--ciel-fort); border-color: var(--ciel-fort); color: #fff; font-weight: 600; }
.fil { list-style: none; padding: 0; margin: 0; } .fil li { padding: 8px 0; border-bottom: 1px solid #eef4fa; font-size: 14px; }
.fil small { color: var(--encre-douce); display: block; }
@media (max-width: 700px) { .colonne { flex-basis: 84vw; } .kanban { margin: 0 -14px; padding: 0 14px 12px; scroll-padding: 0 14px; } }
/* ---------- Ventes : lignes de facture, document imprimable ---------- */
.lignes-doc { display: grid; gap: 8px; margin: 6px 0 10px; }
.ligne-doc { display: grid; grid-template-columns: 1fr 70px 100px 32px; gap: 6px; align-items: center; }
.ligne-doc input { padding: 8px 10px; border: 1px solid var(--bordure); border-radius: 10px; width: 100%; font: inherit; }
.ligne-doc button { border: 0; background: none; color: var(--encre-douce); cursor: pointer; font-size: 18px; }
.totaux { margin-left: auto; width: min(320px, 100%); } .totaux td { padding: 4px 6px; }
.statut { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: #eef2f5; color: var(--encre-douce); }
.statut.a_payer, .statut.envoyee { background: var(--ciel-100); color: var(--lien); } .statut.partielle { background: #fff3dc; color: #8a5a00; }
.statut.payee, .statut.acceptee { background: #e3f4ea; color: var(--bon); } .statut.retard { background: #fcebdf; color: #b35a1f; }
.papier { background: #fff; max-width: 820px; margin: 0 auto; padding: 44px; border-radius: 6px; box-shadow: var(--ombre); color: #111; }
.papier h1 { font-size: 28px; letter-spacing: .02em; } .papier table th { color: #555; }
.papier .deux { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin: 20px 0; }
.papier .petit { font-size: 13px; color: #444; line-height: 1.5; }
@media (max-width: 700px) { .ligne-doc { grid-template-columns: 1fr 56px 84px 26px; } .papier { padding: 20px; } }
@media print {
  body { background: #fff; } .barre, .onglets-bas, .non-imprime, .segments { display: none !important; }
  main { padding: 0 !important; max-width: none !important; } .papier { box-shadow: none; padding: 0; max-width: none; }
}
.bouton { text-decoration: none; }
label.champ.plein { grid-column: 1 / -1; }
