:root {
  --navy: #0d1b2a;
  --navy-2: #12233a;
  --navy-3: #1a2f4a;
  --line: #233a58;
  --orange: #e8602c;
  --orange-2: #c4622d;
  --orange-soft: rgba(232, 96, 44, 0.12);
  --text: #f3f5f8;
  --muted: #8a99ad;
  --ok: #34c784;
  --ok-soft: rgba(52, 199, 132, 0.12);
  --warn: #f2b84b;
  --danger: #ff6159;
  --danger-soft: rgba(255, 97, 89, 0.12);
  --radius: 16px;
  --font-title: "Syne", system-ui, sans-serif;
  --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--navy); color: var(--text); font-family: var(--font); font-size: 16px; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; min-height: 100dvh; }
a { color: var(--orange); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-title); letter-spacing: -0.01em; margin: 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt { margin-top: 16px; } .mt2 { margin-top: 28px; } .mb { margin-bottom: 16px; }

/* ── Logo ── */
.logo { display: inline-flex; align-items: baseline; gap: 8px; white-space: nowrap; font-family: var(--font-title); font-weight: 800; letter-spacing: 0.02em; color: var(--text); }
.logo .mark { font-size: 22px; }
.logo .mark b { color: var(--orange); font-weight: 800; }
.logo-full { height: 58px; width: auto; display: block; }
.logo-mark { height: 30px; width: auto; display: block; }
.app-head .logo { align-items: center; gap: 10px; }
.logo .tag { font-size: 10px; letter-spacing: 0.28em; color: var(--muted); font-weight: 700; }

/* ── Boutons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 13px 18px; font-weight: 650; cursor: pointer; background: var(--navy-3); color: var(--text); transition: transform 0.06s, background 0.15s, opacity 0.15s; text-align: center; white-space: nowrap; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--orange); color: #fff; }
.btn.primary:hover:not(:disabled) { background: #f06a36; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.ghost:hover:not(:disabled) { background: var(--navy-3); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 12px; font-size: 14px; border-radius: 10px; }
.btn.icon { padding: 9px; border-radius: 10px; background: transparent; }
.btn.icon:hover { background: var(--navy-3); }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ── Formulaires ── */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.input, select.input, textarea.input { width: 100%; background: var(--navy); border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; outline: none; transition: border 0.15s; }
.input:focus { border-color: var(--orange); }
textarea.input { min-height: 84px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; cursor: pointer; font-size: 15px; }
.check input { width: 20px; height: 20px; accent-color: var(--orange); margin: 1px 0 0; flex: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }

