/* files.wellens.cc */
:root {
    --bg: #f4f5f7;
    --card: #ffffff;
    --text: #1b1d22;
    --muted: #6b7280;
    --line: #e5e7eb;
    --accent: #3b5bdb;
    --accent-2: #2f4ac0;
    --accent-soft: #eef2ff;
    --danger: #d6336c;
    --danger-soft: #fff0f5;
    --ok: #2b8a3e;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #111317;
        --card: #1a1d23;
        --text: #e8e9ec;
        --muted: #9096a1;
        --line: #2a2e36;
        --accent: #6f8cff;
        --accent-2: #8aa1ff;
        --accent-soft: #1f2540;
        --danger: #ff6b9a;
        --danger-soft: #2d1a22;
        --ok: #51cf66;
        --shadow: none;
    }
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); }

.wrap { max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; }
.wrap.narrow, .narrow { max-width: 560px; margin-left: auto; margin-right: auto; }

/* En-tête */
.brand {
    display: flex; align-items: center; gap: 10px;
    font-weight: 650; letter-spacing: -.01em;
    margin-bottom: 28px;
}
.logo {
    width: 26px; height: 26px; border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), #845ef7);
    position: relative;
}
.logo::after {
    content: ""; position: absolute; inset: 7px 8px 6px;
    border: 2px solid #fff; border-top: none; border-radius: 0 0 3px 3px;
}
.brand nav { margin-left: auto; display: flex; gap: 4px; }
.brand nav a {
    color: var(--muted); text-decoration: none; font-weight: 500;
    padding: 6px 12px; border-radius: 8px;
}
.brand nav a:hover { background: var(--card); color: var(--text); }
.brand nav a.active { background: var(--card); color: var(--text); box-shadow: var(--shadow); }

/* Cartes */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
    max-width: 640px;
    margin: 0 auto 20px;
}
.card.flush { padding: 0; max-width: none; overflow: hidden; }
.card-head {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 20px 24px; border-bottom: 1px solid var(--line);
}
.card-head h1 { margin: 0; }
.card-head input { max-width: 240px; }
.center { text-align: center; }
.pad { padding: 32px; }

h1 { font-size: 22px; margin: 0 0 6px; letter-spacing: -.02em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--danger); margin: 12px 0 0; }
.nowrap { white-space: nowrap; }
.ellipsis { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.stack { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }

/* Formulaires */
input[type=text], input[type=password], input[type=search] {
    width: 100%; padding: 11px 14px;
    background: var(--bg); color: var(--text);
    border: 1px solid var(--line); border-radius: 10px;
    font: inherit; outline: none;
    transition: border-color .15s, box-shadow .15s;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input:disabled { opacity: .6; }

/* Boutons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 11px 18px; border-radius: 10px; border: 1px solid transparent;
    font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
    transition: background .15s, opacity .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.small { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--accent-2); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn.ghost:hover { background: var(--bg); }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--line); }
.btn.danger:hover:not(:disabled) { background: var(--danger-soft); border-color: var(--danger); }

.icon-btn {
    background: none; border: none; color: var(--muted); cursor: pointer;
    font-size: 14px; padding: 4px 6px; border-radius: 6px; line-height: 1;
}
.icon-btn:hover { background: var(--bg); color: var(--text); }

/* Zone de dépôt */
.dropzone {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    margin-top: 20px; padding: 40px 20px;
    border: 2px dashed var(--line); border-radius: var(--radius);
    background: var(--bg); cursor: pointer; text-align: center;
    transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.disabled { pointer-events: none; opacity: .5; }
.dz-icon {
    width: 48px; height: 48px; border-radius: 50%;
    display: grid; place-items: center; font-size: 22px;
    background: var(--card); color: var(--accent); margin-bottom: 8px;
    box-shadow: var(--shadow);
}

/* Liste de fichiers */
.filelist { list-style: none; padding: 0; margin: 16px 0 8px; }
.filelist li {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 4px; border-bottom: 1px solid var(--line);
}
.filelist li:last-child { border-bottom: none; }
.fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fsize { color: var(--muted); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.filelist + .btn { margin-top: 12px; }

/* Progression */
.progress { margin-top: 18px; }
.bar { height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.bar span {
    display: block; height: 100%; width: 0;
    background: linear-gradient(90deg, var(--accent), #845ef7);
    transition: width .2s;
}

/* Résultat */
.success-icon {
    width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%;
    display: grid; place-items: center; font-size: 26px; font-weight: 700;
    color: #fff; background: var(--ok);
}
.copyrow { display: flex; gap: 8px; margin: 18px 0 12px; }
.copyrow input { font-family: ui-monospace, Consolas, monospace; font-size: 14px; }
.row-actions { display: flex; gap: 8px; justify-content: center; }

/* Statistiques */
.stats {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
    margin-bottom: 20px;
}
.stats div {
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
}
.stats strong { display: block; font-size: 22px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stats span { color: var(--muted); font-size: 13px; }

/* Tableau */
.table-wrap { overflow-x: auto; }
table.links { width: 100%; border-collapse: collapse; }
table.links th {
    text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase;
    letter-spacing: .04em; color: var(--muted);
    padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--bg);
}
table.links td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.links tr:last-child td { border-bottom: none; }
table.links tr:hover td { background: color-mix(in srgb, var(--bg) 50%, transparent); }
table.links .num { text-align: right; font-variant-numeric: tabular-nums; }
.ltitle { font-weight: 600; }
.lurl { display: flex; align-items: center; gap: 4px; font-size: 13px; }
.lurl a { font-family: ui-monospace, Consolas, monospace; text-decoration: none; }
.lurl a:hover { text-decoration: underline; }
tr.removing { opacity: .3; transition: opacity .2s; }

@media (max-width: 720px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
    .card { padding: 20px; }
    .card-head { flex-direction: column; align-items: stretch; }
    .card-head input { max-width: none; }
}
