/* Velyx — design system */
@font-face {
  font-family: "Unbounded";
  src: url("/fonts/unbounded.woff2") format("woff2");
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #050507;
  --bg-2: #08080b;
  --surface: #0b0b0e;
  --surface-2: #101014;
  --surface-3: #17171c;
  --line: #16161b;
  --line-2: #24242b;
  --ink: #fafafa;
  --ink-2: #c9c9cf;
  --muted: #85858f;
  --faint: #55555e;
  --accent: #00e10b;
  --accent-text: #2bff36;
  --accent-ink: #021803;
  --accent-soft: rgba(0, 225, 11, .09);
  --accent-line: rgba(0, 225, 11, .32);
  --blue: #6c8cff;
  --violet: #9b7bff;
  --amber: #ffb224;
  --danger: #ff5c50;
  --danger-soft: rgba(255, 92, 80, .1);
  --warn: #ffb224;
  --warn-soft: rgba(255, 178, 36, .1);
  --ok: #00e10b;
  --ok-soft: rgba(0, 225, 11, .1);
  --hatch: rgba(255, 255, 255, .035);
  --check-a: #0e0e12;
  --check-b: #15151a;
  --shadow: 0 20px 60px rgba(0, 0, 0, .45);
  --glow: 0 0 0 1px var(--accent-line), 0 0 40px rgba(0, 225, 11, .12);
  --radius: 18px;
  --radius-sm: 12px;
  --display: "Unbounded", "Segoe UI", system-ui, sans-serif;
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", ui-monospace, Consolas, monospace;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f6f6f3;
  --bg-2: #efefeb;
  --surface: #ffffff;
  --surface-2: #f8f8f6;
  --surface-3: #efefec;
  --line: #e7e7e2;
  --line-2: #d9d9d3;
  --ink: #0a0a0b;
  --ink-2: #33333a;
  --muted: #6c6c75;
  --faint: #a1a1a8;
  --accent-text: #00960a;
  --accent-soft: rgba(0, 190, 10, .1);
  --accent-line: rgba(0, 170, 10, .4);
  --hatch: rgba(0, 0, 0, .045);
  --check-a: #f3f3f0;
  --check-b: #e8e8e4;
  --shadow: 0 20px 50px rgba(20, 20, 10, .12);
  --glow: 0 0 0 1px var(--accent-line), 0 0 30px rgba(0, 190, 10, .1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
::selection { background: var(--accent); color: var(--accent-ink); }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: .9em; }
h1, h2, h3, h4 { margin: 0; font-family: var(--display); letter-spacing: -.02em; }
svg.ic { width: 17px; height: 17px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.ic.fill { fill: currentColor; stroke: none; }
.hidden { display: none !important; }
.display { font-family: var(--display); }
.muted { color: var(--muted); }
.accent { color: var(--accent-text); }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.label {
  font-family: var(--display); font-size: 10.5px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
}
.eyebrow { font-family: var(--display); font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-text); }

/* ============ Barre du haut ============ */
.topbar {
  position: sticky; top: 0; z-index: 40; height: 64px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { max-width: 1440px; margin: 0 auto; height: 100%; padding: 0 24px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: -.03em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 28px; height: 28px; flex: none; }
.brand img.mark { border-radius: 8px; object-fit: cover; }
.nav { display: flex; gap: 22px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  position: relative; color: var(--muted); font-family: var(--display); font-size: 12.5px; font-weight: 500;
  white-space: nowrap; padding: 6px 0; transition: color .15s;
}
.nav a:hover { color: var(--ink); text-decoration: none; }
.nav a.active { color: var(--ink); }
.nav a.active::after {
  content: ""; position: absolute; left: 50%; bottom: -2px; width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent); transform: translateX(-50%); box-shadow: 0 0 10px var(--accent);
}
.top-actions { display: flex; align-items: center; gap: 10px; }
.iconbtn {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); transition: all .15s;
}
.iconbtn:hover { color: var(--ink); border-color: var(--faint); }
.iconbtn.active { color: var(--accent-text); border-color: var(--accent-line); }
.dd { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 230px; z-index: 60;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow); padding: 6px;
  animation: pop .14s ease-out;
}
.menu .who { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu .who b { font-family: var(--display); font-size: 13px; display: block; }
.menu .who small { color: var(--muted); }
.menu a, .menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 9px;
  color: var(--ink-2); background: none; border: 0; font: inherit; font-size: 13.5px; cursor: pointer; text-align: left;
}
.menu a:hover, .menu button:hover { background: var(--surface-3); color: var(--ink); text-decoration: none; }
.menu a.active { color: var(--accent-text); background: var(--accent-soft); }
.menu .danger { color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.userbtn {
  display: flex; align-items: center; gap: 8px; padding: 3px 12px 3px 3px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit; font-size: 13px;
}
.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; flex: none;
  background: var(--accent-soft); color: var(--accent-text); font-family: var(--display); font-weight: 700; font-size: 10.5px;
  border: 1px solid var(--accent-line);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.cta-badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent-ink); color: var(--accent);
  font-size: 10.5px; display: inline-grid; place-items: center; font-family: var(--mono);
}

