/* Design repris de www.zitoon.com : mêmes jetons, mêmes fontes, même grammaire visuelle
   (fond graphite, accent orange, libellés en mono capitales, cartes à liseré). */

:root {
  --bg: #0a0a0a;
  --bg-1: #0f0f0f;
  --bg-2: #141414;
  --bg-3: #1a1a1a;
  --surface: rgba(255, 255, 255, 0.02);
  --surface-hi: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.06);
  --border-hi: rgba(255, 255, 255, 0.12);
  --border-accent: rgba(255, 94, 58, 0.25);

  --ink: #fafafa;
  --ink-2: #d4d4d4;
  --ink-3: #a3a3a3;
  --ink-4: #737373;
  --ink-5: #525252;

  --accent: #ff5e3a;
  --accent-hi: #ff7a5c;
  --accent-glow: rgba(255, 94, 58, 0.15);
  --accent-soft: rgba(255, 94, 58, 0.08);

  --success: #4ade80;
  --warn: #fbbf24;
  --danger: #f87171;
  --idle: #525252;

  --display: "Bricolage Grotesque", -apple-system, system-ui, sans-serif;
  --sans: "Manrope", -apple-system, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --max: 1320px;
  --pad: clamp(20px, 4vw, 56px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

::selection { background: var(--accent); color: var(--bg); }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* --- décor ambiant, identique au site vitrine ---------------------------- */
.ambient { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.ambient::before, .ambient::after {
  content: ""; position: absolute; border-radius: 50%;
  filter: blur(120px); opacity: 0.5;
}
.ambient::before {
  top: -220px; left: -140px; width: 520px; height: 520px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  animation: drift-a 22s ease-in-out infinite;
}
.ambient::after {
  top: 45vh; right: -200px; width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(255, 140, 80, 0.1) 0%, transparent 70%);
  animation: drift-b 28s ease-in-out infinite;
}
@keyframes drift-a {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(80px, 60px) scale(1.08); }
}
@keyframes drift-b {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-80px, -40px) scale(0.92); }
}
@media (prefers-reduced-motion: reduce) {
  .ambient::before, .ambient::after { animation: none; }
}

body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 1;
  opacity: 0.03; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

.shell {
  max-width: var(--max); margin: 0 auto;
  padding-left: var(--pad); padding-right: var(--pad);
  position: relative; z-index: 2;
}

.mono {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-4);
}

/* --- barre de navigation ------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 50; padding: 16px 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: baseline; gap: 10px; }
.brand .word {
  font-family: var(--display); font-weight: 600; font-size: 1.35rem;
  letter-spacing: -0.03em; color: var(--ink);
}
.brand .word span { color: var(--accent); }
.brand .sep { color: var(--ink-5); }
.brand .sub { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-4); }
.nav-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border: 1px solid var(--border-hi); border-radius: 999px;
  background: var(--surface); font-family: var(--mono); font-size: 0.68rem;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2);
}
.chip b { color: var(--ink); font-weight: 500; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--idle); flex: none; }
.dot.online { background: var(--success); animation: pulse 2.4s infinite; }
.dot.stale { background: var(--warn); }
.dot.offline { background: var(--ink-5); }
.dot.unknown { background: var(--ink-5); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid transparent;
  font-size: 0.88rem; font-weight: 600;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover:not(:disabled) { background: var(--accent); color: var(--ink); transform: translateY(-1px); }
.btn-ghost { background: var(--surface); color: var(--ink-2); border-color: var(--border-hi); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-hi); color: var(--ink); transform: translateY(-1px); }
.btn svg { width: 15px; height: 15px; flex: none; }

/* --- en-tête de page ----------------------------------------------------- */
.head { padding: clamp(36px, 6vw, 64px) 0 clamp(24px, 3vw, 36px); }
.sec-tag {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono);
  font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 16px;
}
.sec-tag::before { content: ""; width: 24px; height: 1px; background: var(--accent); }
.head h1 {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(2.2rem, 6vw, 4rem); line-height: 1; letter-spacing: -0.03em;
}
.head h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--accent), var(--accent-hi));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.head p { color: var(--ink-3); margin-top: 16px; max-width: 62ch; }

