[hidden]{display:none!important}
.crm-nav{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 28px;padding-bottom:16px;border-bottom:1px solid var(--line)}
.crm-nav button{border:1px solid transparent;background:transparent;color:var(--muted);padding:11px 16px;border-radius:9px;font:600 13px Inter,sans-serif;cursor:pointer}
.crm-nav button[aria-current="page"]{color:var(--green);background:#e5f2ed;border-color:#c5e1d5}
.office-selector{max-width:400px;margin:0 0 24px}.crm-view{min-width:0}
.view-head{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;margin-bottom:24px}
.view-head h1{font-size:30px;letter-spacing:-.04em;margin:0;color:var(--navy)}.view-head p{color:var(--muted);line-height:1.6;margin:8px 0 0;font-size:14px}
.management-card{background:#fff;border:1px solid var(--line);border-radius:16px;padding:24px;margin-bottom:20px;min-width:0}
.management-card h2{margin:0 0 18px;font-size:19px;color:var(--navy)}.management-card .base-table{width:100%}
.management-card .table-scroll{border-radius:10px;max-height:650px}.base-table td{overflow-wrap:anywhere}
.tag{display:inline-block;border:1px solid var(--line);background:#f5f8f7;border-radius:6px;padding:5px 8px;font-size:11px;font-weight:600;white-space:nowrap}
.money{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}.management-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:16px}
.login-screen{min-height:100vh;min-height:100dvh;display:grid;place-items:center;padding:28px;background:radial-gradient(ellipse at 20% 0%,#e0ede7,transparent 55%),var(--bg)}
.login-card{width:min(100%,460px);padding:40px;background:#fff;border:1px solid var(--line);border-radius:22px;box-shadow:0 20px 70px #0b263315}
.login-card .brand-link{margin-bottom:36px;width:100%;max-width:340px}.login-card h1{font-size:30px;letter-spacing:-.035em;color:var(--navy);margin:12px 0}
.login-card p{font-size:14px;color:var(--muted);line-height:1.6}.login-card form{display:grid;gap:18px;margin-top:26px}.login-card .btn{width:100%;justify-content:center}
#loginMessage,#manageError{min-height:1.4em;color:#a12936;font-size:13px;margin:0}.field input[type=checkbox]{width:18px;height:18px;accent-color:var(--green)}
.account-copy strong,.account-copy span{max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.account .avatar{flex-shrink:0}
#networkStatus{background:#fff7dd;color:#745300;border:1px solid #e9dca7;border-radius:10px;padding:12px 16px;font-size:13px}
.crm-view .small-note{line-height:1.6}button:disabled{cursor:not-allowed;opacity:.6}
@media(max-width:720px){.management-card{padding:16px}.view-head h1{font-size:26px}.crm-nav{gap:4px}.crm-nav button{padding:10px;font-size:12px}.login-card{padding:26px}.office-selector{max-width:none}.view-head>.btn{width:100%;justify-content:center}.management-card .row-actions{min-width:120px}.account-copy{max-width:130px}}

/* Navegação hierárquica e indicadores: extensão aditiva */
.hierarchy-toolbar{display:flex;flex-wrap:wrap;gap:12px;align-items:end}.hierarchy-summary{margin:16px 0}.hierarchy-summary-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px}.hierarchy-summary-cards .metric{min-width:0}#summaryMessage{font-size:.85rem}

/* Revisão visual final — preserva integralmente estrutura e comportamento */
.topbar{border-bottom-color:rgba(199,149,63,.38);box-shadow:0 10px 34px rgba(4,22,36,.16)}
.brand-link{border-color:rgba(255,255,255,.42);border-radius:12px;box-shadow:0 7px 22px rgba(0,0,0,.16),inset 0 0 0 1px rgba(7,30,49,.035)}
.brand-link:focus-visible{outline-color:#d7ae67;outline-offset:4px}
.brand .brand-copy span{color:rgba(255,255,255,.78);font-weight:600}

.crm-nav{position:sticky;top:84px;z-index:20;display:flex;gap:5px;flex-wrap:wrap;margin:-4px 0 28px;padding:7px;border:1px solid rgba(7,30,49,.08);border-radius:14px;background:rgba(255,255,255,.92);box-shadow:0 8px 28px rgba(7,30,49,.055);backdrop-filter:blur(12px)}
.crm-nav button{min-height:40px;border:1px solid transparent;background:transparent;color:#53636c;padding:9px 14px;border-radius:9px;font:600 12px/1.35 Inter,sans-serif;cursor:pointer;transition:background-color .18s ease,color .18s ease,border-color .18s ease,box-shadow .18s ease}
.crm-nav button:hover{color:var(--navy);background:#f2f6f5}
.crm-nav button[aria-current="page"]{color:#fff;background:linear-gradient(135deg,var(--green),#075f4b);border-color:rgba(8,119,95,.4);box-shadow:0 6px 15px rgba(8,119,95,.18)}

#networkStatus{margin:-12px 0 22px;line-height:1.55;box-shadow:0 5px 16px rgba(116,83,0,.06)}
.hierarchy-toolbar{gap:14px;align-items:flex-end;margin-bottom:18px;padding:16px;border:1px solid rgba(7,30,49,.08);border-radius:16px;background:rgba(255,255,255,.8)}
.hierarchy-toolbar .field{flex:1 1 260px;max-width:420px}
.hierarchy-toolbar .office-selector{margin:0}
.hierarchy-summary{margin:0 0 30px}
.hierarchy-summary>.field{max-width:240px;margin:0 0 12px}
.hierarchy-summary-cards{gap:14px}
.hierarchy-summary-cards .metric{min-height:92px}
#summaryMessage{min-height:1.3em;margin:10px 2px 0;color:var(--muted);line-height:1.5}

.view-head{margin-bottom:26px}
.view-head h1{font-size:clamp(27px,3vw,36px);line-height:1.18}
.view-head p{max-width:720px}
.management-card{border-color:rgba(7,30,49,.08);border-radius:18px;padding:clamp(18px,2.3vw,28px);box-shadow:0 10px 30px rgba(7,30,49,.05)}
.management-card h2{font-size:20px;letter-spacing:-.02em}
.management-card .table-scroll{border:1px solid var(--line);border-radius:12px}
.management-actions{gap:10px;margin-top:20px}
.tag{border-radius:999px;padding:5px 9px;background:#f1f5f4}

.login-screen{padding:clamp(20px,5vw,54px);background:radial-gradient(circle at 16% 0%,rgba(8,119,95,.16),transparent 34rem),radial-gradient(circle at 100% 100%,rgba(199,149,63,.11),transparent 30rem),#f2f6f5}
.login-card{width:min(100%,470px);padding:clamp(26px,4.5vw,44px);border-color:rgba(7,30,49,.09);border-radius:24px;box-shadow:0 28px 80px rgba(7,30,49,.14)}
.login-card .brand-link{width:100%;max-width:342px;margin:0 0 34px}
.login-card h1{font-size:clamp(28px,4vw,34px);line-height:1.18}
.login-card p{line-height:1.65}
.login-card form{gap:17px;margin-top:28px}
.login-card .btn{min-height:48px;font-size:13px}

@media(max-width:880px){.crm-nav{top:84px;overflow-x:auto;flex-wrap:nowrap;scrollbar-width:none;overscroll-behavior-x:contain}.crm-nav::-webkit-scrollbar{display:none}.crm-nav button{flex:0 0 auto}}
@media(max-width:720px){.crm-nav{top:72px;margin-bottom:22px;padding:6px}.crm-nav button{min-height:38px;padding:8px 12px}.hierarchy-toolbar{padding:14px;gap:12px}.hierarchy-toolbar .field{max-width:none}.hierarchy-summary{margin-bottom:24px}.management-card{padding:17px}.view-head{align-items:stretch;gap:18px}.view-head>.btn{width:100%}.login-card{border-radius:20px}}
@media(max-width:480px){.crm-nav{margin-inline:-2px}.hierarchy-summary>.field{max-width:none}.management-actions>.btn{flex:1 1 100%;white-space:normal}.login-screen{padding:14px}.login-card{padding:24px 20px}.login-card .brand-link{margin-bottom:28px}}
@media(prefers-reduced-motion:reduce){.crm-nav button{transition:none}}


/* LOGO ORIGINAL BRASIL CERTIFICADORA */
.brand-link,
.login-card .brand-link {
    display: block;
    position: relative;
    width: min(100%, 342px);
    height: auto;
    aspect-ratio: auto;
    overflow: visible;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
}

.brand-link .brand-logo,
.login-card .brand-link .brand-logo {
    position: static;
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    object-position: center;
    transform: none;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.topbar .brand-link {
    width: 220px;
}

@media (max-width: 720px) {
    .topbar .brand-link {
        width: 158px;
    }
}


/* DESTAQUE DA LOGO NO CABECALHO INTERNO */
.topbar .brand-link {
    box-sizing: border-box;
    width: 240px;
    padding: 8px 12px;
    background: #ffffff;
    border: 1px solid #e5eaf0;
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .12);
}

.topbar .brand-link .brand-logo {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

@media (max-width: 720px) {
    .topbar .brand-link {
        width: 178px;
        padding: 6px 9px;
    }
}

/* Letras azuis nas etiquetas da tabela de Comissões */
#view-comissoes .tag {
    color: #1565c0;
    background-color: #ffffff;
    border: 1px solid #d5e3f5;
    font-weight: 700;
}

/* Etiquetas de Comissões: fundo branco e letras pretas */
#view-comissoes .tag,
#view-comissoes .tag * {
    color: #111111 !important;
}

#view-comissoes .tag {
    background: #ffffff !important;
    border: 1px solid #d5dce3;
    font-weight: 700;
}

/* Texto da observação em Ajustes para compensação */
#view-comissoes .management-card > .small-note {
    color: #111111 !important;
}

/* Status dos escritórios: letras pretas e fundo branco */
#view-escritorios .tag,
#view-escritorios .tag * {
    color: #111111 !important;
}

#view-escritorios .tag {
    background: #ffffff !important;
    border: 1px solid #d5dce3;
    font-weight: 700;
}


/* Privacidade visual na página de Comissões */
#view-comissoes .commission-eye {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  margin-left: 10px;
  padding: 5px;
  color: inherit;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 9px;
  cursor: pointer;
}

#view-comissoes .commission-eye:hover {
  opacity: .7;
}

#view-comissoes.commissions-hidden .management-card {
  display: none !important;
}

#view-comissoes .commissions-privacy-message {
  margin-top: 20px;
  padding: 20px;
  border: 1px solid #53606b;
  border-radius: 12px;
  color: inherit;
}

#view-comissoes .commissions-privacy-message[hidden] {
  display: none !important;
}


/* Quatro ações na mesma linha na carteira do representante */
body:has(#portfolioRows) #portfolioRows .row-actions {
    display: flex;
    flex-wrap: nowrap !important;
    align-items: center;
    gap: 5px;
    width: max-content;
    min-width: max-content;
}

#portfolioRows .row-actions > button {
    flex: 0 0 auto;
    white-space: nowrap;
    padding-left: 8px;
    padding-right: 8px;
}

