/* Componentes universais Hubbly. Não editar vendor CSS. */
/* Home welcome uses shared theme tokens and the same profile image as header.html. */
.hb-home-welcome{display:flex;align-items:center;gap:20px;margin:0 0 28px;padding:30px;border:1px solid var(--hb-border);border-radius:var(--hb-radius-lg);background:linear-gradient(115deg,var(--hb-surface),var(--hb-surface-muted));box-shadow:var(--hb-shadow);color:var(--hb-text)}
.hb-home-welcome__avatar{width:80px;height:80px;flex:0 0 80px;display:grid;place-items:center;overflow:hidden;border-radius:50%;border:1px solid var(--hb-border);background:var(--hb-surface-muted);color:var(--hb-primary)}
.hb-home-welcome__avatar img{width:100%;height:100%;object-fit:cover}.hb-home-welcome__avatar .hb-icon{width:32px;height:32px}.hb-home-welcome__content{min-width:0;overflow-wrap:anywhere}.hb-home-welcome h2{font-size:26px;margin:0 0 8px;font-weight:700}.hb-home-welcome p{margin:0 0 13px;color:var(--hb-muted)}.hb-home-welcome__badges{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.hb-home-welcome__company{display:inline-flex;gap:7px;align-items:center;font-size:12px;padding:5px 10px;background:var(--hb-hover);border-radius:20px}.hb-home-welcome__company .hb-icon{width:16px;height:16px;flex-shrink:0}@media(max-width:600px){.hb-home-welcome{padding:20px;gap:14px;align-items:flex-start}.hb-home-welcome h2{font-size:22px}.hb-home-welcome__avatar{width:60px;height:60px;flex-basis:60px}}
/* Marca Hubbly */
.hb-logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
  border: 0;
  outline: 0;
  line-height: 0;
}
.hb-logo-link:hover,
.hb-logo-link:focus,
.hb-logo-link:active { text-decoration: none !important; }
.hb-logo { display: block; max-width: 100%; }
.hb-logo--full { width: 122px; height: 38px; object-fit: contain; object-position: center; }
.hb-logo--symbol { display: none; width: 42px; height: 42px; object-fit: contain; object-position: center; }
.hb-logo--dark { display: none; }
html[data-bs-theme="dark"] .hb-logo--light { display: none; }
html[data-bs-theme="dark"] .hb-logo--dark.hb-logo--full { display: block; }

.hb-global-search { height: 38px; margin-left: clamp(16px, 6vw, 80px); display: flex; align-items: center; gap: 9px; border: 1px solid var(--hb-border); background: var(--hb-surface-muted); border-radius: 8px; padding: 0 11px; color: var(--hb-muted); min-width: 0; }
.hb-global-search:focus-within { border-color: rgba(var(--hb-primary-rgb), .55); box-shadow: 0 0 0 3px rgba(var(--hb-primary-rgb), .08); background: var(--hb-surface); }
.hb-global-search .hb-icon { width: 18px; height: 18px; }
.hb-global-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--hb-text); font-size: 13px; }
.hb-global-search input::placeholder { color: var(--hb-muted); }
.hb-global-search kbd { border: 0; background: transparent; color: var(--hb-muted); font-family: inherit; font-size: 10px; font-weight: 500; padding: 0; opacity: .7; }

.hb-icon-button { width: 38px; height: 38px; border: 0; background: transparent; color: var(--hb-muted); border-radius: 9px; display: grid; place-items: center; cursor: pointer; position: relative; transition: color var(--hb-transition), background var(--hb-transition); }
.hb-icon-button:hover { color: var(--hb-text); background: var(--hb-hover); }
.hb-icon-button .hb-icon { width: 20px; height: 20px; }
.hb-notification-dot { position: absolute; right: 7px; top: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--hb-primary); border: 2px solid var(--hb-topbar-bg); box-sizing: content-box; }
.hb-theme-icon--dark { display: none; }
html[data-bs-theme="dark"] .hb-theme-icon--light { display: none; }
html[data-bs-theme="dark"] .hb-theme-icon--dark { display: block; }

.hb-user-menu { margin-left: 5px; min-height: 44px; border: 0; border-left: 1px solid var(--hb-border); background: transparent; color: var(--hb-text); display: flex; align-items: center; gap: 10px; padding: 0 8px 0 15px; border-radius: 0; cursor: pointer; }
.hb-avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--hb-surface-muted); border: 1px solid var(--hb-border); color: var(--hb-muted); }
.hb-avatar .hb-icon { width: 23px; height: 23px; }
.hb-user-menu__text { display: grid; text-align: left; line-height: 1.15; min-width: 0; }
.hb-user-menu__text strong { font-size: 12px; font-weight: 600; max-width: 135px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-user-menu__text small { color: var(--hb-muted); font-size: 10px; margin-top: 3px; }
.hb-user-menu > .hb-icon { width: 15px; height: 15px; color: var(--hb-muted); }
.hb-user-dropdown { min-width: 210px; padding: 7px; border: 1px solid var(--hb-border); border-radius: 10px; box-shadow: var(--hb-shadow-menu); background: var(--hb-surface); }
.hb-dropdown-heading { color: var(--hb-muted); font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; padding: 6px 10px; }
.hb-user-dropdown .dropdown-item { border-radius: 7px; font-size: 13px; display: flex; align-items: center; gap: 9px; }
.hb-user-dropdown .dropdown-item .hb-icon { width: 17px; height: 17px; }
.hb-user-dropdown__version { padding: 6px 10px 3px; color: var(--hb-muted); font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }

.hb-quick-link { color: var(--hb-muted); text-decoration: none; padding: 5px 10px; border-radius: 6px; font-size: 12px; white-space: nowrap; transition: background var(--hb-transition), color var(--hb-transition); }
.hb-quick-link:hover, .hb-quick-link:focus, .hb-quick-link:active, .hb-quick-link.is-active { color: var(--hb-text); background: var(--hb-hover); text-decoration: none !important; }
.hb-quick-access__toggle { width: 28px; height: 28px; border: 0; border-radius: 7px; background: transparent; color: var(--hb-muted); display: grid; place-items: center; cursor: pointer; }
.hb-quick-access__toggle:hover { color: var(--hb-text); background: var(--hb-hover); }
.hb-quick-access__toggle .hb-icon { width: 16px; height: 16px; transform: rotate(180deg); }

.hb-nav-item { min-height: 44px; display: grid; grid-template-columns: 34px minmax(0,1fr) 20px; align-items: center; gap: 5px; padding: 0 9px; margin: 3px 0; border-radius: 8px; color: var(--hb-text); text-decoration: none; transition: color var(--hb-transition), background var(--hb-transition); overflow: hidden; }
.hb-nav-item:hover { color: var(--hb-text); background: var(--hb-hover); text-decoration: none !important; }
.hb-nav-item:focus, .hb-nav-item:active, .hb-nav-item:visited { text-decoration: none !important; }
.hb-nav-item.is-active { color: #fff; background: var(--hb-primary); text-decoration: none !important; }
.hb-nav-item__icon { width: 34px; height: 34px; display: grid; place-items: center; }
.hb-nav-item__icon .hb-icon { width: 21px; height: 21px; }
.hb-nav-item__label { font-size: 13px; font-weight: 500; white-space: nowrap; }
.hb-nav-item__arrow { justify-self: center; font-size: 24px; line-height: 1; opacity: .75; }
.hb-shell.is-sidebar-compact .hb-nav-item { grid-template-columns: 1fr; padding: 0; justify-items: center; }
.hb-shell.is-sidebar-compact .hb-nav-item__label, .hb-shell.is-sidebar-compact .hb-nav-item__arrow { display: none; }
.hb-shell.is-sidebar-compact .hb-nav-item__icon { width: 44px; height: 44px; }

.hb-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.hb-toolbar__search { min-width: 220px; max-width: 380px; flex: 1; }
.hb-filter-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--hb-border); background: var(--hb-surface); color: var(--hb-muted); border-radius: 999px; padding: 5px 10px; font-size: 12px; }
.hb-btn-block { width: 100%; }
.hb-status { display: inline-flex; align-items: center; gap: .4rem; }
.hb-status-dot { width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }


/* A compactação MANUAL da sidebar não altera a marca.
   A troca para o símbolo acontece somente quando a janela entra no breakpoint responsivo. */
@media (max-width: 991.98px) {
  .hb-logo-link { width: 100%; justify-content: center; }
  .hb-logo--full { display: none !important; }
  .hb-logo--symbol { width: 44px; height: 44px; }
  .hb-logo--symbol.hb-logo--light { display: block; }
  html[data-bs-theme="dark"] .hb-logo--symbol.hb-logo--light { display: none; }
  html[data-bs-theme="dark"] .hb-logo--symbol.hb-logo--dark { display: block; }

  /* A pesquisa continua sendo um campo completo no responsivo. */
  .hb-global-search {
    width: 100%;
    max-width: 100%;
    margin: 0;
    min-width: 120px;
  }
  .hb-global-search kbd { display: none; }
}

@media (max-width: 720px) {
  .hb-global-search {
    height: 36px;
    padding-inline: 9px;
    min-width: 110px;
  }
  .hb-global-search input { font-size: 12px; }
  .hb-topbar__actions { gap: 2px; }
  .hb-icon-button { width: 34px; height: 34px; }
  .hb-user-menu { margin-left: 2px; padding-left: 8px; padding-right: 4px; min-height: 38px; }
  .hb-avatar { width: 34px; height: 34px; }
}

@media (max-width: 560px) {
  /* Em telas estreitas a pesquisa diminui, mas nunca desaparece. */
  .hb-global-search {
    width: 100%;
    max-width: none;
    min-width: 96px;
    padding: 0 8px;
    gap: 7px;
    overflow: hidden;
  }
  .hb-global-search input {
    position: static;
    display: block;
    width: 100%;
    min-width: 0;
    height: auto;
    opacity: 1;
    color: var(--hb-text);
    caret-color: auto;
    padding: 0;
  }
  .hb-global-search .hb-icon {
    position: static;
    flex: 0 0 auto;
    pointer-events: none;
  }
}

