:root {
  --cyan: #5EEAD4;
  --violet: #A78BFA;
  --ink: #E6EAFB;
  --muted: #A9B2D6;
  --night: #0E1233;
  --indigo: #1A1A4A;
  --aubergine: #2B1140;
  --glass-bg: rgba(255, 255, 255, 0.11);
  --glass-border: rgba(255, 255, 255, 0.18);
  --danger: #FDA4AF;
  --radius: 20px;
}

* { box-sizing: border-box; }

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

body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: linear-gradient(160deg, var(--night) 0%, var(--indigo) 45%, var(--aubergine) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  padding: 24px;
}

h1, h2 { line-height: 1.25; margin: 0; }
h1 { font-size: 1.25rem; font-weight: 650; }
h2 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Formes floues en arrière-plan */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.55; }
.blob-a { width: 420px; height: 420px; background: #2DD4BF; top: -120px; left: -100px; }
.blob-b { width: 480px; height: 480px; background: #7C3AED; bottom: -160px; right: -120px; }
.blob-c { width: 300px; height: 300px; background: #38BDF8; top: 40%; left: 55%; opacity: 0.35; }

/* Carte en verre dépoli */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 10px 40px rgba(8, 6, 30, 0.35), 0 0 60px rgba(124, 58, 237, 0.12);
}

.topbar {
  max-width: 1200px;
  margin: 0 auto 24px;
  padding: 16px 24px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  box-shadow: 0 0 24px rgba(94, 234, 212, 0.45);
}
.sub { font-size: 0.85rem; color: var(--muted); margin-top: 2px; }

.chip {
  font-size: 0.78rem; padding: 6px 12px; white-space: nowrap;
  border-radius: 999px; color: var(--cyan);
  background: rgba(94, 234, 212, 0.12);
  border: 1px solid rgba(94, 234, 212, 0.35);
}

.layout {
  max-width: 1200px; margin: 0 auto;
  display: grid; gap: 24px;
  grid-template-columns: 1fr 1fr;
}
.layout .panel:first-child { grid-column: 1 / -1; }
.chat { grid-column: 1 / -1; }

.panel { border-radius: var(--radius); padding: 22px; min-width: 0; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
}
.muted { color: var(--muted); font-size: 0.85rem; }

/* Boutons */
.btn {
  font: inherit; font-size: 0.9rem; cursor: pointer;
  min-height: 36px; padding: 8px 14px;
  border-radius: 12px; color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.btn:hover { background: rgba(255, 255, 255, 0.14); transform: translateY(-1px); }
.btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.btn-primary {
  color: #0B1B2E; font-weight: 600; border-color: transparent;
  background: linear-gradient(135deg, var(--cyan), #7DD3FC);
  box-shadow: 0 0 22px rgba(94, 234, 212, 0.35);
}
.btn-primary:hover { background: linear-gradient(135deg, #7FF2E0, #93DDFD); }
.btn-small { min-height: 30px; padding: 4px 10px; font-size: 0.8rem; border-radius: 10px; }
.btn-accent { border-color: rgba(94, 234, 212, 0.45); color: var(--cyan); }

/* Tableau conteneurs */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left; padding: 12px 8px; vertical-align: middle;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10); white-space: nowrap;
}
th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; }
td.actions { white-space: normal; }
.actions .btn + .btn { margin-left: 6px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85rem; color: #CFFAF1; }

/* Statuts */
.statut {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.8rem; padding: 3px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.08); color: var(--muted);
}
.statut::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.statut-ok { color: var(--cyan); }
.statut-arret { color: var(--muted); }
.statut-erreur { color: var(--danger); }

/* Sous-domaines */
.domain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.domain-list li {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; min-width: 0;
  padding: 14px 16px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.domain-list .host { font-weight: 600; overflow-wrap: anywhere; }
.domain-list .cible { font-size: 0.82rem; color: var(--muted); overflow-wrap: anywhere; }
.domain-list .droite { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tag {
  font-size: 0.75rem; padding: 2px 10px; border-radius: 999px;
  color: var(--muted); border: 1px solid rgba(255, 255, 255, 0.18);
}
.tag-actif { color: var(--cyan); border-color: rgba(94, 234, 212, 0.45); background: rgba(94, 234, 212, 0.10); }

/* Chat */
.chat-log {
  min-height: 140px; max-height: 320px; overflow-y: auto;
  padding: 14px; border-radius: 16px;
  background: rgba(14, 18, 51, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex; flex-direction: column; gap: 10px;
}
.msg { max-width: 80%; padding: 9px 13px; font-size: 0.92rem; border-radius: 14px; }
.msg-agent {
  align-self: flex-start;
  background: rgba(94, 234, 212, 0.10);
  border: 1px solid rgba(94, 234, 212, 0.28);
}
.msg-user {
  align-self: flex-end;
  background: rgba(167, 139, 250, 0.22);
  border: 1px solid rgba(167, 139, 250, 0.40);
}
.chat-form { display: flex; gap: 10px; margin-top: 14px; }
.chat-form input {
  flex: 1; min-width: 0; font: inherit; min-height: 40px; padding: 8px 14px;
  color: var(--ink); background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border); border-radius: 12px;
}
.chat-form input::placeholder { color: var(--muted); }
.chat-form input:focus { outline: 2px solid var(--violet); outline-offset: 1px; }

/* Notification */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  padding: 12px 18px; border-radius: 14px; z-index: 10;
  font-size: 0.9rem; color: var(--ink);
  max-width: calc(100% - 32px);
  background: rgba(30, 27, 75, 0.7);
  border: 1px solid rgba(94, 234, 212, 0.4);
  box-shadow: 0 0 30px rgba(167, 139, 250, 0.35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.toast[hidden] { display: none; }

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

/* Responsive */
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; gap: 16px; }
  .layout .panel:first-child, .chat { grid-column: auto; }
  .topbar { padding: 14px 16px; }
  .chip { display: none; }
}

@media (max-width: 420px) {
  body { padding: 14px; }
  h1 { font-size: 1.05rem; }
  .sub { font-size: 0.75rem; }
  .panel { padding: 16px; }
  .panel-head .btn { width: 100%; }
  .msg { max-width: 92%; }
  .chat-form { flex-direction: column; }
  .chat-form .btn { width: 100%; }
  .domain-list .droite { width: 100%; }
}
