/*
  GGV · base visual compartilhada.
  Padrão de aparência: Padronizador de Leads (padronizador-leads.html).
  Cores do logo GGV: dourado e azul-marinho; temas em ggv-theme.css.
  Toda tela da central carrega este arquivo antes do próprio <style>;
  o build (scripts/build-single.mjs) o embute no arquivo único.
*/
:root {
  --navy-950: #010138;
  --navy-900: #0C0F4A;
  --navy-800: #1C2063;
  --navy-700: #353A78;
  --navy-600: #4F5388;
  --navy-500: #6A6E9A;
  --navy-300: #B3B5CE;
  --navy-200: #D6D8E6;
  --navy-150: #E4E5EF;
  --navy-100: #EEEFF6;
  --navy-50: #F7F7FB;
  --gold-500: #FFB705;
  --gold-600: #F09E33;
  --gold-100: #FFF1CC;
  --gold-50: #FFF9E8;
  --gold-ink: #6B4500;
  --red-600: #B8312A;
  --red-100: #FBE4E2;
  --green-700: #17704A;
  --green-100: #DCF0E4;
  --white: #FFFFFF;
  --radius-control: 8px;
  --radius-panel: 12px;
  /* Instrument Sans no texto, Instrument Serif nos títulos grandes, IBM Plex Mono nos números. Geist fica de reserva
     para página que ainda carregue só a fonte antiga. */
  --font-ui: "Instrument Sans", "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-float: 0 16px 36px -12px rgba(1, 1, 56, 0.24), 0 2px 6px rgba(1, 1, 56, 0.06);
  color-scheme: light;
}

/* ---- base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--white); }
body {
  margin: 0;
  background: var(--white);
  color: var(--navy-950);
  font: 14px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
input, select, textarea { caret-color: var(--navy-900); }
::selection { background: var(--gold-100); color: var(--navy-950); }
:focus-visible { outline: 2px solid var(--navy-900); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: var(--navy-200) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--navy-200); border-radius: 999px; border: 2px solid var(--white); }
::-webkit-scrollbar-track { background: transparent; }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
h1, h2, h3 { margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--navy-900); text-underline-offset: 3px; text-decoration-color: var(--navy-300); }
a:hover { color: var(--navy-950); text-decoration-color: var(--navy-700); }
code, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---- página ---- */
/* minmax(0, 1fr): uma tabela larga rola dentro da própria caixa em vez de alargar a página inteira. */
.app { max-width: 1320px; margin: 0 auto; padding-inline: 24px; padding-block: 28px 56px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
body.embedded .app { max-width: none; padding-inline: 0; padding-block: 4px 24px; }
.app-header { display: grid; gap: 4px; }
.app-header h1 { font-size: 22px; font-weight: 650; color: var(--navy-950); }
.app-header p { color: var(--navy-600); max-width: 72ch; }

/* ---- botões ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 36px; padding: 0 14px; border-radius: var(--radius-control);
  border: 1px solid transparent; font-weight: 600; font-size: 13px; white-space: nowrap;
  transition: background-color .15s var(--ease-out), border-color .15s var(--ease-out), color .15s var(--ease-out), transform .1s var(--ease-out);
  text-decoration: none;
}
.btn i { font-size: 16px; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-navy { background: var(--navy-900); color: var(--white); }
.btn-navy:hover:not(:disabled) { background: var(--navy-800); color: var(--white); }
.btn-gold { background: var(--gold-500); color: var(--navy-950); }
.btn-gold:hover:not(:disabled) { background: var(--gold-600); }
.btn-ghost { background: var(--white); color: var(--navy-900); border-color: var(--navy-200); }
.btn-ghost:hover:not(:disabled) { border-color: var(--navy-300); background: var(--navy-50); }
.btn-quiet { background: transparent; color: var(--navy-600); padding: 0 8px; }
.btn-quiet:hover:not(:disabled) { color: var(--navy-900); background: var(--navy-50); }
.btn-danger-quiet { background: transparent; color: var(--red-600); padding: 0 8px; }
.btn-danger-quiet:hover { background: var(--red-100); }
.btn:disabled { background: var(--navy-100); color: var(--navy-500); border-color: transparent; }
.btn-small { min-height: 30px; padding: 0 10px; font-size: 12px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-control);
  border: 1px solid transparent; background: transparent; color: var(--navy-700); font-size: 17px;
  transition: background-color .15s var(--ease-out), color .15s var(--ease-out);
}
.icon-btn:hover:not(:disabled) { background: var(--navy-100); color: var(--navy-950); }
.icon-btn:disabled { color: var(--navy-300); }
.icon-btn.send:not(:disabled) { color: var(--navy-950); background: var(--gold-100); }
.icon-btn.send:hover:not(:disabled) { background: var(--gold-500); }
.link-btn { border: 0; background: none; padding: 0; color: var(--navy-700); font-size: 12.5px; font-weight: 550; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--navy-300); }
.link-btn:hover { color: var(--navy-950); text-decoration-color: var(--navy-700); }

/* ---- campos ---- */
.field { display: grid; gap: 6px; min-width: 0; }
.field-label { font-size: 12px; font-weight: 550; color: var(--navy-700); }
.field-hint { font-size: 12px; color: var(--navy-600); }
.input, .select, .textarea {
  width: 100%; min-width: 0; height: 38px; padding: 0 11px; border-radius: var(--radius-control);
  border: 1px solid var(--navy-200); background: var(--white); color: var(--navy-950);
  transition: border-color .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.textarea { height: auto; min-height: 88px; padding: 9px 11px; resize: vertical; }
.select { appearance: none; padding-right: 34px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%234F5388' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px 16px; }
.input::placeholder, .textarea::placeholder { color: var(--navy-500); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--navy-300); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--navy-900); box-shadow: 0 0 0 3px var(--navy-100); }
.input.mono { font-size: 13px; }
.select.open, .input.open { border-color: var(--navy-900); box-shadow: 0 0 0 3px var(--navy-100); }
.check { display: flex; gap: 9px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--navy-150); border-radius: var(--radius-control); cursor: pointer; transition: border-color .15s var(--ease-out), background-color .15s var(--ease-out); }
.check:hover { border-color: var(--navy-300); }
.check:has(input:checked) { border-color: var(--navy-300); background: var(--navy-50); }
.check input { margin: 2px 0 0; width: 15px; height: 15px; accent-color: var(--navy-900); flex-shrink: 0; }
.check strong { display: block; font-size: 13px; font-weight: 600; color: var(--navy-950); }
.check small { display: block; font-size: 12px; color: var(--navy-600); line-height: 1.4; margin-top: 2px; }
.check-inline { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--navy-700); cursor: pointer; margin-top: 2px; }
.check-inline input { width: 15px; height: 15px; margin: 0; accent-color: var(--navy-900); }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 550; color: var(--navy-800); }
.switch input { appearance: none; width: 30px; height: 18px; border-radius: 999px; background: var(--navy-200); position: relative; margin: 0; cursor: pointer; transition: background-color .15s var(--ease-out); }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--white); transition: transform .15s var(--ease-out); }
.switch input:checked { background: var(--navy-900); }
.switch input:checked::after { transform: translateX(12px); }

