:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --border: #e2e5ea;
  --border-strong: #cfd4dc;
  --text: #1c2128;
  --text-dim: #5b6472;
  --text-faint: #8b93a1;
  --accent: #2563eb;
  --accent-soft: #eaf1fe;
  --red: #dc2626;
  --red-soft: #fdecec;
  --green: #16a34a;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20,25,35,.04), 0 8px 24px -12px rgba(20,25,35,.12);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --surface: #1c1f25;
    --border: rgba(255,255,255,.08);
    --border-strong: rgba(255,255,255,.16);
    --text: #e8eaed;
    --text-dim: #9aa1ad;
    --text-faint: #6b7280;
    --accent: #5b8def;
    --accent-soft: rgba(91,141,239,.15);
    --red: #f87171;
    --red-soft: rgba(248,113,113,.15);
    --green: #4ade80;
  }
}
/* bascule manuelle (plus prioritaire que la preference systeme ci-dessus,
   grace a la specificite superieure de [data-theme] sur :root seul) */
:root[data-theme="dark"] {
  --bg: #14161a; --surface: #1c1f25; --border: rgba(255,255,255,.08); --border-strong: rgba(255,255,255,.16);
  --text: #e8eaed; --text-dim: #9aa1ad; --text-faint: #6b7280; --accent: #5b8def; --accent-soft: rgba(91,141,239,.15);
  --red: #f87171; --red-soft: rgba(248,113,113,.15); --green: #4ade80;
}
:root[data-theme="light"] {
  --bg: #f6f7f9; --surface: #ffffff; --border: #e2e5ea; --border-strong: #cfd4dc;
  --text: #1c2128; --text-dim: #5b6472; --text-faint: #8b93a1; --accent: #2563eb; --accent-soft: #eaf1fe;
  --red: #dc2626; --red-soft: #fdecec; --green: #16a34a;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: 'Segoe UI', ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 14px;
  display: flex; flex-direction: column;
}

button { font-family: inherit; cursor: pointer; }
.btn {
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--text);
  padding: 8px 14px; border-radius: 8px; font-size: 13.5px; font-weight: 600;
}
.btn:hover { background: var(--accent-soft); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { padding: 6px 10px; font-size: 12.5px; }
.btn.danger { color: var(--red); }
.icon-btn {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text-dim); display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--accent-soft); }
.hidden { display: none !important; }

/* ---- topbar ---- */
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 12px 22px;
  background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10;
  flex-wrap: wrap;
}
.brand { font-weight: 800; font-size: 16px; flex: none; }
.breadcrumb { flex: 1; display: flex; align-items: center; gap: 4px; font-size: 13.5px; color: var(--text-dim); overflow-x: auto; white-space: nowrap; min-width: 80px; }
.breadcrumb .crumb { cursor: pointer; padding: 3px 6px; border-radius: 6px; }
.breadcrumb .crumb:hover { background: var(--accent-soft); color: var(--accent); }
.breadcrumb .sep { color: var(--text-faint); }
.top-actions { display: flex; gap: 8px; flex: none; }

.search-box {
  display: flex; align-items: center; gap: 7px; background: var(--bg); border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 0 10px; flex: none; width: 180px; transition: width .15s ease;
}
.search-box:focus-within { width: 240px; border-color: var(--accent); }
.search-box svg { width: 14px; height: 14px; fill: var(--text-faint); flex: none; }
.search-box input { border: none; background: none; padding: 7px 0; outline: none; color: var(--text); font-size: 13px; width: 100%; }

/* ---- barre de stats ---- */
.stats-bar { display: flex; gap: 16px; font-size: 12px; color: var(--text-faint); margin-bottom: 14px; padding: 0 2px; }
.stats-bar b { color: var(--text-dim); font-weight: 600; }

