/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
  --bg: #12151b;
  --bg-surface: #191d25;
  --bg-elevated: #1f242e;
  --border: #2a2f3b;
  --text: #e6e8eb;
  --text-muted: #8b93a1;
  --text-faint: #565d6b;
  --accent: #e0a458;
  --accent-soft: rgba(224, 164, 88, 0.12);
  --accent-dim: #a97a3f;
  --danger: #e5787c;
  --danger-soft: rgba(229, 120, 124, 0.12);
  --radius: 5px;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

/* ==========================================================================
   Scrollbars
   ========================================================================== */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background-color: var(--border);
  border-radius: 20px;
  border: 2px solid var(--bg-surface);
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background-color: var(--accent-dim);
}
::-webkit-scrollbar-corner {
  background: transparent;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ==========================================================================
   Top bar
   ========================================================================== */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 52px;
  padding: 0 18px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar__brand {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar__brand .prompt { color: var(--accent); }

.topbar__toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-family: var(--font-mono);
}

.search {
  flex: 1;
  max-width: 360px;
  position: relative;
}

.search::before {
  content: "/";
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 13px;
  pointer-events: none;
}

.search input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 7px 10px 7px 24px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.search input:focus { border-color: var(--accent-dim); outline: none; }
.search input::placeholder { color: var(--text-faint); }

.topbar__user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ==========================================================================
   Lien "Mes serveurs" (bas de sidebar)
   ========================================================================== */
.sidebar__footer {
  border-top: 1px solid var(--border);
  padding: 10px 12px;
  flex-shrink: 0;
}

.sidebar__servers-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 13px;
}
.sidebar__servers-link:hover { background: var(--bg-elevated); color: var(--text); text-decoration: none; }
.sidebar__servers-link.active {
  background: var(--accent-soft);
  color: var(--accent);
}
.sidebar__servers-icon { font-size: 14px; }

/* ==========================================================================
   Page "Mes serveurs" (kanban par catégories)
   ========================================================================== */
.servers-page__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.servers-page__title {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 8px;
}

.servers-page__subtitle {
  color: var(--text-muted);
  font-size: 13.5px;
  margin: 0;
  max-width: 560px;
  line-height: 1.6;
}

.servers-page__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-secondary {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-secondary:hover { border-color: var(--accent-dim); color: var(--accent); }

.servers-page__error,
.servers-page__empty {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-faint);
  padding: 22px;
  border: 1px dashed var(--border);
  border-radius: 8px;
}
.servers-page__error { color: var(--danger); border-color: rgba(229, 120, 124, 0.3); }

/* ---- Tableau kanban ---- */
.board {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  overflow-x: auto;
  padding-bottom: 12px;
}

.board-column {
  flex: 0 0 270px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 260px);
}

.board-column__header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--border);
}

.board-column__title {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 1px dashed transparent;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.board-column__title:hover { color: var(--accent); border-bottom-color: var(--accent-dim); }
.board-column__title--muted { color: var(--text-faint); cursor: default; }
.board-column__title--muted:hover { color: var(--text-faint); border-bottom-color: transparent; }

.board-column__count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1px 7px;
  flex-shrink: 0;
}

.board-column__del {
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 0 2px;
  flex-shrink: 0;
}
.board-column__del:hover { color: var(--danger); }

.board-column__list {
  list-style: none;
  margin: 0;
  padding: 10px;
  overflow-y: auto;
  flex: 1;
  min-height: 70px;
  border-radius: 0 0 8px 8px;
  transition: background .12s ease;
}
.board-column__list--over { background: var(--accent-soft); }

.server-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: var(--radius);
  cursor: grab;
  margin-bottom: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
}
.server-card:hover { border-color: var(--accent-dim); }
.server-card.dragging { opacity: 0.35; }
.server-card:active { cursor: grabbing; }

