/* Helm — console interno Brainnext. Base visual v2 (2026-09), portada do protótipo
   "Helm Console" (sete telas + base visual) desenhado no Claude Design. IBM Plex Sans/Mono,
   paleta refinada em tokens, disciplina real-vs-simulado, indicador de severidade sempre
   cor+ponto+palavra (nunca só cor). Continua sobre Bootstrap (grid/utilitários) em vez de
   substituí-lo — mesma decisão da v1: reescrever toda a base pra tirar o Bootstrap seria um
   projeto à parte, não o que foi pedido aqui. */

:root {
  --helm-ink: #14201e;
  --helm-ink-2: #4a5b57;
  --helm-ink-3: #7b8b87;
  --helm-bg: #f4f6f5;
  --helm-surface: #ffffff;
  --helm-surface-sub: #f8faf9;
  --helm-border: #dfe6e4;
  --helm-border-row: #eef1f0;

  --helm-sidebar: #10221f;
  --helm-sidebar-text: #b9c9c5;
  --helm-sidebar-muted: #7b908b;
  --helm-sidebar-active: #0e6e68;

  --helm-brand: #0e6e68;
  --helm-brand-soft: #e6f0ef;
  --helm-brand-strong: #0a4b47;

  --helm-good: #1f8a5a;
  --helm-good-soft: #e9f4ee;
  --helm-warn: #b5750f;
  --helm-warn-soft: #fdf6e7;
  --helm-bad: #b3261e;
  --helm-bad-soft: #fdf0ef;
  --helm-info: #2f4d7a;
  --helm-info-soft: #eaf0fa;

  --helm-font-sans: "IBM Plex Sans", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --helm-font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

body {
  background: var(--helm-bg);
  color: var(--helm-ink);
  font-family: var(--helm-font-sans);
  -webkit-font-smoothing: antialiased;
}

code, .helm-mono { font-family: var(--helm-font-mono); }

/* ---- Shell: sidebar + content ---- */

.helm-shell { display: flex; min-height: 100vh; }

.helm-sidebar {
  width: 236px;
  flex: 0 0 236px;
  background: var(--helm-sidebar);
  color: var(--helm-sidebar-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.helm-sidebar .helm-brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  text-decoration: none;
}
.helm-sidebar .helm-brand-mark:hover { text-decoration: none; }
.helm-brand-name { display: block; font-size: 0.85rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #ffffff; line-height: 1; }
.helm-brand-sub { display: block; font-size: 0.6rem; letter-spacing: .06em; color: var(--helm-sidebar-muted); margin-top: 3px; }

.helm-sidebar nav { flex: 1; padding: 14px 10px; overflow-y: auto; }

.helm-nav-group {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: #6b807b;
  padding: 14px 10px 7px;
}
.helm-nav-group:first-child { padding-top: 2px; }

.helm-sidebar nav a {
  color: var(--helm-sidebar-text);
  text-decoration: none;
  padding: 8px 10px;
  margin-top: 2px;
  border-radius: 4px;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 9px;
}

.helm-sidebar nav a:hover { background: rgba(255,255,255,0.06); color: #fff; text-decoration: none; }
.helm-sidebar nav a.active { background: var(--helm-sidebar-active); color: #fff; font-weight: 600; }

.helm-sidebar .helm-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 16px;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.helm-user-avatar {
  width: 28px; height: 28px; flex: none;
  border-radius: 3px;
  background: var(--helm-brand-strong);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 600;
}
.helm-user-info { min-width: 0; flex: 1; }
.helm-user-info .helm-user-name { color: #fff; font-weight: 500; font-size: 0.78rem; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.helm-user-info .helm-user-role { color: var(--helm-sidebar-muted); font-size: 0.65rem; display: block; }
.helm-sidebar form button {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.14);
  color: var(--helm-sidebar-text);
  font-size: 0.65rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 4px 7px;
  border-radius: 3px;
}
.helm-sidebar form button:hover { border-color: var(--helm-brand); color: #fff; }

.helm-content { flex: 1; padding: 0; min-width: 0; }
.helm-content > .helm-page-header {
  background: var(--helm-surface);
  border-bottom: 1px solid var(--helm-border);
  padding: 22px 32px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.helm-content > .helm-page-header h1 { margin: 0; font-size: 1.3rem; font-weight: 600; letter-spacing: -.01em; }
.helm-content > .helm-page-header p { margin: 5px 0 0; font-size: 0.82rem; color: var(--helm-ink-3); }
.helm-page-body { padding: 20px 32px 48px; }

/* ---- Login: split-screen (sem sidebar) ---- */
.helm-login-shell { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }
.helm-login-brand {
  background: var(--helm-sidebar);
  padding: 56px 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
}
.helm-login-brand .helm-brand-mark { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.helm-login-brand .helm-brand-mark span { font-size: 1.05rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #fff; }
.helm-login-kicker { font-size: 0.68rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--helm-brand); margin-bottom: 14px; }
.helm-login-brand h1 { font-size: 2rem; line-height: 1.15; font-weight: 600; letter-spacing: -.01em; color: #fff; max-width: 440px; }
.helm-login-brand p { font-size: 0.85rem; line-height: 1.6; color: var(--helm-sidebar-text); max-width: 420px; }
.helm-login-stack { display: flex; align-items: center; gap: 10px; font-size: 0.68rem; color: var(--helm-sidebar-muted); letter-spacing: .06em; text-transform: uppercase; }
.helm-login-stack span.sep { color: #2c4440; }
.helm-login-form-wrap { display: flex; align-items: center; justify-content: center; padding: 48px; }
.helm-login-form { width: 100%; max-width: 360px; }
.helm-login-form h2 { margin: 0 0 6px; font-size: 1.15rem; font-weight: 600; letter-spacing: -.01em; }
.helm-login-form > p { margin: 0 0 26px; font-size: 0.8rem; color: var(--helm-ink-3); }
.helm-login-footnote { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--helm-border); font-size: 0.75rem; line-height: 1.6; color: var(--helm-ink-3); }

/* ---- Components ---- */

.card {
  border: 1px solid var(--helm-border);
  border-radius: 5px;
  box-shadow: none;
}
.card-header { background: var(--helm-surface-sub); border-bottom: 1px solid var(--helm-border); font-weight: 600; font-size: 0.7rem; letter-spacing: .09em; text-transform: uppercase; color: var(--helm-ink-2); }

.btn-primary { background: var(--helm-brand); border-color: var(--helm-brand); font-weight: 600; }
.btn-primary:hover, .btn-primary:focus { background: var(--helm-brand-strong); border-color: var(--helm-brand-strong); }
.btn-outline-primary { color: var(--helm-brand-strong); border-color: var(--helm-border); }
.btn-outline-primary:hover { background: var(--helm-brand-soft); border-color: var(--helm-brand); color: var(--helm-brand-strong); }
.btn-outline-danger { border-color: var(--helm-border); color: var(--helm-bad); }
.btn-outline-danger:hover { background: var(--helm-bad-soft); border-color: var(--helm-bad); }
.btn-outline-secondary { border-color: var(--helm-border); color: var(--helm-ink-2); }
.btn-outline-secondary:hover { border-color: var(--helm-brand); color: var(--helm-brand-strong); }

.form-control, .form-select { border-color: var(--helm-border); font-size: 0.82rem; }
.form-control:focus, .form-select:focus { border-color: var(--helm-brand); box-shadow: 0 0 0 1px var(--helm-brand); }

.table { --bs-table-hover-bg: var(--helm-surface-sub); font-size: 0.82rem; }
.table thead th {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--helm-ink-3);
  border-bottom-width: 1px;
  border-color: var(--helm-border);
  background: var(--helm-surface-sub);
}
.table td { border-color: var(--helm-border-row); vertical-align: middle; }

/* Badges de destaque de catálogo (real vs simulado é tratado à parte, ver .helm-sim-tag) */
.badge.text-bg-success, .helm-badge-good { background: var(--helm-good-soft) !important; color: var(--helm-good) !important; }
.badge.text-bg-secondary, .helm-badge-neutral { background: var(--helm-border-row) !important; color: var(--helm-ink-2) !important; }
.badge.text-bg-warning, .helm-badge-warn { background: var(--helm-warn-soft) !important; color: var(--helm-warn) !important; }
.badge.text-bg-primary, .helm-badge-info { background: var(--helm-info-soft) !important; color: var(--helm-info) !important; }
.helm-badge-bad { background: var(--helm-bad-soft) !important; color: var(--helm-bad) !important; }

/* Stat card — cartão de número grande com fio superior colorido (padrão de Início/Status Geral) */
.helm-stat-card {
  background: var(--helm-surface);
  border: 1px solid var(--helm-border);
  border-top: 2px solid var(--helm-brand);
  border-radius: 5px;
  padding: 16px 18px 15px;
}
.helm-stat-card .helm-stat-label { font-size: 0.68rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--helm-ink-3); }
.helm-stat-card .helm-stat-value { display: flex; align-items: flex-end; gap: 9px; margin-top: 12px; }
.helm-stat-card .helm-stat-number { font-size: 2.1rem; font-weight: 600; line-height: 1; letter-spacing: -.02em; }
.helm-stat-card .helm-stat-meta { font-size: 0.75rem; color: var(--helm-ink-2); padding-bottom: 3px; }
.helm-stat-card.helm-accent-good { border-top-color: var(--helm-good); }
.helm-stat-card.helm-accent-warn { border-top-color: var(--helm-warn); }
.helm-stat-card.helm-accent-bad { border-top-color: var(--helm-bad); }
.helm-stat-card.helm-accent-dark { border-top-color: var(--helm-brand-strong); }

/* Real vs. simulado — sempre borda sólida+tinta da marca (real) ou tracejada+âmbar (simulado) */
.helm-tag-real {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid #cfe3df; background: var(--helm-brand-soft); color: var(--helm-brand-strong);
  border-radius: 3px; padding: 1px 6px; font-size: 0.6rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
}
.helm-sim-tag {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px dashed #e4c98a; background: var(--helm-warn-soft); color: var(--helm-warn);
  border-radius: 3px; padding: 1px 6px; font-size: 0.6rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  margin-left: 6px; vertical-align: middle;
}

/* Indicador de severidade: cor + ponto + palavra, nunca só cor */
.helm-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 3px; padding: 3px 8px; font-size: 0.7rem; font-weight: 600; white-space: nowrap; }
.helm-pill-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.helm-pill-good { background: var(--helm-good-soft); color: #166b46; border: 1px solid rgba(31,138,90,.2); }
.helm-pill-good .helm-pill-dot { background: var(--helm-good); }
.helm-pill-warn { background: var(--helm-warn-soft); color: #8e5c0b; border: 1px solid rgba(181,117,15,.2); }
.helm-pill-warn .helm-pill-dot { background: var(--helm-warn); }
.helm-pill-bad { background: var(--helm-bad-soft); color: #8f1e18; border: 1px solid rgba(179,38,30,.2); }
.helm-pill-bad .helm-pill-dot { background: var(--helm-bad); }

/* Placeholder honesto para tela em construção — nunca dado inventado no lugar */
.helm-coming-soon {
  background: var(--helm-surface);
  border: 1px dashed #cdd8d5;
  border-radius: 5px;
  padding: 40px 32px;
  text-align: center;
  color: var(--helm-ink-2);
}
.helm-coming-soon h2 { font-size: 1.05rem; font-weight: 600; margin-bottom: 8px; }
.helm-coming-soon p { font-size: 0.85rem; max-width: 640px; margin: 0 auto; line-height: 1.6; color: var(--helm-ink-3); }
.helm-badge-phase {
  display: inline-flex; align-items: center;
  border: 1px dashed var(--helm-border); background: var(--helm-surface-sub); color: var(--helm-ink-2);
  border-radius: 3px; padding: 2px 7px; font-size: 0.58rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
}

/* ---- Clientes: cada empresa é um <details> nativo (recolhe/expande sem JS,
   sem depender de "d-none"+onclick espalhado pela página) - resolve "não
   consigo compactar a visualização desta empresa" e o problema de escala
   quando existirem muitas empresas. ---- */

.helm-customer { border: 1px solid var(--helm-border); border-radius: 6px; background: var(--helm-surface); margin-bottom: 14px; }
.helm-customer + .helm-customer { margin-top: 0; }
.helm-customer[open] { box-shadow: 0 2px 8px rgba(16,34,31,.06); }

.helm-customer summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-left: 3px solid var(--helm-brand);
}
.helm-customer summary::-webkit-details-marker { display: none; }
.helm-customer summary::before {
  content: "\25B8"; /* ▸ */
  display: inline-block;
  width: 1em;
  margin-right: 6px;
  color: var(--helm-ink-3);
  transition: transform 0.12s ease;
}
.helm-customer[open] summary::before { transform: rotate(90deg); }

.helm-customer-heading { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.helm-customer-heading strong { font-size: 1rem; }
.helm-customer-heading code { font-size: 0.72rem; color: var(--helm-ink-3); }

.helm-customer-glance { display: flex; align-items: center; gap: 18px; font-size: 0.78rem; color: var(--helm-ink-3); white-space: nowrap; }
.helm-customer-glance strong { color: var(--helm-ink); font-family: var(--helm-font-mono); font-weight: 500; }

.helm-customer-body { border-top: 1px solid var(--helm-border); padding: 16px; background: var(--helm-bg); }

.helm-section { background: var(--helm-surface); border: 1px solid var(--helm-border); border-radius: 5px; margin-bottom: 14px; }
.helm-section:last-child { margin-bottom: 0; }
.helm-section > h6 {
  display: flex; align-items: center;
  text-transform: uppercase; font-size: 0.68rem; letter-spacing: 0.09em; color: var(--helm-ink-2); font-weight: 600;
  margin: 0; padding: 9px 14px; background: var(--helm-surface-sub); border-bottom: 1px solid var(--helm-border); border-radius: 5px 5px 0 0;
}
.helm-section > .helm-section-body { padding: 12px 14px; }

/* Toolbar acima da lista: busca + expandir/recolher tudo. */
.helm-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
.helm-toolbar input[type="search"] { max-width: 320px; }
