:root {
  --fond: #f3f4f7; --blanc: #fff; --trait: #dde1e8; --texte: #1d2433; --doux: #6b7385;
  --accent: #1f5fd1; --accent-clair: #e6efff; --survol: #eef2f8; --selection: #d6e4ff;
  --marine: #0b1433; --or: #f2c14e; --danger: #c62f2f;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--texte); background: var(--fond); }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: var(--blanc); border: 1px solid var(--trait); border-radius: 7px; padding: 6px 10px; cursor: pointer; white-space: nowrap; }
button:hover:not(:disabled) { background: var(--survol); border-color: #c6ccd8; }
button:disabled { opacity: .4; cursor: default; }
button.principal { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.principal:hover { background: #174bb0; }
button.danger { color: var(--danger); }
button.danger.principal { background: var(--danger); border-color: var(--danger); color: #fff; }
button.discret { border-color: transparent; background: transparent; color: #cfd6e6; }
button.icone { width: 34px; padding: 6px 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
[hidden] { display: none !important; }

/* connexion */
.ecran { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--marine); }
.carte-connexion { background: var(--blanc); width: min(380px, 100%); border-radius: 14px; padding: 26px; display: grid; gap: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.carte-connexion h1 { margin: 0 0 4px; font-size: 20px; }
.carte-connexion label { display: grid; gap: 4px; color: var(--doux); font-size: 13px; }
.carte-connexion input { padding: 10px; border: 1px solid var(--trait); border-radius: 8px; color: var(--texte); }
.carte-connexion button { padding: 11px; }
.carte-connexion .aide { margin: 0; color: var(--doux); }
.msg { margin: 0; color: var(--danger); min-height: 1.2em; }
.marque { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: .04em; }
.logo { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--marine); color: var(--or); font-size: 15px; }
.carte-connexion .marque { color: var(--marine); }

/* application */
#appli { height: 100vh; display: grid; grid-template-rows: auto auto auto 1fr auto; }
.entete { display: flex; align-items: center; gap: 12px; padding: 8px 14px; background: var(--marine); color: #fff; }
.entete .logo { background: var(--or); color: var(--marine); }
.entete .leger { font-weight: 400; opacity: .75; letter-spacing: 0; }
#recherche { margin-left: auto; width: min(320px, 40vw); padding: 7px 10px; border-radius: 8px; border: 1px solid #2a3766; background: #18234d; color: #fff; }
#recherche::placeholder { color: #9aa6c7; }
#utilisateur { color: #cfd6e6; font-size: 13px; }
.outils { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 12px; background: var(--blanc); border-bottom: 1px solid var(--trait); }
.sep { width: 1px; height: 24px; background: var(--trait); margin: 0 4px; }
.adresse { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px 12px; background: var(--blanc); border-bottom: 1px solid var(--trait); min-height: 38px; }
.adresse a { padding: 3px 7px; border-radius: 6px; color: var(--texte); text-decoration: none; }
.adresse a:hover, .adresse a.cible { background: var(--survol); }
.adresse .chevron { color: var(--doux); }
.corps { display: grid; grid-template-columns: 280px 1fr; min-height: 0; }
#volet { background: var(--blanc); border-right: 1px solid var(--trait); overflow: auto; display: flex; flex-direction: column; }
#contenu { overflow: auto; background: var(--blanc); }
.etat { padding: 4px 14px; font-size: 12px; color: var(--doux); background: var(--blanc); border-top: 1px solid var(--trait); }

/* arborescence */
.arbre, .arbre ul { list-style: none; margin: 0; padding: 0; }
.arbre { padding: 6px 0; flex: 1; }
.arbre ul { padding-left: 16px; }
.noeud { display: flex; align-items: center; gap: 2px; padding: 3px 8px 3px 4px; cursor: pointer; border-radius: 6px; margin: 0 4px; user-select: none; }
.noeud:hover { background: var(--survol); }
.noeud.actif { background: var(--selection); }
.noeud.cible { background: var(--accent-clair); outline: 2px dashed var(--accent); }
.fleche { width: 18px; height: 18px; display: inline-grid; place-items: center; color: var(--doux); font-size: 11px; flex: none; border-radius: 4px; }
.fleche:hover { background: #dfe5ef; }
.fleche.vide { visibility: hidden; }
.noeud .nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.volet-bas { border-top: 1px solid var(--trait); padding: 6px; display: grid; }
.lien-volet { padding: 6px 10px; border-radius: 6px; color: var(--texte); text-decoration: none; }
.lien-volet:hover, .lien-volet.actif { background: var(--survol); }
.lien-volet.cible { background: var(--accent-clair); outline: 2px dashed var(--accent); }

/* liste des elements */
table.liste { width: 100%; border-collapse: collapse; }
.liste th { position: sticky; top: 0; background: var(--blanc); text-align: left; font-weight: 500; color: var(--doux); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--trait); z-index: 1; }
.liste td { padding: 6px 10px; border-bottom: 1px solid #f0f2f5; white-space: nowrap; }
.liste tr.ligne { cursor: default; user-select: none; }
.liste tr.ligne:hover td { background: var(--survol); }
.liste tr.ligne.selection td { background: var(--selection); }
.liste tr.ligne.cible td { background: var(--accent-clair); box-shadow: inset 0 2px 0 var(--accent), inset 0 -2px 0 var(--accent); }
.liste td.nom { display: flex; align-items: center; gap: 8px; white-space: normal; }
.liste .ic { font-size: 17px; width: 22px; text-align: center; flex: none; }
.liste .col-plus { width: 40px; text-align: right; }
.plus { border: none; background: transparent; padding: 2px 8px; font-size: 18px; line-height: 1; color: var(--doux); }
.vide-dossier { padding: 50px 20px; text-align: center; color: var(--doux); }
.renommage { width: 100%; max-width: 420px; padding: 3px 6px; border: 1px solid var(--accent); border-radius: 5px; }

/* page */
.page { max-width: 860px; padding: 20px 28px 60px; }
.page-barre { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.page-barre h1 { font-size: 22px; margin: 0 auto 0 0; }
.page .meta { color: var(--doux); font-size: 12px; margin-bottom: 18px; }
.rendu { line-height: 1.6; }
.rendu table { border-collapse: collapse; margin: 12px 0; }
.rendu th, .rendu td { border: 1px solid var(--trait); padding: 6px 10px; text-align: left; vertical-align: top; }
.rendu th { background: var(--fond); }
.rendu code { background: var(--fond); padding: 1px 5px; border-radius: 4px; }
.rendu pre { background: var(--fond); padding: 12px; border-radius: 8px; overflow: auto; }
.rendu a { color: var(--accent); }
.rendu img { max-width: 100%; }
.edition { display: grid; gap: 10px; }
.edition textarea { width: 100%; min-height: 60vh; padding: 12px; border: 1px solid var(--trait); border-radius: 8px; font: 14px/1.5 ui-monospace, Consolas, monospace; resize: vertical; }
.aide-edition { color: var(--doux); font-size: 12px; }
.apercu-fichier { max-width: 100%; max-height: 70vh; border: 1px solid var(--trait); border-radius: 8px; }
iframe.apercu-fichier { width: 100%; height: 72vh; }

/* menus, dialogues, notifications */
.menu { position: fixed; z-index: 50; list-style: none; margin: 0; padding: 5px; background: var(--blanc); border: 1px solid var(--trait); border-radius: 9px; box-shadow: 0 8px 28px rgba(15,25,50,.18); min-width: 210px; }
.menu li { padding: 7px 12px; border-radius: 6px; cursor: pointer; display: flex; gap: 10px; align-items: center; }
.menu li:hover, .menu li:focus { background: var(--survol); outline: none; }
.menu li.sep-menu { height: 1px; padding: 0; margin: 4px 6px; background: var(--trait); pointer-events: none; }
.menu li .raccourci { margin-left: auto; color: var(--doux); font-size: 12px; }
.dialogue { position: fixed; inset: 0; z-index: 60; background: rgba(10,18,40,.45); display: grid; place-items: center; padding: 16px; }
.boite { background: var(--blanc); border-radius: 12px; padding: 20px; width: min(480px, 100%); max-height: 85vh; overflow: auto; display: grid; gap: 12px; box-shadow: 0 16px 50px rgba(0,0,0,.3); }
.boite h2 { margin: 0; font-size: 17px; }
.boite p { margin: 0; }
.boite input[type=text] { padding: 9px; border: 1px solid var(--trait); border-radius: 8px; width: 100%; }
.boite .boutons { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.choix-dossier { border: 1px solid var(--trait); border-radius: 8px; max-height: 45vh; overflow: auto; padding: 4px 0; }
.depot { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(31,95,209,.12); border: 4px dashed var(--accent); font-size: 22px; font-weight: 600; color: var(--accent); pointer-events: none; }
.toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 70; background: var(--marine); color: #fff; padding: 10px 16px; border-radius: 9px; box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: 90vw; }
.toast.erreur { background: var(--danger); }
.progression { height: 6px; border-radius: 3px; background: var(--fond); overflow: hidden; }
.progression > div { height: 100%; background: var(--accent); width: 0; transition: width .2s; }
.vue-titre { padding: 16px 20px 4px; margin: 0; font-size: 18px; }
.vue-aide { padding: 0 20px 10px; margin: 0; color: var(--doux); }

.seul-mobile { display: none; }
@media (max-width: 760px) {
  .seul-mobile { display: inline-block; }
  .masque-mobile, .outils .texte, .col-type, .col-par, .col-taille { display: none; }
  .corps { grid-template-columns: 1fr; }
  #volet { position: fixed; z-index: 30; top: 0; bottom: 0; left: 0; width: 84vw; max-width: 320px; transform: translateX(-100%); transition: transform .2s; box-shadow: 4px 0 20px rgba(0,0,0,.2); }
  #volet.ouvert { transform: none; }
  #voile { position: fixed; inset: 0; z-index: 25; background: rgba(0,0,0,.3); }
  #recherche { width: 100%; }
  .entete { flex-wrap: wrap; }
  .outils button { padding: 8px 10px; }
  .liste td { padding: 10px 8px; }
  .page { padding: 16px; }
}
@media (pointer: coarse) { .plus { padding: 6px 12px; } }

.champ-mdp { position: relative; display: block; }
.champ-mdp input { width: 100%; padding-right: 48px; }
.oeil { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: none; background: transparent; font-size: 20px; padding: 4px 8px; line-height: 1; }
.oeil.visible { opacity: .45; }
