/* =====================================================================
   NViNiO•Share™ — Design System v4 « Aurora Glass »
   ---------------------------------------------------------------------
   · Glassmorphism : surfaces translucides + flou d'arrière-plan sur un
     fond « aurore » qui épouse la couleur du thème choisi
   · 10 thèmes de couleur : chaque palette = 3 variables (--p, --pd, --p2)
     d'où dérivent TOUS les accents (clair, sombre, dégradés, fonds teintés)
   · Modes clair / sombre / auto, contrastes WCAG AA vérifiés
   · Toutes les classes historiques sont conservées (pages + JS inchangés)
   ===================================================================== */

/* ------------------------------------------------------------ Jetons */
:root {
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --fs-2xs: 11.5px; --fs-xs: 12.5px; --fs-sm: 13.5px; --fs-md: 14.5px;
  --fs-lg: 16px;    --fs-xl: 18px;   --fs-2xl: 21px;  --fs-3xl: 26px; --fs-4xl: 34px;

  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px;
  --sp-6: 24px; --sp-7: 32px; --sp-8: 40px; --sp-9: 48px;

  --r-xs: 8px; --r-sm: 11px; --r-md: 14px; --r-lg: 20px; --r-xl: 28px; --r-full: 999px;
  --r-pill: var(--r-full);
  --radius: var(--r-md); --radius-lg: var(--r-lg); --radius-xl: var(--r-xl);

  --dur-1: 120ms; --dur-2: 200ms; --dur-3: 320ms;
  --ease: cubic-bezier(.4, 0, .2, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);
  --transition: var(--dur-2) var(--ease);
  --transition-fast: var(--dur-1) var(--ease);

  --sidebar-w: 284px;
  --topbar-h: 64px;
  --blur: 18px;

  /* ---- Palette par défaut : émeraude. Une palette = 3 couleurs.
         --p  : couleur en mode clair   --pd : couleur en mode sombre
         --p2 : teinte complémentaire pour les dégradés / l'aurore */
  --p: #0e9f6e; --pd: #34d399; --p2: #06b6d4;

  --danger: #dc2626; --danger-hover: #b91c1c; --danger-strong: #c81e1e;
  --danger-soft: rgba(220, 38, 38, .11);
  --warning: #b45309; --warning-soft: rgba(217, 119, 6, .14);
  --info: #6d4fe0;    --info-soft: rgba(109, 79, 224, .12);
  --success: var(--accent); --success-soft: var(--accent-soft);

  /* Couleurs de graphiques (catégorielles) — la 1re suit le thème */
  --chart-1: var(--accent); --chart-2: var(--p2);
  --chart-3: #f59e0b; --chart-4: #ec4899; --chart-5: #8b5cf6;
  --chart-6: #14b8a6; --chart-7: #f97316; --chart-8: #64748b;
}

