/*!
 * ACIANF HUB — estilos (herda as variáveis do template Layout G quando presente)
 */
.acihub {
  --h-brand: var(--g-brand, #0F72BE);
  --h-navy: var(--g-navy, #0B3460);
  --h-accent: var(--g-accent, #1AA3E0);
  --h-green: var(--g-green, #00A06B);
  --h-gold: var(--g-gold, #FBBD17);
  --h-red: #C8322B;
  --h-ink: var(--g-ink, #1C1C24);
  --h-ink-2: var(--g-ink-2, #4A5563);
  --h-muted: var(--g-muted, #6B7685);
  --h-line: var(--g-line, #E2E8EF);
  --h-soft: var(--g-bg-soft, #F4F9FE);
  --h-soft-2: var(--g-bg-soft-2, #EAF3FB);
  --h-r: var(--g-radius, 8px);
  --h-r-lg: var(--g-radius-lg, 16px);
  font-family: var(--g-font, Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif);
  color: var(--h-ink);
  line-height: 1.55;
}
.acihub *, .acihub *::before, .acihub *::after { box-sizing: border-box; }
.acihub [hidden] { display: none !important; }

.acihub-member, .acihub-nlpage { max-width: 1180px; margin: 0 auto; padding: clamp(28px, 5vw, 56px) 0 clamp(48px, 6vw, 80px); }

/* Cabeçalho */
.acihub-head { margin-bottom: 28px; }
.acihub-kicker { margin: 0 0 6px; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--h-brand); }
.acihub-title { margin: 0 0 8px; font-size: clamp(1.9rem, 3.6vw, 2.6rem); line-height: 1.12; font-weight: 800; color: var(--h-navy); letter-spacing: -.01em; }
.acihub-lead { margin: 0; max-width: 62ch; font-size: 1.06rem; color: var(--h-ink-2); }

/* Cartões e passos */
.acihub-card { position: relative; background: #fff; border: 1px solid var(--h-line); border-radius: var(--h-r-lg); padding: clamp(20px, 3vw, 32px); box-shadow: 0 1px 2px rgb(11 52 96 / .04), 0 8px 24px -12px rgb(11 52 96 / .12); }
.acihub-card h2 { margin: 0 0 6px; font-size: 1.22rem; font-weight: 750; color: var(--h-navy); }
.acihub-step.acihub-card { max-width: 560px; padding-left: clamp(64px, 8vw, 84px); }
.acihub-stepno { position: absolute; left: clamp(20px, 3vw, 28px); top: clamp(20px, 3vw, 30px); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--h-soft-2); color: var(--h-brand); font-weight: 800; }
.acihub-help { margin: 0 0 18px; color: var(--h-ink-2); }
.acihub-note { margin: 16px 0 0; font-size: .84rem; color: var(--h-muted); }

/* Campos */
.acihub-field { display: grid; gap: 6px; margin: 0 0 16px; }
.acihub-field > span { font-size: .84rem; font-weight: 650; color: var(--h-ink-2); }
.acihub-field input, .acihub-filters select, .acihub-filters input {
  width: 100%; min-height: 46px; padding: 10px 14px; font: inherit; color: var(--h-ink);
  background: #fff; border: 1px solid #C9D4E0; border-radius: var(--h-r); transition: border-color .15s, box-shadow .15s;
}
.acihub-field input:focus, .acihub-filters select:focus, .acihub-filters input:focus { outline: 0; border-color: var(--h-brand); box-shadow: 0 0 0 3px rgb(15 114 190 / .18); }
.acihub-field--code input { max-width: 220px; font-size: 1.5rem; font-weight: 700; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }

/* Botões */
.acihub-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.acihub-actions--center { justify-content: center; margin-top: 18px; }
.acihub-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 20px;
  font: inherit; font-weight: 700; font-size: .95rem; line-height: 1.1; text-decoration: none; white-space: nowrap;
  border: 1.5px solid transparent; border-radius: 999px; cursor: pointer; transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.acihub-btn:active { transform: translateY(1px); }
.acihub-btn:disabled { opacity: .55; cursor: not-allowed; }
.acihub-btn--primary, .acihub a.acihub-btn--primary, .acihub a.acihub-btn--primary:visited { background: var(--h-brand); color: #fff; text-decoration: none; }
.acihub-btn--primary:hover:not(:disabled), .acihub a.acihub-btn--primary:hover { background: var(--h-navy); color: #fff; }
.acihub-btn--ghost, .acihub a.acihub-btn--ghost, .acihub a.acihub-btn--ghost:visited { background: #fff; color: var(--h-navy); border-color: #C9D4E0; text-decoration: none; }
.acihub-btn--ghost:hover:not(:disabled) { border-color: var(--h-brand); color: var(--h-brand); }
.acihub-btn--sm { min-height: 34px; padding: 6px 14px; font-size: .84rem; }
.acihub-link { padding: 4px 2px; font: inherit; font-size: .9rem; color: var(--h-brand); background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.acihub-btn:focus-visible, .acihub-link:focus-visible, .acihub-account:focus-visible { outline: 3px solid rgb(15 114 190 / .35); outline-offset: 2px; }

/* Mensagens */
.acihub-msg { margin: 0 0 18px; padding: 12px 16px; border-radius: var(--h-r); font-size: .94rem; border: 1px solid; }
.acihub-msg--info { background: var(--h-soft); border-color: var(--h-soft-2); color: var(--h-navy); }
.acihub-msg--ok { background: #E8F7F1; border-color: #BFE8D7; color: #06623F; }
.acihub-msg--error { background: #FDECEB; border-color: #F5C6C2; color: #8E1F19; }
.acihub-alert { padding: 16px 20px; border-radius: var(--h-r); }
.acihub-alert--warn { background: #FFF7E0; border: 1px solid #F6DD93; color: #6B4E00; }

/* Seleção de empresa */
.acihub-accounts { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.acihub-account {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; width: 100%; padding: 14px 18px; text-align: left;
  font: inherit; color: var(--h-ink); background: #fff; border: 1px solid var(--h-line); border-radius: var(--h-r); cursor: pointer; transition: border-color .15s, background .15s;
}
.acihub-account:hover { border-color: var(--h-brand); background: var(--h-soft); }
.acihub-account strong { color: var(--h-navy); }
.acihub-account span { grid-column: 1; font-size: .85rem; color: var(--h-muted); }
.acihub-account em { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-style: normal; font-weight: 700; font-size: .85rem; color: var(--h-brand); }

/* Painel */
.acihub-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; padding: 18px 22px; color: #fff; background: linear-gradient(120deg, var(--h-navy), var(--h-brand)); border-radius: var(--h-r-lg); }
.acihub-company { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.acihub-company__label { width: 100%; font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .75; }
.acihub-company strong { font-size: 1.25rem; }
.acihub-badge { padding: 3px 10px; font-size: .74rem; font-weight: 700; color: var(--h-navy); background: var(--h-gold); border-radius: 999px; }
.acihub-bar__actions { display: flex; gap: 8px; }
.acihub-bar .acihub-btn--ghost { color: #fff; background: rgb(255 255 255 / .08); border-color: rgb(255 255 255 / .45); }
.acihub-bar .acihub-btn--ghost:hover { color: var(--h-navy); background: #fff; border-color: #fff; }

.acihub-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.acihub-kpi { padding: 16px 20px; background: #fff; border: 1px solid var(--h-line); border-left: 4px solid var(--h-brand); border-radius: var(--h-r); }
.acihub-kpi span { display: block; font-size: .8rem; font-weight: 650; color: var(--h-muted); }
.acihub-kpi strong { display: block; margin-top: 4px; font-size: 1.45rem; font-weight: 800; color: var(--h-navy); font-variant-numeric: tabular-nums; }
.acihub-kpi--warn { border-left-color: var(--h-gold); }
.acihub-kpi--bad { border-left-color: var(--h-red); }
.acihub-kpi--ok { border-left-color: var(--h-green); }

.acihub-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
.acihub-dues__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 20px; margin-bottom: 14px; }
.acihub-dues__head h2 { margin: 0; }
.acihub-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.acihub-filters label { display: grid; gap: 2px; flex: 0 1 auto; font-size: .74rem; font-weight: 650; color: var(--h-muted); }
.acihub-filters select, .acihub-filters input { width: auto; min-height: 38px; padding: 6px 10px; font-size: .88rem; }
.acihub-filters input[type=date] { width: 150px; }

.acihub-table-wrap { overflow-x: auto; }
.acihub-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.acihub-table th { padding: 10px 12px; font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--h-muted); text-align: left; border-bottom: 2px solid var(--h-line); white-space: nowrap; }
.acihub-table td { padding: 12px 10px; border-bottom: 1px solid var(--h-line); vertical-align: middle; white-space: nowrap; }
.acihub-table tbody tr:hover { background: var(--h-soft); }
.acihub-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.acihub-table .act { text-align: right; padding-right: 4px; }
.acihub-table td.act { white-space: nowrap; }
.acihub-table .act .acihub-btn + .acihub-btn { margin-left: 4px; }
.acihub-table .act .acihub-btn { padding-inline: 12px; }
.acihub-table small { display: block; margin-top: 2px; font-size: .78rem; color: var(--h-muted); }
.acihub.is-loading .acihub-table tbody { opacity: .5; }
.acihub-empty { margin: 18px 0 0; text-align: center; color: var(--h-muted); }

.acihub-pill { display: inline-block; padding: 3px 10px; font-size: .76rem; font-weight: 700; border-radius: 999px; background: #EEF1F5; color: var(--h-ink-2); }
.acihub-pill--open { background: #FFF4D6; color: #7A5600; }
.acihub-pill--overdue { background: #FDE3E1; color: #9B231C; }
.acihub-pill--partially_paid { background: #FFF0E0; color: #8A4B00; }
.acihub-pill--paid { background: #DFF5EC; color: #06623F; }
.acihub-pill--negotiating, .acihub-pill--negotiated { background: var(--h-soft-2); color: var(--h-brand); }

.acihub-profile dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 28px; margin: 14px 0 0; }
.acihub-profile dl > div { min-width: 0; }
.acihub-profile dl > div.is-wide { grid-column: 1 / -1; }
.acihub-profile dt { margin: 0 0 2px; font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--h-muted); }
.acihub-profile dd { margin: 0; color: var(--h-ink); overflow-wrap: anywhere; }

/* Newsletter */
.acihub-nl__title { margin: 0 0 6px; font-size: 1.3rem; font-weight: 800; color: inherit; }
.acihub-nl__intro { margin: 0 0 16px; opacity: .85; }
.acihub-nl__row { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.acihub-nl__row .acihub-field { flex: 1 1 220px; margin: 0; }
.acihub-nl__row .acihub-field--code { flex: 0 1 220px; }
.acihub-nl__row .acihub-btn { min-height: 46px; }
.acihub-check { display: flex; align-items: flex-start; gap: 10px; margin: 14px 0 0; font-size: .86rem; color: var(--h-ink-2); cursor: pointer; }
.acihub-check input { flex: none; width: 18px; height: 18px; margin-top: 2px; accent-color: var(--h-brand); }
.acihub-check a { color: var(--h-brand); }
.acihub-nl .acihub-msg { margin: 14px 0 0; }
.acihub-nl .acihub-link { margin-top: 10px; }
.acihub-nl__done { padding: 16px 18px; font-weight: 650; color: #06623F; background: #E8F7F1; border: 1px solid #BFE8D7; border-radius: var(--h-r); }
.acihub-nl__switch { margin: 18px 0 0; font-size: .86rem; }
.acihub-nl__switch a { color: var(--h-muted); }
.acihub-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Variante compacta sobre fundo escuro (faixa de newsletter da home) */
.acihub-nl--compact { color: inherit; }
.acihub-nl--compact .acihub-field > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.acihub-nl--compact .acihub-nl__row { align-items: stretch; }
.acihub-nl--dark .acihub-check, .acihub-nl--dark .acihub-help, .acihub-nl--dark .acihub-nl__switch a { color: rgb(255 255 255 / .82); }
.acihub-nl--dark .acihub-check a, .acihub-nl--dark .acihub-link { color: #fff; }
.acihub-nl--dark .acihub-field input { border-color: transparent; }
.acihub-nl--dark .acihub-btn--primary { background: var(--h-gold); color: var(--h-navy); }
.acihub-nl--dark .acihub-btn--primary:hover:not(:disabled) { background: #fff; color: var(--h-navy); }

/* Integração com o template Layout G (faixa #newsletter da home):
   mantém a chamada do template ao lado do formulário. */
.g-newsletter__in.has-module:has(.acihub-nl) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
.g-newsletter__in.has-module:has(.acihub-nl) .g-newsletter__intro { display: block; }
.g-newsletter .acihub-nl .acihub-field input { border-color: #C9D4E0; }
.acihub.acihub-nl p.acihub-nl__switch { margin-top: 12px; }
.acihub.acihub-nl p.acihub-msg { margin-top: 14px; }
.acihub.acihub-nl p.acihub-help { margin-bottom: 12px; }
@media (max-width: 960px) { .g-newsletter__in.has-module:has(.acihub-nl) { grid-template-columns: minmax(0, 1fr); } }

.acihub .visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 640px) {
  .acihub-kpis { grid-template-columns: minmax(0, 1fr); }
  .acihub-step.acihub-card { padding-left: 20px; padding-top: 64px; }
  .acihub-table thead { display: none; }
  .acihub-table, .acihub-table tbody, .acihub-table tr, .acihub-table td { display: block; width: 100%; }
  .acihub-table tr { padding: 12px 0; border-bottom: 1px solid var(--h-line); }
  .acihub-table td { display: flex; justify-content: space-between; gap: 12px; padding: 4px 4px; border: 0; white-space: normal; }
  .acihub-table td::before { content: attr(data-th); font-size: .76rem; font-weight: 700; color: var(--h-muted); text-transform: uppercase; }
  .acihub-table .act { justify-content: flex-end; padding-top: 10px; }
  .acihub-table .act::before { content: none; }
}
@media (prefers-reduced-motion: reduce) { .acihub * { transition: none !important; } }
