/* Partage — share.maegur.com
   Sobre et lisible : une seule couleur d'accent, clair ou sombre selon le système. */

:root {
  --fond: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --trait: #d9dee6;
  --encre: #1c232d;
  --encre-douce: #5d6877;
  --accent: #2f6fde;
  --accent-encre: #ffffff;
  --accent-doux: #e3ecfc;
  --danger: #c4372b;
  --succes: #1f8a5b;
  --rayon: 8px;
  --ombre: 0 8px 28px rgba(20, 30, 50, .16);
  --police: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #14181e;
    --surface: #1b2129;
    --surface-2: #232b35;
    --trait: #323c48;
    --encre: #e6eaf0;
    --encre-douce: #98a3b2;
    --accent: #6d9cf0;
    --accent-encre: #0d1a2e;
    --accent-doux: #1f2f4a;
    --danger: #ef7b6f;
    --succes: #5cc794;
    --ombre: 0 8px 28px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--fond); color: var(--encre); font: 15px/1.5 var(--police); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 .6em; }
h2 { font-size: 1.15rem; margin: 0 0 .8em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
main { max-width: 1100px; margin: 0 auto; padding: 1.25rem 1rem 6rem; }
.discret, .aide { color: var(--encre-douce); }
.aide { font-size: .9rem; }
[hidden] { display: none !important; }

/* ---- Barre ---------------------------------------------------------------------------------- */
.barre {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: .6rem 1rem; background: var(--surface); border-bottom: 1px solid var(--trait);
}
.marque { font-weight: 700; font-size: 1.1rem; color: var(--encre); }
.marque:hover { text-decoration: none; }
.barre nav { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; font-size: .92rem; }
.barre nav a { color: var(--encre-douce); }
.barre nav a:hover { color: var(--encre); text-decoration: none; }
.jauge { display: inline-flex; align-items: center; gap: .45rem; color: var(--encre-douce); font-size: .85rem; white-space: nowrap; }
.jauge progress { width: 90px; }
.flash { max-width: 1100px; margin: 1rem auto 0; padding: .6rem 1rem; background: var(--accent-doux); border-radius: var(--rayon); }

progress {
  appearance: none; height: 6px; border: 0; border-radius: 3px; background: var(--surface-2); overflow: hidden;
}
progress::-webkit-progress-bar { background: var(--surface-2); }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }

/* ---- Boutons et champs ---------------------------------------------------------------------- */
button, .bouton {
  font: inherit; font-size: .9rem; color: var(--encre); background: var(--surface);
  border: 1px solid var(--trait); border-radius: var(--rayon); padding: .4rem .85rem;
  cursor: pointer; display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap;
}
button:hover:not(:disabled), .bouton:hover { border-color: var(--accent); text-decoration: none; }
button:disabled { opacity: .45; cursor: not-allowed; }
.principal { background: var(--accent); border-color: var(--accent); color: var(--accent-encre); font-weight: 600; }
.principal:hover:not(:disabled) { filter: brightness(1.08); }
button.lien { background: none; border: 0; padding: 0; color: var(--accent); }
button.lien:hover { text-decoration: underline; }
.danger, button.danger, button.lien.danger { color: var(--danger); }
form.inline { display: inline; }
input[type=text], input[type=password] {
  font: inherit; color: var(--encre); background: var(--surface); width: 100%;
  border: 1px solid var(--trait); border-radius: var(--rayon); padding: .5rem .65rem;
}
input[type=checkbox] { accent-color: var(--accent); width: 1rem; height: 1rem; margin: 0; vertical-align: middle; }
.champ { display: flex; flex-direction: column; gap: .3rem; margin-bottom: 1rem; font-size: .9rem; color: var(--encre-douce); }
.champ input { color: var(--encre); font-size: 1rem; }
.option { display: flex; align-items: center; gap: .5rem; margin: .5rem 0 1rem; font-size: .9rem; }
.erreur { color: var(--danger); }

/* ---- Connexion ------------------------------------------------------------------------------ */
.connexion { max-width: 380px; margin: 3rem auto; background: var(--surface); padding: 2rem;
  border: 1px solid var(--trait); border-radius: 12px; }
.connexion .soustitre { color: var(--encre-douce); margin-top: -.4rem; }
.connexion button.principal { width: 100%; justify-content: center; padding: .6rem; }
.connexion .aide { margin-top: 1.2rem; }