/* ---- Thèmes de couleur (choix utilisateur) ------------------------- */
html[data-palette="emerald"]  { --p: #0e9f6e; --pd: #34d399; --p2: #06b6d4; }
html[data-palette="teal"]     { --p: #0d9488; --pd: #2dd4bf; --p2: #3b82f6; }
html[data-palette="ocean"]    { --p: #2563eb; --pd: #60a5fa; --p2: #06b6d4; }
html[data-palette="indigo"]   { --p: #4f46e5; --pd: #818cf8; --p2: #a855f7; }
html[data-palette="violet"]   { --p: #7c3aed; --pd: #a78bfa; --p2: #ec4899; }
html[data-palette="fuchsia"]  { --p: #c026d3; --pd: #e879f9; --p2: #f43f5e; }
html[data-palette="rose"]     { --p: #e11d48; --pd: #fb7185; --p2: #f97316; }
html[data-palette="orange"]   { --p: #ea580c; --pd: #fb923c; --p2: #eab308; }
html[data-palette="amber"]    { --p: #d97706; --pd: #fbbf24; --p2: #ef4444; }
html[data-palette="graphite"] { --p: #475569; --pd: #94a3b8; --p2: #0ea5e9; }

/* ---- Mode clair (défaut) ------------------------------------------- */
:root {
  --accent: var(--p);
  --accent-hover: color-mix(in srgb, var(--p) 86%, #000);
  --accent-strong: color-mix(in srgb, var(--p) 78%, #000);
  --accent-text: color-mix(in srgb, var(--p) 64%, #000);
  --accent-soft: color-mix(in srgb, var(--p) 15%, transparent);
  --accent-softer: color-mix(in srgb, var(--p) 8%, transparent);
  --accent-contrast: #ffffff;
  --accent-2: var(--p2);
  --grad: linear-gradient(135deg, var(--accent-strong), color-mix(in srgb, var(--p2) 22%, var(--accent-strong)));
  --grad-soft: linear-gradient(135deg, color-mix(in srgb, var(--p) 18%, transparent), color-mix(in srgb, var(--p2) 14%, transparent));

  --bg: color-mix(in srgb, var(--p) 4%, #f3f5f9);
  --bg-elevated: #ffffff;
  --bg-sunken: color-mix(in srgb, var(--p) 5%, #eaeef3);
  --bg-hover: rgba(15, 23, 42, .05);
  --bg-active: rgba(15, 23, 42, .09);
  --glass: rgba(255, 255, 255, .62);
  --glass-strong: rgba(255, 255, 255, .84);
  --glass-border: rgba(255, 255, 255, .75);
  --glass-hi: inset 0 1px 0 rgba(255, 255, 255, .85);
  --field-bg: rgba(255, 255, 255, .72);
  --text: #0f172a;
  --text-soft: #475569;
  --text-faint: #5a6679;
  --border: rgba(15, 23, 42, .09);
  --border-strong: rgba(15, 23, 42, .17);
  --overlay: rgba(15, 23, 42, .45);
  --scroll-thumb: rgba(15, 23, 42, .2);
  --topbar-bg: rgba(255, 255, 255, .66);
  --sidebar-bg: rgba(255, 255, 255, .66);

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .05);
  --shadow: 0 2px 4px rgba(15, 23, 42, .04), 0 10px 30px rgba(15, 23, 42, .09);
  --shadow-lg: 0 6px 16px rgba(15, 23, 42, .09), 0 28px 64px rgba(15, 23, 42, .18);
  --glow: 0 8px 28px color-mix(in srgb, var(--p) 32%, transparent);
  --ring: 0 0 0 3px var(--accent-soft);
  --hero-glow-1: color-mix(in srgb, var(--p) 18%, transparent);
  --hero-glow-2: color-mix(in srgb, var(--p2) 12%, transparent);
  --aurora-op: .9;
  color-scheme: light;
}

/* ---- Mode sombre --------------------------------------------------- */
html[data-theme="dark"] {
  --accent: var(--pd);
  --accent-hover: color-mix(in srgb, var(--pd) 82%, #fff);
  --accent-strong: var(--pd);
  --accent-text: color-mix(in srgb, var(--pd) 58%, #fff);
  --accent-soft: color-mix(in srgb, var(--pd) 19%, transparent);
  --accent-softer: color-mix(in srgb, var(--pd) 10%, transparent);
  --accent-contrast: #05100c;
  --accent-2: color-mix(in srgb, var(--p2) 70%, #fff);
  --grad: linear-gradient(135deg, var(--pd), color-mix(in srgb, var(--p2) 40%, var(--pd)));
  --grad-soft: linear-gradient(135deg, color-mix(in srgb, var(--pd) 22%, transparent), color-mix(in srgb, var(--p2) 16%, transparent));

  --bg: color-mix(in srgb, var(--p) 5%, #080b10);
  --bg-elevated: #121821;
  --bg-sunken: #0c1117;
  --bg-hover: rgba(255, 255, 255, .06);
  --bg-active: rgba(255, 255, 255, .105);
  --glass: rgba(22, 29, 39, .56);
  --glass-strong: rgba(18, 24, 33, .82);
  --glass-border: rgba(255, 255, 255, .09);
  --glass-hi: inset 0 1px 0 rgba(255, 255, 255, .06);
  --field-bg: rgba(255, 255, 255, .045);
  --text: #eef2f7;
  --text-soft: #a9b4c3;
  --text-faint: #8d99a9;
  --border: rgba(255, 255, 255, .085);
  --border-strong: rgba(255, 255, 255, .16);
  --overlay: rgba(2, 5, 9, .66);
  --scroll-thumb: rgba(255, 255, 255, .18);
  --topbar-bg: rgba(14, 19, 27, .62);
  --sidebar-bg: rgba(14, 19, 27, .62);
  --danger: #f06060; --danger-hover: #f78787; --danger-strong: #b91c1c;
  --warning: #f5a524; --warning-soft: rgba(245, 165, 36, .16);
  --info: #a995fb; --info-soft: rgba(169, 149, 251, .17);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45);
  --shadow: 0 2px 6px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .45);
  --shadow-lg: 0 6px 16px rgba(0, 0, 0, .5), 0 30px 70px rgba(0, 0, 0, .62);
  --glow: 0 8px 30px color-mix(in srgb, var(--pd) 26%, transparent);
  --hero-glow-1: color-mix(in srgb, var(--pd) 20%, transparent);
  --hero-glow-2: color-mix(in srgb, var(--p2) 14%, transparent);
  --aurora-op: .75;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --accent: var(--pd);
    --accent-hover: color-mix(in srgb, var(--pd) 82%, #fff);
    --accent-strong: var(--pd);
    --accent-text: color-mix(in srgb, var(--pd) 58%, #fff);
    --accent-soft: color-mix(in srgb, var(--pd) 19%, transparent);
    --accent-softer: color-mix(in srgb, var(--pd) 10%, transparent);
    --accent-contrast: #05100c;
    --accent-2: color-mix(in srgb, var(--p2) 70%, #fff);
    --grad: linear-gradient(135deg, var(--pd), color-mix(in srgb, var(--p2) 40%, var(--pd)));
    --grad-soft: linear-gradient(135deg, color-mix(in srgb, var(--pd) 22%, transparent), color-mix(in srgb, var(--p2) 16%, transparent));
    --bg: color-mix(in srgb, var(--p) 5%, #080b10);
    --bg-elevated: #121821;
    --bg-sunken: #0c1117;
    --bg-hover: rgba(255, 255, 255, .06);
    --bg-active: rgba(255, 255, 255, .105);
    --glass: rgba(22, 29, 39, .56);
    --glass-strong: rgba(18, 24, 33, .82);
    --glass-border: rgba(255, 255, 255, .09);
    --glass-hi: inset 0 1px 0 rgba(255, 255, 255, .06);
    --field-bg: rgba(255, 255, 255, .045);
    --text: #eef2f7;
    --text-soft: #a9b4c3;
    --text-faint: #8d99a9;
    --border: rgba(255, 255, 255, .085);
    --border-strong: rgba(255, 255, 255, .16);
    --overlay: rgba(2, 5, 9, .66);
    --scroll-thumb: rgba(255, 255, 255, .18);
    --topbar-bg: rgba(14, 19, 27, .62);
    --sidebar-bg: rgba(14, 19, 27, .62);
    --danger: #f06060; --danger-hover: #f78787; --danger-strong: #b91c1c;
    --warning: #f5a524; --warning-soft: rgba(245, 165, 36, .16);
    --info: #a995fb; --info-soft: rgba(169, 149, 251, .17);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45);
    --shadow: 0 2px 6px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .45);
    --shadow-lg: 0 6px 16px rgba(0, 0, 0, .5), 0 30px 70px rgba(0, 0, 0, .62);
    --glow: 0 8px 30px color-mix(in srgb, var(--pd) 26%, transparent);
    --hero-glow-1: color-mix(in srgb, var(--pd) 20%, transparent);
    --hero-glow-2: color-mix(in srgb, var(--p2) 14%, transparent);
    --aurora-op: .75;
    color-scheme: dark;
  }
}

/* ------------------------------------------------------------ Base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--bg); }
body {
  margin: 0; font-family: var(--font-sans); font-size: 14.5px; line-height: 1.55;
  color: var(--text); background: transparent; min-height: 100vh;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01";
}
img, svg, video { max-width: 100%; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .45em; font-weight: 720; letter-spacing: -.02em; line-height: 1.22; }
h1 { font-size: 26px; } h2 { font-size: 21px; } h3 { font-size: 16px; } h4 { font-size: 14.5px; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
code { font-family: var(--font-mono); font-size: .92em; background: var(--bg-sunken); padding: 2px 6px; border-radius: 6px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-soft); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
* { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 8px; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }
*::-webkit-scrollbar-track { background: transparent; }

/* Fond « aurore » : 3 masses de dégradés douces, teintées par le thème.
   Pas de filter:blur() (coûteux) — les dégradés radiaux sont déjà diffus. */
body::before, body::after { content: ""; position: fixed; z-index: -1; pointer-events: none; will-change: transform; }
body::before {
  inset: -20vmax;
  background:
    radial-gradient(38vmax 32vmax at 12% 8%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 70%),
    radial-gradient(34vmax 30vmax at 92% 14%, color-mix(in srgb, var(--p2) 19%, transparent), transparent 70%),
    radial-gradient(40vmax 34vmax at 70% 98%, color-mix(in srgb, var(--accent) 17%, transparent), transparent 72%);
  opacity: var(--aurora-op);
  animation: nvAurora 38s ease-in-out infinite alternate;
}
body::after {
  inset: 0; opacity: .5;
  background-image: radial-gradient(color-mix(in srgb, var(--text) 9%, transparent) 1px, transparent 1.2px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000, transparent 72%);
          mask-image: radial-gradient(ellipse at 50% 0%, #000, transparent 72%);
}
@keyframes nvAurora {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  50%  { transform: translate3d(2.5vw, 2vh, 0) rotate(5deg) scale(1.06); }
  100% { transform: translate3d(-2vw, 3vh, 0) rotate(-4deg) scale(1.1); }
}

/* ------------------------------------------------------------ Utilitaires */
.max-h-scroll { max-height: 24rem; overflow-y: auto; }
.text-soft { color: var(--text-soft); } .text-faint { color: var(--text-faint); }
.text-danger { color: var(--danger); } .text-accent { color: var(--accent-text); } .text-warning { color: var(--warning); }
.mono { font-family: var(--font-mono); font-size: .93em; }
.nowrap { white-space: nowrap; } .w-100 { width: 100%; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; } .mt-4 { margin-top: 28px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 20px; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.flex-wrap { flex-wrap: wrap; } .flex-1 { flex: 1; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 20px; }
.stack { display: flex; flex-direction: column; }
.gap-1 { gap: 6px; } .gap-2 { gap: 10px; } .gap-3 { gap: 16px; }
.section { margin-bottom: 24px; }
.cluster { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.cluster.center { justify-content: center; }
.truncate { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.divider-v { width: 1px; align-self: stretch; background: var(--border); }
@media (max-width: 640px) { .hide-sm { display: none !important; } }
@media (min-width: 901px) { .show-mobile { display: none !important; } }
.section-eyebrow, .page-eyebrow {
  display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-2xs); font-weight: 720;
  letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); margin-bottom: 6px;
}
.section-title { font-size: var(--fs-lg); font-weight: 700; margin: 0 0 12px; display: flex; align-items: center; gap: 9px; letter-spacing: -.015em; }
.section-title .icon { width: 17px; height: 17px; color: var(--accent-text); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ------------------------------------------------------------ Icônes & boutons */
.icon-tile {
  width: 36px; height: 36px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--grad-soft); color: var(--accent); flex: none;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent);
}
.icon-tile .icon { width: 18px; height: 18px; }
.icon-tile img { width: 100%; height: 100%; object-fit: cover; border-radius: 11px; }
.icon-tile.accent { background: var(--accent-soft); color: var(--accent); }
.icon-tile.danger { background: var(--danger-soft); color: var(--danger); box-shadow: none; }
.icon-tile.warning { background: var(--warning-soft); color: var(--warning); box-shadow: none; }
.icon-tile-lg { width: 46px; height: 46px; border-radius: 14px; } .icon-tile-lg .icon { width: 22px; height: 22px; }
.icon-tile-xl { width: 56px; height: 56px; border-radius: 17px; } .icon-tile-xl .icon { width: 27px; height: 27px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border-radius: 12px; border: 0; background: transparent; color: var(--text-soft); cursor: pointer;
  position: relative; flex: none; transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn:active { transform: scale(.93); }
.icon-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.icon-btn .icon { width: 19px; height: 19px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 17px;
  border-radius: var(--r-sm); border: 1px solid transparent; cursor: pointer; font: inherit; font-weight: 620;
  font-size: 14px; line-height: 1.2; color: var(--text); background: transparent; min-height: 40px;
  letter-spacing: -.005em; -webkit-tap-highlight-color: transparent; user-select: none; white-space: nowrap;
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition), transform var(--dur-1) var(--ease);
}
.btn:hover:not(:disabled) { text-decoration: none; }
.btn:active:not(:disabled) { transform: scale(.975); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn:focus-visible { outline: none; box-shadow: var(--ring), 0 0 0 1px var(--accent); }
.btn .icon { width: 17px; height: 17px; flex: none; }
.btn-primary {
  background: var(--grad); color: var(--accent-contrast); border-color: transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 1px 2px rgba(15, 23, 42, .16), 0 6px 18px color-mix(in srgb, var(--accent) 28%, transparent);
  background-size: 140% 100%; background-position: 0 0;
}
.btn-primary:hover:not(:disabled) { background-position: 100% 0; transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 2px 4px rgba(15, 23, 42, .16), 0 10px 26px color-mix(in srgb, var(--accent) 38%, transparent); }
.btn-secondary { background: var(--glass); border-color: var(--border-strong); color: var(--text); box-shadow: var(--shadow-sm); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.btn-secondary:hover:not(:disabled) { background: var(--glass-strong); border-color: color-mix(in srgb, var(--accent) 40%, var(--border-strong)); transform: translateY(-1px); }
.btn-quiet { background: var(--bg-sunken); border-color: var(--border); color: var(--text-soft); }
.btn-quiet:hover:not(:disabled) { background: var(--bg-hover); color: var(--text); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--bg-hover); }
.btn-soft { background: var(--accent-soft); color: var(--accent-text); }
.btn-soft:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 26%, transparent); }
.btn-danger { background: var(--danger); color: #fff; box-shadow: var(--shadow-sm); }
.btn-danger:hover:not(:disabled) { background: var(--danger-hover); }
.btn-danger-soft { background: var(--danger-soft); color: var(--danger); }
.btn-danger-soft:hover:not(:disabled) { background: var(--danger); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 13px; min-height: 34px; border-radius: 10px; } .btn-sm .icon { width: 15px; height: 15px; }
.btn-lg { padding: 13px 26px; font-size: 15.5px; min-height: 50px; border-radius: var(--r-md); }
.btn-icon { padding: 0; width: 40px; height: 40px; border-radius: 12px; flex: none; }
.btn-icon.btn-sm { width: 34px; height: 34px; border-radius: 10px; }
.btn-block { width: 100%; }
.files-toolbar .btn.active { background: var(--accent-soft); color: var(--accent); }

/* ------------------------------------------------------------ Formulaires */
.field { margin-bottom: 16px; }
.label { display: block; font-size: 13px; font-weight: 640; color: var(--text-soft); margin-bottom: 6px; letter-spacing: .01em; }
.field:focus-within > .label { color: var(--text); }
.hint { font-size: 12.5px; color: var(--text-faint); margin-top: 5px; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px 16px; align-items: end; }
.form-grid .field { margin-bottom: 0; }
.form-grid-switches { margin-top: 14px; }
.input, .select, textarea.input {
  width: 100%; padding: 9.5px 13px; min-height: 43px; font: inherit; font-size: var(--fs-md); color: var(--text);
  background: var(--field-bg); border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.input:hover, .select:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border-strong)); }
.input:focus, .select:focus, textarea.input:focus { outline: none; border-color: var(--accent); background: var(--bg-elevated); box-shadow: var(--ring); }
.input::placeholder { color: var(--text-faint); }
.input:disabled, .select:disabled, .input[readonly] { opacity: .62; cursor: not-allowed; background: var(--bg-sunken); }
.input:invalid:not(:placeholder-shown) { border-color: var(--danger); }
.input[type="password"] { letter-spacing: .06em; }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.6; }
.select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 36px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238d99a9' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.select option { background: var(--bg-elevated); color: var(--text); }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; cursor: pointer; }
.checkbox-row input[type="checkbox"] { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--accent); cursor: pointer; }
.checkbox-row .lbl { font-size: 14px; } .checkbox-row .sub { display: block; font-size: 12.5px; color: var(--text-faint); }
.form-error { color: var(--danger); font-size: 13px; margin-top: 6px; display: none; }
.form-error.show { display: block; }
.form-ok { color: var(--success); font-size: 13px; margin-top: 6px; display: none; }
.form-ok.show { display: block; background: var(--success-soft); }
.auth-card .form-error.show, .auth-card .form-ok.show {
  padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
  background: color-mix(in srgb, currentColor 8%, transparent); font-weight: 560;
}
.input-group { display: flex; gap: 8px; } .input-group > * { flex: 1; }
label.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text-soft); cursor: pointer; padding: 4px 2px; border-radius: 7px; }
label.chk input { accent-color: var(--accent); } label.chk:hover { color: var(--text); }
.otp-input { text-align: center; font-size: 22px; letter-spacing: .45em; font-family: var(--font-mono); }

.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--border-strong); border-radius: 26px; transition: background var(--transition), box-shadow var(--transition); cursor: pointer; }
.switch .track::before {
  content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%;
  transition: transform var(--dur-3) var(--ease-spring); box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
.switch input:checked + .track { background: var(--grad); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent), 0 4px 12px color-mix(in srgb, var(--accent) 30%, transparent); }
.switch input:checked + .track::before { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------------ Cartes (verre) */
.card {
  position: relative; background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm), var(--glass-hi);
  backdrop-filter: blur(var(--blur)) saturate(1.6); -webkit-backdrop-filter: blur(var(--blur)) saturate(1.6);
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}
.card-pad { padding: var(--sp-6); }
.card-hover:hover { box-shadow: var(--shadow), var(--glass-hi); border-color: color-mix(in srgb, var(--accent) 30%, var(--glass-border)); transform: translateY(-3px); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: var(--sp-5) var(--sp-6) 0; flex-wrap: wrap; }
.card-head h3, .card-head .section-title { margin: 0; }
.card-head a.text-faint { font-size: var(--fs-xs); font-weight: 600; transition: color var(--transition-fast); }
.card-head a.text-faint:hover { color: var(--accent-text); text-decoration: none; }
.card > .card-pad { padding: var(--sp-4) var(--sp-5) var(--sp-5); }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 650;
  line-height: 1.45; background: var(--bg-sunken); color: var(--text-soft); border: 1px solid var(--border); white-space: nowrap;
}
.badge-accent { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge-info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge .icon { width: 13px; height: 13px; flex: none; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); display: inline-block; flex: none; }
.dot.on { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); } .dot.off { background: var(--danger); }

.avatar {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; overflow: hidden;
  background: var(--grad); color: var(--accent-contrast); border: 2px solid var(--glass-strong);
  font-size: 13px; font-weight: 720; flex: none; user-select: none; cursor: pointer; padding: 0;
  box-shadow: 0 2px 10px color-mix(in srgb, var(--accent) 28%, transparent); transition: box-shadow var(--transition), transform var(--transition);
}
.avatar:hover { box-shadow: var(--ring), 0 4px 14px color-mix(in srgb, var(--accent) 36%, transparent); transform: scale(1.05); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 76px; height: 76px; font-size: 26px; } .avatar-sm { width: 28px; height: 28px; font-size: 11px; border-width: 1.5px; }
.avatar-xl { width: 84px; height: 84px; font-size: 28px; }

/* ------------------------------------------------------------ Tableaux */
.table-wrap { overflow-x: auto; border: 1px solid var(--glass-border); border-radius: var(--radius-lg); background: var(--glass); box-shadow: var(--shadow-sm), var(--glass-hi); backdrop-filter: blur(var(--blur)) saturate(1.5); -webkit-backdrop-filter: blur(var(--blur)) saturate(1.5); }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: var(--fs-2xs); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint);
  padding: 13px var(--sp-4); border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg-sunken) 55%, transparent); white-space: nowrap;
}
.table td { padding: 13px var(--sp-4); border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--transition-fast); }
.table tbody tr:hover { background: var(--bg-hover); }
.table tbody tr:focus-within { background: var(--accent-softer); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table th.sortable { cursor: pointer; user-select: none; transition: color var(--transition-fast); }
.table th.sortable:hover { color: var(--accent-text); }

.progress { height: 8px; background: var(--bg-sunken); border-radius: 999px; overflow: hidden; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .08); }
.progress > .bar { height: 100%; width: 0%; border-radius: 999px; background: var(--grad); transition: width 900ms var(--ease-out); position: relative; overflow: hidden; }
.progress > .bar::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .4) 50%, transparent 70%); animation: nvShine 3.2s ease-in-out infinite; }
.progress > .bar.danger { background: linear-gradient(90deg, var(--danger), #fb7185); }
.progress > .bar.warning { background: linear-gradient(90deg, var(--warning), #fbbf24); }
.progress-lg { height: 12px; } .progress-sm { height: 4px; }
@keyframes nvShine { from { transform: translateX(-120%); } to { transform: translateX(120%); } }

/* ------------------------------------------------------------ États */
.empty-state { text-align: center; padding: 72px 24px; color: var(--text-faint); }
.empty-state > .icon { width: 56px; height: 56px; margin: 0 auto 16px; display: block; color: var(--accent); opacity: .55; animation: nvFloat 5s ease-in-out infinite; }
.empty-state .icon-tile { margin: 0 auto 14px; } .empty-state .icon-tile .icon, .empty-state .btn .icon { width: 18px; height: 18px; margin: 0; opacity: 1; animation: none; }
.empty-state .title { font-weight: 680; color: var(--text-soft); margin-bottom: 6px; font-size: var(--fs-lg); }
.empty-state p { max-width: 46ch; margin-inline: auto; }
@keyframes nvFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.skeleton { background: linear-gradient(90deg, var(--bg-sunken) 25%, var(--bg-hover) 50%, var(--bg-sunken) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.spinner { width: 20px; height: 20px; border: 2.5px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin 700ms linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.center-loader { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px; color: var(--text-faint); }
.tooltip { position: relative; }
.tooltip::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 7px); left: 50%; transform: translateX(-50%) scale(.9);
  background: var(--text); color: var(--bg-elevated); font-size: 12px; font-weight: 540; padding: 5px 9px; border-radius: 8px;
  white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 140ms, transform 140ms; z-index: 95;
}
.tooltip:hover::after { opacity: 1; transform: translateX(-50%) scale(1); }

.tabs { display: flex; gap: 4px; margin-bottom: var(--sp-6); overflow-x: auto; scrollbar-width: none; padding: 5px; background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--r-md); width: fit-content; max-width: 100%; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--shadow-sm); }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 8px 16px; border: 0; background: transparent; cursor: pointer; font: inherit; font-size: var(--fs-sm); font-weight: 600; color: var(--text-soft); border-radius: var(--r-xs); white-space: nowrap; transition: color var(--transition), background var(--transition); }
.tab:hover { color: var(--text); background: var(--bg-hover); }
.tab.active { color: var(--accent-contrast); background: var(--grad); font-weight: 680; box-shadow: 0 3px 12px color-mix(in srgb, var(--accent) 32%, transparent); }

/* ------------------------------------------------------------ Menus, modales, toasts */
.dropdown { position: relative; display: inline-block; }
.dropdown .dd-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 224px; z-index: 65; padding: 6px; display: none;
  background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: var(--radius); box-shadow: var(--shadow-lg), var(--glass-hi);
  backdrop-filter: blur(22px) saturate(1.7); -webkit-backdrop-filter: blur(22px) saturate(1.7); animation: popIn 160ms var(--ease-spring); transform-origin: top right;
}
.dropdown.open .dd-menu { display: block; }
.dd-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 11px; border-radius: 9px; border: 0;
  background: transparent; font: inherit; font-size: 13.5px; font-weight: 560; color: var(--text); cursor: pointer; min-height: 37px;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.dd-item:hover { background: var(--accent-soft); color: var(--accent-text); text-decoration: none; }
.dd-item.danger { color: var(--danger); } .dd-item.danger:hover { background: var(--danger-soft); color: var(--danger); }
.dd-item .icon { width: 16px; height: 16px; flex: none; opacity: .85; }
.dd-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.dd-head { padding: 8px 11px 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-faint); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-menu--floating {
  position: fixed; display: block; z-index: 210; min-width: 224px; padding: 6px; max-height: min(65vh, 420px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: var(--radius); box-shadow: var(--shadow-lg), var(--glass-hi);
  backdrop-filter: blur(22px) saturate(1.7); -webkit-backdrop-filter: blur(22px) saturate(1.7); animation: ddFloatIn 140ms var(--ease-spring); transform-origin: top right;
}
.dd-menu--floating.menu-above { transform-origin: bottom right; }
.dd-menu--floating .dd-item { padding-inline: 11px 26px; }
@keyframes ddFloatIn { from { opacity: 0; transform: scale(.95) translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { transform: scale(.95) translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-backdrop { position: fixed; inset: 0; z-index: 70; background: var(--overlay); display: flex; align-items: center; justify-content: center; padding: 18px; animation: fadeIn 160ms ease; overflow-y: auto; backdrop-filter: blur(8px) saturate(1.3); -webkit-backdrop-filter: blur(8px) saturate(1.3); }
.modal {
  background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg), var(--glass-hi);
  width: 100%; max-width: 520px; max-height: calc(100dvh - 36px); display: flex; flex-direction: column; animation: popIn 260ms var(--ease-spring);
  backdrop-filter: blur(28px) saturate(1.7); -webkit-backdrop-filter: blur(28px) saturate(1.7);
}
.modal.modal-lg { max-width: 760px; } .modal.modal-xl { max-width: 1080px; height: calc(100dvh - 36px); }
.modal .m-head { display: flex; align-items: center; gap: 10px; padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); flex: none; }
.modal .m-head h3 { margin: 0; font-size: 16px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal .m-body { padding: var(--sp-5); overflow-y: auto; flex: 1; }
.modal .m-foot { display: flex; justify-content: flex-end; gap: 9px; padding: var(--sp-3) var(--sp-5); border-top: 1px solid var(--border); flex: none; flex-wrap: wrap; }
@media (max-width: 560px) {
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal { max-height: 96dvh; border-radius: var(--radius-xl) var(--radius-xl) 0 0; animation: sheetUp 300ms var(--ease-out); }
  .modal .m-foot { padding-bottom: max(14px, env(safe-area-inset-bottom)); } .modal .m-foot .btn { flex: 1; }
}
@keyframes sheetUp { from { transform: translateY(44px); opacity: .4; } to { transform: none; opacity: 1; } }

.toast-stack { position: fixed; top: max(16px, env(safe-area-inset-top)); right: 16px; z-index: 90; display: flex; flex-direction: column; gap: 10px; max-width: min(390px, calc(100vw - 24px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 11px; padding: 13px 16px; font-size: 13.5px; font-weight: 520;
  background: var(--glass-strong); border: 1px solid var(--glass-border); border-left: 3px solid var(--accent); border-radius: var(--radius);
  box-shadow: var(--shadow-lg), var(--glass-hi); backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6); animation: nvToastIn 300ms var(--ease-spring);
}
@keyframes nvToastIn { from { opacity: 0; transform: translateX(28px) scale(.96); } to { opacity: 1; transform: none; } }
.toast.out { opacity: 0; transform: translateX(28px); transition: all 220ms; }
.toast .icon { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.toast.success { border-left-color: var(--accent); } .toast.success .icon { color: var(--accent); }
.toast.error { border-left-color: var(--danger); } .toast.error .icon { color: var(--danger); }
.toast.warning { border-left-color: var(--warning); } .toast.warning .icon { color: var(--warning); }
.toast.info { border-left-color: var(--info); } .toast.info .icon { color: var(--info); }
@media (max-width: 640px) { .toast-stack { left: 12px; right: 12px; top: 12px; max-width: none; } }

/* ================================================================
   Shell applicatif : barre latérale (type Google Drive) + barre du haut
   ================================================================ */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: none; position: sticky; top: 0; height: 100vh; z-index: 40;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--sidebar-bg); border-right: 1px solid var(--glass-border);
  backdrop-filter: blur(24px) saturate(1.7); -webkit-backdrop-filter: blur(24px) saturate(1.7);
  box-shadow: 1px 0 0 var(--border), 30px 0 80px -50px color-mix(in srgb, var(--accent) 40%, transparent);
  transition: margin-left var(--dur-3) var(--ease-out), transform var(--dur-3) var(--ease-out);
}
.sidebar .brand {
  display: flex; align-items: center; gap: 11px; padding: 18px 20px 10px; flex: none;
  font-weight: 800; font-size: 17px; letter-spacing: -.02em; color: var(--text); text-decoration: none;
}
.sidebar .brand:hover { text-decoration: none; }
.sidebar .brand img { width: 32px; height: 32px; border-radius: 10px; transition: transform var(--dur-3) var(--ease-spring); box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent); }
.sidebar .brand:hover img { transform: scale(1.08) rotate(-5deg); }

/* Bouton « Nouveau » (style Drive) */
.sb-new { padding: 8px 16px 6px; flex: none; }
.sb-new .dropdown { display: block; }
.btn-new {
  display: inline-flex; align-items: center; gap: 12px; width: 100%; padding: 0 22px 0 16px; min-height: 52px;
  border: 0; border-radius: 18px; cursor: pointer; font: inherit; font-weight: 700; font-size: 15px; color: var(--accent-contrast);
  background: var(--grad); background-size: 150% 100%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), var(--glow);
  transition: transform var(--dur-2) var(--ease-spring), box-shadow var(--transition), background-position var(--dur-3) var(--ease);
}
.btn-new:hover { transform: translateY(-2px) scale(1.01); background-position: 100% 0; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 12px 34px color-mix(in srgb, var(--accent) 45%, transparent); }
.btn-new:active { transform: scale(.97); }
.btn-new:focus-visible { outline: none; box-shadow: var(--ring), var(--glow); }
.btn-new .plus { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255, 255, 255, .22); transition: transform var(--dur-3) var(--ease-spring); }
.btn-new .plus .icon { width: 16px; height: 16px; }
.btn-new[aria-expanded="true"] .plus { transform: rotate(135deg); }

.sb-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 6px 0 10px; scrollbar-gutter: stable; }
.nav-group { padding: 2px 12px 8px; }
.nav-group .group-label { font-size: 10.5px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); padding: 14px 12px 6px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 12px; margin: 1px 0; border-radius: 12px;
  color: var(--text-soft); font-weight: 560; font-size: 14px; transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}
.nav-item:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }
.nav-item:active { transform: scale(.985); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 680; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 16%, transparent); }
.nav-item.active::before { content: ""; position: absolute; left: -12px; top: 22%; bottom: 22%; width: 4px; border-radius: 0 4px 4px 0; background: var(--grad); }
.nav-item.has-active { color: var(--text); font-weight: 640; }
.nav-item .icon { width: 19px; height: 19px; flex: none; transition: transform var(--dur-2) var(--ease-spring); }
.nav-item:hover .icon { transform: scale(1.12); }
.nav-item .count { margin-left: auto; font-size: 11.5px; font-weight: 720; background: var(--bg-active); color: var(--text-soft); border-radius: 999px; padding: 1px 8px; }
.nav-item.active .count { background: var(--accent-strong); color: var(--accent-contrast); }