#portfolioRows td:has(.row-actions) {
    min-width: 350px;
}


/* Contato: os dois botões têm dimensões idênticas. */
#portfolioRows .client-contact-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 118px;
}

#portfolioRows .client-contact-btn {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 118px;
  min-width: 118px;
  height: 40px;
  min-height: 40px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

#portfolioRows .client-contact-email {
  background: #e8f1ff;
  border-color: #b9d4fc;
  color: #164eaa !important;
}

#portfolioRows .client-contact-whatsapp {
  background: #e5f7ec;
  border-color: #a6dfbc;
  color: #126b37 !important;
}

#portfolioRows .client-contact-disabled {
  background: #e8e8e8;
  border-color: #cccccc;
  color: #777 !important;
  cursor: not-allowed;
}

#portfolioRows .client-contact-btn:focus-visible {
  outline: 3px solid #4386d4;
  outline-offset: 2px;
}


/* PADRONIZACAO VISUAL DOS BOTOES DA CARTEIRA */

/* Dimensões e alinhamento dos botões de contato. */
#portfolioRows .client-contact-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 118px;
}

#portfolioRows .client-contact-btn {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 118px;
    min-width: 118px;
    height: 40px;
    min-height: 40px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s ease, border-color .15s ease;
}

/* Demais botões da tabela: altura e cantos uniformes. */
#portfolioRows .base-stage-buttons button {
    box-sizing: border-box;
    min-height: 40px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 700;
}

