:root {
  --fond: #f6f7f9; --surface: #ffffff; --bord: #dfe3e8; --texte: #1b1f24; --doux: #5b6672;
  --accent: #1f6feb; --accent-texte: #ffffff; --danger: #c62828; --ok: #2e7d32; --survol: #eef3fc;
  --ombre: 0 2px 10px rgba(0,0,0,.08);
}
@media (prefers-color-scheme: dark) {
  :root { --fond: #0f1216; --surface: #171b21; --bord: #2a3038; --texte: #e6e9ed; --doux: #9aa5b1;
    --accent: #4c8dff; --survol: #1d2632; --danger: #ef5350; --ok: #66bb6a; --ombre: 0 2px 10px rgba(0,0,0,.4); }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fond); color: var(--texte);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--bord); background: var(--surface); border-radius: 8px;
  padding: 7px 12px; white-space: nowrap; }
button:hover { background: var(--survol); }
button.principal { background: var(--accent); color: var(--accent-texte); border-color: var(--accent); }
button.danger { color: var(--danger); }
button:disabled { opacity: .45; cursor: default; }
input[type=text], input[type=password], input[type=number], select {
  border: 1px solid var(--bord); background: var(--fond); border-radius: 8px; padding: 8px 10px; width: 100%; }
a { color: var(--accent); }
.attente { padding: 40px; text-align: center; color: var(--doux); }
.cache { display: none !important; }

/* En-tête */
header.barre { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--surface);
  border-bottom: 1px solid var(--bord); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.marque { font-weight: 700; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.marque img { width: 24px; height: 24px; }
nav.onglets { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
nav.onglets button { border-color: transparent; }
nav.onglets button.actif { background: var(--survol); border-color: var(--bord); font-weight: 600; }
.disque { min-width: 170px; font-size: 12px; color: var(--doux); }
.jauge { height: 6px; background: var(--bord); border-radius: 3px; overflow: hidden; margin-top: 3px; }
.jauge > div { height: 100%; background: var(--accent); }
main { padding: 16px; max-width: 1200px; margin: 0 auto; }

/* Explorateur */
.fil { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; margin-bottom: 10px; font-size: 14px; }
.fil button { border: 0; background: none; padding: 4px 6px; color: var(--accent); }
.fil span { color: var(--doux); }
.outils { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.liste { background: var(--surface); border: 1px solid var(--bord); border-radius: 10px; overflow: hidden; }
.ligne { display: grid; grid-template-columns: 34px 1fr 110px 150px; align-items: center; gap: 8px;
  padding: 8px 12px; border-top: 1px solid var(--bord); }
.ligne:first-child { border-top: 0; }
.ligne.entete { font-size: 12px; color: var(--doux); text-transform: uppercase; letter-spacing: .4px; }
.ligne.choisie { background: var(--survol); }
.ligne .nom { display: flex; gap: 8px; align-items: center; min-width: 0; }
.ligne .nom button { border: 0; background: none; padding: 0; text-align: left; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; color: var(--texte); }
.ligne .nom button:hover { text-decoration: underline; }
.ligne .petit { font-size: 13px; color: var(--doux); text-align: right; }
.icone { width: 20px; text-align: center; flex: none; }
.vide { padding: 30px; text-align: center; color: var(--doux); }
.depot-survol { outline: 3px dashed var(--accent); outline-offset: -6px; }
.lecture-seule { font-size: 13px; color: var(--doux); margin-bottom: 8px; }

/* Téléversements */
.envois { position: fixed; right: 16px; bottom: 16px; width: min(380px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--bord); border-radius: 10px; box-shadow: var(--ombre);
  max-height: 50vh; overflow: auto; z-index: 10; }
.envois h3 { margin: 0; padding: 10px 12px; font-size: 14px; display: flex; justify-content: space-between;
  align-items: center; border-bottom: 1px solid var(--bord); }
.envoi { padding: 8px 12px; font-size: 13px; border-bottom: 1px solid var(--bord); }
.envoi .jauge > div.ok { background: var(--ok); }
.envoi .jauge > div.ko { background: var(--danger); }
.envoi .err { color: var(--danger); }

/* Tableaux */
table.tableau { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--bord);
  border-radius: 10px; overflow: hidden; font-size: 14px; }
table.tableau th, table.tableau td { text-align: left; padding: 8px 10px; border-top: 1px solid var(--bord);
  vertical-align: top; }
table.tableau th { font-size: 12px; color: var(--doux); text-transform: uppercase; border-top: 0; }
.mot { word-break: break-all; }
.etat-actif { color: var(--ok); } .etat-expire, .etat-revoque { color: var(--doux); }
.issue-refus, .issue-echec { color: var(--danger); }

/* Boîtes */
dialog { border: 1px solid var(--bord); border-radius: 12px; background: var(--surface); color: var(--texte);
  padding: 20px; width: min(460px, calc(100vw - 32px)); box-shadow: var(--ombre); }
dialog::backdrop { background: rgba(0,0,0,.45); }
dialog h2 { margin: 0 0 14px; font-size: 18px; }
.champ { margin-bottom: 12px; }
.champ label { display: block; font-size: 13px; color: var(--doux); margin-bottom: 4px; }
.case { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.url { display: flex; gap: 6px; }
.url input { font-family: ui-monospace, monospace; font-size: 13px; }
.note { font-size: 13px; color: var(--doux); }
.erreur { color: var(--danger); font-size: 14px; margin: 8px 0; }

/* Connexion et page de lien */
.carte { max-width: 440px; margin: 60px auto; background: var(--surface); border: 1px solid var(--bord);
  border-radius: 14px; padding: 26px; box-shadow: var(--ombre); }
.carte h1 { margin: 0 0 6px; font-size: 22px; }
.carte .grand { width: 100%; padding: 11px; margin-top: 8px; }
.separateur { text-align: center; color: var(--doux); font-size: 13px; margin: 18px 0 10px; }
.zone-depot { border: 2px dashed var(--bord); border-radius: 12px; padding: 26px; text-align: center;
  color: var(--doux); margin: 14px 0; }
.zone-depot.depot-survol { border-color: var(--accent); outline: 0; }
.page-lien { max-width: 900px; margin: 0 auto; padding: 16px; }
.langue { position: fixed; top: 10px; right: 12px; width: auto; z-index: 20; }
header.barre .langue { position: static; }

@media (max-width: 640px) {
  .ligne { grid-template-columns: 30px 1fr 80px; }
  .ligne .date { display: none; }
  .disque { min-width: 0; width: 100%; order: 3; }
  main { padding: 10px; }
  table.tableau .large { display: none; }
}
