:root {
  --hf-orange: #ee7522;
  --hf-orange-dark: #d8631a;
  --hf-blue: #1659c4;
  --hf-cyan: #28d3dd;        /* bionexo */
  --hf-cyan-dark: #1fb4bd;
  --hf-tasy: #1b5386;        /* tasy */
  --hf-tasy-dark: #143f66;
  --hf-gray: #4a4a4a;
  --hf-bg: #f4f5f7;
  --hf-border: #e3e5ea;
  --hf-text: #3a3a3a;
  --hf-muted: #8a8f99;
  --bs-body-font-size: 12px;
  --hf-topbar-h: 66px;
  --hf-navbar-h: 46px;
  --hf-footer-h: 34px;
}

@font-face {
  font-family: 'Proxima Nova';
  src: url('fonts/Proxima-Nova-Regular.woff2') format('woff2'),
       url('fonts/Proxima-Nova-Regular.woff') format('woff');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Proxima Nova';
  src: url('fonts/Proxima-Nova-Semibold.woff2') format('woff2'),
       url('fonts/Proxima-Nova-Semibold.woff') format('woff');
  font-weight: 600 800; font-style: normal; font-display: swap;
}
* { font-family: 'Proxima Nova', system-ui, sans-serif; }
body, input, button, select, textarea, .btn, .form-control, .form-select {
  font-family: 'Proxima Nova', system-ui, sans-serif;
}
html { font-size: 12px; }
body { background: var(--hf-bg); color: var(--hf-text); font-size: 12px; }
.small, small, .text-muted { font-size: 10px; }
.container { max-width: 1040px; }

/* ===================== Loading bar ===================== */
#hf-loading { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 2000; pointer-events: none; opacity: 0; transition: opacity .2s; }
#hf-loading.on { opacity: 1; }
.hf-loading-bar { height: 100%; width: 0; background: var(--hf-orange); box-shadow: 0 0 8px rgba(238,117,34,.6); }
#hf-loading.on .hf-loading-bar { animation: hf-progress 1.4s ease-in-out infinite; }
@keyframes hf-progress { 0%{width:0;margin-left:0} 50%{width:70%;margin-left:0} 100%{width:0;margin-left:100%} }