/* Modo noturno. */
html[data-theme="dark"] #portfolioRows .client-contact-email {
    background: #304763;
    border-color: #5a789b;
    color: #edf5ff !important;
}

html[data-theme="dark"] #portfolioRows .client-contact-whatsapp {
    background: #245344;
    border-color: #428c71;
    color: #e4fff0 !important;
}

html[data-theme="dark"] #portfolioRows .client-contact-disabled {
    background: #343d46;
    border-color: #46525e;
    color: #aeb9c4 !important;
    cursor: not-allowed;
}

/* Modo claro. */
html:not([data-theme="dark"]) #portfolioRows .client-contact-email {
    background: #e4efff;
    border-color: #a9c6eb;
    color: #244d80 !important;
}

html:not([data-theme="dark"]) #portfolioRows .client-contact-whatsapp {
    background: #e0f3e8;
    border-color: #a2d4b8;
    color: #206344 !important;
}

html:not([data-theme="dark"]) #portfolioRows .client-contact-disabled {
    background: #eef0f2;
    border-color: #d0d5da;
    color: #707981 !important;
    cursor: not-allowed;
}

/* Realce ao passar o mouse. */
#portfolioRows a.client-contact-btn:hover {
    filter: brightness(1.1);
}

/* Navegação pelo teclado. */
#portfolioRows .client-contact-btn:focus-visible,
#portfolioRows .base-stage-buttons button:focus-visible {
    outline: 3px solid #5797d6;
    outline-offset: 2px;
}