.server-card__status {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-faint);
}
.server-card__status--running { background: #7fd88f; box-shadow: 0 0 6px rgba(127, 216, 143, 0.55); }
.server-card__status--offline { background: var(--danger); }
.server-card__status--starting,
.server-card__status--stopping { background: #f0c95f; box-shadow: 0 0 6px rgba(240, 201, 95, 0.5); animation: pulse-status 1.4s ease-in-out infinite; }
.server-card__status--unknown { background: var(--text-faint); }

@keyframes pulse-status { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

.server-card__link {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 13px;
}
.server-card__link:hover { color: var(--accent); text-decoration: none; }

.server-card__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.server-card__state {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-faint);
  flex-shrink: 0;
}
.server-card__state--running { color: #7fd88f; }
.server-card__state--offline { color: var(--danger); }
.server-card__state--starting,
.server-card__state--stopping { color: #f0c95f; }

.server-card__addr {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.server-card__badge {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-faint);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 4px;
  flex-shrink: 0;
}

/* ---- Outils de gestion rapide sur la carte ---- */
.server-card__manage {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-faint);
  border-radius: var(--radius);
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
}
.server-card__manage:hover { color: var(--accent); border-color: var(--accent-dim); }

@media (max-width: 720px) {
  .board-column { flex-basis: 240px; }
  .servers-page__header { flex-direction: column; }
}

/* ==========================================================================
   Panneau de gestion serveur (modale)
   ========================================================================== */
.server-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 9, 12, 0.6);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.server-modal-overlay[hidden] { display: none; }

.server-modal {
  width: 100%;
  max-width: 480px;
  max-height: min(640px, 90vh);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.server-modal__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.server-modal__status {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-faint);
}
.server-modal__status--running { background: #7fd88f; box-shadow: 0 0 6px rgba(127, 216, 143, 0.55); }
.server-modal__status--offline { background: var(--danger); }
.server-modal__status--starting,
.server-modal__status--stopping { background: #f0c95f; animation: pulse-status 1.4s ease-in-out infinite; }

.server-modal__title {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 14.5px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-modal__close {
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 2px 4px;
  flex-shrink: 0;
}
.server-modal__close:hover { color: var(--text); }

.server-modal__body {
  padding: 18px;
  overflow-y: auto;
}

.server-modal__section-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  margin: 0 0 10px;
}
.server-modal__section-label:not(:first-child) { margin-top: 22px; }

/* ---- Actions d'alimentation ---- */
.power-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.power-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius);
  padding: 10px 6px 9px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  cursor: pointer;
}
.power-btn__icon { font-size: 15px; line-height: 1; }
.power-btn:hover { border-color: var(--accent-dim); color: var(--text); }
.power-btn--start:hover { border-color: #7fd88f; color: #7fd88f; }
.power-btn--restart:hover { border-color: #f0c95f; color: #f0c95f; }
.power-btn--stop:hover, .power-btn--kill:hover { border-color: var(--danger); color: var(--danger); }
.power-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.power-btn:disabled:hover { border-color: var(--border); color: var(--text-muted); }

/* ---- Jauges de ressources ---- */
.resource-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.resource-stat__row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 5px;
}
.resource-stat__row span:last-child { color: var(--text); }

.resource-stat__bar {
  height: 6px;
  border-radius: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  overflow: hidden;
}
.resource-stat__fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width .3s ease;
}
.resource-stat__fill--warn { background: #f0c95f; }
.resource-stat__fill--danger { background: var(--danger); }

.server-modal__uptime {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
}

.server-modal__loading,
.server-modal__error {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-faint);
  padding: 10px 2px;
}
.server-modal__error { color: var(--danger); }

.server-modal__footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  gap: 10px;
}
.server-modal__footer .btn-secondary { flex: 1; text-align: center; }

/* ---- Téléchargement des identifiants SFTP (jamais affichés à l'écran) ---- */
.sftp-download {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sftp-download__hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.55;
}
.sftp-download #sftpDownloadBtn,
#sftpDownloadBtn {
  width: 100%;
  text-align: center;
}

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

.topbar__user strong { color: var(--text); font-weight: 500; }

.logout-link {
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 10px;
  font-size: 12px;
}
.logout-link:hover { color: var(--accent); text-decoration: none; border-color: var(--accent-dim); }

/* ==========================================================================
   Layout
   ========================================================================== */
.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 220px;
  min-height: calc(100vh - 52px);
}

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

