/* =====================================================================
   HOMOLOGA – interface
   Cores, fonte e cantos vêm de theme.php (Admin > Personalização).
   1. Base e tema escuro      5. Rodapé e carregamento
   2. Menu lateral            6. Componentes do sistema
   3. Topo colorido e onda    7. Telas de acesso
   4. Conteúdo                8. Personalização e configurações
   ===================================================================== */

:root {
  --sidebar-w: 232px;
  --sidebar-w-collapsed: 76px;
  --c-card-bg: #ffffff;
  --c-border: rgba(20, 35, 40, .08);
  --c-text: #1d2a2e;
  --c-muted: #5f6f75;
  --c-soft: #eef2f3;
  --shadow: 0 1px 2px rgba(15, 35, 40, .04), 0 6px 18px rgba(15, 35, 40, .05);
  --shadow-lg: 0 14px 40px rgba(15, 35, 40, .18);
}
[data-bs-theme="dark"] {
  --c-bg: #13181a !important;
  --c-sidebar: #1a2023 !important;
  --c-sidebar-text: #d6dfe2 !important;
  --c-sidebar-text-rgb: 214, 223, 226 !important;
  --c-card-bg: #1d2427;
  --c-border: rgba(255, 255, 255, .07);
  --c-text: #e7eef0;
  --c-muted: #9eadb3;
  --c-soft: #263033;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35);
  --bs-body-bg: #13181a;
  --bs-body-color: #e7eef0;
  --bs-tertiary-bg: #1d2427;
  --bs-link-color: var(--c-primary-light);
  --bs-link-hover-color: #fff;
}
[data-bs-theme="dark"] .text-primary, [data-bs-theme="dark"] .hm-sub-link.active, [data-bs-theme="dark"] .nav-tabs .nav-link.active { color: var(--c-primary-light) !important; }
[data-bs-theme="dark"] .nav-tabs .nav-link.active { border-bottom-color: var(--c-primary-light); }
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: var(--c-primary-light); --bs-btn-border-color: var(--c-primary-light); }
[data-bs-theme="dark"] .hm-avatar { background: var(--c-card-bg); color: #fff; }

html, body { min-height: 100%; }
body.hm { font-family: var(--font); background: var(--c-bg); color: var(--c-text); font-size: .9rem; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; }
:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }
.min-w-0 { min-width: 0; }
.text-primary { color: var(--c-primary) !important; }
.text-muted, .text-body-secondary { color: var(--c-muted) !important; }
.help { color: var(--c-muted); font-size: .85rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .84rem; word-break: break-all; }
.btn { font-weight: 600; border-radius: var(--radius-sm); }
.btn-ghost { background: var(--c-soft); color: var(--c-text); border: 0; }
.btn-ghost:hover { background: rgba(var(--c-primary-rgb), .12); color: var(--c-primary); }
.form-control, .form-select { border-radius: var(--radius-sm); }
.form-label { font-weight: 600; font-size: .86rem; margin-bottom: 4px; }
.form-text { color: var(--c-muted); }

/* ------------------------------------------------------------ 2. menu lateral */
.hm-sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--c-sidebar); color: var(--c-sidebar-text);
  border-right: 1px solid rgba(var(--c-sidebar-text-rgb), .08); display: flex; flex-direction: column; z-index: 1040; transition: width .2s ease, transform .25s ease; }
.hm-brand { height: 78px; display: flex; align-items: center; justify-content: center; padding: 10px 18px; flex-shrink: 0; }
.hm-brand-logo { max-height: 56px; max-width: 100%; object-fit: contain; }
.hm-brand-icon { display: none; width: 40px; height: 40px; object-fit: contain; }
.hm-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 6px 10px; scrollbar-width: thin; }
.hm-nav-item { margin-bottom: 4px; }
.hm-nav-link { display: flex; align-items: center; gap: 11px; width: 100%; border: 0; background: transparent; color: var(--c-sidebar-text);
  padding: 6px 8px; border-radius: var(--radius); font-weight: 500; font-size: .86rem; text-align: left; transition: background .15s; }
.hm-nav-link:hover { background: rgba(var(--c-sidebar-text-rgb), .06); color: var(--c-sidebar-text); }
.hm-nav-icon { position: relative; width: 32px; height: 32px; flex-shrink: 0; border-radius: calc(var(--radius-sm) + 1px); background: rgba(var(--c-sidebar-text-rgb), .07);
  display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; color: rgba(var(--c-sidebar-text-rgb), .78); transition: background .15s, color .15s; }
