/* VPS Panel — thème « Aluminium » (piste A1) */
:root {
  --ground: #E4E7EB;      /* fond de page */
  --panel: #F4F5F7;       /* barre du haut, façade, cartes */
  --unit: #FFFFFF;        /* unités de la baie, champs */
  --rack: #D5DAE0;        /* intérieur de la baie */
  --line: #CDD2D9;        /* bordures */
  --line-strong: #AEB5BF;
  --plate: #EEF0F3;       /* plaques de port */
  --ink: #1D2329;         /* texte, boutons principaux */
  --muted: #555F6B;
  --ok: #1A8A4C;
  --ok-ring: #D3EDDD;
  --warn: #B36B00;
  --warn-ring: #F6E2BC;
  --warn-bg: #FFF8EC;
  --warn-line: #E8C98F;
  --bad: #C8392B;
  --bad-ring: #F6D3CE;
  --bad-bg: #FDF1EF;
  --bad-line: #EBB4AC;
  --link: #1D4ED8;
  --term-bg: #1D2329;
  --term-text: #D5DAE0;
  --term-muted: #8C96A3;
  --radius: 10px;
  --font: 'Schibsted Grotesk', system-ui, sans-serif;
  --mono: 'Fira Code', ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
[v-cloak] { display: none; }
html, body { margin: 0; }
body { background: var(--ground); color: var(--ink); font: 15px/1.5 var(--font); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
code, .mono, pre, textarea.mono, input.mono { font-family: var(--mono); font-size: 13.5px; }
code { background: var(--plate); border: 1px solid var(--line); padding: 1px 6px; border-radius: 4px; word-break: break-all; }
h1 { font-size: 34px; font-weight: 800; line-height: 1.05; letter-spacing: -.01em; margin: 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
hr { border: 0; border-top: 1px solid var(--line); margin: 8px 0; }
.muted { color: var(--muted); font-weight: 400; }
.strong { color: var(--ink); }
.small { font-size: 13px; }
.right { text-align: right; }
.lede { margin: 8px 0 0; }
.label { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.link { color: var(--link); }
.text-ok { color: var(--ok); }
.text-bad { color: var(--bad) !important; }
@keyframes blink { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }

/* ---------- mise en page ---------- */
.container { max-width: 1280px; margin: 0 auto; padding: 32px 40px 64px; }
.narrow { max-width: 760px; margin: 0 auto; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-lg { display: flex; flex-direction: column; gap: 28px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.stack > .page-head { margin-bottom: 0; }
.back { font-size: 14px; display: inline-block; margin-bottom: 6px; color: var(--muted); }
.domain-link { font-family: var(--mono); font-size: 14px; display: inline-block; margin-top: 6px; }
.row { display: flex; align-items: center; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.gap { gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 160px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid.two { grid-template-columns: 1fr 1fr; }
.span2 { grid-column: 1 / -1; }
.card { background: var(--unit); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }

/* ---------- barre du haut ---------- */
.topbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px;
  padding: 14px 40px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5;
}
.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 800; font-size: 19px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand.big { font-size: 24px; justify-content: center; margin-bottom: 6px; }
.logo { color: var(--ink); flex: none; }
.mainnav { display: flex; gap: 4px; flex-wrap: wrap; }
.mainnav a { padding: 9px 14px; border-radius: 6px; color: var(--muted); font-weight: 500; }
.mainnav a:hover { background: var(--rack); text-decoration: none; }
.mainnav a.on { background: var(--ink); color: #FFFFFF; font-weight: 600; }
.host { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }

/* ---------- façade du serveur ---------- */
.facade {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.gauge { background: var(--panel); padding: 18px 22px; display: flex; flex-direction: column; gap: 10px; }
.gauge-head { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 14px; }
.segs { display: flex; gap: 3px; }
.segs span { flex: 1; height: 10px; border-radius: 2px; background: var(--rack); }
.segs span.on { background: var(--ok); }
.segs span.on.warn { background: var(--warn); }
.segs span.on.bad { background: var(--bad); }
.services { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; }
.services span { display: inline-flex; align-items: center; gap: 7px; }

/* ---------- voyants ---------- */
.led { display: inline-block; flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--line-strong); box-shadow: 0 0 0 3px var(--rack); }
.led.small { width: 9px; height: 9px; box-shadow: none; }
.led.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-ring); }
.led.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-ring); }
.led.bad { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-ring); }
.led.small.ok, .led.small.warn, .led.small.bad { box-shadow: none; }
.led.blink { animation: blink 1s infinite; }

/* ---------- la baie ---------- */
.rack { background: var(--rack); border: 1px solid #C2C8D0; border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.unit {
  display: grid; grid-template-columns: auto auto minmax(200px, 1.4fr) minmax(170px, 1fr) 150px 130px 150px;
  align-items: center; gap: 14px 22px; padding: 16px 22px;
  background: var(--unit); border: 1px solid var(--line); border-radius: 6px; color: inherit;
  box-shadow: 0 1px 0 #FFFFFF inset; transition: border-color .15s;
}
.unit:hover { text-decoration: none; border-color: var(--ink); }
.unit.is-warn { background: var(--warn-bg); border-color: var(--warn-line); }
.unit.is-bad { background: var(--bad-bg); border-color: var(--bad-line); }
.screws { display: flex; flex-direction: column; gap: 22px; }
.screws i { width: 7px; height: 7px; border-radius: 50%; background: var(--rack); border: 1px solid var(--line-strong); }
.unit-name { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.unit-name .name { font-size: 20px; font-weight: 700; }
.unit-name .mono, .unit-kind .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unit-kind { display: flex; flex-direction: column; font-size: 14px; min-width: 0; }
.plate { justify-self: start; font-size: 14px; padding: 8px 12px; border-radius: 4px; background: var(--plate); border: 1px solid var(--line); white-space: nowrap; }
.plate .arrow { color: var(--muted); }
.ssl { justify-self: start; font-size: 13px; font-weight: 600; color: var(--muted); padding: 6px 10px; border: 1px dashed var(--line-strong); border-radius: 4px; white-space: nowrap; }
.ssl.ok { color: var(--ok); border: 1px solid var(--ok); }
.ssl.warn { color: var(--warn); border: 1px solid var(--warn); }
.ssl.bad { color: var(--bad); border: 1px solid var(--bad); }
.unit-status { text-align: right; font-weight: 700; font-size: 14px; color: var(--muted); }
.unit-status.ok { color: var(--ok); }
.unit-status.work { color: var(--warn); }
.unit-status.bad { color: var(--bad); }
.slot {
  min-height: 64px; display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 1px dashed #9AA3AE; border-radius: 6px; color: var(--muted); font-size: 15px;
}
.slot:hover { text-decoration: none; color: var(--ink); border-color: var(--ink); background: rgba(255, 255, 255, .4); }

/* ---------- formulaires ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
label { display: block; font-weight: 600; }
label > input, label > select, label > textarea, label > .row { margin-top: 6px; }
input, select, textarea {
  font: inherit; font-weight: 400; color: var(--ink); background: var(--unit); border: 1px solid var(--line);
  border-radius: 6px; padding: 10px 12px; width: 100%; min-height: 44px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ink); outline-offset: 0; border-color: var(--ink); }
input:disabled { background: var(--plate); color: var(--muted); }
input::placeholder, textarea::placeholder { color: #8C96A3; }
label.check { display: flex; align-items: center; gap: 10px; font-weight: 400; }
label.check input { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--ink); }
.choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.opt { border: 1px solid var(--line); background: var(--unit); border-radius: 8px; padding: 14px; cursor: pointer; display: block; }
.opt input { width: auto; min-height: 0; margin: 0 6px 0 0; accent-color: var(--ink); }
.opt small { display: block; color: var(--muted); font-weight: 400; margin-top: 4px; }
.opt.on { border: 2px solid var(--ink); padding: 13px; }

.btn {
  font: inherit; font-weight: 600; font-size: 15px; border: 1px solid var(--line-strong); background: var(--unit); color: var(--ink);
  min-height: 44px; padding: 0 18px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
}
.btn:hover { border-color: var(--ink); text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #FFFFFF; font-weight: 700; }
.btn.primary:hover { background: #343C45; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { border-color: var(--line-strong); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 13px; }
.danger-btn { color: var(--bad); border-color: var(--bad); }
.danger { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
.danger p { margin: 2px 0 0; }

/* ---------- badges & états ---------- */
.badge { font-size: 13px; padding: 3px 10px; border-radius: 4px; background: var(--plate); border: 1px solid var(--line); color: var(--ink); font-weight: 500; }
.badge.ok { color: var(--ok); border-color: var(--ok); background: var(--unit); }
.badge.bad { color: var(--bad); border-color: var(--bad); background: var(--unit); }
.badge.warn { color: var(--warn); border-color: var(--warn); background: var(--warn-bg); }
.status { font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.status::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.status.ok { color: var(--ok); }
.status.bad { color: var(--bad); }
.status.work { color: var(--warn); }
.status.work::before { animation: blink 1s infinite; }
h1 .status::before { display: none; }
.title-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.title-meta .domain-link { margin-top: 0; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); display: inline-block; }
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--bad); }

.alert { padding: 12px 16px; border-radius: 8px; margin: 0 0 16px; border: 1px solid var(--warn-line); }
.alert.warn { background: var(--warn-bg); color: #7A4A00; }
.error { color: var(--bad); margin: 0; }
.toast {
  position: fixed; bottom: 20px; right: 20px; padding: 12px 18px; border-radius: 8px; color: #FFFFFF;
  background: var(--ink); border-left: 4px solid var(--ok); z-index: 20; box-shadow: 0 6px 20px rgba(29, 35, 41, .25); max-width: 420px;
}
.toast.bad { border-left-color: #FF8577; }

/* ---------- création ---------- */
.detected { margin-bottom: 16px; }
.detect-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fw { font-size: 22px; font-weight: 800; margin-right: 4px; }
.notes { margin: 12px 0 0; padding-left: 18px; color: #7A4A00; }
.dns { font-size: 14px; margin-top: -6px; font-family: var(--mono); }
.ports { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip {
  font: inherit; font-family: var(--mono); font-size: 14px; border: 1px solid var(--line); background: var(--plate); color: var(--ink);
  min-height: 40px; padding: 0 14px; border-radius: 4px; cursor: pointer;
}
.chip:hover { border-color: var(--ink); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }
.port-input { width: 120px; font-family: var(--mono); }

/* ---------- page d'un site ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button {
  font: inherit; background: none; border: 0; padding: 12px 16px; min-height: 44px; cursor: pointer; color: var(--muted);
  border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); border-bottom-color: var(--ink); font-weight: 700; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0 0 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.copy { display: flex; gap: 8px; align-items: center; }
.copy code { flex: 1; padding: 8px 10px; font-size: 12.5px; }
.table { width: 100%; border-collapse: collapse; }
.table td { padding: 10px 6px; border-top: 1px solid var(--line); }
.clickable { cursor: pointer; }
.clickable:hover { background: var(--unit); }
.terminal {
  background: var(--term-bg); color: var(--term-text); border-radius: 10px; padding: 16px 20px; margin: 10px 0 0;
  height: 480px; overflow: auto; white-space: pre-wrap; word-break: break-all; font-family: var(--mono); font-size: 13px; line-height: 1.7;
}
.env { display: flex; flex-direction: column; gap: 8px; }
.env-row { display: grid; grid-template-columns: 1fr 2fr auto; gap: 8px; align-items: center; }
.vol-row { display: grid; grid-template-columns: minmax(140px, 1fr) 2fr auto; gap: 8px; align-items: center; }
.vol-host { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- connexion ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; background: var(--unit); }

/* ---------- mobile ---------- */
@media (max-width: 1100px) and (min-width: 761px) {
  .unit { grid-template-columns: auto minmax(180px, 1.4fr) minmax(150px, 1fr) auto auto; }
  .screws { display: none; }
  .unit-status { grid-column: 2 / -1; text-align: left; }
}

@media (max-width: 760px) {
  .container { padding: 20px 16px 48px; }
  .topbar { padding: 12px 16px; }
  .host .mono { display: none; }
  h1 { font-size: 28px; }
  .grid.two { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .choice { grid-template-columns: 1fr; }
  .unit { display: flex; flex-wrap: wrap; padding: 14px 16px; gap: 10px 14px; }
  .unit-name { flex: 1 1 200px; }
  .unit-kind { flex: 1 0 100%; }
  .screws { display: none; }
  .unit-status { flex: 1 0 100%; text-align: left; }
  .env-row { grid-template-columns: 1fr 1fr auto; }
  .vol-row { grid-template-columns: 1fr auto; }
  .vol-host { grid-column: 1 / -1; grid-row: 2; }
}
