/* CRM UI-01. Tokens apply only to the CRM document, including dialog portals. */
html[data-crm-theme="light"] {
  color-scheme:light;
  --font-sans:'Plus Jakarta Sans',ui-sans-serif,system-ui,-apple-system,'Segoe UI',sans-serif;
  --gray-0:#FFFFFF;--gray-25:#F8FAFC;--gray-50:#F3F6FA;--gray-100:#EAF0F5;
  --gray-150:#D6E0E8;--gray-200:#C4D0DC;--gray-300:#74879B;--gray-400:#586C82;
  --gray-500:#506278;--gray-600:#42566D;--gray-700:#34485E;--gray-800:#24364C;--gray-900:#142235;
  --forest-50:#EAF0F5;--forest-100:#D6E0E8;--forest-200:#DCE6EF;--forest-300:#527C89;
  --forest-400:#427384;--forest-500:#326477;--forest-600:#24576A;--forest-700:#086578;
  --forest-800:#1D3B4D;--forest-900:#142235;--forest-950:#202D3D;
  --lime-50:#E6F6F9;--lime-100:#D5EFF4;--lime-200:#B8E5EE;--lime-300:#82DCEC;
  --lime-400:#52CEE7;--lime-500:#70D7EA;--lime-600:#087F91;--lime-700:#086578;--lime-800:#07586B;
  --bg-app:#F3F6FA;--bg-sidebar:#202D3D;--surface-card:#FFFFFF;--surface-muted:#F3F6FA;
  --surface-sunken:#EAF0F5;--surface-hover:#EAF0F5;--surface-selected:#E6F6F9;
  --surface-brand:#52CEE7;--surface-brand-soft:#E6F6F9;--surface-inverse:#202D3D;--surface-overlay:rgba(20,34,53,.48);
  --text-primary:#142235;--text-secondary:#506278;--text-tertiary:#586C82;--text-disabled:#74879B;
  --text-on-inverse:#FFFFFF;--text-on-brand:#142235;--text-link:#086578;--text-link-hover:#07586B;
  --action-primary:#087F91;--action-primary-hover:#086578;--action-on-primary:#FFFFFF;
  --selection-bg:#E6F6F9;--selection-text:#086578;--unread-bg:#087F91;--unread-text:#FFFFFF;
  --border-default:#D6E0E8;--border-subtle:#E3EAF0;--border-strong:#74879B;--border-control:#74879B;
  --border-brand:#087F91;--border-focus:#087F91;
  --red-50:#FFF0F1;--red-100:#FADDE0;--red-500:#BA293D;--red-600:#9F1F30;
  --amber-50:#FFF4DF;--amber-100:#FBE7BF;--amber-500:#9B5B08;--amber-700:#86500A;
  --blue-50:#EDF3FF;--blue-100:#D9E7FF;--blue-500:#275EB8;--blue-700:#214E99;
  --status-success-bg:#E6F6F1;--status-success-fg:#17674F;--status-success-dot:#17674F;
  --status-danger-bg:#FFF0F1;--status-danger-fg:#BA293D;--status-danger-dot:#BA293D;
  --status-warning-bg:#FFF4DF;--status-warning-fg:#86500A;--status-warning-dot:#86500A;
  --status-info-bg:#EDF3FF;--status-info-fg:#214E99;--status-info-dot:#275EB8;
  --status-neutral-bg:#EAF0F5;--status-neutral-fg:#42566D;--status-neutral-dot:#586C82;
  --chart-1:#087F91;--chart-2:#6F94A0;--chart-3:#8696A6;--chart-4:#B8E5EE;--chart-5:#34485E;
  --chart-grid:#D6E0E8;--chart-axis:#586C82;
  --gradient-lime-sheen:linear-gradient(135deg,#FFFFFF,#EAF0F5);
  --gradient-frost:linear-gradient(145deg,#FFFFFF,#EAF0F5);
  --gradient-lime-mist:linear-gradient(145deg,#FFFFFF,#E6F6F9);
  --gradient-orb:radial-gradient(circle at 30% 25%,#E8FAFF,#52CEE7 30%,#087F91 68%,#202D3D);
  --shadow-xs:0 2px 6px rgba(20,34,53,.045);--shadow-sm:0 2px 8px rgba(20,34,53,.06);
  --shadow-md:0 12px 32px rgba(20,34,53,.13);--shadow-lg:0 20px 54px rgba(20,34,53,.18);
  --shadow-highlight:inset 0 1px rgba(255,255,255,.65);
  --focus-ring:0 0 0 3px rgba(8,127,145,.24);--focus-ring-danger:0 0 0 3px rgba(186,41,61,.22);
}
html[data-crm-theme="light"] body {margin:0;background:var(--bg-app);color:var(--text-primary);}
/* UI-03: product identity is separate from the active organization and DS namespace. */
html[data-crm-theme="light"] .crm-brand {display:inline-flex;align-items:center;gap:8px;width:180px;height:40px;flex-shrink:0;vertical-align:middle;font-family:'Plus Jakarta Sans',ui-sans-serif,system-ui,sans-serif;color:#0F1720;white-space:nowrap;}
html[data-crm-theme="light"] .crm-brand__symbol {display:block;width:40px;height:40px;flex-shrink:0;object-fit:contain;}
html[data-crm-theme="light"] .crm-brand__wordmark {display:inline-flex;align-items:baseline;gap:5px;white-space:nowrap;}
html[data-crm-theme="light"] .crm-brand__name {font-size:20.7px;line-height:1.2;font-weight:700;letter-spacing:-.405px;}
html[data-crm-theme="light"] .crm-brand__category {font-size:9.9px;line-height:1.2;font-weight:500;letter-spacing:.765px;color:#334155;}
html[data-crm-theme="light"] .crm-brand--dark {color:#FFFFFF;}
html[data-crm-theme="light"] .crm-brand--dark .crm-brand__category {color:#00CFFF;}
html[data-crm-theme="light"] .crm-brand--symbol {width:40px;}
html[data-crm-theme="light"] .crm-brand--context {width:auto;max-width:100%;height:auto;min-height:12px;font-size:10px;line-height:1.2;font-weight:600;letter-spacing:0;color:var(--text-secondary);overflow:hidden;text-overflow:ellipsis;}
html[data-crm-theme="light"] .crm-auth-brand {flex-shrink:0;line-height:0;}
.crm-topbar input[type="search"] {min-height:24px;}
@media(max-width:899px) {.crm-navigation button[aria-label="Fechar menu"] {min-width:44px!important;min-height:44px!important;flex-shrink:0!important;}}
/* Auth is also rendered outside .crm-app. Size the native targets at every width. */
html:has(.crm-auth-overlay),html:has(.crm-auth-overlay) body {overflow:hidden!important;}
.crm-auth-overlay {box-sizing:border-box;height:100vh;height:100dvh;overscroll-behavior:contain;}
.crm-auth {min-height:100vh;min-height:100dvh;box-sizing:border-box;}
.crm-auth>div {min-width:0;box-sizing:border-box;}
.crm-auth-demo-notice {font-size:12px;line-height:1.6;color:var(--text-secondary);overflow-wrap:anywhere;}
.crm-auth-demo-notice a {color:var(--text-link);text-decoration:underline;}
@media(max-width:640px) {.crm-auth-plan-actions {flex-direction:column-reverse;}.crm-auth-plan-actions button {width:100%;flex:auto!important;}}
.crm-auth .crm-auth-error {margin:0;padding:10px 12px;border:1px solid var(--red-100);border-radius:10px;background:var(--red-50);color:var(--red-600);font-size:13px;line-height:1.6;overflow-wrap:anywhere;}
.crm-screen-loading,.crm-screen-load-error {box-sizing:border-box;max-width:600px;padding:24px;color:var(--text-primary);font-family:var(--font-sans);line-height:1.6;}
.crm-screen-load-error {margin:24px auto;border:1px solid var(--border-default);border-radius:var(--radius-lg);background:var(--surface-card);}
.crm-screen-load-error h2 {font-size:20px;line-height:1.3;margin:0 0 12px;overflow-wrap:anywhere;}
.crm-screen-load-error p {font-size:14px;margin:0 0 16px;color:var(--text-secondary);}
.crm-screen-load-error button {min-height:44px;padding:10px 18px;border:1px solid var(--border-default);border-radius:var(--radius-button);font:600 14px var(--font-sans);background:var(--surface-brand);color:var(--text-on-brand);cursor:pointer;}
.crm-screen-load-error button:focus-visible {outline:2px solid var(--border-focus);outline-offset:3px;}
.crm-auth input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]) {min-width:44px;min-height:44px;box-sizing:border-box;}
/* Keep the hit area stable between pointer press and release, including its edges. */
.crm-auth button {min-width:44px;min-height:44px;box-sizing:border-box;--press-scale:1;}
.crm-auth a,.crm-auth label:has(>input[type="checkbox"]) {display:inline-flex;align-items:center;min-width:44px;min-height:44px;box-sizing:border-box;}
.crm-auth label:has(>input[type="checkbox"]) {position:relative;}
.crm-auth :where(button,a,input,select,[tabindex]):focus-visible {outline:2px solid var(--border-focus)!important;outline-offset:3px;}
.crm-auth label:has(>input[type="checkbox"]:focus-visible) {outline:2px solid var(--border-focus);outline-offset:3px;border-radius:5px;}
.crm-app :where(button,input,textarea,select) {font:inherit;}
.crm-app :where(button,a,input,textarea,select,[tabindex]):focus-visible {outline:2px solid var(--border-focus)!important;outline-offset:3px;}
.crm-app a {color:var(--text-link);text-decoration:none;}
.crm-app a:hover {color:var(--text-link-hover);text-decoration:underline;}
.crm-app :where(input,textarea)::placeholder {color:var(--text-tertiary);opacity:1;}
.crm-app ::selection {background:var(--selection-bg);color:var(--selection-text);}
/* Legacy DS aliases: primary actions use cyan while forest remains readable ink. */
.crm-app button[style*="background: var(--forest-900)"],.crm-app button[style*="background: var(--forest-700)"] {background:var(--action-primary)!important;color:var(--action-on-primary)!important;}
.crm-app button[style*="background: var(--forest-900)"]:hover,.crm-app button[style*="background: var(--forest-700)"]:hover {background:var(--action-primary-hover)!important;}
.crm-app button[aria-haspopup="listbox"],.crm-app button[style*="border: 1px solid var(--border-default)"],
.crm-app .vc-input-shell:not(:has([aria-invalid="true"])) {border-color:var(--border-control)!important;}
.crm-app .vc-input-shell:focus-within,.crm-app button[aria-haspopup="listbox"][aria-expanded="true"] {border-color:var(--border-focus)!important;box-shadow:var(--focus-ring)!important;}
.crm-app .vc-input-shell:has([aria-invalid="true"]):focus-within {border-color:var(--red-500)!important;box-shadow:var(--focus-ring-danger)!important;}
/* The shell is the keyboard indicator; suppress only the nested duplicate. */
.crm-app .vc-input-shell .vc-input-control:focus-visible {outline:none!important;box-shadow:none!important;}
/* Only nested controls defer to their already visible container focus ring. */
html[data-crm-theme="light"] :is(.crm-app,[role="dialog"]) .crm-message-editor textarea:focus-visible,
html[data-crm-theme="light"] :is(.crm-app,[role="dialog"]) form[role="search"] input:focus-visible,
html[data-crm-theme="light"] :is(.crm-app,[role="dialog"]) .vc-input-shell .vc-input-control:focus-visible {outline:none!important;box-shadow:none!important;}
.crm-app .vc-input-control:read-only {cursor:default;}
.crm-app .vc-dialog-footer>*,.crm-app .vc-drawer-footer>* {min-width:0;max-width:100%;white-space:normal!important;overflow-wrap:anywhere;flex-shrink:1;}
.crm-app .vc-dialog-footer button,.crm-app .vc-drawer-footer button {height:auto!important;padding-top:10px!important;padding-bottom:10px!important;}
.crm-app [role="radio"][aria-checked="true"],.crm-app [role="option"][aria-selected="true"] {background:var(--selection-bg)!important;color:var(--selection-text)!important;}
.crm-app label:has(>input[type="checkbox"])>span[aria-hidden="true"] {border-color:var(--border-control)!important;}
.crm-app label:has(>input[type="checkbox"]:checked)>span[aria-hidden="true"] {background:var(--action-primary)!important;border-color:var(--action-primary)!important;}
.crm-app label:has(>input[type="checkbox"]:checked)>span svg {color:white!important;}
.crm-topbar>header {background:rgba(255,255,255,.97)!important;border-bottom:1px solid var(--border-default)!important;}
.crm-app>nav {background:rgba(255,255,255,.98)!important;}
/* Sidebar nav/account consume gray aliases and need a separate scope. */
.crm-navigation aside {
  --gray-0:#2C3D51;--gray-50:#31445A;--gray-100:#31445A;--gray-500:#B8C9D9;--gray-600:#DCE6EF;
  --text-primary:#DCE6EF;--text-secondary:#B8C9D9;--text-tertiary:#B8C9D9;
  --border-default:#53677E;--border-subtle:#3B4E65;--border-focus:#52CEE7;--surface-inverse:#26374B;
  color:var(--text-primary);
}
.crm-navigation aside nav button {min-height:44px;}
.crm-navigation aside nav button svg {color:currentColor!important;}
.crm-navigation aside nav button[aria-current="page"] {background:var(--selection-bg)!important;color:var(--selection-text)!important;border-color:var(--selection-bg)!important;box-shadow:none!important;}
.crm-navigation aside nav button:not([aria-current]):hover {background:#31445A!important;}
/* Keep the navigation scrollbar inside its panel; the logo/account stay put. */
.crm-navigation>.sc-host-x {height:100%;min-height:0;}
.crm-navigation aside {min-height:0;max-height:100dvh;overflow:hidden!important;}
.crm-navigation aside>div,.crm-navigation aside>button {flex-shrink:0;}
.crm-navigation aside>nav {flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#74879B #202D3D;scrollbar-gutter:stable;}
.crm-navigation aside>nav::-webkit-scrollbar {width:7px;}
.crm-navigation aside>nav::-webkit-scrollbar-track {background:#202D3D;}
.crm-navigation aside>nav::-webkit-scrollbar-thumb {background:#74879B;border:2px solid #202D3D;border-radius:6px;}
.crm-navigation aside>nav:focus-visible {outline:2px solid #52CEE7;outline-offset:-2px;}
.crm-follow-up {min-height:44px;cursor:pointer;transition:background .15s,border-color .15s;}
.crm-follow-up:hover {background:var(--surface-selected)!important;border-color:var(--action-primary)!important;}
.crm-follow-up:focus-visible {outline:2px solid var(--border-focus);outline-offset:3px;}
.crm-learn-conversation {min-height:44px;cursor:pointer;transition:background .15s,border-color .15s;}
.crm-learn-conversation:not(:disabled):hover {background:var(--surface-selected)!important;border-color:var(--action-primary)!important;}
.crm-learn-conversation:focus-visible {outline:2px solid var(--border-focus);outline-offset:3px;}
.crm-learn-conversation:disabled {cursor:wait;}
.crm-deal-actions {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;min-width:0;width:100%;}
.crm-deal-actions>button {min-width:0;min-height:44px;max-width:100%;padding-left:10px!important;padding-right:10px!important;}
.crm-notification [role="status"] {color:var(--text-on-inverse)!important;}
.crm-notification [role="status"]>div>div+div {color:#DCE6EF!important;}
.crm-unread {background:var(--unread-bg);color:var(--unread-text);}
.crm-dashboard {align-items:start;}
.crm-section-label {grid-column:span 12;margin:4px 0 -4px;font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:var(--text-secondary);font-weight:600;}
.crm-contact-list,.crm-inbox,.crm-inbox-thread,.crm-inbox-list {min-width:0;}
.crm-contact-toolbar {padding-bottom:14px;border-bottom:1px solid var(--border-subtle);}
.crm-thread-header {flex-wrap:wrap;}
.crm-thread-person {display:flex;align-items:center;gap:10px;flex:1 1 180px;min-width:0;}
.crm-thread-actions {display:flex;align-items:center;gap:8px;flex:0 1 auto;min-width:0;}
.crm-thread-actions .crm-thread-assignee span:has(+button[aria-haspopup="listbox"]) {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;}
.crm-thread-identity {flex-basis:120px;}
.crm-thread-assignee {margin-left:auto;}
.crm-messages {min-height:0!important;overscroll-behavior:contain;overflow-wrap:anywhere;}
.crm-message {overflow-wrap:anywhere;}
.crm-composer {background:var(--surface-card);min-height:0;flex-shrink:1!important;overflow-y:auto;scrollbar-width:thin;}
.crm-message-editor {box-sizing:border-box;}
.crm-message-editor:has(.crm-message-editor__info[open]) {min-height:180px;}
.crm-message-editor:focus-within {border-color:var(--border-focus)!important;box-shadow:0 0 0 2px var(--surface-selected);}
.crm-message-editor textarea {flex:0 1 auto;min-height:44px!important;border:0!important;outline:0!important;box-shadow:none!important;resize:none!important;}
.crm-message-editor__previews {overscroll-behavior:contain;scrollbar-width:thin;}
.crm-message-editor__previews>div {flex-shrink:0;}
.crm-message-editor__action:hover:not(:disabled) {background:var(--surface-hover)!important;color:var(--text-link)!important;}
.crm-message-editor__action[aria-label="Enviar localmente"]:hover:not(:disabled) {background:var(--action-primary-hover)!important;color:var(--action-on-primary)!important;}
.crm-message-editor__action:focus-visible,.crm-message-editor summary:focus-visible {outline:2px solid var(--border-focus);outline-offset:-2px;}
.crm-message-editor__action:disabled {cursor:default;opacity:.5;}
.crm-week-grid {display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:8px;min-width:0;}
.crm-week-grid>div {min-width:0;overflow-wrap:anywhere;}
.crm-week-grid label {min-width:0;}
.crm-week-grid>div>div:first-child,.crm-week-grid [data-crm-task-label] {flex-wrap:wrap;gap:5px!important;}
.crm-app .crm-task-add {display:grid!important;grid-template-columns:minmax(0,1fr) auto;align-items:start!important;}
.crm-app .crm-task-add>div {min-width:0;}
.crm-app .crm-task-add>button {margin-top:0!important;flex-shrink:0;}
.crm-task-add .vc-input-shell {min-height:44px!important;}
.crm-task-add #crm-task-title-message {min-height:18px;line-height:18px;}
.crm-app .crm-task-form-error {grid-column:1/-1;}
@media(max-width:899px) {
  .crm-app button:not([role="switch"]),.crm-app [role="option"],.crm-app [role="button"] {min-height:44px;}
  .crm-app button[aria-label]:not([role="radio"]):not([role="tab"]):not([aria-haspopup="listbox"]) {min-width:44px;}
  .crm-app label:has(>input[type="checkbox"]) {min-width:44px;min-height:44px;align-items:center!important;justify-content:center;}
  .crm-app div:has(>input:not([type="checkbox"]):not([type="file"])) {min-height:44px;}
  .crm-app input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),.crm-app textarea {min-height:44px;box-sizing:border-box;}
  .crm-app a {display:inline-flex;align-items:center;min-height:44px;}
  .crm-topbar>header {gap:6px!important;padding:8px!important;}
  .crm-topbar button[aria-label="Abrir assistente"] {display:none!important;}
  .crm-contact-toolbar>* {flex:1 1 100%!important;min-width:0!important;}
  .crm-contact-list [role="tablist"] {width:100%;gap:16px!important;}
  .crm-week-grid {grid-template-columns:repeat(2,minmax(0,1fr));}
  .crm-week-grid>div {min-height:180px!important;}
  .crm-task-add {flex-wrap:wrap;min-width:0!important;}
  .crm-task-add>div {min-width:180px;}
  .crm-task-copy {min-width:0!important;flex-basis:calc(100% - 110px)!important;}
  .crm-inbox {height:calc(100dvh - 190px)!important;min-height:460px!important;}
  .crm-inbox button[aria-label] {min-width:44px!important;flex-shrink:0;}
  .crm-thread-header {gap:6px!important;padding:10px!important;}
  .crm-thread-actions {flex:1 1 100%;justify-content:flex-end;}
  .crm-thread-assignee {flex:1 1 140px!important;max-width:none!important;}
  .crm-thread-assignee button {width:100%!important;}
  .crm-composer {padding:8px 10px!important;}
  .crm-inbox .crm-message {max-width:90%!important;}
}
@media(max-width:479px) {.crm-week-grid {grid-template-columns:minmax(0,1fr);}.crm-week-grid>div {min-height:140px!important;}}
@media(prefers-reduced-motion:reduce) {html[data-crm-theme="light"] *,html[data-crm-theme="light"] *::before,html[data-crm-theme="light"] *::after {animation:none!important;transition:none!important;}}

/* UI-02 / etapa 1: commercial dashboard. All additions stay in this screen. */
.crm-dash-financial {display:flex;flex-direction:column;gap:22px;min-width:0;font-family:var(--font-sans);color:var(--text-primary);}
.crm-dash-financial :where(section,header,div) {min-width:0;}
.crm-dash-financial .crm-dash-header {display:flex;justify-content:space-between;align-items:center;gap:18px;flex-wrap:wrap;width:100%;}
.crm-dash-financial .crm-dash-eyebrow {font-size:11px;line-height:1.5;letter-spacing:.09em;text-transform:uppercase;font-weight:600;color:var(--text-link);}
.crm-dash-financial h1 {font-size:26px;line-height:1.25;letter-spacing:-.025em;font-weight:600;margin:6px 0;overflow-wrap:anywhere;}
.crm-dash-financial .crm-dash-header p {font-size:13px;color:var(--text-secondary);line-height:1.5;margin:0;}
.crm-dash-financial .crm-dash-period {display:flex;align-items:center;gap:9px;padding:11px 14px;border:1px solid var(--border-default);border-radius:12px;background:var(--surface-card);font-size:12px;line-height:1.5;color:var(--text-secondary);}
.crm-dash-financial .crm-dash-period svg {flex-shrink:0;color:var(--text-link);}
.crm-dash-financial .crm-dash-filters {display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;width:100%;}
.crm-dash-financial .crm-dash-filters>.sc-host-x {max-width:100%;min-width:0;}
.crm-dash-financial .crm-dash-filters button {min-height:44px;}
.crm-dash-financial .crm-dash-filter-status {margin:0;font-size:12px;line-height:1.5;color:var(--text-secondary);}
.crm-dash-financial .crm-dash-filter-scope {font-size:12px;line-height:1.5;color:var(--text-secondary);margin:0;}
.crm-dash-financial .crm-dash-metrics {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;width:100%;align-items:stretch;}
.crm-dash-financial .crm-dash-metric {display:flex;min-width:0;align-items:stretch;}
/* DC keeps a host around the StatCard: stretch both existing layers per grid row. */
.crm-dash-financial .crm-dash-metric>.sc-host-x {display:flex!important;flex:1 1 auto;min-width:0;width:100%;align-items:stretch;}
.crm-dash-financial .crm-dash-metric>.sc-host-x>div {flex:1 1 auto;min-width:0;width:100%;min-height:158px;}
.crm-dash-financial .crm-dash-metric>.sc-host-x>div>div:nth-child(2)>span:first-child {font-size:clamp(22px,2vw,30px)!important;white-space:normal!important;overflow-wrap:anywhere;}
.crm-dash-financial .crm-dash-metric>.sc-host-x>div>div:nth-child(2)>span+span {font-size:11px!important;}
.crm-dash-financial .crm-dash-metric>.sc-host-x>div>div:first-child>span:nth-child(2) {white-space:normal!important;overflow:visible!important;}
.crm-dash-financial .crm-dash-metric>.sc-host-x>div>span:last-child {line-height:1.5;overflow-wrap:anywhere;}
.crm-dash-financial .crm-dash-scope {grid-column:1/-1;margin:0;font-size:12px;line-height:1.6;color:var(--text-secondary);}
.crm-dash-financial .crm-dash-analysis {display:grid;grid-template-columns:minmax(0,1.7fr) minmax(0,1fr);gap:16px;width:100%;align-items:stretch;}
.crm-dash-financial :is(.crm-dash-history,.crm-dash-pipelines)>section {height:100%;}
.crm-dash-financial .crm-dash-history>section>header {flex-wrap:wrap;row-gap:12px;}
.crm-dash-financial .crm-dash-chart-filter {display:flex;flex-direction:column;gap:5px;font-size:10.5px;color:var(--text-secondary);font-weight:500;}
.crm-dash-financial .crm-dash-chart-filter select {font:500 12px var(--font-sans);color:var(--text-primary);background:var(--surface-card);border:1px solid var(--border-control);border-radius:9px;min-height:36px;padding:7px 28px 7px 10px;max-width:100%;cursor:pointer;}
.crm-dash-financial :is(button,select,summary):focus-visible {outline:2px solid var(--border-focus);outline-offset:3px;}
.crm-dash-financial .crm-dash-chart-data {margin-top:10px;border-top:1px solid var(--border-subtle);padding-top:10px;font-size:12px;color:var(--text-secondary);}
.crm-dash-financial .crm-dash-chart-data summary {cursor:pointer;line-height:1.5;}
.crm-dash-financial table {width:100%;border-collapse:collapse;font-size:12px;margin:12px 0 0;font-variant-numeric:tabular-nums;}
.crm-dash-financial :is(th,td) {text-align:right;padding:8px 5px;border-bottom:1px solid var(--border-subtle);line-height:1.5;overflow-wrap:anywhere;}
.crm-dash-financial th:first-child {text-align:left;}
.crm-dash-financial caption {text-align:left;font-weight:600;color:var(--text-primary);margin-bottom:6px;}
.crm-dash-financial .crm-dash-note {font-size:11.5px;line-height:1.6;color:var(--text-secondary);margin:14px 0 0;}
.crm-dash-financial .crm-dash-bars {display:flex;flex-direction:column;gap:24px;padding:8px 0 4px;}
.crm-dash-financial .crm-dash-bar-heading {display:flex;justify-content:space-between;flex-wrap:wrap;gap:5px 12px;font-size:13px;line-height:1.5;}
.crm-dash-financial .crm-dash-bar-heading strong {font-size:14px;font-weight:600;font-variant-numeric:tabular-nums;}
.crm-dash-financial .crm-dash-bar-track {height:12px;border-radius:6px;background:var(--surface-sunken);overflow:hidden;margin:9px 0;}
.crm-dash-financial .crm-dash-bar-track>div {height:100%;border-radius:6px;}
.crm-dash-financial .crm-dash-bar-caption {font-size:11.5px;line-height:1.6;color:var(--text-secondary);}
.crm-dash-financial .crm-dash-operations {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;width:100%;}
.crm-dash-financial .crm-dash-section-heading {grid-column:1/-1;display:flex;align-items:baseline;gap:6px 14px;flex-wrap:wrap;}
.crm-dash-financial h2 {font-size:16px;line-height:1.4;letter-spacing:-.01em;font-weight:600;margin:0;}
.crm-dash-financial .crm-dash-section-heading p {font-size:12px;line-height:1.5;color:var(--text-secondary);margin:0;}
.crm-dash-financial .crm-dash-operation>section {height:100%;}
.crm-dash-financial .crm-dash-operation>section>header {flex-wrap:wrap;}
.crm-dash-financial .crm-dash-empty {font-size:13px;line-height:1.6;color:var(--text-secondary);margin:8px 0;}
.crm-dash-financial .crm-dash-task-row {display:flex;flex-direction:column;align-items:flex-start;gap:4px;padding:11px 0;border-bottom:1px solid var(--border-subtle);}
.crm-dash-financial .crm-dash-task-row label {max-width:100%;justify-content:flex-start!important;text-align:left;}
.crm-dash-financial .crm-dash-task-when {font-size:11.5px;line-height:1.5;padding-left:28px;}
.crm-dash-financial .crm-dash-action-row {display:flex;align-items:center;gap:10px;width:100%;background:transparent;border:0;border-bottom:1px solid var(--border-subtle);text-align:left;color:inherit;font-family:inherit;cursor:pointer;padding:11px 0;}
.crm-dash-financial .crm-dash-action-row:hover {background:var(--surface-hover);}
.crm-dash-financial .crm-dash-action-copy {display:flex;flex-direction:column;gap:4px;flex:1;min-width:0;overflow-wrap:anywhere;}
.crm-dash-financial .crm-dash-action-copy strong {font-size:12.5px;font-weight:600;line-height:1.4;}
.crm-dash-financial .crm-dash-action-copy>span {font-size:12px;line-height:1.5;color:var(--text-secondary);}
.crm-dash-financial .crm-dash-action-copy small {font-size:11px;line-height:1.5;color:var(--text-secondary);}
.crm-dash-financial .crm-dash-setup {width:100%;padding:18px;box-sizing:border-box;background:var(--surface-card);border:1px solid var(--border-default);border-radius:var(--radius-card);}
.crm-dash-financial .crm-dash-setup-steps {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,170px),1fr));gap:10px;margin-top:14px;}
.crm-dash-financial .crm-dash-setup-steps button {display:flex;align-items:center;gap:10px;border:1px solid var(--border-default);border-radius:10px;background:var(--surface-muted);color:var(--text-primary);padding:12px;font:500 12px var(--font-sans);text-align:left;cursor:pointer;}
.crm-dash-financial .crm-dash-setup-steps small {display:block;font-size:11px;color:var(--text-secondary);margin-top:4px;}
@media(max-width:1199px) {.crm-dash-financial .crm-dash-metrics {grid-template-columns:repeat(2,minmax(0,1fr));}.crm-dash-financial .crm-dash-operations {grid-template-columns:minmax(0,1fr);}}
@media(max-width:899px) {.crm-dash-financial .crm-dash-analysis {grid-template-columns:minmax(0,1fr);}.crm-dash-financial .crm-dash-chart-filter select {min-height:44px;}.crm-dash-financial .crm-dash-header {gap:12px;}.crm-dash-financial .crm-dash-metric>.sc-host-x>div>div:nth-child(2)>span:first-child {font-size:26px!important;}.crm-dash-financial .crm-dash-period {max-width:100%;box-sizing:border-box;}}
@media(max-width:479px) {.crm-dash-financial {gap:18px;}.crm-dash-financial h1 {font-size:23px;}.crm-dash-financial .crm-dash-metrics {grid-template-columns:minmax(0,1fr);gap:10px;}.crm-dash-financial .crm-dash-metric>.sc-host-x>div {min-height:138px;}.crm-dash-financial .crm-dash-history>section>header>div:last-child {width:100%;}.crm-dash-financial .crm-dash-chart-filter {width:100%;}.crm-dash-financial .crm-dash-chart-filter select {width:100%;}.crm-dash-financial :is(th,td) {font-size:11px;padding:8px 3px;}}

/* UI-02 / etapa 2: priority forms and CRM-only keyboard affordances. */
.crm-app .crm-form-error {font-size:13px;line-height:1.6;color:var(--red-600);background:var(--red-50);border:1px solid var(--red-100);border-radius:10px;padding:10px 12px;margin:0;overflow-wrap:anywhere;}
.crm-app .crm-task-add {flex-wrap:wrap;}
.crm-app .crm-task-form-error {flex-basis:100%;}
.crm-app .crm-form-fields input[aria-invalid="true"] {scroll-margin-block:90px;}
.crm-app .crm-form-fields input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]) {min-height:44px;box-sizing:border-box;}
.crm-app [role="dialog"] button {min-height:44px;}
.crm-app [role="dialog"] button:is([aria-label="Fechar"],[aria-label="Voltar"]) {min-width:44px!important;flex-shrink:0!important;}
.crm-app [data-crm-form="settings"] button[aria-label="Descartar"] {min-width:44px!important;min-height:44px!important;flex-shrink:0!important;}
.crm-app [data-crm-form="contact-import"] label:focus-within {outline:2px solid var(--border-focus);outline-offset:3px;}
.crm-app :is([role="tab"],[role="radio"],button[aria-haspopup="listbox"]):focus-visible {outline:2px solid var(--border-focus)!important;outline-offset:3px;}
.crm-app [data-crm-control-label="Tipo de contato"] {min-width:0;max-width:100%;}
@media(max-width:899px) {.crm-app .crm-task-add>button {margin-top:0!important;}.crm-app .crm-form-fields input {font-size:16px!important;}}

/* BE-02: authenticated boot and existing CRM action groups. */
.crm-remote-gate {box-sizing:border-box;width:min(100% - 32px,600px);margin:10vh auto;padding:28px;border:1px solid var(--border-default,#d6e1eb);border-radius:16px;background:var(--surface-card,#fff);color:var(--text-primary,#17212f);font-family:var(--font-sans,'Plus Jakarta Sans',system-ui);line-height:1.5;box-shadow:0 8px 32px #17212f08;}
.crm-remote-gate h1 {font-size:24px;line-height:1.3;font-weight:650;letter-spacing:-.6px;margin:0 0 12px;overflow-wrap:anywhere;}
.crm-remote-gate p {font-size:14px;color:var(--text-secondary,#536477);margin:0 0 22px;overflow-wrap:anywhere;}
.crm-remote-brand {display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-bottom:28px;font-size:18px;font-weight:700;letter-spacing:-.4px;}
.crm-remote-brand img {flex-shrink:0;}
.crm-remote-brand .crm-remote-badge {font-size:11px;letter-spacing:0;font-weight:500;border:1px solid var(--border-default,#d6e1eb);border-radius:999px;padding:4px 9px;margin-left:auto;color:var(--text-secondary,#536477);}
.crm-remote-gate-actions {display:flex;align-items:center;flex-wrap:wrap;gap:10px;}
.crm-remote-gate button {box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;min-height:44px;margin:6px 8px 0 0;padding:10px 18px;border:1px solid var(--border-default,#d6e1eb);border-radius:var(--radius-button,999px);font:600 13px var(--font-sans,'Plus Jakarta Sans',system-ui);line-height:1.4;color:var(--text-primary,#17212f);background:var(--surface-card,#fff);cursor:pointer;}
.crm-remote-gate button.primary {background:var(--action-primary,#087f91);border-color:var(--action-primary,#087f91);color:var(--action-on-primary,#fff);}
.crm-remote-gate button.primary:hover:not(:disabled) {background:var(--action-primary-hover,#086578);border-color:var(--action-primary-hover,#086578);}
.crm-remote-gate button.secondary:hover:not(:disabled) {background:var(--surface-muted,#edf7fa);}
.crm-remote-gate button:disabled {opacity:.55;cursor:wait;}
.crm-remote-gate-actions button {margin:0;}
.crm-remote-gate [hidden] {display:none!important;}
.crm-remote-gate a.crm-remote-link {display:flex;align-items:center;width:fit-content;min-height:44px;margin-top:12px;color:var(--text-link,#087f91);font-size:13px;font-weight:500;text-decoration:none;}
.crm-remote-gate a.crm-remote-link:hover {text-decoration:underline;}
.crm-remote-error-title {padding-left:44px;min-height:36px;background:url('/assets/brand/hackpay/symbol-light.svg') left center/32px 32px no-repeat;}
.crm-remote-gate :focus-visible,.crm-remote-actions :focus-visible {outline:2px solid var(--border-focus,#426b2c);outline-offset:3px;}
.crm-remote-actions {display:flex;flex-wrap:wrap;align-items:center;gap:8px;min-width:0;}
.crm-remote-actions button {min-height:44px;}
@media(max-width:899px) {.crm-remote-gate {margin:24px auto;padding:20px;}.crm-thread-actions .crm-remote-actions {flex-basis:100%;}.crm-thread-actions .crm-remote-actions>div {max-width:100%;}}

/* Real conversation controls share bounded columns; long member names truncate inside the trigger. */
.crm-inbox--remote .crm-thread-actions {display:grid!important;grid-template-columns:minmax(0,1fr) minmax(120px,0.75fr) auto auto;align-items:end;flex:1 1 100%;width:100%;}
.crm-inbox--remote .crm-thread-actions .crm-conversation-controls {display:contents;}
.crm-inbox--remote .crm-thread-assignee {margin-left:0;min-width:0;max-width:none!important;width:100%;}
.crm-inbox--remote .crm-thread-assignee>div,.crm-inbox--remote .crm-conversation-status,.crm-inbox--remote .crm-conversation-status>div {min-width:0;width:100%;}
.crm-inbox--remote .crm-thread-assignee div:has(>button[aria-haspopup="listbox"]) {display:flex!important;min-width:0;width:100%;}
.crm-inbox--remote .crm-thread-actions .crm-thread-assignee span:has(+button[aria-haspopup="listbox"]) {position:static;width:auto;height:auto;overflow:visible;clip-path:none;white-space:normal;}
.crm-inbox--remote .crm-thread-actions button[aria-haspopup="listbox"] {width:100%!important;min-width:0!important;max-width:100%;min-height:44px;}
.crm-inbox--remote .crm-thread-actions button[aria-haspopup="listbox"]>span {flex:1!important;min-width:0;}
@media(max-width:899px) {.crm-inbox--remote .crm-thread-actions {grid-template-columns:minmax(0,1fr) minmax(0,1fr);}.crm-inbox--remote .crm-thread-actions>button {justify-self:end;}}

/* Real task creation follows the filters and keeps title, deadline and action in DOM order. */
.crm-tasks--remote .crm-task-toolbar {flex-direction:column;align-items:stretch!important;gap:16px!important;}
.crm-tasks--remote .crm-task-filters {align-self:flex-start;min-width:0;max-width:100%;}
.crm-tasks--remote .crm-task-add-real {display:grid;grid-template-columns:minmax(0,1fr) 240px auto;gap:12px;align-items:start;width:100%;min-width:0;}
.crm-tasks--remote .crm-task-title-field {display:flex;flex-direction:column;gap:6px;min-width:0;}
.crm-tasks--remote .crm-task-add-real label {font-size:13px;font-weight:600;line-height:20px;}
.crm-tasks--remote .crm-task-due-field,.crm-tasks--remote .crm-task-due-field>div {min-width:0;}
.crm-tasks--remote .crm-task-add-real .vc-input-shell {min-height:44px!important;}
.crm-tasks--remote .crm-task-submit-field {padding-top:26px;min-width:0;}
.crm-tasks--remote .crm-task-submit-field button {min-height:44px;white-space:nowrap;}
.crm-tasks--remote .crm-task-add-real input {min-width:0;max-width:100%;}
.crm-tasks--remote .crm-task-add-real .crm-task-form-error {grid-column:1/-1;}
@media(max-width:899px) {.crm-tasks--remote .crm-task-add-real {grid-template-columns:minmax(0,1fr) auto;}.crm-tasks--remote .crm-task-title-field {grid-column:1/-1;}}
@media(max-width:479px) {.crm-tasks--remote .crm-task-add-real {grid-template-columns:minmax(0,1fr);}.crm-tasks--remote .crm-task-submit-field {padding-top:0;}}
/* Cabeçalho da conversa: nomes longos de responsável não passam por cima do botão Resolver. */
.crm-thread-assignee {max-width:170px;min-width:0;overflow:hidden;}
.crm-thread-assignee button[aria-haspopup="listbox"] {max-width:100%;min-width:0;}
.crm-thread-assignee button[aria-haspopup="listbox"]>span {min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
