/* Espace client (panel) — même langage visuel que la page d'accueil (site.css est chargé avant) :
   barre utilitaire, navigation collante, ouverture quadrillée avec télémétrie, sections en .wrap. */
html, body { min-height: 100%; }
.boot { min-height: 100vh; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--text-2); }
/* site.css espace les <section> de la page d'accueil : pas dans le panel (spécificité minimale). */
:where(.panel-body) section { padding: 0; }
.shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.main { flex: 1; padding-bottom: 72px; }

/* ---------- Barre utilitaire + navigation ---------- */
.utility-meta .sep { opacity: .45; margin: 0 6px; }
.utility-meta b { font-weight: 500; color: #fff; }
.utility-meta .hot { color: #f7c470; }
.app-links { gap: 26px; }
.app-links a.active { color: var(--text); }
.app-links a.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -22px; height: 2px; border-radius: 2px; background: var(--brand); }
.app-links a:hover::after { bottom: -22px; }
.me { display: flex; align-items: center; gap: 9px; padding-left: 12px; border-left: 1px solid var(--line); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); flex-shrink: 0; object-fit: cover; }
.me-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.me-text b { font-size: 13.5px; font-weight: 700; max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-text span { font-size: 12px; color: var(--text-3); white-space: nowrap; }

/* ---------- Bandeau (offre gratuite verrouillée, paiement en échec) ---------- */
.banner { border-bottom: 1px solid var(--brand-line); background: linear-gradient(90deg, var(--brand-soft), transparent 75%), var(--bg-2); }
.banner.danger { border-color: var(--danger-line); background: linear-gradient(90deg, var(--danger-soft), transparent 75%), var(--bg-2); }
.banner-inner { display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; padding-block: 12px; }
.banner-inner > p { flex: 1; min-width: 260px; font-size: 14.5px; color: var(--text-2); }
.banner-inner > p b { color: var(--text); }
.banner-inner .row { gap: 8px; }

/* ---------- Rail des bots ---------- */
.rail { border-bottom: 1px solid var(--line); background: var(--bg-2); }
.rail-inner { display: flex; align-items: center; gap: 14px; min-height: 54px; }
.rail-label { display: inline-flex; align-items: baseline; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-3); white-space: nowrap; }
.rail-label b { font: 500 12px var(--mono); color: var(--text-2); }
.bot-list { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-block: 8px; }
.bot-list::-webkit-scrollbar { display: none; }
.bot-item { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); text-decoration: none; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.bot-item:hover { color: var(--text); border-color: var(--line-strong); }
.bot-item.active { color: var(--text); border-color: var(--brand-line); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand-line); }
.bot-item .name { max-width: 22ch; overflow: hidden; text-overflow: ellipsis; }
.bot-item .rt { font: 500 11px var(--mono); color: var(--text-3); }
.bot-empty { color: var(--text-3); font-size: 13.5px; align-self: center; }