/* Ligne parente dépliable (Mes fichiers / Organisations) */
.nav-row { position: relative; }
.nav-row .nav-item { padding-right: 38px; }
.nav-caret {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-faint); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.nav-caret:hover { background: var(--bg-active); color: var(--text); }
.nav-caret .icon { width: 14px; height: 14px; transition: transform var(--dur-3) var(--ease-out); }
.nav-parent.open > .nav-row .nav-caret .icon { transform: rotate(90deg); }
.nav-row .nav-item .count { margin-right: 2px; }

/* Arborescence — repli animé sans re-rendu */
.tree-collapse { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--dur-3) var(--ease-out); }
.tree-collapse > * { overflow: hidden; min-height: 0; }
.nav-parent.open > .tree-collapse, .tree-node-item.open > .tree-collapse { grid-template-rows: 1fr; }
.nav-tree-scroll { padding: 2px 0 4px; }
.tree-node, .tree-children { list-style: none; margin: 0; padding: 0; }
.tree-node-item { list-style: none; margin: 0; padding: 0; }
.tree-row {
  --depth: 1; display: flex; align-items: center; gap: 2px; position: relative; min-height: 34px; margin: 1px 0;
  padding: 2px 8px 2px calc(8px + var(--depth) * 14px); border-radius: 10px; color: var(--text-soft); font-size: 13.5px; font-weight: 540;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.tree-row:hover { background: var(--bg-hover); color: var(--text); }
.tree-row.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 680; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 16%, transparent); }
.tree-row.active::before { content: ""; position: absolute; left: -12px; top: 22%; bottom: 22%; width: 4px; border-radius: 0 4px 4px 0; background: var(--grad); }
.tree-row.drop-target { background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent); }
.tree-caret {
  width: 20px; height: 20px; flex: none; border: 0; background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-faint); border-radius: 6px; padding: 0; transition: background var(--transition-fast), color var(--transition-fast);
}
.tree-caret:hover { color: var(--text); background: var(--bg-active); }
.tree-caret .icon { width: 12px; height: 12px; transition: transform var(--dur-3) var(--ease-out); }
.tree-caret.hidden { visibility: hidden; }
.tree-node-item.open > .tree-row > .tree-caret .icon, .tree-caret.expanded .icon { transform: rotate(90deg); }
.tree-link { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; color: inherit; text-decoration: none; padding: 5px 0; }
.tree-link:hover { text-decoration: none; }
.tree-link .icon { width: 17px; height: 17px; flex: none; color: var(--accent); fill: color-mix(in srgb, var(--accent) 18%, transparent); transition: transform var(--dur-2) var(--ease-spring); }
.tree-row:hover .tree-link .icon { transform: scale(1.1); }
.tree-node-item.open > .tree-row > .tree-link .icon, .tree-row.active .tree-link .icon { fill: color-mix(in srgb, var(--accent) 32%, transparent); }
.tree-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-count { font-size: 10.5px; font-weight: 650; color: var(--text-faint); background: var(--bg-sunken); border-radius: 999px; padding: 0 7px; line-height: 17px; flex: none; }
.tree-row.active .tree-count { background: var(--accent-soft); color: var(--accent-text); }
.tree-org-item > .tree-row .tree-link .icon { fill: color-mix(in srgb, var(--p2) 22%, transparent); color: var(--accent-2); }
.tree-org-head { display: flex; align-items: center; gap: 4px; }
.tree-org-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-loading, .tree-empty { font-size: 12.5px; color: var(--text-faint); padding: 8px 14px 8px 36px; line-height: 1.5; }
.tree-skeleton { height: 26px; margin: 5px 10px 5px 34px; border-radius: 8px; }
.tree-empty a { font-weight: 640; }

/* Stockage + utilisateur */
.sidebar-storage {
  flex: none; margin: 4px 14px 10px; padding: 14px 15px; border-radius: var(--r-md);
  background: var(--grad-soft); border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--glass-border));
}
.sidebar-storage .progress { height: 7px; background: color-mix(in srgb, var(--bg-sunken) 80%, transparent); }
.sidebar-user { flex: none; padding: 10px 14px 14px; border-top: 1px solid var(--border); }
.sidebar-user-link { display: flex; align-items: center; gap: 11px; padding: 8px; border-radius: 12px; transition: background var(--transition-fast); }
.sidebar-user-link:hover { background: var(--bg-hover); text-decoration: none; }
.sidebar-user-link .avatar { cursor: pointer; }
.sidebar-user-name { display: block; font-size: 13.5px; font-weight: 680; color: var(--text); line-height: 1.3; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-mail { display: block; font-size: 11.8px; color: var(--text-faint); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user .chev { margin-left: auto; width: 15px; height: 15px; color: var(--text-faint); flex: none; }
.sidebar-backdrop { position: fixed; inset: 0; background: var(--overlay); z-index: 39; opacity: 0; pointer-events: none; transition: opacity 240ms; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: 8px; padding: 0 24px;
  background: var(--topbar-bg); border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(22px) saturate(1.8); -webkit-backdrop-filter: blur(22px) saturate(1.8);
}
.topbar .search-box { flex: 1 1 140px; min-width: 0; max-width: 600px; position: relative; }
.topbar .search-box .input {
  padding-left: 42px; padding-right: 44px; min-height: 44px; border-radius: 999px; background: color-mix(in srgb, var(--bg-sunken) 78%, transparent); border-color: transparent; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .05);
}
.topbar .search-box .input:hover { border-color: var(--border-strong); }
.topbar .search-box .input:focus { background: var(--bg-elevated); border-color: var(--accent); }
.topbar .search-box .icon-search { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--text-faint); pointer-events: none; }
.search-kbd {
  position: absolute; right: 13px; top: 50%; transform: translateY(-50%); pointer-events: none; font: 600 11.5px var(--font-mono);
  color: var(--text-faint); border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 6px; padding: 0 6px; line-height: 18px;
}
.search-box .input:focus ~ .search-kbd { opacity: 0; }
.topbar .spacer { flex: 1; }
.topbar .badge-dot {
  position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 4px; background: var(--danger-strong); color: #fff; border-radius: 999px;
  font-size: 10.5px; font-weight: 720; display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg); animation: nvPing 2.4s ease-in-out infinite;
}
@keyframes nvPing { 0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .45); } 50% { box-shadow: 0 0 0 5px rgba(220, 38, 38, 0); } }
.topbar-upload { display: none; }

.page { padding: 30px 30px 40px; max-width: 1320px; width: 100%; margin: 0 auto; flex: 1; }
.page-header { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: var(--sp-6); }
.page-header h1 { margin: 0; font-size: clamp(22px, 2.4vw, 29px); letter-spacing: -.03em; line-height: 1.2; }
.page-header .page-sub { margin: 5px 0 0; color: var(--text-soft); font-size: 14px; max-width: 62ch; }
.page-header .actions { margin-left: auto; display: flex; gap: 9px; flex-wrap: wrap; align-self: center; }

@media (min-width: 901px) { body.sidebar-collapsed .sidebar { margin-left: calc(-1 * var(--sidebar-w)); } }
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; height: 100dvh; transform: translateX(-105%); box-shadow: var(--shadow-lg); background: var(--glass-strong); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  body.sidebar-open { overflow: hidden; }
  .page { padding: 18px 14px 28px; }
  .page-header .actions { margin-left: 0; width: 100%; } .page-header .actions .btn { flex: 1 1 auto; }
  .btn { min-height: 44px; } .btn-sm { min-height: 38px; }
  .topbar { gap: 4px; padding: 0 12px; } .topbar .icon-btn { width: 42px; height: 42px; }
  .topbar-upload { display: inline-flex; }
}
@media (max-width: 640px) { .topbar .spacer { display: none; } .search-kbd { display: none; } }
@media (max-width: 480px) { .topbar .search-box .input { padding-right: 14px; } }

/* ---- Sélecteur de thème (palette + mode) ---------------------------- */
.theme-menu { width: 288px; padding: 14px; }
.theme-menu .tm-title { font-size: 11px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); margin: 0 2px 10px; }
.theme-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 14px; }
.theme-swatch {
  position: relative; width: 100%; aspect-ratio: 1; border-radius: 50%; border: 0; cursor: pointer; padding: 0;
  background: linear-gradient(135deg, var(--sw1), var(--sw2)); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35), 0 2px 8px color-mix(in srgb, var(--sw1) 40%, transparent);
  transition: transform var(--dur-2) var(--ease-spring), box-shadow var(--transition);
}
.theme-swatch:hover { transform: scale(1.14); }
.theme-swatch.active { box-shadow: 0 0 0 2px var(--bg-elevated), 0 0 0 4px var(--sw1), 0 4px 14px color-mix(in srgb, var(--sw1) 50%, transparent); }
.theme-swatch.active::after { content: ""; position: absolute; inset: 0; margin: auto; width: 11px; height: 6px; border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff; transform: translateY(-1px) rotate(-45deg); filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .35)); }
.mode-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 3px; background: var(--bg-sunken); border-radius: 12px; }
.mode-seg button { border: 0; background: transparent; padding: 7px 4px; border-radius: 9px; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 620; color: var(--text-soft); display: flex; align-items: center; justify-content: center; gap: 6px; transition: background var(--transition-fast), color var(--transition-fast); }
.mode-seg button .icon { width: 14px; height: 14px; }
.mode-seg button:hover { color: var(--text); }
.mode-seg button.active { background: var(--bg-elevated); color: var(--accent-text); box-shadow: var(--shadow-sm); }
.theme-btn-dot { width: 20px; height: 20px; border-radius: 50%; background: linear-gradient(135deg, var(--p), var(--p2)); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .45), 0 2px 8px color-mix(in srgb, var(--accent) 40%, transparent); }

/* Sélecteur de palette (Paramètres → Profil) */
.palette-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 12px; max-width: 560px; }
.palette-dot {
  position: relative; height: 62px; border-radius: var(--r-md); cursor: pointer; border: 2px solid transparent; padding: 0; overflow: hidden;
  background: linear-gradient(135deg, var(--sw1, var(--p)), var(--sw2, var(--p2)));
  box-shadow: var(--shadow-sm), inset 0 0 0 1px rgba(255, 255, 255, .25); transition: transform var(--dur-2) var(--ease-spring), box-shadow var(--transition), border-color var(--transition);
}
.palette-dot span { position: absolute; left: 8px; bottom: 6px; font-size: 11.5px; font-weight: 700; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .45); }
.palette-dot:hover { transform: translateY(-3px) scale(1.03); box-shadow: var(--shadow); }
.palette-dot.active { border-color: var(--bg-elevated); box-shadow: 0 0 0 3px var(--sw1, var(--accent)), var(--shadow); }
.palette-dot.active::after { content: ""; position: absolute; right: 9px; top: 9px; width: 16px; height: 16px; border-radius: 50%; background: #fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/10px no-repeat; }

.breadcrumb { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 13.5px; color: var(--text-faint); margin-bottom: 16px; padding: 6px 8px; background: var(--glass); border: 1px solid var(--glass-border); border-radius: 999px; width: fit-content; max-width: 100%; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--shadow-sm); }
.breadcrumb a { color: var(--text-soft); padding: 4px 10px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; font-weight: 580; transition: background var(--transition-fast), color var(--transition-fast); }
.breadcrumb a:hover { background: var(--accent-soft); text-decoration: none; color: var(--accent-text); }
.breadcrumb .sep { color: var(--text-faint); opacity: .5; }
.breadcrumb .current { color: var(--text); font-weight: 700; padding: 4px 8px; }

/* ================================================================
   Gestionnaire de fichiers
   ================================================================ */
.files-toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 16px; }
.files-toolbar .spacer { flex: 1; }
.files-toolbar .select { width: auto; min-height: 40px; padding-top: 6px; padding-bottom: 6px; border-radius: 999px; padding-left: 16px; }
.files-toolbar .input { width: auto; min-width: 170px; max-width: 280px; border-radius: 999px; }
.view-toggle { display: inline-flex; background: var(--glass); border: 1px solid var(--glass-border); border-radius: 12px; padding: 3px; gap: 2px; }
.view-toggle button { border: 0; background: transparent; padding: 6px 10px; cursor: pointer; color: var(--text-faint); display: inline-flex; align-items: center; border-radius: 9px; min-height: 32px; transition: background var(--transition-fast), color var(--transition-fast); }
.view-toggle button:hover { color: var(--text); }
.view-toggle button.active { background: var(--bg-elevated); color: var(--accent-text); box-shadow: var(--shadow-sm); }

