/* © 2026 DYONYSOS SASU (Omnifloo) — tous droits réservés. Licence propriétaire Omnifloo : voir site/LICENSE.
   Documents (lot OFF-DOCS) : arborescence, liste, dépôt glisser-déposer, aperçu. */
.docs .wrap { max-width: 1180px; }
.docs-etat { min-height: 1.4em; color: var(--gris); }
.docs-grille { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }
.docs-cote { background: var(--blanc); border: 1px solid var(--ligne); border-radius: 12px; padding: 14px; }
.docs-t-cote { font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--gris2); margin: 0 0 8px; }
.docs-arbo, .docs-arbo ul { list-style: none; margin: 0; padding-left: 14px; }
.docs-arbo { padding-left: 0; max-height: 46vh; overflow: auto; }
.docs-arbo-bouton { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 5px 8px; border-radius: 8px; color: var(--texte2); cursor: pointer; font-size: .95rem; }
.docs-arbo-bouton:hover { background: var(--surface3); }
.docs-arbo-bouton.courant { background: var(--accent-fond); color: var(--lien-fort); font-weight: 600; }
.docs-quota { margin-top: 16px; border-top: 1px solid var(--ligne); padding-top: 12px; }
.docs-quota-barre { height: 8px; background: var(--surface3); border-radius: 6px; overflow: hidden; }
#docs-quota-plein { height: 100%; width: 0; background: var(--bleu2); border-radius: 6px; }
.docs-quota-texte { font-size: .82rem; color: var(--gris); margin: 6px 0 0; }
.docs-fil { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; margin-bottom: 12px; }
.docs-fil-bouton { background: none; border: 0; color: var(--lien); cursor: pointer; font-size: .95rem; padding: 2px 4px; border-radius: 6px; }
.docs-fil-bouton:hover { text-decoration: underline; }
.docs-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.docs-nouveaux { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.docs-nouveaux-titre { font-weight: 600; color: var(--texte2); margin-right: 2px; }
.docs-recents { margin-bottom: 14px; }
.docs-recents .docs-ligne { background: var(--blanc); border-color: var(--ligne); }
.docs-recherche { display: flex; gap: 8px; flex: 1; min-width: 240px; }
.docs-recherche input[type="search"] { flex: 1; min-width: 120px; padding: 8px 10px; border: 1px solid var(--ligne2); border-radius: 10px; background: var(--blanc); color: var(--encre); }
.docs-recherche select { padding: 8px 10px; border: 1px solid var(--ligne2); border-radius: 10px; background: var(--blanc); color: var(--encre); }
.docs-depot { border: 2px dashed var(--ligne2); border-radius: 14px; padding: 18px; background: var(--surface2); }
.docs-depot.survol { border-color: var(--bleu3); background: var(--accent-fond); }
.docs-depot-indice { margin: 0 0 10px; color: var(--gris2); font-size: .9rem; }
.docs-liste { list-style: none; margin: 0; padding: 0; }
.docs-ligne { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid transparent; }
.docs-ligne:hover { background: var(--blanc); border-color: var(--ligne); }
.docs-dossier { cursor: pointer; font-weight: 600; }
.docs-icone { font-size: 1.2rem; }
.docs-nom { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--encre); }
.docs-meta { color: var(--gris2); font-size: .82rem; white-space: nowrap; }
.docs-actions-ligne { display: flex; gap: 6px; }

/* Menus « … » (barre d'actions et lignes de fichiers), toutes largeurs : les règles n'existaient que sous 760 et 480 px,
   si bien qu'au-delà les listes restaient dépliées en puces sous chaque fichier. Fermés par défaut, ouverts par .show. */
.docs-actions-menu, .docs-actions-menu-ligne { position: relative; display: inline-block; }
.docs-actions-menu-liste, .docs-actions-menu-ligne-liste {
  display: none; position: absolute; right: 0; top: 100%; z-index: 70; min-width: 170px; margin: 4px 0 0; padding: 4px 0;
  list-style: none; background: var(--blanc); border: 1px solid var(--ligne); border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.docs-actions-menu-liste.show, .docs-actions-menu-ligne-liste.show { display: block; }
.docs-actions-menu-liste .btn, .docs-actions-menu-ligne-liste .btn, .docs-actions-menu-ligne-liste a.btn {
  display: block; width: 100%; text-align: left; padding: 6px 12px; border: 0; border-radius: 0; background: none;
}
.docs-actions-menu-liste .btn:hover, .docs-actions-menu-ligne-liste .btn:hover, .docs-actions-menu-ligne-liste a.btn:hover {
  background: var(--surface3);
}
.docs-vide { color: var(--gris); }
.docs-progression { color: var(--lien-fort); font-size: .9rem; }
.docs-connexion { margin-top: 18px; }
.docs-modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); display: flex; align-items: center; justify-content: center; z-index: 60; padding: 18px; }
.docs-modal[hidden] { display: none; }
.docs-modal-carte { background: var(--blanc); border-radius: 14px; max-width: 960px; width: 100%; max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; }
.docs-modal-tete { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--ligne); }
.docs-modal-corps { padding: 16px; overflow: auto; text-align: center; }
.docs-modal-corps img { max-width: 100%; height: auto; }
.docs-modal-corps iframe { width: 100%; height: 70vh; border: 0; }
.docs-partage-corps { text-align: left; }
.docs-partage-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.docs-partage-form label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; color: var(--texte2); }
.docs-partage-form label[hidden] { display: none; }
.docs-modal label.docs-case { display: flex; flex-direction: row; align-items: center; gap: 8px; }
.docs-modal label.docs-case[hidden] { display: none; }
.docs-modal label.docs-case input[type="checkbox"] { width: 16px; height: 16px; flex: none; margin: 0; }
.docs-partage-form input, .docs-partage-form select { padding: 8px 10px; border: 1px solid var(--ligne2); border-radius: 10px; background: var(--blanc); color: var(--encre); }
.docs-partage-resultat { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--ok-fond); border: 1px solid var(--ok-bord); border-radius: 10px; padding: 10px; }
.docs-partage-resultat[hidden] { display: none; }
.docs-partage-resultat a { color: var(--lien-fort); word-break: break-all; }
.docs-partage-titre-liste { font-size: .95rem; margin: 14px 0 6px; }
.docs-partage-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.docs-partage-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 1px solid var(--ligne); border-radius: 10px; padding: 8px 10px; font-size: .88rem; }
@media (max-width: 760px) {
  .docs-grille { grid-template-columns: 1fr; }
  .docs-cote { order: 2; }
  .docs-arbo { max-height: 24vh; }
  .docs-meta { display: none; }
  .docs-actions-ligne .btn { padding: 4px 8px; font-size: .82rem; }
}