/* ===================== Topbar (1ª) ===================== */
.hf-topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--hf-topbar-h);
  background: #fff; border-bottom: 1px solid var(--hf-border);
  display: flex; align-items: center; gap: 1rem; padding: 0 1.5rem;
  z-index: 1030; box-shadow: 0 1px 3px rgba(16,24,40,.04);
}
.hf-brand img { height: 58px; display: block; }
.hf-search { position: absolute; left: 50%; transform: translateX(-50%); width: 100%; max-width: 460px; }
.hf-search-box { position: relative; }
.hf-search-box i { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--hf-muted); font-size: 15px; pointer-events: none; }
.hf-search input { width: 100%; border: 1px solid var(--hf-border); border-radius: 999px; padding: .6rem 1rem .6rem 2.4rem; font-size: 13px; background: #f7f8fa; }
.hf-search input:focus { outline: none; border-color: var(--hf-orange); background: #fff; box-shadow: 0 0 0 .2rem rgba(238,117,34,.13); }
.hf-search-dd {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: #fff; z-index: 1100;
  display: none; max-height: 60vh; overflow-y: auto;
}
.hf-search-dd.show { display: block; animation: hf-fade .15s ease both; }
.hf-dd-item { display: flex; align-items: center; gap: .55rem; text-decoration: none; }
.hf-dd-item:hover { text-decoration: none; }
.hf-dd-item i { color: var(--hf-orange); font-size: 15px; flex: none; }
.hf-dd-item .t { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hf-dd-item .g { margin-left: auto; font-size: 10px; font-weight: 700; color: var(--hf-muted); background: #f1f2f5; padding: .1rem .45rem; border-radius: 999px; flex: none; }
.hf-dd-empty { padding: .7rem .8rem; color: var(--hf-muted); }
.hf-dd-carregando { display: flex; align-items: center; padding: .5rem .6rem; color: var(--hf-muted); font-weight: 700; }
.hf-dd-item .s { color: var(--hf-muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hf-dd-item .g { margin-left: auto; }

.hf-user { margin-left: auto; }
.hf-user-btn { display: flex; align-items: center; gap: .5rem; background: transparent; border: 1px solid var(--hf-border); border-radius: 999px; padding: .2rem .7rem .2rem .2rem; cursor: pointer; transition: border-color .15s; }
.hf-user-btn:hover { border-color: var(--hf-orange); }
.hf-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--hf-orange); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; }
.hf-user-name { font-weight: 700; color: var(--hf-gray); }
.hf-user-btn .bi-chevron-down { font-size: 10px; color: var(--hf-muted); }

/* ===================== Dropdowns (corpo no padrao dos cards) ===================== */
.dropdown-menu, .hf-search-dd {
  font-size: 12px; color: var(--hf-text); background: #fff;
  border: 1px solid var(--hf-border); border-radius: 12px; padding: .35rem;
  box-shadow: 0 10px 28px rgba(16,24,40,.12);
  min-width: 240px;
}
.dropdown-item, .hf-dd-item { border-radius: 8px; padding: .45rem .6rem; font-weight: 600; color: var(--hf-gray); }
.dropdown-item:hover, .dropdown-item:focus, .hf-dd-item:hover { background: #f5f6f8; color: var(--hf-gray); }
.dropdown-item.text-danger:hover, .dropdown-item.text-danger:focus { background: rgba(220,53,69,.08); color: #dc3545; }
.dropdown-item-text { padding: .35rem .6rem; }
.dropdown-divider { margin: .3rem 0; border-color: #f0f1f4; }
.dropdown-header { padding: .45rem .6rem .3rem; color: var(--hf-muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.dropdown-item.active { background: rgba(238,117,34,.10); color: var(--hf-gray); }

/* select virado dropdown com busca (o <select> real continua no form) */
.hf-select { position: relative; }
.hf-select-native { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.hf-select-btn { width: 100%; background: #fff; cursor: pointer; }
.hf-select-btn:focus { border-color: var(--hf-cyan); box-shadow: 0 0 0 .2rem rgba(40,211,221,.2); }
.hf-select-menu { width: 100%; min-width: 0; padding-top: 0; }
.hf-select-busca { position: sticky; top: 0; z-index: 1; background: #fff; padding: .35rem .1rem .4rem; border-bottom: 1px solid #f0f1f4; }
.hf-select-busca i { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--hf-muted); font-size: 12px; pointer-events: none; }
.hf-select-busca input { padding-left: 1.9rem; }
.hf-select-lista { max-height: 220px; overflow-y: auto; padding-top: .2rem; }
.hf-select-btn:disabled { background: #fff; color: var(--hf-muted); cursor: not-allowed; }
.hf-item-sub { font-size: 10px; font-weight: 700; color: var(--hf-muted); background: #f1f2f5; padding: .1rem .45rem; border-radius: 999px; flex: none; }
.hf-select-rodape { position: sticky; bottom: 0; background: #fff; padding: .4rem .1rem .1rem; border-top: 1px solid #f0f1f4; }
.hf-select-carregando { display: flex; align-items: center; justify-content: center; padding: .5rem; color: var(--hf-muted); }
.hf-check { font-size: 13px; color: var(--hf-muted); flex: none; }
.dropdown-item.active .hf-check { color: var(--hf-orange); }

/* chips dos perfis selecionados */
.hf-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin: .5rem 0 .25rem; }
.hf-chips:empty { margin: 0; }
.hf-chip {
  display: inline-flex; align-items: center; gap: .3rem;
  background: rgba(238,117,34,.10); color: var(--hf-orange-dark);
  border-radius: 999px; padding: .2rem .3rem .2rem .6rem; font-weight: 700; font-size: 11px;
}
.hf-chip-x { border: 0; background: transparent; color: inherit; line-height: 1; padding: 0 .2rem; cursor: pointer; opacity: .7; }
.hf-chip-x:hover { opacity: 1; }

/* ===================== Navbar (2ª topbar / funcoes) ===================== */
.hf-navbar {
  position: fixed; top: var(--hf-topbar-h); left: 0; right: 0; height: var(--hf-navbar-h);
  background: #fff; border-bottom: 1px solid var(--hf-border);
  z-index: 1029; box-shadow: 0 1px 2px rgba(16,24,40,.03);
}
.hf-navbar-inner {
  max-width: 1040px; margin: 0 auto; height: 100%;
  display: flex; align-items: center; justify-content: center; gap: .25rem; padding: 0 1rem;
}
.hf-nav-link {
  display: flex; align-items: center; gap: .45rem; height: 100%;
  padding: 0 .9rem; color: var(--hf-gray); text-decoration: none; font-weight: 700;
  border-bottom: 2px solid transparent; transition: color .15s, border-color .15s, background .15s;
}
.hf-nav-link i { font-size: 15px; }
.hf-nav-logo { height: 15px; width: auto; flex: none; }
.hf-nav-link:hover { color: var(--hf-orange); text-decoration: none; background: #fafbfc; }
.hf-nav-link.active { color: var(--hf-orange); border-bottom-color: var(--hf-orange); }

/* ===================== Main (centralizado) ===================== */
.hf-main {
  margin-top: calc(var(--hf-topbar-h) + var(--hf-navbar-h));
  margin-bottom: var(--hf-footer-h); padding: 1.6rem 0;
}
.hf-main .container { max-width: 960px; margin-left: auto; margin-right: auto; }

/* Desktop: a pagina em si nao rola. O conteudo rola dentro da area entre a
   navbar e a bottombar, entao nada passa por baixo do rodape fixo. */
@media (min-width: 769px) {
  body.has-shell { overflow: hidden; }
  body.has-shell .hf-main {
    height: calc(100vh - var(--hf-topbar-h) - var(--hf-navbar-h) - var(--hf-footer-h));
    margin-bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
  }
  /* Telas de lista: a tabela e que rola, para o rodape da pagina (paginacao)
     ficar sempre visivel. Navegador sem :has() cai no scroll do main, acima. */
  body.has-shell .hf-main > .container:has(> .card > .card-body.p-0 > .table) {
    height: 100%; display: flex; flex-direction: column; min-height: 0;
  }
  body.has-shell .hf-main > .container:has(> .card > .card-body.p-0 > .table) > .card {
    flex: 1 1 auto; min-height: 120px; display: flex; flex-direction: column;
  }
  body.has-shell .hf-main > .container:has(> .card > .card-body.p-0 > .table) > .card > .card-body.p-0 {
    flex: 1 1 auto; min-height: 0; overflow-y: auto;
  }
  /* cabecalho da tabela fica fixo enquanto as linhas rolam */
  body.has-shell .hf-main .card-body.p-0 > .table > thead th {
    position: sticky; top: 0; z-index: 1;
  }
}

/* ===================== Footer (bottombar) ===================== */
.hf-footer {
  position: fixed; bottom: 0; left: 0; right: 0; height: var(--hf-footer-h);
  background: #fff; border-top: 1px solid var(--hf-border);
  display: flex; align-items: center; padding: 0 1.5rem; z-index: 1030;
  font-size: 10px; color: var(--hf-muted);
}
.hf-foot-left { flex: 1; text-align: left; font-weight: 700; }
.hf-foot-center { flex: 1; text-align: center; font-weight: 800; color: var(--hf-gray); }
.hf-foot-right { flex: 1; text-align: right; }

/* ====================================================================
   MOBILE: vira "app" — funcoes numa bottom-bar fixa embaixo
   ==================================================================== */
@media (max-width: 768px) {
  .hf-topbar { padding: 0 .9rem; gap: .6rem; }
  .hf-brand img { height: 40px; }
  .hf-user-name { display: none; }
  .hf-search { display: none; }
  .hf-user { margin-left: auto; }

  /* nav (2a topbar) -> bottom-bar estilo app */
  .hf-navbar {
    top: auto; bottom: 0; height: 60px;
    border-top: 1px solid var(--hf-border); border-bottom: 0;
    box-shadow: 0 -2px 10px rgba(16,24,40,.06); z-index: 1040;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .hf-navbar-inner { padding: 0; gap: 0; justify-content: space-around; }
  .hf-nav-link {
    flex: 1; flex-direction: column; justify-content: center; gap: .15rem;
    height: 100%; padding: .3rem 0; border-bottom: 0; border-radius: 0;
  }
  .hf-nav-link i { font-size: 19px; }
  .hf-nav-link span { display: inline; font-size: 9px; font-weight: 700; }
  .hf-nav-link:hover { background: transparent; }
  .hf-nav-link.active { color: var(--hf-orange); position: relative; }
  .hf-nav-link.active::before {
    content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 26px; height: 3px; border-radius: 0 0 3px 3px; background: var(--hf-orange);
  }

  /* conteudo: topbar em cima, bottom-bar embaixo */
  .hf-main { margin-top: var(--hf-topbar-h); margin-bottom: 60px; padding: 1rem 0; }
  .hf-main .container { padding-left: .9rem; padding-right: .9rem; }

  /* esconde a barra de versao no mobile (bottom-bar ocupa o lugar) */
  .hf-footer { display: none; }

  /* tabelas rolam na horizontal dentro do card */
  .card-body.p-0 { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table { white-space: nowrap; }

  /* cabecalho da pagina: botao Adicionar quebra linha confortavel */
  .hf-page-head { flex-wrap: wrap; }
  .hf-page-head h4 { font-size: 16px; }

  /* dropdown nao estoura a tela */
  .dropdown-menu { max-width: 92vw; min-width: 200px; }
}

/* ===================== Animations ===================== */
.hf-fade-in { animation: none; }
@keyframes hf-fade { from { opacity: 0; } to { opacity: 1; } }

/* ===================== Skeleton (conteudo carregando) ===================== */
.hf-skel {
  display: block; border-radius: 6px; background: #eceef1;
  background-image: linear-gradient(90deg, #eceef1 25%, #f6f7f9 37%, #eceef1 63%);
  background-size: 400% 100%; animation: hf-shimmer 1.3s ease infinite;
}
.hf-skel.circ { border-radius: 50%; flex: none; }
.hf-page-head .hf-skel { display: inline-block; vertical-align: middle; }
td > .hf-skel, th > .hf-skel { height: 13px; }
@keyframes hf-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .hf-skel { animation: none; } }
.hf-lazy-legenda { display: flex; align-items: center; color: var(--hf-muted); font-weight: 700; margin-bottom: .6rem; }
.hf-lazy-legenda.hf-lazy-centro { justify-content: center; margin: .2rem 0 .8rem; }
.hf-lazy .hf-tree-row .hf-skel { margin-right: .5rem; }
.hf-tree-row .hf-skel { flex: none; }
.hf-tree-row .hf-skel:last-child { flex: 1 1 auto; max-width: 60%; }

/* ===================== Page head ===================== */
.hf-page-head { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.hf-page-head > i { color: var(--hf-orange); font-size: 18px; }
.hf-page-head h4 { margin: 0; }
.hf-page-head .ms-auto { margin-left: auto; }

/* ===================== Tooltip proprio ===================== */
.hf-tip {
  position: fixed; z-index: 2100; pointer-events: none;
  background: #2b3240; color: #fff; font-size: 11px; font-weight: 600;
  padding: .35rem .6rem; border-radius: 7px; max-width: 260px;
  box-shadow: 0 6px 18px rgba(16,24,40,.22);
  opacity: 0; transform: translateY(3px); transition: opacity .12s, transform .12s;
}
.hf-tip.show { opacity: 1; transform: translateY(0); }
.hf-tip::after {
  content: ''; position: absolute; left: 50%; margin-left: -5px;
  border: 5px solid transparent; border-top-color: #2b3240; top: 100%;
}
.hf-tip.baixo::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: #2b3240; }

/* ===================== Modais (sem animacao, corpo e botoes maiores) ===================== */
.modal.fade .modal-dialog, .modal .modal-dialog { transition: none; transform: none; }
.modal.fade { transition: none; }
.modal-backdrop.fade { transition: none; }
.modal-backdrop { opacity: .5; }
.modal-content { border-radius: 16px; border-color: var(--hf-border); }
.modal-header { padding: 1.1rem 1.4rem .4rem; }
.modal-title { font-size: 16px; }
.modal-body { padding: 1rem 1.4rem; font-size: 13px; }
.modal-body .form-control, .modal-body .form-select { font-size: 14px; padding: .65rem .9rem; }
.modal-body .form-label { font-size: 12px; }
.modal-footer { padding: .6rem 1.4rem 1.2rem; gap: .5rem; }
.modal-footer .btn { padding: .55rem 1.3rem; font-size: 13px; }

/* ===================== Cards ===================== */
.card { border: 1px solid var(--hf-border); border-radius: 12px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.card-body { padding: 1rem 1.1rem; }
.folder-card { cursor: pointer; }

/* logo no lugar do icone, na mesma caixa dos icones dos cards */
.hf-card-logo { height: 22px; width: auto; display: block; }
.hf-card-ext { position: absolute; top: 1rem; right: 1.1rem; font-size: 12px; color: var(--hf-muted); }

/* stat cards */
.hf-stat { display: flex; align-items: center; gap: .8rem; }
.hf-stat-ico { width: 42px; height: 42px; border-radius: 10px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 20px; background: rgba(238,117,34,.12); color: var(--hf-orange); }
.hf-stat-ico.blue { background: rgba(22,89,196,.12); color: var(--hf-blue); }
.hf-stat-ico.gray { background: rgba(74,74,74,.10); color: var(--hf-gray); }
.hf-stat .num { font-size: 22px; font-weight: 800; line-height: 1; color: var(--hf-gray); }
.hf-stat .lbl { color: var(--hf-muted); text-transform: capitalize; }

/* ===================== Buttons ===================== */
.btn { font-weight: 700; border-radius: 8px; padding: .38rem .8rem; font-size: 12px; }
.btn-sm { padding: .28rem .5rem; font-size: 11px; }
.hf-btn-add { padding: .42rem 1rem; font-size: 12px; }
.btn i { vertical-align: -1px; }
.btn:hover, .btn:focus { text-decoration: none; }
.btn-primary { --bs-btn-bg: var(--hf-orange); --bs-btn-border-color: var(--hf-orange); --bs-btn-hover-bg: var(--hf-orange-dark); --bs-btn-hover-border-color: var(--hf-orange-dark); --bs-btn-active-bg: var(--hf-orange-dark); --bs-btn-active-border-color: var(--hf-orange-dark); --bs-btn-disabled-bg: var(--hf-orange); --bs-btn-disabled-border-color: var(--hf-orange); }
.btn-outline-primary { --bs-btn-color: var(--hf-orange); --bs-btn-border-color: var(--hf-orange); --bs-btn-hover-bg: var(--hf-orange); --bs-btn-hover-border-color: var(--hf-orange); --bs-btn-active-bg: var(--hf-orange); --bs-btn-active-border-color: var(--hf-orange); }
.btn-secondary { --bs-btn-bg: var(--hf-tasy); --bs-btn-border-color: var(--hf-tasy); --bs-btn-hover-bg: var(--hf-tasy-dark); --bs-btn-hover-border-color: var(--hf-tasy-dark); --bs-btn-active-bg: var(--hf-tasy-dark); --bs-btn-active-border-color: var(--hf-tasy-dark); }
/* bionexo cyan = destaque/info (texto escuro p/ contraste) */
.btn-info { --bs-btn-bg: var(--hf-cyan); --bs-btn-border-color: var(--hf-cyan); --bs-btn-color: #08343a; --bs-btn-hover-bg: var(--hf-cyan-dark); --bs-btn-hover-border-color: var(--hf-cyan-dark); --bs-btn-hover-color: #08343a; --bs-btn-active-bg: var(--hf-cyan-dark); --bs-btn-active-border-color: var(--hf-cyan-dark); --bs-btn-active-color: #08343a; --bs-btn-disabled-bg: var(--hf-cyan); --bs-btn-disabled-border-color: var(--hf-cyan); --bs-btn-disabled-color: #08343a; }
.btn-outline-info { --bs-btn-color: var(--hf-tasy); --bs-btn-border-color: var(--hf-cyan); --bs-btn-hover-bg: var(--hf-cyan); --bs-btn-hover-border-color: var(--hf-cyan); --bs-btn-hover-color: #08343a; --bs-btn-active-bg: var(--hf-cyan); --bs-btn-active-border-color: var(--hf-cyan); --bs-btn-active-color: #08343a; }
a { color: var(--hf-blue); text-decoration: none; }
a:hover { color: #1149a3; text-decoration: underline; }

/* ===================== Headings ===================== */
h4 { font-size: 18px; }
h5 { font-size: 14px; }
h4 { color: var(--hf-gray); font-weight: 400; }
h5 { color: var(--hf-gray); font-weight: 600; }

/* ===================== Tables ===================== */
.table { --bs-table-bg: #fff; border-radius: 12px; overflow: hidden; margin: 0; }
.table > thead th { background: #fafbfc; border-bottom: 1px solid var(--hf-border); color: var(--hf-muted); font-weight: 800; text-transform: uppercase; font-size: 10px; letter-spacing: .04em; padding: .6rem .75rem; }
.table > tbody td { padding: .65rem .75rem; vertical-align: middle; border-color: #f0f1f4; }
.table > tbody > tr { cursor: pointer; }
.hf-col-id { color: var(--hf-muted); font-weight: 700; width: 1%; white-space: nowrap; }
.hf-col-data { color: var(--hf-muted); white-space: nowrap; width: 1%; }

/* busca acima das tabelas */
.hf-filtrando .card { opacity: .55; transition: opacity .12s; }
.hf-busca-tabela { position: relative; display: flex; align-items: center; gap: .4rem; max-width: 380px; margin-bottom: .6rem; }
.hf-busca-tabela i { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--hf-muted); font-size: 13px; pointer-events: none; }
.hf-busca-tabela input { padding-left: 2rem; }

/* ===================== Pager ===================== */
.hf-pager { display: flex; align-items: center; gap: .3rem; margin-top: 1rem; flex-wrap: wrap; }
.hf-pager-link { min-width: 28px; height: 28px; padding: 0 .4rem; border-radius: 8px; border: 1px solid var(--hf-border); background: #fff; color: var(--hf-gray); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; text-decoration: none; transition: background .15s, color .15s, border-color .15s; }
.hf-pager-link:hover { border-color: var(--hf-orange); color: var(--hf-orange); text-decoration: none; }
.hf-pager-link.active { background: var(--hf-orange); border-color: var(--hf-orange); color: #fff; }
.hf-pager-info { margin-left: auto; color: var(--hf-muted); font-size: 10px; }

/* ===================== Badges ===================== */
.hf-badge { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .5rem; border-radius: 999px; font-weight: 700; font-size: 10px; }
.hf-badge.ok { background: rgba(22,163,74,.12); color: #16a34a; }
.hf-badge.off { background: rgba(120,120,120,.14); color: #6b7280; }
.hf-badge.admin { background: rgba(238,117,34,.14); color: var(--hf-orange-dark); }
.hf-badge.cliente { background: rgba(22,89,196,.12); color: var(--hf-blue); }
.hf-badge.consultor { background: rgba(40,211,221,.16); color: #0e7c84; }
.hf-badge.interno_hf { background: rgba(27,83,134,.12); color: var(--hf-tasy); }

/* ===================== Forms ===================== */
.form-control, .form-select { font-size: 13px; border-radius: 8px; border-color: var(--hf-border); padding: .55rem .8rem; }
.form-control:focus, .form-select:focus { border-color: var(--hf-cyan); box-shadow: 0 0 0 .2rem rgba(40,211,221,.2); }
.form-label { font-weight: 700; color: var(--hf-gray); }
.form-check-input:checked { background-color: var(--hf-orange); border-color: var(--hf-orange); }
.form-check-input:focus { border-color: var(--hf-orange); box-shadow: 0 0 0 .2rem rgba(238,117,34,.18); }
.form-check-label { color: var(--hf-gray); }

/* toggles de permissao do perfil (um abaixo do outro) */
.hf-perms { border-color: var(--hf-border) !important; }
.hf-perm-row { padding: .5rem .2rem .5rem 2.6rem; border-bottom: 1px solid #f0f1f4; margin: 0; }
.hf-perm-row:last-child { border-bottom: 0; }
.hf-perm-row .form-check-input { width: 2rem; height: 1rem; margin-left: -2.6rem; margin-top: .1rem; cursor: pointer; }
.hf-perm-row .form-check-label { font-weight: 700; cursor: pointer; }
.hf-perm-row .form-check-label i { color: var(--hf-orange); }
.hf-perm-row .form-check-label span { font-weight: 400; font-size: 10px; }
#perm_total:checked { background-color: var(--hf-blue); border-color: var(--hf-blue); }

/* acesso as funcoes do sistema (switch + nivel, um por linha) */
.hf-funcoes { border-color: var(--hf-border) !important; }
.hf-funcao-row {
  display: flex; align-items: center; gap: .75rem;
  padding: .5rem .2rem; border-bottom: 1px solid #f0f1f4;
}
.hf-funcao-row:last-child { border-bottom: 0; }
.hf-funcao-row .form-check { flex: 1 1 auto; min-width: 0; margin: 0; padding-left: 2.6rem; }
.hf-funcao-row .form-check-input { width: 2rem; height: 1rem; margin-left: -2.6rem; margin-top: .1rem; cursor: pointer; }
.hf-funcao-row .form-check-label { font-weight: 700; cursor: pointer; }
/* o JS embrulha o <select> num .hf-select: a largura tem que ficar no wrapper,
   senao o campo estica e vaza para fora da caixa */
.hf-funcao-row .hf-select { flex: none; width: 220px; }
.hf-funcao-row .hf-select .hf-funcao-nivel { width: 100%; min-width: 0; }
.hf-funcao-nivel { width: 220px; min-width: 0; flex: none; }
.hf-funcao-nivel:disabled { background: #fff; color: var(--hf-muted); }
.hf-req { color: #dc3545; font-weight: 800; }
.hf-spin { display: inline-block; width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: hf-rot .6s linear infinite; vertical-align: -1px; }
@keyframes hf-rot { to { transform: rotate(360deg); } }

/* barra de progresso de download (portal) */
.hf-dlbar { display: inline-block; width: 90px; height: 6px; background: #eceef1; border-radius: 4px; overflow: hidden; vertical-align: middle; }
.hf-dlbar-fill { height: 100%; width: 0; background: var(--hf-orange); transition: width .15s; }
.hf-dlbar-fill.indet { width: 40% !important; animation: hf-indet 1s ease-in-out infinite; }
@keyframes hf-indet { 0%{margin-left:-40%} 100%{margin-left:100%} }
.hf-dlpct { display: inline-block; margin-left: .35rem; min-width: 32px; }

/* editar perfil em tela grande: a coluna das pastas e ancorada (absolute) na
   coluna do formulario, entao ela nao empurra a linha — as duas terminam juntas.
   Dentro dela: vinculadas fixas em 35% da altura, arvore ocupa o resto. */
@media (min-width: 992px) {
  .hf-perfil-grid > .col-lg-7 { position: relative; }
  .hf-perfil-grid > .col-lg-7 > .hf-lazy,
  .hf-perfil-grid > .col-lg-7 > .hf-pastas-pilha {
    position: absolute; top: 0; bottom: 0;
    left: calc(var(--bs-gutter-x) * .5); right: calc(var(--bs-gutter-x) * .5);
    display: flex; flex-direction: column; min-height: 0;
  }
  .hf-pastas-pilha { display: flex; flex-direction: column; min-height: 0; height: 100%; }
  /* 0 0 35%: nao cresce nem encolhe — o card do Drive ficava com todo o espaco */
  .hf-card-vinculadas { flex: 0 0 35%; min-height: 90px; display: flex; }
  .hf-card-vinculadas > .card-body { display: flex; flex-direction: column; min-height: 0; width: 100%; }
  .hf-card-vinculadas #hf-linked { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; min-height: 0; }
  .hf-card-drive { flex: 1 1 auto; min-height: 0; display: flex; }
  .hf-card-drive > .card-body { display: flex; flex-direction: column; min-height: 0; width: 100%; }
  .hf-card-drive .hf-tree { flex: 1 1 auto; min-height: 80px; max-height: none; }
}
/* somente visualizacao: uma coluna so, a lista rola dentro do card */
.hf-perfil-leitura #hf-linked { max-height: calc(100vh - var(--hf-topbar-h) - var(--hf-navbar-h) - var(--hf-footer-h) - 11rem); overflow-y: auto; overflow-x: hidden; }
.hf-linked-row { gap: .5rem; }
.hf-linked-nome { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* arvore de pastas (perfil) */
.hf-tree-search { position: relative; max-width: 360px; }
.hf-tree-search i { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--hf-muted); font-size: 13px; pointer-events: none; }
.hf-tree-search input { padding-left: 2rem; }
.hf-tree { border: 1px solid var(--hf-border); border-radius: 10px; padding: .3rem; max-height: 420px; overflow-y: auto; }
.hf-tree-row { display: flex; align-items: center; gap: .4rem; padding: .3rem .5rem; border-radius: 7px; }
.hf-tree-row:hover { background: #fafbfc; }
.hf-tree-ico { color: var(--hf-orange); font-size: 15px; flex: none; }
.hf-tree-name { font-weight: 600; color: var(--hf-gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hf-tree-toggle { flex: none; width: 18px; height: 18px; padding: 0; border: 0; background: transparent; color: var(--hf-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.hf-tree-toggle i { transition: transform .15s; font-size: 11px; }
.hf-tree-toggle.open i { transform: rotate(90deg); }
.hf-tree-spacer { flex: none; width: 18px; }
.hf-tree-toggle.hf-tree-loading i { display: none; }
.hf-tree-toggle.hf-tree-loading::before { content: ""; width: 11px; height: 11px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: hf-rot .6s linear infinite; }
.hf-tree-actions form { display: inline; }
code { color: var(--hf-blue); background: #eef2fb; padding: .1rem .35rem; border-radius: 5px; font-size: 11px; }

/* ===================== Login (estilo clássico) ===================== */
.hf-login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem;
  background:
    radial-gradient(circle at 20% 20%, rgba(238,117,34,.06), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(22,89,196,.06), transparent 40%),
    var(--hf-bg);
}
.hf-login-card {
  position: relative; width: 100%; max-width: 380px; background: #fff;
  border: 1px solid #d7dae0; border-radius: 6px; overflow: hidden;
  box-shadow: 0 6px 22px rgba(31,41,55,.14), inset 0 1px 0 #fff;
  padding: 2rem 2rem 1.5rem; animation: hf-fade .4s ease both;
}
.hf-login-logo { display: block; width: 150px; margin: .6rem auto 1rem; }
.hf-login-title { text-align: center; font-size: 15px; color: var(--hf-gray); margin: 0; font-weight: 400; }
.hf-login-title i { color: var(--hf-orange); }
.hf-login-sub { text-align: center; color: var(--hf-muted); font-size: 11px; margin: .15rem 0 1.3rem; }
.hf-login-card .form-label { font-weight: 700; font-size: 11px; color: var(--hf-gray); margin-bottom: .2rem; text-transform: uppercase; letter-spacing: .03em; }
.hf-login-card .input-group-text { background: #f3f4f6; border-color: var(--hf-border); color: var(--hf-muted); }
.hf-login-card .input-group .form-control { border-color: var(--hf-border); }
.hf-login-card .input-group:focus-within .input-group-text { border-color: var(--hf-orange); color: var(--hf-orange); }
.hf-login-card .btn-outline-secondary { --bs-btn-border-color: var(--hf-border); --bs-btn-color: var(--hf-muted); --bs-btn-hover-bg: #f3f4f6; --bs-btn-hover-border-color: var(--hf-border); --bs-btn-hover-color: var(--hf-gray); }
.hf-login-foot { text-align: center; color: var(--hf-muted); font-size: 10px; margin-top: 1.2rem; border-top: 1px solid #f0f1f4; padding-top: .8rem; }
.hf-accent { color: var(--hf-orange); }
