/* =====================================================================
   Depot Client - peau "privilege" : papier chaud, encre, or discret,
   titres en serif, filets fins, beaucoup d'air. Une seule feuille pour
   l'espace client, l'administration et les reglages.
   ===================================================================== */

:root {
  color-scheme: light dark;
  --fond: #f4f1ea;
  --surface: #fcfaf5;
  --surface-2: #ede9df;
  --bord: #e2ddd1;
  --bord-fort: #cbc4b4;
  --texte: #16150f;
  --texte-doux: #746e62;
  --encre: #16150f;
  --encre-texte: #f8f5ee;
  --or: #b08c55;
  --or-doux: #efe5d1;
  --accent: var(--encre);
  --accent-doux: var(--or-doux);
  --ok: #3e7a4b;
  --alerte: #a83e2f;
  --rayon: 14px;
  --ombre: 0 1px 0 rgba(0, 0, 0, .02), 0 24px 60px -36px rgba(30, 24, 10, .28);
  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Inter, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0c0c0b;
    --surface: #141412;
    --surface-2: #1c1b18;
    --bord: #26241f;
    --bord-fort: #3b382f;
    --texte: #ece7db;
    --texte-doux: #9e9789;
    --encre: #ece7db;
    --encre-texte: #121110;
    --or: #c9a56f;
    --or-doux: #2a2418;
    --ok: #86bd90;
    --alerte: #e2866f;
    --ombre: 0 1px 0 rgba(255, 255, 255, .02), 0 30px 70px -40px rgba(0, 0, 0, .8);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--texte);
  background:
    radial-gradient(1100px 520px at 50% -12%, color-mix(in srgb, var(--or) 14%, transparent), transparent 60%),
    var(--fond);
  font: 14.5px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  letter-spacing: .005em;
}

[hidden] { display: none !important; }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -.012em; }

.surtitre {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--or);
  margin: 0 0 10px;
}

.filet { width: 34px; height: 1px; background: var(--or); margin: 16px 0 20px; }

.enveloppe { max-width: 880px; margin: 0 auto; padding: 36px 22px 90px; }

/* ---------- Connexion ---------- */

.connexion { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }

.carte-connexion {
  width: 100%;
  max-width: 410px;
  background: var(--surface);
  border: 1px solid var(--bord);
  border-radius: 22px;
  box-shadow: var(--ombre);
  padding: 46px 42px 38px;
}

.carte-connexion h1 { margin: 0; font-size: 30px; line-height: 1.15; }
.carte-connexion .sous-titre { margin: 0 0 28px; color: var(--texte-doux); font-size: 14px; line-height: 1.6; }

/* ---------- Formulaires ---------- */

label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 7px;
  color: var(--texte-doux);
}

input[type=text], input[type=email], input[type=password], input[type=number], select {
  width: 100%;
  padding: 11px 13px;
  font: inherit;
  color: var(--texte);
  background: var(--surface);
  border: 1px solid var(--bord-fort);
  border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--or);
  box-shadow: 0 0 0 3px var(--or-doux);
}

.champ { margin-bottom: 18px; }

button {
  font: inherit;
  font-weight: 500;
  letter-spacing: .01em;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--encre);
  color: var(--encre-texte);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, opacity .15s;
}

button:hover:not(:disabled) { background: color-mix(in srgb, var(--encre) 86%, var(--surface)); }
button:disabled { opacity: .45; cursor: default; }
button.large { width: 100%; padding: 13px; font-size: 15px; }

button.discret { background: transparent; color: var(--texte); border-color: var(--bord-fort); }
button.discret:hover:not(:disabled) { background: var(--surface-2); border-color: var(--texte-doux); }

button.mini { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }

button.danger { background: transparent; color: var(--alerte); border-color: transparent; }
button.danger:hover:not(:disabled) { background: color-mix(in srgb, var(--alerte) 10%, transparent); }