/* --- Hubbly modular SaaS extensions --- */
.hb-file-icon{width:1.35rem;height:1.35rem;display:block;object-fit:contain;color:currentColor}
.hb-eyebrow{display:block;margin-bottom:.35rem;font-size:.72rem;font-weight:700;letter-spacing:.09em;text-transform:uppercase;color:var(--hb-primary)}
.hb-page-header--actions{display:flex;align-items:flex-start;justify-content:space-between;gap:1.5rem}
.hb-page-header--actions h1,.hb-page-header h1{margin:0 0 .35rem;font-size:1.75rem;letter-spacing:-.03em}.hb-page-header p{margin:0;color:var(--hb-muted)}
.hb-panel{background:var(--hb-surface);border:1px solid var(--hb-border);border-radius:var(--hb-radius-lg);padding:1.25rem;box-shadow:var(--hb-shadow-sm)}
.hb-panel h2{font-size:1.05rem;margin:0 0 1rem}.hb-panel--narrow{max-width:720px}
.hb-two-column{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(320px,.85fr);gap:1.25rem;align-items:start}
.hb-stat-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:1rem;margin-bottom:1.25rem}
.hb-stat-card{background:var(--hb-surface);border:1px solid var(--hb-border);border-radius:var(--hb-radius-lg);padding:1.2rem;display:flex;flex-direction:column;gap:.25rem}.hb-stat-card strong{font-size:1.8rem;line-height:1}.hb-stat-card span{font-size:.82rem;color:var(--hb-muted)}
.hb-admin-overview-stats .hb-stat-card{align-items:center;justify-content:center;text-align:center;transition:border-color .18s ease,transform .18s ease}
.hb-admin-overview-stats .hb-stat-card:hover{border-color:color-mix(in srgb,var(--hb-primary) 35%,var(--hb-border));transform:translateY(-1px)}
@media(prefers-reduced-motion:reduce){.hb-admin-overview-stats .hb-stat-card{transition:none}.hb-admin-overview-stats .hb-stat-card:hover{transform:none}}
.hb-admin-grid,.hb-card-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:1rem}.hb-card-link,.hb-module-card{display:flex;flex-direction:column;gap:.55rem;background:var(--hb-surface);border:1px solid var(--hb-border);border-radius:var(--hb-radius-lg);padding:1.2rem;text-decoration:none!important;color:inherit}.hb-card-link:hover{border-color:color-mix(in srgb,var(--hb-primary) 35%,var(--hb-border));transform:translateY(-1px)}.hb-card-link span,.hb-module-card p{color:var(--hb-muted);margin:0}
.hb-subnav{display:flex;gap:.35rem;overflow:auto;padding:.2rem 0 1rem;margin-bottom:1rem;border-bottom:1px solid var(--hb-border);scrollbar-width:thin}.hb-subnav a{white-space:nowrap;padding:.48rem .72rem;border-radius:.55rem;color:var(--hb-muted);font-size:.82rem;font-weight:600;text-decoration:none!important}.hb-subnav a:hover{background:var(--hb-surface-hover);color:var(--hb-text)}
.hb-list{display:flex;flex-direction:column}.hb-list-row{display:flex;justify-content:space-between;align-items:center;gap:1rem;padding:.8rem .15rem;border-bottom:1px solid var(--hb-border);color:inherit;text-decoration:none!important}.hb-list-row:last-child{border-bottom:0}.hb-list-row span:first-child{display:flex;flex-direction:column}.hb-list-row small,.hb-table td small{display:block;color:var(--hb-muted);margin-top:.15rem}
.hb-badge{display:inline-flex;align-items:center;justify-content:center;padding:.28rem .5rem;border-radius:999px;background:var(--hb-surface-hover);font-size:.7rem;font-weight:700;color:var(--hb-muted);white-space:nowrap}.hb-badge.is-success{background:rgba(47,179,68,.12);color:#2fb344}.hb-badge.is-info{background:rgba(32,107,196,.12);color:var(--hb-primary)}.hb-badge.is-danger{background:rgba(214,57,57,.12);color:#d63939}
.hb-table-wrap{overflow:auto}.hb-table{width:100%;border-collapse:collapse}.hb-table th{padding:.7rem .75rem;font-size:.7rem;text-transform:uppercase;letter-spacing:.05em;color:var(--hb-muted);text-align:left;border-bottom:1px solid var(--hb-border)}.hb-table td{padding:.8rem .75rem;border-bottom:1px solid var(--hb-border);vertical-align:middle}.hb-table tbody tr:hover{background:var(--hb-surface-hover)}
.hb-form p{display:flex;flex-direction:column;gap:.35rem;margin-bottom:.9rem}.hb-form label{font-size:.78rem;font-weight:650;color:var(--hb-text)}.hb-form input,.hb-form select,.hb-form textarea{width:100%;min-height:40px;border:1px solid var(--hb-border);border-radius:.6rem;background:var(--hb-surface);color:var(--hb-text);padding:.55rem .7rem;outline:none}.hb-form input:focus,.hb-form select:focus,.hb-form textarea:focus{border-color:var(--hb-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--hb-primary) 15%,transparent)}.hb-form input[type=checkbox]{width:auto;min-height:auto}.hb-form .helptext{font-size:.72rem;color:var(--hb-muted)}
.hb-switch-button{box-sizing:border-box;flex:0 0 42px;min-width:42px;max-width:42px;width:42px;height:24px;min-height:24px;border:0;border-radius:999px;background:var(--hb-border);padding:3px;cursor:pointer;transition:.2s}.hb-switch-button span{display:block;width:18px;height:18px;border-radius:50%;background:#fff;transition:.2s;box-shadow:0 1px 3px #0002}.hb-switch-button.is-on{background:var(--hb-primary)}.hb-switch-button.is-on span{transform:translateX(18px)}
.hb-panel-actions{display:flex;gap:.65rem;flex-wrap:wrap;margin-top:1rem}.hb-empty{color:var(--hb-muted);padding:1rem 0}.hb-muted{color:var(--hb-muted)}
.hb-permission-legend{display:flex;gap:1rem;flex-wrap:wrap;margin-bottom:1rem;font-size:.8rem;color:var(--hb-muted)}.hb-permission-legend span{display:flex;align-items:center;gap:.35rem}.hb-permission-legend i{width:9px;height:9px;border-radius:50%;background:var(--hb-border)}.hb-permission-legend i.is-allow{background:#2fb344}.hb-permission-legend i.is-deny{background:#d63939}.hb-permission-section{margin-bottom:1rem}.hb-permission-section>header{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.hb-permission-section>header p{color:var(--hb-muted);margin-top:.25rem}
.hb-notice-row{display:flex;justify-content:space-between;gap:1.2rem;padding:1rem 0;border-bottom:1px solid var(--hb-border)}.hb-notice-row h3{font-size:1rem;margin:.25rem 0}.hb-notice-row p{color:var(--hb-muted);margin:0}.hb-notice-row small{color:var(--hb-muted)}
.hb-profile-grid{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(280px,.7fr);gap:1.25rem}.hb-profile-hero{display:flex;gap:1rem;align-items:center;padding-bottom:1rem;margin-bottom:1rem;border-bottom:1px solid var(--hb-border)}.hb-profile-avatar{width:64px;height:64px;border-radius:50%;display:grid;place-items:center;background:color-mix(in srgb,var(--hb-primary) 14%,var(--hb-surface));color:var(--hb-primary);font-size:1.4rem;font-weight:800}.hb-profile-hero h2{margin:0}.hb-profile-hero p{margin:.2rem 0 0;color:var(--hb-muted)}.hb-meta-list>div{display:flex;justify-content:space-between;gap:1rem;padding:.7rem 0;border-bottom:1px solid var(--hb-border)}.hb-meta-list span{color:var(--hb-muted)}
.hb-toolbar{display:flex;align-items:center;gap:.65rem;margin-bottom:1rem}.hb-local-search{flex:1;display:flex;align-items:center;gap:.5rem;max-width:580px;border:1px solid var(--hb-border);border-radius:.65rem;background:var(--hb-surface);padding:0 .7rem}.hb-local-search input{border:0;background:transparent;outline:0;width:100%;height:40px;color:var(--hb-text)}
.hb-module-placeholder,.hb-empty-state{min-height:280px;border:1px dashed var(--hb-border);border-radius:var(--hb-radius-lg);display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:2.5rem;background:color-mix(in srgb,var(--hb-surface) 70%,transparent)}.hb-module-placeholder p,.hb-empty-state p{max-width:680px;color:var(--hb-muted)}.hb-module-placeholder__icon{font-size:2.2rem;color:var(--hb-primary)}
.hb-creative-library{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:1rem}.hb-creative-card{display:block;border:1px solid var(--hb-border);border-radius:var(--hb-radius-lg);overflow:hidden;background:var(--hb-surface);color:inherit;text-decoration:none!important}.hb-creative-card:hover{border-color:color-mix(in srgb,var(--hb-primary) 35%,var(--hb-border));transform:translateY(-2px)}.hb-creative-thumb{aspect-ratio:1/1.414;background:linear-gradient(145deg,var(--hb-surface-hover),var(--hb-bg));display:grid;place-items:center;color:var(--hb-muted)}.hb-creative-card>div:last-child{padding:.85rem;display:flex;flex-direction:column}.hb-creative-card small{color:var(--hb-muted);margin-top:.2rem}
.hb-creative-editor{position:relative;margin:-12px -4px 0}.hb-creative-editor__top{display:flex;align-items:center;gap:.75rem;padding:.65rem;border:1px solid var(--hb-border);border-radius:.75rem;background:var(--hb-surface);margin-bottom:.75rem}.hb-creative-editor__top>div:last-child{display:flex;gap:.5rem}.hb-creative-title{flex:1;border:0;background:transparent;text-align:center;font-weight:700;color:var(--hb-text);outline:none}.hb-creative-shell{display:grid;grid-template-columns:180px minmax(0,1fr) 220px;height:calc(100vh - 185px);min-height:560px;border:1px solid var(--hb-border);border-radius:.8rem;overflow:hidden;background:var(--hb-surface)}.hb-creative-tools,.hb-creative-properties{padding:1rem;background:var(--hb-surface);overflow:auto}.hb-creative-tools{border-right:1px solid var(--hb-border)}.hb-creative-properties{border-left:1px solid var(--hb-border)}.hb-creative-tools h3,.hb-creative-properties h3{font-size:.78rem;text-transform:uppercase;letter-spacing:.06em;color:var(--hb-muted)}.hb-creative-tools button{width:100%;text-align:left;border:1px solid var(--hb-border);background:var(--hb-surface-hover);color:var(--hb-text);padding:.55rem .65rem;border-radius:.55rem;margin-bottom:.45rem;cursor:pointer}.hb-creative-tools p{font-size:.72rem;color:var(--hb-muted)}.hb-creative-stage{overflow:auto;background:var(--hb-bg);padding:40px}.hb-creative-canvas-wrap{min-width:max-content;display:flex;justify-content:center}.hb-creative-canvas{position:relative;background:#fff;box-shadow:0 8px 30px #0002;overflow:hidden;transform-origin:top center}.hb-canvas-element{position:absolute;border:1px dashed transparent;display:flex;align-items:center;justify-content:center;padding:4px;color:#1f2937;cursor:move;user-select:none;background:rgba(32,107,196,.06)}.hb-canvas-element.is-selected{border-color:#206bc4;box-shadow:0 0 0 1px #fff inset}.hb-resize-handle{position:absolute!important;width:12px!important;height:12px!important;right:-6px;bottom:-6px;background:#206bc4!important;border:2px solid #fff;border-radius:50%;cursor:nwse-resize}.hb-creative-properties label{display:flex;flex-direction:column;gap:.25rem;font-size:.72rem;color:var(--hb-muted);margin-bottom:.6rem}.hb-creative-properties input{border:1px solid var(--hb-border);border-radius:.5rem;padding:.45rem .5rem;background:var(--hb-bg);color:var(--hb-text)}
@media(max-width:1000px){.hb-two-column,.hb-profile-grid{grid-template-columns:1fr}.hb-creative-shell{grid-template-columns:150px minmax(0,1fr)}.hb-creative-properties{display:none}}
@media(max-width:720px){.hb-page-header--actions{flex-direction:column}.hb-toolbar{flex-wrap:wrap}.hb-local-search{max-width:none;min-width:100%}.hb-creative-shell{grid-template-columns:1fr}.hb-creative-tools{display:none}}
.hb-quick-caption{font-size:.62rem;text-transform:uppercase;letter-spacing:.06em;color:var(--hb-muted);padding:0 .2rem 0 .5rem;align-self:center}.hb-quick-link.is-recent{opacity:.82}
.hb-home-intro{display:flex;justify-content:space-between;align-items:end;margin-bottom:1rem}.hb-home-intro h2{margin:0;font-size:1.15rem}.hb-home-intro p{margin:.25rem 0 0;color:var(--hb-muted)}.hb-app-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:1rem}.hb-app-card{display:grid;grid-template-columns:52px 1fr auto;gap:1rem;align-items:center;padding:1.15rem;border:1px solid var(--hb-border);border-radius:var(--hb-radius-lg);background:var(--hb-surface);color:inherit;text-decoration:none!important;transition:.18s}.hb-app-card:hover,.report-summary-card:hover{transform:translateY(-2px);border-color:color-mix(in srgb,var(--hb-primary) 35%,var(--hb-border));box-shadow:var(--hb-shadow-sm)}.hb-app-card__icon{width:52px;height:52px;border-radius:14px;display:grid;place-items:center;background:color-mix(in srgb,var(--hb-primary) 10%,var(--hb-surface));color:var(--hb-primary)}.hb-app-card__icon .hb-icon{width:26px;height:26px}.hb-app-card__body>span{font-size:.65rem;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:var(--hb-muted)}.hb-app-card h3{margin:.15rem 0 .3rem;font-size:1rem}.hb-app-card p{margin:0;color:var(--hb-muted);font-size:.82rem}.hb-app-card__arrow{font-size:1.4rem;color:var(--hb-muted)}
.hb-sql-form textarea{width:100%;min-height:260px;resize:vertical;border:1px solid var(--hb-border);border-radius:.65rem;background:#111827;color:#d1fae5;font:13px/1.55 ui-monospace,SFMono-Regular,Consolas,monospace;padding:1rem;outline:none}.hb-sql-toolbar{display:flex;justify-content:space-between;gap:.75rem;margin-bottom:.75rem}.hb-sql-toolbar select{min-width:180px;border:1px solid var(--hb-border);border-radius:.55rem;background:var(--hb-surface);color:var(--hb-text);padding:.5rem}
.hb-rule-editor{display:grid;grid-template-columns:140px minmax(180px,1fr) minmax(260px,1.4fr) 180px auto;gap:.65rem;align-items:end}.hb-rule-editor label{display:flex;flex-direction:column;gap:.3rem;font-size:.72rem;font-weight:700;color:var(--hb-muted)}.hb-rule-editor select{height:40px;border:1px solid var(--hb-border);border-radius:.55rem;background:var(--hb-surface);color:var(--hb-text);padding:0 .55rem}@media(max-width:1100px){.hb-rule-editor{grid-template-columns:1fr 1fr}.hb-rule-editor .btn{align-self:end}}

/* Arquivos SVG próprios são carregados por <img>; neutralizamos a cor no asset e
   garantimos contraste no item ativo da navegação. */
.hb-nav-item.is-active .hb-file-icon,
.hb-sidebar .hb-nav-item.active .hb-file-icon {
    filter: brightness(0) invert(1);
}

/* --- Acesso rápido SaaS --- */
.hb-quick-chip {
  display: inline-flex;
  align-items: center;
  height: 26px;
  border-radius: 7px;
  background: transparent;
  white-space: nowrap;
}
.hb-quick-chip:hover { background: var(--hb-hover); }
.hb-quick-chip .hb-quick-link { padding-right: 3px; }
.hb-quick-chip__pin,
.hb-quick-chip__close {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 5px;
  display: grid;
  place-items: center;
  padding: 0;
  background: transparent;
  color: var(--hb-muted);
  cursor: pointer;
  opacity: .68;
}
.hb-quick-chip__pin:hover,
.hb-quick-chip__close:hover { opacity: 1; background: color-mix(in srgb, var(--hb-primary) 10%, transparent); }
.hb-quick-chip__pin.is-pinned { opacity: 1; }
.hb-quick-chip__pin .hb-icon { width: 14px; height: 14px; }
.hb-quick-chip__close .hb-icon { width: 11px; height: 11px; }
.hb-quick-separator {
  width: 1px;
  height: 18px;
  flex: 0 0 1px;
  background: var(--hb-border-strong);
  margin: 0 7px;
}
.hb-quick-caption { display: none !important; }

/* Sidebar por categoria */
.hb-nav-category__trigger { cursor: pointer; }
.hb-nav-category__trigger.is-active { color: #fff; background: var(--hb-primary); }
.hb-nav-category__trigger.is-active .hb-file-icon { filter: brightness(0) invert(1); }

/* Administração integrada aos módulos */
.hb-settings-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1rem; }
.hb-settings-grid__wide { grid-column:1 / -1; }
.hb-panel-heading { display:flex; justify-content:space-between; gap:1rem; align-items:flex-start; margin-bottom:1rem; }
.hb-panel-heading h2 { margin:.1rem 0 0; font-size:1rem; }
.hb-panel-heading p { margin:.3rem 0 0; color:var(--hb-muted); font-size:.8rem; }
.hb-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.8rem 1rem; }
.hb-form-grid--4 { grid-template-columns:repeat(4,minmax(0,1fr)); }
.hb-form-grid > label { display:flex; flex-direction:column; gap:.32rem; font-size:.75rem; font-weight:650; color:var(--hb-text); }
.hb-form-grid input,.hb-form-grid select,.hb-form-grid textarea,.hb-inline-admin-form input,.hb-inline-admin-form select { min-height:40px; border:1px solid var(--hb-border); border-radius:.6rem; background:var(--hb-surface); color:var(--hb-text); padding:.55rem .7rem; outline:0; }
.hb-check-grid { display:flex; flex-wrap:wrap; gap:.7rem 1.3rem; margin-top:1rem; }
.hb-check-grid label,.hb-inline-check { display:flex!important; flex-direction:row!important; align-items:center; gap:.5rem; font-size:.78rem; color:var(--hb-text); }
.hb-check-grid input,.hb-inline-check input { width:auto!important; min-height:auto!important; }
.hb-settings-users { margin-top:1rem; }
.hb-inline-admin-form { display:grid; grid-template-columns:minmax(220px,1fr) 220px 100px auto; gap:.75rem; align-items:end; margin-bottom:1rem; }
.hb-inline-admin-form > label { display:flex; flex-direction:column; gap:.3rem; font-size:.74rem; font-weight:650; }
.hb-table-actions { width:1%; white-space:nowrap; text-align:right; }
@media(max-width:1100px){.hb-form-grid--4{grid-template-columns:repeat(2,minmax(0,1fr))}.hb-inline-admin-form{grid-template-columns:1fr 1fr}}
@media(max-width:760px){.hb-settings-grid,.hb-form-grid,.hb-form-grid--4,.hb-inline-admin-form{grid-template-columns:1fr}.hb-settings-grid__wide{grid-column:auto}}

/* --- Refinamento da barra de acesso rápido --- */
.hb-quick-chip {
  width: 176px;
  min-width: 176px;
  max-width: 176px;
  height: 28px;
  padding: 0 3px 0 0;
  overflow: hidden;
  border-radius: 7px;
  transition: background var(--hb-transition), color var(--hb-transition);
}
.hb-quick-chip:hover { background: var(--hb-hover); }
.hb-quick-chip .hb-quick-link {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 5px 7px 5px 10px;
  border-radius: 0;
  background: transparent !important;
  color: inherit;
}
.hb-quick-chip .hb-quick-link:hover,
.hb-quick-chip .hb-quick-link:focus,
.hb-quick-chip .hb-quick-link:active,
.hb-quick-chip .hb-quick-link.is-active {
  background: transparent !important;
  color: inherit;
}
.hb-quick-chip.is-active {
  color: #fff;
  background: var(--hb-primary);
}
.hb-quick-chip.is-active:hover { background: var(--hb-primary); }
.hb-quick-chip.is-active .hb-quick-link,
.hb-quick-chip.is-active .hb-quick-link.is-recent { color: #fff; opacity: 1; }
.hb-quick-chip.is-active .hb-quick-chip__pin,
.hb-quick-chip.is-active .hb-quick-chip__close { color: #fff; opacity: .88; }
.hb-quick-chip.is-active .hb-quick-chip__pin:hover,
.hb-quick-chip.is-active .hb-quick-chip__close:hover { background: rgba(255,255,255,.14); opacity: 1; }
.hb-quick-chip.is-active .hb-icon { filter: brightness(0) invert(1); }
.hb-quick-chip__pin,
.hb-quick-chip__close { flex: 0 0 22px; }

.hb-confirm[hidden] { display: none !important; }
.hb-confirm {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
}
.hb-confirm__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .34);
  backdrop-filter: blur(2px);
}
.hb-confirm__dialog {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px 14px;
  padding: 20px;
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius-lg);
  background: var(--hb-surface);
  box-shadow: 0 18px 50px rgba(15, 23, 42, .22);
}
.hb-confirm__icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--hb-primary);
  background: color-mix(in srgb, var(--hb-primary) 10%, transparent);
}
.hb-confirm__icon .hb-icon { width: 18px; height: 18px; }
.hb-confirm__content h3 { margin: 1px 0 5px; font-size: 15px; }
.hb-confirm__content p { margin: 0; color: var(--hb-muted); font-size: 13px; line-height: 1.45; }
.hb-confirm__actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}
.hb-modal-open { overflow: hidden; }

