/* Vasalis : rail de navigation à gauche, espace de travail, fiche en sections.
   Couleurs, polices et formes : charte graphique Vasalis (novembre 2026). */

/* Polices de la charte, hébergées avec l'application (aucun appel à un service tiers) */
@font-face { font-family: "Source Sans 3"; src: url("fonts/SourceSans3-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("fonts/SourceSans3-400italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("fonts/SourceSans3-600.woff2") format("woff2"); font-weight: 500 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("fonts/SourceSans3-700.woff2") format("woff2"); font-weight: 700 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("fonts/Manrope-600.woff2") format("woff2"); font-weight: 500 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("fonts/Manrope-700.woff2") format("woff2"); font-weight: 700 900; font-style: normal; font-display: swap; }

:root {
  /* surfaces */
  --bg: #F6F3EE; --surface: #FFFFFF; --sunk: #ECE6DD; --line: #DDD6CB; --line-strong: #7F8A86;
  /* texte */
  --ink: #12313A; --muted: #4D6067;
  /* marque */
  --accent: #155E66; --accent-strong: #0E474E; --on-accent: #FFFFFF; --accent-soft: #DCEDEC;
  --cuivre: #C0662F; --cuivre-text: #93471B; --focus: #C0662F;
  /* états */
  --ok: #2D6A3E; --ok-soft: #E1F0E4; --warn: #8A5A00; --warn-soft: #FBEFD6; --crit: #A8322A; --crit-soft: #F8E1DE;
  --ombre-1: 0 1px 2px rgba(18, 49, 58, .08), 0 1px 1px rgba(18, 49, 58, .04);
  --ombre-2: 0 8px 24px rgba(18, 49, 58, .14), 0 2px 6px rgba(18, 49, 58, .08);
  --f-titre: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-body: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-data: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
/* Thème : data-theme="clair" | "sombre" | "systeme" sur <html> (Paramètres, onglet Affichage).
   Les couleurs sombres de la charte s'appliquent si l'utilisateur choisit Sombre, ou Comme le système sur un système sombre. */
:root[data-theme="sombre"] {
    --bg: #0F2228; --surface: #16313A; --sunk: #1D3C46; --line: #2B4C56; --line-strong: #7C979C;
    --ink: #EAF1F0; --muted: #A9BCBE;
    --accent: #5DB3B0; --accent-strong: #7FC6C3; --on-accent: #0F2228; --accent-soft: #1E4950;
    --cuivre: #E08A55; --cuivre-text: #EFA57A; --focus: #E08A55;
    --ok: #7CC58E; --ok-soft: #1C3F2A; --warn: #E5B65C; --warn-soft: #3D3117; --crit: #F08A80; --crit-soft: #4A2320;
    --ombre-1: none;
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="clair"]) {
    --bg: #0F2228; --surface: #16313A; --sunk: #1D3C46; --line: #2B4C56; --line-strong: #7C979C;
    --ink: #EAF1F0; --muted: #A9BCBE;
    --accent: #5DB3B0; --accent-strong: #7FC6C3; --on-accent: #0F2228; --accent-soft: #1E4950;
    --cuivre: #E08A55; --cuivre-text: #EFA57A; --focus: #E08A55;
    --ok: #7CC58E; --ok-soft: #1C3F2A; --warn: #E5B65C; --warn-soft: #3D3117; --crit: #F08A80; --crit-soft: #4A2320;
    --ombre-1: none;
    color-scheme: dark;
  }
}
html, body { background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
a:hover { color: var(--accent-strong); }

.app { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.rail { background: var(--surface); border-right: 1px solid var(--line); padding: 20px 16px; display: flex; flex-direction: column; gap: 20px; }
.brand { font-family: var(--f-titre); font-weight: 700; font-size: 18px; line-height: 1.2; }
.brand-logo { display: inline-block; line-height: 0; margin-bottom: 6px; }
.logo-vasalis { display: block; }
.logo-vasalis img { display: block; height: auto; }
.logo-vasalis .logo-sombre { display: none; }
:root[data-theme="sombre"] .logo-vasalis .logo-clair { display: none; }
:root[data-theme="sombre"] .logo-vasalis .logo-sombre { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="clair"]) .logo-vasalis .logo-clair { display: none; }
  :root:not([data-theme="clair"]) .logo-vasalis .logo-sombre { display: block; }
}
.brand-compte { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 24px; }
.brand-compte small { margin-top: 10px; }
.apropos-logo { margin-bottom: 18px; }
.brand small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); margin-top: 4px; }
.rail nav { display: flex; flex-direction: column; gap: 2px; }
.rail nav a, .rail nav button { display: block; padding: 8px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; font-weight: 500; background: none; border: 0; text-align: left; width: 100%; font: inherit; cursor: pointer; }
.rail nav a:hover, .rail nav button:hover { background: var(--sunk); }
.rail nav a.active { background: var(--accent-soft); color: var(--ink); box-shadow: inset 3px 0 0 var(--accent); font-weight: 600; }
.rail .bas { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.rail .qui { font-size: 12px; color: var(--muted); padding: 0 10px 6px; }
main.travail { padding: 28px 28px 64px; min-width: 0; max-width: 1200px; }

h1, h2, h3, h4 { font-family: var(--f-titre); letter-spacing: -0.01em; }
h1 { font-weight: 700; font-size: 28px; line-height: 1.2; margin: 0; }
h2 { font-weight: 700; font-size: 18px; margin: 0 0 12px; }
.tete { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 24px; }
.tete p { margin: 4px 0 0; color: var(--muted); }
.muted { color: var(--muted); }
.mono { font-family: var(--f-data); font-variant-numeric: tabular-nums; }
.petit { font-size: 12px; }

.btn { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; font-size: 14px; padding: 7px 14px; border-radius: 8px; cursor: pointer; text-decoration: none; display: inline-block; line-height: 1.4; }
.btn:hover { border-color: var(--accent); color: var(--accent-strong); }
.btn.primaire { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primaire:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn.danger { color: var(--crit); border-color: var(--crit); }
.btn.danger:hover { background: var(--crit-soft); color: var(--crit); border-color: var(--crit); }
.confirmation-suppression { border: 1px solid var(--crit); }
fieldset.sans-cadre { border: 0; padding: 0; margin: 0; min-width: 0; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.e-Reflexion { background: var(--sunk); color: var(--muted); }
.e-DeuxiemeConsultation { background: var(--accent-soft); color: var(--accent); border: 1px dashed var(--accent); }
.e-DossierIncomplet { background: var(--warn-soft); color: var(--warn); }
.e-APlanifier { background: var(--accent-soft); color: var(--accent); }
.e-Planifie { background: var(--accent); color: var(--on-accent); }
.e-Controle { background: var(--warn-soft); color: var(--warn); }
.e-Clos { background: var(--ok-soft); color: var(--ok); }
.tag { display: inline-block; font-family: var(--f-data); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); margin-left: 4px; }
.tag.visio { border-color: var(--accent); color: var(--accent); }
.dot { display: inline-flex; align-items: baseline; gap: 6px; font-size: 13px; }
.dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line); flex: none; transform: translateY(-1px); }
.dot.ok::before { background: var(--ok); } .dot.warn::before { background: var(--warn); } .dot.crit::before { background: var(--crit); }

