/* vpsmon — interface v2
   Un seul élément fort : le panneau « machine » bleu nuit. Tout le reste reste calme. */

@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(fonts/manrope-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(fonts/manrope-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/jetbrains-mono-latin-400-normal.woff2) format("woff2"); }

:root {
  color-scheme: light;
  --paper: #f3f5f8;
  --surface: #ffffff;
  --sunken: #f6f8fa;
  --line: #e3e7ed;
  --line-2: #d3d9e1;
  --ink: #0e1a2b;
  --ink-2: #4b5566;
  --ink-3: #828c9b;
  --accent: #2a78d6;
  --accent-ink: #1d5fb0;
  --accent-wash: #e7f0fb;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --good: #0ca30c;  --good-ink: #08780a;
  --warn: #fab219;  --warn-ink: #8a5a00;
  --crit: #d03b3b;  --crit-ink: #b42b2b;
  --track: #e9edf2;
  --grid: #edf0f4;
  /* panneau machine */
  --night-1: #0e1a2b;
  --night-2: #17345c;
  --night-ink: #f2f6fb;
  --night-ink-2: #a9bad0;
  --night-track: rgba(255, 255, 255, .12);
  --night-arc: #8cc0ff;
  --pop: 0 24px 64px -24px rgba(14, 26, 43, .28), 0 2px 6px rgba(14, 26, 43, .06);
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --paper: #0b111a; --surface: #111924; --sunken: #0e151f; --line: #1e2a39; --line-2: #2a3849;
    --ink: #e8edf3; --ink-2: #aab5c3; --ink-3: #758293;
    --accent: #3987e5; --accent-ink: #7fb3f2; --accent-wash: #15263c;
    --series-1: #3987e5; --series-2: #d95926;
    --good-ink: #3fc43f; --warn-ink: #fab219; --crit-ink: #f07373;
    --track: #1d2836; --grid: #18222f;
    --night-1: #0f1f37; --night-2: #1a3f70;
    --pop: 0 24px 64px -24px rgba(0, 0, 0, .7);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0b111a; --surface: #111924; --sunken: #0e151f; --line: #1e2a39; --line-2: #2a3849;
  --ink: #e8edf3; --ink-2: #aab5c3; --ink-3: #758293;
  --accent: #3987e5; --accent-ink: #7fb3f2; --accent-wash: #15263c;
  --series-1: #3987e5; --series-2: #d95926;
  --good-ink: #3fc43f; --warn-ink: #fab219; --crit-ink: #f07373;
  --track: #1d2836; --grid: #18222f;
  --night-1: #0f1f37; --night-2: #1a3f70;
  --pop: 0 24px 64px -24px rgba(0, 0, 0, .7);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 500 14px/1.55 var(--sans); background: var(--paper); color: var(--ink); -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-ink); text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.hidden { display: none !important; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ============ connexion ============ */
.login { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, 1fr); }
.login-art {
  position: relative; overflow: hidden; color: var(--night-ink); padding: 44px 52px;
  background: radial-gradient(120% 90% at 85% 10%, #24548f 0%, transparent 60%), linear-gradient(160deg, var(--night-1), var(--night-2));
  display: flex; flex-direction: column; justify-content: space-between;
}
.login-art .brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 16px; position: relative; }
.login-art .rack { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; padding: 28px 0; }
.login-art .rack svg { height: 100%; max-height: 520px; width: auto; max-width: 100%; }
.login-art h1 { position: relative; font-size: 44px; line-height: 1.05; letter-spacing: -.035em; font-weight: 750; margin: 0 0 14px; max-width: 12ch; }
.login-art p { position: relative; margin: 0; color: var(--night-ink-2); max-width: 38ch; font-size: 15px; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 32px; background: var(--surface); }
.login-form form { width: 100%; max-width: 330px; }
.login-form h2 { margin: 0 0 6px; font-size: 26px; letter-spacing: -.025em; font-weight: 750; }
.login-form .sub { color: var(--ink-3); margin: 0 0 30px; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; font-weight: 650; color: var(--ink-2); margin-bottom: 7px; }
.input {
  width: 100%; height: 42px; padding: 0 13px; border-radius: 11px; border: 1px solid var(--line-2);
  background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-wash); }
.form-error { color: var(--crit-ink); font-size: 13px; min-height: 20px; margin: 2px 0 10px; font-weight: 600; }