/* Ícones personalizados: SVG estático + Lottie JSON no hover */
.hb-lottie-icon { width: 1.35rem; height: 1.35rem; display: block; position: relative; flex: 0 0 auto; }
.hb-lottie-icon__static, .hb-lottie-icon__animation { width: 100%; height: 100%; display: block; }
.hb-lottie-icon__animation { overflow: visible; }
.hb-lottie-icon__animation > svg {
  width: 100% !important;
  height: 100% !important;
  display: block;
  transform: scale(var(--hb-lottie-scale, 1)) !important;
  overflow: visible !important;
  transform-origin: 50% 50%;
}
.hb-nav-item__icon .hb-lottie-icon { width: 21px; height: 21px; }
.hb-sidebar-flyout__item .hb-lottie-icon { width: 28px; height: 28px; }
.hb-avatar img{width:100%;height:100%;object-fit:cover;border-radius:50%;display:block}


/* Administração · Tenant */
.hb-tenant-layout{
  grid-template-columns:repeat(2,minmax(0,1fr));
  max-width:1380px;
  margin-inline:auto;
  align-items:stretch;
}
.hb-tenant-panel{
  height:clamp(620px, 68vh, 760px);
  min-height:620px;
  display:flex;
  flex-direction:column;
  min-width:0;
  min-height:0;
  overflow:hidden;
}
.hb-tenant-panel--form .hb-tenant-form{
  flex:1;
  min-height:0;
  display:flex;
  flex-direction:column;
  overflow:auto;
  padding-right:.2rem;
  scrollbar-gutter:stable;
}
.hb-tenant-panel--form .hb-tenant-form .btn{margin-top:1rem;align-self:flex-start;flex:0 0 auto}
.hb-tenant-panel--list .hb-tenant-list{
  flex:1;
  min-height:0;
  overflow:auto;
  padding-right:.2rem;
  scrollbar-gutter:stable;
}
.hb-tenant-form p.hb-checkbox-field{
  display:grid;
  grid-template-columns:20px minmax(0,1fr);
  column-gap:.55rem;
  row-gap:.22rem;
  align-items:center;
}
.hb-tenant-form p.hb-checkbox-field input[type=checkbox]{
  grid-column:1;
  grid-row:1;
  width:18px;
  height:18px;
  margin:0;
  justify-self:start;
}
.hb-tenant-form p.hb-checkbox-field label{
  grid-column:2;
  grid-row:1;
  margin:0;
  line-height:1.25;
}
.hb-tenant-form p.hb-checkbox-field .helptext,
.hb-tenant-form p.hb-checkbox-field .errorlist{
  grid-column:2;
}
.hb-tenant-detail-layout{max-width:1380px;margin-inline:auto}

