/*
 * NEURAX Admin Console — styles
 * Branding orange #F7B500 sur fond sombre.
 */

:root {
  --neurax-orange: #F7B500;
  --neurax-orange-dim: #C99300;
  --bg: #0E1116;
  --bg-card: #161B22;
  --bg-card-hover: #1B2129;
  --fg: #E6EDF3;
  --fg-muted: #8B949E;
  --border: #30363D;
  --green: #3FB950;
  --red: #F85149;
  --blue: #58A6FF;
  --warn-amber: #D29922;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

a {
  color: var(--neurax-orange);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

code, .secret {
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
  background: #0A0E13;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--neurax-orange);
}

.secret {
  display: inline-block;
  padding: 8px 12px;
  font-size: 0.95em;
  letter-spacing: 0.5px;
}
/* v2.58.0 — `pre.secret` (token + .env block) doit wrap sur mobile sinon
   debordement horizontal sur ecrans <420px. white-space:pre-wrap preserve
   les retours a la ligne, word-break:break-all casse les URLs longues. */
pre.secret {
  display: block;
  white-space: pre-wrap;
  word-break: break-all;
  max-width: 100%;
  margin: 8px 0;
}

.brand-mark {
  color: var(--neurax-orange);
  font-weight: 800;
  letter-spacing: 1px;
}

.muted {
  color: var(--fg-muted);
}

.small {
  font-size: 0.85em;
}

.error {
  color: var(--red);
  background: rgba(248, 81, 73, 0.1);
  padding: 8px 12px;
  border-radius: 6px;
  border-left: 3px solid var(--red);
}

.flash {
  color: var(--blue);
  background: rgba(88, 166, 255, 0.1);
  padding: 8px 12px;
  border-radius: 6px;
  border-left: 3px solid var(--blue);
}

.warning {
  color: var(--neurax-orange);
  background: rgba(247, 181, 0, 0.1);
  padding: 8px 12px;
  border-radius: 6px;
  border-left: 3px solid var(--neurax-orange);
}

/* ===== Auth pages (login, install) ===== */
.page-auth header.brand {
  text-align: center;
  padding: 48px 16px 24px;
}
.page-auth h1 {
  margin: 0 0 4px;
  font-size: 1.4em;
}
.page-auth .brand-sub {
  margin: 0;
  letter-spacing: 0.3px;
}
.page-auth .container {
  max-width: 520px;
  margin: 0 auto;
  padding: 0 16px 32px;
}
.page-auth footer {
  text-align: center;
  padding: 24px 16px;
}

/* Bouton biometrique + fallback TOTP : hierarchie CTA claire (v2.75.35).
   Avant : bouton bio (primary jaune) + lien texte oranger "Utiliser 2FA" =
   perception "2 boutons concurrents". Maintenant : primary XL + ghost small. */
.btn-primary {
  background: var(--neurax-orange);
  color: #0A0E13;
}
.btn-lg {
  padding: 14px 24px;
  font-size: 1.05em;
  width: 100%;
  display: block;
  text-align: center;
}
.auth-alt-methods {
  margin-top: 14px;
  text-align: center;
}
.auth-alt-methods .btn-ghost {
  font-weight: 500;
}

/* details recovery : summary plus discret pour ne pas rivaliser avec les CTAs. */
.recovery-toggle {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.recovery-toggle summary {
  color: var(--fg-muted);
  cursor: pointer;
  font-size: 0.9em;
  padding: 4px 0;
}
.recovery-toggle summary:hover {
  color: var(--fg);
}
.recovery-toggle[open] summary {
  color: var(--fg);
  margin-bottom: 12px;
}

/* ===== App pages (dashboard, instance) ===== */
.page-app .topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-title {
  font-weight: 600;
}
.back {
  color: var(--fg-muted);
  font-size: 1.4em;
  text-decoration: none;
  padding: 0 8px;
}
.back:hover {
  color: var(--neurax-orange);
}

.container {
  padding: 24px;
}
.container-wide {
  max-width: 1400px;
  margin: 0 auto;
}

/* ===== Notice banners partages (dashboard + instance) — v2.75.35. */
.notice-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  margin: 16px 0;
  border-radius: 6px;
  border: 1px solid;
  font-size: 14px;
  line-height: 1.45;
}
.notice-banner .notice-icon {
  font-weight: 700;
  font-size: 18px;
  line-height: 1;
}
.notice-banner .notice-extra {
  margin-left: 4px;
  opacity: 0.75;
  font-size: 0.9em;
}
.notice-success { background: #0f2a1d; color: #9ed9aa; border-color: #1c6a36; }
.notice-warning { background: #3a2f0f; color: #e6c889; border-color: #7a601d; }
.notice-error   { background: #3a1414; color: #e89a9a; border-color: #7a2424; }

/* ===== Dashboard toolbar — v2.75.35 : styles pour la barre au-dessus
   du tableau (titre + bouton MAJ flotte + Cash Dashboard + Enroler). */
.dash-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.dash-toolbar-title {
  margin: 0;
  font-size: 1.15em;
}
.dash-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.dash-toolbar-actions form {
  margin: 0;
}

/* Actions par ligne (colonne "" a droite du tableau instances). */
.table-instances td.row-actions {
  white-space: nowrap;
  text-align: right;
}
.table-instances td.row-actions .btn {
  margin-left: 4px;
}
.row-action-form {
  display: inline-block;
  margin: 0;
}
.row-action-form + .btn { margin-left: 4px; }

/* ===== Version badges (dashboard) — v2.75.35 : deplace de dashboard.php
   inline vers style.css externe pour coherence CSP. Colorisation colonne
   Version : vert si == latest_version manifest signe, orange si en retard. */
.version-cell { white-space: nowrap; font-variant-numeric: tabular-nums; }
.version-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.85em;
  font-weight: 600;
  line-height: 1.4;
  border: 1px solid transparent;
}
.version-badge.version-match {
  color: var(--green);
  background: rgba(46, 160, 67, 0.12);
  border-color: rgba(46, 160, 67, 0.35);
}
.version-badge.version-stale {
  color: var(--neurax-orange);
  background: rgba(255, 145, 0, 0.12);
  border-color: rgba(255, 145, 0, 0.45);
}
.version-badge.version-stale::after { content: " \2191"; opacity: 0.85; }
.version-badge.version-unknown {
  color: var(--fg-muted);
  background: rgba(120, 120, 120, 0.08);
  border-color: rgba(120, 120, 120, 0.25);
}

/* ===== Cards ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 24px;
}
.card.success {
  border-left: 4px solid var(--green);
}
.card h2 {
  margin: 0 0 16px;
  font-size: 1.2em;
}
.empty-state {
  text-align: center;
  padding: 48px 24px;
}

/* ===== Forms ===== */
form label {
  display: block;
  margin-bottom: 16px;
  color: var(--fg-muted);
  font-size: 0.9em;
}
form input[type=text],
form input[type=password] {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  background: #0A0E13;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--fg);
  font-size: 1em;
  font-family: inherit;
}
form input:focus {
  outline: none;
  border-color: var(--neurax-orange);
  box-shadow: 0 0 0 3px rgba(247, 181, 0, 0.15);
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 10px 18px;
  background: var(--neurax-orange);
  color: #0A0E13;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95em;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.btn:hover {
  background: var(--neurax-orange-dim);
  text-decoration: none;
}
.btn-ghost {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--bg-card-hover);
  color: var(--fg);
}

/* v2.75.43 (2026-07-10) — barre de tri du dashboard (mobile-first : le
   thead est masque en <=768px, donc le tri par clic sur th est invisible
   sur telephone ; cette barre reste visible et tactile partout). */
.sort-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 12px 0;
}
.sort-bar label {
  color: var(--fg-muted);
  font-size: 0.9em;
}
.sort-bar select {
  min-height: 40px;
  padding: 8px 10px;
  background: var(--bg-card);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95em;
  max-width: 70vw;
}
.sort-bar .sort-dir-btn {
  min-height: 40px;
  min-width: 84px;
  padding: 8px 12px;
}
.btn-sm {
  padding: 5px 10px;
  font-size: 0.85em;
}

/* ===== Stats grid (dashboard) ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  text-align: center;
}
.stat-label {
  color: var(--fg-muted);
  font-size: 0.85em;
  margin-bottom: 6px;
}
.stat-value {
  font-size: 2em;
  font-weight: 700;
  color: var(--neurax-orange);
}
.stat-online .stat-value { color: var(--green); }
.stat-warning .stat-value { color: var(--neurax-orange); }
.stat-offline .stat-value { color: var(--red); }

/* ===== Tables ===== */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: 8px;
  overflow: hidden;
}
th, td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
th {
  background: #0A0E13;
  color: var(--fg-muted);
  font-weight: 600;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
tr:last-child td {
  border-bottom: none;
}
tr:hover td {
  background: var(--bg-card-hover);
}
.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.pnl-pos { color: var(--green); }
.pnl-neg { color: var(--red); }

/* ===== Badges ===== */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 0.8em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-online {
  background: rgba(63, 185, 80, 0.15);
  color: var(--green);
  border: 1px solid var(--green);
}
.badge-warning {
  background: rgba(247, 181, 0, 0.15);
  color: var(--neurax-orange);
  border: 1px solid var(--neurax-orange);
}
.badge-offline {
  background: rgba(248, 81, 73, 0.15);
  color: var(--red);
  border: 1px solid var(--red);
}
.badge-crashed {
  background: rgba(248, 81, 73, 0.25);
  color: var(--red);
  border: 1px solid var(--red);
}
/* Variante orange ambre (état "partiel") — standardisation canaux notif. */
.badge-warn {
  background: rgba(210, 153, 34, 0.15);
  color: var(--warn-amber);
  border: 1px solid var(--warn-amber);
}

/* ===== Canaux de notification (instance.php — onglet Métriques) ===== */
.notif-channels {
  margin-top: 18px;
}
.notif-channels .notif-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.notif-channels .notif-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
}
.notif-channels .notif-name {
  font-weight: 600;
}
.notif-state-ok      { color: var(--green); }
.notif-state-partial { color: var(--warn-amber); }
.notif-state-off     { color: var(--red); }
.notif-state-unknown { color: var(--fg-muted); }

/* ===== Pastilles compactes (dashboard.php — vue flotte) ===== */
.chan-dots {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}
.chan-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.chan-dot-ok      { background: var(--green); }
.chan-dot-partial { background: var(--warn-amber); }
.chan-dot-off     { background: var(--red); }
.chan-dot-unknown { background: var(--border); }

/* ===== Install QR block ===== */
.qr-block {
  display: flex;
  align-items: center;
  gap: 24px;
  background: #FFFFFF;
  padding: 16px;
  border-radius: 8px;
  margin: 16px 0;
}
.qr-block > div {
  color: #0A0E13;
  flex: 1;
}
.qr-block .muted {
  color: #6B7280;
}

/* ===== Instance detail ===== */
.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.meta-grid > div {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
}
.chart {
  width: 100%;
  height: 180px;
  margin-top: 12px;
  background: #0A0E13;
  border-radius: 4px;
}

footer {
  text-align: center;
  padding: 24px;
  border-top: 1px solid var(--border);
  margin-top: 24px;
}

/* ===== v2.58.0 — Instance detail enrichi (M2.B) ===== */

/* Tabs nav (sticky top sur mobile) */
.tabs-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding-top: 8px;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  color: var(--fg-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.tab:hover {
  color: var(--fg);
  text-decoration: none;
}
.tab-active {
  color: var(--neurax-orange);
  border-bottom-color: var(--neurax-orange);
  font-weight: 600;
}
.tab-count {
  background: rgba(247, 181, 0, 0.15);
  color: var(--neurax-orange);
  padding: 1px 8px;
  border-radius: 100px;
  font-size: 0.75em;
  font-weight: 700;
}
.tab-active .tab-count {
  background: var(--neurax-orange);
  color: #0A0E13;
}
.tab-content {
  margin-bottom: 24px;
}

/* Instance header */
.instance-header {
  margin-bottom: 20px;
}
.meta-uuid {
  font-size: 0.75em;
  word-break: break-all;
}

/* Metric grid (cartes stats live) */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
}
.metric-label {
  color: var(--fg-muted);
  font-size: 0.8em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.metric-value {
  font-size: 1.5em;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.metric-orange { color: var(--neurax-orange); }
.metric-sub {
  margin-top: 4px;
}

/* Charts grid (24h + 7j côte à côte) */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.chart-grid .card {
  margin-bottom: 0;
}
.chart-meta {
  margin-bottom: 8px;
}

/* v2.66.3 — Overlay chart header (légende + symbol selector) */
.overlay-chart-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9em;
  color: var(--text);
}
.legend-swatch {
  display: inline-block;
  width: 24px;
  height: 3px;
  border-radius: 2px;
}
.legend-swatch.swatch-equity {
  background: var(--neurax-orange);
}
.legend-swatch.swatch-price {
  background: #6c7080;
  background-image: linear-gradient(to right, #6c7080 0, #6c7080 4px, transparent 4px, transparent 6px);
  background-size: 6px 100%;
  background-repeat: repeat-x;
}
.legend-zero-line {
  display: inline-block;
  letter-spacing: 1px;
  color: var(--muted);
  font-family: monospace;
  font-weight: 700;
}
.symbol-form select {
  background: var(--card-bg, #1a1d24);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  padding: 4px 8px;
  margin-left: 6px;
  cursor: pointer;
}

/* Table wrapper pour scroll horizontal mobile */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 16px;
  border-radius: 8px;
}
.table-wrap table {
  border-radius: 0;
  min-width: 100%;
}

/* Audit / alerts row coloring */
tr.audit-info td:first-child { border-left: 3px solid var(--blue); }
tr.audit-warning td:first-child { border-left: 3px solid var(--neurax-orange); }
tr.audit-alert td:first-child { border-left: 3px solid var(--red); }
tr.audit-warning { background: rgba(247, 181, 0, 0.04); }
tr.audit-alert { background: rgba(248, 81, 73, 0.05); }
.audit-details {
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 0.85em;
  color: var(--fg-muted);
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.audit-ip {
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 0.85em;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
  padding: 12px;
}

/* Actions grid (tab Actions) */
.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 16px 0 20px;
}
.btn-disabled {
  background: var(--bg-card-hover) !important;
  color: var(--fg-muted) !important;
  cursor: not-allowed !important;
  opacity: 0.6;
}
.btn-disabled:hover {
  background: var(--bg-card-hover) !important;
  text-decoration: none !important;
}
.btn-danger-ghost {
  border: 1px solid var(--red);
}
.card-inner {
  background: rgba(247, 181, 0, 0.05);
  border-left: 3px solid var(--neurax-orange);
  padding: 12px 14px;
  border-radius: 4px;
  margin-top: 16px;
}
.card-inner strong {
  color: var(--neurax-orange);
}

/* v2.66.3 — anti-débordement horizontal global (mobile).
   BenZine consulte souvent depuis son tel : on garantit que rien
   ne dépasse la viewport pour éviter le scroll horizontal partout. */
html { -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; }

/* ===== Mobile responsive ===== */
@media (max-width: 768px) {
  .container { padding: 12px; }
  .container-wide { padding: 10px; }
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
  }
  .topbar-right {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
  }
  .topbar-user { font-size: 0.85em; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-value { font-size: 1.2em; }
  .chart-grid { grid-template-columns: 1fr; }
  table { font-size: 0.85em; }
  th, td { padding: 7px 8px; }
  .hide-mobile { display: none; }
  .audit-details { max-width: 200px; }
  .actions-grid { grid-template-columns: 1fr; }
  .meta-grid { grid-template-columns: repeat(2, 1fr); }
  /* v2.66.3 — section dashboard "Instances" : header + actions stack */
  main > section[style*="space-between"] {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 8px !important;
  }
  .overlay-chart-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .legend-row { justify-content: center; gap: 12px; }

  /* v2.66.3 — `.table-instances` (dashboard.php) en CARDS empilées.
     Avant : table à 11 colonnes qui débordait horizontalement et
     forçait scroll horizontal → infos à droite invisibles d'emblée.
     Maintenant : chaque ligne devient une carte verticale, scan
     naturel en scroll vertical. Le `data-label` sur chaque `<td>`
     est généré côté PHP pour répéter le titre de colonne. */
  .table-instances,
  .table-instances thead,
  .table-instances tbody,
  .table-instances tr,
  .table-instances th,
  .table-instances td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }
  .table-instances thead { display: none; } /* le label est porté par data-label */
  .table-instances tr {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 10px;
  }
  .table-instances td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border: none;
    text-align: right;
    word-break: break-word;
  }
  .table-instances td::before {
    content: attr(data-label) "";
    color: var(--muted, #9aa0aa);
    font-size: 0.85em;
    font-weight: 500;
    margin-right: 12px;
    text-align: left;
    flex-shrink: 0;
  }
  .table-instances td:last-child { /* bouton Détail full-width */
    justify-content: stretch;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 6px;
  }
  .table-instances td:last-child::before { display: none; }
  .table-instances td:last-child .btn { width: 100%; text-align: center; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .meta-grid { grid-template-columns: 1fr; }
  .topbar-title { font-size: 0.95em; }
  .brand-mark { font-size: 0.95em; }
  .btn { padding: 8px 14px; font-size: 0.9em; }
  .tab { padding: 8px 12px; font-size: 0.9em; }
  .table-instances th:nth-child(4),
  .table-instances td:nth-child(4) { display: none; } /* hostname masqué */
}

/* ============================================================
 * Landing public neurax.ch — CSS désormais INLINÉ dans index.html
 * ============================================================
 * Les anciennes règles `.page-landing` / `.landing-*` du bloc v2.66.3
 * dépendaient de ce fichier externe ; sur mobile, un cache navigateur
 * agressif servait l'ancien style.css sans ces règles → l'image de
 * fond s'affichait nue, plein écran, tout le contenu disparaissait
 * visuellement (bug constaté par BenZine 2026-05-21).
 *
 * Correctif v2.66.4 : la landing publique embarque maintenant son CSS
 * critique inline dans `index.html`. Plus aucune dépendance à ce
 * fichier pour le rendu de la page d'accueil — il reste utilisé par
 * la console admin (login.php / dashboard.php / instance.php / etc).
 */

/* ============================================================
   WebAuthn / Profil & sécurité (v2.75.0+)
   ============================================================ */
.form-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin: 12px 0;
}
.form-row input[type="text"] {
  flex: 1 1 220px;
  min-width: 180px;
}
.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  cursor: pointer;
}
.toggle-row input[type="checkbox"] { width: auto; }
#webauthn-login-btn { width: 100%; margin-bottom: 8px; }

/* ============================================================
   Mobile responsive — passe 2026-06-18 (feat/mobile-responsive)
   ============================================================
   La console était déjà largement responsive (v2.66.3/4 cards
   table-instances, table-wrap, grilles auto-fit). Cette passe ferme
   les dernières lacunes constatées sur iPhone SE (375px) / Pixel 5
   (393px) :
     - tap targets `.btn` / `.tab` sous 44px (reco WCAG 2.5.5 / iOS) ;
     - `.qr-block` (install.php) qui débordait sur < 360px ;
     - submit des pages d'auth pas pleine largeur (cible doigt).
   (L'input `target_version` d'instance.php est rendu fluide à la
   source — width:100%/max-width — pas besoin de règle ici.)
   Tout est additif et scopé mobile — le rendu desktop est inchangé.
   ============================================================ */
@media (max-width: 768px) {
  /* Tap targets confortables : ≥44px de haut, texte centré.
     `.btn` passe en inline-flex pour centrer verticalement le label
     une fois la min-height appliquée (inline-block ne le ferait pas). */
  .btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .btn-sm { min-height: 38px; }
  .tab { min-height: 44px; }

  /* Pages d'auth (login.php / index.php) : le bouton de soumission
     prend toute la largeur de la carte = cible plus facile au pouce. */
  .page-auth .card form button.btn { width: 100%; }

  /* QR d'install (install.php) : empilage vertical pour ne plus
     déborder sous ~360px (img 220px + texte côte à côte sinon). */
  .qr-block {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
  }
  .qr-block img { max-width: 100%; height: auto; }
}