/* ---- drop zone / grid ---- */
.drop-zone { flex: 1; position: relative; padding: 20px 22px 60px; max-width: 1200px; margin: 0 auto; width: 100%; }
.drop-overlay {
  position: fixed; inset: 10px; background: var(--accent-soft); border: 3px dashed var(--accent); border-radius: 18px;
  display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; color: var(--accent);
  z-index: 50; pointer-events: none; text-align: center; line-height: 1.6;
}
.empty-state { text-align: center; padding: 70px 20px; color: var(--text-dim); }
.empty-state .dim { color: var(--text-faint); font-size: 13px; }
.empty-state .empty-icon { font-size: 46px; margin-bottom: 10px; opacity: .7; }

.spinner {
  width: 30px; height: 30px; border: 3px solid var(--border-strong); border-top-color: var(--accent);
  border-radius: 50%; margin: 40px auto; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; }
.file-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 10px 10px; text-align: center; cursor: pointer; position: relative;
  transition: border-color .12s ease, transform .12s ease, background .12s ease;
  animation: card-in .18s ease both;
}
@keyframes card-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.file-card:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow); }
.file-card.drag-over { border-color: var(--accent); background: var(--accent-soft); border-style: dashed; }
.file-card.dragging { opacity: .4; }
.file-card[draggable="true"] { cursor: grab; }
.breadcrumb .crumb.drag-over { background: var(--accent-soft); color: var(--accent); outline: 2px dashed var(--accent); outline-offset: -2px; }
.file-card .icon { font-size: 34px; line-height: 1; margin-bottom: 8px; position: relative; display: inline-block; }
.lock-badge { position: absolute; bottom: -2px; right: -8px; font-size: 13px; }
.star-badge { position: absolute; top: -6px; right: -8px; font-size: 13px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.4)); }
.file-card .icon.thumb {
  width: 100%; height: 64px; border-radius: 8px; overflow: hidden; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
}
.file-card .icon.thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---- selection multiple ---- */
.select-check {
  position: absolute; top: 6px; left: 6px; width: 20px; height: 20px; border-radius: 6px;
  border: 1.5px solid var(--border-strong); background: var(--surface); cursor: pointer;
  opacity: 0; transition: opacity .12s ease, background .12s ease, border-color .12s ease;
}
.file-card:hover .select-check, .file-card.selected .select-check { opacity: 1; }
.file-card.selected .select-check { background: var(--accent); border-color: var(--accent); }
.file-card.selected .select-check::after { content: "✓"; color: #fff; font-size: 12px; font-weight: 800; display: block; line-height: 18px; }
.file-card.selected { border-color: var(--accent); background: var(--accent-soft); }
@media (hover: none) { .select-check { opacity: 1; } }

.bulk-bar {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 150;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px;
  box-shadow: var(--shadow); padding: 10px 14px; display: flex; align-items: center; gap: 10px;
  font-size: 13px; animation: card-in .15s ease;
}
.bulk-bar b { color: var(--accent); }
.file-card .name { font-size: 12.5px; font-weight: 600; word-break: break-word; line-height: 1.3; max-height: 2.6em; overflow: hidden; }
.file-card .meta { font-size: 10.5px; color: var(--text-faint); margin-top: 4px; }
.file-card .menu-btn {
  position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 6px; border: none;
  background: var(--bg); color: var(--text-dim); font-size: 14px; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .12s ease;
}
.file-card:hover .menu-btn, .file-card .menu-btn:focus { opacity: 1; }
.file-card .menu-btn:hover { background: var(--accent-soft); }
@media (hover: none) { .file-card .menu-btn { opacity: 1; } }

.ctx-menu {
  position: fixed; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px;
  box-shadow: var(--shadow); padding: 4px; z-index: 60; min-width: 150px;
}
.ctx-menu button {
  display: block; width: 100%; text-align: left; background: none; border: none; padding: 8px 10px;
  border-radius: 6px; font-size: 13px; color: var(--text);
}
.ctx-menu button:hover { background: var(--accent-soft); }
.ctx-menu button.danger { color: var(--red); }

/* ---- viewer ---- */
.viewer-backdrop {
  position: fixed; inset: 0; background: rgba(10,12,16,.55); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: fade-in .12s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.viewer {
  width: 100%; max-width: 1000px; height: 85vh; background: var(--surface); border-radius: 14px;
  border: 1px solid var(--border-strong); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden;
  animation: viewer-in .16s ease;
}
@keyframes viewer-in { from { opacity: 0; transform: scale(.97) translateY(6px); } to { opacity: 1; transform: none; } }
.viewer-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); gap: 10px; }
.viewer-title-wrap { display: flex; align-items: center; gap: 9px; min-width: 0; }
.viewer-icon { font-size: 18px; flex: none; }
.viewer-title { font-weight: 700; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-actions { display: flex; gap: 8px; align-items: center; flex: none; }
.viewer-body { flex: 1; overflow: auto; padding: 0; position: relative; }
.viewer-body.padded { padding: 20px; }
.viewer-body textarea {
  width: 100%; height: 100%; border: none; outline: none; resize: none; padding: 16px;
  font-family: 'Cascadia Code', ui-monospace, monospace; font-size: 13px; background: var(--surface); color: var(--text);
}
.viewer-body img { max-width: 100%; display: block; margin: 0 auto; }
.viewer-body iframe { width: 100%; height: 100%; border: none; }
.viewer-body .docx-preview { max-width: 800px; margin: 0 auto; line-height: 1.6; }
.media-center { height: 100%; display: flex; align-items: center; justify-content: center; }
.media-center video { max-width: 100%; max-height: 100%; border-radius: 8px; }
.media-center audio { width: 100%; max-width: 480px; }
.viewer-body .docx-preview img { max-width: 100%; }
.viewer-body .note { padding: 10px 16px; background: var(--accent-soft); color: var(--accent); font-size: 12.5px; }
.viewer-body .note.error { background: var(--red-soft); color: var(--red); }

.sheet-toolbar { display: flex; gap: 4px; padding: 8px 16px; border-bottom: 1px solid var(--border); align-items: center; }
.sheet-toolbar .sheet-tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; padding: 0; border: none; }
.sheet-tabs button { padding: 5px 10px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 12px; flex: none; }
.sheet-tabs button.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.sheet-table { border-collapse: collapse; width: 100%; }
.sheet-table td, .sheet-table th {
  border: 1px solid var(--border); padding: 4px 8px; font-size: 12.5px; min-width: 70px;
}
.sheet-table th { background: var(--bg); color: var(--text-dim); position: sticky; top: 0; }
.sheet-table td[contenteditable="true"]:focus { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ---- panneau d'upload ---- */
.upload-panel {
  position: fixed; bottom: 20px; left: 20px; width: 300px; background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow); z-index: 150;
  animation: card-in .15s ease;
}
.upload-panel-head {
  display: flex; align-items: center; justify-content: space-between; padding: 10px 12px;
  border-bottom: 1px solid var(--border); font-size: 12.5px; font-weight: 700;
}
.upload-list { max-height: 220px; overflow-y: auto; padding: 8px 12px; display: flex; flex-direction: column; gap: 8px; }
.upload-item .u-name { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 3px; }
.upload-item .u-track { height: 5px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.upload-item .u-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width .15s ease; }
.upload-item.done .u-fill { background: var(--green); }
.upload-item.failed .u-fill { background: var(--red); }
.upload-item .u-status { font-size: 10.5px; color: var(--text-faint); margin-top: 2px; }