@media(max-width:1000px){
  .hb-tenant-layout,.hb-tenant-detail-layout{grid-template-columns:1fr;max-width:none}
  .hb-tenant-panel{height:auto;min-height:0;overflow:visible}
  .hb-tenant-panel--form .hb-tenant-form{overflow:visible;padding-right:0}
  .hb-tenant-panel--list .hb-tenant-list{max-height:520px}
  .hb-tenant-panel--form .hb-tenant-form .btn{margin-top:1rem}
}

/* Empresas: cadastro e listagem seguem o mesmo padrão responsivo dos Tenants. */
.hb-company-layout{
  grid-template-columns:minmax(360px,1fr) minmax(360px,1fr);
  max-width:1380px;
  margin-inline:auto;
  align-items:stretch;
}
.hb-company-panel{
  height:clamp(620px,68vh,760px);
  min-height:620px;
  display:flex;
  flex-direction:column;
  min-width:0;
  overflow:hidden;
}
.hb-company-panel--form .hb-company-form{
  min-height:0;
  flex:1 1 auto;
  overflow-y:auto;
  overflow-x:hidden;
  padding-right:.45rem;
  scrollbar-gutter:stable;
}
.hb-company-panel--form .hb-company-form .btn{
  margin-top:1rem;
  align-self:flex-start;
  flex:0 0 auto;
}
.hb-company-panel--list .hb-company-list{
  min-height:0;
  flex:1 1 auto;
  overflow-y:auto;
  overflow-x:hidden;
  padding-right:.25rem;
  scrollbar-gutter:stable;
}
.hb-company-form p.hb-checkbox-field{
  display:grid;
  grid-template-columns:18px minmax(0,1fr);
  grid-template-areas:"check label" "help help" "error error";
  align-items:center;
  column-gap:.55rem;
  row-gap:.25rem;
}
.hb-company-form p.hb-checkbox-field input[type=checkbox]{
  grid-area:check;
  width:18px;
  height:18px;
  min-height:18px;
  margin:0;
}
.hb-company-form p.hb-checkbox-field label{
  grid-area:label;
  margin:0;
  line-height:1.2;
}
.hb-company-form p.hb-checkbox-field .helptext{grid-area:help}
.hb-company-form p.hb-checkbox-field .errorlist{grid-area:error}
.hb-company-row{cursor:default}

@media(max-width:1000px){
  .hb-company-layout{grid-template-columns:1fr;max-width:none}
  .hb-company-panel{height:auto;min-height:0;overflow:visible}
  .hb-company-panel--form .hb-company-form{overflow:visible;padding-right:0}
  .hb-company-panel--list .hb-company-list{max-height:520px}
}

/* Empresas: identidade alinhada à esquerda e linha clicável para edição. */
.hb-company-form__header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  margin-bottom:.35rem;
}
.hb-company-form__header h2{margin:0}
.hb-company-row{
  cursor:pointer;
  border-radius:8px;
  padding:.8rem;
  transition:background-color .15s ease,border-color .15s ease;
}
.hb-company-row:hover,
.hb-company-row.is-selected{
  background:var(--hb-surface-soft,rgba(255,255,255,.035));
}
.hb-company-row.is-selected{
  box-shadow:inset 3px 0 0 var(--hb-primary,#206bc4);
}
.hb-company-row .hb-company-list__main,
.hb-cosmos-connection-row .hb-company-list__main{
  display:flex!important;
  flex-direction:row!important;
  align-items:center!important;
  justify-content:flex-start;
  gap:.85rem;
  min-width:0;
  width:100%;
}
.hb-company-list__logo-wrap{
  display:flex!important;
  flex:0 0 auto;
  align-items:center;
  justify-content:center;
}
.hb-company-list__details{
  display:flex!important;
  flex-direction:column!important;
  align-items:flex-start;
  justify-content:center;
  min-width:0;
}
.hb-company-list__details strong,
.hb-company-list__details small{
  text-align:left;
  margin:0;
}
.hb-company-list__details strong{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  max-width:100%;
}
.hb-company-list__logo{
  width:46px;
  height:46px;
  object-fit:contain;
  border-radius:7px;
  border:1px solid var(--hb-border);
  padding:3px;
  background:var(--hb-surface);
}
.hb-company-list__logo--empty{display:block}

/* Empresas: CNPJ em linha única e pré-visualização limpa da logomarca em edição. */
.hb-company-list__details small{white-space:nowrap}
.hb-company-logo-preview{
  margin:.15rem 0 1rem;
  padding:.8rem;
  border:1px solid var(--hb-border);
  border-radius:10px;
  background:var(--hb-surface-soft,rgba(255,255,255,.025));
}
.hb-company-logo-preview__label{
  display:block;
  margin-bottom:.55rem;
  font-size:.78rem;
  color:var(--hb-muted);
}
.hb-company-logo-preview__content{
  display:flex;
  align-items:center;
  gap:.85rem;
  min-width:0;
}
.hb-company-logo-preview__content img{
  width:68px;
  height:68px;
  flex:0 0 68px;
  object-fit:contain;
  border:1px solid var(--hb-border);
  border-radius:9px;
  padding:5px;
  background:var(--hb-surface);
}
.hb-company-logo-preview__content div{display:flex;flex-direction:column;min-width:0;gap:.15rem}
.hb-company-logo-preview__content strong{line-height:1.2}
.hb-company-logo-preview__content small,
.hb-company-logo-preview__content span{color:var(--hb-muted);font-size:.78rem;overflow-wrap:anywhere}

/* Cosmos / Firebird: CRUD integrado ao painel Hubbly. */
.hb-cosmos-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:1rem;
  max-width:1380px;
  margin-inline:auto;
}
.hb-cosmos-panel{min-width:0}
.hb-cosmos-panel__header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:1rem;
  margin-bottom:1rem;
}
.hb-cosmos-panel__header h2{margin:0 0 .2rem}
.hb-cosmos-panel__header p{margin:0;color:var(--hb-muted);font-size:.85rem}
.hb-cosmos-form .btn[type=submit]{margin-top:.8rem}
.hb-cosmos-list-panel{max-width:1380px;margin:1rem auto 0}
.hb-inline-form{display:inline-flex;margin:0}
.hb-table-actions{white-space:nowrap;text-align:right}
.hb-table-actions .btn+.hb-inline-form{margin-left:.35rem}
.hb-table-subtitle{display:block;margin-top:.15rem;color:var(--hb-muted)}
@media(max-width:1000px){.hb-cosmos-grid{grid-template-columns:1fr}}