/* ---- Explorateur ---------------------------------------------------------------------------- */
.tete { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tete h1 { margin: 0; }
.ariane { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; font-size: 1.15rem; font-weight: 600; min-width: 0; }
.ariane a { color: var(--encre-douce); padding: .1rem .3rem; border-radius: 6px; }
.ariane .ici { padding: .1rem .3rem; border-radius: 6px; overflow-wrap: anywhere; }
.ariane .sep { color: var(--trait); }
.outils { display: flex; gap: .5rem; flex-wrap: wrap; }

.selection {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  padding: .5rem .75rem; margin-bottom: .75rem; background: var(--accent-doux); border-radius: var(--rayon);
}
#nb-selection { font-weight: 600; margin-right: .5rem; }

.liste { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); overflow: hidden; }
.liste th { text-align: left; font-weight: 600; font-size: .82rem; color: var(--encre-douce); padding: .55rem .75rem; border-bottom: 1px solid var(--trait); background: var(--surface-2); }
.liste th a { color: inherit; }
.liste td { padding: .5rem .75rem; border-bottom: 1px solid var(--trait); vertical-align: middle; }
.liste tbody tr:last-child td { border-bottom: 0; }
.liste tbody tr:hover { background: var(--surface-2); }
.liste tbody tr.choisi { background: var(--accent-doux); }
.liste tbody tr.survol, .ariane .survol { outline: 2px dashed var(--accent); outline-offset: -2px; background: var(--accent-doux); }
.col-coche { width: 2.5rem; }
.col-nom { overflow-wrap: anywhere; }
.col-nom a { color: var(--encre); }
.col-taille { width: 8rem; white-space: nowrap; color: var(--encre-douce); font-size: .9rem; }
.col-date { width: 9rem; white-space: nowrap; color: var(--encre-douce); font-size: .9rem; }
.liste .actions { white-space: nowrap; text-align: right; }
.liste .actions form + form { margin-left: .75rem; }
tr[draggable=true] { cursor: default; }

.vide { text-align: center; padding: 3rem 1rem; background: var(--surface); border: 1px dashed var(--trait); border-radius: var(--rayon); color: var(--encre-douce); }