/* ---- Sidebar ---- */
.sidebar {
  border-right: 1px solid var(--border);
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  min-height: 0;
  /* Toujours limitée à la hauteur visible de l'écran (et collée sous la
     topbar) pour que le pied "Mes serveurs" reste visible sans avoir à
     scroller toute la sidebar, quelle que soit la longueur du menu. */
  position: sticky;
  top: 52px;
  height: calc(100vh - 52px);
  align-self: start;
}

.sidebar__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 12px 8px;
}

.nav-tree, .nav-tree ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-tree ul { padding-left: 14px; margin-top: 2px; }

.nav-tree > li { margin-bottom: 2px; }

.nav-file a {
  display: block;
  padding: 6px 10px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 13.5px;
  border-left: 2px solid transparent;
}

.nav-file a:hover {
  background: var(--bg-elevated);
  color: var(--text);
  text-decoration: none;
}

.nav-file.active a {
  background: var(--accent-soft);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 500;
}

.nav-dir > summary {
  cursor: pointer;
  list-style: none;
  padding: 6px 10px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.nav-dir > summary::-webkit-details-marker { display: none; }
.nav-dir > summary::before { content: "▸"; font-size: 10px; transition: transform .15s ease; }
.nav-dir[open] > summary::before { transform: rotate(90deg); }
.nav-dir > summary:hover { color: var(--text-muted); }

/* ---- Content ---- */
.content {
  padding: 40px 48px 80px;
  min-width: 0;
}

.breadcrumb {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-faint);
  margin-bottom: 18px;
}
.breadcrumb .current { color: var(--text-muted); }

.prose { max-width: 720px; }

.prose h1 {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.prose h2 {
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 600;
  margin: 36px 0 12px;
  color: var(--text);
}

.prose h3 {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  margin: 26px 0 10px;
  color: var(--accent);
}

.prose p { margin: 0 0 14px; color: var(--text); }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 22px; }
.prose li { margin-bottom: 4px; }
.prose li::marker { color: var(--text-faint); }

.prose a { border-bottom: 1px solid var(--accent-dim); }
.prose a:hover { text-decoration: none; border-bottom-color: var(--accent); }

.prose blockquote {
  margin: 0 0 14px;
  padding: 4px 16px;
  border-left: 3px solid var(--accent-dim);
  color: var(--text-muted);
  background: var(--bg-surface);
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--accent);
}

.prose pre {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-dim);
  border-radius: var(--radius);
  padding: 14px 16px;
  overflow-x: auto;
  margin: 0 0 18px;
}

.prose pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  font-size: 13px;
}

.prose table {
  border-collapse: collapse;
  width: 100%;
  margin: 0 0 18px;
  font-size: 13.5px;
}
.prose th, .prose td {
  border: 1px solid var(--border);
  padding: 7px 10px;
  text-align: left;
}
.prose th {
  background: var(--bg-surface);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.prose hr { border: none; border-top: 1px solid var(--border); margin: 28px 0; }

/* ---- Prev / Next ---- */
.pagenav {
  max-width: 720px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.pagenav__link {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text-muted);
}
.pagenav__link:hover { border-color: var(--accent-dim); text-decoration: none; }
.pagenav__link.next { text-align: right; }
.pagenav__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  margin-bottom: 3px;
}
.pagenav__title { color: var(--text); font-size: 13.5px; }

/* ---- On this page ---- */
.toc {
  padding: 40px 20px;
  font-size: 12.5px;
}
.toc__label {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  font-size: 11px;
  margin-bottom: 10px;
}
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc ul ul { padding-left: 12px; }
.toc li { margin-bottom: 6px; }
.toc a { color: var(--text-muted); }
.toc a:hover { color: var(--accent); text-decoration: none; }

/* ==========================================================================
   Login
   ========================================================================== */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.term-window {
  width: 100%;
  max-width: 420px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.term-window__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.term-window__dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--border);
}
.term-window__bar-title {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
}

.term-window__body { padding: 28px 26px 30px; }

.term-line {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 22px;
}
.term-line .prompt { color: var(--accent); }
.term-line .cursor {
  display: inline-block;
  width: 7px; height: 14px;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: -2px;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 13.5px;
}
.field input:focus { border-color: var(--accent-dim); outline: none; }