/* ---- toast ---- */
#toastRoot { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; padding: 11px 16px;
  font-size: 13px; box-shadow: var(--shadow); animation: card-in .15s ease;
}
.toast.error { border-color: var(--red); color: var(--red); }
.toast.success { border-color: var(--green); color: var(--green); }

/* ---- login ---- */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; margin: 0; padding: 20px; }
.login-card {
  width: 100%; max-width: 340px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow); padding: 34px 30px; text-align: center;
}
.login-mark {
  width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 12px; background: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.login-card h1 { font-size: 19px; margin: 0 0 4px; }
.login-sub { color: var(--text-faint); font-size: 12.5px; margin-bottom: 20px; }
.login-card label { display: block; text-align: left; font-size: 11.5px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: .03em; margin: 12px 0 6px; }
.login-card input {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--bg); color: var(--text); font-size: 14px; outline: none;
}
.login-card input:focus { border-color: var(--accent); }
.btn.full { width: 100%; justify-content: center; margin-top: 18px; padding: 10px; }
.login-error { margin-top: 12px; color: var(--red); font-size: 12.5px; }

/* ---- user chip / panneau utilisateurs ---- */
.user-chip {
  width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; flex: none;
  border: none; cursor: pointer; font-family: inherit; overflow: hidden; padding: 0;
}
.user-chip:hover { filter: brightness(1.15); }
.user-chip img { width: 100%; height: 100%; object-fit: cover; }