/* ============ Cadre hachuré ============ */
.frame { max-width: 1440px; margin: 0 auto; display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; min-height: calc(100vh - 64px); }
.rail {
  border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  background-image: repeating-linear-gradient(-45deg, var(--hatch) 0 1px, transparent 1px 9px);
}
.rail.off { border: 0; background: none; }
main { min-width: 0; }
.hero { padding: 64px 40px 44px; text-align: center; border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; left: 50%; top: -160px; width: 640px; height: 320px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(0, 225, 11, .10), transparent); pointer-events: none;
}
.hero h1 { font-size: clamp(28px, 4vw, 44px); font-weight: 700; line-height: 1.08; position: relative; }
.hero h1 .thin { font-weight: 300; }
.hero p { color: var(--muted); margin: 12px auto 0; max-width: 640px; font-size: 15px; position: relative; }
.hero .hero-actions { margin-top: 22px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; position: relative; }
.hero.left { text-align: left; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 48px 40px 36px; }
.hero.left::before { left: 0; transform: none; }
.hero.left p { margin-left: 0; }
.content { padding: 32px 40px 80px; }

/* ============ Cartes ============ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); position: relative; }
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h2 { font-size: 14px; font-weight: 600; }
.card-head .sub { color: var(--muted); font-size: 12.5px; }
.card.glow { box-shadow: var(--glow); }
.grid { display: grid; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.stack { display: grid; gap: 16px; align-content: start; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 16px; }
.kpi { padding: 22px; overflow: hidden; }
.kpi .top { display: flex; align-items: center; justify-content: space-between; }
.kpi .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); }
.kpi.hl .ico { background: var(--accent); color: var(--accent-ink); }
.kpi .value { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: -.03em; margin-top: 18px; font-variant-numeric: tabular-nums; }
.kpi .hint { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.kpi.hl::after {
  content: ""; position: absolute; right: -60px; bottom: -60px; width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 225, 11, .16), transparent); pointer-events: none;
}

/* ============ Boutons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 18px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); cursor: pointer; white-space: nowrap;
  font-family: var(--display); font-size: 12px; font-weight: 600; letter-spacing: -.005em; transition: all .15s;
}
.btn:hover { border-color: var(--faint); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 0 24px rgba(0, 225, 11, .25); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.white { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.white:hover { opacity: .9; }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, var(--line-2)); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.solid-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { border-color: transparent; background: none; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn.sm { padding: 6px 12px; font-size: 11px; }
.btn.icon { padding: 8px; border-radius: 50%; }
.btn.sm.icon { padding: 6px; }
.btn.lg { padding: 13px 26px; font-size: 13px; }
.btn.block { width: 100%; }

/* ============ Champs ============ */
input[type="text"], input[type="password"], input[type="number"], input[type="search"], input[type="date"], select, textarea {
  width: 100%; padding: 11px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--ink); font: inherit; outline: none; transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
select { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2385858f' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 14px; }
textarea { font-family: var(--mono); font-size: 12.5px; min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
input:disabled { opacity: .5; }
label.field { display: grid; gap: 8px; }
label.field > span:first-child, .field-label {
  font-family: var(--display); font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
label.field small, .help { color: var(--muted); font-size: 12px; font-weight: 400; }
label.field small code { overflow-wrap: anywhere; }
.input-icon { position: relative; flex: 1; min-width: 200px; }
.input-icon > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.input-icon > input { padding-left: 40px; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; color: var(--ink-2); }
.check input { appearance: none; width: 18px; height: 18px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--surface-2); display: grid; place-items: center; cursor: pointer; flex: none; margin: 0; }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after { content: ""; width: 9px; height: 5px; border: 2px solid var(--accent-ink); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; align-items: start; }

.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-2); gap: 2px; }
.seg button {
  border: 0; background: none; color: var(--muted); font-family: var(--display); font-weight: 600; font-size: 11.5px;
  padding: 7px 14px; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface-3); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }

.toggle { position: relative; width: 38px; height: 22px; flex: none; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle span { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); cursor: pointer; transition: .15s; }
.toggle span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; border-radius: 50%; background: var(--muted); transition: .15s; }
.toggle input:checked + span { background: var(--accent); border-color: var(--accent); }
.toggle input:checked + span::before { transform: translateX(16px); background: var(--accent-ink); }

/* ============ Badges ============ */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; white-space: nowrap;
  font-family: var(--display); font-size: 9.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  background: var(--surface-3); color: var(--ink-2); border: 1px solid var(--line-2);
}
.badge svg.ic { width: 11px; height: 11px; }
.badge.accent, .badge.ok { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent-line); }
.badge.danger { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.badge.warn, .badge.amber { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.badge.blue { background: rgba(108, 140, 255, .1); color: var(--blue); border-color: rgba(108, 140, 255, .35); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); display: inline-block; flex: none; }
.dot.off { background: var(--faint); box-shadow: none; }

/* ============ Tableaux ============ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-family: var(--display); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
tbody tr { transition: background .1s; }
tbody tr:hover { background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td.actions { text-align: right; white-space: nowrap; }
.empty { padding: 56px 20px; text-align: center; color: var(--muted); display: grid; justify-items: center; gap: 10px; }
.empty .ring-ico { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); border: 1px solid var(--line-2); color: var(--ink-2); }
.empty .ring-ico svg { width: 22px; height: 22px; }
.empty b { color: var(--ink); font-family: var(--display); font-size: 14px; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 18px; color: var(--muted); font-size: 12.5px; }

/* ============ Explorateur ============ */
.explorer { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: calc(100vh - 64px); }
.tree { border-right: 1px solid var(--line); padding: 20px 12px; position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; }
.tree .tree-title { padding: 0 10px 12px; display: flex; align-items: center; justify-content: space-between; }
.tree-node > .tn {
  display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 9px; cursor: pointer; color: var(--ink-2);
  font-size: 13px; user-select: none; white-space: nowrap;
}
.tree-node > .tn:hover { background: var(--surface-2); color: var(--ink); }
.tree-node > .tn.on { background: var(--accent-soft); color: var(--accent-text); }
.tree-node > .tn.drop { box-shadow: inset 0 0 0 1px var(--accent); }
.tree-node > .tn .tw { width: 16px; height: 16px; display: grid; place-items: center; color: var(--faint); flex: none; transition: transform .15s; }
.tree-node > .tn .tw.open { transform: rotate(90deg); }
.tree-node > .tn .tw svg { width: 13px; height: 13px; }
.tree-node > .tn > svg.ic { width: 15px; height: 15px; }
.tree-children { padding-left: 14px; margin-left: 15px; border-left: 1px solid var(--line); }
.ex-main { min-width: 0; padding: 26px 32px 120px; }
.ex-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-family: var(--display); font-size: 20px; font-weight: 700; letter-spacing: -.03em; flex: 1; min-width: 0; }
.crumbs a { color: var(--muted); padding: 2px 6px; border-radius: 8px; }
.crumbs a:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.crumbs a.cur { color: var(--ink); }
.crumbs a.drop { box-shadow: inset 0 0 0 1px var(--accent); }
.crumbs .sl { color: var(--faint); font-weight: 300; }
.ex-meta { color: var(--muted); font-size: 12.5px; margin: -10px 0 18px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.toolbar select { width: auto; border-radius: 999px; padding-top: 8px; padding-bottom: 8px; font-size: 13px; }
.toolbar .input-icon input { border-radius: 999px; padding-top: 9px; padding-bottom: 9px; }
.section-label { display: flex; align-items: center; gap: 10px; margin: 6px 0 12px; }
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 26px; }
.folder {
  display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; cursor: pointer; position: relative;
  background: var(--surface); border: 1px solid var(--line); transition: border-color .15s, background .15s; user-select: none;
}
.folder:hover { border-color: var(--line-2); background: var(--surface-2); }
.folder.drop { border-color: var(--accent); box-shadow: var(--glow); }
.folder .fi { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.folder .fi svg { width: 19px; height: 19px; }
.folder .fn { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder .fs { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.folder > div:nth-child(2) { flex: 1; min-width: 0; }
.folder .more { margin-left: auto; opacity: 0; transition: opacity .15s; }
.folder:hover .more { opacity: 1; }

.files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 12px; }
.tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column; position: relative; transition: border-color .15s, transform .15s; user-select: none;
}
.tile:hover { border-color: var(--line-2); transform: translateY(-2px); }
.tile.sel { border-color: var(--accent); box-shadow: var(--glow); }
.tile .pick { position: absolute; top: 9px; right: 9px; z-index: 2; opacity: 0; transition: opacity .12s; }
.tile:hover .pick, .tile.sel .pick, .selecting .tile .pick { opacity: 1; }
.thumb {
  aspect-ratio: 1; display: grid; place-items: center; position: relative; overflow: hidden;
  background-color: var(--check-a);
  background-image: conic-gradient(var(--check-b) 25%, transparent 0 50%, var(--check-b) 0 75%, transparent 0);
  background-size: 16px 16px;
}
.thumb img { max-width: 88%; max-height: 88%; object-fit: contain; }
.thumb.cover img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; }
.thumb .kind-ic { width: 38px; height: 38px; color: var(--faint); }
.thumb .tags { position: absolute; left: 9px; top: 9px; display: flex; gap: 4px; }
.thumb .tags .badge { backdrop-filter: blur(6px); background: color-mix(in srgb, var(--surface) 80%, transparent); }
.tile .meta { padding: 11px 12px 12px; display: grid; gap: 3px; border-top: 1px solid var(--line); }
.tile .name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .sub { display: flex; justify-content: space-between; color: var(--muted); font-size: 11.5px; gap: 8px; }
.list-thumb { width: 42px; height: 42px; border-radius: 10px; aspect-ratio: 1; }
.list-thumb .kind-ic { width: 18px; height: 18px; }