/* ---------- Ouverture (bot, abonnement, conseiller, admin) ---------- */
.app-hero { padding: 56px 0 64px; }
.app-hero .hero-mark { bottom: -5vw; font-size: clamp(140px, 17vw, 270px); }
.app-hero h1 { font-size: clamp(36px, 4.4vw, 58px); max-width: 16ch; word-break: break-word; }
.app-hero .lead { margin-top: 18px; font-size: 17px; }
.app-hero .hero-actions { margin-top: 28px; }
.app-hero .hero-kicker { align-items: center; margin-bottom: 20px; }
.page-hero { padding: 52px 0 56px; }
.page-hero .hero-copy { max-width: 760px; }
.bot-ident { display: flex; align-items: center; gap: 18px; min-width: 0; }
.bot-ident h1 { min-width: 0; }
.bot-avatar { width: 64px; height: 64px; border-radius: 16px; border: 1px solid var(--line); box-shadow: 0 0 0 4px var(--brand-soft); flex-shrink: 0; }
.bot-mono {
  display: grid; place-items: center; width: 64px; height: 64px; flex-shrink: 0; border-radius: 16px;
  background: linear-gradient(135deg, var(--brand), #7b5cff); color: #fff;
  font: 900 30px/1 var(--sans); font-stretch: 125%; box-shadow: var(--glow);
}
.bot-mono[hidden] { display: none; }

/* Télémétrie (carte sombre de la page d'accueil) */
.tele-grid dd small { font: 400 12px var(--sans); color: var(--term-dim); margin-left: 4px; }
.tele-grid dd.dim { color: var(--term-dim); }
.live.off { color: var(--term-dim); }
.live.off .dot { animation: none; box-shadow: none; }
.live.warn { color: #f7c470; }
.tele-ram { padding: 14px 18px 16px; border-bottom: 1px solid var(--term-line); }
.tele-ram:empty { display: none; }
.gauge-top { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--term-dim); margin-bottom: 8px; }
.gauge-top b { font: 500 12.5px var(--mono); color: var(--term-text); }
.gauge { height: 6px; border-radius: 99px; background: var(--term-line); overflow: hidden; }
.gauge i { display: block; height: 100%; width: var(--w, 0%); border-radius: inherit; background: linear-gradient(90deg, var(--brand), #8fa2ff); transition: width .5s ease; }
.gauge.hot i { background: linear-gradient(90deg, #f2a93b, #f7c470); }
.gauge.full i { background: linear-gradient(90deg, #f0525e, #ff8f98); }
.tele-foot { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.tele-foot a { color: #8fa6ff; }
.btn-term { --bg: transparent; --fg: var(--term-text); --bd: var(--term-line); box-shadow: none; }
.btn-term:hover:not(:disabled) { --bg: var(--term-2); --bd: #2b3a5e; --fg: #fff; }

/* Carte « hébergement gratuit » : boost ou invitations */
.unlock-body { padding: 16px 18px; border-bottom: 1px solid var(--term-line); display: flex; flex-direction: column; gap: 12px; }
.unlock-body p { font-size: 13.5px; line-height: 1.55; color: #aebbd6; }
.unlock-body p b { color: #fff; }
.segments { display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); gap: 4px; }
.segments i { height: 8px; border-radius: 2px; background: var(--term-line); }
.segments i.on { background: #22c57a; box-shadow: 0 0 12px -2px rgba(34, 197, 122, .6); }
.segments.boosted i { background: #f47fff; box-shadow: 0 0 12px -2px rgba(244, 127, 255, .6); }
.unlock-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--term-line); }
.tele-grid dd.ok { color: #6fe3a9; }
.tele-grid dd.boost { color: #f9a8ff; }

/* ---------- Onglets (barre collante sous la navigation) ---------- */
.tabs-bar { position: sticky; top: 64px; z-index: 40; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 26px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; padding: 17px 0 15px; background: none; border: none; color: var(--text-2); font: 600 14.5px var(--sans); cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); }
.tab.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px 2px 0 0; background: var(--brand); }
.tab .badge-dot { display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: var(--danger); vertical-align: 1px; }
.panels { padding-top: 28px; }
.page-body { padding-top: 40px; }
.page-body .section-head { margin-bottom: 24px; }
.page-body .section-head h2 { font-size: clamp(26px, 3vw, 36px); }
.panel-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; min-height: 30px; flex-wrap: wrap; }
.panel-intro { margin-bottom: 14px; max-width: 76ch; }
.sub-title { font-size: 22px; font-stretch: 118%; margin: 40px 0 14px; }
.page-body > .sub-title:first-child { margin-top: 0; }

/* ---------- Cartes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--card-shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 18px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface-2) 50%, transparent); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.card-head h2 { display: flex; align-items: center; gap: 8px; font: 700 15.5px/1.3 var(--sans); font-stretch: 112%; letter-spacing: 0; }
.card-head h2 .icon { color: var(--text-3); }
.card-body { padding: 18px; }
.card.locked .card-body > :not(.lock-note) { opacity: .5; }
.lock-note { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 11px 14px; border-radius: var(--r); background: var(--brand-soft); border: 1px solid var(--brand-line); font-size: 13.5px; color: var(--text); }
.lock-note .icon { color: var(--brand-text); }
.lock-note a { margin-left: auto; font-weight: 600; }

/* ---------- Vue d'ensemble ---------- */
.ov-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
#ov-warnings { margin-bottom: 16px; }
#ov-warnings:empty { display: none; }
.warn-box { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-lg); background: var(--warn-soft); border: 1px solid var(--warn-line); }
.warn-box.danger { background: var(--danger-soft); border-color: var(--danger-line); }
.warn-box > .icon { margin-top: 2px; color: var(--warn); }
.warn-box.danger > .icon { color: var(--danger); }
.warn-box > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.warn-box .mono { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.discord-id { display: flex; align-items: center; gap: 12px; }
.discord-id img { width: 44px; height: 44px; border-radius: 50%; }
.discord-id > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.discord-id b { font-size: 16px; }
.card .intents { list-style: none; margin: 14px 0 0; padding: 0; border-top: 1px solid var(--line); }
.card .intents li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.card .intents li:last-child { border-bottom: none; }
.card .intents li > span:last-child { margin-left: auto; text-align: right; color: var(--text-3); font-size: 12.5px; }
.card .intents .ok > .icon { color: var(--ok); }
.card .intents .bad, .card .intents .bad > span:last-child { color: var(--danger-text); }
.card .intents .off > .icon { color: var(--text-3); }
.chart-box { padding: 14px 18px 16px; }
.chart { width: 100%; height: 130px; display: block; }
.chart-legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-3); margin-top: 6px; }
.chart-empty { height: 130px; display: grid; place-items: center; color: var(--text-3); font-size: 13.5px; text-align: center; }
.timeline { list-style: none; margin: 0; padding: 4px 0; max-height: 320px; overflow-y: auto; }
.timeline li { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: baseline; padding: 8px 18px; font-size: 13.5px; }
.timeline li + li { border-top: 1px solid var(--line); }
.timeline li .dot { transform: translateY(-1px); }
.timeline li span:nth-child(2) { min-width: 0; }
.timeline li small { display: block; color: var(--text-3); font-size: 12.5px; }
.timeline time { color: var(--text-3); font: 12px var(--mono); white-space: nowrap; }
.diag-result { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.diag-result h3 { font: 700 16px var(--sans); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.diag-result ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.diag-result .src { font-size: 12px; color: var(--text-3); }

/* ---------- Console / fichiers ---------- */
.console { height: 62vh; min-height: 380px; box-shadow: 0 0 0 1px rgba(84, 112, 255, .12), 0 30px 70px -40px rgba(84, 112, 255, .45); }
.console-empty { color: var(--term-dim); font-style: italic; }
.console-note { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.console-note .icon { width: 14px; height: 14px; }
.files { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; }
.file-side { display: flex; flex-direction: column; min-width: 0; }
.file-list { display: flex; flex-direction: column; max-height: 52vh; min-height: 160px; overflow-y: auto; padding: 4px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.file-item { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: var(--r); background: none; border: none; color: var(--text); font: 12.5px var(--mono); text-align: left; cursor: pointer; }
.file-item:hover { background: var(--surface-2); }
.file-item.active { background: var(--brand-soft); color: var(--brand-text); }
.file-item .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .fsize { color: var(--text-3); flex-shrink: 0; }
.file-empty { padding: 12px; color: var(--text-3); font-size: 13px; }
.dropzone { margin-top: 10px; padding: 14px 12px; text-align: center; font-size: 13px; color: var(--text-2); border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg); background: var(--surface); transition: border-color .12s, background .12s; }
.files.over .dropzone, .dropzone.over { border-color: var(--brand); background: var(--brand-soft); color: var(--text); }
.dropzone-big { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 36px 16px; margin: 0; cursor: pointer; }
.dropzone-big:hover { border-color: var(--brand); }
.editor-wrap { min-width: 0; display: flex; flex-direction: column; }
.editor-path { font: 12.5px var(--mono); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor { height: 62vh; min-height: 380px; resize: none; background: var(--term); color: var(--term-text); border-color: var(--term-line); border-radius: var(--r-lg); font: 13px/1.6 var(--mono); tab-size: 2; white-space: pre; overflow: auto; padding: 14px 16px; }
.editor:disabled { opacity: .85; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--card-shadow); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; padding: 11px 16px; font-size: 12.5px; font-weight: 600; color: var(--text-3); background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table .who { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.table .who img { width: 28px; height: 28px; border-radius: 50%; }
.table .who span { display: flex; flex-direction: column; }
.table select { min-height: 32px; padding: 0 8px; width: auto; }
.table .actions-cell { display: flex; gap: 6px; justify-content: flex-end; }

/* ---------- Variables, paramètres ---------- */
.env-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.env-row { display: grid; grid-template-columns: minmax(130px, 1fr) 2fr auto; gap: 8px; }
.env-row input { font-family: var(--mono); font-size: 13px; }
.env-empty { color: var(--text-3); font-size: 14px; padding: 6px 0; }
.settings { max-width: 640px; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; max-width: 640px; padding: 14px 16px; border: 1px solid var(--danger-line); border-radius: var(--r-lg); background: var(--danger-soft); }
.danger-zone p { margin-top: 3px; }
.badge-preview { height: 20px; width: auto; }

/* ---------- Abonnement ---------- */
.plan-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.plan-card { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 22px 20px 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--card-shadow); }
.plan-card.featured { box-shadow: inset 0 3px 0 var(--brand), var(--card-shadow); background: linear-gradient(180deg, var(--featured-bg), transparent 60%), var(--surface); }
.plan-card.current { border-color: var(--brand); }
.plan-card h3 { font-size: 21px; font-stretch: 120%; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.plan-card .price b { font: 800 34px/1 var(--sans); font-stretch: 112%; letter-spacing: -0.02em; }
.plan-card .price span { color: var(--text-3); font-size: 13px; margin-left: 4px; }
.plan-card ul { list-style: none; margin: 0; padding: 14px 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; color: var(--text-2); flex: 1; }
.plan-card li { display: flex; gap: 7px; }
.plan-card li .icon { width: 15px; height: 15px; margin-top: 2px; color: var(--ok); }
.plan-card li.minus { color: var(--text-3); }
.plan-card li.minus .icon { color: var(--text-3); }

/* ---------- Conseiller ---------- */
.advisor-body { max-width: 860px; }
.advisor-count { width: 140px; }
.advisor-result { margin-top: 16px; padding: 20px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.advisor-result .rec { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; }
.advisor-result .rec b { font: 800 30px/1 var(--sans); font-stretch: 120%; color: var(--brand-text); }
.advisor-result ul { margin: 0; padding-left: 18px; color: var(--text-2); }
.advisor-result .src { font-size: 12.5px; color: var(--text-3); }

/* ---------- Administration ---------- */
.checklist { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); box-shadow: var(--card-shadow); }
.checklist li { display: flex; gap: 12px; align-items: flex-start; padding: 13px 18px; font-size: 14px; }
.checklist li + li { border-top: 1px solid var(--line); }
.checklist .state { flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; margin-top: 1px; }
.checklist .ok .state { background: var(--ok-soft); color: var(--ok); }
.checklist .todo .state { background: var(--warn-soft); color: var(--warn); }
.checklist .state .icon { width: 12px; height: 12px; }
.checklist b { display: block; }
.checklist code { word-break: break-all; }
.admin-users-head { margin-top: 40px; margin-bottom: 14px; }
.admin-users-head .sub-title { margin: 0; }
#admin-search { max-width: 320px; }

/* ---------- Dialogue ---------- */
.dialog { width: min(520px, calc(100% - 32px)); padding: 0; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); }
.dialog::backdrop { background: rgba(3, 6, 14, .6); backdrop-filter: blur(2px); }
.dialog form { display: flex; flex-direction: column; gap: 16px; padding: 26px; }
.dialog h2 { font-size: 26px; font-stretch: 120%; }
.dialog[open] { animation: pop .16s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.templates { border: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.templates legend { padding: 0; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.tpl { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-size: 13.5px; }
.tpl input { position: absolute; opacity: 0; pointer-events: none; }
.tpl b { font-weight: 600; }
.tpl span { color: var(--text-3); font-size: 12.5px; }
.tpl:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.tpl:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- Responsive ---------- */
@media (max-width: 1150px) {
  .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .me-text { display: none; }
}
@media (max-width: 980px) {
  .ov-grid { grid-template-columns: 1fr; }
  .app-hero { padding: 40px 0 48px; }
}
@media (max-width: 860px) {
  /* La navigation passe sur une deuxième ligne défilante. */
  .nav-inner { flex-wrap: wrap; height: auto; padding-top: 10px; gap: 0 12px; justify-content: space-between; }
  .app-links { display: flex; order: 3; width: 100%; margin: 0; gap: 22px; overflow-x: auto; scrollbar-width: none; padding: 12px 0 13px; }
  .app-links a { white-space: nowrap; }
  .app-links a.active::after, .app-links a:hover::after { bottom: -1px; }
  .tabs-bar { top: 0; position: relative; }
  .files { grid-template-columns: 1fr; }
  .file-list { max-height: 200px; }
  .console, .editor { height: 56vh; min-height: 280px; }
  .env-row { grid-template-columns: 1fr 1fr auto; }
  .danger-zone { flex-direction: column; align-items: flex-start; }
  .plan-grid { grid-template-columns: 1fr; }
  .templates { grid-template-columns: 1fr; }
  .bot-avatar, .bot-mono { width: 48px; height: 48px; border-radius: 12px; font-size: 22px; }
}
@media (max-width: 680px) {
  .app-links { display: flex; }
  .me { padding-left: 8px; }
  .rail-label { display: none; }
  .app-hero .hero-actions .btn { flex: 1; }
  .page-body { padding-top: 28px; }
}