/* ── Cartes ── */
.card { background: var(--navy-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card + .card { margin-top: 14px; }
.card h2 { font-size: 18px; margin-bottom: 12px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--navy-3); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.orange { background: var(--orange-soft); color: var(--orange); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.warn { background: rgba(242, 184, 75, 0.12); color: var(--warn); }

/* ── Zone de dépôt ── */
.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 30px 18px; text-align: center; cursor: pointer; transition: border 0.15s, background 0.15s; background: rgba(255, 255, 255, 0.015); }
.drop:hover, .drop.over { border-color: var(--orange); background: var(--orange-soft); }
.drop .ico { width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 16px; background: var(--orange-soft); color: var(--orange); display: grid; place-items: center; }
.drop .ico svg { width: 26px; height: 26px; }
.drop strong { display: block; font-size: 17px; margin-bottom: 4px; }

/* ── Liste de fichiers ── */
.files { list-style: none; margin: 0; padding: 0; }
.files li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.files li:last-child { border-bottom: 0; }
.ext { width: 42px; height: 42px; border-radius: 11px; background: var(--navy-3); display: grid; place-items: center; font-size: 10px; font-weight: 800; letter-spacing: 0.04em; color: var(--muted); flex: none; text-transform: uppercase; overflow: hidden; }
.ext.img { background: rgba(80, 160, 255, 0.14); color: #6fb1ff; }
.ext.pdf { background: var(--danger-soft); color: var(--danger); }
.ext.vid { background: rgba(170, 120, 255, 0.15); color: #b28cff; }
.ext.zip { background: rgba(242, 184, 75, 0.13); color: var(--warn); }
.ext.design { background: var(--orange-soft); color: var(--orange); }
.ext.folder { background: var(--orange-soft); color: var(--orange); }
.ext svg { width: 22px; height: 22px; }
.fname { font-weight: 600; font-size: 15px; }
.fmeta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.fbar { height: 4px; border-radius: 4px; background: var(--navy-3); margin-top: 6px; overflow: hidden; }
.fbar > i { display: block; height: 100%; width: 0; background: var(--orange); transition: width 0.2s; }
.fbar.done > i { background: var(--ok); }

/* ── Progression globale ── */
.progress { height: 10px; background: var(--navy-3); border-radius: 10px; overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--orange-2), var(--orange)); border-radius: 10px; transition: width 0.25s; }
.bigpct { font-family: var(--font-title); font-size: 44px; font-weight: 800; line-height: 1; }

/* ── Page client ── */
.client-wrap { max-width: 580px; margin: 0 auto; padding: 22px 16px 40px; }
.client-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.hero h1 { font-size: 28px; line-height: 1.15; margin-bottom: 8px; }
.hero p { color: var(--muted); margin: 0 0 20px; line-height: 1.5; }
.note { background: var(--navy-3); border-left: 3px solid var(--orange); border-radius: 10px; padding: 12px 14px; margin: 0 0 18px; white-space: pre-wrap; line-height: 1.5; font-size: 15px; }
.trust { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: center; margin-top: 22px; color: var(--muted); font-size: 13px; }
.trust span { display: inline-flex; align-items: center; gap: 6px; }
.trust svg { width: 15px; height: 15px; color: var(--orange); }
.footer { text-align: center; color: var(--muted); font-size: 12px; margin-top: 34px; line-height: 1.7; }
.state { text-align: center; padding: 36px 10px; }
.state .ico { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 16px; display: grid; place-items: center; background: var(--orange-soft); color: var(--orange); }
.state .ico.ok { background: var(--ok-soft); color: var(--ok); }
.state .ico svg { width: 30px; height: 30px; }
.state h1 { font-size: 24px; margin-bottom: 8px; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--navy-3); border-top-color: var(--orange); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Admin ── */
.app-head { position: sticky; top: 0; z-index: 20; background: rgba(13, 27, 42, 0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.app-head .in { max-width: 980px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 14px; }
.tabs { display: flex; gap: 4px; margin-left: 18px; }
.tabs a { color: var(--muted); padding: 9px 14px; border-radius: 10px; font-weight: 650; font-size: 15px; }
.tabs a.on { color: var(--text); background: var(--navy-3); }
.bottom-nav { display: none; }
.storage-pill { margin-left: auto; cursor: pointer; }
.main { max-width: 980px; margin: 0 auto; padding: 20px 16px 110px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-head h1 { font-size: 26px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; margin-bottom: 12px; cursor: pointer; }
.back svg { width: 18px; height: 18px; }
.list { display: grid; gap: 10px; }
.item { display: flex; align-items: center; gap: 14px; background: var(--navy-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px; cursor: pointer; transition: border 0.15s, background 0.15s; }
.item:hover { border-color: #2f4b70; background: #142842; }
.item .t { font-weight: 700; font-size: 15.5px; }
.item .s { font-size: 13px; color: var(--muted); margin-top: 3px; }
.empty { text-align: center; padding: 50px 16px; color: var(--muted); }
.empty .ico { width: 58px; height: 58px; border-radius: 18px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--navy-3); }
.empty .ico svg { width: 26px; height: 26px; }
.linkbox { display: flex; align-items: center; gap: 8px; background: var(--navy); border: 1px solid var(--line); border-radius: 12px; padding: 6px 6px 6px 14px; }
.linkbox code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; color: var(--text); }
.share-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.share-row .btn { flex-direction: column; gap: 4px; font-size: 12px; padding: 10px 4px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-weight: 650; margin-bottom: 14px; font-size: 15px; }
.crumbs a { color: var(--muted); padding: 4px 6px; border-radius: 8px; }
.crumbs a:hover { background: var(--navy-3); color: var(--text); }
.crumbs a.cur { color: var(--text); }
.crumbs .sep { color: var(--line); }
.gauge { height: 8px; background: var(--navy-3); border-radius: 8px; overflow: hidden; margin: 8px 0 6px; }
.gauge > i { display: block; height: 100%; background: var(--orange); }
.selbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 22px; z-index: 30; background: var(--navy-3); border: 1px solid var(--line); border-radius: 14px; padding: 8px; display: flex; gap: 6px; align-items: center; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45); max-width: calc(100vw - 24px); }
.selbar .count { padding: 0 10px; font-weight: 700; font-size: 14px; white-space: nowrap; }
.cb { width: 22px; height: 22px; accent-color: var(--orange); flex: none; cursor: pointer; }
.upload-panel { position: fixed; right: 16px; bottom: 16px; z-index: 40; width: 360px; max-width: calc(100vw - 24px); background: var(--navy-2); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 16px 50px rgba(0, 0, 0, 0.5); padding: 16px; }
.batch { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.batch:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.batch-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 6px; }

/* ── Modale / feuille ── */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(4, 10, 18, 0.65); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade 0.15s; }
.modal { background: var(--navy-2); border: 1px solid var(--line); border-radius: 18px; width: 100%; max-width: 460px; max-height: 88vh; overflow: auto; padding: 22px; animation: pop 0.18s; }
.modal h2 { font-size: 20px; margin-bottom: 14px; }
.modal .foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.menu-list { display: grid; gap: 4px; }
.menu-list button { display: flex; align-items: center; gap: 12px; width: 100%; background: transparent; border: 0; padding: 13px 12px; border-radius: 10px; text-align: left; cursor: pointer; font-weight: 600; }
.menu-list button:hover { background: var(--navy-3); }
.menu-list button.danger { color: var(--danger); }
.menu-list svg { width: 19px; height: 19px; color: var(--muted); }
.menu-list button.danger svg { color: var(--danger); }
.folder-pick { display: grid; gap: 2px; max-height: 50vh; overflow: auto; margin: 6px 0; }
.folder-pick button { text-align: left; background: transparent; border: 0; padding: 10px 12px; border-radius: 10px; cursor: pointer; display: flex; gap: 10px; align-items: center; }
.folder-pick button:hover, .folder-pick button.on { background: var(--navy-3); }
.folder-pick button.on { outline: 1px solid var(--orange); }
.folder-pick svg { width: 18px; height: 18px; color: var(--orange); flex: none; }
.toast-wrap { position: fixed; left: 50%; transform: translateX(-50%); top: 16px; z-index: 80; display: grid; gap: 8px; width: max-content; max-width: calc(100vw - 24px); }
.toast { background: #f3f5f8; color: var(--navy); padding: 12px 16px; border-radius: 12px; font-weight: 650; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); animation: pop 0.18s; font-size: 15px; }
.toast.err { background: var(--danger); color: #fff; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(0.98); } }

/* ── Connexion ── */
.login { max-width: 380px; margin: 0 auto; padding: 14vh 18px 40px; }
.login h1 { font-size: 26px; margin: 26px 0 6px; }

@media (max-width: 720px) {
  .tabs { display: none; }
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: rgba(13, 27, 42, 0.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted); font-size: 11.5px; font-weight: 650; padding: 7px 0; border-radius: 10px; }
  .bottom-nav a svg { width: 22px; height: 22px; }
  .bottom-nav a.on { color: var(--orange); }
  .main { padding-bottom: 120px; }
  .page-head h1 { font-size: 23px; }
  .selbar { bottom: calc(78px + env(safe-area-inset-bottom)); }
  .upload-panel { right: 12px; left: 12px; width: auto; bottom: calc(78px + env(safe-area-inset-bottom)); }
  .overlay { align-items: flex-end; padding: 0; }
  .modal { border-radius: 20px 20px 0 0; max-width: none; padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
}
@media (max-width: 520px) { .hide-sm { display: none; } }
.right { text-align: right; }
@media (max-width: 440px) {
  .logo-full { height: 50px; }
}