.selbar {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 45; display: flex; align-items: center; gap: 8px;
  padding: 8px 8px 8px 20px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow), var(--glow);
  animation: rise .2s ease-out; max-width: calc(100vw - 32px); overflow-x: auto;
}
.selbar b { font-family: var(--display); font-size: 12.5px; white-space: nowrap; margin-right: 8px; }
.dropzone-overlay {
  position: fixed; inset: 0; z-index: 70; background: rgba(5, 5, 7, .78); backdrop-filter: blur(4px); display: grid; place-items: center;
  pointer-events: none; animation: fade .15s;
}
.dropzone-overlay div { border: 2px dashed var(--accent); border-radius: 24px; padding: 60px 80px; text-align: center; background: var(--accent-soft); }
.dropzone-overlay h2 { font-size: 24px; margin-bottom: 6px; }

/* ============ Import ============ */
.steps { display: grid; gap: 16px; }
.step { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 18px; }
.step .num {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 700;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--muted);
}
.step.done .num { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.step.active .num { border-color: var(--accent); color: var(--accent-text); box-shadow: var(--glow); }
.step h3 { font-size: 15px; margin: 10px 0 4px; }
.step > div > p { color: var(--muted); margin: 0 0 14px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink-2);
  font-size: 12px; font-family: var(--mono); cursor: pointer; transition: all .12s;
}
.chip:hover { border-color: var(--accent-line); color: var(--ink); }
.chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.linkpreview {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line-2);
  font-family: var(--mono); font-size: 13px; overflow-x: auto; white-space: nowrap;
}
.linkpreview .base { color: var(--muted); }
.linkpreview .dest { color: var(--accent-text); font-weight: 600; }
.linkpreview .file { color: var(--ink); }
.drop {
  border: 1.5px dashed var(--line-2); border-radius: var(--radius); padding: 44px 24px; text-align: center;
  background: var(--surface-2); transition: border-color .15s, background .15s;
  background-image: radial-gradient(circle at 50% 0, rgba(0, 225, 11, .06), transparent 60%);
}
.drop.over { border-color: var(--accent); background-color: var(--accent-soft); }
.drop .big-ico { width: 60px; height: 60px; border-radius: 18px; margin: 0 auto 16px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 40px rgba(0, 225, 11, .35); }
.drop .big-ico svg { width: 26px; height: 26px; }
.drop h3 { font-size: 18px; margin-bottom: 6px; }
.drop p { color: var(--muted); margin: 0 0 18px; }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.summary-grid > div { padding: 14px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.summary-grid b { display: block; font-family: var(--display); font-size: 20px; letter-spacing: -.02em; }
.summary-grid span { color: var(--muted); font-size: 12px; }
.paths { font-family: var(--mono); font-size: 12.5px; display: grid; gap: 4px; max-height: 260px; overflow: auto; padding: 4px; }
.paths div { display: flex; gap: 10px; padding: 6px 10px; border-radius: 8px; background: var(--surface-2); }
.paths .from { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.paths .to { color: var(--accent-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1.2; min-width: 0; }
.progress { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; position: relative; }
.progress > i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent); border-radius: 999px; box-shadow: 0 0 16px var(--accent); transition: width .3s; }
.progress > i.err { background: var(--danger); box-shadow: none; }
.bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.log { display: grid; gap: 4px; max-height: 340px; overflow: auto; font-size: 12.5px; }
.log div { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 9px; background: var(--surface-2); }
.log .p { font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log .ok { color: var(--accent-text); }
.log .err { color: var(--danger); }
.log .skip { color: var(--warn); }

/* ============ Tiroir détail ============ */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 50; animation: fade .15s; backdrop-filter: blur(2px); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(580px, 100vw); z-index: 51; background: var(--surface);
  border-left: 1px solid var(--line-2); display: flex; flex-direction: column; animation: slide .2s ease-out;
}
.drawer header { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer header h2 { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.drawer .body { overflow-y: auto; padding: 20px; display: grid; gap: 22px; align-content: start; grid-auto-rows: max-content; }
.preview { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.preview .thumb { aspect-ratio: auto; min-height: 240px; max-height: 380px; padding: 16px; }
.preview .thumb img { max-height: 348px; }
.preview video { width: 100%; display: block; background: #000; }
.preview audio { width: 100%; display: block; padding: 14px; }
.links { display: grid; gap: 8px; }
.link-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.link-row .lbl { font-size: 12px; color: var(--muted); }
.link-row input { font-family: var(--mono); font-size: 11.5px; padding: 8px 12px; border-radius: 10px; }
.kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px 14px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.block-title { font-family: var(--display); font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }

/* ============ Graphiques & jauges ============ */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis text { fill: var(--faint); font-size: 11px; font-family: var(--font); }
.chart .tip {
  position: absolute; pointer-events: none; background: var(--surface-3); color: var(--ink); padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--line-2); font-size: 12px; white-space: nowrap; transform: translate(-50%, -115%); box-shadow: var(--shadow); z-index: 2;
}
.chart .tip b { display: block; margin-bottom: 3px; font-family: var(--display); font-size: 11px; }
.chart .tip i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; }
.gauge { display: flex; align-items: center; gap: 20px; }
.gauge .ringwrap { position: relative; width: 112px; height: 112px; flex: none; }
.gauge .ringwrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge .ringwrap .pct { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 21px; letter-spacing: -.03em; }
.gauge .ringwrap .pct small { display: block; font-size: 9px; color: var(--muted); font-weight: 600; letter-spacing: .1em; text-align: center; }
.gauge h3 { font-size: 14px; margin-bottom: 6px; }
.gauge .info { display: grid; gap: 3px; font-size: 13px; color: var(--muted); }
.gauge .info b { color: var(--ink); font-weight: 600; }
.stackbar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--surface-3); gap: 2px; }
.stackbar i { display: block; height: 100%; }
.legend-list { display: grid; gap: 10px; margin-top: 18px; }
.legend-list div { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; font-size: 13px; }
.legend-list i { width: 10px; height: 10px; border-radius: 3px; }

/* ============ Divers ============ */
.tabs { display: flex; gap: 6px; margin-bottom: 22px; overflow-x: auto; padding-bottom: 2px; }
.tabs button {
  border: 1px solid var(--line-2); background: var(--surface); font-family: var(--display); font-weight: 600; font-size: 11.5px;
  color: var(--muted); padding: 8px 15px; border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.callout { padding: 14px 16px; border-radius: 14px; background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--ink-2); font-size: 13.5px; display: flex; gap: 12px; }
.callout svg { color: var(--accent-text); margin-top: 2px; }
.callout.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.callout.warn svg { color: var(--warn); }
.callout.danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.callout.danger svg { color: var(--danger); }
pre.code {
  margin: 0; padding: 16px 18px; border-radius: 14px; background: #07070a; color: #d4f7d6; border: 1px solid var(--line-2);
  font: 12.5px/1.65 var(--mono); overflow-x: auto; position: relative;
}
:root[data-theme="light"] pre.code { background: #0d0f0d; border-color: #0d0f0d; }
pre.code .copy { position: absolute; right: 10px; top: 10px; }
.keyreveal { font-family: var(--mono); padding: 14px; border-radius: 12px; background: var(--accent-soft); border: 1px dashed var(--accent); color: var(--accent-text); overflow-wrap: anywhere; }
.endpoint { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.endpoint summary { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; list-style: none; }
.endpoint summary::-webkit-details-marker { display: none; }
.endpoint summary:hover { background: var(--surface-2); }
.endpoint .path { font-family: var(--mono); font-size: 12.5px; font-weight: 600; }
.endpoint .desc { color: var(--muted); font-size: 12px; margin-left: auto; text-align: right; }
.endpoint .inner { padding: 14px 16px; display: grid; gap: 10px; font-size: 13.5px; border-top: 1px solid var(--line); color: var(--ink-2); }
.method { font-family: var(--mono); font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 6px; min-width: 58px; text-align: center; }
.m-GET { background: var(--accent-soft); color: var(--accent-text); }
.m-POST { background: rgba(108, 140, 255, .12); color: var(--blue); }
.m-PUT, .m-PATCH { background: var(--warn-soft); color: var(--warn); }
.m-DELETE { background: var(--danger-soft); color: var(--danger); }
.docs-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; }
.docnav { position: sticky; top: 96px; display: grid; gap: 2px; align-self: start; }
.docnav a { padding: 8px 12px; border-radius: 10px; color: var(--muted); font-size: 13px; font-family: var(--display); font-weight: 500; }
.docnav a:hover { background: var(--surface); color: var(--ink); text-decoration: none; }
.docs-layout section { scroll-margin-top: 90px; }

dialog {
  border: 1px solid var(--line-2); border-radius: 20px; background: var(--surface); color: var(--ink); padding: 0;
  width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow);
}
dialog[open] { animation: pop .16s ease-out; }
dialog::backdrop { background: rgba(0, 0, 0, .6); backdrop-filter: blur(3px); }
dialog header { padding: 20px 22px 6px; font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: -.02em; }
dialog .body { padding: 14px 22px 20px; display: grid; gap: 16px; color: var(--ink-2); }
dialog footer { padding: 14px 22px 20px; display: flex; justify-content: flex-end; gap: 8px; }

#toasts { position: fixed; bottom: 24px; right: 24px; display: grid; gap: 8px; z-index: 100; justify-items: end; }
.toast {
  background: var(--surface-3); color: var(--ink); padding: 11px 16px; border-radius: 12px; font-size: 13px; border: 1px solid var(--line-2);
  box-shadow: var(--shadow); animation: rise .18s ease-out; display: flex; align-items: center; gap: 10px; max-width: 420px;
}
.toast svg { color: var(--accent-text); }
.toast.err svg { color: var(--danger); }

/* ============ Connexion ============ */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 14px; gap: 14px; }
.auth-form { display: grid; align-content: center; justify-items: center; padding: 32px 20px; position: relative; }
.auth-form .brand { position: absolute; top: 18px; left: 22px; }
.auth-card { width: min(420px, 100%); display: grid; gap: 18px; }
.auth-card h1 { font-size: 34px; line-height: 1.08; font-weight: 700; }
.auth-card p { color: var(--muted); margin: 0; font-size: 14.5px; }
.auth-visual {
  border-radius: 24px; background: var(--surface); border: 1px solid var(--line); position: relative; overflow: hidden;
  display: grid; align-content: start; padding: 56px 52px;
  background-image: radial-gradient(circle at 80% 100%, rgba(0, 225, 11, .16), transparent 55%), repeating-linear-gradient(-45deg, var(--hatch) 0 1px, transparent 1px 10px);
}
.auth-visual h2 { font-size: 38px; line-height: 1.08; font-weight: 700; max-width: 520px; }
.auth-visual h2 em { font-style: normal; color: var(--accent-text); }
.auth-visual > p { color: var(--ink-2); max-width: 460px; font-size: 15px; margin: 18px 0 0; }
.mock {
  margin-top: 42px; border-radius: 18px; background: var(--bg); border: 1px solid var(--line-2); box-shadow: var(--shadow); overflow: hidden;
  transform: perspective(1400px) rotateX(8deg) rotateY(-10deg) rotateZ(1deg); transform-origin: left top; width: 112%;
}
.mock .mbar { display: flex; gap: 6px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.mock .mbar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.mock .mbar span { margin-left: 10px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.mock .mbody { padding: 16px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.mock .mtile { aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); display: grid; place-items: center; }
.mock .mtile b { width: 46%; height: 46%; border-radius: 8px; opacity: .9; }
.mock .mlink { margin: 0 16px 16px; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--accent-line); font-family: var(--mono); font-size: 11.5px; color: var(--accent-text); display: flex; gap: 8px; align-items: center; }
.auth-foot { margin-top: 26px; display: flex; gap: 22px; color: var(--muted); font-size: 12.5px; }
.auth-foot b { color: var(--ink); font-family: var(--display); display: block; font-size: 18px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.btn.discord { background: #5865f2; border-color: #5865f2; color: #fff; }
.btn.discord:hover { background: #4752c4; border-color: #4752c4; text-decoration: none; }
.discord-card { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.discord-card .who { flex: 1; min-width: 180px; }
.discord-card .who b { display: block; font-size: 15px; }
.discord-card .who small { color: var(--muted); }

.spin { width: 22px; height: 22px; border: 2px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: rot .7s linear infinite; display: inline-block; }
.loading { padding: 80px; display: grid; place-items: center; }

@keyframes rot { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }
@keyframes rise { from { transform: translate(var(--tx, 0), 10px); opacity: 0; } }
.selbar { --tx: -50%; }

@media (max-width: 1100px) {
  .split { grid-template-columns: 1fr; }
  .explorer { grid-template-columns: 1fr; }
  .tree { display: none; }
}
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .docs-layout { grid-template-columns: 1fr; }
  .docnav { position: static; display: flex; flex-wrap: wrap; }
  .grid-2 { grid-template-columns: 1fr; }
  .frame { grid-template-columns: 0 minmax(0, 1fr) 0; }
  .rail { border: 0; }
  .nav { gap: 16px; }
}
@media (max-width: 640px) {
  .topbar { height: auto; }
  .topbar-inner { padding: 10px 14px 0; gap: 10px 14px; flex-wrap: wrap; height: auto; }
  .top-actions { margin-left: auto; }
  .nav { order: 3; flex-basis: 100%; padding: 4px 0 10px; }
  .frame { min-height: auto; }
  .brand span, .userbtn .uname, .cta-label { display: none; }
  .hero { padding: 40px 16px 30px; }
  .hero.left { padding: 32px 16px 24px; }
  .content { padding: 20px 16px 60px; }
  .ex-main { padding: 18px 16px 120px; }
  .files-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .link-row { grid-template-columns: minmax(0, 1fr) auto; }
  .link-row .lbl { grid-column: 1 / -1; }
  .kv { grid-template-columns: 1fr; }
  .step { grid-template-columns: 1fr; }
  .step .num { display: none; }
  .crumbs { font-size: 16px; }
}
