/* Katonne Suite — charte graphique
   Logiciel installé et utilisable hors ligne : polices et icônes sont embarquées
   (static/polices, static/icones.svg), aucune ressource externe.
   Police : IBM Plex Sans (licence OFL). Icônes : Lucide (licence ISC), trait unique. */

@font-face { font-family: "Plex"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(polices/plex-sans-latin-400.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(polices/plex-sans-latin-ext-400.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plex"; font-style: italic; font-weight: 400; font-display: swap;
  src: url(polices/plex-sans-latin-400-italique.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex"; font-style: italic; font-weight: 400; font-display: swap;
  src: url(polices/plex-sans-latin-ext-400-italique.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plex"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(polices/plex-sans-latin-500.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(polices/plex-sans-latin-ext-500.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plex"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(polices/plex-sans-latin-600.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(polices/plex-sans-latin-ext-600.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---------- Jetons ----------
   Le rouge Katonne est la couleur d'identité (logo, repère de l'écran actif).
   Les actions principales sont en anthracite, pour ne jamais confondre
   « valider » avec « supprimer » ; le rouge d'alerte est un rouge brique distinct. */
:root {
  --marque: #c8102e;
  --fond: #f2f3f5;
  --surface: #ffffff;
  --surface-2: #f7f8f9;
  --survol: #f4f6f8;
  --bordure: #dcdfe3;
  --bordure-douce: #eceef1;
  --bordure-forte: #c3c8cf;
  --texte: #1b1e22;
  --texte-2: #57606a;
  --texte-3: #8a929b;
  --barre: #1f2226;
  --barre-texte: #c5cad0;
  --primaire: #262b31;
  --primaire-survol: #0f1215;
  --lien: #1c5282;
  --ok: #1e7a48;        --ok-fond: #ebf5ef;       --ok-bord: #b7d9c4;
  --erreur: #b3261e;    --erreur-fond: #fcefed;   --erreur-bord: #efc2bc;
  --attention: #975a06; --info-fond: #eef3f9;     --info-bord: #c7d6e7;
  --rayon: 4px;
  --rayon-carte: 6px;

  /* Anciens noms, encore utilisés par quelques gabarits de modules */
  --encre: var(--texte);
  --trait: var(--bordure);
  --accent: var(--lien);
  --vert: var(--ok);
  --rouge: var(--erreur);
  --gris: var(--texte-2);

  font-family: "Plex", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--texte);
  background: var(--fond);
  -webkit-font-smoothing: antialiased;
}

/* Thème sombre, propre à chaque installation (Administration > Société). La couleur de
   marque (--marque) n'est pas reprise ici : c'est un réglage indépendant du thème. */
:root[data-theme="sombre"] {
  --fond: #16181c;
  --surface: #1e2125;
  --surface-2: #25282d;
  --survol: #2b2f34;
  --bordure: #363b42;
  --bordure-douce: #2b2f34;
  --bordure-forte: #4a515a;
  --texte: #e7e9ec;
  --texte-2: #a7aeb6;
  --texte-3: #787f88;
  --primaire: #3a4049;
  --primaire-survol: #4a515c;
  --lien: #6fa8dc;
  --ok: #4caf7d;        --ok-fond: #17271f;       --ok-bord: #2d5c42;
  --erreur: #e5736a;    --erreur-fond: #2e1b19;   --erreur-bord: #6b3530;
  --attention: #d9a441; --info-fond: #1c2430;     --info-bord: #35475c;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--fond); }
a { color: var(--lien); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
::selection { background: #f6d3d8; }

.icone { width: 18px; height: 18px; stroke-width: 1.75; flex: none; vertical-align: middle; }

/* ---------- Barre de l'application ---------- */
.barre {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: stretch; height: 46px; padding-right: 10px;
  background: var(--barre); color: var(--barre-texte); font-size: 13.5px;
}
.barre a { color: inherit; text-decoration: none; }
.lanceur { display: grid; place-items: center; width: 48px; color: #fff !important; }
.lanceur:hover { background: rgba(255, 255, 255, .08); }
.lanceur .icone { width: 20px; height: 20px; }
.app-courante { display: flex; align-items: center; padding: 0 16px 0 4px; font-size: 15px; font-weight: 600; color: #fff !important; white-space: nowrap; }
.menu-app { display: flex; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.menu-app a { display: flex; align-items: center; padding: 0 12px; white-space: nowrap;
  border-top: 2px solid transparent; border-bottom: 2px solid transparent; }
.menu-app a:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.menu-app a[aria-current="page"] { color: #fff; border-bottom-color: var(--marque); }
.marque { display: flex; align-items: center; gap: 8px; padding: 0 6px; }
.marque img { height: 32px; width: auto; display: block; margin-top: 2px; }
.marque img.logo-perso { height: 26px; background: #fff; border-radius: 4px; padding: 3px 7px; }
.marque span { color: #fff; font-size: 15px; font-weight: 500; letter-spacing: .02em; white-space: nowrap; }
.espace { flex: 1; }
.barre-droite { display: flex; align-items: center; gap: 14px; margin-left: 12px; white-space: nowrap; }
.barre-droite .societe { color: #8f979f; }
.barre-droite .utilisateur { display: flex; align-items: center; gap: 6px; color: #e3e6e9; }
.barre-droite .utilisateur .icone { width: 16px; height: 16px; }
.sortie { display: flex; }
.bouton-icone { display: grid; place-items: center; width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: var(--rayon); background: none; color: var(--barre-texte); cursor: pointer; }
.bouton-icone:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.barre .exercice { border: 1px solid #454b53; border-radius: var(--rayon); padding: 2px 8px;
  color: #e6e9ec; font-size: 12.5px; }
.barre .exercice:hover { border-color: #6b727b; }

/* ---------- Page ---------- */
.page { max-width: 1240px; margin: 0 auto; padding: 22px 24px 56px; }
.page.etroite { max-width: 640px; }
.page.pleine { max-width: none; margin: 0; padding: 0; display: flex; flex-direction: column; height: calc(100vh - 46px); }
.page.pleine .entete { flex: none; margin: 0; padding: 12px 24px; }
.cadre-externe { display: block; flex: 1; width: 100%; border: 0; }
h1 { font-size: 20px; font-weight: 600; line-height: 1.3; margin: 0 0 16px; letter-spacing: -.005em; }
.page > h1, .entete { padding-bottom: 12px; border-bottom: 1px solid var(--bordure); }
.entete { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.entete h1 { margin: 0; padding: 0; border: 0; }
.entete > span { display: flex; align-items: center; gap: 14px; }
h2 { font-size: 15px; font-weight: 600; margin: 24px 0 8px; }
h3 { font-size: 14px; font-weight: 600; }
.aide { color: var(--texte-2); margin: 0 0 14px; }
.page > h1 + .aide { margin-top: -4px; }
.vide { color: var(--texte-2); padding: 20px 0; }
.graphique { display: block; width: 100%; height: auto; margin-bottom: 18px; }

/* ---------- Formulaires ---------- */
form { display: grid; gap: 14px; }
fieldset { display: grid; gap: 12px; margin: 0; padding: 12px 16px 16px;
  background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon-carte); }
legend { padding: 0 6px; font-weight: 600; font-size: 13px; color: var(--texte); }
label { display: grid; gap: 5px; font-size: 13px; font-weight: 500; color: var(--texte-2); }
label.case { display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--texte); }
.deux, .trois { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.apercu-logo { display: inline-block; padding: 6px 10px; background: var(--surface-2); border: 1px solid var(--bordure); border-radius: var(--rayon); margin-bottom: 8px; }
.apercu-logo img { max-height: 40px; max-width: 160px; width: auto; display: block; }
input, select, textarea {
  font: inherit; font-size: 14px; font-weight: 400; color: var(--texte); min-width: 0; max-width: 100%;
  padding: 6px 9px; border: 1px solid var(--bordure-forte); border-radius: var(--rayon); background: var(--surface);
}
input:not([type="checkbox"]):not([type="radio"]), select { height: 34px; }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; margin: 0; accent-color: var(--primaire); }
select { padding-right: 6px; }
input::placeholder, textarea::placeholder { color: var(--texte-3); }
input:disabled, select:disabled, input[readonly] { background: var(--surface-2); color: var(--texte-2); }
input:hover:not(:disabled), select:hover:not(:disabled), textarea:hover { border-color: #a9b0b8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--lien); box-shadow: 0 0 0 3px rgba(28, 82, 130, .16); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--lien); outline-offset: 2px; }
input.invalide { border-color: var(--erreur); }

/* ---------- Boutons ---------- */
button, .bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; justify-self: start;
  height: 34px; padding: 0 14px; font: inherit; font-size: 14px; font-weight: 500; white-space: nowrap;
  border: 1px solid var(--primaire); border-radius: var(--rayon);
  background: var(--primaire); color: #fff; cursor: pointer; text-decoration: none;
}
button:hover, .bouton:hover { background: var(--primaire-survol); border-color: var(--primaire-survol); text-decoration: none; }
button.secondaire, .bouton.secondaire { background: var(--surface); color: var(--texte); border-color: var(--bordure-forte); }
button.secondaire:hover, .bouton.secondaire:hover { background: var(--survol); border-color: #a9b0b8; }
button.danger { margin-left: auto; background: var(--surface); color: var(--erreur); border-color: var(--erreur-bord); }
button.danger:hover { background: var(--erreur-fond); border-color: var(--erreur); }
button.grave { background: var(--erreur); border-color: var(--erreur); color: #fff; }
button.grave:hover { background: #8e1d16; border-color: #8e1d16; }
.lien-bouton, button.lien-bouton { height: auto; padding: 0; border: 0; background: none; color: var(--lien); font-weight: 400; }
.lien-bouton:hover, button.lien-bouton:hover { background: none; text-decoration: underline; }
.lien-bouton.petit { font-size: 12px; margin-left: 4px; }
.pleine-largeur { width: 100%; justify-self: stretch; }
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.barre-actions { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--bordure); }
form.en-ligne { display: inline; }

/* ---------- Messages ---------- */
.message { margin: 0 0 14px; padding: 9px 12px; border: 1px solid; border-left-width: 3px; border-radius: var(--rayon); }
.message.ok { background: var(--ok-fond); border-color: var(--ok-bord); border-left-color: var(--ok); color: #14532f; }
.message.erreur { background: var(--erreur-fond); border-color: var(--erreur-bord); border-left-color: var(--erreur); color: var(--erreur); }
.message.info { background: var(--info-fond); border-color: var(--info-bord); border-left-color: var(--lien); color: var(--texte); }

/* ---------- Tableaux ---------- */
.defile { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--bordure); }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--bordure-douce); }
thead th { padding: 8px 10px; background: var(--surface-2); border-bottom: 1px solid var(--bordure);
  font-size: 12.5px; font-weight: 600; color: var(--texte-2); white-space: nowrap; }
tbody tr:hover td { background: var(--survol); }
tfoot th, tfoot td { background: var(--surface-2); border-top: 1px solid var(--bordure); border-bottom: 0; color: var(--texte); font-weight: 600; }
tr.inactif td { color: var(--texte-3); }
td small { color: var(--texte-2); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.droite { text-align: right; white-space: nowrap; }
.filtres { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.filtres input:not([type="date"]):not([type="number"]):not([type="hidden"]) { min-width: 220px; }
.filtres input[type="number"] { width: 90px; }
.pagination { display: flex; gap: 16px; justify-content: center; margin-top: 14px; }

.alerte { color: var(--erreur); font-size: 12.5px; }
.ok-texte { color: var(--ok); font-weight: 600; }
.ko-texte { color: var(--erreur); font-weight: 600; }
tr.stock-alerte td { color: var(--erreur); font-weight: 600; }
tr.courant td { background: #eef3f9; }
tr.brouillon td { color: var(--texte-2); font-style: italic; }
tr.lettree td, tr.pointee td { color: var(--texte-2); }
tr.pointee td { background: #f1f6f2; }

/* Plan comptable : la hiérarchie se lit par l'indentation et la graisse */
table.plan tr.classe td { background: #eceef1; font-weight: 600; padding-top: 10px; }
table.plan tr.niv2 td:nth-child(2) { font-weight: 600; }
table.plan tr.niv3 td:nth-child(2) { padding-left: 26px; }
table.plan tr.niv4 td:nth-child(2) { padding-left: 42px; }
table.plan tr.niv5 td:nth-child(2) { padding-left: 58px; }
table.plan tr.niv4 .num, table.plan tr.niv5 .num { color: var(--texte-2); }

/* ---------- Saisie d'écriture ---------- */
.entete-saisie { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.entete-saisie .large { grid-column: 1 / -1; }
table.lignes td { vertical-align: top; padding: 5px 6px; }
table.lignes tbody tr:hover td { background: none; }
table.lignes input { width: 100%; }
table.lignes .c-compte { min-width: 6.5rem; }
table.lignes .c-tiers { min-width: 5.5rem; }
table.lignes .c-libelle { min-width: 14rem; }
table.lignes .c-montant { min-width: 8rem; text-align: right; font-variant-numeric: tabular-nums; }
table.lignes small { display: block; color: var(--texte-2); font-size: 12px; margin-top: 3px; max-width: 16rem; font-weight: 400; }
table.lignes tfoot th, table.lignes tfoot td { border-bottom: 0; }
#ecart.ok { color: var(--ok); }
#ecart.ko { color: var(--erreur); font-weight: 600; }
.c-suppr { font-size: 18px; line-height: 1; text-decoration: none; color: var(--texte-3); }
.c-suppr:hover { color: var(--erreur); text-decoration: none; }
.en-ligne-label { display: flex; align-items: center; gap: 6px; }
.contrepasse { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Fiche descriptive (écriture, article, contact…) */
dl.fiche { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 20px; margin: 0 0 18px;
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon-carte); }
dl.fiche dt { color: var(--texte-2); font-size: 12.5px; }
dl.fiche dd { margin: 2px 0 0; font-weight: 500; }

/* ---------- États ---------- */
.entete-etat { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
table.etat { font-size: 13.5px; }
table.etat td, table.etat th { padding: 6px 9px; }
table.etat tr.report td { color: var(--texte-2); font-style: italic; }
table.etat tfoot th { border-top: 2px solid var(--texte); }
table.balance tr.sous-total td, table.balance tr.classe td { background: #eceef1; font-weight: 600; }
th.groupe-col { text-align: center; border-bottom: 1px solid var(--bordure); }
.bloc-compte { margin-bottom: 26px; }
.bloc-compte h2 { margin-top: 10px; }
.total-general { font-weight: 600; }
table.etat-fin { max-width: 900px; }
table.etat-fin tr.final td { border-top: 2px solid var(--texte); font-size: 14.5px; }
.comptes-rub { color: var(--texte-2); font-size: 12px; }
table.tva { max-width: 560px; }

.synthese { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px; margin-bottom: 18px;
  background: var(--bordure); border: 1px solid var(--bordure); border-radius: var(--rayon-carte); overflow: hidden; }
.synthese > div { display: grid; gap: 3px; padding: 11px 14px; background: var(--surface); }
.synthese span { color: var(--texte-2); font-size: 12.5px; }
.synthese strong { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.nouveau-releve { padding: 14px; background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon-carte); }

ul.verifs { list-style: none; padding: 0; display: grid; gap: 6px; }
ul.verifs li { display: flex; gap: 10px; align-items: baseline; }
.pastille { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: 11px; color: #fff; flex: none; }
.verifs .ok .pastille { background: var(--ok); }
.verifs .bloquant .pastille { background: var(--erreur); }
.verifs .avertissement .pastille { background: var(--attention); }
.verifs .bloquant { color: var(--erreur); }
details { margin: 10px 0 18px; }
summary { cursor: pointer; color: var(--lien); }
.confirmation-cloture { max-width: 480px; margin: 18px 0; padding: 16px; background: var(--surface);
  border: 1px solid var(--erreur-bord); border-left: 3px solid var(--erreur); border-radius: var(--rayon-carte); }

/* ---------- Lanceur d'applications (accueil) ---------- */
.lanceur-page { max-width: 880px; padding-top: 56px; }
.salutation { margin: 0 0 32px; text-align: center; color: var(--texte-2); }
.grille-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 20px 8px; justify-items: center; }
.tuile-app { display: flex; flex-direction: column; align-items: center; gap: 9px; width: 116px; padding: 12px 6px 10px;
  border-radius: 8px; color: var(--texte); text-decoration: none; }
.tuile-app:hover { background: rgba(31, 34, 38, .05); text-decoration: none; }
.tuile-app:focus-visible { outline-offset: 0; }
.tuile-icone { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 14px;
  background: var(--teinte, #4b5563); color: #fff; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12); }
.tuile-icone .icone { width: 30px; height: 30px; stroke-width: 1.6; }
.tuile-icone.petite { width: 42px; height: 42px; border-radius: 10px; }
.tuile-icone.petite .icone { width: 21px; height: 21px; stroke-width: 1.75; }
.tuile-nom { font-size: 13.5px; font-weight: 500; text-align: center; line-height: 1.25; }

.titre-section { margin: 0 0 16px; text-align: center; font-size: 13px; font-weight: 600; color: var(--texte-2); }
.grille-apps + .titre-section { margin-top: 44px; padding-top: 28px; border-top: 1px solid var(--bordure); }
.aide.centre { text-align: center; margin-top: -8px; margin-bottom: 20px; }
/* Module non activé : exactement la même tuile, seul le bouton « Activer » la distingue */
form.tuile-app.disponible { display: flex; gap: 6px; }
.tuile-app.disponible:hover { background: none; }
.tuile-note { font-size: 11.5px; color: var(--texte-3); text-align: center; line-height: 1.2; }
button.petit { height: 28px; padding: 0 12px; font-size: 13px; justify-self: center; }
.tuile-app.disponible button { margin-top: auto; }

/* ---------- Gestion des modules ---------- */
.grille-modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.carte-module { display: flex; flex-direction: column; gap: 12px; padding: 16px;
  background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon-carte); }
.carte-module-tete { display: flex; gap: 12px; align-items: flex-start; }
.carte-module h2 { margin: 1px 0 2px; font-size: 15px; }
.carte-module-tete p { margin: 0; color: var(--texte-2); font-size: 13px; }
.carte-module-infos { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; font-size: 13px; }
.carte-module-infos dt { color: var(--texte-3); }
.carte-module-infos dd { margin: 0; }
.carte-module-pied { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--bordure-douce); }
.carte-module-pied button { margin-left: auto; }
.statut-module { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 500; }
.statut-module.actif { background: var(--ok-fond); color: var(--ok); }
.statut-module.inactif { background: #eceef1; color: var(--texte-2); }
.version { font-size: 12px; color: var(--texte-3); }

/* ---------- Connexion / installation ---------- */
.ecran-accueil { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; }
.ecran-accueil > .message { width: 100%; max-width: 400px; }
.panneau-accueil { width: 100%; max-width: 400px; padding: 28px 28px 26px;
  background: var(--surface); border: 1px solid var(--bordure); border-radius: 8px; }
.panneau-accueil.large { max-width: 580px; }
.panneau-accueil .logo { display: block; width: 150px; margin: 0 auto 22px; }
.panneau-accueil h1 { font-size: 18px; margin: 0 0 4px; }
.panneau-accueil form { margin-top: 18px; }
.panneau-accueil fieldset { background: var(--surface-2); }
.pied-accueil { margin: 18px 0 0; color: var(--texte-3); font-size: 12px; }

/* ---------- Pages d'erreur ---------- */
.page-erreur { max-width: 520px; margin: 64px auto 0; }
.page-erreur h1 { border: 0; padding: 0; margin-bottom: 8px; }
.page-erreur .aide { margin-bottom: 20px; }
.code-erreur { margin: 0 0 6px; color: var(--marque); font-size: 13px; font-weight: 600; }

/* ---------- Module Restaurant : salle ---------- */
.grille-tables { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.carte-table { padding: 12px 14px; background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon-carte); }
.carte-table h3 { margin: 0 0 2px; font-size: 15px; }
.carte-table p { margin: 0; color: var(--texte-2); font-size: 13px; }
.carte-table.libre { border-left: 3px solid var(--ok); }
.carte-table.occupee { border-left: 3px solid var(--marque); }
.carte-table form { display: grid; gap: 6px; margin-top: 10px; }

/* ---------- Module Hôtel ---------- */
.jour-hotel { margin-bottom: 8px; }
.jour-hotel h2 { margin-top: 0; }
.ligne-jour { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin: 0; padding: 7px 0; border-bottom: 1px solid var(--bordure-douce); }
.ligne-jour .aide { margin: 0; font-size: 13px; }
.entete-planning { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 22px 0 10px; }
.entete-planning h2 { margin: 0; }
table.planning { table-layout: fixed; min-width: 980px; }
table.planning th, table.planning td { padding: 0; border: 1px solid var(--bordure-douce); }
table.planning thead th { padding: 6px 2px; text-align: center; font-size: 12px; line-height: 1.3; }
table.planning thead th.weekend { background: #eff1f3; }
table.planning .aujourdhui { box-shadow: inset 0 2px 0 var(--marque); }
table.planning thead th.aujourdhui { color: var(--texte); }
table.planning .p-chambre { width: 120px; padding: 6px 10px; text-align: left; background: var(--surface-2); font-weight: 600; }
table.planning .p-chambre small { display: block; font-weight: 400; font-size: 12px; color: var(--texte-2); }
table.planning tbody tr:hover td { background: none; }
table.planning td.p-libre { height: 44px; text-align: center; }
table.planning td.p-libre a { display: grid; place-items: center; height: 100%; min-height: 42px; color: transparent; text-decoration: none; font-size: 16px; }
table.planning td.p-libre a:hover { color: var(--texte-2); background: var(--survol); }
table.planning td.p-sejour { padding: 4px 3px; }
.bloc-sejour { display: block; padding: 6px 8px; border-radius: 3px; border-left: 3px solid; font-size: 12.5px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--texte); text-decoration: none; }
.bloc-sejour:hover { text-decoration: none; filter: brightness(.97); }
.bloc-sejour.reserve { background: var(--info-fond); border-color: var(--lien); }
.bloc-sejour.en_cours { background: #fbe9ec; border-color: var(--marque); }
.bloc-sejour.termine { background: #eceef1; border-color: #a9b0b8; color: var(--texte-2); }
.bloc-sejour.coupe { border-left-style: dashed; }
.legende-planning { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.legende-planning .bloc-sejour { display: inline-block; font-weight: 400; }
.statut-sejour { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.statut-sejour.reserve { background: var(--info-fond); color: var(--lien); }
.statut-sejour.en_cours { background: #fbe9ec; color: #9b0d24; }
.statut-sejour.termine { background: var(--ok-fond); color: var(--ok); }
.statut-sejour.annule { background: #eceef1; color: var(--texte-2); }
dl.fiche > div { min-width: 0; }

/* ---------- Module CRM ---------- */
.compte { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: #e4e7eb;
  color: var(--texte-2); font-size: 12px; font-weight: 500; text-align: center; vertical-align: 1px; }
.pipeline { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 10px;
  overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; align-items: start; }
.colonne-etape { display: grid; align-content: start; gap: 6px; padding: 0 6px 8px; min-height: 160px;
  background: #e9ebee; border: 1px solid var(--bordure); border-radius: var(--rayon-carte); }
.colonne-etape > header { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 6px;
  padding: 9px 4px 7px; border-bottom: 1px solid var(--bordure); margin-bottom: 2px; }
.colonne-etape h2 { margin: 0; font-size: 13.5px; }
.colonne-etape header .num { grid-column: 1; color: var(--texte-2); font-size: 12.5px; }
.ajout-etape { grid-column: 2; grid-row: 1 / 3; display: grid; place-items: center; width: 28px; height: 28px;
  border-radius: var(--rayon); color: var(--texte-2); }
.ajout-etape:hover { background: var(--surface); color: var(--texte); }
.colonne-vide { margin: 4px; color: var(--texte-3); font-size: 12.5px; }
.colonne-etape h2 { display: flex; align-items: baseline; gap: 6px; }
.titre-etape { color: inherit; text-decoration: none; border-bottom: 1px dashed transparent; }
.titre-etape:hover { border-bottom-color: var(--texte-2); text-decoration: none; }
.colonne-ajout { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 130px; border: 1px dashed var(--bordure-forte); border-radius: var(--rayon-carte);
  color: var(--texte-2); text-decoration: none; font-size: 13px; font-weight: 500; }
.colonne-ajout:hover { background: var(--survol); color: var(--texte); border-color: #a9b0b8; text-decoration: none; }
.colonne-ajout .icone { width: 22px; height: 22px; }
.titre-section-crm { display: flex; align-items: baseline; gap: 6px; margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--bordure); }
.chips-types { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-type { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--bordure); border-radius: 16px;
  color: var(--texte); text-decoration: none; font-size: 13px; font-weight: 500; }
.chip-type:hover { background: var(--survol); border-color: var(--bordure-forte); text-decoration: none; }
.chip-type .icone { width: 15px; height: 15px; color: var(--texte-2); }
.chip-type.chip-ajout { color: var(--texte-2); border-style: dashed; }
.carte-opp { display: grid; gap: 2px; padding: 8px 10px; background: var(--surface);
  border: 1px solid var(--bordure); border-radius: var(--rayon); }
.carte-opp:hover { border-color: var(--bordure-forte); }
.carte-opp-titre { font-weight: 500; color: var(--texte); overflow-wrap: anywhere; }
.carte-opp-contact { color: var(--texte-2); font-size: 13px; }
.carte-opp-pied { display: flex; justify-content: space-between; align-items: center; gap: 6px; min-height: 26px; }
.carte-opp-pied small { color: var(--texte-3); }
.carte-opp-infos { display: flex; flex-wrap: wrap; gap: 2px 12px; padding-top: 5px; margin-top: 2px;
  border-top: 1px solid var(--bordure-douce); color: var(--texte-2); font-size: 12px; }
.carte-opp-infos span { display: inline-flex; align-items: center; gap: 4px; }
.carte-opp-infos .icone { width: 14px; height: 14px; }
button.avancer { width: 26px; height: 26px; padding: 0; background: var(--surface); color: var(--texte-2); border-color: var(--bordure); }
button.avancer:hover { background: var(--survol); color: var(--texte); border-color: var(--bordure-forte); }
button.avancer .icone { width: 16px; height: 16px; }

/* Étapes sur la fiche : l'étape courante en anthracite, les autres cliquables */
.etapes-opp { display: flex; flex-wrap: wrap; margin: -4px 0 16px; }
.etapes-opp > span, .etapes-opp button { height: 30px; padding: 0 14px; display: inline-flex; align-items: center;
  font-size: 13px; font-weight: 500; border: 1px solid var(--bordure-forte); border-radius: 0; margin-left: -1px;
  background: var(--surface); color: var(--texte-2); }
.etapes-opp > :first-child, .etapes-opp > :first-child button { border-radius: var(--rayon) 0 0 var(--rayon); margin-left: 0; }
.etapes-opp > :last-child, .etapes-opp > :last-child button { border-radius: 0 var(--rayon) var(--rayon) 0; }
.etapes-opp button:hover { background: var(--survol); color: var(--texte); border-color: var(--bordure-forte); }
.etapes-opp > span[aria-current] { position: relative; z-index: 1; background: var(--primaire); border-color: var(--primaire); color: #fff; }
.statut-opp { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.statut-opp.ouverte { background: var(--info-fond); color: var(--lien); }
.statut-opp.gagnee { background: var(--ok-fond); color: var(--ok); }
.statut-opp.perdue { background: #eceef1; color: var(--texte-2); }
.description-opp { margin: -6px 0 18px; padding: 10px 14px; white-space: pre-line; background: var(--surface);
  border: 1px solid var(--bordure); border-radius: var(--rayon-carte); }

/* ---------- Facturation ---------- */
.statut-facture, .statut-devis { display: inline-block; padding: 1px 8px; border-radius: 10px;
  font-size: 12px; font-weight: 500; white-space: nowrap; }
.statut-facture.brouillon, .statut-devis.brouillon { background: #eceef1; color: var(--texte-2); }
.statut-facture.impayee, .statut-devis.envoye { background: var(--info-fond); color: var(--lien); }
.statut-facture.partielle { background: #fdf2e2; color: var(--attention); }
.statut-facture.en_retard { background: var(--erreur-fond); color: var(--erreur); }
.statut-facture.reglee, .statut-devis.accepte { background: var(--ok-fond); color: var(--ok); }
.statut-facture.annulee, .statut-devis.refuse { background: #eceef1; color: var(--texte-2); }
.ligne-doc input, .ligne-doc select { width: 100%; }
.fiche-impression { line-height: 1.7; }
.fiche-impression .droite { text-align: right; }
form.sans-marge { margin: 0; }
.colonnes-opp { align-items: start; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.colonnes-opp h3 { margin: 20px 0 8px; }
.ligne-activite { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--bordure-douce); }
.ligne-activite strong { display: block; font-weight: 500; }
.ligne-activite .aide { display: block; margin: 0 0 6px; font-size: 12.5px; }
.ligne-activite form input { flex: 1; min-width: 0 !important; }
.type-activite { display: inline-flex; align-items: center; gap: 6px; color: var(--texte-2); }
.ligne-activite > .type-activite { display: grid; place-items: center; width: 30px; height: 30px;
  border: 1px solid var(--bordure); border-radius: 50%; background: var(--surface); }
.ligne-activite > .type-activite .icone { width: 15px; height: 15px; }
ol.historique { list-style: none; margin: 14px 0 0; padding: 0; }
ol.historique li { padding: 8px 0 8px 12px; border-left: 2px solid var(--bordure); }
ol.historique li.note { border-left-color: var(--lien); }
ol.historique li .aide { margin: 0; font-size: 12px; }
ol.historique li p { margin: 2px 0 0; white-space: pre-line; overflow-wrap: anywhere; }
ol.historique li.suivi p { color: var(--texte-2); }
h2 .compte { margin-left: 4px; }

/* ---------- Fenêtre modale (formulaires courts, sans changer de page) ---------- */
dialog.modal { position: relative; padding: 0; width: min(560px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--bordure-forte); border-radius: var(--rayon-carte); }
dialog.modal::backdrop { background: rgba(27, 30, 34, .5); }
dialog.modal .modal-corps { padding: 24px 24px 22px; max-height: min(82vh, 680px); overflow-y: auto; }
dialog.modal .modal-corps h1 { padding-right: 28px; }
dialog.modal .modal-corps > .message:first-child { margin-top: -4px; }
.modal-fermer { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; padding: 0;
  border: 0; border-radius: var(--rayon); background: none; color: var(--texte-2); cursor: pointer; }
.modal-fermer:hover { background: var(--survol); color: var(--texte); }
.modal-fermer .icone { width: 16px; height: 16px; }

/* ---------- Petits écrans ---------- */
@media (max-width: 760px) {
  .barre-droite .societe, .barre-droite .utilisateur { display: none; }
  .app-courante { padding-right: 8px; }
  .page { padding: 16px 16px 40px; }
  .lanceur-page { padding-top: 28px; }
  .grille-modules { grid-template-columns: 1fr; }
}

/* ---------- Impression ---------- */
@media print {
  .barre, .non-imprime, .filtres, .message.info { display: none !important; }
  body, :root { background: #fff; font-size: 11px; }
  .page { max-width: none; margin: 0; padding: 0; }
  .defile { overflow: visible; }
  table { border: 0; }
  thead th { background: none; }
  table.etat { font-size: 10px; }
  a { color: inherit; text-decoration: none; }
  .bloc-compte { break-inside: avoid-page; }
  thead { display: table-header-group; }
}