.fname { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--text); text-decoration: none; font-weight: 580; font-size: var(--fs-sm); }
.fname:hover { color: var(--accent-text); text-decoration: none; }
.fname-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fname-badges { display: inline-flex; gap: 4px; flex: none; } .fname-badges .badge { padding: 1px 8px; font-size: 11px; }
.ft-thumb { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; flex: none; background: var(--bg-sunken); box-shadow: 0 0 0 1px var(--border), var(--shadow-sm); }
.ft-icon { display: inline-flex; flex: none; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: 10px; background: var(--grad-soft); }
.ft-icon svg { width: 19px; height: 19px; }
.files-table th:first-child, .files-table td:first-child { width: 42px; padding-right: 0; }
.files-table td { padding: 10px var(--sp-4); }
.files-table .cell-actions { text-align: right; white-space: nowrap; }
.row-check { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.file-name-cell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.file-name-cell .meta { min-width: 0; }
.file-name-cell .name { font-weight: 590; color: var(--text); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; max-width: 100%; }
.file-name-cell .name:hover { color: var(--accent-text); }
.file-name-cell .sub { font-size: 12px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; opacity: 0; transition: opacity var(--transition-fast); }
tr:hover .row-actions, tr:focus-within .row-actions { opacity: 1; }
@media (hover: none) { .row-actions { opacity: 1; } }
.icon-mini-btn { width: 30px; height: 30px; border-radius: 9px; border: 0; background: transparent; color: var(--text-soft); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background var(--transition-fast), color var(--transition-fast); }
.icon-mini-btn:hover { background: var(--bg-active); color: var(--text); } .icon-mini-btn .icon { width: 16px; height: 16px; }
.row-selected, .files-table tr.row-selected { background: var(--accent-soft) !important; }
.fav-star { color: #f59e0b; }
.cell-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; }
.icon-share-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 10px; border: 0; background: transparent; color: var(--text-soft); cursor: pointer; padding: 0; transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast); }
.icon-share-btn:hover { background: var(--accent-soft); color: var(--accent); transform: scale(1.08); } .icon-share-btn .icon { width: 16px; height: 16px; }

/* Grille de cartes */
.files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: var(--sp-4); }
.file-card { cursor: pointer; position: relative; border-radius: var(--radius-lg); overflow: visible; }
.file-card .thumb {
  height: 132px; display: flex; align-items: center; justify-content: center; color: var(--accent); overflow: hidden; position: relative;
  background: var(--grad-soft); border-radius: calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) 0 0; text-decoration: none;
}
.file-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 500ms var(--ease-out); }
.file-card:hover .thumb img { transform: scale(1.07); }
.file-card .thumb .icon, .file-card .thumb svg { width: 46px; height: 46px; filter: drop-shadow(0 6px 14px color-mix(in srgb, var(--accent) 35%, transparent)); transition: transform var(--dur-3) var(--ease-spring); }
.file-card:hover .thumb svg { transform: scale(1.12) rotate(-3deg); }
.file-card .card-body { padding: 12px 14px; display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--border); }
.file-card .card-body .name { font-size: 13.5px; font-weight: 620; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.file-card .card-body .name:hover { color: var(--accent-text); text-decoration: none; }
.file-card .card-body .size { font-size: 12px; color: var(--text-faint); flex: none; }
.file-card .fav-badge { position: absolute; top: 9px; right: 48px; background: var(--glass-strong); border-radius: 999px; padding: 4px 6px; box-shadow: var(--shadow-sm); color: #f59e0b; font-size: 12px; line-height: 1; z-index: 3; }
.file-card .check { position: absolute; top: 10px; left: 10px; z-index: 3; width: 18px; height: 18px; accent-color: var(--accent); opacity: 0; transition: opacity var(--transition-fast); }
.file-card:hover .check, .file-card.selected .check, .file-card:focus-within .check { opacity: 1; }
@media (hover: none) { .file-card .check { opacity: 1; } }
.file-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.file-card .card-actions { position: absolute; top: 8px; right: 8px; display: inline-flex; gap: 4px; z-index: 3; opacity: 0; transition: opacity var(--transition-fast); }
.file-card:hover .card-actions, .file-card:focus-within .card-actions, .file-card .card-actions:has(.open) { opacity: 1; }
@media (hover: none) { .file-card .card-actions { opacity: 1; } }
.file-card .card-actions .btn, .file-card .card-actions .icon-share-btn { background: var(--glass-strong); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: var(--shadow-sm); width: 32px; height: 32px; border-radius: 10px; min-height: 0; }
.files-grid.mosaic { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.files-grid.mosaic .file-card .thumb { height: 180px; }
.files-grid.mosaic .file-card .thumb svg { width: 60px; height: 60px; }
.files-grid.mosaic .file-card .card-body { padding: 14px 16px; }
.files-grid.mosaic .file-card .card-body .name { font-size: 14px; font-weight: 650; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.35; }
.files-grid.mosaic .file-card .thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(15, 23, 42, .22)); opacity: 0; transition: opacity var(--transition); pointer-events: none; }
.files-grid.mosaic .file-card:hover .thumb::after { opacity: 1; }

/* Dossiers (arbre déplacer/copier) */
.folder-tree { border: 1px solid var(--border); border-radius: var(--radius); max-height: 300px; overflow-y: auto; background: var(--bg-elevated); }
.folder-tree .ft-item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; padding: 10px 14px; border: 0; background: transparent; cursor: pointer; text-align: left; font: inherit; color: var(--text); border-bottom: 1px solid var(--border); transition: background var(--transition-fast); }
.folder-tree .ft-item:last-child { border-bottom: 0; }
.folder-tree .ft-item:hover { background: var(--bg-hover); }
.folder-tree .ft-item.active { background: var(--accent-soft); color: var(--accent-text); }
.folder-tree .ft-item .ft-name { font-weight: 600; font-size: 13.5px; } .folder-tree .ft-item .ft-path { font-size: 11.5px; color: var(--text-faint); }
.tree-item { display: flex; align-items: center; gap: 8px; padding: 9px 10px; cursor: pointer; border-radius: 10px; margin: 2px 6px; font-size: 13.8px; transition: background var(--transition-fast); }
.tree-item:hover { background: var(--bg-hover); }
.tree-item.selected { background: var(--accent-soft); color: var(--accent-text); font-weight: 650; }
.tree-item .icon { width: 16px; height: 16px; color: var(--accent); }
.tree-item .t-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Barre d'actions groupées (verre flottant) */
.bulk-bar {
  position: fixed; bottom: 26px; left: 50%; transform: translate(-50%, calc(100% + 40px)); display: flex; align-items: center; gap: 6px; padding: 10px 14px;
  background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: 20px; box-shadow: var(--shadow-lg), var(--glass-hi); z-index: 35;
  backdrop-filter: blur(24px) saturate(1.8); -webkit-backdrop-filter: blur(24px) saturate(1.8); max-width: calc(100vw - 32px);
  transition: transform var(--dur-3) var(--ease-spring), opacity var(--dur-2) var(--ease), visibility var(--dur-2); opacity: 0; visibility: hidden; pointer-events: none;
}
.bulk-bar.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; pointer-events: auto; }
.bulk-bar .btn { white-space: nowrap; } .bulk-bar .count { font-weight: 700; padding: 0 10px; white-space: nowrap; color: var(--accent-text); }
@media (max-width: 640px) { .bulk-bar { bottom: max(12px, env(safe-area-inset-bottom)); flex-wrap: wrap; justify-content: center; } }

/* Dépôt + téléversement */
.dropzone-overlay { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--bg) 55%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); pointer-events: none; opacity: 0; transition: opacity 180ms; }
.dropzone-overlay.show { opacity: 1; }
.dropzone-overlay .dz-box { border: 2.5px dashed var(--accent); border-radius: var(--radius-xl); background: var(--glass-strong); color: var(--accent-text); font-weight: 700; font-size: 18px; padding: 48px 68px; display: flex; flex-direction: column; align-items: center; gap: 14px; box-shadow: var(--shadow-lg), var(--glow); margin: 20px; animation: nvFloat 3s ease-in-out infinite; }
.dropzone-overlay .icon { width: 46px; height: 46px; }
.upload-panel { position: fixed; right: 22px; bottom: 22px; width: 380px; max-width: calc(100vw - 32px); background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg), var(--glass-hi); z-index: 60; overflow: hidden; backdrop-filter: blur(24px) saturate(1.7); -webkit-backdrop-filter: blur(24px) saturate(1.7); transform-origin: bottom right; animation: slideUp 320ms var(--ease-spring); }
@keyframes slideUp { from { transform: translateY(24px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.upload-panel .up-head { display: flex; align-items: center; gap: 9px; padding: 14px 16px; border-bottom: 1px solid var(--border); font-weight: 700; } .upload-panel .up-head .spacer { flex: 1; }
.upload-panel .up-list { max-height: 320px; overflow-y: auto; }
.upload-item { padding: 12px 16px; border-bottom: 1px solid var(--border); } .upload-item:last-child { border-bottom: 0; }
.upload-item .u-row { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.upload-item .u-name { font-size: 13px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item .u-state { font-size: 12px; color: var(--text-faint); flex: none; } .upload-item .u-state.err { color: var(--danger); } .upload-item .u-state.ok { color: var(--accent-text); font-weight: 650; }
.upload-item .u-actions { display: flex; gap: 2px; margin-top: 4px; } .upload-item .u-speed { font-size: 11.5px; color: var(--text-faint); margin-top: 3px; }
@media (max-width: 640px) { .upload-panel { right: 10px; left: 10px; width: auto; bottom: max(10px, env(safe-area-inset-bottom)); } }

/* Prévisualisation */
.preview-layout { display: flex; min-height: 0; flex: 1; }
.preview-stage { flex: 1; min-width: 0; background: color-mix(in srgb, var(--bg-sunken) 85%, transparent); display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.preview-stage img { max-width: 100%; max-height: 100%; object-fit: contain; transition: transform 200ms; border-radius: 6px; }
.preview-stage iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.preview-stage video, .preview-stage audio { max-width: 100%; outline: none; }
.preview-stage .pv-zoomable { cursor: zoom-in; }
.preview-stage .pv-text { width: 100%; height: 100%; overflow: auto; padding: 18px; }
.preview-stage .pv-text pre { margin: 0; font-family: var(--font-mono); font-size: 12.8px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.preview-stage .pv-text table { border-collapse: collapse; width: max-content; min-width: 100%; }
.preview-stage .pv-text td, .preview-stage .pv-text th { border: 1px solid var(--border); padding: 4px 10px; font-size: 12.8px; text-align: left; }
.preview-stage .pv-csv th { background: var(--bg-sunken); position: sticky; top: 0; }
.pv-toolbar { position: absolute; top: 12px; right: 12px; display: flex; gap: 6px; z-index: 5; }
.pv-toolbar .icon-mini-btn { background: var(--glass-strong); box-shadow: var(--shadow-sm); border: 1px solid var(--glass-border); width: 36px; height: 36px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.pv-aside-toggle { display: none; } @media (max-width: 720px) { .pv-aside-toggle { display: inline-flex; } }
.preview-aside { width: 340px; flex: none; border-left: 1px solid var(--border); display: flex; flex-direction: column; background: color-mix(in srgb, var(--bg-elevated) 70%, transparent); }
.preview-aside .pa-tabs { display: flex; border-bottom: 1px solid var(--border); flex: none; }
.preview-aside .pa-tabs button { flex: 1; padding: 12px 6px; border: 0; background: transparent; font: inherit; font-size: 12.8px; font-weight: 640; color: var(--text-soft); cursor: pointer; border-bottom: 2px solid transparent; transition: color var(--transition-fast), border-color var(--transition-fast); }
.preview-aside .pa-tabs button.active { color: var(--accent-text); border-bottom-color: var(--accent); }
.preview-aside .pa-body { flex: 1; overflow-y: auto; padding: 16px; }
.preview-aside .pa-foot { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; flex: none; flex-wrap: wrap; }
@media (max-width: 720px) { .preview-aside { position: fixed; right: 0; top: 0; bottom: 0; z-index: 68; width: min(350px, 92vw); background: var(--glass-strong); box-shadow: var(--shadow-lg); transform: translateX(105%); transition: transform 300ms var(--ease-out); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); } .preview-aside.open { transform: translateX(0); } }
.detail-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: 13.2px; border-bottom: 1px dashed var(--border); } .detail-row:last-child { border-bottom: 0; }
.detail-row .k { color: var(--text-faint); flex: none; } .detail-row .v { text-align: right; word-break: break-all; min-width: 0; }
.comment-item { padding: 12px 0; border-bottom: 1px solid var(--border); } .comment-item:last-child { border-bottom: 0; }
.comment-item .c-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; } .comment-item .c-author { font-weight: 680; font-size: 13.2px; } .comment-item .c-date { font-size: 11.8px; color: var(--text-faint); margin-left: auto; }
.comment-item .c-body { font-size: 13.6px; white-space: pre-wrap; word-break: break-word; } .comment-item.resolved { opacity: .55; }
.share-person { display: flex; align-items: center; gap: 10px; padding: 9px 0; } .share-person .sp-name { font-weight: 600; font-size: 13.5px; } .share-person .sp-mail { font-size: 12px; color: var(--text-faint); }
.version-item { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 13px; } .version-item:last-child { border-bottom: 0; }
.expiry-choices { display: flex; gap: 7px; flex-wrap: wrap; }
.expiry-choices .choice { padding: 8px 15px; border: 1px solid var(--border-strong); background: var(--field-bg); border-radius: 999px; font-size: 13px; cursor: pointer; font-weight: 580; transition: border-color var(--transition-fast), background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast); }
.expiry-choices .choice:hover { border-color: var(--accent); transform: translateY(-1px); }
.expiry-choices .choice.active { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); font-weight: 700; }
.link-box { display: flex; gap: 8px; align-items: center; background: var(--bg-sunken); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 8px 10px; }
.link-box .lk { flex: 1; font-family: var(--font-mono); font-size: 12.6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-soft); }
.check-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 13.8px; } .check-row:last-child { border-bottom: 0; }

.list-row { display: flex; align-items: center; gap: 12px; padding: 12px var(--sp-4); border-bottom: 1px solid var(--border); transition: background var(--transition-fast); color: inherit; }
.list-row:hover { background: var(--bg-hover); text-decoration: none; } .list-row:last-child { border-bottom: 0; }
.notification-row { display: flex; gap: 12px; padding: 14px var(--sp-4); cursor: pointer; transition: background var(--transition-fast); border-radius: var(--r-sm); margin-bottom: 3px; }
.notification-row:hover { background: var(--bg-hover); } .notification-row.unread { background: var(--accent-softer); } .notification-row.unread:hover { background: var(--accent-soft); }
.notification-row .n-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); margin-top: 7px; flex: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.notification-row.read .n-dot { background: transparent; border: 1px solid var(--border-strong); box-shadow: none; }
.notification-list { display: flex; flex-direction: column; }

/* Mobile : le tableau de fichiers devient une liste de cartes */
@media (max-width: 720px) {
  .files-table thead { display: none; }
  .files-table, .files-table tbody, .files-table tr, .files-table td { display: block; width: 100%; }
  .files-table tr { position: relative; border-bottom: 1px solid var(--border); padding: 12px 14px 13px 44px; }
  .files-table tr:last-child { border-bottom: 0; }
  .files-table td { border: 0; padding: 0 !important; }
  .files-table td:first-child { position: absolute; left: 15px; top: 18px; width: auto; }
  .files-table td:nth-child(2) { padding-right: 78px !important; }
  .files-table .cell-size, .files-table .cell-date, .files-table .cell-who, .files-table .cell-owner { display: inline-block; width: auto; vertical-align: top; font-size: var(--fs-xs); color: var(--text-faint); margin: 4px 7px 0 0; max-width: 100%; }
  .files-table .cell-size::after { content: "·"; margin-left: 7px; opacity: .6; }
  .files-table .cell-role { display: inline-block; width: auto; margin-top: 4px; }
  .files-table .cell-actions { position: absolute; top: 9px; right: 9px; width: auto; }
  .files-table .fname { flex-wrap: wrap; } .files-table .fname-text { white-space: normal; overflow-wrap: anywhere; }
  .files-table .row-check { width: 18px; height: 18px; }
}

/* ================================================================
   Tableau de bord : hero, anneau de stockage, stats, graphiques
   ================================================================ */