a.bouton-lien {
  display: inline-block;
  text-decoration: none;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--bord-fort);
  color: var(--texte);
  background: transparent;
  line-height: 1.55;
}
a.bouton-lien:hover { background: var(--surface-2); border-color: var(--texte-doux); }

.aide-champ { font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--texte-doux); }
.aide-sous { margin: 6px 0 0; font-size: 12.5px; color: var(--texte-doux); line-height: 1.55; }
.aide-sous code {
  font: 12.5px ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 5px;
}

/* ---------- Messages ---------- */

.message { padding: 11px 14px; border-radius: 10px; font-size: 13.5px; margin-bottom: 16px; }
.message.erreur { background: color-mix(in srgb, var(--alerte) 10%, transparent); color: var(--alerte); }
.message.succes { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.message.info { background: var(--surface-2); color: var(--texte-doux); }

/* ---------- En-tete de page ---------- */

.entete {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}
.entete h1 { margin: 0; font-size: 30px; }
.entete .qui { color: var(--texte-doux); font-size: 13.5px; margin: 4px 0 0; }

/* ---------- Blocs ---------- */

.bloc {
  background: var(--surface);
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  padding: 24px 24px 22px;
  margin-bottom: 18px;
  box-shadow: var(--ombre);
}
.bloc h2 { margin: 0 0 16px; font-size: 19px; }
.bloc h2 .compte { color: var(--texte-doux); font-family: var(--sans); font-size: 13px; font-weight: 400; margin-left: 4px; }

/* ---------- Jauges ---------- */

.quota-ligne { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; margin-bottom: 9px; }
.quota-ligne strong { font-weight: 600; }
.quota-ligne .reste { color: var(--texte-doux); font-size: 13px; }

.jauge { height: 4px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.jauge > div { height: 100%; background: var(--or); border-radius: 99px; transition: width .4s ease; }
.jauge.pleine > div { background: var(--alerte); }

.mini-jauge { width: 110px; height: 4px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 5px; }
.mini-jauge > div { height: 100%; background: var(--or); }
.mini-jauge.pleine > div { background: var(--alerte); }

/* ---------- Zone de depot (pages simples) ---------- */

.depose {
  border: 1px dashed var(--bord-fort);
  border-radius: var(--rayon);
  padding: 38px 20px;
  text-align: center;
  cursor: pointer;
  background: var(--surface);
  transition: border-color .15s, background .15s;
}
.depose:hover, .depose.survol { border-color: var(--or); background: var(--or-doux); }
.depose .titre { font-weight: 600; margin-bottom: 4px; }
.depose .aide { color: var(--texte-doux); font-size: 13px; }
.boutons-depose { display: flex; gap: 8px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }

/* ---------- Listes de fichiers (pages simples, explorateur du disque) ---------- */

.fichiers { list-style: none; margin: 0; padding: 0; }
.fichiers li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--bord); }
.fichiers li:first-child { border-top: none; }
.fichiers .infos { flex: 1; min-width: 0; }
.fichiers .nom { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fichiers .meta { display: block; font-size: 12.5px; color: var(--texte-doux); margin-top: 1px; font-variant-numeric: tabular-nums; }
.fichiers .actions { display: flex; gap: 6px; flex-shrink: 0; }
.fichiers li > input[type=checkbox] { flex-shrink: 0; margin: 0; accent-color: var(--or); cursor: pointer; }
.vide { color: var(--texte-doux); font-size: 14px; padding: 6px 0; margin: 0; }

.explorateur li { gap: 10px; }
.explorateur .icone { flex-shrink: 0; width: 15px; height: 12px; border-radius: 2px 3px 3px 3px; background: var(--or); opacity: .8; }
.explorateur .icone.fichier { width: 11px; height: 14px; border-radius: 2px; background: none; border: 1.5px solid var(--bord-fort); opacity: 1; }
.explorateur .lien-dossier { background: none; border: none; padding: 0; font: inherit; font-size: 14px; color: var(--texte); font-weight: 550; cursor: pointer; text-align: left; }
.explorateur .lien-dossier:hover { color: var(--or); background: none; }
.explorateur li.reserve { opacity: .5; }
.explorateur li.reserve .infos .meta { font-style: italic; }

/* ---------- Transferts (vignettes) ---------- */

.transfert { display: block; padding: 12px 0; border-top: 1px solid var(--bord); }
.transfert:first-child { border-top: none; }
.transfert .ligne-haut { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.transfert .nom { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transfert .pourcent { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--texte-doux); flex-shrink: 0; }
.transfert .ligne-bas { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 6px; font-size: 12.5px; color: var(--texte-doux); font-variant-numeric: tabular-nums; }
.transfert.echec .jauge > div { background: var(--alerte); }
.transfert.termine .jauge > div { background: var(--ok); }

/* ---------- Tableau (administration) ---------- */

.tableau-enveloppe { overflow-x: auto; margin: 0 -24px; padding: 0 24px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--texte-doux);
  font-weight: 600;
  padding: 0 12px 10px 0;
  white-space: nowrap;
}
td { padding: 13px 12px 13px 0; border-top: 1px solid var(--bord); vertical-align: middle; }
td:last-child, th:last-child { padding-right: 0; text-align: right; }

.pastille {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--texte-doux);
}
.pastille.actif { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.pastille.inactif { background: color-mix(in srgb, var(--alerte) 12%, transparent); color: var(--alerte); }

/* ---------- Chiffres cles ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--bord);
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  overflow: hidden;
  margin-bottom: 18px;
}
.stat { background: var(--surface); padding: 18px 20px 16px; }
.stat .valeur { font-family: var(--serif); font-size: 28px; font-weight: 500; letter-spacing: -.02em; line-height: 1.1; }
.stat .libelle { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--texte-doux); margin-top: 6px; }

/* ---------- Identifiants generes ---------- */

.identifiants {
  background: var(--or-doux);
  border: 1px solid color-mix(in srgb, var(--or) 35%, transparent);
  border-radius: var(--rayon);
  padding: 18px 20px;
  margin-bottom: 18px;
}
.identifiants h3 { margin: 0 0 12px; font-size: 17px; }
.identifiants .paire { display: flex; gap: 10px; align-items: baseline; font-size: 14px; padding: 3px 0; }
.identifiants .paire span { color: var(--texte-doux); min-width: 110px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.identifiants code {
  font: 600 14px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--surface);
  padding: 3px 9px;
  border-radius: 6px;
  user-select: all;
}

/* ---------- Journal ---------- */

.journal { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.journal li { display: flex; gap: 12px; padding: 8px 0; border-top: 1px solid var(--bord); align-items: baseline; }
.journal li:first-child { border-top: none; }
.journal .quand { color: var(--texte-doux); font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.journal .quoi { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Divers ---------- */

.rangee { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.rangee > .champ { flex: 1; min-width: 150px; margin-bottom: 0; }
.pied { text-align: center; color: var(--texte-doux); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; margin-top: 36px; }
.case { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--texte); text-transform: none; letter-spacing: 0; font-weight: 450; }
.case input { width: auto; accent-color: var(--or); }

details > summary { cursor: pointer; list-style: none; display: flex; gap: 10px; align-items: baseline; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before {
  content: ""; display: inline-block; width: 7px; height: 7px;
  border-right: 1.5px solid var(--texte-doux); border-bottom: 1.5px solid var(--texte-doux);
  transform: rotate(-45deg); transition: transform .15s; margin-right: 2px;
}
details[open] > summary::before { transform: rotate(45deg); }
details > summary h2 { margin: 0; }

/* ---------- Fil d'Ariane (explorateur du disque) ---------- */

.fil-ariane {
  display: flex; align-items: center; gap: 2px; flex-wrap: wrap;
  font-size: 13px; padding: 8px 12px;
  background: var(--surface-2); border-radius: 10px; margin-bottom: 6px;
}
.fil-ariane button { background: none; border: none; padding: 2px 6px; color: var(--texte-doux); font-size: 13px; font-weight: 500; border-radius: 6px; }
.fil-ariane button:hover:not(:disabled) { background: var(--surface); color: var(--texte); }
.fil-ariane button:disabled { color: var(--texte); font-weight: 600; opacity: 1; cursor: default; }
.fil-ariane button.cible { background: var(--encre); color: var(--encre-texte); }
.fil-ariane .separateur { color: var(--texte-doux); }

/* ---------- File d'envoi a barre unique ---------- */

.envoi { margin-top: 12px; padding: 14px 16px; border: 1px solid var(--bord); border-radius: 12px; background: var(--surface-2); }
.envoi .ligne-haut { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.envoi .nom { font-weight: 600; font-size: 14px; }
.envoi .pourcent { font-size: 13px; color: var(--texte-doux); font-variant-numeric: tabular-nums; }
.envoi .ligne-bas { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; font-size: 12.5px; color: var(--texte-doux); font-variant-numeric: tabular-nums; }
.envoi .courant { margin-top: 6px; font-size: 12px; color: var(--texte-doux); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.envoi.termine .jauge > div { background: var(--ok); }
.envoi.echec .jauge > div { background: var(--alerte); }
.envoi .echecs { margin-top: 10px; }
.envoi .echecs ul { margin: 0 0 10px; padding-left: 18px; font-size: 12.5px; color: var(--alerte); }

/* ---------- Barre de selection / menus / boite ---------- */

.barre-selection { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 4px; background: var(--surface-2); border-radius: 10px; }
.barre-selection .resume { font-size: 13px; color: var(--texte-doux); font-variant-numeric: tabular-nums; }
.barre-selection .boutons-selection { margin-left: auto; display: flex; gap: 6px; }

.menu-enveloppe { position: relative; display: inline-block; }
.bouton-menu { font-size: 15px; line-height: 1; padding: 4px 10px; letter-spacing: 1px; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--bord);
  border-radius: 12px;
  box-shadow: 0 12px 40px -12px rgba(0, 0, 0, .3);
  padding: 5px;
  display: flex; flex-direction: column;
}
.menu button { background: none; border: none; color: var(--texte); text-align: left; padding: 8px 11px; border-radius: 8px; font-weight: 450; font-size: 13.5px; }
.menu button:hover { background: var(--surface-2); }
.menu button.danger { color: var(--alerte); }

.dialogue {
  border: 1px solid var(--bord); border-radius: 18px; padding: 26px 28px;
  background: var(--surface); color: var(--texte); box-shadow: var(--ombre);
  min-width: 340px; max-width: 90vw;
}
.dialogue::backdrop { background: rgba(10, 8, 4, .45); }
.dialogue h3 { margin: 0 0 16px; font-size: 19px; }
.dialogue select { margin-bottom: 20px; }

/* ===================== Fenetre a la Finder ===================== */

.finder-page { height: 100dvh; box-sizing: border-box; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.finder-page > .message { margin: 0; }
.finder-page > #finder { flex: 1; min-height: 0; display: flex; }
.finder-page > #finder > .finder { flex: 1; }

.finder {
  position: relative;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 480px;
  background: var(--surface);
  border: 1px solid var(--bord);
  border-radius: 20px;
  box-shadow: var(--ombre);
  overflow: hidden;
  outline: none;
}
.finder:focus-visible { box-shadow: var(--ombre), 0 0 0 3px var(--or-doux); }

/* --- Barre laterale --- */

.finder-lateral {
  display: flex; flex-direction: column; gap: 6px;
  padding: 22px 12px 16px;
  background: var(--surface-2);
  border-right: 1px solid var(--bord);
  min-width: 0;
}
.finder-entete { padding: 0 10px 18px; }
.finder-entete::before { content: "Espace priv\00e9"; display: block; font-size: 10px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--or); margin-bottom: 8px; }
.finder-titre { font-family: var(--serif); font-weight: 500; font-size: 21px; letter-spacing: -.01em; line-height: 1.15; }
.finder-sous-titre { font-size: 12.5px; color: var(--texte-doux); margin-top: 5px; }

.finder-emplacements { display: flex; flex-direction: column; gap: 3px; }
.finder-emplacements::before { content: "Espaces"; font-size: 10px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--texte-doux); padding: 0 10px 6px; }
.finder-emplacement {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 11px;
  align-items: center;
  text-align: left;
  background: none; border: none;
  color: var(--texte);
  padding: 9px 10px;
  border-radius: 11px;
  font-weight: 550; font-size: 13.5px;
}
.finder-emplacement:hover { background: var(--surface); }
.finder-emplacement::before {
  content: ""; grid-row: 1 / span 2; width: 19px; height: 17px;
  background-color: var(--or);
  -webkit-mask: center / contain no-repeat; mask: center / contain no-repeat;
}
.finder-emplacement.icone-recus::before, .finder-emplacement.icone-envois::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 3v10m0 0l-4-4m4 4l4-4' stroke='black' stroke-width='2.2' fill='none' stroke-linecap='round' stroke-linejoin='round'/><path d='M3 14v5a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-5h-5l-1.5 2h-5L8 14z' fill='black'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 3v10m0 0l-4-4m4 4l4-4' stroke='black' stroke-width='2.2' fill='none' stroke-linecap='round' stroke-linejoin='round'/><path d='M3 14v5a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-5h-5l-1.5 2h-5L8 14z' fill='black'/></svg>");
}
.finder-emplacement.icone-envois::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 13V3m0 0L8 7m4-4l4 4' stroke='black' stroke-width='2.2' fill='none' stroke-linecap='round' stroke-linejoin='round'/><path d='M3 14v5a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-5h-5l-1.5 2h-5L8 14z' fill='black'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 13V3m0 0L8 7m4-4l4 4' stroke='black' stroke-width='2.2' fill='none' stroke-linecap='round' stroke-linejoin='round'/><path d='M3 14v5a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-5h-5l-1.5 2h-5L8 14z' fill='black'/></svg>");
}
.finder-emplacement .nom { grid-column: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finder-emplacement .description { grid-column: 2; font-size: 11.5px; color: var(--texte-doux); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finder-emplacement .cadenas {
  grid-column: 3; grid-row: 1 / span 2; width: 11px; height: 12px;
  background-color: var(--texte-doux);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><rect x='5' y='10' width='14' height='11' rx='2.5' fill='black'/><path d='M8 10V7a4 4 0 0 1 8 0v3' stroke='black' stroke-width='2.2' fill='none'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><rect x='5' y='10' width='14' height='11' rx='2.5' fill='black'/><path d='M8 10V7a4 4 0 0 1 8 0v3' stroke='black' stroke-width='2.2' fill='none'/></svg>") center / contain no-repeat;
}
.finder-emplacement.actif { background: var(--encre); color: var(--encre-texte); }
.finder-emplacement.actif::before { background-color: var(--or); }
.finder-emplacement.actif .cadenas { background-color: color-mix(in srgb, var(--encre-texte) 70%, transparent); }
.finder-emplacement.actif .description { color: color-mix(in srgb, var(--encre-texte) 70%, transparent); }

.finder-pied { margin-top: auto; padding: 8px 10px 0; display: flex; flex-direction: column; gap: 14px; }
.finder-quota .texte { font-size: 12px; color: var(--texte-doux); margin-bottom: 6px; }
.finder-quota .jauge { height: 3px; }

/* --- Zone principale --- */

.finder-principal { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.finder-outils { display: flex; align-items: center; gap: 14px; padding: 14px 18px 10px; }
.finder-nav { display: flex; gap: 4px; }
.finder-fleche { background: transparent; border: 1px solid var(--bord-fort); color: var(--texte); padding: 0 10px; height: 28px; font-size: 18px; line-height: 1; border-radius: 8px; }
.finder-fleche:hover:not(:disabled) { background: var(--surface-2); }
.finder-fleche:disabled { opacity: .3; }
.finder-titre-dossier { flex: 1; min-width: 0; font-family: var(--serif); font-weight: 500; font-size: 20px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finder-actions { display: flex; gap: 6px; align-items: center; }
.finder-actions .menu { left: 0; right: auto; }

.finder-chemin {
  display: flex; align-items: center; gap: 1px;
  padding: 4px 14px 8px;
  font-size: 12.5px;
  border-bottom: 1px solid var(--bord);
  overflow-x: auto; white-space: nowrap;
}
.finder-chemin button { background: none; border: none; color: var(--texte-doux); padding: 2px 6px; border-radius: 6px; font-size: 12.5px; font-weight: 500; }
.finder-chemin button:hover:not(:disabled) { background: var(--surface-2); color: var(--texte); }
.finder-chemin button:disabled { color: var(--texte); font-weight: 600; opacity: 1; cursor: default; }
.finder-chemin button.cible { background: var(--encre); color: var(--encre-texte); }
.finder-chemin .separateur { color: var(--or); padding: 0 3px; }

.finder-contenu { flex: 1; min-height: 0; overflow: auto; position: relative; }
.finder-liste { min-height: 100%; display: flex; flex-direction: column; }
.finder-lignes { flex: 1; }

.finder-ligne {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 130px;
  align-items: center;
  padding: 0 18px;
  height: 38px;
  font-size: 13.5px;
}
.finder-colonnes {
  position: sticky; top: 0; z-index: 2;
  height: 30px;
  background: var(--surface);
  border-bottom: 1px solid var(--bord);
  font-size: 10px; text-transform: uppercase; letter-spacing: .16em;
  color: var(--texte-doux); font-weight: 600;
}
.finder-lignes .finder-ligne { cursor: default; user-select: none; -webkit-user-select: none; border-bottom: 1px solid color-mix(in srgb, var(--bord) 55%, transparent); transition: background .12s; }
.finder-lignes .finder-ligne:hover { background: var(--surface-2); }
.finder-ligne.selectionne, .finder-lignes .finder-ligne.selectionne:hover { background: var(--encre); color: var(--encre-texte); }
.finder-ligne.selectionne .col-taille, .finder-ligne.selectionne .col-date, .finder-ligne.selectionne .chevron { color: color-mix(in srgb, var(--encre-texte) 72%, transparent); }
.finder-ligne.dossier.cible { box-shadow: inset 0 0 0 1.5px var(--or); background: var(--or-doux) !important; color: var(--texte); }
.finder-ligne.en-deplacement { opacity: .4; }

.col-nom { display: flex; align-items: center; gap: 11px; min-width: 0; }
.col-nom .nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finder-ligne.dossier .col-nom .nom { font-weight: 550; }
.col-taille, .col-date { color: var(--texte-doux); font-variant-numeric: tabular-nums; font-size: 12.5px; white-space: nowrap; }
.col-taille { text-align: right; padding-right: 20px; }
.chevron { margin-left: auto; padding: 0 4px 0 10px; font-size: 18px; line-height: 1; color: var(--or); opacity: .55; cursor: pointer; }
.finder-ligne:hover .chevron { opacity: 1; }

.finder-icone { width: 18px; height: 16px; flex-shrink: 0; position: relative; background: center / contain no-repeat; }
.finder-icone.dossier {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 20'><path d='M1 3.5A1.5 1.5 0 0 1 2.5 2h6l2 2.5h11a1.5 1.5 0 0 1 1.5 1.5v11.5a1.5 1.5 0 0 1-1.5 1.5h-19A1.5 1.5 0 0 1 1 17.5z' fill='%23c9ad7c'/><path d='M1 8h22v9.5a1.5 1.5 0 0 1-1.5 1.5h-19A1.5 1.5 0 0 1 1 17.5z' fill='%23e3cfa6'/></svg>");
}
.finder-icone.document, .finder-icone.audio, .finder-icone.video, .finder-icone.image, .finder-icone.archive {
  width: 15px; height: 17px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 24'><path d='M3 1.5h9.5L18 7v15.5H3z' fill='%23fbf8f1' stroke='%23b9b09c' stroke-width='1.2'/><path d='M12.5 1.5V7H18' fill='%23e8e1d2' stroke='%23b9b09c' stroke-width='1.2'/></svg>");
}
.finder-icone.audio::after, .finder-icone.video::after, .finder-icone.image::after, .finder-icone.archive::after {
  content: ""; position: absolute; left: 3px; right: 2px; bottom: 2px; height: 3px; border-radius: 2px;
}
.finder-icone.audio::after { background: var(--or); }
.finder-icone.video::after { background: #6d6a63; }
.finder-icone.image::after { background: var(--ok); }
.finder-icone.archive::after { background: #a29d90; }

.finder-renommage {
  font: inherit; font-size: 13.5px; padding: 2px 7px; border-radius: 6px;
  border: 1.5px solid var(--or); background: var(--surface); color: var(--texte);
  width: min(60%, 420px); outline: none;
}

.finder-vide { padding: 80px 32px; text-align: center; color: var(--texte-doux); font-size: 14px; line-height: 1.7; max-width: 460px; margin: 0 auto; }

.finder-voile {
  position: absolute; inset: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--or) 10%, var(--surface) 60%);
  backdrop-filter: blur(2px);
  pointer-events: none;
}
.finder-voile > div {
  background: var(--surface);
  border: 1px dashed var(--or);
  border-radius: 16px;
  padding: 24px 34px;
  font-family: var(--serif); font-size: 19px; font-weight: 500;
  max-width: 80%; text-align: center;
  box-shadow: var(--ombre);
}
.finder-voile.refus > div { border-color: var(--alerte); color: var(--alerte); font-family: var(--sans); font-size: 15px; }

.finder-message { margin: 8px 16px 0; padding: 8px 12px; border-radius: 8px; font-size: 13px; }
.finder-message.erreur { background: color-mix(in srgb, var(--alerte) 10%, transparent); color: var(--alerte); }
.finder-message.info { background: var(--surface-2); color: var(--texte-doux); }

.finder-envoi { padding: 0 16px; }
.finder-envoi .envoi { margin: 8px 0; }

.finder-etat {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  min-height: 44px; padding: 7px 16px;
  border-top: 1px solid var(--bord);
  background: var(--surface-2);
  font-size: 12.5px; color: var(--texte-doux);
}
.finder-etat .texte { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.finder-etat .actions { display: flex; gap: 6px; flex-shrink: 0; }

.finder-contextuel { position: absolute; z-index: 30; }

@media (max-width: 720px) {
  .finder-page { padding: 8px; }
  .finder { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); min-height: 0; border-radius: 14px; }
  .finder-lateral { flex-direction: row; align-items: center; gap: 6px; padding: 8px; border-right: none; border-bottom: 1px solid var(--bord); }
  .finder-entete, .finder-quota, .finder-emplacement .description, .finder-emplacements::before { display: none; }
  .finder-emplacements { flex-direction: row; flex: 1; }
  .finder-emplacement { grid-template-rows: auto; padding: 7px 8px; }
  .finder-pied { margin-top: 0; padding: 0; }
  .finder-ligne { grid-template-columns: minmax(0, 1fr) 95px; padding: 0 12px; }
  .col-date { display: none; }
  .finder-outils { gap: 8px; padding: 10px 12px 6px; }
  .enveloppe { padding: 22px 14px 60px; }
  .bloc { padding: 18px; }
  .tableau-enveloppe { margin: 0 -18px; padding: 0 18px; }
  th:nth-child(3), td:nth-child(3) { display: none; }
}
