/* Busca e seleção seguem a hierarquia visual do acompanhamento aprovado. */
.companies-page,.contacts-page{container-type:inline-size}
.companies-page .card,.contacts-page .card{border-color:var(--line)}
.companies-page .hero-card{padding:22px;display:grid;gap:18px}
.search-section-head{display:flex;align-items:center;justify-content:space-between;gap:16px}
.search-section-head h2{font-size:22px;line-height:1.4;letter-spacing:-.4px;margin:0}
.search-section-head p{font-size:13px;line-height:1.7;color:var(--muted-strong);margin:6px 0 0}
.search-section-head .stage-badge{white-space:nowrap}
.companies-page .toolbar{grid-template-columns:minmax(0,1fr) auto;gap:10px}
.companies-page .searchbox input{height:44px;font-size:13px;border-radius:11px;padding-right:14px}
.companies-page .primary{height:44px;font-size:13px;border-radius:11px;padding:0 20px}
.companies-page .toolbar-action{gap:8px}
.companies-page .icon-button{height:44px;width:44px;border-radius:11px}
.companies-page .filters{display:grid;grid-template-columns:1fr 1fr 1fr auto;gap:12px;padding:0;align-items:end}
.companies-page .filters[hidden]{display:none}
.companies-page .filters>label,.sort-field{display:grid;gap:7px;min-width:0}
.companies-page .filters>label>span,.sort-field>span{font-size:11px;line-height:1.5;font-weight:700;color:var(--muted-strong)}
.companies-page .select{min-width:0;width:100%;font-size:12px;font-weight:600;height:40px}
.companies-page .secondary{height:40px;font-size:12px;border-radius:11px;padding:0 12px}
.companies-page .chips{padding:0;gap:7px}
.shortcut-label{font-size:11px;font-weight:700;color:var(--muted-strong);margin-right:3px}
.companies-page .chip{font-size:11px;padding:7px 10px}
.companies-page .section-row{padding:20px 22px;align-items:center;flex-wrap:wrap}
.companies-page .section-row h3,.contacts-page .section-row h3{font-size:18px;line-height:1.5}
.companies-page .section-row .tiny,.contacts-page .section-row .tiny{font-size:12px;line-height:1.6;color:var(--muted-strong);margin:4px 0 0}
.companies-page .sort-field{min-width:155px}
.companies-page .table-wrap{padding:0;scrollbar-width:thin;scrollbar-color:var(--line) transparent}
.companies-page .data-table{font-size:12px;min-width:850px}
.companies-page .data-table th{font-size:10px;text-transform:uppercase;letter-spacing:.05em;padding:14px 12px}
.companies-page .data-table td{padding:18px 12px;line-height:1.7}
.companies-page .data-table th:first-child,.companies-page .data-table td:first-child{padding-left:22px}
.companies-page .data-table th:last-child,.companies-page .data-table td:last-child{padding-right:22px}
.companies-page .data-table th:last-child,.companies-page .data-table td:last-child{position:sticky;right:0;box-shadow:-5px 0 12px color-mix(in srgb,var(--text) 3%,transparent)}
.companies-page .data-table td:last-child{background:var(--surface)}
.companies-page .data-table th:last-child{z-index:2}
.companies-page .company-cell{min-width:210px;gap:10px}
.companies-page .logo-tile{flex:0 0 38px;width:38px;height:38px;box-shadow:none}
.companies-page .company-name{font-size:13px;line-height:1.5}
.companies-page .company-cell .tiny{font-size:10px;margin-top:4px;color:var(--muted-strong)}
.companies-page .score{min-width:58px;font-size:10px;height:27px}
.companies-page .row-action{display:flex;align-items:center;justify-content:center;gap:6px;width:auto;min-width:98px;height:36px;font-size:11px;border-radius:10px;padding:0 10px}
.ticket-cell{white-space:nowrap}
.demo-data-caption{font-size:11px;color:var(--muted-strong);line-height:1.6;margin:0;padding:12px 22px 16px}
.search-empty{text-align:center;padding:36px 20px;color:var(--muted-strong);font-size:13px;line-height:1.7}
.search-empty strong{color:var(--text);font-size:15px}
.search-empty p{margin:7px 0 0}
.contacts-page .split{grid-template-columns:270px minmax(0,1fr);gap:16px;align-items:stretch}
.contacts-page .side-card{padding:22px;display:grid;gap:18px;height:100%;align-content:start}
.contacts-page .side-card h3{font-size:16px;margin:0;line-height:1.5}
.contacts-page .selected-company{grid-template-columns:44px minmax(0,1fr);gap:10px;align-items:start}
.contacts-page .selected-company .logo-tile{width:44px;height:44px;border-radius:12px;box-shadow:none}
.contacts-page .company-name{font-size:16px;line-height:1.5;overflow-wrap:anywhere}
.contacts-page .selected-company .tiny{font-size:11px;line-height:1.6;color:var(--muted-strong)}
.contacts-page .meta-list{margin:0;gap:12px}
.company-meta-line{display:grid;gap:4px;padding-bottom:12px;border-bottom:1px solid var(--line)}
.company-meta-line span{font-size:10px;color:var(--muted-strong);font-weight:600}
.company-meta-line strong{font-size:12px;font-weight:600;line-height:1.6;overflow-wrap:anywhere}
.contacts-page .side-card .secondary{font-size:12px;height:40px;width:100%}
.selection-guidance{font-size:12px;line-height:1.7;color:var(--muted-strong);margin:0}
.contacts-page .section-row{padding:20px;gap:12px;flex-wrap:wrap;align-items:center}
.contacts-page .contact-toolbar{grid-template-columns:1fr;padding:0 20px 18px}
.contacts-page .searchbox input{min-width:0;height:42px;font-size:12px;border-radius:11px;padding-right:12px}
.contacts-page .contact-list{padding:0;overflow:hidden}
.contacts-page .contact-row{grid-template-columns:22px minmax(150px,1fr) minmax(180px,1.1fr) 68px;gap:12px;padding:18px 20px;align-items:center;font-size:12px}
.contacts-page .contact-head{font-size:10px;text-transform:uppercase;letter-spacing:.04em;padding-top:12px;padding-bottom:12px}
.contacts-page .contact-row>*{min-width:0}
.contacts-page .contact-row>*:nth-child(4){display:block}
.contacts-page .contact-row.is-selected{background:color-mix(in srgb,var(--accent) 6%,var(--surface));box-shadow:inset 3px 0 0 var(--accent)}
.contacts-page .contact-row:not(.contact-head):hover{background:color-mix(in srgb,var(--accent) 4%,var(--surface))}
.contacts-page .contact-row .person{align-items:flex-start;min-width:0;gap:10px}
.contacts-page .contact-row .person>div:last-child{min-width:0}
.contacts-page .contact-row .avatar{flex:0 0 34px;width:34px;height:34px;font-size:11px}
.contacts-page .contact-row .person strong{font-size:13px;line-height:1.6;overflow-wrap:anywhere}
.contact-role{display:block;color:var(--muted-strong);font-size:11px;line-height:1.6;margin-top:2px}
.contacts-page .contact-row .tiny{display:block;font-size:10px;line-height:1.6;margin-top:3px;color:var(--muted-strong)}
.contact-reach{display:grid;gap:9px;color:var(--text)}
.contact-reach>span{display:grid;gap:3px;font-size:11px;line-height:1.6;overflow-wrap:anywhere}
.contact-reach small{font-size:9px;color:var(--muted-strong);line-height:1.4}
.contacts-page .contact-row .action-links{display:flex;gap:6px;justify-content:flex-end}
.contacts-page .sticky-action{padding:16px 20px;flex-wrap:wrap;gap:12px}
.contacts-page .sticky-action strong{font-size:12px;line-height:1.5;color:var(--muted-strong)}
.contacts-page .sticky-action .primary{height:40px;font-size:12px;border-radius:11px;box-shadow:none}
.contacts-page .primary:disabled{background:var(--field);color:var(--muted-strong);border:1px solid var(--line);cursor:default;opacity:.7}
.budget-page:has(.budget-detail){grid-template-columns:minmax(0,1.2fr) minmax(280px,.8fr);align-items:start}
.budget-page:has(.budget-detail)>.portfolio-head{grid-column:1/-1}
.budget-page .budget-detail,.budget-page .budget-history{padding:22px;gap:22px}
.budget-page .budget-detail-head{padding-bottom:18px;border-bottom:1px solid var(--line)}
.budget-page .budget-detail-head .compact-stage-select{width:100%;min-width:0}
.budget-page .budget-detail-head .compact-stage-select select{width:100%;height:40px}
.budget-page .budget-action-form{gap:16px;padding-top:18px;border-top:1px solid var(--line)}
.budget-page .budget-form-grid{grid-template-columns:1fr 1fr;gap:14px}
.budget-page .budget-form-grid>label:last-child{grid-column:1/-1}
.budget-page .budget-action-form .field{font-size:12px;font-weight:600;height:42px}
.budget-page .budget-action-form textarea.field{height:auto;min-height:100px}
.budget-page .budget-action-form .primary{height:42px;font-size:12px;border-radius:11px;justify-self:end;box-shadow:none}
@media(max-width:1200px){.budget-page:has(.budget-detail){grid-template-columns:1fr}}
@media(min-width:701px) and (max-width:1000px){
  .topbar:has(.topbar-context){padding:0 12px;gap:8px}
  .topbar:has(.topbar-context) .top-actions{gap:6px}
  .topbar:has(.topbar-context) .theme-toggle{height:36px;font-size:11px;padding:0 10px}
  .topbar:has(.topbar-context) #themeQuick{width:36px;padding:0;justify-content:center}
  .topbar:has(.topbar-context) #themeQuick>span:last-child{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  .topbar:has(.topbar-context) .round-icon,.topbar:has(.topbar-context) .avatar-btn{width:36px;height:36px}
  .topbar-context-copy strong{white-space:nowrap}
}
@container(max-width:760px){
  .companies-page .filters{grid-template-columns:1fr 1fr}
  .contacts-page .split{grid-template-columns:1fr}
  .contacts-page .side-card{grid-template-columns:1fr 1fr;padding:18px;gap:14px 20px;height:auto}
  .contacts-page .side-card h3{grid-column:1/-1}
  .contacts-page .meta-list{grid-row:2/4;grid-column:2;grid-template-columns:1fr 1fr;gap:10px}
  .company-meta-line{padding-bottom:8px}
  .contacts-page .side-card .secondary{align-self:start;max-width:210px}
  .contacts-page .selection-guidance{grid-column:1/-1}
}
@container(max-width:560px){
  .search-section-head{align-items:start;flex-direction:column;gap:12px}
  .search-section-head h2{font-size:20px}
  .companies-page .toolbar{grid-template-columns:1fr}
  .companies-page .toolbar-action .primary{flex:1}
  .companies-page .hero-card{padding:18px}
  .companies-page .section-row{padding:18px}
  .companies-page .right-tools,.companies-page .sort-field{width:100%}
  .contacts-page .contact-head{display:none}
  .contacts-page .contact-row{grid-template-columns:22px minmax(0,1fr) 68px;gap:12px;padding:16px}
  .contacts-page .contact-row .person{grid-column:2;grid-row:1}
  .contacts-page .contact-row .contact-reach{grid-column:2/-1;grid-row:2}
  .contacts-page .contact-row .action-links{grid-column:3;grid-row:1}
  .contacts-page .contact-row .contact-check{align-self:start;margin-top:8px}
  .contacts-page .sticky-action{padding:16px}
}
@container(max-width:440px){
  .contacts-page .side-card{grid-template-columns:1fr}
  .contacts-page .meta-list{grid-column:1;grid-row:auto}
  .companies-page .filters{grid-template-columns:1fr}
}
