/* Reset léger */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

/* Fond et typo globale */

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #111827 0, #020617 45%, #000 100%);
    color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Bandeau global POPARNASSUS */

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    width: 100%;
    height: 72px;
    background: rgba(2, 6, 23, 0.98);
    border-bottom: 1px solid rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(14px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.site-title {
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.35em;
    font-size: 0.8rem;
    font-weight: 700;
    color: #7dd3fc;
    padding: 0.6rem 1.4rem;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.6);
    background: radial-gradient(circle at 30% 0, #0ea5e9, #1e293b 60%);
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.7);
    text-align: center;
}

.site-title:hover {
    color: #f9fafb;
    border-color: rgba(125, 211, 252, 0.9);
}

/* Contenu principal centré */

.home-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem 3rem;
}

.home-content {
    text-align: center;
}

/* Image d'accueil */

.home-image-box {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.home-image {
    max-width: 240px;
    width: 60vw;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.8);
    object-fit: contain;
}

/* Titre principal */

.home-title {
    margin: 0 0 1.8rem;
    font-size: clamp(2rem, 2.3vw + 1.4rem, 2.6rem);
    letter-spacing: 0.08em;
    color: #7dd3fc;
}

/* Boutons de navigation */

.home-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.home-btn {
    text-decoration: none;
    font-size: 1.05rem;
    padding: 0.7rem 1.6rem;
    border-radius: 999px;
    border: 1px solid #38bdf8;
    color: #e0f2fe;
    background: rgba(15, 23, 42, 0.95);
    transition: 0.18s ease;
    min-width: 190px;
    text-align: center;
}

.home-btn:hover {
    background: #082f49;
    box-shadow: 0 12px 30px rgba(8, 47, 73, 0.8);
    transform: translateY(-1px);
}

/* Responsive */

@media (max-width: 600px) {
    .home-container {
        padding-inline: 1rem;
    }

    .home-btn {
        min-width: 100%;
    }
}


/* =========================
   HUB (cadres par hostname)
   ========================= */

.hub{
    width: min(1100px, 92vw);
    margin: 0 auto;
    text-align: left;
}

.hubHeader{
    display:flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    margin: 0.5rem auto 1rem;
}

.hubTitle{
    margin: 0;
    font-size: 1.25rem;
    letter-spacing: 0.08em;
    color: #e0f2fe;
    text-transform: uppercase;
}

.hubControls{
    display:flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
}

#filter{
    padding: 0.65rem 0.9rem;
    border-radius: 14px;
    border: 1px solid rgba(56, 189, 248, 0.35);
    background: rgba(15, 23, 42, 0.85);
    color: #e0f2fe;
    min-width: min(520px, 92vw);
    outline: none;
}

#filter::placeholder{ color: rgba(224,242,254,.55); }

#refresh{
    padding: 0.65rem 0.9rem;
    border-radius: 14px;
    border: 1px solid rgba(56, 189, 248, 0.35);
    background: rgba(15, 23, 42, 0.85);
    color: #e0f2fe;
    cursor: pointer;
    transition: 0.18s ease;
}

#refresh:hover{
    background: #082f49;
    box-shadow: 0 12px 30px rgba(8, 47, 73, 0.55);
    transform: translateY(-1px);
}

.hint{
    font-size: 0.78rem;
    opacity: 0.75;
}

.hostsGrid{
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 14px;
}

.frame{
    grid-column: span 6;
    border-radius: 20px;
    border: 1px solid rgba(56, 189, 248, 0.18);
    background: rgba(2, 6, 23, 0.55);
    box-shadow: 0 18px 45px rgba(0,0,0,0.35);
    padding: 14px;
    backdrop-filter: blur(12px);
}

@media (max-width: 980px){
    .frame{ grid-column: span 12; }
}

.frameTitle{
    display:flex;
    align-items:flex-start;
    justify-content: space-between;
    gap: 12px;
}

.frameH2{
    margin: 0;
    font-size: 1.05rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #7dd3fc;
}

.hostMeta{
    display:flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.pill{
    display:inline-flex;
    align-items:center;
    gap: 6px;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.25);
    background: rgba(15, 23, 42, 0.75);
    color: #e0f2fe;
    font-size: 0.78rem;
    opacity: 0.92;
}

table{
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    overflow: hidden;
    border-radius: 14px;
}

th, td{
    padding: 10px 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    font-size: 0.9rem;
    vertical-align: middle;
}

th{
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.75;
}

.rowTunnel td{
    background: rgba(15, 23, 42, 0.35);
}

.statusDot{
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display:inline-block;
    margin-right: 8px;
    background: rgba(148,163,184,.55);
    box-shadow: 0 0 10px rgba(0,0,0,.25);
}

.statusDot.ok{
    background: #22c55e;
    box-shadow: 0 0 12px rgba(34,197,94,.35);
}
.statusDot.ko{
    background: #ef4444;
    box-shadow: 0 0 12px rgba(239,68,68,.35);
}
.statusDot.maybe{
    background: #f59e0b;
    box-shadow: 0 0 12px rgba(245,158,11,.25);
}

.openBtn{
    text-decoration: none;
    display:inline-block;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #e0f2fe;
    background: rgba(15, 23, 42, 0.85);
    transition: 0.18s ease;
    white-space: nowrap;
}

.openBtn:hover{
    background: #082f49;
    box-shadow: 0 12px 30px rgba(8, 47, 73, 0.55);
    transform: translateY(-1px);
}

.toolsFrame{
    margin-top: 14px;
    border-radius: 20px;
    border: 1px solid rgba(56, 189, 248, 0.18);
    background: rgba(2, 6, 23, 0.45);
    box-shadow: 0 18px 45px rgba(0,0,0,0.30);
    padding: 14px;
}