/* Cosmos simplificado: uma conexão corresponde a uma única loja. */
.hb-cosmos-connection-list{
  display:flex;
  flex-direction:column;
  gap:.65rem;
  width:100%;
  min-width:0;
}
.hb-cosmos-connection-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  width:100%;
  min-width:0;
  min-height:88px;
  box-sizing:border-box;
  padding:.85rem 1rem;
  border:1px solid var(--hb-border);
  border-radius:10px;
  background:var(--hb-surface-soft,rgba(255,255,255,.025));
  cursor:pointer;
  transition:border-color .16s ease,background .16s ease;
}
.hb-cosmos-connection-row:hover,
.hb-cosmos-connection-row:focus-visible{
  border-color:var(--hb-primary);
  outline:none;
}
.hb-cosmos-connection-row.is-selected{
  border-left:3px solid var(--hb-primary);
}
.hb-cosmos-connection-row__main{
  display:flex;
  min-width:0;
  flex-direction:column;
  gap:.18rem;
}
.hb-cosmos-connection-row__main small{color:var(--hb-muted)}
.hb-cosmos-path{
  max-width:520px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.hb-cosmos-connection-row__meta{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:.45rem;
  flex-wrap:wrap;
}
@media(max-width:700px){
  .hb-cosmos-connection-row{align-items:flex-start;flex-direction:column}
  .hb-cosmos-connection-row__meta{justify-content:flex-start}
}

/* Cosmos: formulário, validação e navegador server-side do Firebird. */
.hb-cosmos-form .hb-form-field{
  display:flex;
  flex-direction:column;
  gap:.35rem;
  margin-bottom:.9rem;
}
.hb-cosmos-form .hb-form-field>label:not(.hb-checkbox-label){font-weight:600}
.hb-cosmos-form .hb-form-field input:not([type="checkbox"]),
.hb-cosmos-form .hb-form-field select{width:100%}
.hb-firebird-path-row{display:flex;gap:.5rem;align-items:center}
.hb-firebird-path-row input{min-width:0;flex:1}
.hb-firebird-browse-btn{
  flex:0 0 auto;
  width:40px;
  height:40px;
  display:grid;
  place-items:center;
  padding:0;
  border:1px solid var(--hb-primary);
  border-radius:.6rem;
  background:var(--hb-primary);
  color:#fff;
  cursor:pointer;
  transition:background .18s,border-color .18s,box-shadow .18s,transform .18s;
}
.hb-firebird-browse-btn:hover{
  background:var(--hb-primary-hover);
  border-color:var(--hb-primary-hover);
  box-shadow:0 0 0 3px rgba(var(--hb-primary-rgb),.10);
}
.hb-firebird-browse-btn:active{transform:translateY(1px)}
.hb-firebird-browse-btn:focus-visible{outline:none;box-shadow:0 0 0 3px rgba(var(--hb-primary-rgb),.18)}
.hb-firebird-browse-btn .hb-icon,
.hb-firebird-browse-btn .hb-lottie-icon{width:20px;height:20px;color:#fff}
.hb-firebird-browse-btn .hb-icon{filter:brightness(0) invert(1)}
.hb-firebird-browse-btn .hb-lottie-icon__animation{color:#fff!important;opacity:1!important}
.hb-checkbox-field{align-items:flex-start}
.hb-checkbox-label{
  display:inline-flex;
  align-items:center;
  gap:.55rem;
  cursor:pointer;
  font-weight:500;
}
.hb-checkbox-label input[type="checkbox"]{margin:0;order:0}
.hb-checkbox-label span{order:1}
.hb-cosmos-form-actions{
  display:flex;
  align-items:center;
  gap:.55rem;
  margin-top:1rem;
  flex-wrap:wrap;
}
.hb-cosmos-form .hb-cosmos-form-actions .btn{margin-top:0}
.hb-form-errors,.hb-field-error{color:var(--hb-danger,#dc3545)}
.hb-form-errors{margin-bottom:.85rem}
.hb-form-errors ul{margin:0;padding-left:1.1rem}
.hb-field-error{font-size:.82rem}
.hb-help{color:var(--hb-muted)}

.hb-firebird-browser{
  width:min(760px,calc(100vw - 2rem));
  max-height:min(680px,calc(100vh - 2rem));
  padding:0;
  border:1px solid var(--hb-border);
  border-radius:12px;
  background:var(--hb-surface,#20262b);
  color:inherit;
  box-shadow:0 18px 60px rgba(0,0,0,.35);
}
.hb-firebird-browser::backdrop{background:rgba(0,0,0,.55)}
.hb-firebird-browser__header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
  padding:1rem;
  border-bottom:1px solid var(--hb-border);
}
.hb-firebird-browser__header>div{display:flex;flex-direction:column;gap:.2rem;min-width:0}
.hb-firebird-browser__header small{
  color:var(--hb-muted);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.hb-firebird-browser__toolbar{display:flex;gap:.45rem;padding:.75rem 1rem;border-bottom:1px solid var(--hb-border)}
.hb-firebird-browser__list{
  display:flex;
  flex-direction:column;
  min-height:220px;
  max-height:430px;
  overflow:auto;
  padding:.45rem;
}
.hb-firebird-browser__entry{
  display:flex;
  align-items:center;
  gap:.7rem;
  width:100%;
  padding:.65rem .75rem;
  border:0;
  border-radius:7px;
  background:transparent;
  color:inherit;
  text-align:left;
  cursor:pointer;
}
.hb-firebird-browser__entry:hover,.hb-firebird-browser__entry:focus-visible{background:rgba(255,255,255,.06);outline:none}
.hb-firebird-browser__entry.is-file{font-weight:600}
.hb-firebird-browser__entry-icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:28px;
  height:22px;
  border:1px solid var(--hb-border);
  border-radius:5px;
  font-size:.68rem;
  color:var(--hb-muted);
}
.hb-firebird-browser__status{padding:.7rem 1rem 1rem;color:var(--hb-muted);font-size:.85rem}
@media(max-width:620px){
  .hb-firebird-path-row{align-items:center;flex-direction:row}
  .hb-firebird-browse-btn{width:40px;min-width:40px}
}

/* Navegação de banco Firebird no servidor, inclusive caminhos UNC. */
.hb-firebird-browser__pathbar{
  display:flex;
  gap:.5rem;
  padding:.75rem 1rem 0;
}
.hb-firebird-browser__pathbar input{
  flex:1;
  min-width:0;
  height:36px;
  border:1px solid var(--hb-border);
  border-radius:7px;
  background:var(--hb-surface-muted);
  color:inherit;
  padding:0 .7rem;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:.85rem;
}
.hb-firebird-browser__pathbar input:focus{
  outline:none;
  border-color:rgba(var(--hb-primary-rgb),.6);
  box-shadow:0 0 0 3px rgba(var(--hb-primary-rgb),.08);
}
.hb-firebird-browser__toolbar{align-items:center;flex-wrap:wrap}
.hb-firebird-browser__toolbar small{margin-left:auto;color:var(--hb-muted);font-size:.78rem}
\n\n/* Campo de senha Firebird com alternância exibir/ocultar. */
.hb-cosmos-password-toggle [hidden]{display:none!important}


/* Cosmos: senha com o mesmo padrão visual do controle de senha do perfil. */
.hb-cosmos-password-field {
  position: relative;
  width: 100%;
}

.hb-cosmos-password-field input {
  width: 100%;
  padding-right: 52px !important;
}

.hb-cosmos-password-toggle {
  position: absolute;
  top: 50%;
  right: 9px;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--hb-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
}

.hb-cosmos-password-toggle:hover {
  color: var(--hb-text);
  background: var(--hb-surface-muted);
}

.hb-cosmos-password-toggle:focus-visible {
  outline: 2px solid var(--hb-primary, #1684f8);
  outline-offset: 1px;
}

.hb-cosmos-password-eye {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hb-cosmos-password-eye[hidden] {
  display: none !important;
}

.hb-cosmos-password-eye svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}


/* Relações administrativas compactas: Tenant -> Empresas / Empresa -> Conexões. */
.hb-company-meta-line{
  display:flex !important;
  align-items:center;
  gap:0;
  white-space:nowrap !important;
  line-height:1.35;
}
.hb-company-meta-line--tenant{
  color:var(--hb-muted);
  opacity:.9;
}

.hb-link-summary{
  margin:1rem 0 .15rem;
  border:1px solid var(--hb-border);
  border-radius:10px;
  background:var(--hb-surface-soft,rgba(255,255,255,.025));
  overflow:hidden;
}
.hb-link-summary__header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  padding:.72rem .8rem;
  border-bottom:1px solid var(--hb-border);
}
.hb-link-summary__header > div{
  display:flex;
  flex-direction:column;
  gap:.08rem;
  min-width:0;
}
.hb-link-summary__header strong{
  font-size:.82rem;
  line-height:1.25;
}
.hb-link-summary__header small{
  color:var(--hb-muted);
  font-size:.72rem;
}
.hb-link-summary__count{
  min-width:26px;
  height:26px;
  padding:0 .45rem;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:color-mix(in srgb,var(--hb-primary) 12%,var(--hb-surface));
  color:var(--hb-primary);
  font-size:.72rem;
  font-weight:700;
}
.hb-link-summary__items{
  max-height:210px;
  overflow:auto;
}
.hb-link-summary__item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.8rem;
  padding:.62rem .8rem;
  color:inherit;
  text-decoration:none !important;
  border-bottom:1px solid color-mix(in srgb,var(--hb-border) 70%,transparent);
  transition:background-color .15s ease;
}
.hb-link-summary__item:last-child{
  border-bottom:0;
}
.hb-link-summary__item:hover{
  background:color-mix(in srgb,var(--hb-primary) 6%,var(--hb-surface));
}
.hb-link-summary__item > span:first-child{
  display:flex;
  flex-direction:column;
  gap:.08rem;
  min-width:0;
}
.hb-link-summary__item strong{
  font-size:.79rem;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.hb-link-summary__item small{
  color:var(--hb-muted);
  font-size:.7rem;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.hb-link-summary__empty{
  display:block;
  padding:.78rem .8rem;
  color:var(--hb-muted);
  font-size:.76rem;
}


/* Administração: cards cadastrados com dimensões consistentes em
   Empresas, Tenants, Cosmos, APIs e SMTP. */
.hb-company-panel--list .hb-cosmos-connection-list,
.hb-tenant-panel--list .hb-cosmos-connection-list,
.hb-cosmos-connections-panel .hb-cosmos-connection-list,
.hb-cosmos-panel .hb-cosmos-connection-list{
  width:100%;
}

.hb-cosmos-connection-row .hb-company-list__logo-wrap{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  flex:0 0 46px;
  width:46px;
  height:46px;
  align-self:center;
}

.hb-cosmos-connection-row .hb-company-list__details{
  display:flex!important;
  flex-direction:column!important;
  align-items:flex-start!important;
  justify-content:center!important;
  min-width:0;
  align-self:center;
}

.hb-cosmos-connection-row .hb-company-list__logo{
  display:block;
  width:46px;
  height:46px;
  margin:0;
  flex:0 0 46px;
  object-fit:contain;
}

.hb-cosmos-connection-row__main{
  justify-content:center;
}

/* Configurações com checkboxes: leitura mais organizada em duas colunas. */
.hb-check-grid--settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 2rem;
  row-gap: .8rem;
  align-items: start;
}
.hb-check-grid--settings label {
  margin: 0;
}
@media (max-width: 760px) {
  .hb-check-grid--settings {
    grid-template-columns: 1fr;
  }
}

/* Administração: navegação interna + área de trabalho unificada */
.hb-page-content:has(> .hb-admin-sidebar){
  --hb-admin-sidebar-width:220px;
  --hb-admin-frame-height:clamp(280px,calc(100dvh - 250px),720px);
  display:grid;
  grid-template-columns:var(--hb-admin-sidebar-width) minmax(0,1fr);
  column-gap:20px;
  align-items:start;
}
.hb-page-content:has(> .hb-admin-sidebar) > .hb-page-header{
  grid-column:1/-1;
}
.hb-page-content:has(> .hb-admin-sidebar) > .hb-admin-sidebar{
  grid-column:1;
  grid-row:2;
}
.hb-page-content:has(> .hb-admin-sidebar) > .hb-admin-workspace{
  grid-column:2;
  grid-row:2;
  min-width:0;
}
.hb-page-content:has(> .hb-admin-sidebar) > :not(.hb-page-header):not(.hb-admin-sidebar):not(.hb-admin-workspace){
  grid-column:2;
  min-width:0;
}

/* Sidebar administrativa: menor, fixa e com rolagem própria. */
.hb-admin-sidebar{
  position:sticky;
  top:18px;
  align-self:start;
  width:100%;
  height:var(--hb-admin-frame-height);
  min-height:0;
  max-height:var(--hb-admin-frame-height);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border:1px solid var(--hb-border);
  border-radius:.85rem;
  background:var(--hb-surface);
  box-shadow:var(--hb-shadow-sm);
}
.hb-admin-sidebar__head{
  display:flex;
  flex-direction:column;
  gap:.12rem;
  padding:.85rem .85rem .72rem;
  border-bottom:1px solid var(--hb-border);
}
.hb-admin-sidebar__head strong{font-size:.9rem;color:var(--hb-text)}
.hb-admin-sidebar__head small{
  color:var(--hb-muted);
  font-size:.72rem;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.hb-admin-sidebar__scroll{
  min-height:0;
  overflow-y:auto;
  padding:.55rem;
  scrollbar-width:thin;
}
.hb-admin-sidebar__home,
.hb-admin-nav-group__items a{
  display:flex;
  align-items:center;
  gap:.5rem;
  width:100%;
  min-height:34px;
  padding:.44rem .58rem;
  border-radius:.52rem;
  color:var(--hb-muted);
  text-decoration:none!important;
  font-size:.79rem;
  font-weight:600;
  transition:background-color .15s ease,color .15s ease;
}
.hb-admin-sidebar__home:hover,
.hb-admin-nav-group__items a:hover{
  color:var(--hb-text);
  background:var(--hb-surface-hover);
}
.hb-admin-sidebar__home.is-active,
.hb-admin-nav-group__items a.is-active{
  color:#fff;
  background:var(--hb-primary);
}
.hb-admin-sidebar__home .hb-icon{width:15px;height:15px}
.hb-admin-nav-group{
  margin-top:.38rem;
  border-top:1px solid var(--hb-border);
  padding-top:.28rem;
}
.hb-admin-nav-group summary{
  position:relative;
  display:flex;
  align-items:center;
  min-height:29px;
  padding:.34rem 1.3rem .34rem .58rem;
  color:var(--hb-muted);
  cursor:pointer;
  list-style:none;
  user-select:none;
  text-transform:uppercase;
  letter-spacing:.05em;
  font-size:.64rem;
  font-weight:800;
}
.hb-admin-nav-group summary::-webkit-details-marker{display:none}
.hb-admin-nav-group summary::after{
  content:'›';
  position:absolute;
  right:.62rem;
  top:50%;
  transform:translateY(-50%) rotate(90deg);
  font-size:.95rem;
  transition:transform .15s ease;
}
.hb-admin-nav-group:not([open]) summary::after{transform:translateY(-50%) rotate(0deg)}
.hb-admin-nav-group__items{display:grid;gap:.06rem}
.hb-admin-nav-group:not([open]) .hb-admin-nav-group__items{display:none}

/* Um único bloco de conteúdo para toda a Administração. */
.hb-admin-workspace{
  height:var(--hb-admin-frame-height);
  min-height:0;
  overflow:hidden;
  border:1px solid var(--hb-border);
  border-radius:.85rem;
  background:var(--hb-surface);
  box-shadow:var(--hb-shadow-sm);
}
.hb-admin-workspace__scroll{
  height:100%;
  min-height:0;
  overflow:auto;
  scrollbar-gutter:stable;
  scrollbar-width:thin;
  scrollbar-color:var(--hb-muted) var(--hb-surface);
  padding:1.15rem 1.25rem;
}


.hb-admin-workspace .hb-two-column{
  height:100%;
  min-height:0;
}
.hb-admin-workspace .hb-two-column > .hb-panel:first-child{
  padding-right:1.15rem;
}
.hb-admin-workspace .hb-two-column > .hb-panel + .hb-panel{
  padding-left:1.15rem;
}

/* Painel externo passa a ser o próprio workspace. */
.hb-admin-workspace__scroll > .hb-panel{
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
  padding:0;
}

/* Telas em duas colunas (Tenants, Empresas etc.) permanecem lado a lado,
   mas deixam de parecer dois cards independentes. */
.hb-admin-workspace .hb-two-column{
  gap:0;
  max-width:none;
  margin:0;
  align-items:start;
}
.hb-admin-workspace .hb-two-column > .hb-panel{
  height:calc(var(--hb-admin-frame-height) - 2.3rem)!important;
  min-height:0!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  scrollbar-gutter:stable;
  scrollbar-width:thin;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
  padding-right:.9rem;
}
.hb-admin-workspace .hb-two-column > .hb-panel + .hb-panel{
  border-left:1px solid var(--hb-border);
}
.hb-admin-workspace .hb-tenant-panel--form .hb-tenant-form,
.hb-admin-workspace .hb-company-panel--form .hb-company-form,
.hb-admin-workspace .hb-tenant-panel--list .hb-tenant-list,
.hb-admin-workspace .hb-company-panel--list .hb-company-list{
  overflow:visible!important;
  max-height:none!important;
  padding-right:0;
}

/* Grades de configurações passam a funcionar como seções do mesmo bloco. */
.hb-admin-workspace .hb-settings-grid{
  gap:0;
}
.hb-admin-workspace .hb-settings-grid > .hb-panel{
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
  border-bottom:1px solid var(--hb-border);
}
.hb-admin-workspace .hb-settings-grid > .hb-panel:last-child{
  border-bottom:0;
}

/* Listagens e formulários usam toda a largura disponível do bloco. */
.hb-admin-workspace .hb-tenant-layout,
.hb-admin-workspace .hb-company-layout,
.hb-admin-workspace .hb-tenant-detail-layout{
  max-width:none;
  margin-inline:0;
}

/* Evita sensação de deslocamento horizontal ao trocar de tela. */
.hb-admin-workspace,
.hb-admin-workspace__scroll{
  box-sizing:border-box;
}
.hb-admin-workspace__scroll > :first-child{margin-top:0}
.hb-admin-workspace__scroll > :last-child{margin-bottom:0}

@media (max-width:1100px){
  .hb-page-content:has(> .hb-admin-sidebar){
    display:block;
    --hb-admin-frame-height:clamp(280px,65dvh,720px);
  }
  .hb-admin-sidebar{
    position:relative;
    top:auto;
    height:300px;
    max-height:300px;
    margin-bottom:1rem;
  }
  .hb-admin-workspace{
    height:var(--hb-admin-frame-height);
    min-height:0;
  }
  .hb-admin-workspace__scroll{
    height:100%;
    overflow:auto;
  }
  .hb-admin-workspace .hb-two-column{
    grid-template-columns:1fr;
    height:auto;
  }
  .hb-admin-workspace .hb-two-column > .hb-panel{
    height:auto!important;
    overflow:visible!important;
    padding-right:0;
  }
  .hb-admin-workspace .hb-two-column > .hb-panel + .hb-panel{
    border-left:0;
    border-top:1px solid var(--hb-border);
  }
}

/* Administração > Empresas: preview compacto das logomarcas */
.hb-company-logo-preview--compact{
  display:grid;
  gap:.5rem;
  margin-bottom:.85rem;
}
.hb-company-logo-preview--compact .hb-company-logo-preview__label{
  margin-bottom:.05rem;
}
.hb-company-logo-preview__row{
  display:grid;
  grid-template-columns:86px minmax(0,1fr) max-content;
  gap:.75rem;
  align-items:center;
  min-height:66px;
  padding:.5rem .6rem;
  border:1px solid var(--hb-border);
  border-radius:.6rem;
}
.hb-company-logo-preview__thumb{
  width:86px;
  height:50px;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  border:1px solid var(--hb-border);
  border-radius:.45rem;
  background:#f4f5f7;
}
.hb-company-logo-preview__thumb--dark{background:#1c2025}
.hb-company-logo-preview__thumb img{
  display:block;
  width:100%;
  height:100%;
  object-fit:contain;
  padding:.2rem;
}
.hb-company-logo-preview__info{
  display:flex;
  flex-direction:column;
  gap:.08rem;
  min-width:0;
}
.hb-company-logo-preview__info strong{font-size:.78rem;color:var(--hb-text)}
.hb-company-logo-preview__info small{font-size:.68rem;color:var(--hb-muted)}
@media (max-width:700px){
  .hb-company-logo-preview__row{grid-template-columns:72px minmax(0,1fr)}
  .hb-company-logo-preview__thumb{width:72px;height:46px}
  .hb-company-logo-preview__row .btn{grid-column:1/-1;justify-self:start}
}


/* Administração: listas de cadastros responsivas pela largura do próprio painel.
   Isso é mais adequado que @media porque a coluna pode ficar estreita mesmo
   em monitores grandes. */
.hb-cosmos-connection-list{
  container-type:inline-size;
  container-name:hb-admin-records;
}

.hb-cosmos-connection-row{
  min-width:0;
}

.hb-cosmos-connection-row__main{
  flex:1 1 auto;
  min-width:0;
}

.hb-cosmos-connection-row__meta{
  flex:0 0 auto;
  min-width:max-content;
}

.hb-company-list__main{
  min-width:0;
}

.hb-company-list__details{
  min-width:0;
  max-width:100%;
}

@container hb-admin-records (max-width: 500px){
  .hb-cosmos-connection-row{
    display:grid;
    grid-template-columns:minmax(0,1fr);
    align-items:start;
    gap:.65rem;
    min-height:0;
    padding:.75rem .8rem;
  }

  .hb-cosmos-connection-row__main{
    width:100%;
    min-width:0;
  }

  .hb-cosmos-connection-row__meta{
    width:100%;
    min-width:0;
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:.45rem;
    flex-wrap:wrap;
  }

  .hb-company-list__main,
  .hb-cosmos-connection-row .hb-company-list__main{
    width:100%;
    min-width:0;
    gap:.65rem;
  }

  .hb-company-list__details{
    flex:1 1 auto;
    min-width:0;
    overflow:hidden;
  }

  .hb-company-list__details strong{
    display:block;
    width:100%;
    max-width:100%;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }

  .hb-company-list__details small{
    display:block;
    width:100%;
    max-width:100%;
    white-space:normal;
    overflow-wrap:anywhere;
    line-height:1.35;
  }

  .hb-cosmos-path{
    max-width:100%;
    white-space:normal;
    overflow-wrap:anywhere;
  }
}

@container hb-admin-records (max-width: 360px){
  .hb-cosmos-connection-row__meta{
    justify-content:flex-start;
  }

  .hb-company-list__logo,
  .hb-cosmos-connection-row .hb-company-list__logo-wrap,
  .hb-company-list__logo-wrap{
    width:42px;
    height:42px;
    flex-basis:42px;
  }

  .hb-company-list__logo{
    flex-basis:42px;
  }
}


/* Pesquisa padrão Hubbly -------------------------------------------------- */
.hb-search-field{
  position:relative;
  display:flex;
  align-items:center;
  width:100%;
  min-width:0;
  border:1px solid var(--hb-border);
  border-radius:.55rem;
  background:var(--hb-surface);
  transition:border-color var(--hb-transition),box-shadow var(--hb-transition),background var(--hb-transition);
}
.hb-search-field:focus-within{
  border-color:rgba(var(--hb-primary-rgb),.55);
  box-shadow:0 0 0 3px rgba(var(--hb-primary-rgb),.08);
  background:var(--hb-surface);
}
.hb-search-field__icon{
  position:absolute;
  left:.72rem;
  top:50%;
  transform:translateY(-50%);
  width:18px;
  height:18px;
  display:grid;
  place-items:center;
  color:var(--hb-muted);
  opacity:.78;
  pointer-events:none;
  z-index:2;
}
.hb-search-field__icon .hb-icon,
.hb-search-field__icon .hb-lottie-icon{width:18px;height:18px}
.hb-search-field input[type="search"],
input[type="search"].hb-admin-search{
  width:100%;
  min-width:0;
  min-height:38px;
  padding:.4rem .75rem .4rem 2.5rem;
  border:0!important;
  border-radius:inherit;
  outline:0!important;
  box-shadow:none!important;
  background:transparent!important;
  color:var(--hb-text)!important;
  font-size:.78rem;
}
.hb-search-field input[type="search"]::placeholder,
input[type="search"].hb-admin-search::placeholder{color:var(--hb-muted);opacity:.9}
/* Remove decoração nativa que varia entre navegadores/temas. */
.hb-search-field input[type="search"]::-webkit-search-decoration{display:none}


/* Administração > Usuários/Grupos
   Listas grandes rolam dentro do painel, sem aumentar indefinidamente a página. */
.hb-access-table-scroll {
    max-height: min(58vh, 620px);
    overflow-y: auto;
    overflow-x: auto;
    scrollbar-gutter: stable;
}

.hb-access-table-scroll .hb-table {
    margin-bottom: 0;
}

.hb-access-table-scroll .hb-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--hb-surface, var(--bs-body-bg));
}

/* Evita que o painel cresça além da área útil antes da rolagem interna. */
.hb-admin-tab-content .hb-panel {
    min-height: 0;
}


/* Administração > usuários Cosmos: lista e editor lateral dentro da mesma altura. */
.hb-cosmos-users-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(330px, 390px);
    gap: 14px;
    height: clamp(500px, 64vh, 700px);
    min-height: 0;
    overflow: hidden;
}
.hb-cosmos-users-list,
.hb-cosmos-user-side {
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}
.hb-cosmos-users-list {
    display: flex;
    flex-direction: column;
}
.hb-cosmos-users-list > .hb-panel-heading { flex: 0 0 auto; }
.hb-cosmos-users-scroll {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: none;
    overflow-y: auto;
    overflow-x: auto;
    scrollbar-gutter: stable;
}
.hb-cosmos-users-scroll .hb-table thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    background: var(--hb-surface, var(--bs-body-bg));
}
.hb-cosmos-user-side { overflow-y: auto; scrollbar-gutter: stable; }
.hb-cosmos-user-empty { min-height: 100%; display:grid; place-content:center; text-align:center; padding:28px; opacity:.72; }
.hb-cosmos-user-empty p { margin:.35rem 0 0; }
.hb-cosmos-user-editor { padding: 4px; }
.hb-side-editor-heading { padding: 4px 2px 12px; border-bottom: 1px solid var(--hb-border, rgba(127,127,127,.22)); }
.hb-side-editor-heading h2 { margin:.15rem 0 .2rem; font-size:1.15rem; }
.hb-side-editor-heading p { margin:0; font-size:.82rem; opacity:.72; }
.hb-side-editor-section { padding:14px 2px; border-bottom:1px solid var(--hb-border, rgba(127,127,127,.22)); }
.hb-side-editor-section h3 { font-size:.9rem; margin:0 0 10px; }
.hb-side-editor-section label { display:block; margin-bottom:10px; font-size:.8rem; }
.hb-check-line { display:flex !important; align-items:center; gap:8px; }
.hb-cosmos-security-state { display:flex; gap:16px; flex-wrap:wrap; padding-top:6px; font-size:.8rem; opacity:.82; }
.hb-side-editor-actions { position:sticky; bottom:0; padding:12px 2px 4px; background:var(--hb-surface, var(--bs-body-bg)); z-index:2; }
.hb-side-editor-actions .btn { width:100%; }
.hb-side-security-actions { display:grid; gap:8px; }
.hb-cosmos-user-row { cursor:pointer; }
.hb-cosmos-user-row:hover td,
.hb-cosmos-user-row.is-selected td { background:rgba(0,123,255,.055); }

/* Usuários/Grupos sem painel lateral: a barra fica sempre dentro do bloco. */
.hb-access-table-scroll {
    height: clamp(360px, 55vh, 600px);
    max-height: none;
    min-height: 0;
    overflow: auto;
    scrollbar-gutter: stable;
}

@media (max-width: 1050px) {
  .hb-cosmos-users-layout { grid-template-columns: 1fr; height:auto; overflow:visible; }
  .hb-cosmos-users-list { height:clamp(430px,58vh,620px); }
  .hb-cosmos-user-side { height:auto; max-height:none; overflow:visible; }
}


/* V8 - Usuários Cosmos: lista + editor devem caber integralmente no painel externo. */
.hb-cosmos-user-workspace,
.hb-cosmos-user-layout {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
    align-items: stretch;
}

.hb-cosmos-user-pane,
.hb-cosmos-user-list,
.hb-cosmos-user-editor {
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
}

.hb-cosmos-user-list,
.hb-cosmos-user-editor {
    display: flex;
    flex-direction: column;
}

.hb-cosmos-user-list .hb-table-wrap,
.hb-cosmos-user-list .hb-access-table-scroll {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overflow-x: auto;
}

.hb-cosmos-user-editor {
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
}

/* A linha inteira é a ação de edição. */
.hb-cosmos-user-list tbody tr[data-cosmos-user],
.hb-cosmos-user-list tbody tr[data-user-key],
.hb-cosmos-user-list tbody tr.js-cosmos-user-row {
    cursor: pointer;
}

/* Sem coluna/botão Editar, damos mais largura ao painel lateral. */
.hb-cosmos-user-layout {
    grid-template-columns: minmax(0, 1.7fr) minmax(360px, 1fr);
}

@media (max-width: 1100px) {
    .hb-cosmos-user-layout {
        grid-template-columns: minmax(0, 1.45fr) minmax(340px, 1fr);
    }
}

@media (max-width: 860px) {
    .hb-cosmos-user-layout {
        grid-template-columns: 1fr;
        overflow: auto;
    }

    .hb-cosmos-user-editor {
        max-height: none;
    }
}


/* V9 - Administração > Usuários: o conteúdo das abas ocupa somente a área útil
   do workspace, sem criar um bloco mais alto que o painel externo. */
.hb-admin-workspace--users .hb-admin-workspace__scroll {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.hb-admin-workspace--users .hb-admin-tabs {
    flex: 0 0 auto;
}

.hb-admin-workspace--users .hb-admin-tab-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.hb-admin-workspace--users .hb-admin-tab-content > .tab-pane {
    height: 100%;
    min-height: 0;
    overflow: auto;
    padding-top: 16px;
}

.hb-admin-workspace--users .hb-cosmos-users-layout {
    height: 100% !important;
    max-height: 100%;
    min-height: 0;
    overflow: hidden;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 390px);
}

.hb-admin-workspace--users .hb-cosmos-users-list,
.hb-admin-workspace--users .hb-cosmos-user-side {
    height: 100%;
    max-height: 100%;
    min-height: 0;
    overflow: hidden;
}

.hb-admin-workspace--users .hb-cosmos-users-scroll {
    flex: 1 1 0;
    height: 0;
    min-height: 0;
    max-height: none;
    overflow: auto;
    scrollbar-gutter: stable;
}

.hb-admin-workspace--users .hb-cosmos-user-side {
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
}

.hb-cosmos-access-col {
    width: 112px;
    text-align: center;
    white-space: nowrap;
}

.hb-cosmos-access-form {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

/* Switch local de acesso Hubbly. */
.hb-cosmos-access-switch {
    /* Contém o input absoluto dentro da lista rolável, sem ampliar o shell. */
    position: relative;
    display: inline-flex;
    align-items: center;
    margin: 0;
    cursor: pointer;
}

.hb-cosmos-access-switch input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.hb-switch__track {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
    border-radius: 999px;
    background: var(--hb-border);
    transition: background .18s ease, opacity .18s ease;
}

.hb-switch__thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    transition: transform .18s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.hb-cosmos-access-switch input:checked + .hb-switch__track {
    background: var(--bs-primary, #0d6efd);
}

.hb-cosmos-access-switch input:checked + .hb-switch__track .hb-switch__thumb {
    transform: translateX(18px);
}

.hb-cosmos-access-switch input:disabled + .hb-switch__track {
    opacity: .38;
    cursor: not-allowed;
}

.hb-cosmos-disabled-warning {
    margin: 0 0 6px;
    font-size: .78rem;
}

.hb-cosmos-local-cleanup p {
    font-size: .78rem;
    opacity: .75;
}

@media (max-width: 1100px) {
    .hb-admin-workspace--users .hb-admin-tab-content,
    .hb-admin-workspace--users .hb-admin-tab-content > .tab-pane {
        height: auto;
        overflow: visible;
    }

    .hb-admin-workspace--users .hb-cosmos-users-layout {
        height: auto !important;
        max-height: none;
        overflow: visible;
        grid-template-columns: 1fr;
    }

    .hb-admin-workspace--users .hb-cosmos-users-list {
        height: 520px;
    }

    .hb-admin-workspace--users .hb-cosmos-user-side {
        height: auto;
        max-height: none;
        overflow: visible;
    }
}


/* V10 - refinamentos Usuários Cosmos */

/* Pesquisa: o foco pertence ao wrapper inteiro; o input interno não cria uma
   segunda área de fundo/borda. */
.hb-search,
.hb-search-field,
.hb-search-control,
.hb-search-wrap {
    overflow: hidden;
}

.hb-search input[type="search"],
.hb-search-field input[type="search"],
.hb-search-control input[type="search"],
.hb-search-wrap input[type="search"] {
    width: 100% !important;
    max-width: none !important;
    flex: 1 1 auto !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
}

.hb-search:focus-within,
.hb-search-field:focus-within,
.hb-search-control:focus-within,
.hb-search-wrap:focus-within {
    border-color: var(--bs-primary, #0d6efd);
    box-shadow: 0 0 0 1px var(--bs-primary, #0d6efd);
}

/* O painel de edição usa a largura completa. A rolagem fica na extremidade do
   bloco e o conteúdo recebe apenas o padding necessário. */
.hb-admin-workspace--users .hb-cosmos-user-side {
    padding: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-gutter: auto !important;
}

.hb-admin-workspace--users .hb-cosmos-user-side > * {
    margin-left: 24px;
    margin-right: 24px;
}

.hb-admin-workspace--users .hb-cosmos-user-side > :first-child {
    margin-top: 20px;
}

.hb-admin-workspace--users .hb-cosmos-user-side > :last-child {
    margin-bottom: 20px;
}

/* Salvar alterações volta ao fluxo normal do formulário. Não é sticky/fixo e
   portanto nunca cobre os controles de segurança abaixo dele. */
.hb-admin-workspace--users .hb-cosmos-user-side .hb-side-editor-actions,
.hb-admin-workspace--users .hb-cosmos-user-side .hb-cosmos-save-actions,
.hb-admin-workspace--users .hb-cosmos-user-side form > .hb-form-actions,
.hb-admin-workspace--users .hb-cosmos-user-side button[type="submit"].w-100 {
    position: static !important;
    inset: auto !important;
    bottom: auto !important;
    z-index: auto !important;
}

.hb-admin-workspace--users .hb-cosmos-user-side form {
    padding-bottom: 12px;
}


/* V11 - avatar editável no painel Cosmos. */
.hb-cosmos-profile-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 8px;
}
.hb-cosmos-profile-avatar-wrap {
    position: relative;
    flex: 0 0 auto;
}
.hb-cosmos-profile-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--hb-surface-soft, rgba(127,127,127,.12));
    border: 1px solid var(--hb-border);
    background-size: cover;
    background-position: center;
    overflow: hidden;
    font-weight: 700;
    letter-spacing: .02em;
}
.hb-cosmos-profile-avatar.has-image span { display: none; }
.hb-cosmos-avatar-edit {
    position: absolute;
    right: -4px;
    bottom: -3px;
    width: 25px;
    height: 25px;
    min-width: 25px;
    padding: 4px;
    border-radius: 50%;
}
.hb-cosmos-profile-identity { min-width: 0; }
.hb-cosmos-profile-identity h2 { margin: 2px 0 0; }

.hb-avatar-crop-stage {
    position: relative;
    width: min(320px, 100%);
    aspect-ratio: 1;
    margin: 0 auto 18px;
    overflow: hidden;
    border-radius: 10px;
    background: #111827;
    cursor: grab;
    touch-action: none;
    user-select: none;
}
.hb-avatar-crop-stage.is-dragging { cursor: grabbing; }
.hb-avatar-crop-stage canvas {
    display: block;
    width: 100%;
    height: 100%;
}
.hb-avatar-crop-ring {
    position: absolute;
    inset: 12%;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.9);
    box-shadow: 0 0 0 999px rgba(0,0,0,.48);
    pointer-events: none;
}
.hb-avatar-crop-controls {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.hb-avatar-zoom {
    flex: 1 1 180px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}
.hb-avatar-zoom input { flex: 1; }
.hb-avatar-crop-help {
    display: block;
    margin-top: 10px;
    opacity: .72;
}


/* V12 - botão de edição do avatar compacto e consistente com o perfil. */
.hb-cosmos-avatar-edit {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    padding: 3px !important;
    right: -2px !important;
    bottom: -1px !important;
    display: grid !important;
    place-items: center !important;
    line-height: 1 !important;
}
.hb-cosmos-avatar-edit .hb-icon,
.hb-cosmos-avatar-edit svg,
.hb-cosmos-avatar-edit img,
.hb-cosmos-avatar-edit [data-lottie-icon] {
    width: 11px !important;
    height: 11px !important;
    min-width: 11px !important;
    min-height: 11px !important;
}


/* V13 - editor de avatar unificado */
.hb-avatar-crop-stage canvas { background: #8d8d8d; }
.hb-avatar-zoom input[type="range"] { min-width: 0; }
@media (max-width: 560px) {
  .hb-avatar-crop-controls { align-items: stretch; }
  .hb-avatar-zoom { flex-basis: 100%; }
}


/* V16 - cadastro facial somente pelo próprio usuário */
.hb-admin-face-self-service {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--hb-border);
  border-radius: 10px;
}
.hb-admin-face-self-service small { opacity: .72; line-height: 1.35; }

/* V17 - apenas uma rolagem no editor Cosmos.
   O aside externo é o único elemento rolável; o editor interno acompanha o conteúdo. */
.hb-admin-workspace--users .hb-cosmos-user-side {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-gutter: stable !important;
}

.hb-admin-workspace--users .hb-cosmos-user-side .hb-cosmos-user-editor,
.hb-admin-workspace--users .hb-cosmos-user-side .hb-cosmos-user-pane,
.hb-admin-workspace--users .hb-cosmos-user-side .hb-cosmos-user-pane-editor {
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    scrollbar-gutter: auto !important;
}

/* V19 - Administração > Grupos */
.hb-admin-workspace--groups .hb-admin-workspace__scroll {
    display:flex; flex-direction:column; height:100%; min-height:0; overflow:hidden;
}
.hb-admin-workspace--groups .hb-admin-tab-content,
.hb-admin-workspace--groups .tab-pane { flex:1 1 auto; min-height:0; height:100%; overflow:auto; }
.hb-groups-layout {
    display:grid; grid-template-columns:minmax(0,1.55fr) minmax(340px,.85fr);
    gap:16px; height:100%; min-height:0; padding-top:16px; overflow:hidden;
}
.hb-groups-list-panel,.hb-group-side { min-height:0; height:100%; overflow:hidden; }
.hb-groups-list-panel { display:flex; flex-direction:column; }
.hb-groups-scroll { flex:1 1 0; height:0; min-height:0; overflow:auto; scrollbar-gutter:stable; }
.hb-group-side { overflow-y:auto; overflow-x:hidden; scrollbar-gutter:stable; }
.hb-group-row { cursor:pointer; }
.hb-group-row.is-selected td { background:color-mix(in srgb, var(--bs-primary) 9%, transparent); }
.hb-group-side-empty { min-height:220px; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; opacity:.68; gap:5px; }
.hb-group-side-header { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; margin-bottom:14px; }
.hb-group-side-header h2 { margin:2px 0 4px; }
.hb-group-members,.hb-group-candidates { display:flex; flex-direction:column; gap:7px; margin-top:10px; }
.hb-group-member-row,.hb-group-candidate-row {
    display:flex; align-items:center; justify-content:space-between; gap:10px;
    padding:9px 10px; border:1px solid var(--hb-border); border-radius:10px;
}
.hb-group-member-row div,.hb-group-candidate-row div { min-width:0; }
.hb-group-member-row strong,.hb-group-candidate-row strong { display:block; }
.hb-group-member-row small,.hb-group-candidate-row small { display:block; opacity:.72; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.hb-group-member-add { border-top:1px solid var(--hb-border); margin-top:16px; padding-top:14px; }
.hb-group-member-add h3 { font-size:.95rem; margin-bottom:9px; }
.hb-empty-mini { padding:16px; text-align:center; opacity:.65; }
.hb-group-store-checks { max-height:150px; overflow:auto; border:1px solid var(--hb-border); border-radius:10px; padding:8px; }
.hb-group-store-checks label { display:block; padding:4px 3px; }
.hb-form-span-2 { grid-column:1 / -1; }
@media(max-width:1100px){
  .hb-groups-layout{grid-template-columns:1fr; height:auto; overflow:visible}
  .hb-admin-workspace--groups .hb-admin-tab-content,.hb-admin-workspace--groups .tab-pane{height:auto;overflow:visible}
  .hb-groups-list-panel{height:520px}.hb-group-side{height:auto;max-height:620px}
}

/* As colunas empilhadas precisam de um ancestral rolável, sem encolher as abas. */
@media(max-width:1100px){
  .hb-admin-workspace--users .hb-admin-workspace__scroll,
  .hb-admin-workspace--groups .hb-admin-workspace__scroll{
    display:block;
    overflow:auto;
  }
}

/* V19.3 - avatar do usuário Hubbly no painel administrativo */
.hb-admin-avatar-field{display:flex;flex-direction:column;gap:7px}
.hb-admin-avatar-label{font-weight:600;font-size:.78rem}
.hb-admin-avatar-control{display:flex;align-items:center;gap:10px;min-height:58px}
.hb-profile-avatar--small{
  width:54px;height:54px;min-width:54px;border-radius:50%;padding:0;
  border:1px solid var(--hb-border);background-position:center;background-size:cover;
  overflow:hidden;cursor:pointer
}
.hb-profile-avatar--small.has-image .hb-profile-avatar__placeholder{display:none}
.hb-profile-avatar--small .hb-profile-avatar__placeholder{
  width:100%;height:100%;display:flex;align-items:center;justify-content:center;
  font-weight:700;opacity:.55
}

/* V19.4 - identidade compacta no editor administrativo de usuários */
.hb-admin-user-identity-mini{
  grid-column:1/-1;display:flex;align-items:center;gap:14px;min-height:92px;
  padding:12px 14px;border:1px solid var(--hb-border);border-radius:12px;
  background:color-mix(in srgb,var(--hb-surface,#fff) 96%,transparent)
}
.hb-admin-user-avatar-wrap{position:relative;width:72px;height:72px;min-width:72px}
.hb-admin-user-avatar-mini{
  width:72px;height:72px;border-radius:50%;border:1px solid var(--hb-border);padding:0;
  overflow:hidden;background:#fff center/cover no-repeat;display:flex;align-items:center;
  justify-content:center;color:var(--bs-primary);font-size:1.25rem;font-weight:700
}
.hb-admin-user-avatar-mini.has-image .hb-profile-avatar__placeholder{display:none}
.hb-admin-user-avatar-edit-icon{
  position:absolute;right:-2px;bottom:-1px;width:27px;height:27px;min-width:27px;padding:5px;
  border-radius:50%;display:flex;align-items:center;justify-content:center
}
.hb-admin-user-avatar-edit-icon .hb-icon,.hb-admin-user-avatar-edit-icon svg{width:15px;height:15px}
.hb-admin-user-identity-mini__main{min-width:0;display:flex;flex-direction:column;align-items:flex-start}
.hb-admin-user-identity-mini__main>strong{font-size:1.05rem;line-height:1.2;margin-bottom:2px}
.hb-admin-user-identity-mini__main>small{opacity:.68;margin-bottom:7px}
.hb-admin-user-group-badges{display:flex;flex-wrap:wrap;gap:5px}
.hb-admin-user-group-badges span{
  display:inline-flex;align-items:center;min-height:24px;padding:3px 9px;border-radius:999px;
  font-size:.72rem;color:var(--bs-primary);background:color-mix(in srgb,var(--bs-primary) 14%,transparent)
}
.hb-admin-workspace--permissions .hb-panel-heading{
  flex-direction:column;
  align-items:stretch;
}
.hb-admin-workspace--permissions #permissionRuleForm{
  display:flex;
  flex-direction:column;
  gap:1rem;
}
.hb-admin-workspace--permissions #permissionRuleForm > label{
  display:flex;
  flex-direction:column;
  gap:.35rem;
  width:100%;
  min-width:0;
}
.hb-admin-workspace--permissions #pr_submit{
  align-self:flex-end;
}
.hb-admin-workspace--security .hb-panel-heading .hb-search-field{
  flex:0 1 360px;
}
.hb-admin-workspace--security .hb-security-table-actions{
  display:grid;
  grid-template-columns:repeat(2,170px);
  align-items:center;
  gap:.5rem;
  width:max-content;
  white-space:normal;
  text-align:left;
}
.hb-admin-workspace--security .hb-security-table-actions form{
  margin:0;
}
.hb-admin-workspace--security .hb-security-table-actions .btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.4rem;
  width:170px;
  min-width:170px;
  height:38px;
  min-height:38px;
  flex-shrink:0;
  padding:.45rem .7rem;
  border-radius:.5rem;
  white-space:nowrap;
}
.hb-admin-workspace--security .hb-security-table-actions .hb-icon{
  width:18px;
  height:18px;
  flex-shrink:0;
}
.hb-admin-workspace--security .hb-security-table-actions .btn-danger .hb-file-icon{
  filter:brightness(0) invert(1);
  opacity:1;
}
.hb-admin-workspace--security .hb-security-table-actions .btn-danger .hb-lottie-icon__animation{
  color:#fff;
  opacity:1;
}
@media(max-width:760px){
  .hb-admin-workspace--security .hb-panel-heading .hb-search-field{
    flex:0 1 auto;
  }
}

/* Componentes compartilhados: abas administrativas e botões com ícone. */
.hb-action-button{display:inline-flex;align-items:center;justify-content:center;gap:.48rem;min-height:40px}
.hb-action-button .hb-icon{width:18px;height:18px}
.hb-admin-tabs{margin-bottom:0;border-bottom:1px solid var(--hb-border)}
.hb-admin-tabs .nav-link{color:var(--hb-muted);border:0;border-bottom:2px solid transparent;border-radius:0;padding:.8rem 1rem;font-weight:650}
.hb-admin-tabs .nav-link:hover{color:var(--hb-text);border-color:transparent}
.hb-admin-tabs .nav-link.active{color:var(--hb-primary);background:transparent;border-bottom-color:var(--hb-primary)}
.hb-admin-tab-content{padding-top:1rem}
.btn:has(> .hb-icon){display:inline-flex;align-items:center;justify-content:center;gap:.48rem}
.btn > .hb-icon{flex-shrink:0;margin-inline:0}

.hb-module-toggle>span{flex:1 1 auto;min-width:0;overflow-wrap:anywhere;}
/* Home feeds share dimensions, typography and theme tokens across all modules. */
.hb-home-feed{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));gap:18px;margin-bottom:28px}.hb-home-feed__card{display:flex;flex-direction:column;min-width:0;border:1px solid var(--hb-border);border-radius:var(--hb-radius-lg);background:var(--hb-surface);overflow:hidden}.hb-home-feed__card>header{display:flex;align-items:center;gap:10px;padding:10px 14px;border-bottom:1px solid var(--hb-border)}.hb-home-feed__card .hb-app-card__icon{width:32px;height:32px;flex:0 0 32px}.hb-home-feed__card .hb-app-card__icon .hb-icon{width:20px;height:20px}.hb-home-feed__card h2{font-size:14px;margin:0;flex:1;min-width:0}.hb-home-feed__count{font-size:12px;padding:3px 8px;border-radius:20px;background:var(--hb-hover);color:var(--hb-muted)}.hb-home-feed__list{height:160px;padding:10px 12px;box-sizing:border-box;overflow-y:auto;overflow-x:hidden;scrollbar-gutter:stable}.hb-home-feed__row{display:flex;flex-direction:column;gap:4px;width:100%;min-height:74px;margin-bottom:8px;padding:9px 10px;border:1px solid var(--hb-border);border-radius:8px;background:var(--hb-surface-muted);color:var(--hb-text);text-align:left;text-decoration:none;font:inherit}.hb-home-feed__row:hover{background:var(--hb-hover);color:var(--hb-text)}.hb-home-feed__line{display:flex;align-items:baseline;gap:10px;min-width:0}.hb-home-feed__line strong{font-size:13px;flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.hb-home-feed__line small{flex-shrink:0}.hb-home-feed__row small{font-size:11px;color:var(--hb-muted)}.hb-home-feed__preview{font-size:12px;color:var(--hb-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.hb-home-feed__card>footer{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;margin-top:auto;min-height:48px;padding:8px 12px;border-top:1px solid var(--hb-border);font-size:12px}.hb-home-feed__deadlines{display:flex;gap:12px;flex-wrap:wrap}.hb-home-feed__empty{padding:12px 4px;font-size:13px;color:var(--hb-muted)}.hb-home-feed a:focus-visible,.hb-home-feed button:focus-visible{outline:2px solid var(--hb-primary);outline-offset:-2px}
#hb-home-notice-count{background:var(--hb-primary);color:var(--hb-on-primary,#fff)}.hb-home-feed__card>footer .btn{min-height:30px;padding:5px 10px;font-size:12px;gap:6px}.hb-home-feed__card>footer .btn .hb-icon{width:16px;height:16px}.hb-home-feed__row:last-child{margin-bottom:0}