.dash-hero {
  position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(240px, 1fr); gap: var(--sp-6); align-items: center;
  padding: clamp(22px, 3.2vw, 38px); margin-bottom: var(--sp-6); border-radius: var(--r-xl);
  background:
    radial-gradient(60% 120% at 100% 0%, color-mix(in srgb, var(--p2) 26%, transparent), transparent 60%),
    radial-gradient(70% 110% at 0% 100%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 62%),
    var(--glass);
  border: 1px solid var(--glass-border); box-shadow: var(--shadow), var(--glass-hi);
  backdrop-filter: blur(var(--blur)) saturate(1.6); -webkit-backdrop-filter: blur(var(--blur)) saturate(1.6);
}
.dash-hero::before, .dash-hero::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.dash-hero::before { width: 260px; height: 260px; right: -70px; top: -90px; background: var(--grad); opacity: .16; animation: nvOrb 14s ease-in-out infinite alternate; }
.dash-hero::after { width: 160px; height: 160px; left: 38%; bottom: -80px; background: var(--grad); opacity: .1; animation: nvOrb 18s ease-in-out infinite alternate-reverse; }
@keyframes nvOrb { from { transform: translate(0, 0) scale(1); } to { transform: translate(-24px, 18px) scale(1.18); } }
.dash-hero-text { position: relative; z-index: 1; min-width: 0; }
.dash-hero h1 { font-size: clamp(24px, 3.2vw, 36px); letter-spacing: -.035em; margin-bottom: 8px; }
.dash-hero .page-sub { color: var(--text-soft); font-size: 15px; max-width: 52ch; margin: 0 0 20px; }
.dash-hero .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.dash-hero-side { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 18px; min-width: 0; }
.ring-wrap { position: relative; width: 148px; height: 148px; flex: none; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring-track { fill: none; stroke: color-mix(in srgb, var(--text) 9%, transparent); stroke-width: 12; }
.ring-bar { fill: none; stroke: url(#nvRingGrad); stroke-width: 12; stroke-linecap: round; stroke-dasharray: 0 999; transition: stroke-dasharray 1.4s var(--ease-out); filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--accent) 45%, transparent)); }
.ring-bar.warning { stroke: var(--warning); } .ring-bar.danger { stroke: var(--danger); }
.ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ring-label strong { font-size: 30px; font-weight: 780; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.ring-label small { font-size: 11.5px; color: var(--text-faint); margin-top: 4px; font-weight: 600; }
.ring-meta { min-width: 0; }
.ring-meta .rm-title { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); }
.ring-meta .rm-val { font-size: 19px; font-weight: 740; letter-spacing: -.02em; margin: 3px 0 2px; }
.ring-meta .rm-sub { font-size: 12.5px; color: var(--text-soft); margin-bottom: 8px; }
@media (max-width: 860px) { .dash-hero { grid-template-columns: 1fr; } .dash-hero-side { justify-content: flex-start; } }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--sp-4); }
.stat-card { padding: var(--sp-5); overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; min-height: 142px; }
.stat-card::after { content: ""; position: absolute; width: 130px; height: 130px; right: -40px; bottom: -50px; border-radius: 50%; background: var(--grad); opacity: .07; transition: transform var(--dur-3) var(--ease-out), opacity var(--transition); pointer-events: none; }
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow), var(--glass-hi); }
.stat-card:hover::after { transform: scale(1.6); opacity: .13; }
.stat-card .stat-label { font-size: var(--fs-2xs); font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: .07em; }
.stat-card .stat-value { font-size: clamp(28px, 2.8vw, 34px); font-weight: 780; letter-spacing: -.035em; margin-top: 8px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat-card .stat-sub { font-size: var(--fs-xs); color: var(--text-faint); margin-top: 8px; position: relative; z-index: 1; }
.stat-card .stat-sub a { font-weight: 650; }
.stat-card .stat-icon { position: absolute; top: var(--sp-4); right: var(--sp-4); width: 42px; height: 42px; border-radius: 13px; background: var(--grad); color: var(--accent-contrast); display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 32%, transparent); transition: transform var(--dur-3) var(--ease-spring); }
.stat-card:hover .stat-icon { transform: scale(1.1) rotate(-6deg); }
.stat-card .stat-icon .icon { width: 21px; height: 21px; }
.stat-card .stat-icon.info { background: linear-gradient(135deg, #7c5cf0, #b06ef5); color: #fff; box-shadow: 0 6px 16px rgba(124, 92, 240, .32); }
.stat-card .stat-icon.warning { background: linear-gradient(135deg, #f59e0b, #f97316); color: #fff; box-shadow: 0 6px 16px rgba(245, 158, 11, .32); }
.stat-card .stat-icon.danger { background: linear-gradient(135deg, #ef4444, #f43f5e); color: #fff; }
.stat-card .stat-body { position: relative; z-index: 1; }
.stat-card .stat-foot { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 7px; font-size: var(--fs-xs); color: var(--text-soft); font-weight: 560; }
.stat-spark { display: block; width: 100%; height: 34px; margin-top: 10px; overflow: visible; }
.stat-spark path.s-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 400; stroke-dashoffset: 400; animation: nvDraw 1.4s var(--ease-out) .3s forwards; }
.stat-spark path.s-area { fill: url(#nvAreaGrad); opacity: 0; animation: nvFadeIn .8s ease .9s forwards; }
@keyframes nvDraw { to { stroke-dashoffset: 0; } }
@keyframes nvFadeIn { to { opacity: 1; } }

.shortcut-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); gap: var(--sp-3); }
.shortcut { display: flex; align-items: center; gap: var(--sp-3); padding: 14px 16px; border: 1px solid var(--glass-border); border-radius: var(--radius); background: var(--glass); color: var(--text); text-decoration: none; transition: border-color var(--transition), background var(--transition), transform var(--dur-2) var(--ease-spring), box-shadow var(--transition); }
.shortcut:hover { text-decoration: none; border-color: var(--accent); background: var(--accent-softer); transform: translateY(-3px); box-shadow: var(--shadow-sm), 0 8px 22px color-mix(in srgb, var(--accent) 16%, transparent); }
.shortcut-icon { width: 38px; height: 38px; border-radius: 12px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--grad-soft); color: var(--accent); transition: transform var(--dur-2) var(--ease-spring); }
.shortcut:hover .shortcut-icon { transform: scale(1.12) rotate(-5deg); }
.shortcut-icon .icon { width: 18px; height: 18px; }
.shortcut-title { font-size: var(--fs-sm); font-weight: 640; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Bande « Récents » avec vignettes */
.recent-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(176px, 1fr); gap: var(--sp-4); overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x proximity; }
.rc-card { scroll-snap-align: start; cursor: pointer; border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.rc-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.rc-thumb { height: 104px; display: flex; align-items: center; justify-content: center; background: var(--grad-soft); color: var(--accent); overflow: hidden; }
.rc-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 500ms var(--ease-out); }
.rc-card:hover .rc-thumb img { transform: scale(1.08); }
.rc-thumb .icon { width: 36px; height: 36px; filter: drop-shadow(0 6px 12px color-mix(in srgb, var(--accent) 35%, transparent)); }
.rc-info { padding: 11px 13px 12px; min-width: 0; border-top: 1px solid var(--border); }
.rc-name { font-size: 13.5px; font-weight: 640; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-meta { font-size: 11.8px; color: var(--text-faint); margin-top: 2px; }

/* Graphiques */
.charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: var(--sp-5); align-items: stretch; }
.chart-card { padding: var(--sp-5) var(--sp-6); display: flex; flex-direction: column; }
.chart-card .chart-title { font-size: var(--fs-lg); font-weight: 700; margin: 0 0 4px; letter-spacing: -.015em; }
.chart-card .chart-sub { font-size: var(--fs-xs); color: var(--text-faint); margin-bottom: var(--sp-4); }
.chart-card .chart-body { flex: 1; min-height: 212px; display: flex; align-items: center; justify-content: center; position: relative; }
.chart-card .chart-body > * { width: 100%; }
.chart-card svg { display: block; width: 100%; height: auto; max-height: 250px; }
.chart-card .empty-state { margin: auto; padding: 30px 8px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: var(--sp-4); font-size: var(--fs-xs); color: var(--text-soft); }
.chart-legend > span { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 7px; border-radius: 999px; background: var(--bg-sunken); font-weight: 560; }
.chart-legend .dot { width: 9px; height: 9px; border-radius: 3px; }
.nv-chart text { font-family: var(--font-sans); }
.nv-chart .axis { stroke: var(--border-strong); stroke-width: 1; }
.nv-chart .gridline { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 5; }
.nv-chart .tick-label { fill: var(--text-faint); font-size: 10.5px; }
.nv-chart .bar { fill: url(#nvBarGrad); transform-box: fill-box; transform-origin: bottom; animation: nvGrow 800ms var(--ease-out) backwards; transition: filter 140ms, opacity 140ms; }
.nv-chart .bar:hover { filter: brightness(1.15) drop-shadow(0 4px 8px color-mix(in srgb, var(--accent) 45%, transparent)); }
.nv-chart .bar.alt { opacity: .4; }
@keyframes nvGrow { from { transform: scaleY(0); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }
.nv-chart .area { fill: url(#nvAreaGrad); animation: nvFadeIn 1s ease .5s backwards; }
.nv-chart .line { fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1400; animation: nvDraw2 1.6s var(--ease-out) backwards; filter: drop-shadow(0 3px 6px color-mix(in srgb, var(--accent) 35%, transparent)); }
@keyframes nvDraw2 { from { stroke-dashoffset: 1400; } to { stroke-dashoffset: 0; } }
.nv-chart .dot-point { fill: var(--bg-elevated); stroke: var(--accent); stroke-width: 2; transition: r 140ms; animation: nvFadeIn .5s ease 1.2s backwards; }
.nv-chart .dot-point:hover { r: 5; }
.nv-chart .donut-seg { transition: opacity 140ms, stroke-width 200ms; animation: nvFadeIn .9s ease backwards; stroke-linecap: butt; }
.nv-chart .donut-seg:hover { opacity: .85; stroke-width: 30; }
.nv-chart .donut-center { fill: var(--text); font-weight: 780; letter-spacing: -.03em; }
.nv-chart .donut-sub { fill: var(--text-faint); font-size: 11px; }

/* ================================================================
   Pense-bêtes
   ================================================================ */
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: var(--sp-4); align-items: stretch; }
.note-card { padding: 16px 17px; border-radius: var(--radius-lg); border: 1px solid transparent; display: flex; flex-direction: column; gap: 9px; min-height: 156px; box-shadow: var(--shadow-sm); transition: transform var(--dur-2) var(--ease-spring), box-shadow var(--transition); }
.note-card:hover { transform: translateY(-4px) rotate(-.4deg); box-shadow: var(--shadow); }
.note-card.done { box-shadow: none; background-image: linear-gradient(var(--bg-sunken), var(--bg-sunken)); }
.note-card.done .note-title { text-decoration: line-through; color: var(--text-soft); } .note-card.done .note-body { opacity: .85; } .note-card.done .note-foot { opacity: .75; }
.note-card.pinned { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-soft), var(--shadow-sm); }
.note-title { font-weight: 690; font-size: 14.5px; line-height: 1.35; overflow-wrap: anywhere; }
.note-body { font-size: 13px; white-space: pre-wrap; word-break: break-word; flex: 1; opacity: .92; }
.note-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; } .note-meta .badge { font-size: 11px; padding: 2px 8px; }
.note-foot { display: flex; align-items: center; gap: 6px; font-size: 11.6px; margin-top: auto; padding-top: 4px; } .note-foot-spacer { flex: 1; }
.note-done { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; opacity: .9; } .note-done input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.note-foot .btn-icon { opacity: .6; } .note-card:hover .note-foot .btn-icon, .note-card:focus-within .note-foot .btn-icon { opacity: 1; }
.note-color-yellow { background: #fdf3c2; border-color: #e8d477; color: #4a3b00; }
.note-color-green  { background: #d7f0dd; border-color: #a3d6b3; color: #14432a; }
.note-color-blue   { background: #d8ecfa; border-color: #a8cdea; color: #0b3a58; }
.note-color-pink   { background: #fbdfe8; border-color: #eeb2c8; color: #55182d; }
.note-color-orange { background: #ffe7cd; border-color: #eec49b; color: #5c2e00; }
.note-color-gray   { background: var(--bg-sunken); border-color: var(--border-strong); color: var(--text); }
html[data-theme="dark"] .note-color-yellow { background: #3a3316; border-color: #5c5224; color: #f3e6ac; }
html[data-theme="dark"] .note-color-green  { background: #16342a; border-color: #275545; color: #b9ecd0; }
html[data-theme="dark"] .note-color-blue   { background: #14283a; border-color: #274a66; color: #bcdcf5; }
html[data-theme="dark"] .note-color-pink   { background: #3a1a26; border-color: #663046; color: #f5c1d4; }
html[data-theme="dark"] .note-color-orange { background: #382513; border-color: #664524; color: #f7d5ad; }
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .note-color-yellow { background: #3a3316; border-color: #5c5224; color: #f3e6ac; }
  html[data-theme="auto"] .note-color-green  { background: #16342a; border-color: #275545; color: #b9ecd0; }
  html[data-theme="auto"] .note-color-blue   { background: #14283a; border-color: #274a66; color: #bcdcf5; }
  html[data-theme="auto"] .note-color-pink   { background: #3a1a26; border-color: #663046; color: #f5c1d4; }
  html[data-theme="auto"] .note-color-orange { background: #382513; border-color: #664524; color: #f7d5ad; }
}

/* ================================================================
   Organisations, paramètres
   ================================================================ */
.orgs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: var(--sp-5); align-items: start; }
.org-card { display: flex; flex-direction: column; gap: var(--sp-4); overflow: hidden; }
.org-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--grad); }
.org-card-head { display: flex; align-items: flex-start; gap: var(--sp-3); }
.org-card-icon { width: 44px; height: 44px; border-radius: 13px; }
.org-card-title { min-width: 0; display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.org-card-name { font-weight: 700; font-size: var(--fs-lg); letter-spacing: -.015em; line-height: 1.3; overflow-wrap: anywhere; }
.org-card-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.org-card-meta { display: flex; gap: var(--sp-5); margin: 0; padding: var(--sp-3) 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.org-card-meta > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.org-card-meta dt { font-size: var(--fs-2xs); color: var(--text-faint); text-transform: uppercase; letter-spacing: .06em; font-weight: 650; }
.org-card-meta dd { margin: 0; font-size: var(--fs-sm); font-weight: 650; color: var(--text); }
.org-card-storage { display: flex; flex-direction: column; gap: 7px; }
.org-card-storage-head { display: flex; justify-content: space-between; gap: 10px; font-size: var(--fs-xs); color: var(--text-soft); } .org-card-storage-head span:last-child { font-variant-numeric: tabular-nums; font-weight: 650; }
.org-card-libs { display: flex; flex-direction: column; gap: 2px; }
.org-card-eyebrow { font-size: var(--fs-2xs); font-weight: 680; color: var(--text-faint); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 4px; }
.org-lib { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: var(--r-sm); color: var(--text); text-decoration: none; transition: background var(--transition-fast); }
.org-lib:hover { background: var(--accent-soft); text-decoration: none; } .org-lib .icon { width: 16px; height: 16px; flex: none; color: var(--accent); }
.org-lib-name { font-weight: 600; font-size: var(--fs-sm); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-lib-meta { margin-left: auto; font-size: var(--fs-2xs); color: var(--text-faint); flex: none; font-variant-numeric: tabular-nums; } .org-lib-empty { font-size: var(--fs-xs); padding: 4px 0; }
.org-card-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: auto; padding-top: var(--sp-4); border-top: 1px solid var(--border); }
.settings-profile { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: var(--sp-5); align-items: start; }
.identity-card { display: flex; flex-direction: column; gap: var(--sp-4); position: sticky; top: calc(var(--topbar-h) + var(--sp-4)); }
.identity-top { display: flex; align-items: center; gap: var(--sp-4); } .identity-top .avatar-xl { width: 80px; height: 80px; font-size: 27px; border-radius: 24px; }
.identity-meta { min-width: 0; } .identity-name { margin: 0 0 2px; font-size: var(--fs-xl); letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.identity-mail { margin: 0 0 8px; font-size: var(--fs-xs); color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.identity-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; } .identity-card .hint { margin: 0; }
@media (max-width: 900px) { .settings-profile { grid-template-columns: 1fr; } .identity-card { position: static; } }

/* ================================================================
   Pages publiques : auth, landing, partage
   ================================================================ */
.auth-page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.auth-card { width: 100%; max-width: 448px; margin: auto; padding: 28px 22px; position: relative; z-index: 1; }
.auth-card h1 { font-size: 23px; }
.auth-card .card { padding: 36px 34px; border-radius: var(--radius-xl); box-shadow: var(--shadow-lg), var(--glass-hi); background: var(--glass-strong); animation: nvCardIn 600ms var(--ease-out) both; }
.auth-card .card::before { content: ""; position: absolute; left: 24px; right: 24px; top: 0; height: 3px; border-radius: 0 0 4px 4px; background: var(--grad); }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 26px; font-size: 20px; font-weight: 800; letter-spacing: -.025em; color: var(--text); animation: nvCardIn 500ms var(--ease-out) both; }
.auth-brand img { width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 38%, transparent); }
.auth-foot { text-align: center; color: var(--text-faint); font-size: 13px; padding: 18px; line-height: 1.7; }
@keyframes nvCardIn { from { opacity: 0; transform: translateY(20px) scale(.97); } to { opacity: 1; transform: none; } }
.auth-page::before, .auth-page::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; background: var(--grad); }
.auth-page::before { width: 340px; height: 340px; left: -90px; top: 10%; opacity: .14; animation: nvOrb 16s ease-in-out infinite alternate; }
.auth-page::after { width: 260px; height: 260px; right: -60px; bottom: 6%; opacity: .12; animation: nvOrb 20s ease-in-out infinite alternate-reverse; }

.lang-switch { display: inline-flex; border: 1px solid var(--glass-border); border-radius: 999px; overflow: hidden; background: var(--glass); padding: 3px; gap: 2px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.lang-switch a { padding: 5px 12px; font-size: 12.5px; font-weight: 680; color: var(--text-soft); text-decoration: none; line-height: 1.5; border-radius: 999px; transition: background var(--transition-fast), color var(--transition-fast); }
.lang-switch a:hover { text-decoration: none; color: var(--text); background: var(--bg-hover); } .lang-switch a.active { background: var(--grad); color: var(--accent-contrast); }

.landing { position: relative; }
.landing-nav { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px; padding: 12px clamp(16px, 4vw, 40px); background: var(--topbar-bg); border-bottom: 1px solid var(--glass-border); backdrop-filter: blur(22px) saturate(1.8); -webkit-backdrop-filter: blur(22px) saturate(1.8); }
.landing-nav .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -.02em; color: var(--text); }
.landing-nav .brand:hover { text-decoration: none; } .landing-nav .brand img { width: 30px; height: 30px; border-radius: 9px; }
.landing-hero { text-align: center; padding: clamp(56px, 9vw, 104px) 22px clamp(36px, 5vw, 56px); position: relative; overflow: hidden; }
.landing-hero > img { width: 68px; height: 68px; border-radius: 20px; box-shadow: 0 12px 34px color-mix(in srgb, var(--accent) 40%, transparent); animation: nvFloat 5s ease-in-out infinite; }
.landing-hero .hero-badge { display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px; border-radius: 999px; margin-bottom: 22px; background: var(--glass); color: var(--accent-text); border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--glass-border)); font-size: 13px; font-weight: 680; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--shadow-sm); }
.landing-hero .hero-badge .dot { background: var(--accent); animation: pulseDot 2.2s ease infinite; }
@keyframes pulseDot { 0%, 100% { box-shadow: 0 0 0 0 var(--accent-soft); } 50% { box-shadow: 0 0 0 7px transparent; } }
.landing-hero h1 { font-size: clamp(34px, 6vw, 64px); font-weight: 820; letter-spacing: -.045em; line-height: 1.05; max-width: 860px; margin: 0 auto; }
.landing-hero h1 .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.landing-hero .sub { font-size: clamp(15.5px, 2vw, 19px); color: var(--text-soft); max-width: 650px; margin: 20px auto 34px; line-height: 1.65; }
.landing-hero .hero-cta { display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; }
.landing-hero .hero-meta { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 24px; margin-top: 32px; font-size: 13px; color: var(--text-faint); }
.landing-hero .hero-meta span { display: inline-flex; align-items: center; gap: 6px; } .landing-hero .hero-meta .icon { width: 14px; height: 14px; color: var(--accent); }
.hero-mock { position: relative; max-width: 980px; margin: clamp(40px, 6vw, 70px) auto 0; padding: 0 8px; perspective: 1400px; }
.hero-mock .hm-window { border-radius: var(--r-xl); overflow: hidden; border: 1px solid var(--glass-border); background: var(--glass-strong); box-shadow: var(--shadow-lg), var(--glow); transform: rotateX(6deg); transform-origin: 50% 100%; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); animation: nvHeroIn 1s var(--ease-out) both; }
@keyframes nvHeroIn { from { opacity: 0; transform: rotateX(18deg) translateY(40px); } to { opacity: 1; transform: rotateX(6deg); } }
.hero-mock svg { display: block; width: 100%; height: auto; }
.landing-section-head { text-align: center; max-width: 660px; margin: 0 auto; padding: 60px 22px 8px; }
.landing-section-head h2 { font-size: clamp(24px, 3.4vw, 36px); letter-spacing: -.035em; } .landing-section-head p { color: var(--text-soft); margin-bottom: 0; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(284px, 1fr)); gap: 20px; max-width: 1140px; margin: 0 auto; padding: 36px 22px 20px; }
.feature-card { padding: 28px; border-radius: var(--radius-xl); overflow: hidden; }
.feature-card::after { content: ""; position: absolute; width: 180px; height: 180px; right: -60px; top: -70px; border-radius: 50%; background: var(--grad); opacity: .08; transition: transform var(--dur-3) var(--ease-out), opacity var(--transition); }
.feature-card:hover::after { transform: scale(1.5); opacity: .15; }
.feature-card .f-icon { width: 52px; height: 52px; border-radius: 16px; background: var(--grad); color: var(--accent-contrast); display: flex; align-items: center; justify-content: center; margin-bottom: 18px; box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 34%, transparent); transition: transform var(--dur-3) var(--ease-spring); }
.feature-card:hover .f-icon { transform: scale(1.1) rotate(-6deg); } .feature-card .f-icon .icon { width: 24px; height: 24px; }
.feature-card h3 { font-size: 16.5px; } .feature-card p { font-size: 14px; line-height: 1.6; position: relative; }
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(224px, 1fr)); gap: 20px; max-width: 1140px; margin: 0 auto; padding: 36px 22px 76px; }
.plan-card { padding: 30px 26px; text-align: center; position: relative; border-radius: var(--radius-xl); }
.plan-card.popular { border-color: var(--accent); box-shadow: 0 0 0 1.5px var(--accent), var(--shadow), var(--glow); transform: translateY(-6px); }
.plan-card .plan-flag { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--grad); color: var(--accent-contrast); font-size: 11.5px; font-weight: 720; letter-spacing: .05em; text-transform: uppercase; padding: 5px 14px; border-radius: 999px; box-shadow: var(--shadow-sm); white-space: nowrap; }
.plan-card .price { font-size: 34px; font-weight: 800; margin: 10px 0 4px; letter-spacing: -.035em; } .plan-card .p-name { font-weight: 720; font-size: 16px; }
.plan-card ul { list-style: none; padding: 0; margin: 18px 0 22px; font-size: 13.5px; color: var(--text-soft); text-align: left; } .plan-card li { padding: 6px 0; display: flex; align-items: flex-start; gap: 9px; }
.plan-card li::before { content: ""; flex: none; width: 17px; height: 17px; margin-top: 2px; background: var(--accent-soft); border-radius: 50%; box-shadow: inset 0 0 0 2.5px var(--accent); }
.landing-footer { border-top: 1px solid var(--glass-border); padding: 30px 22px; text-align: center; color: var(--text-faint); font-size: 13px; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.landing-footer a { color: var(--text-soft); } .landing-footer a:hover { color: var(--accent-text); }

.public-page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.public-top { padding: 20px 28px; } .public-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; color: var(--text); } .public-brand img { width: 32px; height: 32px; border-radius: 10px; }
.public-main { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 12px 16px 48px; }
.public-card { width: min(700px, 100%); padding: 32px; border-radius: var(--radius-xl); box-shadow: var(--shadow-lg), var(--glass-hi); background: var(--glass-strong); animation: nvCardIn 600ms var(--ease-out) both; }
.public-title { font-size: 20px; margin: 0 0 4px; }
.public-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 0 4px; color: var(--text-soft); font-size: 13.5px; }

/* ================================================================
   Animations d'entrée, impression, mouvement réduit
   ================================================================ */
.page > * { animation: nvRise 520ms var(--ease-out) both; }
.page > *:nth-child(2) { animation-delay: 60ms; } .page > *:nth-child(3) { animation-delay: 110ms; } .page > *:nth-child(4) { animation-delay: 160ms; }
.page > *:nth-child(5) { animation-delay: 200ms; } .page > *:nth-child(n+6) { animation-delay: 240ms; }
@keyframes nvRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.stat-cards > *, .shortcut-grid > *, .charts-grid > *, .recent-strip > *, .features-grid > *, .plans-grid > *, .orgs-grid > * { animation: nvRise 560ms var(--ease-out) both; }
.stat-cards > :nth-child(2), .shortcut-grid > :nth-child(2), .charts-grid > :nth-child(2), .recent-strip > :nth-child(2), .features-grid > :nth-child(2), .plans-grid > :nth-child(2), .orgs-grid > :nth-child(2) { animation-delay: 70ms; }
.stat-cards > :nth-child(3), .shortcut-grid > :nth-child(3), .charts-grid > :nth-child(3), .recent-strip > :nth-child(3), .features-grid > :nth-child(3), .plans-grid > :nth-child(3), .orgs-grid > :nth-child(3) { animation-delay: 140ms; }
.stat-cards > :nth-child(4), .shortcut-grid > :nth-child(4), .recent-strip > :nth-child(4), .features-grid > :nth-child(4), .plans-grid > :nth-child(4) { animation-delay: 210ms; }
.stat-cards > :nth-child(n+5), .recent-strip > :nth-child(n+5), .features-grid > :nth-child(n+5) { animation-delay: 270ms; }
.files-table tbody tr, .files-grid .file-card, .notes-grid .note-card { animation: nvRowIn 380ms var(--ease-out) backwards; }
.files-table tbody tr:nth-child(2), .files-grid .file-card:nth-child(2), .notes-grid .note-card:nth-child(2) { animation-delay: 40ms; }
.files-table tbody tr:nth-child(3), .files-grid .file-card:nth-child(3), .notes-grid .note-card:nth-child(3) { animation-delay: 80ms; }
.files-table tbody tr:nth-child(4), .files-grid .file-card:nth-child(4), .notes-grid .note-card:nth-child(4) { animation-delay: 120ms; }
.files-table tbody tr:nth-child(n+5), .files-grid .file-card:nth-child(n+5), .notes-grid .note-card:nth-child(n+5) { animation-delay: 160ms; }
@keyframes nvRowIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media print { .sidebar, .topbar, .bulk-bar, .upload-panel, .toast-stack, body::before, body::after { display: none !important; } .page { padding: 0; max-width: none; } .card { box-shadow: none; backdrop-filter: none; background: #fff; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .stat-spark path.s-line { stroke-dashoffset: 0; } .stat-spark path.s-area { opacity: 1; }
}
/* Sans support de backdrop-filter : surfaces plus opaques pour garder la lisibilité */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --glass: var(--bg-elevated); --glass-strong: var(--bg-elevated); --sidebar-bg: var(--bg-elevated); --topbar-bg: var(--bg-elevated); }
}
@media (max-width: 640px) { body::before { animation: none; } .hero-mock .hm-window { transform: none; animation: none; } }

/* Chargement initial : aucun repli animé tant que l'état mémorisé n'est pas appliqué */
.nv-no-anim .tree-collapse, .nv-no-anim .nav-caret .icon, .nv-no-anim .tree-caret .icon { transition: none !important; }

/* Garde-fous de mise en page : aucun enfant ne doit élargir la page (bandes défilantes, tableaux…) */
.app-main { overflow-x: clip; }
.page { min-width: 0; }
.page > * { min-width: 0; max-width: 100%; }

/* Cellule d'actions : doit rester une vraie cellule de tableau (sinon la ligne se décale) */
@media (min-width: 721px) {
  td.cell-actions { display: table-cell; vertical-align: middle; text-align: right; white-space: nowrap; }
  td.cell-actions > * { vertical-align: middle; }
}
.landing-hero > img { display: block; margin: 0 auto 20px; }
.theme-grid + .tm-title { margin-top: 4px; }
.palette-picker { margin-bottom: 12px; }
#pf-save { margin-top: 16px; }

/* Penses-bêtes : glisser-déposer */
.notes-grid .note-card[data-note-id] { cursor: grab; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.notes-grid .note-card .note-body, .notes-grid .note-card .note-title { cursor: inherit; }
.note-card.note-placeholder { opacity: .28; outline: 2px dashed var(--accent); outline-offset: -2px; box-shadow: none; }
.note-card.note-ghost { position: fixed; z-index: 120; margin: 0; pointer-events: none; cursor: grabbing; transform: rotate(2.5deg) scale(1.04); box-shadow: var(--shadow-lg), 0 0 0 2px var(--accent); transition: none; animation: none; opacity: .97; }
body.note-dragging, body.note-dragging * { cursor: grabbing !important; user-select: none !important; }
a.note-card { cursor: pointer; }

/* ================= Administration : offres ================= */
.plans-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; align-items: stretch; }
.plan-admin { padding: 22px; display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.plan-admin::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--grad); opacity: .55; }
.plan-admin.is-default { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-soft), var(--shadow-sm), var(--glass-hi); }
.plan-admin.is-default::before { opacity: 1; }
.plan-admin.is-off { opacity: .72; } .plan-admin.is-off::before { background: var(--border-strong); }
.plan-admin .pa-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.plan-admin h3 { margin: 0; font-size: 18px; }
.plan-admin .pa-desc { color: var(--text-faint); font-size: 13px; margin: 2px 0 10px; min-height: 1.5em; }
.plan-admin .pa-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.plan-admin .pa-amount { font-size: 30px; font-weight: 800; letter-spacing: -.035em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.plan-admin .pa-label { font-size: 12.5px; color: var(--text-faint); font-weight: 600; }
.plan-admin .pa-feats { list-style: none; margin: 0 0 16px; padding: 14px 0 0; border-top: 1px dashed var(--border-strong); display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; color: var(--text-soft); flex: 1; }
.plan-admin .pa-feats li { display: flex; align-items: center; gap: 9px; }
.plan-admin .pa-feats li::before { content: ""; flex: none; width: 16px; height: 16px; border-radius: 50%; background: var(--accent-soft); box-shadow: inset 0 0 0 2.5px var(--accent); }
.plan-admin .pa-feats b { color: var(--text); font-weight: 700; }
.plan-admin .pa-foot { display: flex; align-items: center; gap: 6px; padding-top: 14px; border-top: 1px solid var(--border); }
.plan-admin .pa-foot .spacer { flex: 1; }
.plan-admin .pa-subs { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-faint); }
.plan-admin .pa-subs .icon { width: 15px; height: 15px; }

/* ================================================================
   Visualiseur de fichiers v3 — plein écran, verre dépoli, thème
   ================================================================ */
html.nvv-open, html.nvv-open body { overflow: hidden; }
.nvv { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; opacity: 0; transition: opacity 180ms var(--ease);
  background: radial-gradient(70% 50% at 50% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%), color-mix(in srgb, var(--bg) 95%, #000 3%);
  backdrop-filter: blur(30px) saturate(1.5); -webkit-backdrop-filter: blur(30px) saturate(1.5); }
.nvv.in { opacity: 1; }
.nvv-top { display: flex; align-items: center; gap: 10px; min-height: 62px; padding: 8px 14px; flex: none; background: var(--glass-strong); border-bottom: 1px solid var(--glass-border); box-shadow: var(--shadow-sm); position: relative; z-index: 3; }
.nvv-ico { width: 38px; height: 38px; flex: none; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--grad-soft); color: var(--accent); }
.nvv-ico svg { width: 20px; height: 20px; }
.nvv-title { min-width: 0; flex: 1; line-height: 1.25; }
.nvv-name { font-weight: 700; font-size: 15px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nvv-sub { font-size: 12px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nvv-count { font-size: 12.5px; font-weight: 650; color: var(--text-soft); background: var(--bg-sunken); padding: 3px 11px; border-radius: 999px; flex: none; }
.nvv-count:empty { display: none; }
.nvv-actions { display: flex; align-items: center; gap: 3px; flex: none; }
.nvv-sep { width: 1px; height: 24px; background: var(--border-strong); margin: 0 6px; }
.nvv-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 40px; height: 40px; padding: 0 10px; border: 0; border-radius: 12px; background: transparent; color: var(--text-soft); cursor: pointer; font: inherit; font-weight: 640; font-size: 13.5px; transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast); }
.nvv-btn:hover { background: var(--bg-hover); color: var(--text); } .nvv-btn:active { transform: scale(.94); }
.nvv-btn.active { background: var(--accent-soft); color: var(--accent-text); }
.nvv-btn .icon { width: 19px; height: 19px; } .nvv-btn[hidden] { display: none !important; }
.nvv-primary { background: var(--grad); color: var(--accent-contrast); padding: 0 16px; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 30%, transparent); }
.nvv-primary:hover { background: var(--grad); color: var(--accent-contrast); filter: brightness(1.08); }
.nvv-primary.dirty { animation: nvvPulse 1.8s ease-in-out infinite; } .nvv-primary.busy { opacity: .6; pointer-events: none; }
@keyframes nvvPulse { 0%, 100% { box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 30%, transparent); } 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 22%, transparent); } }
.nvv-back { display: none; }
.nvv-body { flex: 1; min-height: 0; display: flex; position: relative; }
.nvv-stage { flex: 1; min-width: 0; position: relative; overflow: auto; display: flex; flex-direction: column; outline: none; }
.nvv-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--text-faint); z-index: 2; pointer-events: none; }
.nvv-empty { margin: auto; text-align: center; padding: 30px; max-width: 460px; display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--text-soft); }
.nvv-empty-t { font-weight: 700; font-size: 17px; color: var(--text); margin: 6px 0 0; overflow-wrap: anywhere; } .nvv-empty p { margin: 0; }