/* ============ boutons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer;
  font-weight: 650; font-size: 13px; white-space: nowrap; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--sunken); border-color: var(--ink-3); }
.btn:disabled { opacity: .5; cursor: default; }
.btn .i { width: 16px; height: 16px; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.btn.primary:hover { background: var(--night-2); border-color: var(--night-2); color: #fff; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.accent:hover { filter: brightness(1.08); background: var(--accent); }
.btn.danger { color: var(--crit-ink); }
.btn.danger.solid { background: var(--crit); border-color: var(--crit); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--sunken); border-color: transparent; }
.btn.block { width: 100%; height: 44px; font-size: 14px; }
.btn.icon { width: 36px; padding: 0; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.sm.icon { width: 30px; }

.seg { display: inline-flex; background: var(--sunken); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 4px 11px; border-radius: 7px; font-size: 12.5px; font-weight: 650; color: var(--ink-3); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(14, 26, 43, .1); }
.seg button .i { width: 15px; height: 15px; }

/* ============ structure ============ */
.app { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100%; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.logo { display: flex; align-items: center; gap: 11px; padding: 0 10px 26px; font-weight: 750; font-size: 15px; letter-spacing: -.01em; }
.logo-mark { width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(150deg, var(--night-2), var(--night-1)); display: grid; place-items: center; color: #8cc0ff; flex: none; }
.logo-mark .i { width: 18px; height: 18px; stroke-width: 2.2; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; color: var(--ink-2); font-weight: 650; }
.nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 4%, transparent); }
.nav a.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(14, 26, 43, .06), 0 0 0 1px var(--line); }
.nav a.active .i { color: var(--accent); }
.nav .count { margin-left: auto; font-size: 11.5px; font-weight: 700; padding: 0 7px; border-radius: 99px; background: color-mix(in srgb, var(--crit) 14%, transparent); color: var(--crit-ink); }
.machine-card { margin-top: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.machine-card .h { display: flex; align-items: center; gap: 8px; font-weight: 700; overflow: hidden; }
.machine-card .h span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.machine-card .ip { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.machine-card .acts { display: flex; gap: 2px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); align-items: center; }
.machine-card .acts .ver { font-size: 11.5px; color: var(--ink-3); margin-right: auto; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 20%, transparent); }
.dot.off { background: var(--crit); box-shadow: 0 0 0 3px color-mix(in srgb, var(--crit) 20%, transparent); }

.main { min-width: 0; padding: 22px 28px 56px 6px; }
.page-head { display: flex; align-items: center; gap: 14px; margin: 4px 0 20px; min-height: 40px; }
.page-head h1 { margin: 0; font-size: 26px; font-weight: 750; letter-spacing: -.03em; }
.page-head .sub { color: var(--ink-3); font-weight: 600; }
.page-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.menu-btn { display: none; }
.view { max-width: 1440px; animation: viewIn .25s ease; }
@keyframes viewIn { from { opacity: 0; transform: translateY(4px); } }

