@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap");

/* ==========================================================================
   Kryum — design system
   Palette et composants alignés sur le tableau de bord Krazy Scope :
   noir neutre, bordures fines, rayons généreux, Inter + JetBrains Mono.
   ========================================================================== */

:root {
  --bg: #050505;
  --panel: #0b0b0b;
  --panel-2: #0f0f0f;
  --panel-3: #151515;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e8e8e8;
  --text-dim: #9a9a9a;
  --text-faint: #6b6b6b;
  --accent: #e2e2e2;
  --accent-2: #9a9a9a;
  --success: #6fbf9a;
  --warning: #d7a948;
  --critical: #e15a63;
  --info: #9a9a9a;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.35);

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Alias historiques conservés pour le reste de la feuille */
  --bg-elevated: #0d0d0d;
  --panel-hover: #141414;
  --text-muted: #9a9a9a;
  --accent-hover: #f2f2f2;
  --accent-soft: rgba(255, 255, 255, 0.08);
  --success-soft: rgba(111, 191, 154, 0.14);
  --warning-soft: rgba(215, 169, 72, 0.14);
  --danger: #e15a63;
  --danger-soft: rgba(225, 90, 99, 0.14);
  --radius-lg: 18px;
  --font: var(--sans);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(110, 242, 213, 0.07), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(124, 156, 255, 0.08), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

a:hover {
  color: #fff;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

h1 {
  font-size: 26px;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 15px;
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
}

code,
pre,
.mono {
  font-family: var(--mono);
  font-size: 12.5px;
}

code {
  padding: 1px 5px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #ffffff08;
  color: #d6d6d6;
}

pre {
  margin: 0;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #060606;
  overflow-x: auto;
  color: #cfcfcf;
}

::selection {
  background: rgba(226, 226, 226, 0.22);
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid rgba(226, 226, 226, 0.5);
  outline-offset: 2px;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #ffffff1a;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: #ffffff2e;
  background-clip: padding-box;
}

/* ==========================================================================
   Utilitaires
   ========================================================================== */

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow {
  max-width: 860px;
}

.mono {
  font-family: var(--mono);
}

.muted {
  color: var(--text-dim);
}

.dim {
  color: var(--text-faint);
}

.tiny {
  font-size: 11.5px;
  line-height: 1.5;
}

.small {
  font-size: 12.5px;
}

.small-strong {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.strong {
  font-weight: 600;
}

.text-danger {
  color: var(--critical);
}

.ellipsis {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hint {
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1.55;
  display: flex;
  gap: 6px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.hint code {
  color: var(--text-dim);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #ffffff06;
  color: var(--text-dim);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow svg {
  color: var(--success);
}

.grid-2 {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.info-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.open-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
}

.open-link:hover {
  color: var(--text);
}

/* ==========================================================================
   Structure application (dashboard, serveur, admin)
   ========================================================================== */

.app-body {
  background:
    radial-gradient(1000px 520px at 8% -12%, rgba(110, 242, 213, 0.06), transparent 62%),
    radial-gradient(900px 480px at 100% 0%, rgba(124, 156, 255, 0.07), transparent 58%),
    var(--bg);
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sidebar {
  width: 248px;
  flex: none;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 22px 16px;
  background: rgba(8, 8, 8, 0.82);
  border-right: 1px solid var(--border);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  z-index: 20;
}

.side-brand {
  padding: 0 6px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.side-label {
  margin: 14px 0 6px;
  padding: 0 11px;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.side-label:first-child {
  margin-top: 0;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.side-link:hover {
  color: var(--text);
  background: #ffffff08;
}

.side-link.active {
  color: var(--text);
  background: linear-gradient(90deg, #ffffff17, #ffffff08);
  border-color: #ffffff29;
}

.side-link svg {
  flex: none;
  opacity: 0.75;
}

.side-link.active svg {
  opacity: 1;
}

.side-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 6px;
  color: var(--text-faint);
  font-size: 12px;
}

.side-back:hover {
  color: var(--text);
}

.side-server {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 2px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff05;
}

.side-server-name {
  font-size: 13px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-server-id {
  color: var(--text-faint);
  font-size: 10.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-server .pill {
  align-self: flex-start;
}

.side-foot {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.brand > span:not(.brand-mark) {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand small {
  margin-top: 1px;
  color: var(--text-faint);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  background: linear-gradient(135deg, #ffffff, #c4c4c4);
  color: #0b0b0b;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}

.mobile-bar {
  display: none;
}

.mobile-title {
  font-size: 13.5px;
  font-weight: 600;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 4px 6px;
}

.user-chip .avatar,
.user-chip .avatar-img,
.user-chip .avatar-fallback {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-strong);
}

.user-chip .avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, #ffffff2e, #ffffff14);
}

.user-chip .avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ffffff2e, #ffffff14);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 700;
}

.user-chip > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.user-chip strong {
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip > span:last-child {
  min-width: 0;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   Barre publique
   ========================================================================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--border);
  background: rgba(5, 5, 5, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 26px;
  height: 60px;
}

.topbar .nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}

.topbar .nav a {
  padding: 7px 11px;
  border-radius: 9px;
  border: 1px solid transparent;
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 500;
}

.topbar .nav a:hover {
  color: var(--text);
  background: #ffffff08;
}

.topbar .nav a.active {
  color: var(--text);
  background: #ffffff0f;
  border-color: #ffffff1f;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* ==========================================================================
   Pied de page public
   ========================================================================== */

.footer {
  margin-top: 72px;
  border-top: 1px solid var(--border);
  background: #060606;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 22px 0;
  color: var(--text-faint);
  font-size: 12px;
}

.footer-inner a {
  color: var(--text-dim);
}

.footer-inner a:hover {
  color: var(--text);
}

.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ==========================================================================
   Pages et sections
   ========================================================================== */

.page {
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: 100%;
  max-width: 1280px;
  padding: 30px 34px 64px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.page > #app {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.page-head h1 {
  font-size: 27px;
  letter-spacing: -0.025em;
}

.page-head p {
  margin-top: 5px;
  color: var(--text-dim);
  font-size: 13px;
  max-width: 640px;
}

.section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 64px 0 0;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.section-head h2 {
  font-size: 20px;
  letter-spacing: -0.02em;
}

.section-head p {
  margin-top: 4px;
  color: var(--text-faint);
  font-size: 12.5px;
  max-width: 620px;
}

.dashboard-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
}

.dashboard-section:first-of-type {
  padding-top: 0;
  border-top: 0;
}

/* ==========================================================================
   Boutons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff0d;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease, opacity 0.15s ease;
}

.btn:hover {
  background: #ffffff16;
  border-color: var(--border-strong);
  color: #fff;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, #f4f4f4, #c9c9c9);
  border-color: transparent;
  color: #0b0b0b;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #ffffff, #dcdcdc);
  border-color: transparent;
  color: #000;
}

.btn-ghost {
  background: transparent;
}

.btn-ghost:hover {
  background: #ffffff0d;
}

.btn-danger {
  background: rgba(225, 90, 99, 0.14);
  border-color: rgba(225, 90, 99, 0.4);
  color: #ffb3ba;
}

.btn-danger:hover {
  background: rgba(225, 90, 99, 0.24);
  border-color: rgba(225, 90, 99, 0.6);
  color: #ffd6da;
}

.btn-sm {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  gap: 6px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
}

.btn-icon.btn-sm {
  width: 30px;
  height: 30px;
}

/* ==========================================================================
   Formulaires
   ========================================================================== */

.input,
.select,
.textarea {
  width: 100%;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #070707;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--text-faint);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: rgba(226, 226, 226, 0.45);
  box-shadow: 0 0 0 3px rgba(226, 226, 226, 0.08);
}

.input-sm,
.select-sm {
  padding: 6px 9px;
  border-radius: 8px;
  font-size: 12.5px;
}

.textarea {
  min-height: 90px;
  resize: vertical;
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239a9a9a' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 30px;
}

.label {
  display: block;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.field > label {
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.form-row {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.switch {
  appearance: none;
  position: relative;
  width: 40px;
  height: 22px;
  flex: none;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: #ffffff14;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #cfcfcf;
  transition: transform 0.16s ease, background 0.16s ease;
}

.switch:checked {
  background: rgba(111, 191, 154, 0.28);
  border-color: rgba(111, 191, 154, 0.55);
}

.switch:checked::after {
  transform: translateX(18px);
  background: #eafff5;
}

.secret-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #060606;
}

.secret-value {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dev-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ==========================================================================
   Cartes
   ========================================================================== */

.card {
  background: linear-gradient(180deg, #0f0f0f, #0a0a0a);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.card-pad {
  padding: 18px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.card-header h3 {
  font-size: 14px;
  font-weight: 650;
}

.card-header .small {
  color: var(--text-dim);
}

/* ==========================================================================
   Statistiques
   ========================================================================== */

.stat-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 15px 17px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, #101010, #0a0a0a);
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--border-strong);
  opacity: 0.7;
}

.stat-card:nth-child(1)::before {
  background: var(--success);
  opacity: 0.9;
}

.stat-card:nth-child(2)::before {
  background: var(--accent-2);
  opacity: 0.9;
}

.stat-card:nth-child(3)::before {
  background: var(--warning);
  opacity: 0.9;
}

.stat-card:nth-child(4)::before {
  background: var(--accent);
  opacity: 0.9;
}

.stat-card strong {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.stat-card strong.small-strong {
  font-size: 15px;
  letter-spacing: -0.01em;
}

.stat-label {
  color: var(--text-faint);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.stat-note {
  color: var(--text-faint);
  font-size: 11.5px;
}

.stat-row {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 34px;
}

.stat {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, #0f0f0f, #0a0a0a);
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.stat-label + .stat-value {
  margin-top: 2px;
}

.stat .stat-label {
  margin-top: 4px;
  letter-spacing: 0.02em;
  text-transform: none;
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.45;
}

/* ==========================================================================
   Pastilles d'état
   ========================================================================== */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff0a;
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.pill.online,
.pill.ok {
  color: var(--success);
  border-color: rgba(111, 191, 154, 0.32);
  background: rgba(111, 191, 154, 0.1);
}

.pill.starting,
.pill.stopping,
.pill.warn {
  color: var(--warning);
  border-color: rgba(215, 169, 72, 0.32);
  background: rgba(215, 169, 72, 0.1);
}

.pill.offline {
  color: var(--text-dim);
}

.pill.crashed,
.pill.suspended,
.pill.danger {
  color: var(--critical);
  border-color: rgba(225, 90, 99, 0.34);
  background: rgba(225, 90, 99, 0.1);
}

.pill.starting::before,
.pill.stopping::before {
  animation: pulse-dot 1.4s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.25;
  }
}

/* ==========================================================================
   Jauges
   ========================================================================== */

.meter {
  position: relative;
  height: 5px;
  border-radius: 999px;
  background: #ffffff12;
  overflow: hidden;
}

.meter > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6fbf9a, #8fd9b8);
  transition: width 0.35s ease;
}

.meter.warn > span,
.meter.is-warn > span {
  background: linear-gradient(90deg, #d7a948, #ecc76a);
}

.meter.danger > span,
.meter.is-bad > span {
  background: linear-gradient(90deg, #e15a63, #f08a91);
}

.metric-mini {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.metric-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-faint);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.metric-label span:last-child {
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
}

/* ==========================================================================
   Tableaux
   ========================================================================== */

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr:hover td {
  background: #ffffff05;
}

.table-empty {
  padding: 26px 12px;
  color: var(--text-faint);
  font-size: 12.5px;
  text-align: center;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.user-cell .avatar-img,
.user-cell .avatar-fallback {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
}

.actions-cell {
  width: 1%;
  white-space: nowrap;
}

.actions-cell.actions-wrap {
  width: auto;
  min-width: 360px;
  white-space: normal;
  align-content: center;
}

.actions-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.actions-wrap .select {
  min-width: 140px;
}

.move-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   États vides, chargement, erreurs
   ========================================================================== */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 20px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: #ffffff03;
}

.empty h3 {
  font-size: 15px;
  font-weight: 650;
}

.empty p {
  max-width: 440px;
  color: var(--text-dim);
  font-size: 12.5px;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 4px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: #ffffff08;
  color: var(--text-dim);
}

.loading-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 44px 16px;
  color: var(--text-dim);
  font-size: 13px;
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  flex: none;
  border-radius: 50%;
  border: 2px solid #ffffff1f;
  border-top-color: var(--text);
  animation: spin 0.7s linear infinite;
}

.spinner.dark {
  border-color: #ffffff1a;
  border-top-color: #cfcfcf;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   Bandeaux et encarts
   ========================================================================== */

.notice {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff05;
  font-size: 12.5px;
}

.notice strong {
  font-size: 13px;
}

.notice p {
  color: var(--text-dim);
}

.notice .btn {
  align-self: flex-start;
  margin-top: 6px;
}

.notice-warn {
  border-color: rgba(215, 169, 72, 0.32);
  background: rgba(215, 169, 72, 0.08);
}

.notice-warn strong {
  color: var(--warning);
}

.notice-danger {
  border-color: rgba(225, 90, 99, 0.34);
  background: rgba(225, 90, 99, 0.08);
}

.notice-danger strong {
  color: var(--critical);
}

.callout {
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-left: 2px solid var(--text-dim);
  border-radius: 0 12px 12px 0;
  background: #ffffff05;
  color: var(--text-dim);
  font-size: 12.5px;
}

.note {
  color: var(--text-faint);
  font-size: 11.5px;
}

.limit {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #ffffff07;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 10.5px;
}

/* ==========================================================================
   Fenêtres modales
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(2, 2, 2, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.modal {
  display: flex;
  flex-direction: column;
  width: min(520px, 100%);
  max-height: 88vh;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: #0c0c0c;
  box-shadow: var(--shadow);
  animation: modal-in 0.16s ease-out;
}

.modal-renew {
  width: min(560px, 100%);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.modal-head h2,
.modal-head h3 {
  font-size: 15px;
  font-weight: 650;
}

.modal-body {
  padding: 16px 18px;
  overflow-y: auto;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

/* ==========================================================================
   Notifications
   ========================================================================== */

.toast-host {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(380px, calc(100vw - 36px));
}

.toast {
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: #111111f2;
  box-shadow: var(--shadow);
  font-size: 12.5px;
  animation: toast-in 0.18s ease-out;
}

.toast.success {
  border-color: rgba(111, 191, 154, 0.45);
  color: #c8f2e2;
}

.toast.error {
  border-color: rgba(225, 90, 99, 0.45);
  color: #ffc2c8;
}

.toast.info {
  color: var(--text-dim);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ==========================================================================
   Console
   ========================================================================== */

.console-shell {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #060606;
  overflow: hidden;
}

.console-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: #0b0b0b;
}

.console-bar-left,
.console-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

#console-meta {
  min-width: 0;
  overflow: hidden;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.console-node-link {
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.22);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.console-node-link:hover,
.console-node-link:focus-visible {
  color: var(--text);
  border-bottom-color: currentColor;
  outline: none;
}

.console-hint {
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 10.5px;
}

.console {
  height: 420px;
  padding: 12px 14px;
  overflow-y: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  background:
    linear-gradient(180deg, #080808, #050505);
}

.console-line {
  display: flex;
  gap: 10px;
  padding: 1px 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.console-line .stamp {
  flex: none;
  color: #4f4f4f;
  font-size: 10.5px;
  padding-top: 2px;
  user-select: none;
}

.console-line .text {
  min-width: 0;
  color: #c9c9c9;
}

.console-line.system .text {
  color: #7d7d7d;
  font-style: italic;
}

.console-line.stderr .text {
  color: #e88a92;
}

.console-line.stdout .text {
  color: #cfcfcf;
}

.console-empty {
  padding: 26px 12px;
  color: var(--text-faint);
  font-size: 12px;
  text-align: center;
}

.console-boot {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(120% 160% at 0% 0%, #ffffff0a, transparent 60%),
    linear-gradient(180deg, #0d0d0d, #080808);
}

.console-boot-art {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #e6e6e6;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.05;
  letter-spacing: 0.02em;
  white-space: pre;
  text-shadow: 0 0 18px #ffffff22;
}

.console-boot-meta {
  min-width: 0;
}

.console-boot-title {
  color: var(--text);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.console-boot-title span {
  color: var(--text-faint);
  font-weight: 600;
  letter-spacing: 0.1em;
}

.console-boot-line {
  margin-top: 4px;
  color: var(--text-dim);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.console-boot-line.dim {
  color: var(--text-faint);
  font-size: 10.5px;
}

/* ==========================================================================
   Fichiers, éditeur, déploiement
   ========================================================================== */

.files-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: 320px minmax(0, 1fr);
  align-items: start;
}

.files-list-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.files-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: #0b0b0b;
}

.files-toolbar .btn {
  padding: 5px 9px;
  font-size: 11.5px;
}

.files-list {
  display: flex;
  flex-direction: column;
  max-height: 520px;
  overflow-y: auto;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-bottom: 1px solid #ffffff06;
  color: var(--text-dim);
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.file-row:last-child {
  border-bottom: 0;
}

.file-row:hover {
  background: #ffffff07;
  color: var(--text);
}

.file-row.selected {
  background: #ffffff0d;
  color: var(--text);
}

.file-row.dir {
  color: var(--text);
}

.file-icon {
  display: inline-flex;
  flex: none;
  color: var(--text-faint);
}

.file-row.dir .file-icon {
  color: var(--text-dim);
}

.fname {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fsize {
  flex: none;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 10px;
}

.editor-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: #0b0b0b;
}

.editor-name {
  flex: 1;
  min-width: 0;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-area {
  min-height: 420px;
  padding: 14px;
  border: 0;
  border-radius: 0;
  background: #060606;
  color: #d2d2d2;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  resize: vertical;
}

.editor-area:focus {
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(226, 226, 226, 0.18);
}

.editor-placeholder {
  display: grid;
  place-items: center;
  min-height: 420px;
  padding: 20px;
  color: var(--text-faint);
  font-size: 12.5px;
  text-align: center;
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 34px 20px;
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
  background: #ffffff03;
  color: var(--text-dim);
  font-size: 12.5px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: rgba(226, 226, 226, 0.4);
  background: #ffffff08;
}

.dropzone strong {
  color: var(--text);
  font-size: 13px;
}

.deploy-progress {
  margin-top: 14px;
}

.deploy-log {
  margin-top: 12px;
  max-height: 240px;
  overflow-y: auto;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #060606;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* ==========================================================================
   Cartes serveur et nœuds
   ========================================================================== */

.servers-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.server-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #101010, #0a0a0a);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.server-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  background: linear-gradient(180deg, #131313, #0b0b0b);
}

.server-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.server-card-title {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-card-sub {
  margin-top: 3px;
  color: var(--text-faint);
  font-size: 11.5px;
}

.server-card-metrics {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.server-card-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 11px;
}

.server-card-foot .open-link {
  margin-left: auto;
}

.server-card-renew {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.node-strip {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.node-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #0b0b0b;
  color: var(--text-dim);
  font-size: 12.5px;
}

.node-chip-rich {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.node-chip-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.node-chip-head strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.node-chip-head .mono {
  margin-left: auto;
  color: var(--text-faint);
  font-size: 10.5px;
}

.node-chip-meta {
  color: var(--text-faint);
  font-size: 11.5px;
}

.node-chip-foot {
  color: var(--text-faint);
  font-size: 10.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   Page serveur
   ========================================================================== */

.server-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.server-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.server-title h1 {
  font-size: 26px;
  letter-spacing: -0.025em;
}

.server-id {
  margin-top: 4px;
  color: var(--text-faint);
  font-size: 11px;
}

.server-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.resource-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.resource-panel {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.res-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
}

.res-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-faint);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.res-top strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-transform: none;
}

.res-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.res-note {
  color: var(--text-faint);
  font-size: 11px;
}

/* ==========================================================================
   Renouvellement
   ========================================================================== */

.renew-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12px;
}

#settings-form > .field,
#settings-form > .form-row {
  margin-bottom: 14px;
}

#settings-form > .form-actions {
  margin-top: 4px;
}

.renew-date {
  color: var(--text);
  font-family: var(--mono);
  font-size: 11.5px;
}

.renew-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.renew-step {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: #ffffff03;
}

.renew-step-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.renew-step-head strong {
  display: block;
  font-size: 13px;
  font-weight: 650;
}

.renew-step-head p {
  margin-top: 2px;
}

.renew-step-num {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #ffffff08;
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
}

.renew-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-faint);
  font-size: 11.5px;
}

.renew-progress span:last-child {
  font-family: var(--mono);
  font-size: 11px;
}

.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 110px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: #060606;
  overflow: hidden;
}

.ad-house {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 20px;
  text-align: center;
}

.ad-house strong {
  font-size: 14px;
}

.ad-house p {
  color: var(--text-faint);
  font-size: 11.5px;
}

.ad-label {
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-faint);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ad-image {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px;
}

.ad-image img {
  max-width: 100%;
  max-height: 160px;
  border-radius: 8px;
}

.ad-image .ad-label {
  position: absolute;
  top: 8px;
  left: 8px;
}

.captcha-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
}

/* ==========================================================================
   Statut public
   ========================================================================== */

.status-head {
  padding-top: 34px;
}

.status-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #ffffff05;
  color: var(--text-dim);
  font-size: 11.5px;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--text-faint);
}

.status-dot.ok {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(111, 191, 154, 0.16);
}

.status-dot.warn {
  background: var(--warning);
  box-shadow: 0 0 0 3px rgba(215, 169, 72, 0.16);
}

.status-dot.danger {
  background: var(--critical);
  box-shadow: 0 0 0 3px rgba(225, 90, 99, 0.16);
}

.status-summary {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 22px 0 18px;
}

.status-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.status-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #101010, #0a0a0a);
}

.status-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.status-node-name {
  font-size: 14px;
  font-weight: 650;
}

.status-node-host {
  margin-top: 2px;
  color: var(--text-faint);
  font-size: 10.5px;
}

.status-facts {
  display: grid;
  gap: 10px 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.status-facts > div {
  min-width: 0;
}

.status-facts dt {
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-facts dd {
  margin: 2px 0 0;
  color: var(--text);
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 10.5px;
}

a.status-node-name {
  display: inline-block;
  color: var(--text);
  text-decoration: none;
}

a.status-node-name:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.node-page-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.8fr);
  align-items: start;
  margin-top: 22px;
}

.node-card-lg {
  gap: 18px;
  padding: 22px;
}

.node-facts {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.node-facts dd {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.node-meter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.node-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.node-side-title {
  font-size: 13px;
  font-weight: 650;
}

.node-side p {
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.65;
}

.node-side-list {
  margin: 0;
  padding-left: 17px;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.7;
}

.node-side-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.node-offline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 640px;
  margin-top: 22px;
}

.node-offline h2 {
  font-size: 17px;
}

.node-offline p {
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.7;
}

.node-offline-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 11px;
}

.status-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 40px;
}

.status-security {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.status-security-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #0b0b0b;
}

.status-security-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: #ffffff07;
  color: var(--text-dim);
}

.status-security-item strong {
  display: block;
  font-size: 12.5px;
  font-weight: 650;
}

.status-security-item p {
  margin-top: 2px;
  color: var(--text-faint);
  font-size: 11.5px;
}

.status-limits {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.status-limit {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0b0b0b;
}

.status-limit span {
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-limit strong {
  font-size: 15px;
  font-weight: 650;
}

.status-foot {
  margin-top: 34px;
  color: var(--text-faint);
  font-size: 11px;
}

/* ==========================================================================
   Documentation
   ========================================================================== */

.docs-layout {
  display: grid;
  gap: 40px;
  grid-template-columns: 236px minmax(0, 1fr);
  align-items: start;
  padding-top: 34px;
  padding-bottom: 40px;
}

.docs-nav {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #0b0b0b;
}

.docs-nav a {
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 12.5px;
}

.docs-nav a:hover {
  color: var(--text);
  background: #ffffff08;
}

.docs-nav a.active {
  color: var(--text);
  background: #ffffff0f;
}

.docs-body {
  display: flex;
  flex-direction: column;
  gap: 38px;
  min-width: 0;
  max-width: 780px;
}

.docs-body section {
  scroll-margin-top: 90px;
}

.docs-body > * {
  min-width: 0;
}

.docs-body h2 {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  font-size: 20px;
}

.docs-body h3 {
  margin: 20px 0 8px;
  font-size: 15px;
}

.docs-body p {
  margin-bottom: 10px;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.7;
}

.docs-body pre {
  margin: 14px 0;
}

.docs-body pre code {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-size: 12.5px;
  line-height: 1.65;
}

.docs-body ul,
.docs-body ol {
  margin: 0 0 12px;
  padding-left: 20px;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.7;
}

.docs-body li {
  margin-bottom: 5px;
}

.docs-body li::marker {
  color: var(--text-faint);
}

.docs-body strong {
  color: var(--text);
  font-weight: 600;
}

.docs-body table {
  width: 100%;
  margin: 14px 0;
  border-collapse: collapse;
  font-size: 12.5px;
}

.docs-body .table-wrap {
  width: 100%;
  margin: 14px 0;
  overflow-x: auto;
}

.docs-body .table-wrap table {
  margin: 0;
}

.docs-body th {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-strong);
  color: var(--text-faint);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

.docs-body td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
  vertical-align: top;
}

/* ==========================================================================
   Connexion / porte d'authentification
   ========================================================================== */

.auth-wrap {
  display: grid;
  place-items: center;
  min-height: 62vh;
  padding: 30px 0;
}

.auth-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: min(420px, 100%);
  padding: 34px 28px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, #101010, #0a0a0a);
  box-shadow: var(--shadow);
  text-align: center;
}

.auth-card h1,
.auth-card h2 {
  font-size: 20px;
}

.auth-card p {
  color: var(--text-dim);
  font-size: 12.5px;
}

.auth-card .btn {
  margin-top: 6px;
}

.auth-card .brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 19px;
}

/* ==========================================================================
   Administration
   ========================================================================== */

.admin-view {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.admin-view .card {
  overflow: hidden;
}

/* ==========================================================================
   Accueil
   ========================================================================== */

.hero {
  position: relative;
  padding: 92px 0 24px;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 -40% 0;
  height: 70%;
  background: radial-gradient(600px 260px at 50% 0%, rgba(226, 226, 226, 0.06), transparent 70%);
  pointer-events: none;
}

.hero-inner {
  max-width: 780px;
}

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.hero p {
  max-width: 640px;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 26px;
}

.hero-actions .btn {
  padding: 11px 18px;
  font-size: 13.5px;
}

.resource-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.resource-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
}

.resource-card .label {
  color: var(--text-faint);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.resource-card .value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.resource-card .note {
  font-size: 11.5px;
}

.steps {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.split-panel {
  display: grid;
  gap: 32px;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
}

.step {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px;
}

.step h3 {
  font-size: 15px;
}

.step p {
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.6;
}

.step-number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: 4px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: #ffffff08;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
}

/* ==========================================================================
   Onglets
   ========================================================================== */

.tabs {
  display: inline-flex;
  align-self: flex-start;
  gap: 2px;
  max-width: 100%;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff06;
  overflow-x: auto;
}

.tab {
  padding: 6px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  background: var(--panel-3);
  color: var(--text);
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.tab-panel.active {
  display: flex;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 11.5px;
}

.breadcrumb-path {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-dim);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1080px) {
  .stat-grid,
  .status-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .resource-grid,
  .resource-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .status-grid,
  .info-grid,
  .status-security {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .files-layout {
    grid-template-columns: 280px minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.18s ease;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
    background: #080808f5;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .app-main {
    width: 100%;
  }

  .page {
    padding: 20px 18px 52px;
  }

  .mobile-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 30;
    height: 54px;
    padding: 0 14px;
    border-bottom: 1px solid var(--border);
    background: rgba(5, 5, 5, 0.88);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }

  .docs-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .docs-nav {
    position: static;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 4px;
    overflow-x: auto;
    padding: 8px;
    scrollbar-width: none;
  }

  .docs-nav::-webkit-scrollbar {
    display: none;
  }

  .docs-nav a {
    flex: none;
    white-space: nowrap;
  }

  .files-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .topbar .nav {
    display: none;
  }

  .resource-grid,
  .steps,
  .info-grid,
  .status-security {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .node-page-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .node-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero {
    padding: 60px 0 18px;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 16px;
  }

  .stat-grid,
  .status-summary,
  .status-grid,
  .grid-2,
  .form-row,
  .resource-grid,
  .steps,
  .info-grid,
  .status-security,
  .stat-row,
  .resource-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-head,
  .server-head {
    flex-direction: column;
  }

  .server-actions {
    width: 100%;
  }

  .server-actions .btn {
    flex: 1;
  }

  .page {
    padding: 18px 14px 46px;
  }

  .hero h1 {
    font-size: 34px;
  }

  .console {
    height: 340px;
  }

  .console-bar {
    flex-wrap: wrap;
  }

  .console-bar-right {
    margin-left: auto;
  }

  .console-boot {
    align-items: flex-start;
    gap: 14px;
  }

  .console-boot-art {
    font-size: 10px;
  }

  .modal {
    border-radius: 14px;
  }

  .modal-backdrop {
    padding: 12px;
  }

  .server-card-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .status-facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .topbar-actions .btn-ghost {
    display: none;
  }

  .topbar-inner {
    gap: 12px;
  }

  .user-chip > span:last-child {
    display: none;
  }

  .node-facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .console-boot {
    gap: 12px;
    padding: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