.hm-nav-dot { position: absolute; top: -2px; right: -2px; width: 9px; height: 9px; border-radius: 50%; background: var(--c-secondary); box-shadow: 0 0 0 2px var(--c-sidebar); }
.hm-nav-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-caret { font-size: .7rem; opacity: .6; transition: transform .2s; }
.hm-nav-item.open > .hm-nav-link .hm-caret { transform: rotate(180deg); }
.hm-nav-item.active > .hm-nav-link { background: var(--c-primary-soft); color: var(--c-primary); font-weight: 600; }
[data-bs-theme="dark"] .hm-nav-item.active > .hm-nav-link { color: #fff; background: rgba(var(--c-primary-rgb), .35); }
.hm-nav-item.active > .hm-nav-link .hm-nav-icon { background: var(--c-primary); color: var(--c-on-primary); }
.hm-sub { display: none; padding: 4px 0 6px 22px; }
.hm-nav-item.open > .hm-sub { display: block; }
.hm-sub-label { display: none !important; }
.hm-sub-title { display: none; }
.hm-sub-link { display: flex; align-items: center; gap: 9px; padding: 7px 10px 7px 14px; color: rgba(var(--c-sidebar-text-rgb), .86); font-size: .84rem;
  border-left: 2px solid rgba(var(--c-sidebar-text-rgb), .12); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.hm-sub-link i { font-size: .92rem; opacity: .7; }
.hm-sub-link:hover { color: var(--c-primary); background: rgba(var(--c-sidebar-text-rgb), .04); }
.hm-sub-link.active { color: var(--c-primary); font-weight: 600; border-left-color: var(--c-primary); background: var(--c-primary-soft); }
[data-bs-theme="dark"] .hm-sub-link.active, [data-bs-theme="dark"] .hm-sub-link:hover { color: #fff; }
.hm-count { margin-left: auto; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 9px; background: var(--c-secondary); color: var(--c-on-secondary);
  font-size: .68rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.hm-collapse { border: 0; border-top: 1px solid rgba(var(--c-sidebar-text-rgb), .08); background: transparent; color: var(--c-sidebar-text); height: 54px;
  display: flex; align-items: center; gap: 12px; padding: 0 24px; font-weight: 500; font-size: .84rem; flex-shrink: 0; }
.hm-collapse:hover { color: var(--c-primary); }
.hm-collapse i { transition: transform .2s; }
/* recolhido: só ícones e submenus flutuantes */
.sidebar-collapsed .hm-sidebar { width: var(--sidebar-w-collapsed); }
.sidebar-collapsed .hm-brand-logo { display: none; }
.sidebar-collapsed .hm-brand-icon { display: block; }
.sidebar-collapsed .hm-nav { overflow: visible; padding: 6px 14px; }
.sidebar-collapsed .hm-nav-link { justify-content: center; padding: 6px; }
.sidebar-collapsed .hm-nav-label, .sidebar-collapsed .hm-caret, .sidebar-collapsed .hm-collapse span, .sidebar-collapsed .hm-nav-link > .hm-count { display: none; }
.sidebar-collapsed .hm-collapse { justify-content: center; padding: 0; }
.sidebar-collapsed .hm-collapse i { transform: rotate(180deg); }
.sidebar-collapsed .hm-nav-item.open > .hm-sub { display: none; }
.sidebar-collapsed .hm-nav-item > .hm-sub { position: fixed; left: calc(var(--sidebar-w-collapsed) - 4px); min-width: 220px; padding: 8px; background: var(--c-sidebar);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); border: 1px solid rgba(var(--c-sidebar-text-rgb), .08); z-index: 1060; }
.sidebar-collapsed .hm-nav-item > .hm-sub::before { content: ""; position: absolute; left: -12px; top: 0; bottom: 0; width: 14px; }
.sidebar-collapsed .hm-nav-item.flyout > .hm-sub { display: block !important; animation: hmFly .14s ease-out; }
.sidebar-collapsed .hm-sub-title { display: block; font-weight: 700; font-size: .82rem; padding: 4px 10px 8px; color: var(--c-sidebar-text); }
.sidebar-collapsed .hm-sub-label .hm-sub-title { padding: 2px 6px; }
.sidebar-collapsed .hm-sub-link { border-left: 0; border-radius: var(--radius-sm); padding-left: 10px; }
@keyframes hmFly { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.hm-backdrop { display: none; }

/* ------------------------------------------------------------ 3. topo colorido */
.hm-main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left .2s ease; }
.sidebar-collapsed .hm-main { margin-left: var(--sidebar-w-collapsed); }
.hm-impersonate { position: sticky; top: 0; z-index: 1050; background: var(--c-warning); color: #fff; text-align: center; padding: 6px; font-size: .86rem; }
.hm-impersonate a { color: #fff; text-decoration: underline; margin-left: 8px; }
.hm-hero { position: relative; z-index: 1025; background: linear-gradient(180deg, var(--c-primary) 0%, var(--c-primary-deep) 100%); color: var(--c-hero-text); padding: 12px 34px 0; }
.hero-full .hm-hero { min-height: 220px; padding-bottom: 58px; }
.hero-page .hm-hero { padding-bottom: 46px; }
.hero-mini .hm-hero { padding-bottom: 24px; }
.hm-hero-deco { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.hm-wave { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 42px; display: block; }
.hm-wave .w1 { fill: var(--c-secondary); }
.hm-wave .w2 { fill: var(--c-accent); }
.hm-wave .wb { fill: var(--c-bg); }
.hm-hero-line { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: linear-gradient(180deg, var(--c-secondary) 0 55%, var(--c-accent) 55% 100%); }
.hm-topbar { display: flex; align-items: center; gap: 12px; position: relative; z-index: 6; } /* acima do título e dos botões do topo: os menus suspensos abrem por cima */
.hm-search { flex: 1; max-width: 480px; display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .14); border-radius: 999px; padding: 0 6px 0 14px; height: 38px; }
.hm-search:focus-within { background: rgba(255, 255, 255, .22); box-shadow: 0 0 0 2px rgba(255, 255, 255, .35); }
.hm-search i { opacity: .85; }
.hm-search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--c-hero-text); font-size: .86rem; outline: none; }
.hm-search input::placeholder { color: var(--c-hero-text); opacity: .72; }
.hm-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.hm-round { position: relative; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .15); color: var(--c-hero-text);
  display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; transition: background .15s; }
.hm-round:hover, .hm-round[aria-expanded="true"] { background: rgba(255, 255, 255, .28); color: var(--c-hero-text); }
.hm-dot { position: absolute; top: -3px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--c-secondary); color: var(--c-on-secondary);
  font-size: .62rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--c-primary); }
.hm-avatar { width: 38px; height: 38px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .85); background: #fff; color: var(--c-primary); font-weight: 700; font-size: .8rem; padding: 0; overflow: hidden; }
.hm-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hm-av { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; object-fit: cover; background: var(--c-primary-soft); color: var(--c-primary); font-weight: 700; font-size: .8rem; display: inline-flex; align-items: center; justify-content: center; }
.hm-av.sm { width: 30px; height: 30px; font-size: .7rem; }
.hm-photo { position: relative; width: 116px; height: 116px; flex-shrink: 0; }
.hm-photo > img, .hm-photo-initials { width: 116px; height: 116px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 4px var(--c-card-bg), 0 0 0 6px rgba(var(--c-primary-rgb), .25); }
.hm-photo-initials { display: flex; align-items: center; justify-content: center; background: var(--c-primary-soft); color: var(--c-primary); font-size: 2.2rem; font-weight: 800; }
.hm-photo-btn-wrap { position: absolute; right: 0; bottom: 2px; }
.hm-photo-btn { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--c-card-bg); background: var(--c-primary); color: var(--c-on-primary); display: inline-flex; align-items: center; justify-content: center; }
.hm-cam { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 1 / 1; }
.hm-cam video, .hm-cam canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.hm-cam video { transform: scaleX(-1); }
.hm-cam-guide { position: absolute; inset: 12%; border: 3px dashed rgba(255, 255, 255, .75); border-radius: 50%; pointer-events: none; }
.hm-cam canvas:not(.d-none) + .hm-cam-guide { display: none; }
.hm-dropdown { border: 1px solid var(--c-border); box-shadow: var(--shadow-lg); border-radius: var(--radius); padding: 6px; min-width: 250px; font-size: .86rem; }
.hm-dropdown .dropdown-item { border-radius: var(--radius-sm); padding: 7px 10px; }
.hm-hero-body { position: relative; z-index: 2; padding: 24px 0 6px; max-width: calc(100% - 200px); }
.hm-greeting { font-weight: 800; font-style: var(--title-style); font-size: clamp(1.9rem, 3.2vw, 2.6rem); letter-spacing: -.02em; margin: 0 0 6px; line-height: 1.1; }
.hm-hero-sub { margin: 0 0 12px; opacity: .92; font-size: .88rem; }
.hm-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.hm-pill { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .16); border-radius: 999px; padding: 4px 11px; font-size: .74rem; font-weight: 600; }
.hm-hero-mark { position: absolute; right: 38px; top: 60px; width: 150px; height: 124px; object-fit: contain; opacity: .95; }
.hm-hero-mark.to-white { filter: brightness(0) invert(1) drop-shadow(0 6px 14px rgba(0, 0, 0, .18)); opacity: 1; }
.hm-hero-page { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: none; padding-top: 20px; flex-wrap: wrap; }
.hm-page-title { font-weight: 800; font-style: var(--title-style); font-size: 1.7rem; margin: 0; letter-spacing: -.015em; line-height: 1.15; }
.hm-hero-icon { width: 48px; height: 48px; border-radius: var(--radius); background: rgba(255, 255, 255, .16); display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem; flex-shrink: 0; }
.hm-crumbs { font-size: .76rem; opacity: .88; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hm-crumbs a { color: inherit; }
.hm-crumbs a:hover { text-decoration: underline; }
.hm-crumbs i { font-size: .6rem; }
.hm-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; position: relative; z-index: 2; }
.hm-hero-actions .btn-light { color: var(--c-primary); border: 0; }
.hm-hero-actions .btn-ghost { background: rgba(255, 255, 255, .16); color: var(--c-hero-text); }

