/* Tableau de bord Pilotage — charte reprise de l'ancien tableau de bord (fond #07090F, bleu #4F9CF9).
   Polices auto-hébergées : aucun appel à Google. Aucun style en ligne n'est utilisé (CSP stricte). */

@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-style: normal; font-display: swap; src: url("/fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Serif"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/instrument-serif-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Serif"; font-weight: 400; font-style: italic; font-display: swap; src: url("/fonts/instrument-serif-latin-400-italic.woff2") format("woff2"); }

:root {
  --ink: #07090F; --panel: #0C0F17; --text: #E8EEF5; --soft: #A5B0BF; --muted: #8591A3;
  --accent: #4F9CF9; --line: rgba(255,255,255,.08); --card: rgba(255,255,255,.035);
  --ok: #4ADE80; --mid: #FBBF24; --bad: #F87171;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { background: var(--ink); color: var(--text); font-family: Inter, system-ui, sans-serif; font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.serif { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; }
.noscript { padding: 24px; }
.cache { display: none !important; }

/* barre du haut */
.top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.top h1 { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; font-size: 28px; margin-right: 6px; }
.top .sp { flex: 1; }
.recherche { background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px; width: 240px; outline: none; }
.recherche:focus { border-color: var(--accent); }
.etat { font-size: 12.5px; color: var(--muted); min-width: 110px; text-align: right; }
.etat.err { color: var(--bad); } .etat.ok { color: var(--ok); }

/* boutons */
.btn { background: var(--accent); color: #06080D; border: 0; border-radius: 9px; padding: 9px 16px; font-weight: 600; cursor: pointer; }
.btn:hover { background: #74B0FB; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.fantome { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.fantome:hover { background: var(--card); }
.btn.danger { background: transparent; color: var(--bad); border: 1px solid rgba(248,113,113,.4); }
.btn.petit { padding: 6px 11px; font-size: 13px; }
.btn.ok { background: var(--ok); }
.btn-badge { position: relative; }
.badge { display: inline-block; min-width: 20px; margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: rgba(248,113,113,.18); color: var(--bad); font-size: 11.5px; text-align: center; }
.badge.mid { background: rgba(251,191,36,.16); color: var(--mid); }

/* indicateurs */
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; padding: 18px 24px 6px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.kpi b { display: block; font-family: "Instrument Serif", Georgia, serif; font-weight: 400; font-size: 30px; line-height: 1.1; }
.kpi span { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
.kpi.attention b { color: var(--mid); } .kpi.urgent b { color: var(--bad); }

/* bandeau d'avertissement */
.bandeau { margin: 12px 24px 0; padding: 10px 14px; border-radius: 10px; border: 1px solid rgba(251,191,36,.4); background: rgba(251,191,36,.07); color: var(--mid); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.bandeau.err { border-color: rgba(248,113,113,.45); background: rgba(248,113,113,.07); color: var(--bad); }
.bandeau span { flex: 1; }

/* onglets */
.onglets { display: flex; gap: 6px; padding: 14px 24px 0; overflow-x: auto; }
.onglet { background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 8px 14px; cursor: pointer; font-weight: 500; white-space: nowrap; }
.onglet[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
main { padding: 14px 24px 60px; }

/* tableau (kanban) */
.tableau { display: grid; grid-auto-flow: column; grid-auto-columns: 268px; gap: 12px; overflow-x: auto; padding-bottom: 14px; align-items: start; }
.col { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; min-height: 120px; }
.col h3 { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 500; display: flex; justify-content: space-between; margin-bottom: 10px; }
.col h3 em { font-style: normal; color: var(--soft); }
.carte { display: block; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; margin-bottom: 9px; cursor: pointer; }
.carte:hover { border-color: rgba(79,156,249,.5); }
.carte b { display: block; font-weight: 600; margin-bottom: 1px; overflow-wrap: anywhere; }
.carte small { display: block; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.pastilles { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pastille { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--soft); white-space: nowrap; }
.pastille.high { border-color: rgba(248,113,113,.5); color: var(--bad); background: rgba(248,113,113,.08); }
.pastille.mid { border-color: rgba(251,191,36,.5); color: var(--mid); background: rgba(251,191,36,.08); }
.pastille.ok { border-color: rgba(74,222,128,.45); color: var(--ok); background: rgba(74,222,128,.07); }
.pastille.info { border-color: rgba(79,156,249,.45); color: var(--accent); background: rgba(79,156,249,.08); }
.vide { color: var(--muted); font-size: 13px; padding: 6px 2px; }

/* liste */
.enveloppe-table { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; min-width: 960px; }
th { text-align: left; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; user-select: none; white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--soft); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr { cursor: pointer; }
tbody tr:hover td { background: rgba(255,255,255,.025); }
td b { color: var(--text); font-weight: 600; }
td small { color: var(--muted); }

/* alertes */
.alertes { display: grid; gap: 10px; max-width: 980px; }
.alerte { display: flex; gap: 14px; align-items: center; background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--muted); border-radius: 10px; padding: 12px 14px; }
.alerte.high { border-left-color: var(--bad); } .alerte.mid { border-left-color: var(--mid); } .alerte.info { border-left-color: var(--accent); }
.alerte .corps { flex: 1; min-width: 0; }
.alerte b { font-weight: 600; overflow-wrap: anywhere; }
.alerte small { display: block; color: var(--muted); overflow-wrap: anywhere; }
.alerte .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* file d'appels */
.resume-file { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.file { display: grid; gap: 12px; max-width: 1040px; }
.appel { background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--muted); border-radius: 12px; padding: 14px 16px; display: grid; gap: 10px; }
.appel.urgent { border-left-color: var(--bad); } .appel.rappel_du { border-left-color: var(--mid); } .appel.nouveau { border-left-color: var(--accent); }
.appel .entete { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.appel .entete b { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.appel .poste { color: var(--soft); overflow-wrap: anywhere; }
.appel .client { margin-left: auto; color: var(--muted); font-size: 12.5px; }
.appel .contact { display: flex; gap: 16px; flex-wrap: wrap; color: var(--soft); }
.appel .contact .absent { color: var(--muted); font-style: italic; }
.extrait { background: rgba(255,255,255,.03); border-radius: 8px; padding: 9px 12px; color: var(--soft); overflow-wrap: anywhere; }
.appel .boutons { display: flex; gap: 8px; flex-wrap: wrap; }
.mini { font-size: 12px; color: var(--muted); }

/* fiche client */
.voile { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: none; z-index: 30; }
.voile.on { display: block; }
.tiroir { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100%); background: var(--panel); border-left: 1px solid var(--line); z-index: 31; transform: translateX(105%); transition: transform .25s; overflow-y: auto; padding: 22px 24px 48px; }
.tiroir.on { transform: none; }
.tiroir h2 { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; font-size: 30px; line-height: 1.1; margin-bottom: 2px; overflow-wrap: anywhere; }
.tiroir .sous-titre { color: var(--muted); margin-bottom: 16px; overflow-wrap: anywhere; }
.fermer { position: absolute; top: 14px; right: 16px; background: none; border: 0; font-size: 26px; color: var(--muted); cursor: pointer; }
details.section { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
details.section > summary { cursor: pointer; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin-bottom: 12px; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.section > summary::-webkit-details-marker { display: none; }
details.section > summary::after { content: "▾"; }
details.section:not([open]) > summary::after { content: "▸"; }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.f { margin-bottom: 12px; }
.f label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; }
.f input, .f select, .f textarea { width: 100%; background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; outline: none; color-scheme: dark; }
.f textarea { min-height: 90px; resize: vertical; }
.f input:focus, .f select:focus, .f textarea:focus { border-color: var(--accent); }
.f select option { background: #0C0F17; }
.f .aide { font-size: 12px; color: var(--muted); margin-top: 4px; }
.coche { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
.coche input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.coche label { cursor: pointer; }
.coche.non-remplie label { color: var(--bad); }
.faits { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.fait { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.fait b { display: block; font-size: 17px; } .fait span { font-size: 12px; color: var(--muted); }
.fait.high b { color: var(--bad); } .fait.mid b { color: var(--mid); } .fait.ok b { color: var(--ok); }
.jauge { height: 8px; background: rgba(255,255,255,.08); border-radius: 999px; overflow: hidden; margin: 6px 0; }
.jauge > div { height: 100%; background: var(--accent); border-radius: 999px; }
.jauge.mid > div { background: var(--mid); } .jauge.high > div { background: var(--bad); } .jauge.ok > div { background: var(--ok); }
.entonnoir { display: grid; gap: 6px; }
.etape { display: grid; grid-template-columns: 150px 1fr 80px; gap: 10px; align-items: center; }
.etape .nom { color: var(--soft); font-size: 13px; }
.etape .val { text-align: right; font-weight: 600; }
.etape .val small { color: var(--muted); font-weight: 400; display: block; font-size: 11.5px; }
.liste-lignes { display: grid; gap: 8px; }
.ligne { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 6px; }
.ligne .tete { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.ligne .tete b { overflow-wrap: anywhere; }
.ligne .boutons { display: flex; gap: 6px; flex-wrap: wrap; }
.infos dt { font-size: 12px; color: var(--muted); margin-top: 10px; } .infos dd { color: var(--text); overflow-wrap: anywhere; }
.proposition { border: 1px solid rgba(79,156,249,.45); background: rgba(79,156,249,.07); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; display: grid; gap: 8px; }
.alertes-fiche { display: grid; gap: 8px; margin-bottom: 6px; }

/* fenêtres */
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 16px; padding: 24px; width: min(480px, calc(100% - 24px)); margin: auto; }
dialog::backdrop { background: rgba(0,0,0,.6); }
dialog h2 { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; font-size: 26px; margin-bottom: 8px; }
dialog p { color: var(--soft); margin-bottom: 14px; overflow-wrap: anywhere; }
dialog .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.erreur { color: var(--bad); min-height: 20px; margin-top: 8px; }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 60; }
.toast { background: #12161F; border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; max-width: min(520px, 92vw); }
.toast.err { border-color: rgba(248,113,113,.5); color: var(--bad); }

/* connexion */
.connexion { min-height: 100%; display: grid; place-items: center; padding: 20px; }
.connexion .boite { width: min(400px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px; }
.connexion h1 { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; font-size: 32px; margin-bottom: 4px; }
.connexion p { color: var(--soft); margin-bottom: 18px; }

@media (max-width: 1000px) { .kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) {
  .kpis { grid-template-columns: repeat(2, 1fr); } .recherche { width: 100%; }
  .top, main, .kpis, .onglets { padding-left: 16px; padding-right: 16px; }
  .bandeau { margin-left: 16px; margin-right: 16px; } .deux, .faits { grid-template-columns: 1fr; }
  .etape { grid-template-columns: 110px 1fr 70px; }
}

/* M7 : portail client et tableaux */
.portail { max-width: 760px; margin: 0 auto; padding: 32px 20px 60px; display: grid; gap: 26px; }
.portail h1 { font-size: 36px; line-height: 1.1; }
.portail h2 { font-size: 24px; margin-bottom: 10px; }
.portail ul { margin: 8px 0 0 18px; }
td.neg { color: var(--bad); }
.extrait { user-select: all; }

/* Portail : retours sur les rendez-vous et agenda */
.retour { margin-top: 10px; display: grid; gap: 8px; }
.portail .boutons { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
a.btn { text-decoration: none; display: inline-block; }
.retour-client { margin: 6px 0; padding: 8px 10px; border-left: 2px solid var(--accent); display: grid; gap: 6px; }

/* Portail : navigation, pages larges, panneau de détail */
.nav-portail { max-width: 1280px; margin: 0 auto; padding-top: 16px; }
.bandeau-demo { max-width: 1280px; margin: 10px auto 0; }
.portail.large { max-width: 1280px; }
.portail .tableau { grid-auto-columns: minmax(230px, 1fr); }
.portail .controles { margin: 8px 0 12px; }
.portail .controles select { background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; color-scheme: dark; }
.portail table.contacts { min-width: 760px; }
.portail .pagination { margin-top: 12px; justify-content: center; }
.tiroir h3 { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin: 0 0 8px; }
.tiroir .bloc { padding: 14px 0; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.tiroir .lecture > div { overflow-wrap: anywhere; }
.tiroir .historique { margin: 0 0 0 18px; color: var(--soft); font-size: 13px; }
.tiroir .fermer { position: absolute; top: 14px; right: 16px; background: transparent; border: 0; color: var(--muted); font-size: 26px; cursor: pointer; }
.sequence .extrait { margin: 6px 0; }
