html, body { min-height: 100%; }
body.hb-body {
  margin: 0;
  background: var(--hb-workspace-bg);
  color: var(--hb-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a,
a:hover,
a:focus,
a:active,
a:visited {
  text-decoration: none !important;
}
a { color: var(--hb-primary); }
::selection { background: rgba(var(--hb-primary-rgb), .22); }

.hb-icon { width: 21px; height: 21px; display: block; flex: 0 0 auto; }

.btn-primary {
  --tblr-btn-bg: var(--hb-primary);
  --tblr-btn-border-color: var(--hb-primary);
  --tblr-btn-hover-bg: var(--hb-primary-hover);
  --tblr-btn-hover-border-color: var(--hb-primary-hover);
}

.card {
  background: var(--hb-surface);
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius);
  box-shadow: var(--hb-shadow);
}

.form-control, .form-select {
  border-color: var(--hb-border-strong);
  border-radius: var(--hb-radius-sm);
}
.form-control:focus, .form-select:focus {
  border-color: rgba(var(--hb-primary-rgb), .7);
  box-shadow: 0 0 0 3px rgba(var(--hb-primary-rgb), .12);
}

/* Campos em edição — padrão Hubbly no tema escuro. */
html[data-bs-theme="dark"] .form-control:focus,
html[data-bs-theme="dark"] .form-select:focus,
html[data-bs-theme="dark"] .hb-form input:focus,
html[data-bs-theme="dark"] .hb-form select:focus,
html[data-bs-theme="dark"] .hb-form textarea:focus,
html[data-bs-theme="dark"] .hb-admin-user-form input:focus,
html[data-bs-theme="dark"] .hb-admin-user-form select:focus {
  background-color: var(--hb-input-focus-bg) !important;
  color: var(--hb-text) !important;
  border-color: rgba(var(--hb-primary-rgb), .72) !important;
  box-shadow: 0 0 0 3px rgba(var(--hb-primary-rgb), .12) !important;
  outline: none;
}


/* --------------------------------------------------------------------------
   ÍCONES GLOBAIS HUBBLY
   Todos os ícones servidos pelo registro central seguem a paleta do tema,
   igual à sidebar e ao menu principal. Evita cores próprias gravadas no SVG.
   -------------------------------------------------------------------------- */
.hb-file-icon {
  transition: filter .16s ease, opacity .16s ease;
}

/* Tema claro: azul-cinza padrão da navegação. */
html:not([data-bs-theme="dark"]) .hb-file-icon {
  filter: brightness(0) saturate(100%) invert(48%) sepia(12%) saturate(626%)
          hue-rotate(174deg) brightness(91%) contrast(86%);
  opacity: 1;
}

/* Tema escuro: ícones claros, seguindo sidebar/topbar. */
html[data-bs-theme="dark"] .hb-file-icon {
  filter: brightness(0) invert(1);
  opacity: .88;
}

/* Botões primários/áreas azuis sempre usam ícone branco. */
.btn-primary .hb-file-icon,
.hb-btn-primary .hb-file-icon,
[style*="--hb-primary"] > .hb-file-icon {
  filter: brightness(0) invert(1) !important;
  opacity: 1 !important;
}

/* Em hover, aumenta contraste sem introduzir uma cor fixa. */
button:hover .hb-file-icon,
a:hover .hb-file-icon {
  opacity: 1;
}

/* Lottie/SVG inline segue currentColor em toda a plataforma. */
.hb-lottie-icon,
.hb-lottie-icon__animation {
  color: inherit;
}
.hb-lottie-icon__animation svg [fill]:not([fill="none"]) {
  fill: currentColor !important;
}
.hb-lottie-icon__animation svg [stroke]:not([stroke="none"]) {
  stroke: currentColor !important;
}
html[data-bs-theme="dark"] .hb-lottie-icon__animation {
  color: #fff;
  opacity: .88;
}
html:not([data-bs-theme="dark"]) .hb-lottie-icon__animation {
  color: var(--hb-muted);
  opacity: 1;
}
.btn-primary .hb-lottie-icon__animation,
.hb-btn-primary .hb-lottie-icon__animation {
  color: #fff !important;
  opacity: 1 !important;
}