/* ------------------------------------------------------------ 4. conteúdo */
.hm-content { flex: 1; padding: 6px 34px 36px; } /* sem z-index: os modais precisam ficar acima do topo */
.hero-full .hm-content, .hero-page .hm-content { margin-top: 0; }

/* ------------------------------------------------------------ 5. rodapé e carregamento */
.hm-footer { display: flex; align-items: center; gap: 18px; padding: 10px 34px; background: var(--c-card-bg); border-top: 1px solid var(--c-border); font-size: .8rem; flex-wrap: wrap; }
.hm-footer-brand { display: flex; align-items: center; gap: 8px; }
.hm-footer-brand img { width: 24px; height: 24px; object-fit: contain; }
.hm-version { background: var(--c-soft); border-radius: 6px; padding: 1px 6px; font-size: .7rem; color: var(--c-muted); }
.hm-footer-text { color: var(--c-muted); }
.hm-chip { border: 0; background: var(--c-soft); color: var(--c-text); border-radius: 999px; padding: 4px 10px; font-size: .78rem; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.hm-chip i { color: var(--c-secondary); }
.hm-chip-count { background: rgba(var(--c-sidebar-text-rgb), .12); border-radius: 9px; padding: 0 6px; font-size: .7rem; }
.hm-chip-count.has { background: var(--c-danger); color: #fff; }
.hm-alerts { min-width: 320px; max-height: 60vh; overflow: auto; }
.hm-footer-stats { display: flex; gap: 16px; color: var(--c-muted); margin-left: auto; }
.hm-footer-stats b { color: var(--c-text); }
.hm-footer-year { color: var(--c-muted); }
.hm-loader { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; background: rgba(var(--c-primary-rgb), .08); backdrop-filter: blur(1px);
  opacity: 0; visibility: hidden; transition: opacity .18s, visibility .18s; }
.hm-loader.show { opacity: 1; visibility: visible; }
.hm-loader.is-boot { opacity: 1; visibility: visible; background: var(--c-bg); animation: hmBoot .01s 3s forwards; }
@keyframes hmBoot { to { opacity: 0; visibility: hidden; } }
.hm-loader-box { position: relative; width: 84px; height: 84px; }
.hm-loader-ring { width: 84px; height: 84px; animation: hmSpin 1s linear infinite; }
.hm-loader-ring circle { fill: none; stroke-width: 6; }
.hm-loader-ring .track { stroke: rgba(var(--c-primary-rgb), .14); }
.hm-loader-ring .arc { stroke: var(--c-primary); stroke-linecap: round; stroke-dasharray: 90 190; }
.hm-loader-icon { position: absolute; inset: 20px; width: 44px; height: 44px; object-fit: contain; }
@keyframes hmSpin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ 6. componentes */
.panel { background: var(--c-card-bg); border: 1px solid var(--c-border); border-radius: var(--radius); margin-bottom: 20px; box-shadow: var(--shadow); }
.panel-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--c-border); flex-wrap: wrap; }
.panel-h h2, .panel-h h3 { font-size: 1rem; font-weight: 700; margin: 0; display: inline-flex; align-items: center; gap: 8px; }
.panel-b { padding: 18px; }
.panel-b.p0 { padding: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { background: var(--c-card-bg); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: rgba(var(--c-primary-rgb), .25); }
.kpi .v { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.kpi .l { color: var(--c-muted); font-size: .84rem; margin-top: 4px; }
.kpi.good::before { background: var(--c-success); } .kpi.good .v { color: var(--c-success); }
.kpi.warn::before { background: var(--c-warning); } .kpi.warn .v { color: var(--c-warning); }
.kpi.bad::before { background: var(--c-danger); } .kpi.bad .v { color: var(--c-danger); }
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > thead th { font-size: .78rem; color: var(--c-muted); font-weight: 600; white-space: nowrap; border-bottom-width: 1px; }
.table td { vertical-align: middle; }
.dt-container { padding: 14px 16px; }
.empty { padding: 34px 18px; text-align: center; color: var(--c-muted); }
.empty i { font-size: 2rem; display: block; margin-bottom: 8px; opacity: .55; }
.list-group-item { background: transparent; }

.st { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; font-size: .8rem; padding: 2px 9px; border-radius: 30px; white-space: nowrap; }
.st-ok { background: rgba(var(--c-success-rgb), .14); color: var(--c-success); }
.st-pend { background: rgba(var(--c-warning-rgb), .16); color: var(--c-warning); }
.st-fiscal { background: rgba(var(--c-danger-rgb), .13); color: var(--c-danger); }
.st-info { background: var(--c-soft); color: var(--c-muted); }
[data-bs-theme="dark"] .st-ok, [data-bs-theme="dark"] .st-pend, [data-bs-theme="dark"] .st-fiscal { filter: brightness(1.35); }
.rg { display: inline-block; font-weight: 600; font-size: .78rem; padding: 2px 9px; border-radius: 4px; border: 1px solid; }
.rg-mei { color: #8a5300; border-color: #e8c98d; background: #fdf6e8; }
.rg-simples { color: #1f5b86; border-color: #b7d3e8; background: #eef6fc; }
.rg-geral { color: #2f5a3d; border-color: #bcd7c4; background: #eff7f1; }
.rg-ind { color: var(--c-muted); border-color: var(--c-border); background: var(--c-soft); }
[data-bs-theme="dark"] .rg-mei { color: #f5c979; background: rgba(245, 201, 121, .1); border-color: rgba(245, 201, 121, .3); }
[data-bs-theme="dark"] .rg-simples { color: #8ec4ee; background: rgba(142, 196, 238, .1); border-color: rgba(142, 196, 238, .3); }
[data-bs-theme="dark"] .rg-geral { color: #9fd8b0; background: rgba(159, 216, 176, .1); border-color: rgba(159, 216, 176, .3); }
.fs { display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 9px; border-radius: 30px; }
.fs-analise { background: var(--c-soft); color: var(--c-muted); }
.fs-fiscal { background: rgba(var(--c-danger-rgb), .13); color: var(--c-danger); }
.fs-ok { background: rgba(var(--c-success-rgb), .14); color: var(--c-success); }
.fs-rep { background: #3a1f1d; color: #fff; }
.fs-inativo { background: var(--c-soft); color: var(--c-muted); opacity: .8; }
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 30px; padding: 5px 12px; font-size: .84rem; font-weight: 600; }

/* Dossiê do fornecedor */
.dossie-head { display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: center; background: var(--c-card-bg); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; box-shadow: var(--shadow); }
.seal { width: 112px; height: 112px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; border: 3px solid currentColor;
  box-shadow: inset 0 0 0 5px var(--c-card-bg), inset 0 0 0 6px currentColor; font-weight: 700; line-height: 1.1; padding: 10px; transform: rotate(-6deg); }
.seal i { font-size: 1.7rem; margin-bottom: 4px; }
.seal span { font-size: .8rem; }
.seal.apto { color: var(--c-success); background: rgba(var(--c-success-rgb), .1); }
.seal.pendente { color: var(--c-warning); background: rgba(var(--c-warning-rgb), .12); }
.seal.fiscal { color: var(--c-danger); background: rgba(var(--c-danger-rgb), .1); }
.dossie-head h2 { font-size: 1.45rem; font-weight: 800; margin: 0 0 4px; letter-spacing: -.02em; }
.dossie-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--c-muted); font-size: .9rem; align-items: center; }
.rail { display: grid; grid-template-columns: repeat(5, 1fr); margin-bottom: 18px; background: var(--c-card-bg); border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.rail a { display: flex; gap: 10px; align-items: flex-start; padding: 14px; color: var(--c-text); border-right: 1px solid var(--c-border); }
.rail a:last-child { border-right: 0; }
.rail a:hover { background: var(--c-soft); }
.rail .n { flex: 0 0 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; border: 2px solid var(--c-border); color: var(--c-muted); background: var(--c-card-bg); }
.rail .t { font-weight: 600; font-size: .9rem; line-height: 1.2; }
.rail .s { font-size: .78rem; margin-top: 3px; }
.rail .ok .n { border-color: var(--c-success); background: var(--c-success); color: #fff; }
.rail .pendente .n { border-color: var(--c-warning); color: var(--c-warning); }
.rail .fiscal .n { border-color: var(--c-danger); background: var(--c-danger); color: #fff; }
.rail .ok .s { color: var(--c-success); } .rail .pendente .s { color: var(--c-warning); } .rail .fiscal .s { color: var(--c-danger); } .rail .info .s { color: var(--c-muted); }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--c-border); }
.checklist li:last-child { border-bottom: 0; }
.checklist .ic { flex: 0 0 22px; font-size: 1.05rem; line-height: 1.3; }
.checklist .ok .ic { color: var(--c-success); } .checklist .pendente .ic { color: var(--c-warning); } .checklist .fiscal .ic { color: var(--c-danger); } .checklist .info .ic { color: var(--c-muted); }
.checklist .ref { display: block; color: var(--c-muted); font-size: .78rem; margin-top: 2px; }
.nav-tabs { border-bottom: 1px solid var(--c-border); gap: 2px; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; }
.nav-tabs .nav-link { color: var(--c-muted); font-weight: 600; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 10px 14px; white-space: nowrap; background: transparent; }
.nav-tabs .nav-link.active { color: var(--c-primary); border-bottom-color: var(--c-primary); background: transparent; }
.tab-content { padding-top: 18px; }
.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.cert { border: 1px solid var(--c-border); border-radius: var(--radius); padding: 14px; background: var(--c-card-bg); display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); }
.cert h4 { font-size: .98rem; font-weight: 700; margin: 0; }
.cert .val { font-size: .86rem; color: var(--c-muted); }
.cert.is-ok { border-left: 4px solid var(--c-success); } .cert.is-bad { border-left: 4px solid var(--c-danger); } .cert.is-miss { border-left: 4px solid var(--c-border); }
.alert-legal { border-left: 4px solid var(--c-secondary); background: var(--c-secondary-soft); padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 10px; font-size: .92rem; }
.alert-legal.info { border-left-color: var(--c-primary); background: var(--c-primary-soft); }
.alert-legal .ref { display: block; font-size: .78rem; color: var(--c-muted); margin-top: 2px; }
.best-row { background: rgba(var(--c-success-rgb), .1) !important; }
.money { text-align: right; white-space: nowrap; }
.cot-formula { background: var(--c-card-bg); border: 1px dashed var(--c-border); border-radius: var(--radius); padding: 12px 16px; font-size: .92rem; }
.pix-box { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: start; }
.pix-qr { background: #fff; padding: 10px; border: 1px solid var(--c-border); border-radius: var(--radius); width: 236px; min-height: 236px; display: flex; align-items: center; justify-content: center; }
.pix-qr img, .pix-qr canvas { max-width: 100%; }
.ts-wrapper.form-select, .ts-wrapper.form-control { padding: 0; }
.ts-control { border-radius: var(--radius-sm); }
.progress-list { max-height: 280px; overflow: auto; text-align: left; font-size: .9rem; }
.progress-list div { padding: 3px 0; }
.print-only { display: none; }
.swal2-popup { border-radius: var(--radius) !important; font-family: var(--font) !important; }
.swal2-styled.swal2-confirm { background: var(--c-primary) !important; border-radius: var(--radius-sm) !important; }

/* ------------------------------------------------------------ 7. telas de acesso */
.hm-blank { background: var(--c-bg); }
.hm-auth { display: flex; min-height: 100vh; }
.hm-auth-art { position: relative; flex: 0 0 44%; max-width: 44%; background: linear-gradient(180deg, var(--c-primary) 0%, var(--c-primary-deep) 100%) center / cover no-repeat;
  color: var(--c-hero-text); display: flex; align-items: center; justify-content: center; padding: 48px 76px 48px 44px; overflow: hidden; }
.hm-auth-art.has-image::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(var(--c-primary-rgb), .6), rgba(var(--c-primary-rgb), .88)); }
.hm-auth-art-inner { position: relative; z-index: 2; max-width: 420px; }
.hm-auth-mark { width: 84px; height: 76px; object-fit: contain; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .18)); }
.hm-auth-mark.to-white { filter: brightness(0) invert(1) drop-shadow(0 6px 14px rgba(0, 0, 0, .18)); }
.hm-auth-welcome { margin: 16px 0 2px; font-weight: 600; opacity: .9; }
.hm-auth-art h2 { font-weight: 800; font-style: var(--title-style); font-size: clamp(2rem, 3.4vw, 3rem); letter-spacing: -.025em; margin: 0 0 12px; line-height: 1.05; }
.hm-auth-lead { font-size: 1rem; opacity: .92; margin: 0; line-height: 1.5; }
.hm-auth-steps { counter-reset: s; list-style: none; padding: 0; margin: 26px 0 0; border-left: 2px solid rgba(255, 255, 255, .22); }
.hm-auth-steps li { counter-increment: s; padding: 6px 0 6px 20px; position: relative; font-weight: 500; }
.hm-auth-steps li::before { content: counter(s); position: absolute; left: -12px; top: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--c-secondary); color: var(--c-on-secondary);
  font-size: .72rem; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.hm-auth-divider { position: absolute; top: 0; right: 0; bottom: 0; width: 46px; height: 100%; z-index: 3; }
.hm-auth-divider .s1 { fill: var(--c-secondary); }
.hm-auth-divider .s2 { fill: var(--c-accent); }
.hm-auth-divider .bg { fill: var(--c-bg); }
.hm-auth-wave { display: none; }
.hm-auth-main { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; }
.hm-auth-theme { position: fixed; top: 14px; right: 18px; z-index: 10; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--c-card-bg); color: var(--c-text); box-shadow: var(--shadow);
  display: inline-flex; align-items: center; justify-content: center; }
.hm-auth-theme:hover { color: var(--c-primary); }
.hm-auth-card { width: 100%; max-width: 420px; background: var(--c-card-bg); border-radius: calc(var(--radius) + 6px); box-shadow: 0 8px 30px rgba(15, 35, 40, .07), 0 1px 2px rgba(15, 35, 40, .05); padding: 30px 30px 26px; }
.hm-auth-card h1 { font-size: 1.35rem; font-weight: 800; margin-bottom: 4px; }
.hm-auth-card .sub { color: var(--c-muted); font-size: .86rem; margin-bottom: 18px; }
.hm-auth-card .form-control { height: 44px; }
.hm-auth-card .btn-primary { height: 46px; }
.hm-auth-logo { display: block; max-height: 58px; max-width: 240px; margin: 0 auto 22px; object-fit: contain; }
.hm-auth-copy { margin: 18px 0 0; font-size: .76rem; color: var(--c-muted); text-align: center; }
.hm-auth-copy a { color: inherit; text-decoration: underline; }
.hm-auth-copy .sep { opacity: .6; margin: 0 2px; }

/* ------------------------------------------------------------ 8. personalização e configurações */
.hm-preset { border: 1px solid var(--c-border); background: var(--c-card-bg); border-radius: 999px; padding: 4px 10px 4px 6px; display: inline-flex; align-items: center; gap: 3px; font-size: .78rem; color: var(--c-text); }
.hm-preset span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--c-card-bg); margin-right: -6px; }
.hm-preset small { margin-left: 10px; font-weight: 600; }
.hm-preset:hover { border-color: var(--c-primary); }
.hm-color { display: flex; gap: 8px; align-items: center; }
.hm-color input[type=color] { width: 42px; height: 38px; border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: 2px; background: var(--c-card-bg); flex-shrink: 0; }
.hm-upload { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--c-border); border-radius: var(--radius); padding: 12px; height: 100%; }
.hm-upload-thumb { width: 92px; height: 72px; flex-shrink: 0; border-radius: var(--radius-sm); background: repeating-conic-gradient(var(--c-soft) 0 25%, transparent 0 50%) 0 0 / 14px 14px; display: flex; align-items: center; justify-content: center; overflow: hidden; border: 1px solid var(--c-border); }
.hm-upload-thumb.dark { background: #1d2427; }
.hm-upload-thumb img { max-width: 90%; max-height: 90%; object-fit: contain; }
.hm-upload-thumb i { font-size: 1.6rem; color: var(--c-muted); }
.hm-sticky { position: sticky; top: 16px; }
.hm-settings-nav .list-group-item { border: 0; border-left: 3px solid transparent; font-weight: 500; color: var(--c-text); display: flex; align-items: center; gap: 8px; }
.hm-settings-nav .list-group-item.active { background: var(--c-primary-soft); color: var(--c-primary); border-left-color: var(--c-primary); font-weight: 600; }
.hm-settings-nav .badge { margin-left: auto; }
section.panel { scroll-margin-top: 16px; }
.diag-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--c-border); }
.diag-row:last-child { border-bottom: 0; }
.diag-row .ms-auto { text-align: right; }

