/* ==========================================================================
   AVIX Design System — v4.0 Corporate
   Base visual compartilhada por Login, Viabilidade (WEB) e Admin.
   Não altera nenhuma chamada de API: apenas a camada de apresentação.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SFMono-Regular", ui-monospace, "JetBrains Mono", Menlo, Consolas,
    monospace;

  /* Superfícies */
  --bg: #eef2f7;
  --bg-grad: radial-gradient(1200px 600px at 12% -10%, #e3ecfa 0%, transparent 60%),
    radial-gradient(900px 500px at 100% 0%, #eaf1fb 0%, transparent 55%), #eef2f7;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #eef3f9;
  --surface-inset: #f4f7fb;

  /* Traços */
  --border: #dde5ef;
  --border-strong: #c6d2e2;
  --ring: rgba(11, 87, 201, 0.18);

  /* Texto */
  --text: #10203a;
  --text-2: #44566e;
  --muted: #7b8ba3;

  /* Marca */
  --brand: #0b57c9;
  --brand-600: #0a49aa;
  --brand-700: #083b8b;
  --brand-100: #dbe8ff;
  --brand-50: #eef4ff;
  --accent: #f07d20;

  /* Semântica */
  --ok: #0d8f5b;
  --ok-bg: #e6f6ee;
  --ok-border: #a9e0c6;
  --warn: #b45309;
  --warn-bg: #fdf3e3;
  --warn-border: #f2d3a0;
  --danger: #c92a2a;
  --danger-bg: #fdeceb;
  --danger-border: #f4bfbc;
  --info-bg: #eaf2ff;
  --info-border: #c3d9fb;

  /* Forma */
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 22px;

  --sh-xs: 0 1px 2px rgba(16, 32, 58, 0.06);
  --sh-sm: 0 1px 3px rgba(16, 32, 58, 0.08), 0 1px 2px rgba(16, 32, 58, 0.04);
  --sh: 0 4px 14px rgba(16, 32, 58, 0.08), 0 1px 3px rgba(16, 32, 58, 0.05);
  --sh-lg: 0 18px 44px rgba(16, 32, 58, 0.14), 0 2px 8px rgba(16, 32, 58, 0.06);

  --sidew: 400px;
  --topbar-h: 62px;
}

/* Variantes escuras — mantidas para quem já usa um tema dark salvo no Admin.
   O visual corporativo claro continua sendo o padrão. */
body.theme-executive_dark,
body.theme-graphite,
body.theme-avix_blue,
body.theme-neo_fiber,
body.theme-3d_neon,
body.theme-3d_datacenter,
body.theme-3d_graphite {
  --bg: #0c1524;
  --bg-grad: radial-gradient(1100px 560px at 10% -12%, #123056 0%, transparent 60%),
    radial-gradient(900px 480px at 100% 0%, #0f2846 0%, transparent 55%), #0c1524;
  --surface: #10203a;
  --surface-2: #142744;
  --surface-3: #182e50;
  --surface-inset: #0e1c33;
  --border: #223a5e;
  --border-strong: #2d4a76;
  --text: #eaf2ff;
  --text-2: #adc2de;
  --muted: #8199b8;
  --brand: #3d90ff;
  --brand-600: #2a7ff0;
  --brand-700: #1f6ad2;
  --brand-100: #17325a;
  --brand-50: #142a4a;
  --ok: #34d399;
  --ok-bg: #0e3b2c;
  --ok-border: #1c6b50;
  --warn: #fbbf24;
  --warn-bg: #3a2c0c;
  --warn-border: #6b5119;
  --danger: #f87171;
  --danger-bg: #3d1717;
  --danger-border: #6d2a2a;
  --info-bg: #122a4c;
  --info-border: #22436f;
  --ring: rgba(61, 144, 255, 0.28);
  --sh-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --sh: 0 6px 18px rgba(0, 0, 0, 0.4);
  --sh-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
}

/* --------------------------------------------------------------------------
   2. Reset / base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-grad);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
h5 {
  margin: 0 0 0.5rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text);
}
h1 { font-size: 19px; }
h2 { font-size: 16px; }
h3 { font-size: 14.5px; }
h4 { font-size: 13px; }
p { margin: 0 0 0.7rem; color: var(--text-2); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
}

pre {
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-2);
  background: var(--surface-inset);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 14px;
  margin: 10px 0 0;
  max-height: 340px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: content-box; }

/* --------------------------------------------------------------------------
   3. Tipografia utilitária
   -------------------------------------------------------------------------- */
.muted { color: var(--muted); }
.tiny { font-size: 11.5px; color: var(--muted); line-height: 1.55; }
.mini { font-size: 12px; color: var(--text-2); }
.ok { color: var(--ok); font-weight: 650; }
.bad { color: var(--danger); font-weight: 650; }
.yellow { color: var(--warn); font-weight: 650; }
.green { color: var(--ok); font-weight: 650; }

.section-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 18px 0 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* --------------------------------------------------------------------------
   4. Formulários
   -------------------------------------------------------------------------- */
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin: 12px 0 5px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
input:not([type]),
select,
textarea {
  width: 100%;
  padding: 9px 11px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

textarea { min-height: 76px; resize: vertical; line-height: 1.5; }

input::placeholder,
textarea::placeholder { color: #a6b3c6; }

input:hover:not(:disabled),
select:hover:not(:disabled),
textarea:hover:not(:disabled) { border-color: var(--muted); }

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--ring);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: var(--surface-3);
  color: var(--muted);
  cursor: not-allowed;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237b8ba3' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

input[type="file"] {
  padding: 8px;
  font-size: 12.5px;
  background: var(--surface-2);
  cursor: pointer;
}
input[type="file"]::file-selector-button {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  border-radius: 6px;
  padding: 5px 11px;
  margin-right: 10px;
  cursor: pointer;
}

/* Checkbox inline dentro de <label> */
label:has(> input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 9px 11px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
label:has(> input[type="checkbox"]):hover {
  border-color: var(--border-strong);
  background: var(--surface-3);
}
input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex: none;
  accent-color: var(--brand);
  cursor: pointer;
  margin: 0;
}

.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.grid2 > div > label:first-child,
.grid3 > div > label:first-child { margin-top: 0; }

@media (max-width: 720px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   5. Botões
   -------------------------------------------------------------------------- */
button,
.av-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 620;
  line-height: 1;
  color: #fff;
  background: var(--brand);
  border: 1px solid var(--brand);
  border-radius: var(--r-sm);
  padding: 10px 15px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.08s;
  box-shadow: var(--sh-xs);
}
button:hover:not(:disabled),
.av-btn:hover:not(:disabled) { background: var(--brand-600); border-color: var(--brand-600); }
button:active:not(:disabled) { transform: translateY(1px); }
button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
button:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

button.secondary,
.av-btn.secondary {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border-strong);
}
button.secondary:hover:not(:disabled) { background: var(--surface-3); border-color: var(--muted); }

button.ghost {
  color: var(--text-2);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
button.ghost:hover:not(:disabled) { background: var(--surface-3); border-color: var(--border); }

button.danger,
.av-btn.danger {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}
button.danger:hover:not(:disabled) { background: #a81f1f; border-color: #a81f1f; }

button.block { width: 100%; }

/* Botão principal de exportação de KML gerado pelo JS */
button.kml-main {
  width: 100%;
  margin-top: 10px;
  color: #fff;
  background: linear-gradient(180deg, var(--accent), #d96a12);
  border-color: #d96a12;
}
button.kml-main:hover:not(:disabled) { background: #d96a12; }

button.map-btn {
  width: 100%;
  margin-top: 8px;
  color: var(--text);
  background: var(--surface);
  border-color: var(--border-strong);
}
button.map-btn:hover:not(:disabled) { background: var(--surface-3); }

.actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.actions button { width: 100%; }

/* --------------------------------------------------------------------------
   6. Cards e superfícies
   -------------------------------------------------------------------------- */
.card,
.av-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  margin: 0 0 14px;
  box-shadow: var(--sh-sm);
}
.card > h2:first-child,
.card > h3:first-child,
.av-card > h2:first-child { margin-top: 0; }

.card h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.av-card-sub {
  margin: -6px 0 14px;
  font-size: 12.5px;
  color: var(--muted);
}

.notice {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-2);
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  border-left: 3px solid var(--brand);
  border-radius: var(--r-sm);
  padding: 11px 13px;
  margin: 10px 0;
}
.notice b { color: var(--text); }

.rowbox,
.city,
.poprow {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 14px;
  margin: 8px 0;
  font-size: 13px;
  color: var(--text-2);
}
.city h3 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.city .actions { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.poprow { background: var(--surface); }
.pops { display: none; margin-top: 10px; }

/* --------------------------------------------------------------------------
   7. Badges, pills, chips
   -------------------------------------------------------------------------- */
.pill,
.badge,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--text-2);
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 10px;
  margin: 0 5px 5px 0;
  white-space: nowrap;
}
.badge {
  color: var(--brand);
  background: var(--brand-50);
  border-color: var(--brand-100);
}
.pill.green { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-border); }
.pill.yellow { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-border); }
.pill.red { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-border); }

/* --------------------------------------------------------------------------
   8. KPIs
   -------------------------------------------------------------------------- */
.kpi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 9px;
  margin: 14px 0;
}
.kpi > div {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 11px 12px;
  min-width: 0;
}
.kpi small {
  display: block;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.kpi b {
  font-size: 16px;
  font-weight: 680;
  letter-spacing: -0.02em;
  color: var(--text);
  overflow-wrap: break-word;
  hyphens: auto;
}
.kpi br { display: none; }

.cost {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  margin: 4px 0 2px;
  font-variant-numeric: tabular-nums;
}

.topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.topline h3, .topline h4 { margin: 0; }

/* --------------------------------------------------------------------------
   9. Status banner (ONNET / OFFNET / CAPEX)
   -------------------------------------------------------------------------- */
.status-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: var(--r);
  padding: 14px 16px;
  margin-bottom: 14px;
  border: 1px solid transparent;
}
.status-banner::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 22%, transparent);
}
.status-onnet { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-border); }
.status-offnet { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-border); }
.status-capex { color: var(--brand); background: var(--brand-50); border-color: var(--brand-100); }
.status-neutral { color: var(--muted); background: var(--surface-3); border-color: var(--border); }

