/* ------------------------------------------------------------------ */
/* Thème                                                               */
/* ------------------------------------------------------------------ */
:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #f0f2f7;
  --surface-hover: #f5f6fb;
  --border: #e3e6ee;
  --text: #161a26;
  --muted: #697086;
  --accent: #5b5bd6;
  --accent-strong: #4a4ac4;
  --accent-soft: #ededfc;
  --accent-text: #4747c2;
  --danger: #e5484d;
  --danger-soft: #fdeded;
  --success: #2b9a66;
  --warning: #d98a00;
  --doc-fill: #ffffff;
  --doc-stroke: #c7ccd9;
  --doc-fold: #eceff5;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 12px 32px -14px rgba(16, 24, 40, .22);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar-w: 264px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1016; --surface: #161922; --surface-2: #1d212c; --surface-hover: #1b1f29;
    --border: #282d3a; --text: #e7e9f1; --muted: #8a90a4;
    --accent: #8080ff; --accent-strong: #9393ff; --accent-soft: rgba(128, 128, 255, .14); --accent-text: #a5a5ff;
    --danger: #ff6369; --danger-soft: rgba(255, 99, 105, .13);
    --doc-fill: #232837; --doc-stroke: #3a4153; --doc-fold: #2c3244;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -14px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0e1016; --surface: #161922; --surface-2: #1d212c; --surface-hover: #1b1f29;
  --border: #282d3a; --text: #e7e9f1; --muted: #8a90a4;
  --accent: #8080ff; --accent-strong: #9393ff; --accent-soft: rgba(128, 128, 255, .14); --accent-text: #a5a5ff;
  --danger: #ff6369; --danger-soft: rgba(255, 99, 105, .13);
  --doc-fill: #232837; --doc-stroke: #3a4153; --doc-fold: #2c3244;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -14px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* ------------------------------------------------------------------ */
/* Base                                                                */
/* ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2 { margin: 0; letter-spacing: -.02em; }
.muted { color: var(--muted); }

.i { width: 18px; height: 18px; flex: none; display: block; }
[data-icon] { display: inline-flex; }

::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------------------ */
/* Boutons & champs                                                    */
/* ------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font-weight: 550; cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: background .15s, border-color .15s, transform .05s, box-shadow .15s;
}
.btn:hover { background: var(--surface-hover); border-color: color-mix(in srgb, var(--border) 60%, var(--muted)); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: default; }
.btn .i { width: 17px; height: 17px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.block { width: 100%; }
.btn.lg { height: 44px; font-size: 15px; }
.btn.grow { flex: 1; justify-content: flex-start; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; flex: none;
  border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--muted); cursor: pointer;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn.sm .i { width: 16px; height: 16px; }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 13px; font-weight: 600; }
.field small { color: var(--muted); font-size: 12px; }
.input, select.input {
  width: 100%; height: 42px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input:disabled { background: var(--surface-2); color: var(--muted); }

.form-error {
  margin: 0 0 14px; padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft); color: var(--danger);
  font-weight: 550; font-size: 13px;
}

/* Interrupteur */
.switch {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 14px; margin-bottom: 8px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer;
}
.switch-text { display: grid; }
.switch-text strong { font-weight: 600; }
.switch-text small { color: var(--muted); }
.switch input { appearance: none; position: relative; flex: none; width: 40px; height: 24px; margin: 0; border-radius: 99px; background: var(--border); cursor: pointer; transition: background .2s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(16px); }
.switch input:disabled { opacity: .55; cursor: default; }
.switch:has(input:disabled) { cursor: default; }

