/* ==========================================================================
   FTP Web | Ch'ti Serveur — mêmes jetons que le thème ISPConfig
   ========================================================================== */
@font-face { font-family: "Inter"; src: url("../fonts/inter-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Fredoka"; src: url("../fonts/fredoka-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --chti-violet: #a24bff; --chti-cyan: #22d3ee; --chti-amber: #ffc21a;
  --accent: var(--chti-violet); --accent-2: var(--chti-cyan); --accent-3: var(--chti-amber);
  --accent-strong: color-mix(in oklab, var(--accent) 78%, #000);
  --accent-soft: color-mix(in oklab, var(--accent) 16%, transparent);
  --accent-softer: color-mix(in oklab, var(--accent) 8%, transparent);
  --accent-text: color-mix(in oklab, var(--accent) 55%, #fff);
  --neon-3: linear-gradient(90deg, var(--accent-3), var(--accent), var(--accent-2));
  --bg: #0b0817; --surface: #141027; --surface-2: #1a1531; --surface-3: #241d42;
  --glass: rgba(20, 16, 39, .74); --input: #0f0c1f;
  --border: #2a2349; --border-strong: #3a3164;
  --text: #ece8ff; --muted: #a8a1cb; --faint: #7a739c;
  --success: #34d399; --warning: #fbbf24; --danger: #ff5577;
  --danger-soft: color-mix(in oklab, var(--danger) 14%, transparent);
  --success-soft: color-mix(in oklab, var(--success) 14%, transparent);
  --info-soft: color-mix(in oklab, var(--accent-2) 12%, transparent);
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 30px -18px rgba(0,0,0,.8);
  --pop: 0 24px 60px -24px rgba(0,0,0,.9);
  --r: 16px; --r-sm: 10px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Fredoka", "Inter", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}
[data-theme="light"] {
  --accent: color-mix(in oklab, var(--chti-violet) 88%, #2a0060);
  --accent-text: color-mix(in oklab, var(--accent) 85%, #000);
  --accent-soft: color-mix(in oklab, var(--accent) 11%, transparent);
  --accent-softer: color-mix(in oklab, var(--accent) 6%, transparent);
  --accent-2: color-mix(in oklab, var(--chti-cyan) 75%, #003a4a);
  --accent-3: color-mix(in oklab, var(--chti-amber) 80%, #6b3a00);
  --bg: #f5f3fb; --surface: #fff; --surface-2: #f8f6fd; --surface-3: #efebfa;
  --glass: rgba(255,255,255,.8); --input: #fff;
  --border: #e6e1f3; --border-strong: #d4cdea;
  --text: #1c1631; --muted: #5f5880; --faint: #8e87aa;
  --success: #059669; --warning: #b45309; --danger: #e11d48;
  --shadow: 0 1px 2px rgba(28,22,49,.04), 0 8px 24px -16px rgba(28,22,49,.18);
  --pop: 0 24px 60px -24px rgba(28,22,49,.4);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { min-height: 100vh; font: 14px/1.55 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
body.app::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(900px 520px at 10% -10%, color-mix(in oklab, var(--accent) 18%, transparent), transparent 70%),
              radial-gradient(700px 520px at 105% 110%, color-mix(in oklab, var(--accent-2) 8%, transparent), transparent 70%); }
a { color: var(--accent-text); text-decoration: none; }
a:hover { color: var(--accent-2); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: color-mix(in oklab, var(--accent) 40%, transparent); }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Icônes (masques SVG) ---------- */
.ico { display: inline-block; flex: none; width: 16px; height: 16px; background: currentColor; vertical-align: -3px;
  -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.ico-moon { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.5 14.6A8.5 8.5 0 0 1 9.4 3.5a8.5 8.5 0 1 0 11.1 11.1z'/%3E%3C/svg%3E"); }
.ico-sun { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4.2' fill='black'/%3E%3Cpath d='M12 2v2.5M12 19.5V22M2 12h2.5M19.5 12H22M4.9 4.9l1.8 1.8M17.3 17.3l1.8 1.8M4.9 19.1l1.8-1.8M17.3 6.7l1.8-1.8'/%3E%3C/svg%3E"); }
.ico-power { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M12 3v8'/%3E%3Cpath d='M6.3 6.8a8 8 0 1 0 11.4 0'/%3E%3C/svg%3E"); }
.ico-user { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21a8 8 0 0 1 16 0'/%3E%3C/svg%3E"); }
.ico-lock { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Crect x='4.5' y='10.5' width='15' height='10' rx='2.5'/%3E%3Cpath d='M8 10.5V7.5a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E"); }
.ico-eye { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); }
.ico-arrow { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E"); }
.ico-search { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E"); }
.ico-refresh { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 11a8 8 0 1 0-2.3 5.7'/%3E%3Cpath d='M20 4v7h-7'/%3E%3C/svg%3E"); }
.ico-upload { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15V4M7 9l5-5 5 5'/%3E%3Cpath d='M4 15v3a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-3'/%3E%3C/svg%3E"); }
.ico-download { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v11M7 10l5 5 5-5'/%3E%3Cpath d='M4 15v3a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-3'/%3E%3C/svg%3E"); }
.ico-chevron { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
.ico-home { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11l9-7 9 7'/%3E%3Cpath d='M5 10v10h14V10'/%3E%3C/svg%3E"); }
.ico-folder { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 6.5A2.5 2.5 0 0 1 5.5 4h4.2l2 2.2h6.8A2.5 2.5 0 0 1 21 8.7v8.8a2.5 2.5 0 0 1-2.5 2.5h-13A2.5 2.5 0 0 1 3 17.5z'/%3E%3C/svg%3E"); }
.ico-folder-plus { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6.5A2.5 2.5 0 0 1 5.5 4h4.2l2 2.2h6.8A2.5 2.5 0 0 1 21 8.7v8.8a2.5 2.5 0 0 1-2.5 2.5h-13A2.5 2.5 0 0 1 3 17.5z'/%3E%3Cpath d='M12 10v6M9 13h6'/%3E%3C/svg%3E"); }
.ico-file { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M6 3h8l5 5v13H6z'/%3E%3Cpath d='M14 3v5h5'/%3E%3C/svg%3E"); }
.ico-doc { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 2h8.5L20 7.5V22H6zM14 2.5V8h5.5' fill-rule='evenodd'/%3E%3C/svg%3E"); }
.ico-code { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 7l-5 5 5 5M16 7l5 5-5 5M13.5 4l-3 16'/%3E%3C/svg%3E"); }
.ico-image { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='16' rx='3'/%3E%3Ccircle cx='9' cy='10' r='2' fill='black'/%3E%3Cpath d='M21 16l-5-5-9 9'/%3E%3C/svg%3E"); }
.ico-archive { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='3'/%3E%3Cpath d='M12 3v3M12 8v2M12 12v2' stroke-linecap='round'/%3E%3Crect x='10' y='15' width='4' height='4' rx='1'/%3E%3C/svg%3E"); }
.ico-media { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 4h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2zm5 4.5v7l6-3.5z' fill-rule='evenodd'/%3E%3C/svg%3E"); }
.ico-link { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M10 14a4.5 4.5 0 0 0 6.4 0l3-3a4.5 4.5 0 0 0-6.4-6.4l-1 1'/%3E%3Cpath d='M14 10a4.5 4.5 0 0 0-6.4 0l-3 3a4.5 4.5 0 0 0 6.4 6.4l1-1'/%3E%3C/svg%3E"); }
.ico-edit { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h4L19 9l-4-4L4 16z'/%3E%3Cpath d='M13.5 6.5l4 4'/%3E%3C/svg%3E"); }
.ico-rename { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h10M4 12h7M4 17h5'/%3E%3Cpath d='M14 19l1-3.5 5-5 2.5 2.5-5 5z'/%3E%3C/svg%3E"); }
.ico-key { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='15' r='4'/%3E%3Cpath d='M11 12l8-8M16 7l2 2M19 4l2 2'/%3E%3C/svg%3E"); }
.ico-trash { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16M9 7V4h6v3M6 7l1 13h10l1-13M10 11v6M14 11v6'/%3E%3C/svg%3E"); }
.ico-x { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E"); }
.ico-check { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
.ico-alert { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l10 18H2z'/%3E%3Cpath d='M12 10v4M12 17.5v.01'/%3E%3C/svg%3E"); }

/* ---------- Boutons, champs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: var(--r-sm);
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 13px; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .15s, filter .15s; white-space: nowrap; }
.btn:hover { background: var(--surface-3); border-color: color-mix(in oklab, var(--accent) 40%, var(--border-strong)); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-strong)); border-color: transparent; color: #fff; box-shadow: 0 6px 20px -8px var(--accent); }
.btn.primary:hover { filter: brightness(1.12); }
.btn.danger { background: var(--danger-soft); border-color: color-mix(in oklab, var(--danger) 35%, transparent); color: var(--danger); }
.btn.danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; height: 46px; font-size: 15px; border-radius: 12px; }
.btn.loading { pointer-events: none; }
.btn.loading .ico-arrow { animation: spin .8s linear infinite; --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M12 3a9 9 0 1 1-9 9'/%3E%3C/svg%3E"); }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0; border-radius: var(--r-sm);
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--muted); cursor: pointer; transition: all .15s; }
.icon-btn:hover { color: var(--text); background: var(--surface-3); }
.icon-btn .ico { width: 18px; height: 18px; }
.theme-toggle:hover { color: var(--accent-3); box-shadow: 0 0 18px -6px var(--accent-3); }
.theme-toggle .ico-sun, [data-theme="light"] .theme-toggle .ico-moon { display: none; }
[data-theme="light"] .theme-toggle .ico-sun { display: inline-block; }
input[type=text], input:not([type]), input[type=search], input[type=password], textarea {
  width: 100%; height: 38px; padding: 8px 12px; border-radius: var(--r-sm); border: 1px solid var(--border-strong); background: var(--input); color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .15s; }
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder { color: var(--faint); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; margin: 0; vertical-align: middle; }
.alert { padding: 10px 14px; border-radius: 12px; border: 1px solid; font-size: 13px; margin: 0 0 14px; }
.alert.danger { background: var(--danger-soft); border-color: color-mix(in oklab, var(--danger) 35%, transparent); }
.alert.info { background: var(--info-soft); border-color: color-mix(in oklab, var(--accent-2) 35%, transparent); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); }

/* ==========================================================================
   APPLICATION
   ========================================================================== */
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 16px; height: 68px; padding: 0 24px;
  background: color-mix(in oklab, var(--bg) 78%, transparent); -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand img { filter: drop-shadow(0 0 10px color-mix(in oklab, var(--accent) 55%, transparent)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--display); font-weight: 600; font-size: 18px; }
.brand-text small { color: var(--faint); font-size: 11.5px; }
.brand:hover { color: var(--text); }
.who { display: flex; align-items: center; gap: 10px; margin-left: 8px; padding: 6px 14px 6px 6px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); min-width: 0; max-width: 520px; }
.avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 34px; height: 34px; border-radius: 50%; font-weight: 700; font-size: 13px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 0 14px -4px var(--accent); }
.who-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.who-text strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-text small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { margin-left: auto; display: flex; gap: 8px; }

.main { max-width: 1400px; margin: 0 auto; padding: 24px; }
.browser { overflow: visible; }
.toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; min-width: 0; flex: 1; font-weight: 500; }
.crumbs button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; max-width: 260px; }
.crumbs button span.t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs button:hover { background: var(--surface-3); color: var(--text); }
.crumbs button.cur { color: var(--text); font-weight: 600; cursor: default; background: transparent; }
.crumbs .sep { color: var(--faint); font-size: 13px; padding: 0 1px; }
.crumbs button.drop-hover { background: var(--accent-soft); color: var(--accent-text); }
.tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search { position: relative; display: block; }
.search .ico { position: absolute; left: 11px; top: 11px; color: var(--faint); }
.search input { width: 200px; padding-left: 34px; }
.split { position: relative; display: inline-flex; }
.split > .btn:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.split .caret { border-radius: 0 var(--r-sm) var(--r-sm) 0; padding: 0 10px; margin-left: 1px; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 210px; padding: 6px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--pop); }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-radius: 8px; background: none; text-align: left; cursor: pointer; }
.menu button:hover { background: var(--accent-soft); color: var(--accent-text); }

.table-wrap { overflow-x: auto; }
table.files { width: 100%; border-collapse: collapse; }
.files th { position: sticky; top: 0; padding: 11px 12px; text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--faint);
  background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; user-select: none; }
.files th.sortable { cursor: pointer; }
.files th.sortable:hover { color: var(--muted); }
.files th.sorted { color: var(--accent-text); }
.files th.sorted::after { content: "↑"; margin-left: 6px; }
.files th.sorted.desc::after { content: "↓"; }
.files td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.files tbody tr { transition: background .1s; }
.files tbody tr:hover { background: var(--accent-softer); }
.files tbody tr.sel { background: var(--accent-soft); }
.files tbody tr.drop-hover { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.files tbody tr:last-child td { border-bottom: 0; }
.c-check { width: 44px; }
.c-size { width: 110px; } .c-date { width: 170px; } .c-perm { width: 120px; } .c-owner { width: 120px; } .c-act { width: 1%; }
.files td.c-size, .files td.c-date, .files td.c-owner { color: var(--muted); white-space: nowrap; }
.files td.c-perm { font-family: var(--mono); font-size: 12px; color: var(--faint); white-space: nowrap; }
.files td.c-perm b { color: var(--muted); font-weight: 600; margin-right: 6px; }
.name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.name .ftype { width: 20px; height: 20px; }
.name .label { border: 0; background: none; padding: 0; text-align: left; cursor: pointer; color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }
.name .label:hover { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.name .msub { display: none; }
.name small { color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-dir { color: var(--accent-3); }
.t-img { color: #f472b6; } .t-code { color: var(--accent-2); } .t-arch { color: #fb923c; } .t-media { color: #a78bfa; } .t-doc { color: var(--muted); } .t-link { color: var(--accent-2); }
.acts { display: flex; gap: 4px; justify-content: flex-end; opacity: .55; transition: opacity .15s; }
tr:hover .acts, tr.sel .acts, .acts:focus-within { opacity: 1; }
.acts .icon-btn { width: 32px; height: 32px; background: transparent; border-color: transparent; }
.acts .icon-btn .ico { width: 16px; height: 16px; }
.acts .icon-btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.acts .icon-btn.del:hover { color: var(--danger); background: var(--danger-soft); border-color: color-mix(in oklab, var(--danger) 35%, transparent); }
.empty { padding: 56px 16px; text-align: center; color: var(--faint); }
.empty .ico { width: 42px; height: 42px; display: block; margin: 0 auto 10px; color: var(--border-strong); }
.empty strong { display: block; color: var(--muted); font-size: 15px; margin-bottom: 2px; }
.statusbar { display: flex; justify-content: space-between; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--border); color: var(--faint); font-size: 12.5px; }
.statusbar .hint { display: inline-flex; align-items: center; gap: 6px; }
.skeleton td { padding: 14px 12px; }
.skeleton i { display: block; height: 10px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* Barre de sélection */
.bulkbar { position: fixed; left: 50%; bottom: 22px; z-index: 50; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 18px;
  border-radius: 16px; background: var(--glass); border: 1px solid var(--border-strong); box-shadow: var(--pop); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.bulkbar #bulkCount { font-weight: 600; margin-right: 6px; white-space: nowrap; }

/* Glisser-déposer */
.dropzone { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 24px; pointer-events: none;
  background: color-mix(in oklab, var(--bg) 70%, transparent); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.dropzone > div { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 60px; border-radius: 24px; border: 2px dashed var(--accent); background: var(--accent-softer); box-shadow: 0 0 60px -20px var(--accent); text-align: center; }
.dropzone .ico { width: 40px; height: 40px; color: var(--accent-text); }
.dropzone strong { font-family: var(--display); font-size: 22px; }
.dropzone small { color: var(--muted); font-family: var(--mono); }

/* Envoi en cours */
.uploads { position: fixed; right: 20px; bottom: 20px; z-index: 60; width: 340px; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--pop); }
.up-head { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 13.5px; }
.up-head span { color: var(--accent-text); font-weight: 700; }
.progress { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); box-shadow: 0 0 12px var(--accent); transition: width .2s; }
.up-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.up-meta span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Notifications */
.toasts { position: fixed; right: 20px; top: 84px; z-index: 90; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 10px; max-width: 380px; padding: 11px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border-strong);
  box-shadow: var(--pop); font-size: 13px; pointer-events: auto; animation: toast-in .2s ease-out; }
.toast .ico { margin-top: 2px; }
.toast.ok .ico { color: var(--success); } .toast.ok { border-color: color-mix(in oklab, var(--success) 45%, var(--border-strong)); }
.toast.err .ico { color: var(--danger); } .toast.err { border-color: color-mix(in oklab, var(--danger) 45%, var(--border-strong)); }
.toast.out { opacity: 0; transform: translateY(-6px); transition: all .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } }

/* Fenêtres */
.modal-root:empty { display: none; }
.modal-back { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 18px; background: rgba(5,3,12,.62); animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(460px, 100%); max-height: calc(100vh - 36px); display: flex; flex-direction: column; border-radius: 18px; background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--pop); animation: pop .18s ease-out; }
.modal.wide { width: min(1100px, 100%); height: calc(100vh - 36px); }
.modal.mid { width: min(620px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px 0; }
.modal-head h2 { font-size: 19px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-head .sub { display: block; font-family: var(--mono); font-size: 12px; color: var(--faint); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-body { padding: 14px 18px; overflow: auto; flex: 1; }
.modal-body p { margin: 0 0 12px; color: var(--muted); }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 18px 18px; flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; display: flex; align-items: center; gap: 8px; color: var(--faint); font-size: 12px; }
.modal .danger-icon { display: inline-flex; width: 38px; height: 38px; align-items: center; justify-content: center; border-radius: 12px; background: var(--danger-soft); color: var(--danger); flex: none; }
.modal ul.names { margin: 0 0 6px; padding: 10px 14px; list-style: none; max-height: 180px; overflow: auto; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-family: var(--mono); font-size: 12.5px; }
.modal ul.names li { padding: 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor { width: 100%; height: 100%; min-height: 300px; resize: none; font: 13px/1.6 var(--mono); tab-size: 4; padding: 14px 16px; border-radius: 12px; white-space: pre; overflow: auto; }
.modal.wide .modal-body { display: flex; }
.dirty { color: var(--accent-3); font-weight: 600; }
.perm-grid { display: grid; grid-template-columns: auto repeat(3, 1fr); gap: 8px 10px; align-items: center; margin: 4px 0 16px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.perm-grid .h { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); text-align: center; }
.perm-grid .r { font-weight: 600; color: var(--muted); }
.perm-grid label { display: flex; justify-content: center; }
.octal { width: 110px !important; font-family: var(--mono); font-size: 18px !important; text-align: center; letter-spacing: .2em; height: 44px !important; }
.conflicts { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow: auto; }
.conflict { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.conflict .n { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: 9px; background: var(--surface-3); flex: none; }
.seg button { border: 0; padding: 4px 10px; border-radius: 7px; background: transparent; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg button.on.ow { color: var(--warning); }

/* ==========================================================================
   CONNEXION
   ========================================================================== */
body.login { background: #07050f; overflow-x: hidden; }
[data-theme="light"] body.login { background: #f3effc; }
.login-bg { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.login-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 40%, transparent 0%, rgba(7,5,15,.35) 55%, rgba(7,5,15,.85) 100%); }
[data-theme="light"] .login-bg::after { background: radial-gradient(ellipse at 50% 40%, transparent 0%, rgba(243,239,252,.3) 60%, rgba(243,239,252,.85) 100%); }
.glow { position: absolute; border-radius: 50%; filter: blur(90px); animation: float 18s ease-in-out infinite alternate; }
.g1 { width: 620px; height: 620px; left: 50%; top: -20%; margin-left: -310px; background: var(--accent); opacity: .45; }
.g2 { width: 460px; height: 460px; left: -8%; bottom: -14%; background: #ff7a18; opacity: .3; animation-duration: 22s; }
.g3 { width: 460px; height: 460px; right: -8%; bottom: -10%; background: var(--accent-2); opacity: .28; animation-duration: 26s; }
[data-theme="light"] .glow { opacity: .2; }
@keyframes float { to { transform: translate3d(30px,-24px,0) scale(1.08); } }
.grid { position: absolute; left: -50%; right: -50%; bottom: -10%; height: 55%;
  background-image: linear-gradient(color-mix(in oklab, var(--accent) 45%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in oklab, var(--accent) 45%, transparent) 1px, transparent 1px);
  background-size: 64px 64px; transform: perspective(520px) rotateX(62deg); transform-origin: 50% 0; opacity: .5;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 35%, transparent 95%); mask-image: linear-gradient(to bottom, transparent, #000 35%, transparent 95%); }
[data-theme="light"] .grid { opacity: .25; }
.floating { position: fixed; top: 16px; right: 16px; z-index: 5; background: var(--glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.login-wrap { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 16px; }
.login-logo { width: min(440px, 88vw); height: auto; margin-bottom: 8px; filter: drop-shadow(0 0 26px color-mix(in oklab, var(--accent) 45%, transparent)); animation: flicker 7s infinite; }
@keyframes flicker { 0%, 92%, 100% { opacity: 1; } 93% { opacity: .82; } 94% { opacity: 1; } 96% { opacity: .9; } 97% { opacity: 1; } }
.login-card { width: min(400px, 100%); padding: 28px; border-radius: 22px; background: var(--glass); -webkit-backdrop-filter: blur(18px) saturate(150%); backdrop-filter: blur(18px) saturate(150%);
  border-color: color-mix(in oklab, var(--accent) 22%, rgba(255,255,255,.08)); box-shadow: 0 30px 80px -30px rgba(0,0,0,.9), 0 0 60px -30px var(--accent); }
[data-theme="light"] .login-card { border-color: var(--border); box-shadow: 0 30px 70px -35px rgba(60,20,120,.45); }
.login-card h1 { font-size: 26px; }
.login-card > p { margin: 2px 0 20px; font-size: 13px; }
.field { display: block; margin-bottom: 16px; }
.field > span:first-child { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.input-ico { position: relative; display: block; }
.input-ico > .ico { position: absolute; left: 14px; top: 15px; color: var(--faint); pointer-events: none; }
.input-ico input { height: 46px; padding-left: 42px; border-radius: 12px; font-size: 14.5px; }
.input-ico input[type=password], .input-ico .reveal + input { padding-right: 46px; }
.input-ico:focus-within > .ico { color: var(--accent-text); }
.reveal { position: absolute; right: 6px; top: 6px; width: 34px; height: 34px; border: 0; border-radius: 9px; background: transparent; color: var(--faint); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.reveal:hover { background: var(--surface-3); color: var(--text); }
.reveal.on { color: var(--accent-text); }
.login-card .btn.block { margin-top: 6px; }
.login-foot { display: inline-flex; align-items: center; gap: 8px; margin: 18px 0 0; padding: 6px 14px; border-radius: 99px; background: var(--glass); border: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 10px var(--success); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1100px) { .hide-lg { display: none; } }
@media (max-width: 900px) {
  .hide-md { display: none; }
  .search input { width: 150px; }
  .brand-text { display: none; }
}
@media (max-width: 640px) {
  .hide-sm { display: none !important; }
  .topbar { padding: 0 12px; gap: 10px; height: 60px; }
  .who { padding-right: 10px; margin-left: 0; }
  .main { padding: 12px 10px 90px; }
  .toolbar { padding: 12px; }
  .tools { width: 100%; }
  .search { flex: 1; } .search input { width: 100%; }
  .c-date, .files td.c-date, .c-size, .files td.c-size { display: none; }
  table.files { table-layout: fixed; }
  .files th.c-check { width: 38px; } .files th.c-act { width: 146px; }
  .name { flex-wrap: wrap; row-gap: 0; }
  .name .label { flex: 1 1 0; min-width: 0; max-width: none; }
  .name .msub { display: block; flex-basis: 100%; padding-left: 30px; font-size: 11.5px; }
  .files td, .files th { padding-left: 8px; padding-right: 8px; }
  .acts { opacity: 1; }
  .acts .icon-btn.opt { display: none; }
  .uploads { left: 10px; right: 10px; width: auto; bottom: 10px; }
  .bulkbar { left: 10px; right: 10px; transform: none; bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