/* --------------------------------------------------------------------------
   10. Bloco de construção / opções comerciais
   -------------------------------------------------------------------------- */
.construction-box {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--r);
  padding: 13px 14px;
  margin: 14px 0;
}
.construction-box .section-title { margin-top: 0; color: var(--warn); }
.construction-box .section-title::after { background: var(--warn-border); }

.option {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 13px 14px;
  margin: 10px 0;
}
.option h4 { margin: 0; font-size: 13.5px; }
.option .kpi { grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); margin: 10px 0; }
.option .kpi b { font-size: 14.5px; }
.option .kpi > div { background: var(--surface); }

/* Linha de item LPU gerada pelo JS */
.lpu-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--text-2);
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}

/* --------------------------------------------------------------------------
   11. Tabelas
   -------------------------------------------------------------------------- */
.tablewrap {
  overflow: auto;
  max-height: 520px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
}
.tablewrap > table { border: none; }

table.lputable,
table.av-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
}
table.lputable th,
table.av-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-3);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.lputable td,
table.av-table td {
  padding: 9px 12px;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
table.lputable tbody tr:hover td,
table.av-table tbody tr:hover td { background: var(--surface-2); }
table.lputable tbody tr:last-child td { border-bottom: none; }

/* --------------------------------------------------------------------------
   12. Topbar
   -------------------------------------------------------------------------- */
.av-topbar {
  position: sticky;
  top: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--topbar-h);
  padding: 0 18px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--sh-xs);
}
.av-topbar .av-logo {
  display: flex;
  align-items: center;
  height: 34px;
  padding-right: 16px;
  border-right: 1px solid var(--border);
}
.av-topbar .av-logo img { max-height: 30px; max-width: 128px; object-fit: contain; }
.av-titleblock { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.av-titleblock strong {
  font-size: 14px;
  font-weight: 680;
  letter-spacing: -0.01em;
  color: var(--text);
}
.av-titleblock span {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.av-topbar-spacer { flex: 1; }
.av-topbar-meta { display: flex; align-items: center; gap: 7px; }
.av-topbar-nav { display: flex; align-items: center; gap: 4px; }
.av-navlink {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.av-navlink:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.av-navlink.is-active {
  color: var(--brand);
  background: var(--brand-50);
  border-color: var(--brand-100);
}

.av-status-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ok);
  background: var(--ok-bg);
  border: 1px solid var(--ok-border);
  border-radius: 999px;
  padding: 5px 11px;
}
.av-status-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: av-pulse 2.4s ease-in-out infinite;
}
@keyframes av-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.chip.version-chip { color: var(--brand); background: var(--brand-50); border-color: var(--brand-100); }