/* Navigation latérale (flèches) */
.nvv-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--glass-border); background: var(--glass-strong); color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow); z-index: 4; opacity: 0; transition: opacity var(--transition), transform var(--transition-fast); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.nvv-arrow:hover { transform: translateY(-50%) scale(1.08); } .nvv-arrow-l { left: 16px; } .nvv-arrow-r { right: 16px; }
.nvv:hover .nvv-arrow { opacity: .85; } .nvv-arrow:hover { opacity: 1 !important; }
.nvv.single .nvv-arrow, .nvv.single [data-a="prev"], .nvv.single [data-a="next"] { display: none; } .nvv.panel-open .nvv-arrow-r { right: calc(var(--vw-panel, 360px) + 16px); }

/* Panneau latéral */
.nvv-panel { width: 360px; flex: none; display: flex; flex-direction: column; background: var(--glass-strong); border-left: 1px solid var(--glass-border); margin-right: -360px; transition: margin-right var(--dur-3) var(--ease-out); z-index: 5; }
.nvv.panel-open .nvv-panel { margin-right: 0; }
.nvv-tabs { display: flex; flex: none; padding: 8px 8px 0; gap: 2px; border-bottom: 1px solid var(--border); }
.nvv-tabs button { flex: 1; padding: 11px 6px; border: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 650; color: var(--text-soft); cursor: pointer; border-bottom: 2px solid transparent; border-radius: 8px 8px 0 0; transition: color var(--transition-fast), background var(--transition-fast); }
.nvv-tabs button:hover { background: var(--bg-hover); } .nvv-tabs button.active { color: var(--accent-text); border-bottom-color: var(--accent); }
.nvv-panel-body { flex: 1; overflow-y: auto; padding: 16px; }
.nvv-hero { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 0 18px; text-align: center; }
.nvv-hero-n { font-weight: 700; overflow-wrap: anywhere; font-size: 14.5px; }

