/* Le portail Visual Engine : les couleurs du plugin et de l'application (10/10/2026, theme-portail-20261010) — bleu nuit dégradé avec
   le halo du haut, cartes liserées, accent cyan ; palette relevée dans src/ui/ui_view.cpp et app/VisualEngine.App/App.xaml (dépôt
   visual-engine). */
:root {
  color-scheme: dark;
  --fond-haut: #061421; --fond-bas: #030b12; --halo: rgba(18, 60, 88, .33);
  --panneau-haut: rgba(6, 23, 37, .96); --panneau-bas: rgba(3, 16, 26, .976); --bord-panneau: #16516b;
  --carte-haut: #092235; --carte-bas: #061724; --bord: #174b66;
  --actif-debut: #0c6ca1; --actif-fin: #083050;
  --fond-bouton: #0a3044; --bord-bouton: #1e5e79; --texte-bouton: #c5efff; --fond-champ: #04121e;
  --texte: #eef8ff; --doux: #8fb0c2; --nav: #d7e8f2; --accent: #1ed9ff; --accent-fonce: #16d6ff;
  --vert: #3fd08a; --orange: #e6a23c; --rouge: #e5604d;
  --lueur: 0 0 16px rgba(30, 217, 255, .35);
}
* { box-sizing: border-box; }
html { background: var(--fond-bas); scrollbar-color: #245a75 transparent; }
body {
  margin: 0; min-height: 100vh; color: var(--texte); font: 15px/1.5 "Segoe UI", system-ui, -apple-system, sans-serif;
  background: radial-gradient(75% 80% at 75% -15%, var(--halo), transparent 100%), linear-gradient(var(--fond-haut), var(--fond-bas));
  background-attachment: fixed;
  display: flex; flex-direction: column;   /* 15/10/2026 (page-licences-20261015) : le pied en bas de la fenêtre, pas au milieu */
}
::selection { background: rgba(30, 217, 255, .3); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, .bouton:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* L'en-tête : comme la colonne de gauche du plugin — panneau sombre liseré, logo « Visual Engine par Mayana DEV ». */
header { background: linear-gradient(var(--panneau-haut), var(--panneau-bas)); border-bottom: 1px solid var(--bord-panneau); }
header .barre { max-width: 1100px; margin: 0 auto; padding: 12px 16px; display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
header .marque { margin-right: auto; display: flex; flex-direction: column; color: var(--texte); line-height: 1; }
header .marque:hover { text-decoration: none; }
header .titre { font: 900 24px/1 "Segoe UI Black", "Segoe UI", system-ui, sans-serif; white-space: nowrap; letter-spacing: -.2px; }
header .titre .engine { color: var(--accent); }
header .titre .gestion { font: 600 13px "Segoe UI", system-ui, sans-serif; color: var(--doux); letter-spacing: 0; margin-left: 8px; }
header .signature { display: flex; align-items: center; gap: 6px; margin-top: 5px; font-size: 11px; color: #a2bed0; }
header .signature img { height: 22px; width: auto; display: block; }
header nav { display: flex; gap: 6px; flex-wrap: wrap; }
header nav a { color: var(--nav); padding: 7px 13px; border: 1px solid transparent; border-radius: 6px; }
header nav a:hover { text-decoration: none; background: rgba(10, 48, 68, .6); border-color: var(--bord-bouton); }
header nav a.actif {
  color: #fff; background: linear-gradient(90deg, var(--actif-debut), var(--actif-fin)); border-color: var(--accent-fonce); box-shadow: var(--lueur);
}
header nav a.actif::after { content: "›"; color: var(--accent); margin-left: 8px; }
/* 15/10/2026 (page-licences-20261015) : la langue et la déconnexion, petites, à droite de la navigation. */
header .outils { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }   /* sous ~315 px : l'un sous l'autre */
header .outils:empty { display: none; }
header .outils .langue {
  color: var(--texte-bouton); font-size: 13px; padding: 5px 10px; border: 1px solid var(--bord-bouton); border-radius: 6px; background: var(--fond-bouton);
}
header .outils .langue:hover { text-decoration: none; border-color: var(--accent); }
header .outils button { margin: 0; }
/* La gestion a neuf onglets : toujours en deux lignes — le logo et la déconnexion, puis les onglets. */
header .barre.gestion { display: grid; grid-template-columns: 1fr auto; gap: 12px 16px; }
header .barre.gestion nav { grid-column: 1 / -1; grid-row: 2; }
header .barre.gestion .outils { grid-column: 2; grid-row: 1; }

main { flex: 1 0 auto; width: 100%; max-width: 1100px; margin: 0 auto; padding: 28px 16px 60px; }
main.etroit { max-width: 460px; }
main.moyen { max-width: 860px; }
/* 16/10/2026 (page-lots-20261016) : la gestion a des tableaux larges (lots, achats, journal) : jusqu'à 1 400 px, en-tête compris. */
main.large { max-width: 1400px; }
header .barre.gestion { max-width: 1400px; }
h1 { font-size: 24px; font-weight: 700; margin: 0 0 18px; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 10px; }
.carte {
  background: linear-gradient(var(--carte-haut), var(--carte-bas)); border: 1px solid var(--bord); border-radius: 8px; padding: 18px;
  margin-bottom: 16px;
}
.doux { color: var(--doux); font-size: 13.5px; }
label { display: block; color: var(--doux); font-size: 13.5px; margin: 10px 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], textarea, select {
  width: 100%; background: var(--fond-champ); color: var(--texte); border: 1px solid var(--bord); border-radius: 6px; padding: 9px 10px; font: inherit;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
select option { background: #061a28; color: var(--texte); }
textarea { min-height: 80px; }

/* Les boutons : le principal comme l'onglet actif du plugin (dégradé bleu, bord cyan, lueur) ; les autres comme ses boutons d'action. */
button, .bouton {
  display: inline-block; background: linear-gradient(90deg, var(--actif-debut), var(--actif-fin)); color: #fff;
  border: 1px solid var(--accent-fonce); border-radius: 6px; padding: 8px 16px; font: inherit; font-weight: 600; cursor: pointer;
  margin: 12px 8px 0 0; box-shadow: var(--lueur);
}
button:hover, .bouton:hover { border-color: var(--accent); opacity: .92; text-decoration: none; }
button.secondaire, .bouton.secondaire {
  background: var(--fond-bouton); border-color: var(--bord-bouton); color: var(--texte-bouton); font-weight: 400; box-shadow: none;
}
button.danger { background: #7a1f1a; border-color: var(--rouge); box-shadow: none; }
button.petit, .bouton.petit { padding: 5px 10px; font-size: 13px; margin-top: 0; }
/* 15/10/2026 (lots-revocation-fond-20261015) : un bouton désactivé (révocation d'un lot en cours) se voit comme tel. */
button:disabled, button:disabled:hover { opacity: .5; cursor: not-allowed; }
.nowrap { white-space: nowrap; }
td.actions { white-space: nowrap; text-align: right; }
/* 12/10/2026 : les captures jointes à un journal, en vignettes (un clic l'ouvre en grand). */
.vignettes { display: flex; gap: 8px; flex-wrap: wrap; }
.vignettes img { display: block; height: 96px; border-radius: 4px; border: 1px solid var(--bord); }
form.ligne { display: inline; }

/* Les messages : bleu nuit liseré cyan, ou rouge sombre liseré rouge (comme la barre des messages de l'application). */
.message { border-radius: 6px; padding: 10px 14px; margin-bottom: 16px; background: #0b2a3d; border: 1px solid var(--bord); border-left: 3px solid var(--accent); }
.message.erreur { background: #4a1e22; border-color: #6b2a2a; border-left-color: var(--rouge); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--bord); vertical-align: top; }
th { color: var(--doux); font-weight: 600; font-size: 13px; }
.etat { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12.5px; font-weight: 600; border: 1px solid; }
.etat.vert { background: rgba(63, 208, 138, .12); color: var(--vert); border-color: rgba(63, 208, 138, .35); }
.etat.orange { background: rgba(230, 162, 60, .12); color: var(--orange); border-color: rgba(230, 162, 60, .35); }
.etat.rouge { background: rgba(229, 96, 77, .12); color: var(--rouge); border-color: rgba(229, 96, 77, .35); }
.chiffres { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.chiffres .carte { flex: 1 1 180px; margin: 0; }
.chiffres .valeur { font-size: 28px; font-weight: 700; }
code, .cle { font-family: Consolas, "Cascadia Mono", monospace; overflow-wrap: anywhere; }   /* 10/10 : une empreinte ou une clé longue revient à la ligne dans sa carte */
.grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 16px; }   /* 16/10 : pas de débordement sous 330 px */

/* La barre de défilement fine et sombre (la grise du navigateur sortait du thème). */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #245a75; border-radius: 5px; border: 2px solid var(--fond-bas); }

@media (max-width: 640px) {
  /* Les tableaux de la gestion perdent leurs colonnes de détail ; ceux qui se lisent en fiches (.pile) ou défilent (.complet), non. */
  table:not(.pile):not(.complet) :is(th, td):nth-child(n+4) { display: none; }
  /* 15/10/2026 (page-licences-20261015) : l'en-tête en deux lignes — le logo et les outils, puis la navigation. */
  header .barre { display: grid; grid-template-columns: 1fr auto; gap: 10px 12px; padding: 10px 16px; }
  header .marque { grid-column: 1; grid-row: 1; }
  header .outils { grid-column: 2; grid-row: 1; }
  header nav { grid-column: 1 / -1; grid-row: 2; gap: 4px; }
  header nav a { padding: 6px 10px; font-size: 14px; }
  header nav a.actif::after { content: none; }
  header .titre { font-size: 21px; }
  header .outils .langue, header .outils button.petit { font-size: 12.5px; padding: 5px 8px; }
  header .marque { min-width: 0; }
  main { padding-top: 20px; }
}

/* 13/10/2026 (vente-finitions-20261013) : les conditions de vente, les cases de l'achat, le pied des pages publiques. */
.conditions { max-width: 860px; }
.conditions h2 { margin-top: 24px; }
.conditions p, .conditions li { line-height: 1.55; }
.encadre {
  border: 1px solid var(--bord); border-left: 3px solid var(--accent); border-radius: 6px; padding: 10px 16px; margin: 12px 0;
  background: var(--fond-champ); font-size: 13.5px;
}
label.case { display: flex; gap: 10px; align-items: flex-start; color: var(--texte); font-size: 14px; line-height: 1.45; margin: 12px 0; }
label.case input { flex: none; width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--accent); }
/* 16/10/2026 (revue) : sur un écran très étroit (Galaxy Z Fold fermé, 280 px), « gestion » laisse sa place à la déconnexion. */
@media (max-width: 360px) { header .titre .gestion { display: none; } }

/* 15/10/2026 (page-licences-20261015) : le pied a la largeur du contenu (étroit, moyen), aligné sur lui, au bas de la fenêtre. */
footer.pied {
  width: 100%; max-width: 1100px; margin: 0 auto; padding: 16px 16px 28px; display: flex; gap: 8px 18px; flex-wrap: wrap; font-size: 13.5px;
  border-top: 1px solid rgba(23, 75, 102, .45);
}
footer.pied.etroit { max-width: 460px; }
footer.pied.moyen { max-width: 860px; }
footer.pied a { color: var(--doux); }

/* 15/10/2026 (page-licences-20261015) : « Mes licences » — une carte par clé, deux repères (activations, PC actif), l'historique. */
.sous-titre { margin: -10px 0 18px; }
.licence-tete { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.licence-tete h2 { margin: 0; }
.faits { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 12px; }
.fait { background: var(--fond-champ); border: 1px solid var(--bord); border-radius: 6px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fait-valeur { font-size: 20px; line-height: 1.25; overflow-wrap: anywhere; }
.licence h3 { font-size: 15px; font-weight: 600; color: var(--nav); margin: 22px 0 6px; }
.licence form.demande { margin-top: 14px; }
.licence .message { margin: 14px 0 0; }
.jauge, .progres { height: 8px; background: var(--fond-champ); border: 1px solid var(--bord); border-radius: 5px; overflow: hidden; }
.fait .jauge { background: #020b13; }
.jauge span, .progres span { display: block; height: 100%; background: linear-gradient(90deg, var(--actif-debut), var(--accent)); }
.jauge.plein span { background: var(--orange); }
.liens-compte { display: flex; gap: 8px 22px; flex-wrap: wrap; font-size: 14px; }
form.ajout-cle { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
form.ajout-cle input { flex: 1 1 260px; }
form.ajout-cle button { margin: 0; }
table.pile td { vertical-align: middle; }
@media (max-width: 640px) {
  /* Au téléphone, un PC par fiche : son nom, puis chaque valeur avec son libellé (rien de caché). */
  table.pile thead { display: none; }
  table.pile, table.pile tbody, table.pile tr, table.pile td { display: block; width: 100%; }
  table.pile tr { background: var(--fond-champ); border: 1px solid var(--bord); border-radius: 6px; padding: 8px 12px; margin-bottom: 8px; }
  table.pile td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; text-align: right; }
  table.pile td::before { content: attr(data-label); color: var(--doux); font-size: 13px; text-align: left; flex: none; }
  table.pile td:first-child::before { content: none; }
  table.pile td:first-child { justify-content: flex-start; text-align: left; font-size: 15px; }
}

/* 15/10/2026 (compteur-ventes-20261015) : « On a vendu N clés », le palier atteint et le chemin vers le prochain (gestion). */
.ventes {
  display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; border-color: #1e6f8f;
  background: linear-gradient(100deg, rgba(12, 108, 161, .30), rgba(6, 23, 36, 0) 70%), linear-gradient(var(--carte-haut), var(--carte-bas));
}
.ventes-phrase { font-size: 26px; font-weight: 700; line-height: 1.2; margin: 4px 0 6px; }
.ventes-phrase strong { color: var(--accent); font-size: 38px; text-shadow: var(--lueur); }
.ventes-palier { flex: 0 1 320px; min-width: 220px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.ventes-palier .progres { width: 100%; }
/* Le tableau des achats garde toutes ses colonnes au téléphone : il défile. */
.defile { overflow-x: auto; }
.defile table.complet { min-width: 820px; }
/* 16/10/2026 (page-lots-20261016) : le nom d'un lot ne se coupe plus à chaque tiret (« xplane- / store- / 08/26 »). */
table.lots td.nom-lot { min-width: 12rem; }
table.lots td { vertical-align: middle; }
table.lots td .doux { font-size: 12.5px; }