/* C4 : Correction du débordement horizontal en mobile */
@media (max-width: 760px) {
  /* Barre d'actions principale - replier dans menu */
  .docs-actions {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  /* Masquer les boutons qui seront dans le menu */
  .docs-actions #docs-corbeille-btn {
    display: none;
  }
  
  /* Menu déroulant pour les actions principales */
  .docs-actions-menu {
    position: relative;
    display: inline-block;
  }
  
  .docs-actions-menu-btn {
    padding: 8px 12px;
    font-size: .9rem;
  }
  
  .docs-actions-menu-liste {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--blanc);
    border: 1px solid var(--ligne);
    border-radius: 10px;
    min-width: 160px;
    z-index: 70;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }
  
  .docs-actions-menu-liste.show {
    display: block;
  }
  
  .docs-actions-menu-liste .btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    border: 0;
    border-radius: 0;
  }
  
  .docs-actions-menu-liste .btn:hover {
    background: var(--surface3);
  }
  
  /* Replier les actions de ligne dans un menu */
  .docs-actions-ligne {
    display: none;
  }
  
  .docs-actions-principales {
    flex-wrap: nowrap;
    gap: 6px;
  }
  
  .docs-actions-principales .btn {
    flex-shrink: 0;
  }
}

@media (max-width: 480px) {
  /* Pour mobile étroit (360px et 390px) */
  .docs-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  .docs-actions form {
    order: 1;
  }
  
  /* Masquer la plupart des boutons dans la ligne, garder seulement Partager et un menu */
  .docs-ligne .docs-actions-ligne {
    display: none;
  }
  
  .docs-ligne .docs-actions-principales {
    display: flex;
    gap: 6px;
  }
  
  /* Menu déroulant pour les actions de la ligne */
  .docs-ligne .docs-actions-menu-ligne {
    position: relative;
    display: inline-block;
  }
  
  .docs-ligne .docs-actions-menu-ligne-btn {
    padding: 4px 8px;
    font-size: .82rem;
  }
  
  .docs-ligne .docs-actions-menu-ligne-liste {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--blanc);
    border: 1px solid var(--ligne);
    border-radius: 8px;
    min-width: 140px;
    z-index: 70;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  }
  
  .docs-ligne .docs-actions-menu-ligne-liste.show {
    display: block;
  }
  
  .docs-ligne .docs-actions-menu-ligne-liste .btn,
  .docs-ligne .docs-actions-menu-ligne-liste a.btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 6px 8px;
    font-size: .82rem;
    border: 0;
    border-radius: 0;
  }
  
  .docs-ligne .docs-actions-menu-ligne-liste .btn:hover,
  .docs-ligne .docs-actions-menu-ligne-liste a.btn:hover {
    background: var(--surface3);
  }
  
  /* Voile sombre pleine largeur */
  .docs-modal {
    width: 100%;
    left: 0;
    right: 0;
  }
  
  /* Assurer que le document ne déborde pas */
  .docs-principal {
    overflow-x: hidden;
  }
}

/* C4 : Corrections supplémentaires pour mobile très étroit (360px et 390px) */
@media (max-width: 480px) {
  .docs-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  .docs-actions form {
    width: 100%;
  }
  
  .docs-actions .docs-recherche {
    flex-direction: column;
    gap: 6px;
  }
  
  .docs-actions .docs-recherche input[type="search"] {
    width: 100%;
  }
  
  .docs-actions .docs-recherche select {
    width: 100%;
  }
  
  /* Pour les lignes de fichiers, garder seulement les actions principales */
  .docs-actions-principales {
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  
  /* Assurer que le nom du fichier ne déborde pas */
  .docs-nom {
    max-width: 40vw;
  }
}

/* Écrans étroits (≤ 480 px) : le nom du fichier occupait 0 px, écrasé par les boutons de la ligne (parcours e2e MEGA-03,
   390 px). Le nom prend sa propre ligne, les actions passent dessous. */
@media (max-width: 480px) {
  .docs-ligne { flex-wrap: wrap; }
  .docs-ligne .docs-nom { flex: 1 1 calc(100% - 40px); max-width: none; }
}