/* --- grille des machines ------------------------------------------------- */
.cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 18px; padding-bottom: 64px;
}
.card {
  position: relative; background: var(--bg-1); border: 1px solid var(--border);
  border-radius: 16px; padding: 26px 26px 22px; overflow: hidden;
  transition: border-color 0.3s ease, background 0.3s ease, transform 0.3s ease;
}
.card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, var(--accent-soft) 0%, transparent 70%);
  transition: opacity 0.4s ease;
}
.card:hover { border-color: var(--border-accent); background: var(--bg-2); transform: translateY(-2px); }
.card:hover::before { opacity: 1; }
.card > * { position: relative; z-index: 2; }
.card.is-offline { opacity: 0.72; }
.card.is-offline:hover { opacity: 1; }
.card.is-hot { border-color: rgba(248, 113, 113, 0.35); }

.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.card-name {
  font-family: var(--display); font-weight: 600; font-size: 1.5rem;
  letter-spacing: -0.015em; line-height: 1.1;
  display: flex; align-items: center; gap: 10px;
}
.card-role { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-4); margin-top: 6px; }
.card-hint { font-size: 0.8rem; color: var(--ink-5); margin-top: 4px; }

.temp { text-align: right; flex: none; }
.temp-val {
  font-family: var(--display); font-weight: 500; font-size: 2.6rem; line-height: 1;
  letter-spacing: -0.04em;
  background: linear-gradient(180deg, var(--accent) 0%, rgba(255, 94, 58, 0.35) 95%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.temp-val.cool { background: linear-gradient(180deg, #7dd3fc 0%, rgba(125, 211, 252, 0.3) 95%);
  -webkit-background-clip: text; background-clip: text; }
.temp-val.warm { background: linear-gradient(180deg, var(--warn) 0%, rgba(251, 191, 36, 0.3) 95%);
  -webkit-background-clip: text; background-clip: text; }
.temp-val.hot { background: linear-gradient(180deg, var(--danger) 0%, rgba(248, 113, 113, 0.3) 95%);
  -webkit-background-clip: text; background-clip: text; }
.temp-val.none { -webkit-text-fill-color: var(--ink-5); font-size: 1.6rem; }
.temp-lbl { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-5); margin-top: 2px; }

.spark { margin: 20px 0 4px; height: 44px; width: 100%; display: block; }
.spark-legend { display: flex; justify-content: space-between; }

.gauges { margin-top: 18px; display: grid; gap: 12px; }
.gauge-row { display: grid; grid-template-columns: 68px 1fr auto; align-items: center; gap: 12px; }
.gauge-row .k { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-4); }
.gauge-row .v { font-family: var(--mono); font-size: 0.74rem; color: var(--ink-2); white-space: nowrap; }
.bar { height: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width 0.6s ease; }
.bar > i.ok { background: var(--success); }
.bar > i.warn { background: var(--warn); }
.bar > i.bad { background: var(--danger); }

.sensors { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  padding: 4px 10px; font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.03em;
  color: var(--ink-3); border: 1px solid var(--border-hi); border-radius: 999px;
  background: var(--surface); white-space: nowrap;
}
.pill b { color: var(--ink); font-weight: 500; }
.pill.hot { border-color: rgba(248, 113, 113, 0.4); color: var(--danger); }
.pill.gpu { border-color: rgba(74, 222, 128, 0.3); }

.card-foot {
  margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.seen { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.04em; color: var(--ink-4); }
.seen b { color: var(--ink-2); font-weight: 500; }
.wol-note { flex-basis: 100%; font-family: var(--mono); font-size: 0.64rem;
  color: var(--ink-4); margin-top: 4px; }
.wol-note.err { color: var(--danger); }
.wol-note.ok { color: var(--success); }

/* --- page de connexion --------------------------------------------------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; position: relative; z-index: 2;
}
.login-card {
  width: 100%; max-width: 400px; background: var(--bg-1); border: 1px solid var(--border);
  border-radius: 18px; padding: 40px 34px 34px;
}
.login-card .brand { margin-bottom: 28px; }
.login-card h1 {
  font-family: var(--display); font-weight: 500; font-size: 1.9rem;
  letter-spacing: -0.025em; line-height: 1.1; margin-bottom: 8px;
}
.login-card p { color: var(--ink-4); font-size: 0.9rem; margin-bottom: 26px; }
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field label { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-4); }
.field input {
  width: 100%; padding: 13px 15px; border-radius: 10px; background: var(--bg-3);
  border: 1px solid var(--border-hi); color: var(--ink);
  font-family: var(--mono); font-size: 0.95rem; letter-spacing: 0.06em;
}
.field input:focus { outline: none; border-color: var(--accent); background: var(--bg-2); }
.login-card .btn { width: 100%; padding: 13px; }
.err {
  margin-top: 16px; font-size: 0.85rem; color: var(--danger);
  min-height: 1.2em;
}

.foot {
  border-top: 1px solid var(--border); padding: 22px 0 34px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.foot .mono { color: var(--ink-5); }

@media (max-width: 520px) {
  .cards { grid-template-columns: 1fr; }
  .card { padding: 22px 20px 18px; }
  .temp-val { font-size: 2.1rem; }
}

/* --- onglets Machines / Réseau ------------------------------------------- */
.tabs { display: flex; gap: 2px; padding: 3px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border); }
.tab {
  padding: 7px 16px; border-radius: 8px; font-size: 0.86rem; font-weight: 600;
  color: var(--ink-4); transition: color 0.2s ease, background 0.2s ease;
}
.tab:hover { color: var(--ink-2); }
.tab.is-active { background: var(--bg-3); color: var(--ink); }
@media (max-width: 860px) { .nav-inner { flex-wrap: wrap; } .tabs { order: 3; } }

/* --- barre d'avancement du scan ------------------------------------------ */
.progress { margin-top: 26px; }
.progress-line { display: grid; grid-template-columns: 130px 1fr 90px;
  align-items: center; gap: 14px; }
.progress-line .bar { height: 5px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.progress-line .bar > i { display: block; height: 100%; background: var(--accent);
  transition: width 0.4s ease; }
.progress-line .mono:last-child { text-align: right; }

/* --- filtres -------------------------------------------------------------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.chip.filter { cursor: pointer; border-color: var(--border); }
.chip.filter:hover { border-color: var(--border-hi); color: var(--ink); }
.chip.filter.is-active { border-color: var(--accent); color: var(--ink);
  background: var(--accent-soft); }
.chip.filter b { color: var(--accent); }

/* --- cartes d'appareil ---------------------------------------------------- */
.dev { padding: 20px 22px 16px; }
.dev-head { display: grid; grid-template-columns: 40px 1fr auto; gap: 14px;
  align-items: start; }
.dev-icon { font-size: 1.7rem; line-height: 1.2; }
.dev-name {
  font-family: var(--display); font-weight: 600; font-size: 1.12rem;
  letter-spacing: -0.01em; line-height: 1.25; word-break: break-word;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.dev-sub { font-size: 0.86rem; color: var(--ink-3); margin-top: 2px; }
.dev-type { color: var(--ink-5); white-space: nowrap; padding-top: 4px; }
.tag {
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 2px 7px; border-radius: 999px;
  border: 1px solid var(--border-accent); color: var(--accent); font-weight: 500;
}
.tag.new { border-color: rgba(74, 222, 128, 0.4); color: var(--success); }
.tag.off { border-color: var(--border-hi); color: var(--ink-5); }
.dev-net { margin-top: 12px; color: var(--ink-2); display: flex; gap: 12px;
  flex-wrap: wrap; font-size: 0.72rem; letter-spacing: 0.02em; text-transform: none; }
.dev-mac { color: var(--ink-5); }
.dev-foot {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
}
.dev-actions { display: flex; gap: 8px; }
.btn.small { padding: 6px 12px; font-size: 0.78rem; border-radius: 8px; }
.dev-details { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.signals-list {
  display: grid; grid-template-columns: 118px 1fr; gap: 6px 14px;
  font-family: var(--mono); font-size: 0.72rem; line-height: 1.5;
}
.signals-list dt { color: var(--ink-5); }
.signals-list dd { color: var(--ink-2); word-break: break-word; }
.empty { color: var(--ink-4); padding: 40px 0; grid-column: 1 / -1; }