/* Barre d'outils flottante */
.nvv-tools { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; align-items: center; gap: 2px; padding: 6px; border-radius: 16px; background: var(--glass-strong); border: 1px solid var(--glass-border); box-shadow: var(--shadow-lg), var(--glass-hi); backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6); z-index: 3; max-width: calc(100% - 24px); overflow-x: auto; }
.nvv-tb { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 38px; height: 38px; padding: 0 9px; border: 0; border-radius: 11px; background: transparent; color: var(--text-soft); cursor: pointer; font: inherit; font-weight: 640; font-size: 13px; text-decoration: none; transition: background var(--transition-fast), color var(--transition-fast); }
.nvv-tb:hover { background: var(--accent-soft); color: var(--accent-text); text-decoration: none; } .nvv-tb .icon { width: 18px; height: 18px; }
.nvv-zl { min-width: 52px; text-align: center; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-soft); }
.nvv-tsep { width: 1px; height: 22px; background: var(--border-strong); margin: 0 5px; }
.nvv-sel { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-faint); padding: 0 6px; } .nvv-sel select, .nvv-rate { background: var(--field-bg); border: 1px solid var(--border-strong); color: var(--text); border-radius: 9px; padding: 5px 8px; font: inherit; font-size: 12.5px; }

/* Images */
.nvv-k-image { background: repeating-conic-gradient(color-mix(in srgb, var(--text) 5%, transparent) 0% 25%, transparent 0% 50%) 0 0 / 22px 22px; overflow: hidden; }
.nvv-canvas { flex: 1; display: flex; align-items: center; justify-content: center; cursor: grab; touch-action: none; overflow: hidden; padding: 24px 24px 84px; } .nvv-canvas.grabbing { cursor: grabbing; }
.nvv-img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; border-radius: 6px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); opacity: 0; transition: opacity 250ms, filter 120ms; will-change: transform; }
.nvv-img.ready { opacity: 1; }
.nvv-editpanel { position: absolute; right: 16px; top: 16px; bottom: 90px; width: 270px; padding: 16px; border-radius: var(--r-lg); overflow-y: auto; background: var(--glass-strong); border: 1px solid var(--glass-border); box-shadow: var(--shadow-lg), var(--glass-hi); z-index: 3; display: flex; flex-direction: column; gap: 14px; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); animation: popIn 240ms var(--ease-spring); }
.nvv-ep-t { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--accent-text); } .nvv-ep-t .icon { width: 18px; height: 18px; }
.nvv-sl { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 640; color: var(--text-soft); } .nvv-sl span { display: flex; justify-content: space-between; } .nvv-sl b { color: var(--text); font-variant-numeric: tabular-nums; }
.nvv-sl input[type=range], #nvv-seek, .nvv-volr { accent-color: var(--accent); width: 100%; }
.nvv-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.nvv-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--field-bg); color: var(--text-soft); font: inherit; font-size: 12.5px; font-weight: 640; cursor: pointer; transition: all var(--transition-fast); }
.nvv-chip:hover { border-color: var(--accent); color: var(--accent-text); } .nvv-chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); } .nvv-chip .icon { width: 14px; height: 14px; }

