/* Apresentação exclusiva do representante. Não altera visibilidade/permissões. */
html body #crmApp.crm-representante-ui #portfolioControlBar {
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(240px,340px)!important;
  align-items:end!important;
  gap:20px!important;
  padding:20px 24px!important;
  min-height:0!important;
  border:1px solid var(--line)!important;
  border-radius:18px!important;
  box-shadow:none!important;
}
html body #crmApp.crm-representante-ui #portfolioControlBar .main-client-actions {
  grid-column:1;grid-row:1;
  display:flex!important;flex-wrap:wrap!important;
  align-items:center!important;gap:10px!important;
  margin:0!important;padding:0!important;width:auto!important;
}
html body #crmApp.crm-representante-ui #portfolioControlBar #hierarchyToolbar {
  grid-column:2;grid-row:1;
  display:block!important;width:100%!important;min-width:0!important;margin:0!important;
}
html body #crmApp.crm-representante-ui #portfolioControlBar .field {
  margin:0!important;min-width:0!important;max-width:100%!important;
  font-size:12px!important;font-weight:600;line-height:1.5;
}
html body #crmApp.crm-representante-ui #portfolioControlBar .select {
  margin-top:6px;height:42px!important;min-height:42px!important;
  width:100%!important;max-width:100%!important;border-radius:10px!important;
  font-size:13px!important;
}
html body #crmApp.crm-representante-ui #portfolioControlBar .main-client-actions > .btn,
html body #crmApp.crm-representante-ui #view-escritorios .view-head [data-action="office-new"],
html body #crmApp.crm-representante-ui #view-escritorios .row-actions .btn,
html body #crmApp.crm-representante-ui #view-pedidos .op-acoes .btn {
  min-height:42px!important;height:auto!important;
  padding:10px 14px!important;border-radius:10px!important;
  font-size:13px!important;font-weight:600!important;line-height:1.4!important;
  white-space:normal!important;word-break:normal!important;overflow-wrap:normal!important;
  box-shadow:none!important;transform:none!important;
}
html body #crmApp.crm-representante-ui #portfolioControlBar .main-client-actions > .btn:not(#newCustomerBtn),
html body #crmApp.crm-representante-ui #view-escritorios .row-actions .btn,
html body #crmApp.crm-representante-ui #view-pedidos .op-acoes .btn {
  background:var(--surface)!important;color:var(--text)!important;
  -webkit-text-fill-color:var(--text)!important;border:1px solid var(--line-strong)!important;
}
html body #crmApp.crm-representante-ui #portfolioControlBar #newCustomerBtn,
html body #crmApp.crm-representante-ui #view-escritorios .view-head [data-action="office-new"] {
  background:var(--text)!important;color:var(--surface)!important;
  -webkit-text-fill-color:var(--surface)!important;border:1px solid var(--text)!important;
}
html body #crmApp.crm-representante-ui #portfolioControlBar .main-client-actions > .btn svg {
  width:16px!important;height:16px!important;flex-shrink:0!important;
}
html body #crmApp.crm-representante-ui #view-escritorios .view-head,
html body #crmApp.crm-representante-ui #view-pedidos .view-head {
  gap:20px;align-items:center;margin-bottom:20px;
}
html body #crmApp.crm-representante-ui #view-escritorios .view-head h1,
html body #crmApp.crm-representante-ui #view-pedidos .view-head h1 {
  font-size:clamp(24px,2.3vw,32px)!important;line-height:1.2!important;letter-spacing:-.025em;
}
html body #crmApp.crm-representante-ui #view-escritorios .view-head p,
html body #crmApp.crm-representante-ui #view-pedidos .view-head p {
  font-size:14px!important;line-height:1.6;margin-top:8px;
}
html body #crmApp.crm-representante-ui #view-escritorios .management-card,
html body #crmApp.crm-representante-ui #view-pedidos .op-vendas-card {
  padding:22px!important;border-radius:18px!important;
  border:1px solid var(--line)!important;box-shadow:none!important;
}
html body #crmApp.crm-representante-ui #view-escritorios .base-table th,
html body #crmApp.crm-representante-ui #view-pedidos .op-vendas-table th {
  padding:12px 14px!important;font-size:11px!important;
  line-height:1.5!important;letter-spacing:.04em;
  white-space:normal!important;overflow-wrap:normal!important;word-break:normal!important;
}
html body #crmApp.crm-representante-ui #view-escritorios .base-table td,
html body #crmApp.crm-representante-ui #view-pedidos .op-vendas-table td {
  padding:14px!important;font-size:13px!important;line-height:1.6!important;
  vertical-align:middle!important;
}
html body #crmApp.crm-representante-ui #view-escritorios .base-table td:first-child,
html body #crmApp.crm-representante-ui #view-pedidos .op-vendas-table td:first-child { font-weight:600; }
html body #crmApp.crm-representante-ui #view-escritorios .row-actions { gap:8px;flex-wrap:wrap; }
html body #crmApp.crm-representante-ui #view-pedidos .op-acoes { align-items:flex-start; }
html body #crmApp.crm-representante-ui #view-pedidos .op-acoes .btn { width:auto!important;min-width:0!important;max-width:100%!important; }
html body #crmApp.crm-representante-ui #view-pedidos .op-pill { font-size:11px;line-height:1.5;padding:5px 9px; }
html body #crmApp.crm-representante-ui #view-escritorios input[type="search"] {
  height:42px!important;min-height:42px!important;max-width:440px!important;
  border-radius:10px!important;font-size:14px!important;
}
html body #crmApp.crm-representante-ui #view-escritorios label:has(> input[type="search"]) { font-size:13px;font-weight:600; }
html body #crmApp.crm-representante-ui #view-escritorios div:has(> label > input[type="search"]) > .small-note {
  display:inline-block;padding:6px 10px!important;margin:10px 0 0!important;
  border-radius:8px!important;font-size:12px!important;line-height:1.5;
}
html body #crmApp.crm-representante-ui #portfolioControlBar [hidden],
html body #crmApp.crm-representante-ui #view-escritorios tr[hidden] { display:none!important; }
@media(min-width:1051px) {
  html body #crmApp.crm-representante-ui #view-pedidos .op-vendas-table th:nth-child(1){width:18%}
  html body #crmApp.crm-representante-ui #view-pedidos .op-vendas-table th:nth-child(2){width:14%}
  html body #crmApp.crm-representante-ui #view-pedidos .op-vendas-table th:nth-child(3){width:8%}
  html body #crmApp.crm-representante-ui #view-pedidos .op-vendas-table th:nth-child(4){width:8%}
  html body #crmApp.crm-representante-ui #view-pedidos .op-vendas-table th:nth-child(5){width:6%}
  html body #crmApp.crm-representante-ui #view-pedidos .op-vendas-table th:nth-child(6){width:8%}
  html body #crmApp.crm-representante-ui #view-pedidos .op-vendas-table th:nth-child(7){width:11%}
  html body #crmApp.crm-representante-ui #view-pedidos .op-vendas-table th:nth-child(8){width:9%}
  html body #crmApp.crm-representante-ui #view-pedidos .op-vendas-table th:nth-child(9){width:10%}
  html body #crmApp.crm-representante-ui #view-pedidos .op-vendas-table th:nth-child(10){width:8%}
}
@media(max-width:1100px) {
  html body #crmApp.crm-representante-ui #portfolioControlBar { grid-template-columns:minmax(0,1fr)!important;gap:16px!important; }
  html body #crmApp.crm-representante-ui #portfolioControlBar #hierarchyToolbar { grid-column:1;grid-row:2; }
}
@media(max-width:600px) {
  html body #crmApp.crm-representante-ui #portfolioControlBar { padding:16px!important; }
  html body #crmApp.crm-representante-ui #portfolioControlBar .main-client-actions { display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr)); }
  html body #crmApp.crm-representante-ui #portfolioControlBar .main-client-actions > .btn { width:100%!important;min-width:0!important;max-width:100%!important;padding:10px!important; }
  html body #crmApp.crm-representante-ui #view-escritorios .view-head { align-items:flex-start;flex-direction:column; }
  html body #crmApp.crm-representante-ui #view-escritorios .management-card,
  html body #crmApp.crm-representante-ui #view-pedidos .op-vendas-card { padding:14px!important; }
}

/* Ajuste fino de espaço para liberação, entrega e ações. */
html body #crmApp.crm-representante-ui #view-pedidos .op-vendas-table th:nth-child(n+6),
html body #crmApp.crm-representante-ui #view-pedidos .op-vendas-table td:nth-child(n+6) {
  padding-left:10px!important;padding-right:10px!important;
}
html body #crmApp.crm-representante-ui #view-pedidos .op-vendas-table .op-pill {
  display:inline-block;width:max-content;max-width:100%;box-sizing:border-box;
  padding:5px 8px;border-radius:8px!important;line-height:1.45;
  white-space:normal;word-break:normal;overflow-wrap:normal;
}
html body #crmApp.crm-representante-ui #view-pedidos .op-vendas-table th:nth-child(9),
html body #crmApp.crm-representante-ui #view-pedidos .op-vendas-table td:nth-child(9),
html body #crmApp.crm-representante-ui #view-pedidos .op-vendas-table th:last-child {
  text-align:center;
}
html body #crmApp.crm-representante-ui #view-pedidos .op-acoes { align-items:center; }