/* ---- menu suspenso ---- */
.menu {
  position: absolute; z-index: 50; overflow-y: auto; overscroll-behavior: contain; padding: 4px;
  background: var(--white); border: 1px solid var(--navy-150); border-radius: 10px;
  box-shadow: var(--shadow-float);
  animation: menu-in .14s var(--ease-out);
}
.menu.up { animation-name: menu-in-up; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes menu-in-up { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.menu-option { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 34px; padding: 7px 10px; border-radius: 6px; font-size: 13px; color: var(--navy-900); cursor: pointer; }
.menu-option span { overflow-wrap: anywhere; }
.menu-option.active { background: var(--navy-100); }
.menu-option.selected { font-weight: 600; color: var(--navy-950); }
.menu-option.selected i { color: var(--navy-900); font-size: 15px; flex-shrink: 0; }
.menu-option.disabled { color: var(--navy-300); cursor: default; }
.menu-empty { padding: 10px 12px; font-size: 12.5px; color: var(--navy-600); max-width: 320px; }

/* ---- chips de situação: sempre ícone + palavra ---- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px 0 7px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--navy-50); color: var(--navy-600);
}
.chip i { font-size: 14px; }
.chip.ready { background: var(--navy-100); color: var(--navy-900); }
.chip.attention { background: var(--gold-100); color: var(--gold-ink); }
.chip.danger { background: var(--red-100); color: var(--red-600); }
.chip.success { background: var(--green-100); color: var(--green-700); }
.chip.quiet { background: transparent; padding: 0; height: auto; color: var(--navy-600); font-weight: 500; }
.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- painéis ---- */
.panel { border: 1px solid var(--navy-150); border-radius: var(--radius-panel); background: var(--white); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-title { font-size: 14px; font-weight: 650; color: var(--navy-950); display: inline-flex; align-items: center; gap: 8px; }
.panel-title i { font-size: 18px; color: var(--navy-700); }
.muted { color: var(--navy-600); }
.small { font-size: 12px; }
.callout { display: flex; gap: 8px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--navy-50); color: var(--navy-800); font-size: 13px; }
.callout.attention { background: var(--gold-50); color: var(--gold-ink); }
.callout.danger { background: var(--red-100); color: var(--red-600); }
.callout.success { background: var(--green-100); color: var(--green-700); }

/* ---- tabelas ---- */
.table-scroll { overflow-x: auto; border: 1px solid var(--navy-150); border-radius: var(--radius-panel); }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--navy-600); background: var(--navy-50); padding: 9px 14px; border-bottom: 1px solid var(--navy-150); white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--navy-100); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Contexto de dados e recortes: usados por painéis e ferramentas da Central. */
.data-context, .metric-note { color: var(--navy-600); font-size: 12px; line-height: 1.55; }
.data-context { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; }
.data-context strong { color: var(--navy-800); font-weight: 600; }
.scope-summary { padding: 10px 0; color: var(--navy-700); font-size: 13px; border-block: 1px solid var(--navy-150); overflow-wrap: anywhere; }
.filter-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.filter-toolbar .field { flex: 1 1 160px; }
.filter-toolbar input, .filter-toolbar select { min-width: 0; }
.section-intro { display: grid; gap: 4px; margin-top: 10px; }
.section-intro h2 { font-size: 16px; font-weight: 650; }
.section-intro p { color: var(--navy-600); font-size: 13px; max-width: 75ch; }
.status-feedback { color: var(--navy-700); font-size: 13px; overflow-wrap: anywhere; }
.kpi-value, .stat strong { font-variant-numeric: tabular-nums; }

@media (max-width: 640px) {
  .app { padding-inline: 16px; }
  .filter-toolbar { align-items: stretch; }
  .filter-toolbar .field { flex-basis: 100%; }
  .btn, .input, .select { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