/* Documents : texte, code, Markdown, HTML */
.nvv-doc { flex: 1; min-height: 0; display: flex; padding: 18px; gap: 14px; overflow: auto; }
.nvv-doc.view.code { padding: 18px; } .nvv-doc.view.rendered { justify-content: center; align-items: flex-start; }
.nvv-codebox, .nvv-edbox { display: flex; flex: 1; min-width: 0; min-height: 0; border-radius: var(--r-md); border: 1px solid var(--glass-border); background: var(--glass-strong); box-shadow: var(--shadow-sm); overflow: auto; font-family: var(--font-mono); font-size: 13px; line-height: 1.65; }
.nvv-doc.view.code { flex-direction: column; } .nvv-codebox { flex: 0 0 auto; width: 100%; min-height: 220px; align-self: flex-start; }
.nvv-ln { margin: 0; padding: 14px 12px 14px 16px; text-align: right; color: var(--text-faint); user-select: none; border-right: 1px solid var(--border); background: color-mix(in srgb, var(--bg-sunken) 60%, transparent); font: inherit; flex: none; min-width: 3.4em; }
.nvv-pre { margin: 0; padding: 14px 18px; flex: 1; min-width: 0; font: inherit; background: transparent !important; overflow: visible; white-space: pre; tab-size: 2; } .nvv-pre code { font: inherit; background: none; padding: 0; color: var(--text); }
.nvv-note { padding: 10px 16px; font-size: 12.5px; color: var(--warning); }
.nvv-doc.edit { align-items: stretch; } .nvv-ed { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.nvv-edbar { display: flex; align-items: center; gap: 8px; min-height: 30px; } .nvv-edinfo { margin-left: auto; font-size: 12px; color: var(--text-faint); }
.nvv-edbox { flex: 1; overflow: hidden; } .nvv-edbox .nvv-ln { overflow: hidden; }
.nvv-ta { flex: 1; min-width: 0; margin: 0; padding: 14px 18px; border: 0; outline: 0; resize: none; background: transparent; color: var(--text); font: inherit; line-height: inherit; white-space: pre; overflow: auto; tab-size: 2; }
.nvv-doc.split .nvv-ed { flex: 1 1 50%; } .nvv-pv { flex: 1 1 50%; min-width: 0; overflow: auto; border-radius: var(--r-md); }
.nvv-paper { width: min(860px, 100%); background: var(--bg-elevated); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow); padding: clamp(18px, 4vw, 48px); line-height: 1.7; font-size: 15px; overflow-wrap: anywhere; }
.nvv-pv .nvv-paper { width: 100%; min-height: 100%; box-shadow: var(--shadow-sm); }
.nvv-paper h1, .nvv-paper h2, .nvv-paper h3 { margin: 1.3em 0 .5em; } .nvv-paper h1:first-child, .nvv-paper h2:first-child { margin-top: 0; }
.nvv-paper img { max-width: 100%; height: auto; border-radius: 8px; } .nvv-paper pre { background: var(--bg-sunken); padding: 14px; border-radius: 10px; overflow: auto; } .nvv-paper pre code { background: none; padding: 0; }
.nvv-paper table { border-collapse: collapse; margin: 1em 0; max-width: 100%; display: block; overflow: auto; } .nvv-paper th, .nvv-paper td { border: 1px solid var(--border-strong); padding: 7px 12px; } .nvv-paper th { background: var(--bg-sunken); }
.nvv-paper blockquote { margin: 1em 0; padding: 4px 18px; border-left: 4px solid var(--accent); color: var(--text-soft); background: var(--accent-softer); border-radius: 0 10px 10px 0; }
.nvv-paper a { color: var(--accent-text); text-decoration: underline; } .nvv-paper hr { border: 0; border-top: 1px solid var(--border-strong); }
.nvv-paper.frame { padding: 0; overflow: hidden; background: #fff; height: 100%; min-height: 420px; } .nvv-paper.frame iframe { width: 100%; height: 100%; min-height: 420px; border: 0; background: #fff; display: block; }
.nvv-paper.checker { display: flex; align-items: center; justify-content: center; min-height: 360px; background: repeating-conic-gradient(color-mix(in srgb, var(--text) 6%, transparent) 0% 25%, transparent 0% 50%) 0 0 / 20px 20px; }
.nvv-svgimg { max-width: 100%; max-height: 70vh; }
.nvv-paper.docx { font-family: Georgia, "Times New Roman", serif; }
/* Coloration syntaxique (clair/sombre via variables) */
.hljs-comment, .hljs-quote { color: var(--text-faint); font-style: italic; } .hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-built_in, .hljs-doctag { color: #c026d3; }
.hljs-string, .hljs-regexp, .hljs-addition { color: #0e9f6e; } .hljs-number, .hljs-symbol, .hljs-bullet, .hljs-attr, .hljs-variable, .hljs-template-variable { color: #d97706; }
.hljs-title, .hljs-section, .hljs-selector-id, .hljs-class .hljs-title, .hljs-function .hljs-title { color: #2563eb; } .hljs-name, .hljs-tag, .hljs-attribute, .hljs-type { color: #e11d48; } .hljs-deletion { color: var(--danger); } .hljs-meta { color: #0891b2; }
html[data-theme="dark"] .hljs-keyword, html[data-theme="dark"] .hljs-literal, html[data-theme="dark"] .hljs-built_in { color: #e879f9; } html[data-theme="dark"] .hljs-string, html[data-theme="dark"] .hljs-addition { color: #34d399; } html[data-theme="dark"] .hljs-number, html[data-theme="dark"] .hljs-attr, html[data-theme="dark"] .hljs-variable { color: #fbbf24; } html[data-theme="dark"] .hljs-title, html[data-theme="dark"] .hljs-section { color: #60a5fa; } html[data-theme="dark"] .hljs-name, html[data-theme="dark"] .hljs-tag, html[data-theme="dark"] .hljs-attribute, html[data-theme="dark"] .hljs-type { color: #fb7185; }
@media (prefers-color-scheme: dark) { html[data-theme="auto"] .hljs-keyword, html[data-theme="auto"] .hljs-literal, html[data-theme="auto"] .hljs-built_in { color: #e879f9; } html[data-theme="auto"] .hljs-string { color: #34d399; } html[data-theme="auto"] .hljs-number, html[data-theme="auto"] .hljs-attr { color: #fbbf24; } html[data-theme="auto"] .hljs-title { color: #60a5fa; } html[data-theme="auto"] .hljs-name, html[data-theme="auto"] .hljs-tag, html[data-theme="auto"] .hljs-attribute { color: #fb7185; } }

/* Vidéo / audio / PDF */
.nvv-media { flex: 1; display: flex; align-items: center; justify-content: center; padding: 20px 20px 84px; min-height: 0; background: radial-gradient(60% 60% at 50% 40%, color-mix(in srgb, var(--accent) 12%, #000), #05070a); }
.nvv-video { max-width: 100%; max-height: 100%; border-radius: var(--r-md); background: #000; box-shadow: 0 24px 70px rgba(0, 0, 0, .55); outline: none; }
.nvv-pdf { flex: 1; width: 100%; border: 0; background: #fff; } .nvv-k-pdf .nvv-tools { bottom: 16px; }
.nvv-audio { margin: auto; width: min(640px, 94%); display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 28px 22px; }
.nvv-disc { width: 190px; height: 190px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: conic-gradient(from 0deg, var(--accent), var(--accent-2), var(--accent)); box-shadow: var(--shadow-lg), var(--glow); position: relative; }
.nvv-disc::after { content: ""; position: absolute; inset: 14px; border-radius: 50%; background: var(--bg-elevated); opacity: .92; } .nvv-disc .icon-tile { position: relative; z-index: 1; width: 84px; height: 84px; border-radius: 50%; } .nvv-disc .icon-tile .icon { width: 38px; height: 38px; }
.nvv-disc.spin { animation: spin 7s linear infinite; }
.nvv-atitle { font-size: 19px; font-weight: 750; letter-spacing: -.02em; text-align: center; overflow-wrap: anywhere; }
.nvv-viz { width: 100%; height: 100px; } .nvv-aplayer { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 18px; background: var(--glass-strong); border: 1px solid var(--glass-border); box-shadow: var(--shadow); } .nvv-aplayer time { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text-faint); min-width: 36px; text-align: center; } .nvv-volr { max-width: 84px; }
.nvv-play { width: 46px; height: 46px; flex: none; border: 0; border-radius: 50%; background: var(--grad); color: var(--accent-contrast); cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: var(--glow); transition: transform var(--transition-fast); } .nvv-play:hover { transform: scale(1.08); } .nvv-play .icon { width: 20px; height: 20px; }

/* Tableurs */
.nvv-grid { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 14px; gap: 10px; }
.nvv-gtools { display: flex; flex-wrap: wrap; gap: 8px; } .nvv-gscroll { flex: 1; min-height: 0; overflow: auto; border-radius: var(--r-md); border: 1px solid var(--glass-border); background: var(--glass-strong); box-shadow: var(--shadow-sm); }
.nvv-tbl { border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 100%; } .nvv-tbl th, .nvv-tbl td { padding: 6px 12px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); white-space: nowrap; max-width: 420px; overflow: hidden; text-overflow: ellipsis; }
.nvv-tbl thead th { position: sticky; top: 0; z-index: 2; background: var(--bg-sunken); color: var(--text-faint); font-size: 11.5px; font-weight: 700; text-align: center; } .nvv-tbl th.rn { position: sticky; left: 0; z-index: 1; background: var(--bg-sunken); color: var(--text-faint); font-size: 11.5px; text-align: center; min-width: 44px; } .nvv-tbl thead th.rn { z-index: 3; }
.nvv-tbl td[contenteditable] { cursor: text; outline: none; } .nvv-tbl td[contenteditable]:focus { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-softer); } .nvv-tbl tbody tr:hover td { background: var(--bg-hover); }
.nvv-sheets { display: flex; gap: 6px; overflow-x: auto; } .nvv-sheet { padding: 6px 14px; border: 1px solid var(--border-strong); background: var(--field-bg); border-radius: 10px 10px 0 0; font: inherit; font-size: 12.5px; font-weight: 640; color: var(--text-soft); cursor: pointer; } .nvv-sheet.on { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent); }

/* Présentations, archives, polices */
.nvv-slides { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; padding: 24px; align-content: start; }
.nvv-slide { position: relative; aspect-ratio: 16 / 9; padding: 28px 24px 18px; border-radius: var(--r-lg); background: var(--bg-elevated); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; gap: 6px; }
.nvv-slide::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--grad); } .nvv-slide h3 { margin: 0 0 4px; font-size: 18px; } .nvv-slide p { margin: 0; font-size: 13px; color: var(--text-soft); } .nvv-slide-n { position: absolute; right: 12px; bottom: 10px; font-size: 11px; color: var(--text-faint); font-weight: 700; }
.nvv-zip { margin: 18px auto; width: min(760px, 94%); background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; max-height: calc(100% - 36px); } .nvv-zip-h { padding: 14px 18px; font-weight: 700; border-bottom: 1px solid var(--border); } .nvv-zip-l { overflow: auto; }
.nvv-zip-r { display: flex; align-items: center; gap: 10px; padding: 8px 18px; border-bottom: 1px solid var(--border); font-size: 13px; } .nvv-zip-r:hover { background: var(--bg-hover); } .nvv-zip-i { color: var(--accent); display: inline-flex; } .nvv-zip-i .icon { width: 16px; height: 16px; } .nvv-zip-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .nvv-zip-s { color: var(--text-faint); font-size: 12px; }
.nvv-font { margin: 24px auto; width: min(820px, 94%); padding: 28px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; } .nvv-f1 { font-size: 110px; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; } .nvv-f3 { font-size: 22px; line-height: 1.7; color: var(--text-soft); }

/* Mobile : barre compacte, panneau en feuille basse */
@media (max-width: 900px) {
  .nvv-top { padding: 6px 8px; gap: 6px; min-height: 56px; } .nvv-back { display: inline-flex; } .nvv-x, .nvv-hide-sm, .nvv-ico { display: none; }
  .nvv-btn { min-width: 38px; height: 38px; padding: 0 8px; } .nvv-txt span { display: none; } .nvv-sep { margin: 0 2px; }
  .nvv-actions [data-a="prev"], .nvv-actions [data-a="next"] { display: none; } .nvv-arrow { opacity: .9; width: 42px; height: 42px; } .nvv-arrow-l { left: 8px; } .nvv-arrow-r { right: 8px; }
  .nvv-panel { position: absolute; left: 0; right: 0; bottom: 0; width: auto; height: 66%; margin: 0; transform: translateY(105%); transition: transform var(--dur-3) var(--ease-out); border-left: 0; border-top: 1px solid var(--glass-border); border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: var(--shadow-lg); }
  .nvv.panel-open .nvv-panel { transform: none; margin: 0; } .nvv.panel-open .nvv-arrow-r { right: 8px; }
  .nvv-doc { padding: 10px; flex-direction: column; } .nvv-doc.split .nvv-ed, .nvv-doc.split .nvv-pv { flex: 1 1 50%; min-height: 220px; }
  .nvv-editpanel { left: 10px; right: 10px; width: auto; top: auto; bottom: 84px; max-height: 44%; } .nvv-canvas { padding: 12px 12px 90px; }
  .nvv-name { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { .nvv-disc.spin { animation: none; } }
.nvv:has(.nvv-doc.edit) .nvv-arrow, .nvv:has(.nvv-grid) .nvv-arrow { display: none; }

/* Sélecteur de langue (barre supérieure) */
.lang-btn { width: auto; padding: 0 10px; gap: 6px; border-radius: 12px; }
.lang-code { font-size: 12px; font-weight: 750; letter-spacing: .04em; }
.lang-flag { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 20px; border-radius: 6px; background: var(--bg-sunken); font-size: 10.5px; font-weight: 750; color: var(--text-soft); }
.dd-item.is-current { background: var(--accent-softer); color: var(--accent-text); font-weight: 680; }

/* ================= Vignettes : aperçu du contenu + pastille de type ================= */
.file-card .thumb, .rc-thumb { position: relative; overflow: hidden; }
.file-card .thumb > img, .rc-thumb > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; background: var(--bg-sunken); }
.file-card .thumb > img[src*="thumb.php"], .rc-thumb > img { object-position: center top; }
.rc-ico { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--accent); }
.rc-ico .icon, .rc-ico svg { width: 36px; height: 36px; }
html[data-thumbs="0"] .file-card .thumb > img, html[data-thumbs="0"] .rc-thumb > img { display: none; }
.type-badge { position: absolute; left: 9px; bottom: 9px; z-index: 3; display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 780; letter-spacing: .05em; line-height: 1.6; color: #fff; background: var(--badge, var(--accent-strong)); box-shadow: 0 2px 8px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .25); pointer-events: none; }
.type-badge[data-cat="image"] { --badge: #0891b2; } .type-badge[data-cat="pdf"] { --badge: #dc2626; } .type-badge[data-cat="document"] { --badge: #2563eb; }
.type-badge[data-cat="text"] { --badge: #64748b; } .type-badge[data-cat="video"] { --badge: #7c3aed; } .type-badge[data-cat="audio"] { --badge: #db2777; }
.type-badge[data-cat="archive"] { --badge: #d97706; } .type-badge[data-cat="other"] { --badge: #475569; }
html[data-badges="0"] .type-badge { display: none; }
.pref-row { display: flex; align-items: flex-start; gap: 14px; padding: 12px 0; cursor: pointer; border-top: 1px solid var(--border); } .pref-row:first-of-type { border-top: 0; }
.pref-row .switch { margin-top: 2px; }

/* PERF : le flou d'arrière-plan est coûteux sur de longues listes → réservé aux surfaces flottantes
   (barres, menus, fenêtres) ; les cartes de liste utilisent un fond translucide simple. */
.file-card, .table-wrap, .rc-card, .stat-card, .shortcut, .org-card, .chart-card, .feature-card, .plan-admin { backdrop-filter: none; -webkit-backdrop-filter: none; background: color-mix(in srgb, var(--glass-strong) 88%, transparent); }
.card { transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition); }
body::before { will-change: auto; }
.note-card { backdrop-filter: none; -webkit-backdrop-filter: none; }
@media (max-width: 900px) { .card, .table-wrap, .topbar { backdrop-filter: none; -webkit-backdrop-filter: none; } .topbar { background: var(--glass-strong); } }
.upload-panel.out { opacity: 0; transform: translateY(14px) scale(.97); transition: opacity 240ms, transform 240ms; }

/* Tableau de bord : penses-bêtes (cartes compactes, cliquables — pas de glisser-déposer ici) */
.dash-notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.dnote { display: flex; flex-direction: column; gap: 6px; min-height: 104px; padding: 13px 14px 11px; border: 1px solid transparent; border-radius: var(--r-md); text-decoration: none !important; color: inherit; cursor: pointer; box-shadow: var(--shadow-sm); transition: transform var(--dur-2) var(--ease-spring), box-shadow var(--transition); position: relative; overflow: hidden; }
.dnote:hover { transform: translateY(-3px); box-shadow: var(--shadow); } .dnote:active { transform: scale(.985); }
.dnote.pinned { box-shadow: 0 0 0 1.5px var(--accent), var(--shadow-sm); }
.dnote-title { font-weight: 700; font-size: 13.8px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.dnote-body { font-size: 12.3px; line-height: 1.45; opacity: .8; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.dnote-foot { margin-top: auto; display: flex; align-items: center; gap: 6px; min-height: 18px; font-size: 11.5px; font-weight: 650; }
.dnote-due { opacity: .75; } .dnote-pin { font-size: 12px; }
.dnote.done .dnote-title { text-decoration: line-through; opacity: .65; } .dnote.done { box-shadow: none; opacity: .85; }
.dnote.note-color-gray { background: var(--bg-sunken); border-color: var(--border-strong); color: var(--text); }
#dash-note-title { border-radius: 999px; }
/* Bande « Reprendre » : cartes régulières, sans débordement */
.recent-strip { grid-auto-columns: minmax(190px, 220px); }
.rc-card { min-height: 0; } .rc-thumb { height: 118px; } .rc-info { padding: 10px 13px 11px; }
.rc-name { display: block; }

/* ================= Page publique d'un lien de partage ================= */
.public-top { display: flex; align-items: center; gap: 12px; } .public-top .spacer { flex: 1; }
.public-main.wide { padding: 8px clamp(10px, 3vw, 32px) 28px; }
.pub-window { width: min(1120px, 100%); background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: var(--r-xl); box-shadow: var(--shadow-lg), var(--glass-hi); overflow: hidden; display: flex; flex-direction: column; animation: nvCardIn 600ms var(--ease-out) both; backdrop-filter: blur(22px) saturate(1.6); -webkit-backdrop-filter: blur(22px) saturate(1.6); }
.pub-head { display: flex; align-items: center; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--border); background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%); flex-wrap: wrap; }
.pub-title { flex: 1; min-width: 200px; } .pub-title h1 { margin: 0 0 6px; font-size: clamp(18px, 2.4vw, 24px); overflow-wrap: anywhere; letter-spacing: -.02em; }
.pub-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--text-soft); }
.pub-bar { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; background: color-mix(in srgb, var(--bg-sunken) 55%, transparent); }
.pub-nav { display: flex; gap: 2px; } .pub-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.pub-ib { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--text-soft); cursor: pointer; text-decoration: none; transition: background var(--transition-fast), color var(--transition-fast); flex: none; }
.pub-ib:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent-text); text-decoration: none; } .pub-ib:disabled { opacity: .35; cursor: default; } .pub-ib .icon { width: 18px; height: 18px; }
.pub-crumbs { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 160px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; font-size: 13.5px; } .pub-crumbs::-webkit-scrollbar { display: none; }
.pub-crumbs a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; color: var(--text-soft); font-weight: 600; } .pub-crumbs a:hover { background: var(--accent-soft); color: var(--accent-text); text-decoration: none; }
.pub-crumbs .icon { width: 15px; height: 15px; } .pub-crumbs .sep { color: var(--text-faint); display: inline-flex; opacity: .6; } .pub-crumbs .current { font-weight: 700; padding: 5px 10px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.pub-search { position: relative; display: inline-flex; align-items: center; } .pub-search .icon { position: absolute; left: 11px; width: 15px; height: 15px; color: var(--text-faint); pointer-events: none; }
.pub-search input { width: 190px; max-width: 100%; height: 36px; padding: 0 12px 0 33px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--field-bg); color: var(--text); font: inherit; font-size: 13.5px; } .pub-search input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.pub-sort { width: auto; min-height: 36px; padding-top: 4px; padding-bottom: 4px; border-radius: 999px; font-size: 13.5px; }
.pub-body { padding: 18px; min-height: 280px; max-height: calc(100dvh - 320px); overflow-y: auto; }
.pub-foot { display: flex; justify-content: space-between; gap: 10px; padding: 11px 24px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-faint); background: color-mix(in srgb, var(--bg-sunken) 45%, transparent); }
.pub-list { display: flex; flex-direction: column; }
.pub-row { display: flex; align-items: center; gap: 14px; padding: 9px 12px; border-radius: 12px; cursor: pointer; transition: background var(--transition-fast); outline: none; } .pub-row:hover, .pub-row:focus-visible { background: var(--accent-softer); } .pub-row:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.pub-ico { position: relative; width: 40px; height: 40px; flex: none; border-radius: 11px; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; background: var(--grad-soft); color: var(--accent); }
.pub-ico img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; background: var(--bg-sunken); } .pub-fold { display: inline-flex; color: var(--accent); }
.pub-name { flex: 1; min-width: 0; display: flex; flex-direction: column; } .pub-name b { font-size: 14px; font-weight: 640; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .pub-name small { color: var(--text-faint); font-size: 12px; }
.pub-sz, .pub-dt { font-size: 12.5px; color: var(--text-faint); white-space: nowrap; font-variant-numeric: tabular-nums; } .pub-sz { min-width: 70px; text-align: right; } .pub-dt { min-width: 100px; text-align: right; }
.pub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; } .pub-grid.mosaic { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.pub-card { border: 1px solid var(--glass-border); border-radius: var(--r-lg); background: color-mix(in srgb, var(--glass-strong) 90%, transparent); box-shadow: var(--shadow-sm); cursor: pointer; overflow: hidden; display: flex; flex-direction: column; outline: none; transition: transform var(--dur-2) var(--ease-spring), box-shadow var(--transition), border-color var(--transition); }
.pub-card:hover, .pub-card:focus-visible { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 40%, var(--glass-border)); }
.pub-thumb { position: relative; height: 126px; display: flex; align-items: center; justify-content: center; background: var(--grad-soft); color: var(--accent); overflow: hidden; } .pub-grid.mosaic .pub-thumb { height: 178px; }
.pub-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; z-index: 1; background: var(--bg-sunken); transition: transform 500ms var(--ease-out); } .pub-card:hover .pub-thumb img { transform: scale(1.06); }
.pub-cap { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); } .pub-cn { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 640; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .pub-cs { font-size: 12px; color: var(--text-faint); flex: none; } .pub-cap .pub-ib { width: 30px; height: 30px; }
.pub-single { display: flex; align-items: center; gap: 28px; padding: 24px; flex-wrap: wrap; justify-content: center; }
.pub-bigthumb { position: relative; width: min(340px, 100%); height: 240px; border-radius: var(--r-lg); overflow: hidden; background: var(--grad-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow); } .pub-bigthumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; z-index: 1; background: var(--bg-sunken); }
.pub-single-i { min-width: 220px; max-width: 420px; } .pub-single-i h2 { overflow-wrap: anywhere; }
html[data-thumbs="0"] .pub-thumb img, html[data-thumbs="0"] .pub-ico img, html[data-thumbs="0"] .pub-bigthumb img { display: none; }
@media (max-width: 720px) { .pub-sz, .pub-dt { display: none; } .pub-tools { margin-left: 0; width: 100%; } .pub-search { flex: 1; } .pub-search input { width: 100%; } .pub-head { padding: 16px; } .pub-body { max-height: none; padding: 12px; } .pub-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; } .pub-grid.mosaic { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); } }
/* Visualiseur en mode public : pas de panneau, barre d'actions réduite */
.nvv.nvv-public .nvv-panel { display: none; }
.view-toggle .icon { width: 17px; height: 17px; } .pub-list .pub-ico .icon, .pub-fold .icon { width: 20px; height: 20px; } .pub-fold .icon { width: 100%; max-width: 56px; }
.modal > form { display: flex; flex-direction: column; min-height: 0; flex: 1; max-height: inherit; } .modal > form > .m-body { overflow-y: auto; }
