/* ==========================================================================
   Téléchargements — feuille de style partagée (index, voir, créer, modifier, panel)
   Style « 3D net » : ombres dures sans aucun flou, rebords, formes géométriques.
   Police chargée sans bloquer l'affichage (bloc_assets.php).
   ========================================================================== */

.dl-app {
    --p1: #6e48aa;
    --p2: #9d50bb;
    --p3: #4b2c86;
    --pink: #e056b0;
    --amber: #ffb938;
    --ink: #221a36;
    --muted: #6d6585;
    --line: #e7ddf6;
    --soft: #f6f1fd;
    --card: #ffffff;
    --ok: #13a06c;
    --ok-dark: #0b7a51;
    --ok-soft: #e1f7ee;
    --danger: #e5484d;
    --danger-soft: #fdeceb;
    --warn-soft: #fff4dc;
    --radius: 20px;
    --ledge: #e2d4f6;              /* rebord sous les cartes */
    --ledge-hover: #cdb5f0;
    --grad: linear-gradient(135deg, #6e48aa 0%, #9d50bb 55%, #e056b0 100%);

    color: var(--ink);
    padding-bottom: 2.5rem;
    position: relative;
}
.dl-app, .dl-app * { font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif; }
.dl-app ::selection { background: #e7d7ff; color: var(--ink); }
.dl-app a { color: inherit; }
.dl-app h1, .dl-app h2, .dl-app h3 { border: none; margin: 0; padding: 0; }

/* ── Décor de fond : quadrillage + formes géométriques nettes ───────────── */
.dl-aurora {
    position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
    background-image:
        linear-gradient(rgba(110, 72, 170, .06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(110, 72, 170, .06) 1px, transparent 1px);
    background-size: 44px 44px;
}
.dl-aurora span { position: absolute; }
.dl-aurora span:nth-child(1) { /* anneau */
    width: 180px; height: 180px; border-radius: 50%; border: 14px solid rgba(157, 80, 187, .12);
    top: 12%; right: -50px;
}
.dl-aurora span:nth-child(2) { /* carré */
    width: 70px; height: 70px; border-radius: 16px; background: rgba(224, 86, 176, .12);
    bottom: 14%; left: 3%; transform: rotate(12deg);
}
.dl-aurora span:nth-child(3) { /* triangle */
    width: 0; height: 0; border-left: 46px solid transparent; border-right: 46px solid transparent;
    border-bottom: 80px solid rgba(255, 185, 56, .16);
    top: 55%; right: 6%;
}

/* ── Animations ─────────────────────────────────────────────────────────── */
@keyframes dl-up     { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes dl-pop    { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes dl-shake  { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes dl-stripes { to { background-position: 40px 0; } }
.dl-anim > * { animation: dl-up .5s cubic-bezier(.2, .8, .3, 1) both; }
.dl-anim > *:nth-child(2) { animation-delay: .06s; }
.dl-anim > *:nth-child(3) { animation-delay: .12s; }
.dl-anim > *:nth-child(4) { animation-delay: .18s; }
.dl-anim > *:nth-child(5) { animation-delay: .24s; }
.dl-anim > *:nth-child(n+6) { animation-delay: .3s; }
@media (prefers-reduced-motion: reduce) { .dl-app *, .dl-aurora * { animation: none !important; transition: none !important; } }

/* ── Fil d'Ariane / retour ──────────────────────────────────────────────── */
.dl-crumbs { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.3rem; font-size: .9rem; color: var(--muted); }
.dl-crumbs a { text-decoration: none; color: var(--p1); font-weight: 600; }
.dl-crumbs a:not(.dl-back):hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.dl-crumbs .sep { opacity: .45; font-weight: 700; }
.dl-back {
    display: inline-flex; align-items: center; gap: .45rem; text-decoration: none;
    background: var(--card); color: var(--p1) !important; font-weight: 700; font-size: .88rem;
    padding: .5rem 1.05rem .5rem .85rem; border-radius: 999px; border: 2px solid var(--line);
    box-shadow: 0 4px 0 var(--ledge); transition: transform .15s, box-shadow .15s;
}
.dl-back:hover  { transform: translate(-3px, -2px); box-shadow: 0 6px 0 var(--ledge-hover); text-decoration: none !important; }
.dl-back:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ledge); }

/* ── Bandeau (hero) ─────────────────────────────────────────────────────── */
.dl-hero {
    position: relative; overflow: hidden; isolation: isolate;
    background: linear-gradient(120deg, #4b2c86 0%, #6e48aa 32%, #9d50bb 64%, #e056b0 100%);
    color: #fff; border-radius: 28px; border: 3px solid #3c2370;
    padding: 2.6rem; margin-bottom: 2.2rem;
    display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap;
    box-shadow: 0 10px 0 #3c2370;
    animation: dl-pop .6s cubic-bezier(.2, .9, .3, 1.2) both;
}
/* Rayures diagonales nettes */
.dl-hero::before {
    content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: repeating-linear-gradient(-45deg, rgba(255,255,255,.07) 0 14px, transparent 14px 28px);
}
/* Anneaux concentriques (côté droit) */
.dl-hero::after {
    content: ''; position: absolute; z-index: -1; pointer-events: none;
    width: 340px; height: 340px; right: -90px; top: -120px; border-radius: 50%;
    border: 22px solid rgba(255,255,255,.12);
    box-shadow: 0 0 0 30px rgba(255,255,255,.06), 0 0 0 60px rgba(255,255,255,.04);
    border-top-color: rgba(255, 185, 56, .5);
}
.dl-hero-main { display: flex; align-items: center; gap: 1.3rem; min-width: 0; }
.dl-hero-icon {
    flex: none; width: 78px; height: 78px; border-radius: 22px; display: grid; place-items: center;
    font-size: 2.5rem; background: #fff; border: 3px solid #3c2370;
    box-shadow: 0 6px 0 #3c2370;
}
.dl-hero h1 {
    font-size: 2.3rem; font-weight: 800; line-height: 1.12; letter-spacing: -.03em; word-break: break-word;
    color: #fff; text-shadow: 0 3px 0 rgba(40, 15, 80, .35);
}
.dl-hero p  { color: rgba(255,255,255,.92); margin: .4rem 0 0; font-size: 1rem; font-weight: 500; }
.dl-hero-meta { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.dl-hero-meta span {
    background: rgba(255,255,255,.14); border: 2px solid rgba(255,255,255,.35);
    padding: .22rem .75rem; border-radius: 999px; font-size: .8rem; font-weight: 600;
}
.dl-hero-actions { display: flex; gap: .7rem; flex-wrap: wrap; }

/* ── Boutons (rebord qui s'enfonce au clic) ─────────────────────────────── */
.dl-btn {
    --btn-ledge: rgba(0,0,0,.18);
    position: relative; overflow: hidden; isolation: isolate;
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .72rem 1.35rem; border-radius: 14px; border: 2px solid transparent; cursor: pointer;
    font-size: .95rem; font-weight: 700; text-decoration: none !important; line-height: 1.2; white-space: nowrap;
    box-shadow: 0 4px 0 var(--btn-ledge);
    transition: transform .12s, box-shadow .12s, background-color .2s, color .2s;
}
.dl-btn:hover  { transform: translateY(-2px); box-shadow: 0 6px 0 var(--btn-ledge); }
.dl-btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--btn-ledge); }
.dl-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: 0 4px 0 var(--btn-ledge); }
.dl-btn:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
/* Reflet net qui balaie le bouton au survol */
.dl-btn::after {
    content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 40%; z-index: -1; pointer-events: none;
    background: rgba(255,255,255,.28); transform: translateX(-160%) skewX(-20deg); transition: transform .55s ease;
}
.dl-btn:hover::after { transform: translateX(320%) skewX(-20deg); }
.dl-btn-primary { background: var(--grad); color: #fff !important; border-color: var(--p3); --btn-ledge: var(--p3); }
.dl-btn-success { background: linear-gradient(135deg, #13a06c, #2bc48a); color: #fff !important; border-color: var(--ok-dark); --btn-ledge: var(--ok-dark); }
.dl-btn-white   { background: #fff; color: var(--p1) !important; border-color: #3c2370; --btn-ledge: #3c2370; }
.dl-btn-glass   { background: rgba(255,255,255,.14); color: #fff !important; border-color: rgba(255,255,255,.55); --btn-ledge: rgba(40,15,80,.45); }
.dl-btn-glass:hover { background: rgba(255,255,255,.24); }
.dl-btn-soft    { background: var(--soft); color: var(--p1) !important; border-color: var(--line); --btn-ledge: var(--ledge); }
.dl-btn-soft:hover { background: #efe5fc; }
.dl-btn-soft::after, .dl-btn-danger::after { background: rgba(157, 80, 187, .12); }
.dl-btn-danger  { background: var(--danger-soft); color: var(--danger) !important; border-color: #f7c9c9; --btn-ledge: #f3b5b5; }
.dl-btn-danger:hover { background: var(--danger); color: #fff !important; border-color: #b8282d; --btn-ledge: #b8282d; }
.dl-btn-sm { padding: .45rem .85rem; font-size: .82rem; border-radius: 11px; }
.dl-btn-lg { padding: .95rem 1.9rem; font-size: 1.05rem; border-radius: 16px; }
.dl-btn-block { width: 100%; }
.dl-inline-form { display: inline; margin: 0; }

/* ── Alertes ────────────────────────────────────────────────────────────── */
.dl-alert {
    display: flex; gap: .7rem; align-items: flex-start; padding: 1rem 1.25rem; border-radius: 16px;
    margin-bottom: 1.4rem; font-weight: 600; font-size: .95rem; border: 2px solid; animation: dl-pop .4s ease both;
}
.dl-alert-success { background: var(--ok-soft); color: #0b6a47; border-color: #a9e5cd; box-shadow: 0 4px 0 #a9e5cd; }
.dl-alert-error   { background: var(--danger-soft); color: #a3262a; border-color: #f5c0c0; box-shadow: 0 4px 0 #f5c0c0; }
.dl-alert-warning { background: var(--warn-soft); color: #8a5a00; border-color: #f5d898; box-shadow: 0 4px 0 #f5d898; }

/* ── Barre d'outils / recherche ─────────────────────────────────────────── */
.dl-toolbar { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 1.5rem; }
.dl-toolbar h2 { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; }
.dl-toolbar h2 small {
    display: inline-grid; place-items: center; min-width: 1.8em; height: 1.8em; padding: 0 .4em; margin-left: .4rem;
    background: var(--ink); color: #fff; border-radius: 999px; font-size: .75rem; font-weight: 700; vertical-align: middle;
}
.dl-search { position: relative; flex: 0 1 360px; }
.dl-search input {
    width: 100%; padding: .78rem 1rem .78rem 2.7rem; border-radius: 999px; border: 2px solid var(--line);
    background: var(--card); box-shadow: 0 4px 0 var(--ledge); font-size: .95rem; transition: border-color .15s, box-shadow .15s;
}
.dl-search input:focus { outline: none; border-color: var(--p2); box-shadow: 0 4px 0 var(--p2); }
.dl-search::before { content: '🔍'; position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); font-size: .9rem; }
.dl-no-result { display: none; text-align: center; color: var(--muted); padding: 2rem; font-weight: 600; }

/* ── Grilles ────────────────────────────────────────────────────────────── */
.dl-grid { display: grid; gap: 1.6rem 1.4rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.dl-grid-files { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
/* Rendu différé des cartes hors écran : page plus rapide avec beaucoup de fichiers */
.dl-grid > .dl-file { content-visibility: auto; contain-intrinsic-size: auto 300px; }

/* ── Carte dossier (une par personne) ───────────────────────────────────── */
.dl-folder {
    --hue: 270;
    position: relative; display: flex; flex-direction: column; gap: .95rem; text-decoration: none !important;
    background: var(--card); color: var(--ink) !important;
    border: 2px solid hsl(var(--hue) 50% 88%); border-radius: 6px var(--radius) var(--radius) var(--radius);
    padding: 1.4rem; margin-top: 16px;
    box-shadow: 0 6px 0 hsl(var(--hue) 50% 86%);
    transition: transform .2s, box-shadow .2s;
}
.dl-folder::before { /* onglet du dossier */
    content: ''; position: absolute; top: -18px; left: -2px; width: 44%; height: 18px;
    background: hsl(var(--hue) 58% 62%); border: 2px solid hsl(var(--hue) 50% 50%); border-bottom: none;
    border-radius: 12px 16px 0 0;
}
.dl-folder::after { /* liseré couleur */
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 6px;
    background: linear-gradient(90deg, hsl(var(--hue) 58% 58%), hsl(calc(var(--hue) + 45) 70% 64%));
    border-radius: 0 16px 0 0;
}
.dl-folder:hover  { transform: translateY(-6px); box-shadow: 0 12px 0 hsl(var(--hue) 50% 80%); }
.dl-folder:active { transform: translateY(2px); box-shadow: 0 2px 0 hsl(var(--hue) 50% 80%); }
.dl-folder-head { display: flex; align-items: center; gap: .9rem; }
.dl-avatar {
    flex: none; width: 54px; height: 54px; border-radius: 17px; display: grid; place-items: center;
    color: #fff; font-weight: 800; font-size: 1.4rem; text-transform: uppercase;
    background: linear-gradient(135deg, hsl(var(--hue) 58% 55%), hsl(calc(var(--hue) + 45) 70% 62%));
    border: 2px solid hsl(var(--hue) 50% 40%); box-shadow: 0 4px 0 hsl(var(--hue) 50% 40%);
}
.dl-folder-name { font-size: 1.15rem; font-weight: 800; line-height: 1.25; word-break: break-word; transition: color .2s; }
.dl-folder-sub { font-size: .8rem; color: var(--muted); }
.dl-folder-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.dl-stat {
    background: hsl(var(--hue, 270) 60% 97%); border: 2px solid hsl(var(--hue, 270) 50% 92%);
    border-radius: 13px; padding: .55rem .4rem; text-align: center;
}
.dl-stat b { display: block; font-size: 1.3rem; font-weight: 800; color: hsl(var(--hue, 270) 50% 40%); line-height: 1.2; }
.dl-stat span { font-size: .68rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.dl-folder-foot { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; color: var(--muted); }
.dl-folder-open {
    color: #fff; background: hsl(var(--hue) 50% 45%); font-weight: 700; padding: .2rem .7rem; border-radius: 999px;
    transition: transform .2s;
}
.dl-folder:hover .dl-folder-open { transform: translateX(4px); }
.dl-folder:hover .dl-folder-name { color: hsl(var(--hue) 50% 40%); }
.dl-tag-me {
    position: absolute; z-index: 2; top: -15px; right: 1rem;
    background: var(--amber); color: var(--ink); border: 2px solid var(--ink); box-shadow: 0 3px 0 var(--ink);
    font-size: .7rem; font-weight: 800; padding: .15rem .6rem; border-radius: 999px;
}
.dl-tag-admin {
    display: inline-block; background: linear-gradient(135deg, #f7971e, #ffd200); color: #3a2a00;
    border: 1.5px solid #b86b00; font-size: .62rem; font-weight: 800; padding: .08rem .45rem; border-radius: 999px;
    vertical-align: middle; margin-left: .3rem; letter-spacing: .04em; -webkit-text-fill-color: #3a2a00;
}

/* ── Carte fichier ──────────────────────────────────────────────────────── */
.dl-file {
    position: relative; display: flex; flex-direction: column; gap: .85rem; background: var(--card);
    border: 2px solid var(--line); border-radius: var(--radius); padding: 1.4rem;
    box-shadow: 0 6px 0 var(--ledge); transition: transform .2s, box-shadow .2s;
}
.dl-file:hover { transform: translateY(-5px); box-shadow: 0 11px 0 var(--ledge-hover); }
.dl-file-head { display: flex; gap: .9rem; align-items: flex-start; }
.dl-file-icon {
    flex: none; width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center;
    font-size: 1.65rem; background: var(--soft); border: 2px solid var(--line); box-shadow: 0 3px 0 var(--ledge);
}
.dl-file-title { font-size: 1.1rem; font-weight: 800; line-height: 1.3; word-break: break-word; }
.dl-file-title a { text-decoration: none; transition: color .2s; }
.dl-file:hover .dl-file-title a, .dl-file-title a:hover { color: var(--p1); }
.dl-file-desc {
    color: var(--muted); font-size: .9rem; line-height: 1.55; flex: 1;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.dl-chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.dl-chip {
    display: inline-flex; align-items: center; gap: .3rem; background: var(--soft); color: var(--p1);
    border: 1.5px solid var(--line); font-size: .74rem; font-weight: 700; padding: .18rem .62rem; border-radius: 999px;
}
.dl-chip-lock  { background: var(--ink); color: #fff; border-color: var(--ink); }
.dl-chip-free  { background: var(--ok-soft); color: var(--ok-dark); border-color: #aee6cf; }
.dl-chip-muted { background: #f4f2f8; color: var(--muted); border-color: #e9e5f0; }
.dl-file-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.dl-file-actions .dl-btn { flex: 1; }
.dl-file-owner { display: flex; gap: .5rem; border-top: 2px dashed var(--line); padding-top: .9rem; }
.dl-file-owner > * { flex: 1; }
.dl-file-owner .dl-btn { width: 100%; }

/* ── État vide ──────────────────────────────────────────────────────────── */
.dl-empty { text-align: center; background: var(--card); border: 2px dashed var(--ledge-hover); border-radius: 26px; padding: 3.5rem 2rem; }
.dl-empty .icon { font-size: 4.2rem; display: inline-block; }
.dl-empty h2 { font-size: 1.5rem; font-weight: 800; margin: .8rem 0 .3rem; }
.dl-empty p { color: var(--muted); margin-bottom: 1.5rem; }

/* ── Cartes de formulaire ───────────────────────────────────────────────── */
.dl-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 1.6rem; align-items: start; }
.dl-side { position: sticky; top: 1rem; display: flex; flex-direction: column; gap: 1.2rem; }
.dl-card {
    background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
    padding: 1.8rem; box-shadow: 0 6px 0 var(--ledge); margin-bottom: 1.6rem;
}
.dl-card-title { display: flex; align-items: center; gap: .85rem; margin-bottom: 1.4rem; }
.dl-card-title h2 { font-size: 1.2rem; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
.dl-card-title p { font-size: .85rem; color: var(--muted); margin: .1rem 0 0; }
.dl-step {
    flex: none; width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center;
    background: var(--grad); color: #fff; font-weight: 800; font-size: 1.05rem;
    border: 2px solid var(--p3); box-shadow: 0 4px 0 var(--p3);
}
.dl-field { margin-bottom: 1.2rem; }
.dl-field:last-child { margin-bottom: 0; }
.dl-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.dl-label { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; font-weight: 700; font-size: .9rem; margin-bottom: .45rem; color: var(--ink); }
.dl-label .opt { font-weight: 500; color: var(--muted); font-size: .78rem; }
.dl-label .req { color: var(--danger); }
.dl-counter { font-weight: 600; font-size: .75rem; color: var(--muted); }
.dl-input {
    width: 100%; padding: .8rem 1rem; border: 2px solid var(--line); border-radius: 13px;
    font-size: .98rem; background: #fdfcff; color: var(--ink); box-shadow: 0 3px 0 var(--line);
    transition: border-color .15s, box-shadow .15s, transform .15s, background-color .15s;
}
.dl-input:hover { border-color: var(--ledge-hover); }
.dl-input:focus { outline: none; border-color: var(--p2); background: #fff; box-shadow: 0 4px 0 var(--p2); transform: translateY(-1px); }
textarea.dl-input { resize: vertical; min-height: 130px; line-height: 1.55; }
select.dl-input { cursor: pointer; }
.dl-hint { font-size: .8rem; color: var(--muted); margin-top: .4rem; }
.dl-actions { display: flex; gap: .9rem; flex-wrap: wrap; align-items: center; }

/* ── Zone de dépôt (glisser-déposer) ───────────────────────────────────── */
.dl-drop {
    position: relative; border: 3px dashed #cdb5f0; border-radius: 22px;
    background:
        repeating-linear-gradient(-45deg, rgba(157, 80, 187, .04) 0 12px, transparent 12px 24px),
        #fbf8ff;
    padding: 2.3rem 1.5rem; text-align: center; transition: border-color .2s, background-color .2s, transform .2s; cursor: pointer;
}
.dl-drop:hover { border-color: var(--p2); }
.dl-drop:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
.dl-drop.is-over {
    border-style: solid; border-color: var(--pink);
    background:
        repeating-linear-gradient(-45deg, rgba(224, 86, 176, .10) 0 12px, transparent 12px 24px),
        #fdf0fa;
}
.dl-drop.is-error { border-color: var(--danger); animation: dl-shake .4s; }
.dl-drop-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dl-drop-icon { font-size: 3.2rem; line-height: 1; display: inline-block; }
.dl-drop-title { font-size: 1.15rem; font-weight: 800; margin-top: .7rem; }
.dl-drop-or { color: var(--muted); font-size: .85rem; font-weight: 600; margin: .5rem 0 .9rem; }
.dl-drop-buttons { display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; }
.dl-drop-note { font-size: .8rem; color: var(--muted); margin-top: 1.1rem; }
.dl-drop-selected { display: none; align-items: center; gap: 1rem; text-align: left; cursor: default; }
.dl-drop.has-file { border-style: solid; border-color: var(--ok); background: var(--ok-soft); padding: 1.2rem; cursor: default; box-shadow: 0 5px 0 #a9e5cd; }
.dl-drop.has-file .dl-drop-empty { display: none; }
.dl-drop.has-file .dl-drop-selected { display: flex; }
.dl-drop.has-file .dl-file-icon { background: #fff; border-color: #a9e5cd; box-shadow: 0 3px 0 #a9e5cd; animation: dl-pop .45s cubic-bezier(.2, .9, .3, 1.5) both; }
.dl-drop-selected .info { flex: 1; min-width: 0; }
.dl-drop-selected .name { font-weight: 800; word-break: break-all; }
.dl-drop-selected .meta { font-size: .82rem; color: var(--ok-dark); font-weight: 600; }
.dl-drop-selected .meta.warn { color: var(--danger); }
.dl-drop-busy { display: none; }
.dl-drop.is-busy .dl-drop-empty, .dl-drop.is-busy .dl-drop-selected { display: none; }
.dl-drop.is-busy .dl-drop-busy { display: block; }
.dl-drop-busy .dl-progress-bar { margin: 1rem auto 0; max-width: 360px; }

/* ── Barre de progression ───────────────────────────────────────────────── */
.dl-upload {
    display: none; margin-top: 1.3rem; background: var(--card); border: 2px solid var(--line);
    border-radius: 18px; padding: 1.1rem 1.3rem; box-shadow: 0 5px 0 var(--ledge);
}
.dl-upload.is-active { display: block; animation: dl-pop .35s ease both; }
.dl-upload-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .65rem; gap: 1rem; }
.dl-upload-label { font-weight: 700; }
.dl-upload-pct { font-size: 1.6rem; font-weight: 800; color: var(--p1); font-variant-numeric: tabular-nums; }
.dl-progress-bar { height: 18px; background: var(--soft); border: 2px solid var(--line); border-radius: 999px; overflow: hidden; }
.dl-progress-fill {
    height: 100%; width: 0; border-radius: 999px; transition: width .25s ease;
    background-image:
        repeating-linear-gradient(-45deg, rgba(255,255,255,.28) 0 10px, transparent 10px 20px),
        var(--grad);
    background-size: 40px 40px, 100% 100%; animation: dl-stripes .8s linear infinite;
}
.dl-upload-info { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; font-size: .82rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.dl-upload.is-done { border-color: #a9e5cd; box-shadow: 0 5px 0 #a9e5cd; }
.dl-upload.is-done .dl-progress-fill { background-image: linear-gradient(135deg, #13a06c, #2bc48a); animation: none; }
.dl-upload.is-done .dl-upload-pct { color: var(--ok); }

/* ── Barre « lancement du téléchargement » (en bas de l'écran) ──────────── */
.dl-launch {
    position: fixed; z-index: 1000; left: 50%; bottom: 1.4rem; width: min(420px, calc(100vw - 2rem));
    transform: translate(-50%, 140%); transition: transform .3s cubic-bezier(.2, .9, .3, 1.1);
    background: var(--card); color: var(--ink); border: 2px solid var(--ink); border-radius: 18px;
    box-shadow: 0 6px 0 var(--ink); padding: .9rem 1.1rem;
}
.dl-launch.is-visible { transform: translate(-50%, 0); }
.dl-launch-top { display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem; font-weight: 700; font-size: .92rem; }
.dl-launch-text { flex: 1; }
.dl-launch-pct { font-weight: 800; color: var(--p1); font-variant-numeric: tabular-nums; }
.dl-launch .dl-progress-bar { height: 14px; }
.dl-launch.is-delete { border-color: #b8282d; box-shadow: 0 6px 0 #b8282d; }
.dl-launch.is-delete .dl-launch-pct { color: var(--danger); }
.dl-launch.is-delete .dl-progress-fill { background-image: repeating-linear-gradient(-45deg, rgba(255,255,255,.28) 0 10px, transparent 10px 20px), linear-gradient(135deg, #e5484d, #f07a7e); }
.dl-launch.is-error { border-color: #b8282d; box-shadow: 0 6px 0 #b8282d; background: var(--danger-soft); }
.dl-launch.is-error .dl-progress-bar { display: none; }
.dl-launch.is-error .dl-launch-top { margin-bottom: 0; }
.dl-launch.is-done { border-color: var(--ok-dark); box-shadow: 0 6px 0 var(--ok-dark); }
.dl-launch.is-done .dl-launch-pct { color: var(--ok); }
.dl-launch.is-done .dl-progress-fill { background-image: linear-gradient(135deg, #13a06c, #2bc48a); animation: none; }

/* ── Interrupteur + mot de passe ────────────────────────────────────────── */
.dl-switch-row {
    display: flex; align-items: center; gap: 1rem; cursor: pointer; padding: 1rem 1.1rem; border-radius: 16px;
    background: var(--soft); border: 2px solid var(--line); user-select: none; transition: border-color .2s;
}
.dl-switch-row:hover { border-color: var(--ledge-hover); }
.dl-switch-row strong { display: block; font-size: .98rem; font-weight: 800; }
.dl-switch-row small { display: block; color: var(--muted); font-size: .82rem; }
.dl-switch { position: relative; flex: none; width: 56px; height: 32px; }
.dl-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.dl-switch-ui { position: absolute; inset: 0; background: #d9d2e6; border: 2px solid #bfb5d1; border-radius: 999px; transition: background .25s, border-color .25s; }
.dl-switch-ui::after {
    content: ''; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%;
    background: #fff; border: 2px solid #bfb5d1; transition: transform .25s cubic-bezier(.2, .9, .3, 1.4), border-color .25s;
}
.dl-switch input:checked + .dl-switch-ui { background: var(--grad); border-color: var(--p3); }
.dl-switch input:checked + .dl-switch-ui::after { transform: translateX(24px); border-color: var(--p3); }
.dl-switch input:focus-visible + .dl-switch-ui { outline: 3px solid var(--amber); outline-offset: 2px; }
.pwd-fields { margin-top: 1rem; animation: dl-up .3s ease both; }
.dl-pwd-wrap { display: flex; gap: .5rem; }
.dl-pwd-wrap .dl-input-box { position: relative; flex: 1; }
.dl-pwd-wrap .dl-input { padding-right: 3rem; font-family: 'Consolas', 'Courier New', monospace !important; letter-spacing: .06em; }
.dl-eye { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; font-size: 1.1rem; padding: .3rem; }
.dl-rules { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin: .85rem 0 0; padding: 0; }
.dl-rules li {
    font-size: .76rem; font-weight: 700; padding: .22rem .65rem; border-radius: 999px;
    background: #f4f2f8; border: 1.5px solid #e9e5f0; color: var(--muted); transition: all .2s;
}
.dl-rules li::before { content: '○ '; }
.dl-rules li.ok { background: var(--ok-soft); border-color: #aee6cf; color: var(--ok-dark); transform: translateY(-1px); }
.dl-rules li.ok::before { content: '✓ '; }
.dl-pwd-status { font-size: .82rem; font-weight: 600; margin-top: .6rem; color: var(--muted); }

/* ── Encadrés latéraux ──────────────────────────────────────────────────── */
.dl-tip { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 1.35rem; box-shadow: 0 6px 0 var(--ledge); font-size: .88rem; }
.dl-tip h3 { font-size: 1rem; font-weight: 800; margin-bottom: .65rem; }
.dl-tip ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .55rem; color: var(--muted); }
.dl-tip li { display: flex; gap: .5rem; }
.dl-tip-grad {
    position: relative; overflow: hidden; isolation: isolate;
    background: linear-gradient(135deg, #5b3a96, #9d50bb 60%, #e056b0); color: #fff;
    border-color: #3c2370; box-shadow: 0 6px 0 #3c2370;
}
.dl-tip-grad::before {
    content: ''; position: absolute; inset: 0; z-index: -1;
    background: repeating-linear-gradient(-45deg, rgba(255,255,255,.07) 0 12px, transparent 12px 24px);
}
.dl-tip-grad ul { color: rgba(255,255,255,.92); }
.dl-kv { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 2px dashed var(--line); font-size: .88rem; }
.dl-kv:last-child { border-bottom: none; }
.dl-kv span { color: var(--muted); }
.dl-kv b { text-align: right; word-break: break-word; }

/* ── Page voir : téléchargement + versions ──────────────────────────────── */
.dl-desc { line-height: 1.8; color: #3d3552; white-space: normal; word-break: break-word; }
.dl-download-box { text-align: center; border-color: #a9e5cd; box-shadow: 0 6px 0 #a9e5cd; }
.dl-download-box .big { font-size: 2.8rem; display: inline-block; }
.dl-download-box .dl-input { margin-bottom: .85rem; }
.dl-timeline { position: relative; list-style: none; margin: 0; padding: 0 0 0 1.7rem; }
.dl-timeline::before { content: ''; position: absolute; left: .5rem; top: .4rem; bottom: .4rem; width: 3px; border-radius: 3px; background: var(--line); }
.dl-timeline li { position: relative; padding: 0 0 1.35rem; }
.dl-timeline li:last-child { padding-bottom: 0; }
.dl-timeline li::before {
    content: ''; position: absolute; left: -1.7rem; top: .3rem; width: 16px; height: 16px; border-radius: 50%;
    background: #fff; border: 3px solid #cdb5f0;
}
.dl-timeline li.is-latest::before { border-color: var(--p3); background: var(--amber); box-shadow: 0 0 0 4px #efe5fc; }
.dl-tl-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.dl-tl-version { font-weight: 800; font-size: 1.05rem; }
.dl-tl-date { font-size: .8rem; color: var(--muted); font-weight: 500; }
.dl-tl-notes { color: var(--muted); font-size: .9rem; margin-top: .35rem; line-height: 1.55; }
.dl-tl-file { font-family: 'Consolas', 'Courier New', monospace !important; font-size: .78rem; color: var(--muted); margin-top: .3rem; word-break: break-all; }
.dl-badge-latest {
    background: var(--amber); color: var(--ink); border: 1.5px solid var(--ink); font-size: .66rem; font-weight: 800;
    padding: .1rem .5rem; border-radius: 999px; margin-left: .4rem; vertical-align: middle;
}

/* ── Panel admin ────────────────────────────────────────────────────────── */
.dl-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1.1rem; margin-bottom: 1.8rem; }
.dl-stats .dl-stat { background: var(--card); border: 2px solid var(--line); box-shadow: 0 6px 0 var(--ledge); padding: 1.2rem; border-radius: var(--radius); }
.dl-stats .dl-stat b { font-size: 2.2rem; color: var(--p1); }
.dl-table { width: 100%; border-collapse: collapse; }
.dl-table th, .dl-table td { padding: .85rem 1rem; text-align: left; border-bottom: 2px solid var(--soft); font-size: .9rem; }
.dl-table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 800; }
.dl-table tr:last-child td { border-bottom: none; }
.dl-table tbody tr { transition: background-color .15s; }
.dl-table tbody tr:hover td { background: #fbf8ff; }
.dl-table .empty td { text-align: center; color: var(--muted); font-style: italic; }
.dl-user { display: flex; align-items: center; gap: .7rem; font-weight: 700; }
.dl-user .dl-avatar { width: 38px; height: 38px; border-radius: 12px; font-size: .95rem; box-shadow: 0 3px 0 hsl(var(--hue) 50% 40%); }
.dl-table-wrap { overflow-x: auto; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .dl-layout { grid-template-columns: 1fr; }
    .dl-side { position: static; }
}
@media (max-width: 600px) {
    .dl-hero { padding: 1.7rem 1.4rem; border-radius: 22px; }
    .dl-hero::after { width: 220px; height: 220px; right: -80px; top: -90px; }
    .dl-hero h1 { font-size: 1.6rem; }
    .dl-hero-main { flex-direction: column; align-items: flex-start; }
    .dl-hero-icon { width: 60px; height: 60px; font-size: 1.9rem; border-radius: 17px; }
    .dl-hero-actions, .dl-hero-actions .dl-btn { width: 100%; }
    .dl-drop.has-file .dl-drop-selected { flex-wrap: wrap; }
    .dl-drop-selected .info { flex-basis: calc(100% - 70px); }
    .dl-drop-selected [data-drop-clear] { width: 100%; }
    .dl-card { padding: 1.3rem; }
    .dl-row { grid-template-columns: 1fr; }
    .dl-search { flex-basis: 100%; }
    .dl-grid, .dl-grid-files { grid-template-columns: 1fr; }
    .dl-drop { padding: 1.6rem 1rem; }
    .dl-aurora span:nth-child(3) { display: none; }
}