.barre-outils { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.filtre { border: 1px solid var(--line); background: var(--surface); color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 999px; cursor: pointer; }
.filtre.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
input:not([type]), input[type=text], input[type=search], input[type=date], input[type=number], input[type=tel], input[type=email], input[type=password], select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; padding: 6px 10px; min-width: 0; max-width: 100%; }
input[type=search] { margin-left: auto; width: 240px; }
textarea { width: 100%; }

.tableau { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--ombre-1); }
.tableau table { width: 100%; border-collapse: collapse; min-width: 960px; }
.tableau th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); }
/* En-têtes triables : le bouton reprend le style de l'en-tête, avec une flèche dessinée en CSS (hors du texte copié dans data-label). */
.tableau th.triable { padding: 0; }
.tableau th .tri { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 6px; width: 100%; padding: 10px 14px; cursor: pointer;
  font: inherit; text-transform: inherit; letter-spacing: inherit; color: inherit; white-space: nowrap; }
.tableau th .tri::after { content: ""; width: 8px; height: 11px; flex: none; opacity: .45; background: currentColor;
  clip-path: polygon(50% 0, 100% 40%, 56% 40%, 56% 60%, 100% 60%, 50% 100%, 0 60%, 44% 60%, 44% 40%, 0 40%); }
.tableau th .tri:hover { color: var(--ink); }
.tableau th .tri:hover::after { opacity: .8; }
.tableau th .tri.asc, .tableau th .tri.desc { color: var(--accent); }
.tableau th .tri.asc::after { opacity: 1; clip-path: polygon(50% 15%, 100% 75%, 0 75%); }
.tableau th .tri.desc::after { opacity: 1; clip-path: polygon(0 25%, 100% 25%, 50% 85%); }
.tableau th .tri:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: 4px; }
.tableau td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tableau tr:last-child td { border-bottom: 0; }
.tableau tbody tr.lien { cursor: pointer; }
.tableau tbody tr.lien:hover td { background: var(--sunk); }