/* Icônes : formes en masque SVG, couleur par type */
.ico { display: inline-block; width: 1.15rem; height: 1.15rem; margin-right: .55rem; vertical-align: -.2rem; background: var(--encre-douce);
  -webkit-mask: var(--forme) center / contain no-repeat; mask: var(--forme) center / contain no-repeat;
  --forme: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 2h8l5 5v13a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zm7 1.5V8h4.5z'/%3E%3C/svg%3E"); }
.ico-dossier { background: #e0a526;
  --forme: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 5a2 2 0 0 1 2-2h4.6l2 2.5H19a2 2 0 0 1 2 2V18a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3C/svg%3E"); }
.ico-image { background: #2e9e6b; }
.ico-video { background: #c2459a; }
.ico-audio { background: #8a5cd6; }
.ico-pdf { background: #d8483a; }
.ico-texte { background: #4a7bd0; }
.ico-archive { background: #9a7b4f; }

/* ---- Dépôt de fichiers ---------------------------------------------------------------------- */
#voile-depot {
  position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; pointer-events: none;
  background: color-mix(in srgb, var(--accent) 14%, transparent); border: 3px dashed var(--accent);
}
#voile-depot p { background: var(--surface); padding: 1rem 1.5rem; border-radius: var(--rayon); box-shadow: var(--ombre); font-weight: 600; }

/* ---- Panneau des envois --------------------------------------------------------------------- */
#panneau-envois {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 15; width: min(440px, calc(100vw - 2rem)); max-height: 55vh;
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--trait);
  border-radius: 12px; box-shadow: var(--ombre);
}
.panneau-tete { display: flex; align-items: center; gap: .75rem; padding: .7rem .9rem; border-bottom: 1px solid var(--trait); }
.panneau-tete strong { flex: 0 1 auto; font-size: .92rem; }
.panneau-tete progress { flex: 1; }
#envois-liste { list-style: none; margin: 0; padding: .3rem 0; overflow-y: auto; }
.envoi { display: grid; grid-template-columns: 1fr auto; gap: .15rem .75rem; padding: .45rem .9rem; font-size: .85rem; }
.envoi-nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.envoi progress { grid-column: 1; width: 100%; }
.envoi-etat { grid-column: 1; color: var(--encre-douce); font-size: .8rem; }
.envoi button { grid-column: 2; grid-row: 1 / span 3; align-self: center; font-size: .8rem; }
.envoi.fini .envoi-etat { color: var(--succes); }
.envoi.erreur .envoi-etat { color: var(--danger); }
.envoi.annule, .envoi.ignore { opacity: .6; }
.envoi.fini progress, .envoi.annule progress, .envoi.ignore progress { display: none; }

/* ---- Boîtes de dialogue --------------------------------------------------------------------- */
dialog { border: 1px solid var(--trait); border-radius: 12px; background: var(--surface); color: var(--encre);
  padding: 1.4rem; width: min(460px, calc(100vw - 2rem)); box-shadow: var(--ombre); }
dialog::backdrop { background: rgba(10, 15, 25, .45); }
.boutons { display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.arbre { max-height: 50vh; overflow: auto; border: 1px solid var(--trait); border-radius: var(--rayon); padding: .4rem; }
.arbre ul { list-style: none; margin: 0; padding-left: 1.1rem; }
.arbre > ul { padding-left: 0; }
.arbre-ligne { display: flex; align-items: center; gap: .2rem; }
.arbre .bascule { border: 0; background: none; width: 1.4rem; padding: 0; justify-content: center; color: var(--encre-douce); }
.arbre-nom { border: 0; background: none; padding: .2rem .45rem; text-align: left; white-space: normal; overflow-wrap: anywhere; }
.arbre-nom.choisi { background: var(--accent); color: var(--accent-encre); }

/* ---- Messages ------------------------------------------------------------------------------- */
.messages { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 30; display: flex; flex-direction: column; gap: .4rem; align-items: center; pointer-events: none; }
.message { margin: 0; padding: .55rem 1rem; background: var(--encre); color: var(--fond); border-radius: var(--rayon); box-shadow: var(--ombre); max-width: min(560px, 92vw); white-space: pre-line; }
.message.erreur { background: var(--danger); color: #fff; }

/* ---- Petits écrans -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .col-date { display: none; }
  .col-taille { width: auto; }
  .liste td, .liste th { padding: .5rem .5rem; }
  .jauge progress { display: none; }
}

/* ---- Partages (lot 3) ----------------------------------------------------------------------- */
.pastille { display: inline-block; margin-left: .5rem; padding: 0 .45rem; border-radius: 999px; font-size: .72rem;
  line-height: 1.5; background: var(--accent-doux); color: var(--accent); vertical-align: .1rem; }
.info-partage { width: 100%; margin: -.4rem 0 0; color: var(--encre-douce); font-size: .9rem; }
.onglets { display: flex; gap: .25rem; background: var(--surface-2); padding: .25rem; border-radius: var(--rayon); }
.onglets a { padding: .35rem .8rem; border-radius: 6px; color: var(--encre-douce); }
.onglets a:hover { text-decoration: none; color: var(--encre); }
.onglets a[aria-current="page"] { background: var(--surface); color: var(--encre); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
select { font: inherit; color: var(--encre); background: var(--surface); border: 1px solid var(--trait);
  border-radius: var(--rayon); padding: .35rem .5rem; }
select[multiple] { width: 100%; padding: .25rem; }

#dlg-partage { width: min(540px, calc(100vw - 2rem)); }
.recherche-cible { position: relative; }
.suggestions { position: absolute; left: 0; right: 0; top: 100%; margin: -.6rem 0 0; z-index: 2; list-style: none; padding: .25rem;
  background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); box-shadow: var(--ombre); max-height: 16rem; overflow: auto; }
.suggestions li { padding: .4rem .6rem; border-radius: 6px; cursor: pointer; }
.suggestions li:hover, .suggestions li:focus { background: var(--accent-doux); outline: none; }
.suggestions li small { color: var(--encre-douce); }
.suggestions li.aucun { cursor: default; color: var(--encre-douce); }
.liste-partages { list-style: none; margin: .5rem 0 0; padding: 0; }
.liste-partages li { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; padding: .55rem 0; border-top: 1px solid var(--trait); }
.liste-partages .cible { flex: 1 1 10rem; font-weight: 600; overflow-wrap: anywhere; }
.liste-partages .droits { display: flex; gap: .75rem; align-items: center; font-size: .88rem; color: var(--encre-douce); flex-wrap: wrap; }
.liste-partages .droits label { display: inline-flex; align-items: center; gap: .3rem; color: var(--encre); }

/* ---- Administration ------------------------------------------------------------------------- */
.ligne-ajout { display: flex; gap: .5rem; }
.ligne-ajout input { min-width: 14rem; }
.grille-admin { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; margin-top: 1rem; align-items: start; }
.carte { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 1.1rem 1.2rem; }
.carte form + form, .carte form + p { margin-top: 1rem; }
.membres { list-style: none; margin: 0 0 1rem; padding: 0; }
.membres li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid var(--trait); }
code { font-size: .85em; background: var(--surface-2); padding: .05rem .3rem; border-radius: 4px; }
@media (max-width: 760px) {
  .grille-admin { grid-template-columns: 1fr; }
  .ligne-ajout { width: 100%; }
  .ligne-ajout input { min-width: 0; flex: 1; }
}

/* ---- Liens publics (lot 4) ------------------------------------------------------------------ */
.pastille-lien { background: color-mix(in srgb, var(--succes) 16%, transparent); color: var(--succes); }
#dlg-lien { width: min(620px, calc(100vw - 2rem)); }
#dlg-lien details { margin-top: .75rem; border: 1px solid var(--trait); border-radius: var(--rayon); padding: .6rem .9rem; }
#dlg-lien summary { cursor: pointer; font-weight: 600; }
#dlg-lien fieldset { border: 0; padding: 0; margin: .8rem 0 .3rem; }
#dlg-lien legend { font-size: .9rem; color: var(--encre-douce); padding: 0; margin-bottom: .2rem; }
#dlg-lien .option { margin: .25rem 0; }
#dlg-lien .ligne { display: flex; gap: .75rem; flex-wrap: wrap; }
#dlg-lien .ligne .champ { flex: 1 1 12rem; }
input[type=datetime-local], input[type=number] { font: inherit; color: var(--encre); background: var(--surface); width: 100%;
  border: 1px solid var(--trait); border-radius: var(--rayon); padding: .45rem .6rem; }
.liste-liens { list-style: none; margin: 0; padding: 0; }
.liste-liens li { padding: .6rem 0; border-bottom: 1px solid var(--trait); }
.liste-liens .lien-haut { display: flex; gap: .5rem; align-items: center; }
.liste-liens .lien-haut input { flex: 1; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .82rem; }
.liste-liens .lien-details { margin-top: .3rem; font-size: .82rem; color: var(--encre-douce); }
.liste-liens li:not(.lien-actif) { opacity: .6; }
.titre-section { margin-top: 2rem; }
.url-lien { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; min-width: 16rem; }
tr.inactif { opacity: .6; }

.page-lien main { max-width: 960px; }
.lien-carte { max-width: 640px; margin: 2rem auto; background: var(--surface); border: 1px solid var(--trait); border-radius: 12px; padding: 1.75rem; }
.lien-carte h1 { font-size: 1.35rem; overflow-wrap: anywhere; }
.lien-erreur { text-align: center; }
.apercu { display: block; max-width: 100%; max-height: 60vh; margin: 1rem auto; border-radius: var(--rayon); }
audio.apercu { width: 100%; }
.boutons-lien { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1.25rem; }
.zone-depot { margin: 1.25rem 0; padding: 2rem 1rem; text-align: center; border: 2px dashed var(--trait); border-radius: 12px; }
.zone-depot.survol { border-color: var(--accent); background: var(--accent-doux); }
.zone-depot .outils { justify-content: center; margin-top: .75rem; }
.envois-depot { list-style: none; margin: 0; padding: 0; }
.envois-depot .envoi { padding: .45rem 0; border-bottom: 1px solid var(--trait); }
.deposes { padding-left: 1.2rem; }
.lien-carte h2 { font-size: 1rem; margin-top: 1.5rem; }

/* ---- Lot 5 : grille, visionneuse, recherche ------------------------------------------------- */
.bascule-vue { display: inline-flex; border: 1px solid var(--trait); border-radius: var(--rayon); overflow: hidden; }
.bascule-vue button, .bascule-vue .bouton { border: 0; border-radius: 0; background: var(--surface); }
.bascule-vue [aria-pressed="true"] { background: var(--accent-doux); color: var(--accent); font-weight: 600; }
.bascule-vue > * + * { border-left: 1px solid var(--trait); }

.grille-tete { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; font-size: .88rem; color: var(--encre-douce); }
.grille-tete .option { margin: 0; }
.grille-tete a { color: var(--encre-douce); }
.grille-tete a[aria-sort] { color: var(--accent); font-weight: 600; }
.grille { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.grille .element { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--trait);
  border-radius: var(--rayon); overflow: hidden; }
.grille .element:hover { border-color: var(--accent); }
.grille .element.choisi { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-doux); }
.grille .element .coche { position: absolute; top: .45rem; left: .45rem; z-index: 1; }
.grille .vignette { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }
.grille .vignette img { width: 100%; height: 100%; object-fit: cover; }
.ico-grand { width: 3rem; height: 3rem; margin: 0; }
.grille .carte-nom { padding: .45rem .6rem 0; font-size: .88rem; color: var(--encre); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grille .carte-info { padding: 0 .6rem .5rem; font-size: .78rem; color: var(--encre-douce); }
.grille .carte-info .pastille { margin-left: .25rem; }
.grille .survol { outline: 2px dashed var(--accent); outline-offset: -2px; }
.surligne { animation: surligne 2.5s ease-out; }
@keyframes surligne { from { background: color-mix(in srgb, var(--accent) 30%, transparent); } to { background: transparent; } }

/* Visionneuse */
body.vis-ouverte { overflow: hidden; }
.visionneuse { position: fixed; inset: 0; z-index: 50; display: grid; grid-template-columns: 3.5rem 1fr 3.5rem; grid-template-rows: auto 1fr;
  background: #0b0d12; color: #eef1f5; }
.vis-barre { grid-column: 1 / -1; display: flex; align-items: center; gap: 1rem; padding: .6rem 1rem; }
.vis-titre { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.vis-compteur { color: #a8b0bc; font-size: .9rem; }
.vis-actions { display: flex; gap: .5rem; }
.visionneuse .bouton, .visionneuse .vis-fermer { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: #eef1f5; }
.vis-nav { align-self: center; justify-self: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; font-size: 1.6rem; line-height: 1;
  justify-content: center; background: rgba(255,255,255,.08); border: 0; color: #fff; }
.vis-nav:hover { background: rgba(255,255,255,.2); }
.vis-scene { display: flex; align-items: center; justify-content: center; min-height: 0; min-width: 0; padding: .5rem 0 1rem; outline: none; }
.vis-scene img, .vis-scene video { max-width: 100%; max-height: 100%; object-fit: contain; }
.vis-scene audio { width: min(600px, 100%); }
.vis-scene iframe { width: 100%; height: 100%; border: 0; background: #fff; border-radius: 4px; }
.vis-texte { width: 100%; max-width: 900px; height: 100%; overflow: auto; background: var(--surface); color: var(--encre); border-radius: var(--rayon); padding: 1.25rem 1.5rem; }
.vis-texte pre { margin: 0; font: .85rem/1.5 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.markdown { line-height: 1.6; }
.markdown h1, .markdown h2, .markdown h3 { margin: 1.2em 0 .5em; }
.markdown pre { background: var(--surface-2); padding: .75rem; border-radius: 6px; overflow: auto; }
.markdown blockquote { margin: 0; padding-left: 1rem; border-left: 3px solid var(--trait); color: var(--encre-douce); }
.markdown table { border-collapse: collapse; }
.markdown th, .markdown td { border: 1px solid var(--trait); padding: .3rem .6rem; }
@media (max-width: 640px) {
  .visionneuse { grid-template-columns: 0 1fr 0; }
  .vis-nav { display: none; }
  .vis-barre { flex-wrap: wrap; }
}

/* Recherche */
.recherche-barre input { width: 13rem; padding: .35rem .6rem; font-size: .88rem; border-radius: 999px; }
input[type=search] { font: inherit; color: var(--encre); background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: .5rem .65rem; }
.form-recherche { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.form-recherche input[type=search] { flex: 1 1 18rem; }
@media (max-width: 640px) { .recherche-barre { order: 3; width: 100%; } .recherche-barre input { width: 100%; } }

/* ---- Lot 6 : versions, espace, quotas ------------------------------------------------------- */
.pastille-versions { background: var(--surface-2); color: var(--encre-douce); }
.pastille-alerte { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
#dlg-versions { width: min(680px, calc(100vw - 2rem)); }
.liste-versions td, .liste-versions th { padding: .45rem .6rem; font-size: .9rem; }
.liste-versions .version-actuelle td { background: var(--accent-doux); }
.actions-version { display: inline-flex; gap: .75rem; flex-wrap: wrap; justify-content: flex-end; width: 100%; }
a.jauge { text-decoration: none; }
a.jauge:hover { color: var(--encre); }
.jauge-large { width: 100%; height: 10px; border-radius: 5px; margin: .25rem 0 .75rem; }
.occupation-total { font-size: 1.05rem; margin: 0 0 .25rem; }
.detail-occupation { width: 100%; border-collapse: collapse; margin: .5rem 0 1rem; }
.detail-occupation th { text-align: left; font-weight: normal; color: var(--encre-douce); padding: .35rem 0; }
.detail-occupation td { padding: .35rem 0; text-align: right; }
.detail-occupation td + td { width: 11rem; }
.form-quota { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; }
.form-quota input { width: 5rem; padding: .35rem .5rem; }
.table-utilisateurs progress { width: 7rem; }

/* ---- Lot 7 : administration ---- */
.onglets-admin { margin: 0 0 1.25rem; display: flex; gap: .25rem; flex-wrap: wrap; border-bottom: 1px solid var(--trait); }
.onglets-admin a { padding: .5rem .7rem; color: var(--encre-douce); border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: .92rem; }
.onglets-admin a:hover { color: var(--encre); text-decoration: none; }
.onglets-admin a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.tuile { display: flex; flex-direction: column; gap: .25rem; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: .9rem 1rem; color: var(--encre); }
a.tuile:hover { border-color: var(--accent); text-decoration: none; }
.tuile-titre { font-size: .8rem; color: var(--encre-douce); text-transform: uppercase; letter-spacing: .03em; }
.tuile-valeur { font-size: 1.45rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.tuile-detail { font-size: .8rem; color: var(--encre-douce); }
.tuile progress { width: 100%; }
.grille-admin > div > .carte + .carte { margin-top: 1rem; }
.carte-alerte { border-color: color-mix(in srgb, var(--danger) 45%, var(--trait)); margin-bottom: 1rem; }
.verifs { list-style: none; margin: .5rem 0 0; padding: 0; }
.verifs li { padding: .4rem 0 .4rem 1.4rem; border-top: 1px solid var(--trait); position: relative; font-size: .9rem; overflow-wrap: anywhere; }
.verifs li:first-child { border-top: 0; }
.verifs li::before { content: ''; position: absolute; left: .2rem; top: .8rem; width: .55rem; height: .55rem; border-radius: 50%; background: var(--trait); }
.verifs .verif-ok::before { background: var(--succes); }
.verifs .verif-alerte::before { background: #d08a12; }
.verifs .verif-erreur::before { background: var(--danger); }
.verifs .verif-info::before { background: var(--accent); }
.filtres-journal { display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: flex-end; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: .9rem 1rem 0; margin-bottom: 1rem; }
.filtres-journal .champ { margin-bottom: .9rem; }
.filtres-journal .case { display: inline-flex; align-items: center; gap: .35rem; margin-bottom: 1.4rem; font-size: .9rem; }
.filtres-boutons { display: flex; gap: .75rem; align-items: center; margin-bottom: .9rem; }
.filtre-actif { margin: -.25rem 0 1rem; font-size: .9rem; }
.table-journal td { font-size: .86rem; vertical-align: top; }
.table-journal .col-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.journal-details { color: var(--encre-douce); overflow-wrap: anywhere; }
.journal-details span { display: inline-block; margin-right: .6rem; }
.journal-details em { font-style: normal; color: var(--encre); opacity: .7; }
.pagination { display: flex; justify-content: space-between; margin: 1rem 0; }
.form-reglages .reglage { padding: .75rem 0; border-top: 1px solid var(--trait); display: flex; flex-direction: column; gap: .3rem; }
.form-reglages .reglage:first-of-type { border-top: 0; padding-top: 0; }
.form-reglages label { font-weight: 600; }
.reglage-saisie { display: flex; align-items: center; gap: .5rem; }
.reglage-saisie input { width: 8rem; }
.detail-occupation td.col-nom { overflow-wrap: anywhere; }
@media (max-width: 760px) { .table-journal th:nth-child(5), .table-journal td:nth-child(5) { display: none; } }
/* Grilles et tableaux d'administration : jamais plus larges que l'écran (défilement horizontal du tableau) */
.grille-admin { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 760px) {
  .grille-admin { grid-template-columns: minmax(0, 1fr); }
  .admin .liste { display: block; overflow-x: auto; }
}
.filtres-journal .champ input, .filtres-journal .champ select { height: 2.5rem; box-sizing: border-box; }