/* --------------------------------------------------------------------------
   13. Segmented control (abas Viabilidade / Ponta A-B)
   -------------------------------------------------------------------------- */
.tabs,
.av-segment {
  display: flex;
  gap: 3px;
  padding: 3px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 0 0 14px;
}
.tabs .tab,
.av-segment > button {
  flex: 1;
  font-size: 12.5px;
  font-weight: 640;
  color: var(--text-2);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 10px;
  box-shadow: none;
}
.tabs .tab:hover:not(.active),
.av-segment > button:hover:not(.active) { background: var(--surface); color: var(--text); }
.tabs .tab.active,
.av-segment > button.active {
  color: var(--brand);
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--sh-xs);
}

.hide { display: none !important; }

/* --------------------------------------------------------------------------
   14. Mapa (tela de viabilidade)
   -------------------------------------------------------------------------- */
.legend {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 800;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 550;
  color: var(--text-2);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 11px 13px;
  box-shadow: var(--sh);
}
.legend > div { display: flex; align-items: center; gap: 8px; }
.legend .sw {
  width: 16px;
  height: 4px;
  border-radius: 99px;
  flex: none;
}
.sw.aereo { background: #f59e0b; }
.sw.sub { background: #8b5cf6; }
.sw.prop { background: #0d8f5b; }
.sw.pop { background: var(--brand); height: 9px; width: 9px; border-radius: 50%; }

/* --------------------------------------------------------------------------
   15. Painel I.A Viabilidade
   -------------------------------------------------------------------------- */
.ia-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 20px;
  background: linear-gradient(135deg, var(--brand-700), var(--brand));
  border-radius: var(--r-lg);
  padding: 22px 24px;
  margin-bottom: 16px;
  color: #fff;
  box-shadow: var(--sh);
  overflow: hidden;
  position: relative;
}
.ia-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(600px 220px at 88% 0%, rgba(255, 255, 255, 0.22), transparent 65%);
  pointer-events: none;
}
.ia-title-card { position: relative; z-index: 1; }
.ia-title-card .tiny {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ia-title-card h2 {
  color: #fff;
  font-size: 24px;
  margin: 6px 0 8px;
  border: none;
  padding: 0;
}
.ia-title-card p { color: rgba(255, 255, 255, 0.85); margin: 0; max-width: 70ch; font-size: 13px; }
.ia-brain {
  position: relative;
  z-index: 1;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.25) 45%, rgba(255, 255, 255, 0.06) 70%);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 40px rgba(255, 255, 255, 0.28);
}