/* ------------------------------------------------------------------ */
/* Chargement                                                          */
/* ------------------------------------------------------------------ */
.boot { position: fixed; inset: 0; display: grid; place-items: center; }
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ */
/* Connexion                                                           */
/* ------------------------------------------------------------------ */
.login { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; overflow: hidden; }
.login-glow {
  position: absolute; inset: -20%;
  background:
    radial-gradient(40% 40% at 25% 25%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 70%),
    radial-gradient(35% 35% at 80% 75%, color-mix(in srgb, #ec4899 20%, transparent), transparent 70%),
    radial-gradient(30% 30% at 75% 20%, color-mix(in srgb, #06b6d4 18%, transparent), transparent 70%);
  filter: blur(20px);
}
.login-card {
  position: relative; width: 100%; max-width: 400px;
  padding: 36px 32px 28px;
  border: 1px solid var(--border); border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  animation: rise .35s ease-out;
}
.login-card h1 { font-size: 26px; margin-top: 26px; }
.login-card > p { margin: 6px 0 24px; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 17px; letter-spacing: -.01em; }
.brand-logo {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #a855f7); color: #fff;
  box-shadow: 0 6px 16px -6px var(--accent);
}
.brand-logo .i { width: 18px; height: 18px; }

/* ------------------------------------------------------------------ */
/* Structure de l'application                                          */
/* ------------------------------------------------------------------ */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; height: 100vh; height: 100dvh; }

.sidebar {
  display: flex; flex-direction: column; gap: 22px;
  padding: 20px 14px 14px;
  border-right: 1px solid var(--border);
  background: var(--surface);
  overflow-y: auto;
}
.sidebar .brand { padding: 0 8px; }
.nav { display: grid; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--muted); font-weight: 550;
  transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--accent-soft); color: var(--accent-text); }

.sidebar-bottom { margin-top: auto; display: grid; gap: 12px; }
.disk { padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.disk-head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; margin-bottom: 10px; }
.disk-head .i { width: 16px; height: 16px; color: var(--muted); }
.meter { height: 6px; border-radius: 99px; background: var(--border); overflow: hidden; }
.meter-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #a855f7); transition: width .4s; }
.meter-fill.warn { background: linear-gradient(90deg, #f59e0b, var(--danger)); }
.disk-text { margin-top: 6px; font-size: 12px; color: var(--muted); }

.user-card { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
.user-meta { display: grid; min-width: 0; line-height: 1.3; }
.user-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta span { font-size: 12px; color: var(--muted); }
.sidebar-actions { display: flex; gap: 4px; }

.avatar {
  display: grid; place-items: center; flex: none;
  width: 36px; height: 36px; border-radius: 50%;
  color: #fff; font-weight: 700; font-size: 13px; letter-spacing: .02em;
  background: var(--accent);
}

.scrim { display: none; }

.main { min-width: 0; overflow-y: auto; }
.view { max-width: 1280px; margin: 0 auto; padding: 18px 28px 48px; }

.topbar { display: flex; align-items: center; gap: 12px; min-height: 48px; margin-bottom: 10px; }
.topbar .title { font-size: 22px; flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.menu-btn { display: none; }

.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; min-width: 0; flex: 1; font-size: 17px; }
.crumb {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px; border-radius: 8px;
  color: var(--muted); font-weight: 600;
  max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.crumb:hover { background: var(--surface-2); color: var(--text); }
.crumb.current { color: var(--text); font-weight: 700; }
.crumb-sep { color: var(--muted); opacity: .6; }
.crumb-sep .i { width: 16px; height: 16px; }

.search {
  display: flex; align-items: center; gap: 8px;
  height: 38px; width: 280px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--muted);
  transition: border-color .15s, box-shadow .15s;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search .i { width: 16px; height: 16px; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); }

.seg { display: flex; padding: 3px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.seg button { display: grid; place-items: center; width: 32px; height: 30px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; }
.seg button .i { width: 16px; height: 16px; }
.seg button.active { background: var(--accent-soft); color: var(--accent-text); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 6px 0 16px; }
.toolbar-actions { display: flex; gap: 8px; }
.summary { color: var(--muted); font-size: 13px; }

/* ------------------------------------------------------------------ */
/* Liste des fichiers                                                  */
/* ------------------------------------------------------------------ */
.listing { transition: opacity .15s; }
.listing.loading { opacity: .5; pointer-events: none; }

.table {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden;
}
.row {
  display: grid; grid-template-columns: minmax(0, 1fr) 110px 170px 132px;
  align-items: center; gap: 12px;
  min-height: 56px; padding: 6px 12px 6px 16px;
  border-top: 1px solid var(--border);
  cursor: pointer; outline: none;
  transition: background .12s;
}
.row:first-child { border-top: 0; }
.row:hover, .row:focus-visible { background: var(--surface-hover); }
.row:focus-visible { box-shadow: inset 3px 0 0 var(--accent); }
.row.head {
  min-height: 40px; cursor: default;
  background: var(--surface-2);
  color: var(--muted); font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em;
}
.row.head:hover { background: var(--surface-2); }
.sort-btn { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
.sort-btn:hover, .sort-btn.active { color: var(--text); }
.sort-btn .i { width: 14px; height: 14px; }

.c-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.name-wrap { display: grid; min-width: 0; }
.name { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-size, .c-date { color: var(--muted); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.c-actions { display: flex; justify-content: flex-end; gap: 2px; opacity: 0; transition: opacity .12s; }
.row:hover .c-actions, .row:focus-within .c-actions { opacity: 1; }

.ficon { display: grid; place-items: center; width: 36px; height: 36px; flex: none; }
.ficon svg { width: 100%; height: 100%; }
.ficon.lg { width: 64px; height: 64px; }
.ficon.xl { width: 96px; height: 96px; }
.ficon .doc { fill: var(--doc-fill); stroke: var(--doc-stroke); stroke-width: 1.5; }
.ficon .fold { fill: var(--doc-fold); stroke: var(--doc-stroke); stroke-width: 1.5; stroke-linejoin: round; }
.ficon .line { fill: var(--doc-stroke); }

/* Grille */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 14px; }
.card {
  position: relative; display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-sm);
  cursor: pointer; overflow: hidden; outline: none;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.card:hover, .card:focus-visible { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.card-thumb { display: grid; place-items: center; aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 10px 12px 12px; min-width: 0; }
.card-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta { font-size: 12px; color: var(--muted); }
.card-actions {
  position: absolute; top: 8px; right: 8px; display: flex; gap: 2px; padding: 3px;
  border-radius: 10px; background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow-sm); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .12s;
}
.card:hover .card-actions, .card:focus-within .card-actions { opacity: 1; }

/* États vides */
.empty {
  display: grid; justify-items: center; gap: 6px;
  padding: 72px 20px; text-align: center;
  border: 1.5px dashed var(--border); border-radius: var(--radius);
  color: var(--muted);
}
.empty-icon { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 8px; border-radius: 18px; background: var(--accent-soft); color: var(--accent-text); }
.empty-icon .i { width: 28px; height: 28px; }
.empty strong { color: var(--text); font-size: 16px; }
.empty .btn { margin-top: 12px; }

/* ------------------------------------------------------------------ */
/* Utilisateurs                                                        */
/* ------------------------------------------------------------------ */
.users .row { grid-template-columns: minmax(0, 1.4fr) 110px minmax(0, 1.2fr) minmax(0, 1fr) 150px 84px; cursor: default; }
.users .row:hover { background: transparent; }
.users .row.head:hover { background: var(--surface-2); }
.users .c-actions { opacity: 1; }
.user-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.user-cell .avatar { width: 34px; height: 34px; }
.you { margin-left: 6px; font-size: 12px; font-weight: 500; color: var(--muted); }

.badge {
  display: inline-flex; align-items: center; gap: 5px; width: fit-content;
  padding: 2px 9px; border-radius: 99px;
  font-size: 12px; font-weight: 650;
  background: var(--surface-2); color: var(--muted);
}
.badge .i { width: 13px; height: 13px; }
.badge.admin { background: var(--accent-soft); color: var(--accent-text); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 550; background: var(--surface-2); color: var(--muted); }
.chip.on { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12.5px; }

/* ------------------------------------------------------------------ */
/* Boîtes de dialogue                                                  */
/* ------------------------------------------------------------------ */
dialog { color: var(--text); }
dialog::backdrop { background: rgba(10, 12, 20, .45); backdrop-filter: blur(3px); }

.dialog {
  width: min(460px, calc(100vw - 32px)); padding: 0;
  border: 1px solid var(--border); border-radius: 18px;
  background: var(--surface); box-shadow: var(--shadow);
}
.dialog[open] { animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(6px); } }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 4px; }
.dlg-head h2 { font-size: 18px; }
.dlg-body { padding: 14px 20px 4px; }
.dlg-body p { margin: 0 0 14px; color: var(--muted); }
.dlg-body .form-error { margin-top: 4px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 18px; }

/* Aperçu */
.preview {
  width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; background: rgba(8, 9, 14, .92); color: #fff;
}
.preview::backdrop { background: transparent; }
.preview[open] { display: flex; flex-direction: column; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.pv-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.pv-title { display: grid; min-width: 0; flex: 1; }
.pv-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-title span { font-size: 12px; color: rgba(255,255,255,.6); }
.pv-head .icon-btn { color: rgba(255,255,255,.75); }
.pv-head .icon-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.pv-head .ficon .doc { fill: #2a2f3d; stroke: #474f63; }
.pv-head .ficon .fold { fill: #333a4b; stroke: #474f63; }
.pv-stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; padding: 0 72px 24px; }
.pv-body { display: grid; place-items: center; width: 100%; height: 100%; min-height: 0; }
.pv-body img, .pv-body video { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.pv-body iframe { width: 100%; height: 100%; border: 0; border-radius: 8px; background: #fff; }
.pv-body pre {
  width: min(1000px, 100%); height: 100%; margin: 0; padding: 20px; overflow: auto;
  border-radius: 12px; background: #11141c; color: #dfe3ee;
  font: 13px/1.6 ui-monospace, "Cascadia Code", Consolas, monospace; white-space: pre-wrap; word-break: break-word;
}
.pv-audio { display: grid; justify-items: center; gap: 24px; }
.pv-audio audio { width: min(420px, 80vw); }
.pv-msg { display: grid; justify-items: center; gap: 12px; color: rgba(255,255,255,.7); }
.pv-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 44px; height: 44px;
  border: 0; border-radius: 50%; background: rgba(255,255,255,.1); color: #fff; cursor: pointer;
}
.pv-nav:hover { background: rgba(255,255,255,.2); }
.pv-nav.prev { left: 16px; }
.pv-nav.next { right: 16px; }

/* ------------------------------------------------------------------ */
/* Glisser-déposer, envois, notifications                              */
/* ------------------------------------------------------------------ */
.dropzone {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 16%, rgba(10, 12, 20, .35));
  backdrop-filter: blur(2px); pointer-events: none;
  animation: fade .12s;
}
.dropzone-card {
  display: grid; justify-items: center; gap: 6px; padding: 36px 48px;
  border: 2px dashed var(--accent); border-radius: 22px;
  background: var(--surface); box-shadow: var(--shadow); text-align: center;
}
.dropzone-card .i { width: 36px; height: 36px; color: var(--accent); margin-bottom: 6px; }
.dropzone-card strong { font-size: 18px; }

.uploads {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  width: min(360px, calc(100vw - 32px)); max-height: 50vh; display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow);
  animation: rise .2s ease-out;
}
.uploads-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--border); }
.uploads-list { overflow-y: auto; padding: 6px 0; }
.up-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 8px 16px; }
.up-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; font-size: 13px; }
.up-status { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.up-item.done .up-status { color: var(--success); }
.up-item.error .up-status { color: var(--danger); }
.up-item .meter { grid-column: 1 / -1; height: 4px; }
.up-item.done .meter-fill { background: var(--success); }
.up-item.error .meter-fill { background: var(--danger); }

.toasts { position: fixed; left: 50%; bottom: 24px; z-index: 100; transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-radius: 12px;
  background: #1c2030; color: #fff; box-shadow: 0 10px 30px -8px rgba(0,0,0,.45);
  font-weight: 550; animation: rise .2s ease-out;
}
.toast .i { width: 17px; height: 17px; color: #6ee7b7; }
.toast.error .i { color: #ff8a8f; }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */
@media (max-width: 1080px) {
  .users .row { grid-template-columns: minmax(0, 1.4fr) 100px minmax(0, 1.2fr) 84px; }
  .users .c-root, .users .c-login { display: none; }
}

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--sidebar-w);
    transform: translateX(-100%); transition: transform .22s ease;
  }
  body.menu-open .sidebar { transform: none; box-shadow: var(--shadow); }
  body.menu-open .scrim { display: block; position: fixed; inset: 0; z-index: 20; background: rgba(10, 12, 20, .4); }
  .menu-btn { display: inline-grid; }
  .view { padding: 12px 16px 40px; }
  .topbar { flex-wrap: wrap; }
  .topbar-actions { width: 100%; }
  #view-users .topbar-actions { width: auto; }
  .search { flex: 1; width: auto; }
  .row { grid-template-columns: minmax(0, 1fr) auto; }
  .row .c-date, .row.head .c-size { display: none; }
  .row .c-size { display: none; }
  .c-actions, .card-actions { opacity: 1; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .users .row { grid-template-columns: minmax(0, 1fr) auto; }
  .users .c-role, .users .c-perms { display: none; }
  .pv-stage { padding: 0 8px 16px; }
  .pv-nav { top: auto; bottom: 24px; transform: none; }
}

@media (max-width: 480px) {
  .toolbar-actions { width: 100%; }
  .toolbar-actions .btn { flex: 1; }
  .crumbs { font-size: 15px; }
}

.mobile-only { display: none; }
@media (max-width: 860px) { .mobile-only { display: block; } }