/* ---- editeur d'avatar (Mon compte) ---- */
.avatar-editor { display: flex; gap: 16px; align-items: center; }
.avatar-editor-preview {
  width: 64px; height: 64px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800;
  flex: none; overflow: hidden; border: 2px solid var(--border-strong);
}
.avatar-editor-preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-editor-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.avatar-editor-actions .btn { margin-right: 6px; }

#sortSelect {
  width: auto; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--bg); color: var(--text); font-size: 12.5px; flex: none;
}
.users-modal { max-width: 680px; height: auto; max-height: 88vh; }

/* ---- carte "nouveau compte" ---- */
.new-user-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px; margin-bottom: 22px;
}
.nu-header { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.nu-avatar-preview {
  width: 46px; height: 46px; border-radius: 50%; background: var(--accent-grad, var(--accent)); flex: none;
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 15px;
  text-transform: uppercase; box-shadow: 0 4px 14px -4px rgba(0,0,0,.3);
}
.nu-header-fields { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.nu-header-fields input { width: 100%; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 13.5px; }

.nu-section { margin-top: 16px; }
.nu-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); margin-bottom: 8px; }
.nu-hint { font-size: 11.5px; color: var(--text-faint); margin: 10px 0 0; line-height: 1.5; }

.role-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.role-opt {
  flex: 1; min-width: 110px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 8px; border-radius: 10px; border: 1.5px solid var(--border-strong); background: var(--surface);
  cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--text-dim); transition: all .12s ease;
}
.role-opt input { position: absolute; opacity: 0; pointer-events: none; }
.role-opt-icon { font-size: 22px; }
.role-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

.perm-switches { display: flex; flex-direction: column; gap: 10px; }
.perm-switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; color: var(--text); }
.perm-switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track {
  width: 34px; height: 20px; border-radius: 20px; background: var(--border-strong); position: relative; flex: none;
  transition: background .15s ease;
}
.switch-track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: transform .15s ease; box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.perm-switch input:checked + .switch-track { background: var(--accent); }
.perm-switch input:checked + .switch-track::after { transform: translateX(14px); }

.users-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.users-table th { text-align: left; color: var(--text-faint); font-size: 10.5px; text-transform: uppercase; padding: 6px 8px; border-bottom: 1px solid var(--border-strong); }
.users-table td { padding: 8px; border-bottom: 1px solid var(--border); }
.users-table td.perm-cell { text-align: center; }
.users-table td.perm-cell input { width: auto; cursor: pointer; }
.users-table .account-cell { display: flex; align-items: center; gap: 8px; }
.mini-avatar { width: 22px; height: 22px; border-radius: 50%; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; flex: none; background: var(--accent-soft); font-size: 12px; }
.mini-avatar img { width: 100%; height: 100%; object-fit: cover; }
.users-table .role-tag { font-size: 10.5px; font-weight: 700; text-transform: uppercase; padding: 2px 7px; border-radius: 20px; background: var(--accent-soft); color: var(--accent); cursor: pointer; border: none; }
.role-tag.role-owner { background: rgba(234,179,8,.16); color: #eab308; }
.role-tag.role-admin { background: var(--accent-soft); color: var(--accent); }
.role-tag.role-user { background: var(--gray-soft, rgba(139,147,161,.16)); color: var(--text-dim); }
.user-chip.role-owner { background: rgba(234,179,8,.18); color: #eab308; }

/* ---- creation fichier/dossier ---- */
.create-type-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.create-type-tabs button {
  flex: 1; padding: 10px; border-radius: 10px; border: 1.5px solid var(--border-strong); background: var(--surface);
  color: var(--text-dim); font-weight: 600; font-size: 13.5px; cursor: pointer;
}
.create-type-tabs button.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.access-modal label:not(.access-mode-opt):not(.access-user-row):not(.perm-switch) { display: block; font-size: 11.5px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: .03em; margin: 4px 0 6px; }
.access-modal input[type="text"],
.access-modal input[type="password"],
.access-modal select {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--bg); color: var(--text); font-size: 14px; margin-bottom: 4px; font-family: inherit;
  color-scheme: dark;
}
.access-modal input[type="text"]:focus,
.access-modal input[type="password"]:focus,
.access-modal select:focus { outline: none; border-color: var(--accent); }
/* Chrome/Edge forcent un fond blanc sur les champs auto-completes (mots de
   passe notamment) -- on force la couleur de fond/texte par dessus */
.access-modal input:-webkit-autofill,
.access-modal input:-webkit-autofill:hover,
.access-modal input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--bg) inset;
  box-shadow: 0 0 0 1000px var(--bg) inset;
  caret-color: var(--text);
}