.btn-primary {
  width: 100%;
  background: var(--accent);
  color: #17130c;
  border: none;
  border-radius: var(--radius);
  padding: 11px 14px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  margin-top: 4px;
}
.btn-primary:hover { background: #ecb46f; }

.flash {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 9px 12px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  border: 1px solid;
}
.flash-error {
  background: var(--danger-soft);
  border-color: rgba(229,120,124,0.4);
  color: var(--danger);
}

.login-note {
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-faint);
  text-align: center;
}

/* ==========================================================================
   404
   ========================================================================== */
.error-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}
.error-page .code { font-size: 48px; color: var(--accent); }

/* ==========================================================================
   Widget "Mes serveurs" (bas de sidebar)
   ========================================================================== */
.servers-panel {
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  flex-shrink: 0;
  max-height: 55%;
  display: flex;
  flex-direction: column;
}

.servers-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  flex-shrink: 0;
}

.servers-panel__toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  padding: 4px 2px;
}
.servers-panel__toggle:hover { color: var(--text); }

.servers-panel__chevron {
  font-size: 10px;
  transition: transform .15s ease;
  color: var(--text-faint);
}
.servers-panel--open .servers-panel__chevron { transform: rotate(90deg); }

.servers-panel__actions {
  display: flex;
  gap: 4px;
}

.servers-panel__icon-btn {
  width: 22px;
  height: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.servers-panel__icon-btn:hover { color: var(--accent); border-color: var(--accent-dim); }
.servers-panel__icon-btn.spinning { animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.servers-panel__body {
  overflow-y: auto;
  padding: 2px 10px 14px;
}

.servers-panel__error,
.servers-panel__empty {
  font-size: 12px;
  color: var(--text-faint);
  padding: 8px 4px;
  font-family: var(--font-mono);
}
.servers-panel__error { color: var(--danger); }

/* ---- Catégorie ---- */
.server-cat {
  margin-bottom: 14px;
}

.server-cat__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 6px;
}

.server-cat__title {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 1px dashed transparent;
}
.server-cat__title:hover { color: var(--accent); border-bottom-color: var(--accent-dim); }
.server-cat__title--muted { color: var(--text-faint); cursor: default; }
.server-cat__title--muted:hover { color: var(--text-faint); border-bottom-color: transparent; }

.server-cat__del {
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}
.server-cat__del:hover { color: var(--danger); }

/* ---- Liste de serveurs (zone de drop) ---- */
.server-list {
  list-style: none;
  margin: 0;
  padding: 4px;
  min-height: 8px;
  border-radius: var(--radius);
  border: 1px dashed transparent;
  transition: border-color .12s ease, background .12s ease;
}

.server-list--over {
  border-color: var(--accent-dim);
  background: var(--accent-soft);
}

.server-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border-radius: var(--radius);
  cursor: grab;
  margin-bottom: 2px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.server-item:hover { border-color: var(--accent-dim); }
.server-item.dragging { opacity: 0.35; }
.server-item:active { cursor: grabbing; }

.server-item__status {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-faint);
}
.server-item__status--running { background: #7fd88f; box-shadow: 0 0 6px rgba(127, 216, 143, 0.55); }
.server-item__status--offline { background: var(--danger); }
.server-item__status--starting,
.server-item__status--stopping { background: #f0c95f; box-shadow: 0 0 6px rgba(240, 201, 95, 0.5); animation: pulse-status 1.4s ease-in-out infinite; }
.server-item__status--unknown { background: var(--text-faint); }

.server-item__link {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 13px;
}
.server-item__link:hover { color: var(--accent); text-decoration: none; }

.server-item__badge {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-faint);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 4px;
  flex-shrink: 0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 980px) {
  .layout, .layout--empty { grid-template-columns: 240px minmax(0, 1fr); }
  .toc { display: none; }
}

@media (max-width: 720px) {
  .topbar__toggle { display: block; }
  .layout, .layout--empty { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 52px; left: 0; bottom: 0;
    width: 260px;
    height: calc(100vh - 52px);
    transform: translateX(-100%);
    transition: transform .18s ease;
    z-index: 30;
  }
  body.nav-open .sidebar { transform: translateX(0); }
  .content { padding: 28px 20px 60px; }
}