.toolsFrame h2{
    margin: 0;
    font-size: 1.02rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #7dd3fc;
}

.toolsFrame p{
    margin: 6px 0 0;
    opacity: 0.75;
    font-size: 0.9rem;
}

.toolsRow{
    display:flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.toolBtn{
    text-decoration: none;
    display:inline-block;
    padding: 0.7rem 1.2rem;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #e0f2fe;
    background: rgba(15, 23, 42, 0.85);
    transition: 0.18s ease;
}

.toolBtn:hover{
    background: #082f49;
    box-shadow: 0 12px 30px rgba(8, 47, 73, 0.55);
    transform: translateY(-1px);
}

.loading{
    padding: 16px;
    border-radius: 16px;
    border: 1px dashed rgba(56, 189, 248, 0.25);
    opacity: 0.85;
}

.legacyBlock{
    margin-top: 18px;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(56, 189, 248, 0.18);
    background: rgba(2, 6, 23, 0.35);
}

/* ====== Terminal UI (htop-ish) ====== */
:root{
  --term-bg: rgba(6, 10, 18, .72);
  --term-bg2: rgba(10, 16, 30, .72);
  --term-border: rgba(255,255,255,.14);
  --term-line: rgba(255,255,255,.10);
  --term-text: rgba(255,255,255,.90);
  --term-dim: rgba(255,255,255,.62);
  --term-green: #39ff88;
  --term-red: #ff3b30;
  --term-amber: #ffd60a;
  --term-cyan: #00d4ff;
  --term-purple: #7c5cff;
  --r: 16px;
}

/* Hub container */
.hub{
  max-width: 1100px;
  margin: 16px auto 28px;
  padding: 14px 14px 20px;
}

/* Controls */
.hubHeader{
  display:flex; align-items:center; justify-content:space-between;
  gap: 12px; flex-wrap: wrap;
  margin: 10px 0 14px;
}
.hubHeader h2{
  margin:0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  letter-spacing: .5px;
  font-weight: 700;
  opacity: .95;
}

.hubControls{
  display:flex; gap:10px; flex-wrap:wrap; align-items:center;
}
#filter{
  padding:10px 12px;
  border-radius: 12px;
  border: 1px solid var(--term-border);
  background: rgba(0,0,0,.35);
  color: var(--term-text);
  outline: none;
  min-width: min(420px, 92vw);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}
#refresh{
  padding:10px 12px;
  border-radius: 12px;
  border: 1px solid var(--term-border);
  background: rgba(255,255,255,.06);
  color: var(--term-text);
  cursor:pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}
#refresh:hover{ background: rgba(255,255,255,.10); }
.hint{
  font-size: 12px;
  color: var(--term-dim);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

/* Grid frames (host cards) */
.hostsGrid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}
.frame{
  grid-column: span 12; /* plein large pour look terminal */
  border: 1px solid var(--term-border);
  border-radius: var(--r);
  background: linear-gradient(180deg, var(--term-bg), var(--term-bg2));
  box-shadow: 0 18px 40px rgba(0,0,0,.32);
  overflow:hidden;
  backdrop-filter: blur(10px);
}

/* Frame header like a terminal top bar */
.frameHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--term-line);
  background: rgba(0,0,0,.24);
}
.frameTitle{
  display:flex; align-items:center; gap:10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}
.hostName{
  font-weight: 800;
  letter-spacing: .6px;
}
.hostMeta{
  display:flex; gap:8px; flex-wrap:wrap; align-items:center;
  color: var(--term-dim);
  font-size: 12px;
}
.pill{
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--term-line);
  background: rgba(0,0,0,.22);
}

/* little terminal “traffic lights” */
.lights{ display:flex; gap:6px; align-items:center; }
.light{ width:10px; height:10px; border-radius:50%; opacity:.9; }
.light.red{ background: var(--term-red); box-shadow: 0 0 12px rgba(255,59,48,.35); }
.light.amb{ background: var(--term-amber); box-shadow: 0 0 12px rgba(255,214,10,.25); }
.light.grn{ background: var(--term-green); box-shadow: 0 0 12px rgba(57,255,136,.25); }

/* Table like htop list */
.termTable{
  width:100%;
  border-collapse: collapse;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}
.termTable thead th{
  text-align:left;
  font-size: 12px;
  color: var(--term-dim);
  padding: 10px 14px;
  border-bottom: 1px solid var(--term-line);
}
.termTable tbody tr{
  transition: background .12s ease;
}
.termTable tbody tr:nth-child(odd){
  background: rgba(255,255,255,.03);
}
.termTable tbody tr:hover{
  background: rgba(0,212,255,.08);
}
.termTable td{
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  color: var(--term-text);
  font-size: 13px;
  vertical-align: middle;
}

/* Status chip like htop */
.st{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  color: var(--term-text);
}
.dot{
  width:10px; height:10px; border-radius:50%;
  background: #666;
}
.dot.ok{ background: var(--term-green); box-shadow: 0 0 10px rgba(57,255,136,.25); }
.dot.ko{ background: var(--term-red); box-shadow: 0 0 10px rgba(255,59,48,.35); }
.dot.maybe{ background: var(--term-amber); box-shadow: 0 0 10px rgba(255,214,10,.25); }

/* Row link: whole row clickable */
.rowLink{
  cursor:pointer;
}
.rowLink td:last-child a{
  opacity: .9;
}
.openBtn{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 12px;
  border: 1px solid var(--term-line);
  background: rgba(0,0,0,.18);
  color: var(--term-text);
  text-decoration:none;
  white-space:nowrap;
}
.openBtn:hover{ background: rgba(255,255,255,.08); }
.tag{
  color: var(--term-cyan);
}