.colonnes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.colonnes.colonnes-tdb { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.tableau table.table-pieces { min-width: 720px; }
.sec { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--ombre-1); padding: 16px; margin-bottom: 12px; }
.sec h3 { font-weight: 700; font-size: 16px; margin: 0 0 12px; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.grille2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.grille3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px 14px; }
.champ { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.champ > span:first-child { font-size: 13px; font-weight: 600; letter-spacing: .01em; color: var(--muted); }
.plein { grid-column: 1 / -1; }
.coches { display: flex; flex-direction: column; gap: 6px; }
.sous-case { margin-left: 28px; padding-left: 10px; border-left: 2px solid var(--line); }
.coche { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
.coche input { margin-top: 3px; }
.sous { background: var(--sunk); border-radius: 8px; padding: 12px; margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.separe { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.ligne-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.actions-fixes { margin-top: 16px; }
.note { font-size: 12px; border-radius: 7px; padding: 8px 10px; margin-top: 10px; }
.note.crit { background: var(--crit-soft); color: var(--crit); }
.note.info { background: var(--accent-soft); color: var(--accent); }
.note.ok { background: var(--ok-soft); color: var(--ok); }
.doc { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.doc:first-of-type { border-top: 0; }
.doc .meta { font-size: 12px; color: var(--muted); }
.doc .actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.verif { margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.verif .titre { font-weight: 600; font-size: 13px; margin-bottom: 8px; }
.verif ul { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 4px; }

.alertes { display: flex; flex-direction: column; }
.alerte { display: grid; grid-template-columns: 6px 1fr; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.alerte:first-child { border-top: 0; }
.sev { align-self: stretch; border-radius: 3px; min-height: 18px; }
.sev.Critique { background: var(--crit); } .sev.Attention { background: var(--warn); } .sev.AFaire { background: var(--accent); }

.etapes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin: 4px 0 20px; list-style: none; padding: 0; }
.etapes li { font-size: 11px; color: var(--muted); border-top: 4px solid var(--line); padding-top: 6px; line-height: 1.25; }
.etapes li.fait { border-color: var(--ok); color: var(--ink); }
.etapes li.cours { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.etapes li.saute { border-top-style: dashed; }

.enregistrer { position: sticky; bottom: 0; background: var(--surface); border: 1px solid var(--accent); border-radius: 14px; padding: 10px 14px; display: flex; gap: 12px; align-items: center; justify-content: space-between; box-shadow: 0 -4px 16px rgba(0,0,0,.08); margin-top: 12px; z-index: 5; }
.message { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; }
.message.ok { background: var(--ok-soft); color: var(--ok); }
.message.crit { background: var(--crit-soft); color: var(--crit); }
.message.info { background: var(--accent-soft); color: var(--accent); }
.message.message-bas { margin: 12px 0 0; max-width: 860px; }
.liste .ligne { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); align-items: center; }
.liste .ligne:first-child { border-top: 0; }

/* Pages de compte (connexion, double authentification) */
.compte { max-width: 480px; margin: 7vh auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 32px; box-shadow: var(--ombre-2); }

#blazor-error-ui { color-scheme: light only; background: lightyellow; bottom: 0; box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); box-sizing: border-box; display: none; left: 0; padding: 0.6rem 1.25rem 0.7rem 1.25rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }
.valid.modified:not([type=checkbox]) { outline: 1px solid var(--ok); }
.invalid { outline: 1px solid var(--crit); }
.validation-message { color: var(--crit); font-size: 12px; }

/* Menu : sur ordinateur, colonne de gauche ; le bouton « Menu » ne sert que sur téléphone (menu.js). */
.menu-panneau { display: flex; flex-direction: column; gap: 20px; flex: 1; }
.bouton-menu { display: none; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  main.travail { padding: 20px 16px 48px; }
  .colonnes, .colonnes.colonnes-tdb, .grille2, .grille3 { grid-template-columns: 1fr; }

  /* Barre fixe en haut : logo et bouton Menu ; le menu s'ouvre dans un panneau. */
  .rail { position: sticky; top: 0; z-index: 50; padding: 0; gap: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .barre-haut { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px; min-height: 56px; }
  .barre-haut .brand small { display: none; }
  .barre-haut .brand-logo { margin-bottom: 0; }
  .barre-haut .logo-vasalis img { width: 108px; }
  .bouton-menu { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
  .bouton-menu .croix { display: none; }
  .menu-ouvert .bouton-menu .croix { display: inline; }
  .menu-ouvert .bouton-menu .trois-traits { display: none; }
  .menu-panneau { display: none; }
  .menu-ouvert .menu-panneau { display: flex; gap: 8px; position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--ombre-2); padding: 8px 16px 16px; max-height: calc(100dvh - 57px); overflow-y: auto; }
  .menu-ouvert .app::after { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, .3); z-index: 40; }
  .menu-ouvert, .menu-ouvert body { overflow: hidden; }
  .rail nav { flex-direction: column; }
  .rail nav a, .rail nav button { width: 100%; padding: 12px 10px; font-size: 16px; }
  .rail .bas { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
}

/* Téléphone : tableaux en cartes (intitulés de colonne posés par menu.js), saisie confortable au doigt. */
@media (max-width: 700px) {
  .tableau { background: none; border: 0; box-shadow: none; overflow: visible; }
  .tableau table, .tableau table.table-pieces, .recap table { min-width: 0; }
  .tableau td { overflow-wrap: anywhere; text-align: left !important; }
  .tableau table, .tableau tbody, .tableau tr, .tableau td { display: block; width: 100%; }
  .tableau thead { display: none; }
  .tableau tr { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--ombre-1); padding: 10px 14px; margin-bottom: 10px; }
  .tableau td { border: 0; padding: 5px 0 5px 40%; position: relative; min-height: 28px; }
  .tableau td::before { content: attr(data-label); font-family: var(--f-body); position: absolute; left: 0; top: 7px; width: calc(40% - 12px); font-size: 11px; line-height: 1.3; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
  .tableau td[data-label=""], .tableau td:not([data-label]) { padding-left: 0; }
  .tableau td[data-label=""]::before, .tableau td:not([data-label])::before { display: none; }
  .tableau td:empty { display: none; }
  .tableau tr:last-child td { border-bottom: 0; }
  .tableau tbody tr.lien:hover td { background: none; }
  .barre-outils input[type=search] { width: 100%; margin-left: 0; }
  .tableau tbody tr.lien:active { border-color: var(--accent); }
  input, select, textarea, .form-control { font-size: 16px; }
  input[type=date], input[type=time] { min-height: 44px; text-align: left; }
  input[type=date]::-webkit-date-and-time-value { text-align: left; }
  .btn { min-height: 40px; }
  h1 { font-size: 24px; }
  /* Bouton principal toujours visible en bas de l'écran */
  .actions-fixes { position: sticky; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); margin: 16px -16px 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
  .actions-fixes .btn { flex: 1; text-align: center; }
}

/* Harmonisation avec les pages de compte (Bootstrap) */
.btn.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.btn-primary:hover, .btn.btn-primary:focus { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
.btn-lg { font-size: 16px; padding: 10px 16px; border-radius: 8px; }
h1:focus, h1:focus-visible { outline: none; }
.nav-pills .nav-link.active { background: var(--accent); }
.form-control, .form-label { font-size: 14px; }

/* Éléments tracés : date et auteur de validation sous la case */
.trace { display: flex; flex-direction: column; gap: 2px; }
.trace-info { margin-left: 24px; font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.trace-info input[type=date] { font-size: 12px; padding: 1px 6px; }
.onglets { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.onglets button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 14px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; margin-bottom: -1px; }
.onglets button.on { color: var(--accent); border-bottom-color: var(--accent); }
/* Onglets du dossier patient : barre segmentée bien visible, en clair comme en sombre. */
.onglets.onglets-dossier { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 6px; margin: 4px 0 20px;
  background: var(--sunk); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--ombre-1); }
.onglets-dossier button { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0; border: 1px solid transparent; border-radius: 10px;
  padding: 12px 16px; font-family: var(--f-titre); font-size: 16px; font-weight: 700; color: var(--ink); background: transparent; transition: background .15s, color .15s; }
.onglets-dossier button .ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.onglets-dossier button:hover { background: var(--accent-soft); color: var(--accent-strong); }
.onglets-dossier button.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent-strong); box-shadow: var(--ombre-2); }
.onglets-dossier button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.recap td.statut { white-space: nowrap; }
.recap tr.section td { background: var(--sunk); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 6px 14px; }
.recap table { min-width: 720px; }
.pipe { display: grid; grid-template-columns: repeat(var(--n, 6), 1fr); gap: 8px; margin-bottom: 28px; }
.etape-carte { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--ombre-1); padding: 12px 14px; text-align: left; text-decoration: none; color: inherit; display: block; }
.etape-carte:hover { border-color: var(--accent); color: inherit; }
/* Toute la carte est cliquable (lien étiré) ; le lien « planifiés encore en réflexion » passe au-dessus. */
.etape-carte .etape-lien { display: block; text-decoration: none; }
.etape-carte .etape-lien::after { content: ""; position: absolute; inset: 0; border-radius: 14px; }
.etape-carte .etape-plus { position: relative; z-index: 1; display: block; margin-top: 8px; font-size: 12px; line-height: 1.3; color: var(--accent); }
.case-filtre { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2, var(--ink)); }
.etape-carte .k { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.etape-carte .v { font-family: var(--f-titre); font-size: 32px; font-weight: 700; line-height: 1.1; margin-top: 4px; font-variant-numeric: tabular-nums; }
.etape-carte .bar { height: 4px; border-radius: 2px; background: var(--sunk); margin-top: 10px; overflow: hidden; }
.etape-carte .bar i { display: block; height: 100%; background: var(--accent); }
.panneau { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--ombre-1); padding: 18px; }
.semaine { margin-bottom: 18px; }
.semaine h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 6px; font-weight: 600; }
.creneau { display: grid; grid-template-columns: 120px 1fr auto; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin-bottom: 6px; }
.totaux { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.grand { font-family: var(--f-titre); font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.liste-alertes .alerte { grid-template-columns: 6px 1fr auto; }
@media (max-width: 900px) {
  .pipe { grid-template-columns: repeat(3, 1fr); }
  .creneau, .totaux { grid-template-columns: 1fr; }
}

/* Menu gauche fixe : le pied reste visible quand la page défile */
@media (min-width: 901px) {
  .rail { position: sticky; top: 0; height: 100vh; overflow-y: auto; }
}

/* Pages Mon compte : espacements */
.gestion h3 { margin-bottom: 16px; }
.gestion h4 { margin-top: 28px; margin-bottom: 12px; font-size: 16px; }
.gestion .btn { margin: 0 8px 10px 0; }
.gestion form { margin-bottom: 12px; }
.gestion .alert { margin-bottom: 16px; }
.gestion p { margin-bottom: 12px; }
.nav-pills .nav-link { color: var(--ink); }
.nav-pills .nav-link.active { color: var(--on-accent); }

/* Champs Bootstrap (pages de compte) alignés sur le thème clair / sombre */
.form-control, .form-select { background-color: var(--surface); color: var(--ink); border-color: var(--line-strong); border-radius: 8px; }
.form-control:focus, .form-select:focus { background-color: var(--surface); color: var(--ink); border-color: var(--accent); box-shadow: 0 0 0 .2rem var(--accent-soft); }
.form-control:disabled, .form-control[readonly] { background-color: var(--sunk); color: var(--ink); opacity: 1; }
.form-floating > label { color: var(--muted); }
.form-floating > .form-control:focus ~ label, .form-floating > .form-control:not(:placeholder-shown) ~ label, .form-floating > .form-control:disabled ~ label { color: var(--muted); }
.form-floating > .form-control:disabled ~ label::after, .form-floating > .form-control:focus ~ label::after, .form-floating > .form-control:not(:placeholder-shown) ~ label::after { background-color: transparent; }
.alert-info { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-soft); }
.alert-warning { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-soft); }
.alert-danger { background: var(--crit-soft); color: var(--crit); border-color: var(--crit-soft); }
.alert-success { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-soft); }
kbd { background: var(--sunk); color: var(--ink); }

/* Aperçu du logo dans les paramètres */
.logo-apercu { width: 96px; height: 64px; border: 1px solid var(--line); border-radius: 8px; display: flex; align-items: center; justify-content: center; background: #fff; flex: none; overflow: hidden; }
.logo-apercu img { max-width: 88px; max-height: 56px; object-fit: contain; }
.monogramme { width: 52px; height: 52px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 20px; display: flex; align-items: center; justify-content: center; letter-spacing: .02em; }
.cotation { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13px; }
.cotation td { padding: 5px 0; border-bottom: 1px solid var(--line); }
.cotation td:last-child { text-align: right; white-space: nowrap; }
.cotation tr.total td { font-weight: 600; border-bottom: 0; }
.import-identite { margin-bottom: 16px; }
.import-ligne { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.import-ligne .scan { flex: 1; min-width: 220px; }
.alertes-import { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.alertes-import li { padding: 7px 10px; border-radius: 6px; background: var(--accent-soft); }
.alertes-import li.crit { background: var(--crit-soft); color: var(--crit); }
.brand small + small { margin-top: 1px; }

.apropos { max-width: 620px; }
.apropos dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; margin: 0 0 14px; }
.apropos dt { color: var(--muted); }
.apropos dd { margin: 0; }
@media (max-width: 600px) { .apropos dl { grid-template-columns: 1fr; gap: 2px; } .apropos dd { margin-bottom: 8px; } }

/* Paramètres : onglets et choix du thème */
.params-onglet { max-width: 860px; }
.choix-theme { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.carte-theme { display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 12px; cursor: pointer; background: var(--surface); }
.carte-theme:hover { border-color: var(--accent); }
.carte-theme.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.carte-theme input { position: absolute; opacity: 0; pointer-events: none; }
.carte-theme:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.apercu-theme { display: grid; grid-template-columns: 30% 1fr; grid-template-rows: 1fr 1fr; gap: 4px; height: 54px; border-radius: 6px; padding: 5px; border: 1px solid var(--line); }
.apercu-theme i { border-radius: 3px; }
.apercu-theme i:first-child { grid-row: 1 / 3; }
.apercu-clair { background: #F6F3EE; } .apercu-clair i { background: #FFFFFF; } .apercu-clair i:last-child { background: #DCEDEC; }
.apercu-sombre { background: #0F2228; } .apercu-sombre i { background: #16313A; } .apercu-sombre i:last-child { background: #1E4950; }
.apercu-double { position: relative; display: block; height: 54px; }
.apercu-double .apercu-theme { position: absolute; inset: 0; }
.apercu-double .apercu-sombre { clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% 100%); }
@media (max-width: 700px) { .choix-theme { grid-template-columns: 1fr; } .onglets { overflow-x: auto; } .onglets button { white-space: nowrap; } .onglets.onglets-dossier { overflow: visible; gap: 4px; padding: 4px; } .onglets-dossier button { padding: 10px 6px; font-size: 14px; gap: 6px; } .onglets-dossier button .ico { width: 16px; height: 16px; } }


/* Page Références */
.references { max-width: 900px; }
.liste-references { display: flex; flex-direction: column; }
.reference { padding: 12px 0; border-top: 1px solid var(--line); }
.reference:first-child { border-top: 0; padding-top: 0; }
.reference:last-child { padding-bottom: 0; }
.reference-tete { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.reference-titre { font-weight: 600; }
.reference-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; flex: none; }
.reference p { margin: 6px 0 0; }
@media (max-width: 700px) { .reference-tete { flex-direction: column; } .reference-actions { justify-content: flex-start; } }

/* Zone de dépôt du document d'identité (glisser-déposer ou clic) */
.zone-depot { position: relative; flex: 1 1 100%; min-height: 76px; border: 2px dashed var(--line-strong); border-radius: 10px; background: var(--sunk); display: flex; align-items: center; justify-content: center; text-align: center; padding: 12px 16px; transition: border-color .15s, background .15s; }
.zone-depot:hover, .zone-depot.survol, .zone-depot:focus-within { border-color: var(--accent); background: var(--accent-soft); }
.zone-depot.survol { border-style: solid; }
.zone-depot:focus-within { outline: 2px solid var(--focus, var(--accent)); outline-offset: 2px; }
.zone-depot-champ { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.zone-depot-texte { pointer-events: none; display: flex; flex-direction: column; gap: 3px; }
.zone-depot-texte span { font-size: 12.5px; color: var(--muted); }
.zone-depot.lecture { border-style: solid; border-color: var(--accent); }
.zone-depot.desactive { opacity: .55; }
.zone-depot.desactive .zone-depot-champ, .zone-depot.lecture .zone-depot-champ { cursor: not-allowed; }

/* Documents à glisser vers un autre logiciel */
.doc-glissable { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); cursor: grab; user-select: none; }
.doc-glissable::before { content: ""; width: 10px; height: 12px; flex: none; background: radial-gradient(circle, var(--muted) 1.2px, transparent 1.4px) 0 0 / 5px 4px; opacity: .8; }
.doc-glissable:hover { border-color: var(--accent); background: var(--accent-soft); }
.doc-glissable.en-cours { cursor: grabbing; opacity: .6; }
.aide-export { margin: -4px 0 10px; }

/* Empreinte SHA-256 d'une pièce (0.3.22) */
.empreinte { margin-top: 2px; }
.empreinte code { font-size: 12px; color: var(--ink); background: none; }
.lien-btn { background: none; border: 0; padding: 0 2px; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; }
.lien-btn:hover { color: var(--accent-strong); }
.lien-btn.ok { color: var(--ok); text-decoration: none; }

/* A propos : copie des informations pour le support (0.3.25) */
.apropos-support { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.apropos-support p { margin: 0; }
.copier-support { display: inline-flex; align-items: center; gap: 6px; }
.copier-support .icone { flex: none; }
.copier-support.ok { color: var(--ok); border-color: var(--ok); }
.support-texte { width: 100%; margin-top: 12px; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; resize: vertical; }

/* Avertissement avant déconnexion pour inactivité (0.3.27) */
.avertissement-inactivite { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .35); }
.avertissement-inactivite[hidden] { display: none; }
.carte-inactivite { max-width: 420px; background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--ombre-2); padding: 20px 22px; }
.carte-inactivite strong { display: block; font-family: var(--f-titre); font-size: 18px; margin-bottom: 6px; }
.carte-inactivite p { margin: 0 0 14px; }
.carte-inactivite .btn { width: 100%; }