/* ============ panneau machine (héros) ============ */
.machine {
  position: relative; overflow: hidden; border-radius: 24px; color: var(--night-ink); box-shadow: var(--pop);
  background: radial-gradient(90% 120% at 100% 0%, #25599a 0%, transparent 55%), linear-gradient(155deg, var(--night-1) 10%, var(--night-2));
  padding: 26px 30px 28px;
}
.machine .art { position: absolute; right: 3%; top: -16px; height: 260px; opacity: .5; pointer-events: none; -webkit-mask-image: linear-gradient(#000 45%, transparent 85%); mask-image: linear-gradient(#000 45%, transparent 85%); }
.machine .art svg { height: 100%; width: auto; display: block; }
.machine-top { position: relative; display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.state { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 650; color: var(--night-ink-2); }
.state .dot { box-shadow: 0 0 0 3px rgba(12, 163, 12, .25); animation: beat 2.4s ease-in-out infinite; }
@keyframes beat { 50% { box-shadow: 0 0 0 6px rgba(12, 163, 12, 0); } }
.hostname { font-size: clamp(34px, 4.6vw, 54px); font-weight: 780; letter-spacing: -.045em; line-height: 1; margin: 12px 0 16px; word-break: break-all; }
.specs { display: flex; gap: 6px; flex-wrap: wrap; }
.spec { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 99px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .1); font-size: 12.5px; font-weight: 600; color: var(--night-ink); white-space: nowrap; }
.spec .i { width: 14px; height: 14px; color: var(--night-ink-2); }
.spec.mono { font-family: var(--mono); font-size: 12px; }
.dials { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 30px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, .1); }
.dial { display: flex; align-items: center; gap: 16px; min-width: 0; }
.ring { position: relative; width: 96px; height: 96px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring .tr { stroke: var(--night-track); }
.ring .arc { stroke: var(--night-arc); stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.2, .8, .2, 1), stroke .3s; }
.ring.warn .arc { stroke: var(--warn); }
.ring.crit .arc { stroke: #ff6b6b; }
.ring .v { position: absolute; inset: 0; display: grid; place-items: center; font-size: 23px; font-weight: 750; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.ring .v .stack { display: flex; flex-direction: column; align-items: center; line-height: 1.05; }
.ring .v small { font-size: 12px; color: var(--night-ink-2); font-weight: 650; margin-left: 1px; }
.dial-t { min-width: 0; }
.dial-t b { display: block; font-size: 15px; font-weight: 720; }
.dial-t span { display: block; color: var(--night-ink-2); font-size: 12.5px; font-weight: 550; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dial-t .flag { display: inline-flex; margin-top: 5px; font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 99px; }
.flag.warn { background: rgba(250, 178, 25, .18); color: #ffd36b; }
.flag.crit { background: rgba(255, 107, 107, .18); color: #ffa3a3; }

/* ============ panneaux ============ */
.row { display: grid; gap: 18px; margin-top: 18px; }
.row.main-side { grid-template-columns: minmax(0, 1fr) 340px; }
.row.pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; min-width: 0; }
.panel-h { display: flex; align-items: center; gap: 12px; padding: 18px 20px 0; flex-wrap: wrap; }
.panel-h h2 { margin: 0; font-size: 16px; font-weight: 740; letter-spacing: -.015em; }
.panel-h .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.panel-b { padding: 16px 20px 20px; }

.big-stat { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 4px; }
.big-stat .n { font-size: 32px; font-weight: 760; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.big-stat .n small { font-size: 15px; color: var(--ink-3); font-weight: 650; margin-left: 3px; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend b { color: var(--ink); font-weight: 720; font-variant-numeric: tabular-nums; }
.sw { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }
.chart-wrap { position: relative; height: 250px; margin-top: 12px; }
.chart-wrap canvas { width: 100%; height: 100%; display: block; }
.tip {
  position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--line-2); border-radius: 11px;
  padding: 9px 11px; font-size: 12.5px; box-shadow: var(--pop); white-space: nowrap; z-index: 5; opacity: 0; transition: opacity .1s; transform: translateX(-50%);
}
.tip.on { opacity: 1; }
.tip .t { color: var(--ink-3); margin-bottom: 4px; font-weight: 600; }
.tip div { display: flex; align-items: center; gap: 7px; }
.tip b { margin-left: auto; padding-left: 14px; font-variant-numeric: tabular-nums; }

.cores { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-top: 16px; }
.core { background: var(--sunken); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px 9px; font-size: 12px; }
.core .l { display: flex; justify-content: space-between; color: var(--ink-3); font-weight: 650; }
.core .l b { color: var(--ink); font-variant-numeric: tabular-nums; }

.bar { height: 6px; border-radius: 4px; background: var(--track); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 4px; background: var(--series-1); transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.bar.warn > i { background: var(--warn); }
.bar.crit > i { background: var(--crit); }
.core .bar { margin-top: 6px; height: 4px; }

/* état du serveur */
.health-sum { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; margin-bottom: 8px; }
.health-sum.ok { background: color-mix(in srgb, var(--good) 9%, transparent); }
.health-sum.warn { background: color-mix(in srgb, var(--warn) 13%, transparent); }
.health-sum.crit { background: color-mix(in srgb, var(--crit) 10%, transparent); }
.health-sum .ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fff; flex: none; }
.health-sum.ok .ico { background: var(--good); }
.health-sum.warn .ico { background: var(--warn); color: #3a2600; }
.health-sum.crit .ico { background: var(--crit); }
.health-sum b { display: block; font-size: 15px; font-weight: 740; }
.health-sum span { color: var(--ink-2); font-size: 12.5px; }
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: flex; align-items: center; gap: 11px; padding: 11px 2px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.checks li:last-child { border-bottom: 0; padding-bottom: 0; }
.checks .ci { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; flex: none; }
.checks .ci .i { width: 13px; height: 13px; stroke-width: 2.6; }
.checks .ok .ci { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good-ink); }
.checks .warn .ci { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn-ink); }
.checks .crit .ci { background: color-mix(in srgb, var(--crit) 14%, transparent); color: var(--crit-ink); }
.checks .lbl { font-weight: 650; }
.checks .val { margin-left: auto; color: var(--ink-3); font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.checks a.val:hover { color: var(--accent-ink); }

/* stockage */
.disk { padding: 13px 0; border-bottom: 1px solid var(--line); }
.disk:first-child { padding-top: 2px; }
.disk:last-child { border-bottom: 0; padding-bottom: 0; }
.disk-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.disk-row .m { font-weight: 720; }
.disk-row .d { color: var(--ink-3); font-size: 12px; font-family: var(--mono); }
.disk-row .v { margin-left: auto; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.disk-row .v b { color: var(--ink); }
.disk .bar { height: 8px; }

/* ============ tableaux ============ */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
.search { position: relative; }
.search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--ink-3); }
.search .input { height: 36px; padding-left: 35px; width: 260px; border-radius: 10px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { display: inline-flex; align-items: baseline; gap: 8px; padding: 10px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.chip b { font-size: 20px; font-weight: 760; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.chip span { color: var(--ink-3); font-weight: 600; font-size: 13px; }
.chip.crit b { color: var(--crit-ink); }
.table-panel { overflow: hidden; }
.scroll { overflow: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th { text-align: left; font-weight: 680; color: var(--ink-3); font-size: 12.5px; padding: 11px 16px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 1; white-space: nowrap; user-select: none; }
table.t th.sort { cursor: pointer; }
table.t th.sort:hover, table.t th.on { color: var(--ink); }
table.t th.on::after { content: " ↓"; color: var(--accent); }
table.t td { padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t tbody tr:last-child td { border-bottom: 0; }
table.t tbody tr:hover { background: var(--sunken); }
table.t .r { text-align: right; }
table.t td.ell { max-width: 460px; overflow: hidden; text-overflow: ellipsis; }
.cellbar { display: flex; align-items: center; gap: 10px; justify-content: flex-end; font-variant-numeric: tabular-nums; }
.cellbar .bar { width: 64px; height: 5px; }
.pill { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 650; color: var(--ink-2); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.pill.ok::before { background: var(--good); }
.pill.fail { color: var(--crit-ink); }
.pill.fail::before { background: var(--crit); }
.pill.warn::before { background: var(--warn); }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.empty { padding: 56px 20px; text-align: center; color: var(--ink-3); }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

/* ============ fichiers ============ */
.files { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 18px; align-items: start; }
.places { position: sticky; top: 22px; }
.places h3 { margin: 4px 10px 8px; font-size: 13px; color: var(--ink-3); font-weight: 680; }
.places a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px; color: var(--ink-2); font-weight: 620; }
.places a:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); color: var(--ink); }
.places a.on { color: var(--accent-ink); background: var(--accent-wash); }
.places a .i { width: 17px; height: 17px; }
.places .free { margin: 14px 10px 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-3); }
.places .free .bar { margin-top: 7px; }

.pathbar { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 6px 6px 6px 8px; margin-bottom: 12px; min-height: 50px; }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; flex: 1; min-width: 0; cursor: text; gap: 1px; }
.crumbs a { padding: 5px 8px; border-radius: 8px; color: var(--ink-2); font-weight: 650; }
.crumbs a:hover { background: var(--sunken); color: var(--ink); }
.crumbs a:last-child { color: var(--ink); font-weight: 740; }
.crumbs .sep { color: var(--line-2); font-weight: 400; }
.pathbar .search .input { font-family: var(--sans); }
.pathbar #pathin { height: 36px; flex: 1; font-family: var(--mono); font-size: 13px; }
.file-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.file-actions .spacer { flex: 1; }
.toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-weight: 600; cursor: pointer; font-size: 13px; }

.fname { display: flex; align-items: center; gap: 12px; cursor: pointer; min-width: 0; }
.fname .n { font-weight: 650; overflow: hidden; text-overflow: ellipsis; }
.fname:hover .n { color: var(--accent-ink); }
.fname .tgt { color: var(--ink-3); font-size: 12px; font-family: var(--mono); }
.ficon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--sunken); color: var(--ink-3); border: 1px solid var(--line); }
.ficon .i { width: 16px; height: 16px; }
.ficon.dir { background: var(--accent-wash); color: var(--accent); border-color: transparent; }
.ficon.img { background: color-mix(in srgb, #1baf7a 13%, transparent); color: #138a5f; border-color: transparent; }
.ficon.code { background: color-mix(in srgb, #6250d6 12%, transparent); color: #6250d6; border-color: transparent; }
.ficon.arc { background: color-mix(in srgb, #eda100 15%, transparent); color: #a46c00; border-color: transparent; }
.ficon.media { background: color-mix(in srgb, #e87ba4 15%, transparent); color: #c24d7a; border-color: transparent; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; margin: 0; }
tr.sel td { background: var(--accent-wash); }

.grid-view { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; padding: 16px; }
.tile { position: relative; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; overflow: hidden; transition: border-color .12s; }
.tile:hover { border-color: var(--line-2); }
.tile.sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.tile .thumb { position: relative; height: 104px; display: grid; place-items: center; background: var(--sunken); border-bottom: 1px solid var(--line); overflow: hidden; }
.tile .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile .thumb .ficon { width: 52px; height: 52px; border-radius: 14px; }
.tile .thumb .ficon .i { width: 24px; height: 24px; }
.tile .meta { padding: 9px 11px 10px; }
.tile .meta b { display: block; font-weight: 680; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .meta span { font-size: 12px; color: var(--ink-3); }
.tile .tsel { position: absolute; top: 8px; left: 8px; opacity: 0; transition: opacity .1s; }
.tile:hover .tsel, .tile.sel .tsel { opacity: 1; }
.tile .tmenu { position: absolute; top: 6px; right: 6px; opacity: 0; background: var(--surface); }
.tile:hover .tmenu { opacity: 1; }

.selbar { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; border-radius: 14px; background: var(--ink); color: var(--surface); margin-bottom: 12px; font-weight: 680; }
.selbar .spacer { flex: 1; }
.selbar .btn { background: transparent; border-color: color-mix(in srgb, var(--surface) 25%, transparent); color: var(--surface); }
.selbar .btn:hover { background: color-mix(in srgb, var(--surface) 12%, transparent); }
.selbar .btn.danger { color: #ff9b9b; }
.foot { margin-top: 10px; font-size: 12.5px; color: var(--ink-3); font-weight: 550; }

.drop-overlay { position: fixed; inset: 0; z-index: 60; background: color-mix(in srgb, var(--night-1) 35%, transparent); backdrop-filter: blur(3px); display: grid; place-items: center; pointer-events: none; animation: fade .12s; }
.drop-overlay div { background: var(--surface); border: 2px dashed var(--accent); border-radius: 22px; padding: 40px 60px; font-weight: 700; display: flex; flex-direction: column; align-items: center; gap: 12px; box-shadow: var(--pop); font-size: 15px; }
.drop-overlay .i { width: 36px; height: 36px; color: var(--accent); }
.drop-overlay small { color: var(--ink-3); font-family: var(--mono); font-weight: 400; }
.uploads { position: fixed; right: 20px; bottom: 20px; width: 340px; z-index: 70; display: flex; flex-direction: column; gap: 8px; }
.upload-item { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; box-shadow: var(--pop); }
.upload-item .n { display: flex; justify-content: space-between; font-size: 13px; font-weight: 680; gap: 10px; margin-bottom: 8px; }
.upload-item .n span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============ modales, menus, éditeur ============ */
.modal-bg { position: fixed; inset: 0; background: rgba(8, 14, 24, .5); z-index: 80; display: grid; place-items: center; padding: 20px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal { width: 100%; max-width: 440px; background: var(--surface); border-radius: 20px; box-shadow: var(--pop); animation: rise .2s cubic-bezier(.2, .8, .2, 1); }
.modal h3 { margin: 0; padding: 22px 24px 0; font-size: 18px; letter-spacing: -.02em; font-weight: 750; }
.modal .mb { padding: 12px 24px 4px; color: var(--ink-2); }
.modal .mf { display: flex; justify-content: flex-end; gap: 8px; padding: 18px 24px 22px; }
.modal pre { background: var(--sunken); border: 1px solid var(--line); border-radius: 12px; padding: 14px; font: 12px/1.55 var(--mono); max-height: 440px; overflow: auto; white-space: pre-wrap; color: var(--ink); margin: 0; }
.modal.wide { max-width: 800px; }

.menu { position: fixed; z-index: 85; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--pop); padding: 6px; min-width: 200px; animation: fade .1s; }
.menu button { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; font-size: 13.5px; font-weight: 600; }
.menu button:hover { background: var(--sunken); }
.menu button.danger { color: var(--crit-ink); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 4px; }
.menu .i { width: 16px; height: 16px; color: var(--ink-3); }
.menu button.danger .i { color: inherit; }

.editor { position: fixed; inset: 0; z-index: 90; background: var(--surface); display: flex; flex-direction: column; animation: fade .12s; }
.editor-h { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.editor-h .p { font-family: var(--mono); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-h .dirty { font-size: 12px; font-weight: 700; color: var(--warn-ink); background: color-mix(in srgb, var(--warn) 18%, transparent); padding: 2px 9px; border-radius: 99px; flex: none; }
.editor-b { flex: 1; display: flex; min-height: 0; }
.gutter { padding: 16px 12px 16px 16px; text-align: right; color: var(--ink-3); font: 13px/1.65 var(--mono); user-select: none; overflow: hidden; white-space: pre; min-width: 56px; background: var(--sunken); border-right: 1px solid var(--line); }
.editor textarea { flex: 1; border: 0; outline: 0; resize: none; padding: 16px 18px; font: 13px/1.65 var(--mono); background: var(--surface); white-space: pre; overflow: auto; tab-size: 4; }
.editor-f { display: flex; gap: 18px; padding: 8px 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); font-weight: 600; }
.preview { position: fixed; inset: 0; z-index: 90; background: rgba(8, 14, 24, .92); display: flex; flex-direction: column; animation: fade .12s; }
.preview-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; color: #fff; }
.preview-h .btn { background: rgba(255, 255, 255, .1); border-color: transparent; color: #fff; }
.preview-b { flex: 1; display: grid; place-items: center; padding: 8px 24px 24px; min-height: 0; }
.preview-b img, .preview-b video { max-width: 100%; max-height: 100%; border-radius: 10px; }
.preview-b iframe { width: 100%; height: 100%; border: 0; background: #fff; border-radius: 10px; }

.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--night-1); color: #f2f6fb; padding: 11px 16px; border-radius: 12px; font-size: 13.5px; font-weight: 600; box-shadow: var(--pop); animation: rise .2s; display: flex; gap: 9px; align-items: center; max-width: 560px; white-space: pre-line; }
.toast .i { width: 16px; height: 16px; color: #7ee07e; }
.toast.err { background: var(--crit); }
.toast.err .i { color: #fff; }
.banner { display: flex; gap: 10px; align-items: center; padding: 11px 15px; border-radius: 12px; background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn-ink); font-size: 13.5px; font-weight: 650; margin-bottom: 16px; }

/* ============ responsive ============ */
@media (max-width: 1200px) {
  .row.main-side, .row.pair { grid-template-columns: minmax(0, 1fr); }
  .dials { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 20px; }
}
@media (max-width: 880px) {
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 50; background: var(--paper); transform: translateX(-100%); transition: transform .2s; box-shadow: var(--pop); }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .main { padding: 14px 16px 40px; }
  .page-head h1 { font-size: 22px; }
  .machine { padding: 22px 20px; border-radius: 20px; }
  .files { grid-template-columns: 1fr; }
  .places { display: none; }
  .search .input { width: 100%; }
  .hide-sm { display: none; }
}
@media (max-width: 520px) {
  .dials { grid-template-columns: minmax(0, 1fr); }
  .ring { width: 80px; height: 80px; }
  .ring .v { font-size: 19px; }
}
@media (max-width: 880px) { .machine .art { display: none; } }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; }
.facts dt { color: var(--ink-3); font-weight: 600; }
.facts dd { margin: 0; text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