/* Prévia ao vivo */
.pv { --pv-primary: #0F5563; display: grid; grid-template-columns: 126px 1fr; border: 1px solid var(--c-border); border-radius: var(--pv-radius, 12px); overflow: hidden;
  font-family: var(--pv-font); background: var(--pv-body); min-height: 300px; font-size: 12px; color: #1d2a2e; }
.pv-side { background: var(--pv-side-bg); color: var(--pv-side-text); padding: 12px 8px; display: flex; flex-direction: column; gap: 4px; }
.pv-logo { height: 34px; display: flex; align-items: center; gap: 6px; font-weight: 700; margin-bottom: 8px; overflow: hidden; }
.pv-logo img.pv-icon { width: 24px; height: 24px; }
.pv-logo img.pv-full { display: none; max-width: 100%; max-height: 30px; }
.pv-logo.has-logo img.pv-full { display: block; }
.pv-logo.has-logo img.pv-icon, .pv-logo.has-logo span { display: none; }
.pv-item { padding: 6px 7px; border-radius: calc(var(--pv-radius) * .6); display: flex; gap: 6px; align-items: center; opacity: .85; }
.pv-item.active { background: color-mix(in srgb, var(--pv-primary) 12%, transparent); color: var(--pv-primary); opacity: 1; font-weight: 600; }
.pv-main { display: flex; flex-direction: column; min-width: 0; }
.pv-hero { position: relative; background: linear-gradient(180deg, var(--pv-primary), var(--pv-primary-dark)); color: var(--pv-hero-text); padding: 14px 14px 30px; }
.pv-hero strong { display: block; font-size: 18px; font-weight: 800; font-style: var(--pv-italic); line-height: 1.1; }
.pv-pills { display: flex; gap: 4px; margin-top: 6px; }
.pv-pills span { background: rgba(255, 255, 255, .18); border-radius: 99px; padding: 1px 7px; font-size: 10px; }
.pv-wave { position: absolute; left: 0; right: 0; bottom: 0; height: 16px; background: linear-gradient(180deg, transparent 0 20%, var(--pv-secondary) 20% 50%, var(--pv-accent) 50% 75%, var(--pv-body) 75%); border-radius: 60% 40% 0 0 / 30% 30% 0 0; }
.pv.no-wave .pv-wave { border-radius: 0; background: linear-gradient(180deg, transparent 0 55%, var(--pv-secondary) 55% 78%, var(--pv-accent) 78%); height: 10px; }
.pv-body { padding: 10px 12px; display: grid; gap: 8px; }
.pv-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pv-card { background: #fff; border-radius: var(--pv-radius); padding: 7px 9px; border: 1px solid rgba(0, 0, 0, .06); }
.pv-card b { display: block; font-size: 16px; }
.pv-card.hl b { color: var(--pv-primary); }
.pv-badges { display: flex; gap: 4px; flex-wrap: wrap; }
.pv-badges span { border-radius: 99px; padding: 1px 8px; font-weight: 600; font-size: 10px; }
.pv-btn { justify-self: start; background: var(--pv-primary); color: var(--pv-on-primary, #fff); border-radius: calc(var(--pv-radius) * .6); padding: 6px 12px; font-weight: 600; }
.pv-count { background: var(--pv-secondary); color: #fff; border-radius: 9px; padding: 0 6px; font-size: 10px; margin-left: auto; }

/* ------------------------------------------------------------ responsivo e impressão */
@media (max-width: 991.98px) {
  .hm-sidebar { transform: translateX(-100%); width: var(--sidebar-w) !important; }
  body.sidebar-open .hm-sidebar { transform: none; box-shadow: var(--shadow-lg); }
  body.sidebar-open .hm-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 1035; }
  .hm-main, .sidebar-collapsed .hm-main { margin-left: 0; }
  .sidebar-collapsed .hm-brand-logo { display: block; } .sidebar-collapsed .hm-brand-icon { display: none; }
  .sidebar-collapsed .hm-nav-label, .sidebar-collapsed .hm-caret { display: inline; }
  .sidebar-collapsed .hm-nav-link { justify-content: flex-start; }
  .sidebar-collapsed .hm-nav-item > .hm-sub { position: static; box-shadow: none; border: 0; }
  .hm-collapse { display: none; }
  .hm-hero { padding: 10px 16px 0; }
  .hm-content { padding: 6px 14px 30px; }
  .hm-footer { padding: 10px 14px; }
  .hm-hero-body { max-width: none; }
  .hm-hero-mark { display: none; }
  .hm-search { max-width: none; }
  .rail { grid-template-columns: 1fr; }
  .rail a { border-right: 0; border-bottom: 1px solid var(--c-border); }
}
@media (max-width: 575.98px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px 14px; }
  .kpi .v { font-size: 1.4rem; }
  .hm-search input::placeholder { font-size: .8rem; }
  .dossie-head { grid-template-columns: 1fr; }
  .seal { width: 92px; height: 92px; }
  .pix-box { grid-template-columns: 1fr; }
  .hm-footer-stats { margin-left: 0; }
}
@media (max-width: 860px) {
  .hm-auth { flex-direction: column; }
  .hm-auth-art { flex: none; max-width: none; min-height: 230px; padding: 34px 24px 64px; }
  .hm-auth-divider, .hm-auth-steps { display: none; }
  .hm-auth-wave { display: block; height: 40px; }
  .hm-auth-main { padding: 20px 16px 30px; justify-content: flex-start; }
  .hm-auth-theme { background: rgba(255, 255, 255, .2); color: #fff; box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } .hm-loader.is-boot { display: none; } }
@media print {
  .hm-sidebar, .hm-topbar, .hm-footer, .hm-loader, .hm-hero-deco, .no-print, .modal { display: none !important; }
  .hm-main { margin: 0 !important; }
  .hm-hero { background: none !important; color: #000 !important; padding: 0 0 10px !important; min-height: 0 !important; }
  .hm-content { padding: 0; }
  .panel, .kpi { box-shadow: none; }
}
.checklist li > .st { align-self: flex-start; flex-shrink: 0; }
.panel-b.p0 > .table th:first-child, .panel-b.p0 > .table td:first-child, .panel-b.p0 > .table-responsive > .table th:first-child, .panel-b.p0 > .table-responsive > .table td:first-child { padding-left: 18px; }
.panel-b.p0 > .table th:last-child, .panel-b.p0 > .table td:last-child, .panel-b.p0 > .table-responsive > .table th:last-child, .panel-b.p0 > .table-responsive > .table td:last-child { padding-right: 18px; }
.fs, .rg, .st { white-space: nowrap; }
/* ------------------------------------------------------------ planos */
.hm-planbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; font-size: .88rem; flex-wrap: wrap;
  background: var(--c-primary-soft); border: 1px solid rgba(var(--c-primary-rgb), .18); }
.hm-planbar > i { color: var(--c-primary); font-size: 1.1rem; }
.hm-planbar.warning { background: rgba(var(--c-warning-rgb), .12); border-color: rgba(var(--c-warning-rgb), .3); }
.hm-planbar.warning > i { color: var(--c-warning); }
.hm-planbar.danger { background: rgba(var(--c-danger-rgb), .1); border-color: rgba(var(--c-danger-rgb), .28); }
.hm-planbar.danger > i { color: var(--c-danger); }
.hm-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.hm-plan { position: relative; border: 1px solid var(--c-border); border-radius: calc(var(--radius) + 2px); padding: 22px 20px 20px; background: var(--c-card-bg); display: flex; flex-direction: column; }
.hm-plan.is-featured { border: 2px solid var(--c-primary); box-shadow: 0 10px 28px rgba(var(--c-primary-rgb), .14); }
.hm-plan.is-current { border-color: var(--c-success); }
.hm-plan h3 { font-size: 1.15rem; font-weight: 800; margin: 0 0 2px; }
.hm-plan-flag { position: absolute; top: -11px; left: 18px; background: var(--c-primary); color: var(--c-on-primary); font-size: .7rem; font-weight: 700; border-radius: 99px; padding: 3px 10px; }
.hm-plan-flag.current { left: auto; right: 18px; background: var(--c-success); color: #fff; }
.hm-plan-price { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; color: var(--c-primary); }
[data-bs-theme="dark"] .hm-plan-price { color: var(--c-primary-light); }
.hm-plan-price small { font-size: .85rem; font-weight: 600; color: var(--c-muted); margin: 0 3px; }
.hm-plan-list { list-style: none; padding: 0; margin: 0 0 18px; flex: 1; font-size: .86rem; }
.hm-plan-list li { display: flex; gap: 8px; padding: 4px 0; }
.hm-plan-list i { color: var(--c-success); }
.hm-plan-list li:nth-child(-n+2) { font-weight: 600; }
.hm-plan-list li:nth-child(-n+2) i { color: var(--c-primary); }
.hm-divider { display: flex; align-items: center; gap: 10px; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c-muted); margin: 6px 0 12px; }
.hm-divider::after { content: ""; flex: 1; height: 1px; background: var(--c-border); }

/* ------------------------------------------------------------ ajuda */
.hm-help { border: 0; background: none; padding: 0 3px; margin: 0; color: var(--c-muted); font-size: .92em; line-height: 1; vertical-align: baseline; cursor: help; }
.hm-help:hover, .hm-help[aria-describedby] { color: var(--c-primary); }
.popover.hm-pop { max-width: 380px; font-size: .84rem; border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.popover.hm-pop .popover-header { font-weight: 700; background: var(--c-primary-soft); }
.popover.hm-pop p:last-child { margin-bottom: 0; }
.hm-ajuda { --bs-offcanvas-width: 420px; }
.hm-flow { counter-reset: f; list-style: none; padding: 0; margin: 0; }
.hm-flow li { counter-increment: f; position: relative; padding: 0 0 18px 44px; }
.hm-flow li::before { content: counter(f); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%; background: var(--c-primary); color: var(--c-on-primary); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.hm-flow li:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 30px; bottom: 2px; width: 2px; background: var(--c-border); }
.hm-flow p { margin: 3px 0 0; color: var(--c-muted); font-size: .88rem; }
.hm-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 20px; }
.hm-step { background: var(--c-card-bg); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: flex; gap: 12px; color: var(--c-text); }
.hm-step:hover { border-color: rgba(var(--c-primary-rgb), .4); color: var(--c-text); }
.hm-step .n { flex: 0 0 34px; height: 34px; border-radius: 50%; background: var(--c-primary-soft); color: var(--c-primary); font-weight: 800; display: flex; align-items: center; justify-content: center; }
.hm-step strong { display: block; font-size: .95rem; }
.hm-step small { color: var(--c-muted); display: block; margin-top: 2px; }
.hm-step .cnt { margin-top: 8px; font-size: .8rem; font-weight: 600; }
.pend-list { list-style: none; padding: 0; margin: 4px 0 0; font-size: .78rem; }
.pend-list li { display: flex; gap: 5px; color: var(--c-warning); }
.pend-list li.div { color: var(--c-danger); }

.table td.money .help { white-space: normal; min-width: 130px; max-width: 220px; margin-left: auto; }
#tbProp td.col-forn { min-width: 200px; }
.pend-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.pend-tag { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: rgba(var(--c-warning-rgb), .14); color: var(--c-warning); cursor: help; }
.pend-tag.div { background: rgba(var(--c-danger-rgb), .12); color: var(--c-danger); }

/* Barras de progresso nas cores do tema */
.progress { --bs-progress-bg: var(--c-primary-soft); --bs-progress-bar-bg: var(--c-primary); --bs-progress-border-radius: 99px; }
.progress.hm-uso { height: 8px; }
.progress.hm-uso .progress-bar { background: linear-gradient(90deg, var(--c-primary), var(--c-primary-deep)); border-radius: 99px; }
[data-bs-theme="dark"] .progress { --bs-progress-bg: rgba(var(--c-primary-rgb), .22); }
[data-bs-theme="dark"] .progress.hm-uso .progress-bar { background: var(--c-primary-light); }

/* ------------------------------------------------------------ estados "ativo" nas cores do tema (sem o azul do Bootstrap) */
.dropdown-menu {
  --bs-dropdown-link-active-bg: var(--c-primary);
  --bs-dropdown-link-active-color: var(--c-on-primary);
  --bs-dropdown-link-hover-bg: var(--c-primary-soft);
  --bs-dropdown-link-hover-color: var(--c-text);
}
.dropdown-item:focus-visible { outline: 2px solid rgba(var(--c-primary-rgb), .45); outline-offset: -2px; background: var(--c-primary-soft); }
.dropdown-item.text-danger:hover, .dropdown-item.text-danger:focus { background: rgba(var(--c-danger-rgb), .1); }
.dropdown-item.text-danger:active, .dropdown-item.text-danger.active { background: var(--c-danger); color: #fff !important; }
.list-group { --bs-list-group-active-bg: var(--c-primary); --bs-list-group-active-border-color: var(--c-primary); --bs-list-group-active-color: var(--c-on-primary); --bs-list-group-action-active-bg: var(--c-primary-soft); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--c-primary); --bs-nav-pills-link-active-color: var(--c-on-primary); }
.nav-link { --bs-nav-link-color: var(--c-primary); --bs-nav-link-hover-color: var(--c-primary-dark); }
.btn-link { --bs-btn-color: var(--c-primary); --bs-btn-hover-color: var(--c-primary-dark); --bs-btn-active-color: var(--c-primary-dark); }
.ts-dropdown .active { background-color: var(--c-primary-soft); color: var(--c-text); }
.ts-wrapper.multi .ts-control > div.active { background: var(--c-primary); border-color: var(--c-primary); color: var(--c-on-primary); }
.swal2-styled:focus, .swal2-styled.swal2-confirm:focus { box-shadow: 0 0 0 3px rgba(var(--c-primary-rgb), .35) !important; }
.swal2-timer-progress-bar { background: rgba(var(--c-primary-rgb), .45) !important; }
[data-bs-theme="dark"] .dropdown-menu { --bs-dropdown-link-hover-color: #fff; }

/* Botão "Entrar com o Google" (padrão visual do Google) */
.btn-google { display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: #fff; color: #1f1f1f; border: 1px solid #747775; font-weight: 600; font-family: var(--font); }
.btn-google:hover, .btn-google:focus { background: #f8faff; color: #1f1f1f; border-color: #747775; box-shadow: 0 1px 3px rgba(60, 64, 67, .2); }
[data-bs-theme="dark"] .btn-google { background: #131314; color: #e3e3e3; border-color: #8e918f; }
.hm-ou { display: flex; align-items: center; gap: 10px; color: var(--c-muted); font-size: .78rem; margin: 14px 0; }
.hm-ou::before, .hm-ou::after { content: ""; flex: 1; height: 1px; background: var(--c-border); }

/* Legislação */
.hm-legis-alerta { display: flex; gap: 16px; align-items: flex-start; padding: 18px 20px; margin-bottom: 20px; border-radius: var(--radius);
  background: var(--c-primary-soft); border: 2px solid var(--c-primary); }
.hm-legis-alerta > i { font-size: 2rem; color: var(--c-primary); line-height: 1; }
.hm-legis-alerta strong { font-size: 1.1rem; display: block; margin-bottom: 4px; }
.hm-legis-rev { display: inline-block; margin-top: 8px; font-size: .78rem; font-weight: 700; background: var(--c-primary); color: var(--c-on-primary); border-radius: 99px; padding: 2px 10px; }
.hm-legis-item { padding: 12px 18px; border-bottom: 1px solid var(--c-border); }
.hm-legis-item:last-child { border-bottom: 0; }
[data-bs-theme="dark"] .hm-legis-alerta > i { color: var(--c-primary-light); }
/* Menus suspensos do topo sempre acima do restante do cabeçalho */
.hm-topbar .dropdown-menu { z-index: 1060; }

.hm-legis-rev.alt { background: var(--c-card-bg); color: var(--c-text); border: 1px solid var(--c-border); }
.hm-legis-novo { border: 2px solid var(--c-warning); }
.hm-legis-item.is-nova { background: var(--c-primary-soft); border-left: 4px solid var(--c-primary); }
.hm-legis-item.is-alterada { background: rgba(var(--c-warning-rgb), .08); border-left: 4px solid var(--c-warning); }

/* Nome e localização de fornecedor sempre em maiúsculas */
.forn-nome, .forn-local, #tb td:first-child a.fw-semibold, #tbProp td.col-forn > a, .dossie-head h2 { text-transform: uppercase; }

/* Botão de salvar flutuante: acompanha a rolagem e para no fim do formulário */
.hm-savebar { position: sticky; bottom: 14px; z-index: 1015; display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin: 8px 0 24px; pointer-events: none; }
.hm-savebar > * { pointer-events: auto; }
.hm-savebar .btn { box-shadow: 0 8px 24px rgba(var(--c-primary-rgb), .35), 0 2px 6px rgba(0, 0, 0, .12); padding-top: .6rem; padding-bottom: .6rem; }
.hm-dirty { background: var(--c-card-bg); color: var(--c-warning); border: 1px solid rgba(var(--c-warning-rgb), .4); border-radius: 99px; padding: 6px 12px; font-size: .8rem; font-weight: 600; box-shadow: var(--shadow); }
.hm-dirty i { font-size: .5rem; vertical-align: middle; margin-right: 4px; }
.hm-savebar.is-dirty .btn { animation: hmPulse 1.6s ease-in-out 2; }
@keyframes hmPulse { 50% { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(var(--c-primary-rgb), .5); } }
@media (max-width: 575.98px) { .hm-savebar { bottom: 8px; } .hm-savebar .btn { flex: 1; } }
.hm-savebar .btn-outline-primary { background: var(--c-card-bg); border-radius: 99px; }

/* Dúvidas e sugestões */
.hm-tickets { max-height: 70vh; overflow-y: auto; }
.hm-ticket { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--c-border); color: var(--c-text); }
.hm-ticket:hover { background: var(--c-soft); color: var(--c-text); }
.hm-ticket.active { background: var(--c-primary-soft); border-left: 3px solid var(--c-primary); }
.hm-ticket.is-new strong { color: var(--c-primary); }
.hm-ticket-ic { font-size: 1.2rem; color: var(--c-primary); flex-shrink: 0; }
.hm-chat { max-height: 60vh; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; background: var(--c-bg); }
.hm-msg { max-width: 82%; padding: 10px 14px; border-radius: 14px; background: var(--c-card-bg); border: 1px solid var(--c-border); box-shadow: var(--shadow); }
.hm-msg.meu { align-self: flex-end; background: var(--c-primary-soft); border-color: rgba(var(--c-primary-rgb), .25); border-bottom-right-radius: 4px; }
.hm-msg.outro { align-self: flex-start; border-bottom-left-radius: 4px; }
.hm-msg-cab { font-size: .76rem; margin-bottom: 4px; display: flex; gap: 8px; }
.hm-msg-cab span { color: var(--c-muted); }
.hm-msg.adm .hm-msg-cab strong { color: var(--c-primary); }
.hm-msg-txt { font-size: .9rem; white-space: normal; word-wrap: break-word; }
.hm-msg-anexo { display: inline-block; margin-top: 6px; font-size: .8rem; }
.hm-chat-sis { align-self: center; font-size: .78rem; color: var(--c-muted); background: var(--c-soft); border-radius: 99px; padding: 4px 12px; }
.hm-chat-sis span { opacity: .7; margin-left: 6px; }
.hm-tipo { display: flex; gap: 8px; align-items: center; border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: 12px; cursor: pointer; height: 100%; }
.hm-tipo i { font-size: 1.2rem; color: var(--c-primary); }
.hm-tipo:has(input:checked) { border-color: var(--c-primary); background: var(--c-primary-soft); }

/* Tema escuro sem "logotipo para fundo escuro": o logotipo comum aparece sobre uma placa clara para manter a leitura */
[data-bs-theme="dark"] .logo-placa { background: rgba(255, 255, 255, .94); border-radius: 10px; padding: 5px 10px; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
[data-bs-theme="dark"] .hm-auth-logo.logo-placa { padding: 8px 14px; }

/* ---------- Aviso de não reembolso (sempre amarelo, independente do tema) e Termos ---------- */
.hm-aviso-termos { background: #fff6d6; border: 1px solid #f6d77a; border-left: 5px solid #f2b705; color: #5a4300; border-radius: var(--radius-sm); padding: 12px 16px; font-size: .93rem; line-height: 1.5; }
.hm-aviso-termos > .bi { color: #d99a00; font-size: 1.15rem; line-height: 1.3; flex: 0 0 auto; }
.hm-aviso-termos a { color: #6b4f00; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.hm-aviso-termos a:hover { color: #3d2d00; }
[data-bs-theme=dark] .hm-aviso-termos { background: rgba(242, 183, 5, .12); border-color: rgba(242, 183, 5, .35); border-left-color: #f2b705; color: #f6e2a4; }
[data-bs-theme=dark] .hm-aviso-termos > .bi { color: #f2b705; }
[data-bs-theme=dark] .hm-aviso-termos a { color: #ffd760; }
.hm-terms { line-height: 1.6; }
.hm-terms p { margin-bottom: .6rem; }
.hm-terms ul { padding-left: 1.2rem; margin-bottom: .7rem; }
.hm-terms li { margin-bottom: .2rem; }
.hm-terms .hm-terms-h { font-size: 1rem; font-weight: 600; margin: 1.1rem 0 .45rem; color: var(--c-primary); }
.hm-terms .hm-terms-h:first-child { margin-top: 0; }
@media print { .hm-terms { max-height: none !important; overflow: visible !important; } }

/* ---------- Teste do PIX (Mercado Pago – API Orders) ---------- */
.mp-passos { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.mp-passo { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--c-primary-soft); }
.mp-passo > .bi { font-size: 1.15rem; line-height: 1.3; }
.mp-passo.ok > .bi { color: var(--c-success); }
.mp-passo.erro { background: rgba(var(--c-danger-rgb), .08); }
.mp-passo.erro > .bi { color: var(--c-danger); }
.mp-qr { display: flex; gap: 16px; align-items: flex-start; margin-top: 14px; padding: 14px; border: 1px dashed var(--bs-border-color); border-radius: var(--radius-sm); }
.mp-qr img { width: 168px; height: 168px; background: #fff; padding: 6px; border-radius: 8px; flex: 0 0 auto; }
.mp-tec { margin-top: 6px; font-size: .85rem; }
.mp-tec summary { cursor: pointer; color: var(--bs-secondary-color); }
.mp-tec pre { max-height: 220px; overflow: auto; background: var(--bs-tertiary-bg); padding: 10px; border-radius: 8px; font-size: .78rem; white-space: pre-wrap; word-break: break-all; }
@media (max-width: 575.98px) { .mp-qr { flex-direction: column; align-items: center; } }