.ia-kpi-3d {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.ia-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--brand);
  border-radius: var(--r);
  padding: 14px 16px;
  box-shadow: var(--sh-sm);
}
.ia-tile small {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.ia-tile b {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}
.ia-tile br { display: none; }
.ia-tile .tiny { display: block; margin-top: 2px; }
.ia-glow-green { border-top-color: var(--ok); }
.ia-glow-gold { border-top-color: var(--accent); }
.ia-glow-purple { border-top-color: #8b5cf6; }

.ia-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}
.ia-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  box-shadow: var(--sh-sm);
}
.ia-panel h3 {
  padding-bottom: 9px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.ia-panel canvas { width: 100%; display: block; }

/* --------------------------------------------------------------------------
   16. Toolbar / prévia de menu (Admin)
   -------------------------------------------------------------------------- */
.toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}
.toolbar label:first-child { margin-top: 0; }

.menuPreview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 8px;
  margin: 12px 0;
}
.menuPreview > div {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-sm);
  padding: 14px 8px;
}

/* --------------------------------------------------------------------------
   17. Utilitários de layout
   -------------------------------------------------------------------------- */
.av-stack { display: flex; flex-direction: column; gap: 12px; }
.av-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.av-scroll { overflow-y: auto; overscroll-behavior: contain; }
.av-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 34px 20px;
}
.av-empty svg { opacity: 0.35; }

.av-footer {
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
  padding: 18px;
}