/* ---- selecteur d'acces ---- */
.access-modal { max-width: 440px; height: auto; max-height: 80vh; }
.access-mode-opt {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px; border-radius: 10px;
  border: 1.5px solid var(--border-strong); margin-bottom: 8px; cursor: pointer;
}
.access-mode-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.access-mode-opt input { margin-top: 3px; }
.access-mode-opt div { display: flex; flex-direction: column; gap: 2px; }
.access-mode-opt span { font-size: 12px; color: var(--text-faint); }
.access-user-list { margin-top: 10px; padding: 10px; background: var(--bg); border-radius: 10px; max-height: 220px; overflow-y: auto; }
.access-user-row { display: flex; align-items: center; gap: 9px; padding: 6px 4px; font-size: 13px; }
.access-user-row input { width: auto; }

/* ---- corbeille ---- */
.trash-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--border); font-size: 13px;
}
.trash-row .t-icon { font-size: 18px; flex: none; }
.trash-row .t-info { flex: 1; min-width: 0; }
.trash-row .t-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trash-row .t-meta { font-size: 11px; color: var(--text-faint); }
.trash-row .t-actions { display: flex; gap: 6px; flex: none; }

/* ---- resultats de recherche globale ---- */
.search-path { font-size: 10px; color: var(--text-faint); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- statistiques de stockage (admin) ---- */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 20px; }
.stat-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.stat-card .sc-value { font-size: 22px; font-weight: 700; }
.stat-card .sc-label { font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.cat-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13px; }
.cat-row .cat-name { width: 90px; flex: none; color: var(--text-dim); }
.cat-row .cat-bar-track { flex: 1; height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; }
.cat-row .cat-bar-fill { height: 100%; background: var(--accent); border-radius: 4px; }
.cat-row .cat-meta { width: 130px; flex: none; text-align: right; color: var(--text-faint); font-size: 11px; }
.stat-section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); margin: 18px 0 8px; }

/* ---- parametres : raccourcis clavier ---- */
.shortcuts-list { display: flex; flex-direction: column; gap: 8px; }
.shortcuts-list > div { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dim); }
.shortcuts-list kbd {
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 6px; padding: 2px 7px;
  font-family: inherit; font-size: 12px; font-weight: 600; color: var(--text); box-shadow: 0 1px 0 var(--border-strong);
}

@media (max-width: 640px) {
  .topbar { padding: 10px 14px; gap: 8px; }
  .brand { display: none; }
  .search-box { width: 100%; order: 3; }
  .search-box:focus-within { width: 100%; }
  .breadcrumb { order: 1; }
  .top-actions { order: 2; }
  .drop-zone { padding: 14px 14px 60px; }
  .file-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
  .viewer-backdrop { padding: 0; }
  .viewer { height: 100%; max-width: 100%; border-radius: 0; }
  .upload-panel { left: 10px; right: 10px; width: auto; bottom: 10px; }
}
