/* OneCloud — l'apparence « Logiciel ».
   Reprise de la version faite avec ChatGPT le 19/09/2026 (Documentation/DA_Logiciel_ChatGPT).
   Clair ou sombre selon le réglage de l'appareil : light-dark(couleur claire, couleur sombre). */

/* ------------------------------------------------------------ les couleurs */
:root {
  color-scheme: light dark;
  --fond:          light-dark(#ffffff, #202020);
  --doux:          light-dark(#f0f1f3, #2d2d2d);   /* le haut, les onglets, la barre d'état */
  --encre:         light-dark(#22252a, #f0f0f0);   /* le texte */
  --gris:          light-dark(#656b74, #b8bcc4);   /* le texte secondaire */
  --trait:         light-dark(#d2d6dc, #454545);   /* les bordures */
  --accent:        light-dark(#176ac1, #a1ceff);   /* le bleu */
  --choisi:        light-dark(#ddecfd, #314b67);   /* la ligne choisie */
  --choisi-bord:   light-dark(#b8d2ee, #4e6e8e);
  --dossier-fond:  light-dark(#f5ce72, #927533);   /* les dossiers jaunes */
  --dossier-trait: light-dark(#bc8b25, #f0cc77);
  --pdf:           light-dark(#b3473e, #e4a298);
  --image:         light-dark(#8a5cc2, #c9b2ef);
  --video:         light-dark(#9b4fb5, #d7a8e8);
  --plan:          light-dark(#2f8577, #9ad5c9);
  --maquette:      light-dark(#3b62b5, #a9c0f0);
  --archive:       light-dark(#9a6b3f, #dcbb96);
  --audio:         light-dark(#c2410c, #f5b28a);
  --word:          light-dark(#2b579a, #8fb4f0);
  --excel:         light-dark(#217346, #8fd0a8);
  --powerpoint:    light-dark(#b7472a, #f0a58f);
  --danger:        light-dark(#c4314b, #ff99a4);
}

/* ------------------------------------------------------------ la base */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--fond); color: var(--encre); font: 12px/1.35 "Segoe UI", system-ui, sans-serif; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.reserve-icones { display: none; }
.ic { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* l'application prend tout l'écran : le haut et le bas restent, la liste défile */
.app { height: 100dvh; display: flex; flex-direction: column; }

/* ------------------------------------------------------------ 1. le haut */
.haut { display: flex; align-items: center; gap: 12px; padding: 9px 13px; background: var(--doux); }
.marque { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.marque .ic { width: 19px; height: 19px; color: var(--accent); }
.recherche { display: flex; align-items: center; gap: 8px; width: 300px; margin-left: auto; padding: 6px 8px;
  border: 1px solid var(--trait); border-radius: 4px; background: var(--fond); color: var(--gris); }
.recherche input { width: 100%; min-width: 0; border: 0; background: transparent; color: var(--encre); font-size: 12px; outline-offset: 3px; }
.recherche input::placeholder { color: var(--gris); opacity: 1; }
.compte { position: relative; }
.avatar { width: 25px; height: 25px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: var(--trait); font-size: 11px; flex-shrink: 0; }
.avatar[aria-expanded="true"] { outline: 2px solid var(--accent); outline-offset: 1px; }
.qui { display: grid; gap: 1px; padding: 7px 9px 9px; margin-bottom: 4px; border-bottom: 1px solid var(--trait); }
.qui span { color: var(--gris); font-size: 11px; }

/* ------------------------------------------------------------ 2. les onglets, reliés à la zone du dessous */
.onglets { display: flex; align-items: flex-end; gap: 2px; padding: 0 10px; background: var(--doux); border-bottom: 1px solid var(--trait); }
.onglet { position: relative; top: 1px; display: flex; align-items: center; gap: 6px; padding: 10px 12px; white-space: nowrap;
  background: transparent; border: 1px solid transparent; border-bottom: 0; border-radius: 6px 6px 0 0; font-size: 12px; }
.onglet .ic { width: 14px; height: 14px; }
.onglet[aria-pressed="true"] { background: var(--fond); border-color: var(--trait); }
.onglet[aria-pressed="true"] .ic { color: var(--accent); }
/* le petit rond : des liens ont été téléchargés depuis la dernière visite de l'onglet */
.onglet[data-nouveau]:not([data-nouveau=""])::after { content: attr(data-nouveau); min-width: 16px; padding: 0 5px; border-radius: 8px;
  background: var(--accent); color: var(--fond); font-size: 10px; line-height: 16px; text-align: center; }

.ajouter { position: relative; margin-left: auto; margin-bottom: 4px; }
.bouton-ajouter { display: flex; align-items: center; gap: 6px; padding: 6px 9px; border: 1px solid var(--trait); border-radius: 4px; background: var(--fond); font-size: 11px; white-space: nowrap; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; min-width: 185px; padding: 5px;
  background: var(--fond); border: 1px solid var(--trait); border-radius: 5px; box-shadow: 0 6px 18px light-dark(#16253c20, #00000044); }
.menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px; border: 0; background: transparent; text-align: left; font-size: 12px; border-radius: 3px; }
.menu button:hover { background: var(--choisi); }
.menu hr { border: 0; border-top: 1px solid var(--trait); margin: 4px 2px; }
.menu button.coche::after { content: "✓"; margin-left: auto; color: var(--accent); }
.menu button.danger, .menu button.danger .ic { color: var(--danger); }
.menu-contexte, .menu-tri { position: fixed; top: 0; right: auto; z-index: 20; }   /* placés par script.js */
.menu-contexte { min-width: 190px; }
.menu-tri { min-width: 160px; }

/* ------------------------------------------------------------ 3. la barre de commandes */
/* une seule ligne, toujours la même hauteur : l'adresse se raccourcit par la gauche, comme dans Windows */
.commandes { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; padding: 8px 12px; border-bottom: 1px solid var(--trait); }
.adresse { display: flex; align-items: center; justify-content: flex-end; gap: 2px; flex: 0 1 auto; min-width: 0; overflow: hidden;
  padding: 3px 6px; border: 1px solid var(--trait); border-radius: 3px; font-size: 12px; }
.adresse > * { flex-shrink: 0; }
.retour, .actions, .tri { flex-shrink: 0; }
.adresse::before { content: "›"; color: var(--gris); font-size: 15px; margin: 0 4px 0 2px; }
.adresse button { padding: 2px 4px; border: 0; border-radius: 3px; background: transparent; white-space: nowrap; }
.adresse button:hover { background: var(--doux); }
.adresse .sep { color: var(--gris); }
.retour { display: flex; align-items: center; gap: 5px; padding: 5px 6px; border: 0; background: transparent; color: var(--accent); font-size: 11px; }
.retour .ic { width: 14px; height: 14px; }
.espaceur { flex: 1; }
.trier { display: flex; align-items: center; gap: 5px; margin-left: 4px; padding: 5px 8px; border: 0; border-left: 1px solid var(--trait); background: transparent; font-size: 11px; white-space: nowrap; }
.trier .ic { width: 13px; height: 13px; }
.trier[aria-pressed="true"] { color: var(--accent); }
.actions { display: flex; gap: 2px; margin-left: 4px; }
.action { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border: 0; border-radius: 3px; background: transparent; font-size: 12px; white-space: nowrap; }
.action:hover { background: var(--doux); }
.action:disabled { opacity: .35; cursor: default; }
.action:disabled:hover { background: transparent; }
.action .ic { width: 15px; height: 15px; color: var(--accent); }
.action.danger, .action.danger .ic { color: var(--danger); }
.statut .annuler { padding: 0 4px; border: 0; background: none; color: var(--accent); text-decoration: underline; font-size: 11px; }

/* ------------------------------------------------------------ 4. la liste */
.contenu { position: relative; flex: 1; min-height: 0; overflow: auto; padding: 0 7px 8px; user-select: none; }
.lasso { position: absolute; z-index: 2; pointer-events: none; border: 1px solid var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.liste.charge { opacity: .45; }
.liste { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12px; }
.liste .col-date { width: 146px; }
.liste .col-type { width: 145px; }
.liste .col-taille { width: 90px; }
.liste .col-reste { width: 0; }                       /* la place en trop, à droite, quand on a réglé les colonnes */
.liste th { position: sticky; top: 0; height: 28px; padding: 5px 9px; background: var(--fond); color: var(--gris); font-size: 11px; font-weight: 400; text-align: left;
  border-bottom: 1px solid var(--trait); border-right: 1px solid var(--trait); }
.liste th:last-child { border-right: 0; }
.liste th .titre { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* la poignée, sur le bord droit de chaque en-tête : on la tire pour élargir la colonne */
.poignee { position: absolute; top: 0; right: -4px; z-index: 1; width: 8px; height: 100%; cursor: col-resize; }
body.tirage, body.tirage * { cursor: col-resize !important; user-select: none; }
.liste td:nth-child(n+2) { overflow: hidden; text-overflow: ellipsis; }
.liste td:nth-child(4) { text-align: right; }
.liste th[data-tri] { cursor: pointer; user-select: none; }
.liste th[data-tri]:hover { background: var(--doux); }
.liste th.trie-haut .titre::after, .liste th.trie-bas .titre::after { margin-left: 6px; font-size: 8px; color: var(--gris); }
.liste th.trie-haut .titre::after { content: "▲"; }
.liste th.trie-bas .titre::after { content: "▼"; }
.liste td { height: 28px; padding: 4px 9px; line-height: 1.25; }
.liste td:nth-child(2), .liste td:nth-child(3), .liste td:nth-child(4) { font-size: 11px; white-space: nowrap; color: var(--gris); }
.liste tbody tr:hover { background: var(--doux); }
.liste tbody tr.choisi, .liste tbody tr.choisi:hover { background: var(--choisi); }
.liste tbody tr.choisi td { border-top: 1px solid var(--choisi-bord); border-bottom: 1px solid var(--choisi-bord); padding-top: 3px; padding-bottom: 3px; }

.fichier { display: flex; align-items: center; gap: 7px; width: 100%; min-width: 0; padding: 0; border: 0; background: transparent; text-align: left; }
.fichier span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fichier .ic { color: var(--gris); }
.fichier[data-type="dossier"] .ic { color: var(--dossier-trait); fill: var(--dossier-fond); }
.fichier[data-type="pdf"] .ic { color: var(--pdf); }
.fichier[data-type="image"] .ic { color: var(--image); }
.fichier[data-type="video"] .ic { color: var(--video); }
.fichier[data-type="texte"] .ic { color: var(--accent); }
.fichier[data-type="plan"] .ic { color: var(--plan); }
.fichier[data-type="maquette"] .ic { color: var(--maquette); }
.fichier[data-type="archive"] .ic { color: var(--archive); }
.fichier[data-type="audio"] .ic { color: var(--audio); }
.fichier[data-type="word"] .ic { color: var(--word); }
.fichier[data-type="excel"] .ic { color: var(--excel); }
.fichier[data-type="powerpoint"] .ic { color: var(--powerpoint); }
/* une étoile après le nom d'un favori ; le champ pour renommer, à la place du nom */
.liste tr.favori .fichier > span::after { content: " ★"; color: light-dark(#d49a00, #f5c542); }
.fichier input.renommer { flex: 1; min-width: 0; padding: 1px 4px; border: 1px solid var(--accent); border-radius: 2px; background: var(--fond); color: var(--encre); font-size: 12px; user-select: text; }
.fichier mark { background: light-dark(#ffe58a, #6b5a14); color: inherit; border-radius: 2px; }

.vide { padding: 30px 9px; margin: 0; color: var(--gris); }

/* ------------------------------------------------------------ 5. la barre d'état */
.etat { display: flex; align-items: center; gap: 8px; padding: 7px 13px; background: var(--doux); border-top: 1px solid var(--trait); font-size: 11px; color: var(--gris); }
.etat .ic { width: 12px; height: 12px; }
.statut { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* une seule ligne */
.espace { white-space: nowrap; }

/* ------------------------------------------------------------ la blague : « And it's gone » */
.parti { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: #000000b0; cursor: pointer; }
.parti figure { margin: 0; text-align: center; color: #fff; }
.parti video { display: block; width: min(400px, 90vw); border-radius: 6px; }
.parti figcaption { margin-top: 10px; font-size: 15px; }

/* ------------------------------------------------------------ déposer, déplacer */
.contenu.depot { outline: 2px dashed var(--accent); outline-offset: -4px; }       /* des fichiers du PC arrivent */
.fantome { position: fixed; z-index: 50; pointer-events: none; padding: 4px 9px; border-radius: 4px; background: var(--accent); color: var(--fond); font-size: 11px; white-space: nowrap; }
.liste tbody tr.cible { outline: 2px solid var(--accent); outline-offset: -2px; }  /* le dossier où l'on va lâcher */
.adresse button.cible { background: var(--choisi); outline: 1px solid var(--accent); }
body.deplace, body.deplace * { cursor: grabbing !important; }

/* ------------------------------------------------------------ « Envoyer un dossier du PC » (OneVerif V2) */
.boite.grande { width: min(760px, 100%); max-height: calc(100dvh - 32px); overflow: auto; }
.depot-pc { display: grid; place-items: center; gap: 12px; min-height: 160px; margin: 12px 0; padding: 16px; border: 2px dashed var(--trait); border-radius: 8px; color: var(--gris); text-align: center; }
.fenetre-envoi.survol .depot-pc { border-color: var(--accent); color: var(--accent); }
.compteurs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0; }
.compteur { display: grid; gap: 2px; padding: 10px; border: 1px solid var(--trait); border-radius: 6px; background: var(--fond); text-align: left; font-size: 11px; color: var(--gris); }
.compteur b { font-size: 20px; font-weight: 600; color: var(--encre); }
.compteur.actif { border-color: var(--accent); background: var(--choisi); }
.details { max-height: 240px; overflow: auto; margin: 0 0 12px; padding: 6px 10px; border: 1px solid var(--trait); border-radius: 6px; list-style: none; font-size: 11px; }
.details li { padding: 2px 0; overflow-wrap: anywhere; }
.details li span, .details .rien { color: var(--gris); }
.copier-tout { width: 100%; padding: 9px; }
.copier-tout:disabled { opacity: .7; }
.progression { display: grid; gap: 4px; font-size: 11px; color: var(--gris); }
.progression progress { width: 100%; height: 10px; }
.echecs { margin-top: 12px; color: var(--danger); font-size: 11px; }
.echecs ul { margin: 4px 0 0; padding-left: 16px; }
@media (max-width: 600px) { .compteurs { grid-template-columns: repeat(2, 1fr); } }

/* ------------------------------------------------------------ « Déplacer vers… » */
.boite-deplacer .ou { display: flex; align-items: center; gap: 6px; margin: 4px 0 8px; font-size: 11px; color: var(--gris); overflow-wrap: anywhere; }
.boite-deplacer .dossiers { max-height: min(50dvh, 360px); overflow: auto; margin: 0; padding: 4px; border: 1px solid var(--trait); border-radius: 6px; list-style: none; }
.boite-deplacer .dossiers button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px; border: 0; border-radius: 4px; background: transparent; text-align: left; }
.boite-deplacer .dossiers button:hover { background: var(--choisi); }
.boite-deplacer .dossiers .ic { color: var(--dossier-trait); fill: var(--dossier-fond); }
.boite-deplacer .dossiers .rien { padding: 8px; color: var(--gris); font-size: 11px; }
.boite-deplacer .pied .bouton-principal:disabled { opacity: .5; }

/* ------------------------------------------------------------ la question avant de vider la corbeille */
.fenetre-confirmer .question { margin: 0 0 4px; font-size: 13px; line-height: 1.5; }
.bouton-danger, .pied .bouton-danger { padding: 6px 14px; border: 1px solid var(--danger); border-radius: 4px; background: var(--danger); color: var(--fond); }

/* ------------------------------------------------------------ la petite fenêtre « Partager » */
.fenetre { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; background: #00000066; }
.boite { width: min(470px, 100%); padding: 16px; background: var(--fond); border: 1px solid var(--trait); border-radius: 8px; box-shadow: 0 10px 30px #00000040; }
.boite h2 { margin: 0 0 6px; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.aide, .note-locale { margin: 0 0 10px; color: var(--gris); font-size: 11px; }
.note-locale { margin: 10px 0 0; }
.ligne-lien { display: flex; gap: 6px; }
.champ-lien { flex: 1; min-width: 0; padding: 6px 8px; border: 1px solid var(--trait); border-radius: 4px; background: var(--doux); font-size: 12px; }
.bouton-principal { padding: 6px 14px; border: 0; border-radius: 4px; background: var(--accent); color: var(--fond); white-space: nowrap; }
.pied { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.pied button { padding: 6px 10px; border: 1px solid var(--trait); border-radius: 4px; background: transparent; }
.pied .couper-ce-lien { display: flex; align-items: center; gap: 6px; padding-left: 0; border: 0; color: var(--danger); }
.couper-ce-lien .ic { width: 14px; height: 14px; }

/* ------------------------------------------------------------ le téléphone et les petits écrans */
@media (max-width: 760px) {
  .onglet { padding: 10px 8px; }
  .action span { display: none; }            /* les boutons gardent leur dessin, sans le texte */
}
@media (max-width: 600px) {
  .haut { flex-wrap: wrap; }
  .recherche { order: 3; width: 100%; margin: 0; }
  .avatar { margin-left: auto; }
  .onglets { padding: 4px 5px; gap: 2px; overflow-x: auto; }
  .onglet { top: 0; border: 0; border-radius: 4px; padding: 8px; font-size: 11px; }
  .onglet .ic { display: none; }
  .ajouter { margin-left: 0; margin-bottom: 0; }
  .commandes { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .adresse { flex-shrink: 0; }
  .menu-ajouter { right: auto; left: 0; }
  .liste .col-type, .liste .col-taille { width: 0 !important; }
  .liste th:nth-child(3), .liste td:nth-child(3), .liste th:nth-child(4), .liste td:nth-child(4) { display: none; }
  .poignee { display: none; }
  .liste .col-date { width: 132px; }
}
@media (max-width: 380px) {
  .liste .col-date { width: 0 !important; }
  .liste th:nth-child(2), .liste td:nth-child(2) { display: none; }
  .onglet { font-size: 11px; }
}
/* au doigt : des cibles plus grandes */
@media (pointer: coarse) {
  button { min-height: 44px; }
  .fichier { min-height: 36px; }
  input { font-size: 16px !important; }
}

/* ------------------------------------------------------------ la page de connexion */
.page-connexion { min-height: 100dvh; display: grid; place-items: center; padding: 16px; background: var(--doux); }
.carte-connexion { width: min(360px, 100%); padding: 22px; background: var(--fond); border: 1px solid var(--trait); border-radius: 8px; box-shadow: 0 10px 30px #0000001a; }
.carte-connexion .marque { margin-bottom: 18px; }
.carte-connexion h1 { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
.carte-connexion form { display: grid; gap: 11px; }
.carte-connexion label { display: grid; gap: 4px; color: var(--gris); font-size: 11px; }
.carte-connexion input:not([type="checkbox"]) { padding: 7px 9px; border: 1px solid var(--trait); border-radius: 4px; background: var(--fond); color: var(--encre); font-size: 13px; }
.carte-connexion .case { display: flex; align-items: center; gap: 7px; color: var(--encre); font-size: 12px; }
.carte-connexion .petit, .carte-connexion .nouvelle-cle { margin: -5px 0 0; color: var(--gris); font-size: 11px; }
.carte-connexion .nouvelle-cle p { margin: 0 0 6px; }
.carte-connexion .nouvelle-cle b { color: var(--encre); font-weight: 600; }
.carte-connexion .cle-a-recopier { color: var(--encre); font-family: Consolas, monospace; font-size: 12px; user-select: all; }
.qr svg { display: block; width: 190px; height: 190px; margin: 4px auto 8px; border-radius: 4px; }
.lien-bouton { min-height: 0 !important; padding: 0; border: 0; background: none; color: var(--accent); text-decoration: underline; font-size: 11px; }
.carte-connexion .bouton-principal { padding: 9px; font-size: 13px; }
.carte-connexion .bouton-principal:disabled { opacity: .6; }
.carte-connexion .erreur { margin: 12px 0 0; color: var(--danger); font-size: 12px; }
.carte-connexion .erreur:empty { display: none; }
