/* ============================================================
   JB Console — palette cockpit dark / dev-tools
   ============================================================ */
:root {
  --bg: #0a0a0b;
  --bg-elev: #14141a;
  --bg-elev-2: #1c1c25;
  --border: #2a2a35;
  --border-soft: #1f1f28;
  --text: #e8e8ed;
  --text-soft: #a8a8b3;
  --text-muted: #6c6c78;
  --accent: #6ee7ff;          /* cyan vif */
  --accent-soft: rgba(110, 231, 255, 0.12);
  --accent-2: #ff7a59;         /* orange vif accent secondaire */
  --green: #4ade80;
  --green-soft: rgba(74, 222, 128, 0.15);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, 0.15);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.15);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Code", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(circle at 20% 0%, rgba(110, 231, 255, 0.04), transparent 50%),
    radial-gradient(circle at 80% 100%, rgba(255, 122, 89, 0.03), transparent 50%);
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: var(--mono); }
code { font-size: 0.88em; background: var(--bg-elev-2); padding: 1px 6px; border-radius: 4px; color: var(--accent); border: 1px solid var(--border-soft); }

.shell { max-width: 1400px; margin: 0 auto; padding: 0 24px; }
.shell--narrow { max-width: 720px; }

.muted { color: var(--text-muted); }
.eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 600;
  font-family: var(--mono);
}
.h-display {
  font-family: var(--sans);
  font-size: 36px;
  line-height: 1.1;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}
.h-section {
  font-family: var(--sans);
  font-size: 24px;
  line-height: 1.2;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}
.h-card {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.3;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}

/* ===== NAV ===== */
.app-nav {
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
}
.app-nav__inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.app-nav__brand {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.app-nav__brand::before {
  content: "▸";
  color: var(--accent);
  font-size: 14px;
}
.app-nav__brand em {
  color: var(--accent);
  font-style: normal;
}
.app-nav__links {
  display: flex;
  gap: 4px;
  align-items: center;
}
.app-nav__links a {
  color: var(--text-soft);
  font-size: 13px;
  padding: 7px 12px;
  border-radius: 6px;
  font-family: var(--mono);
  transition: all 0.15s;
}
.app-nav__links a:hover {
  color: var(--text);
  background: var(--bg-elev-2);
  text-decoration: none;
}
.app-nav__links a.is-active {
  color: var(--accent);
  background: var(--accent-soft);
}

/* ===== CARDS ===== */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  transition: all 0.15s;
}
.card--inline { padding: 14px 16px; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  text-decoration: none;
  letter-spacing: 0.02em;
}
.btn--cognac {                /* nom préservé pour réutiliser dans le code */
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.btn--cognac:hover {
  background: #8df0ff;
  text-decoration: none;
}
.btn--ghost {
  background: transparent;
  color: var(--text-soft);
  border-color: var(--border);
}
.btn--ghost:hover {
  background: var(--bg-elev-2);
  color: var(--text);
  text-decoration: none;
}
.btn--danger {
  background: transparent;
  color: var(--red);
  border-color: rgba(248, 113, 113, 0.3);
}
.btn--danger:hover {
  background: var(--red-soft);
  text-decoration: none;
}
.btn--small { padding: 5px 10px; font-size: 11px; }
.btn--full { width: 100%; justify-content: center; }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }

/* ===== ROW / STACK ===== */
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row--space { justify-content: space-between; }
.row--end { justify-content: flex-end; }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* ===== FIELDS ===== */
.field { margin-bottom: 14px; }
.field__label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  font-family: var(--mono);
}
.input, .textarea, .select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 13px;
  background: var(--bg);
  color: var(--text);
  transition: all 0.15s;
}
.textarea { font-size: 12px; min-height: 100px; resize: vertical; line-height: 1.6; }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

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

/* ===== PILLS ===== */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  font-family: var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.pill--green { background: var(--green-soft); color: var(--green); border: 1px solid rgba(74, 222, 128, 0.3); }
.pill--red { background: var(--red-soft); color: var(--red); border: 1px solid rgba(248, 113, 113, 0.3); }
.pill--amber { background: var(--amber-soft); color: var(--amber); border: 1px solid rgba(251, 191, 36, 0.3); }
.pill--gray { background: var(--bg-elev-2); color: var(--text-soft); border: 1px solid var(--border); }

/* Petits dots de status */
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot--green { background: var(--green); box-shadow: 0 0 8px rgba(74, 222, 128, 0.6); }
.dot--red { background: var(--red); box-shadow: 0 0 8px rgba(248, 113, 113, 0.6); }
.dot--amber { background: var(--amber); }
.dot--gray { background: var(--text-muted); }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-elev);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-family: var(--mono);
  opacity: 0;
  transition: all 0.25s;
  z-index: 9999;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast--error { border-color: rgba(248, 113, 113, 0.4); color: var(--red); }

/* ===== SITE CARD ===== */
.site-card {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  position: relative;
}
.site-card:hover {
  border-color: var(--accent);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(110, 231, 255, 0.1);
}
.site-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.2s;
  border-radius: 10px 10px 0 0;
}
.site-card:hover::before { opacity: 1; }

/* ===== KPI ===== */
.kpi-card { text-align: left; }
.kpi-card__value {
  font-family: var(--mono);
  font-size: 28px;
  color: var(--text);
  margin: 4px 0 4px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.kpi-card__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
  font-family: var(--mono);
}
.kpi-card__sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  font-family: var(--mono);
}

/* ===== LOGS ===== */
pre.logs {
  background: #050507;
  color: #b8e9c4;
  font-family: var(--mono);
  font-size: 11px;
  padding: 14px;
  border-radius: 6px;
  overflow-x: auto;
  max-height: 540px;
  line-height: 1.55;
  border: 1px solid var(--border);
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 9999;
  backdrop-filter: blur(6px);
}
.modal {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 580px;
  width: 100%;
  padding: 24px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

/* ===== TABLE ===== */
table { width: 100%; border-collapse: collapse; }
table th {
  background: var(--bg-elev-2);
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-family: var(--mono);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13px;
}
table tr:last-child td { border-bottom: none; }
table tr:hover td { background: var(--bg-elev-2); }

/* ===== LOGIN ===== */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at top, rgba(110, 231, 255, 0.08), transparent 60%),
    radial-gradient(ellipse at bottom, rgba(255, 122, 89, 0.04), transparent 60%);
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px 28px;
  box-shadow: var(--shadow);
}

@media (max-width: 720px) {
  .h-display { font-size: 28px; }
  .h-section { font-size: 20px; }
  .shell { padding: 0 16px; }
  .app-nav__inner { padding: 0 16px; }
}
