:root{--bg:#07111f;--panel:#101b2e;--panel2:#14233c;--line:#22314c;--text:#f5f7fb;--muted:#8ea0bb;--green:#3ddc97;--blue:#5d8cff;--yellow:#f2b84b;--red:#ff667a;--surface-page:#080a0b;--surface-sidebar:#0b0d0f;--surface-card:#17191b;--surface-card-inner:#111315;--surface-input:#0b0d0f;--surface-hover:rgba(255,255,255,.04);--border-subtle:rgba(255,255,255,.08);--border-default:rgba(255,255,255,.10);--border-strong:rgba(255,255,255,.14)}
*{box-sizing:border-box}body{margin:0;font-family:Inter,Segoe UI,Arial,sans-serif;background:#080a0b;color:var(--text)}
/* FASE VISUAL 1A (correção): proteção global — nenhuma regra de display de
   componente (ex.: .nav{display:flex}) pode sobrescrever o atributo [hidden].
   Sem isso, elementos com display:flex/grid explícito ficavam visíveis mesmo
   marcados hidden pela lógica de papel em syncRoleBasedNavigation(). */
[hidden]{display:none !important}
/* FASE 2D.8E.5C: Ocultar app durante bootstrap incompleto */
body.sgp-booting .app {
  visibility: hidden;
}

button,input,textarea,select{font:inherit}
/* FASE VISUAL 1A (correção): shell autenticado com viewport fixo — somente
   main rola verticalmente. body só perde overflow fora da rota pública
   (sgp-public-route), preservando integralmente login/cadastro/convite/seletor. */
html,body{height:100%}
body:not(.sgp-public-route){overflow:hidden}
/* FASE VISUAL 1A: shell autenticado — sidebar 280px, sem overflow horizontal.
   Breakpoints de recolhimento (icon-only) já existentes em <=1050px/<=700px
   foram preservados e apenas atualizados para as novas classes .brand-text. */
.app{display:grid;grid-template-columns:280px 1fr;height:100vh;min-height:0;overflow:hidden}
aside{background:var(--surface-sidebar);border:0;border-right:1px solid var(--border-subtle);padding:24px 20px;position:relative;top:auto;left:auto;height:100vh;min-height:0;display:flex;flex-direction:column;overflow-y:auto;overflow-x:hidden}
.brand{display:flex;align-items:center;gap:12px;margin-bottom:30px}
.brand-symbol{width:34px;height:34px;min-width:34px;display:flex;align-items:center;justify-content:center}
.brand-symbol svg{width:100%;height:100%}
.brand-text{display:flex;flex-direction:column;line-height:1.15;min-width:0}
.brand-text h1{font-size:20px;margin:0;font-weight:700;font-family:"Manrope","Inter",Arial,sans-serif;color:var(--text);letter-spacing:-0.01em}
.brand-text small{color:var(--muted);font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
nav{display:grid;gap:4px}
/* FASE 2D.8E.13 / FASE VISUAL 1A: Bloco de filtros refinado e compacto */
.sidebar-footer{padding-top:16px;margin-top:12px;border-top:1px solid var(--border-subtle);display:grid;gap:14px}
.sidebar-footer>div{display:grid;gap:6px}
.sidebar-footer label{display:block;color:var(--muted);font-size:10px;font-weight:700;letter-spacing:.07em;margin:0;text-transform:uppercase}
.sidebar-footer select{width:100%;min-height:38px;padding:8px 10px;border-radius:8px;border:1px solid var(--border-default);background:var(--surface-input);color:var(--text);font-size:13px}
.sidebar-footer select:focus{outline:none;border-color:var(--green);box-shadow:0 0 0 3px rgba(61,220,151,.15)}
.sidebar-summary{padding:12px 14px;border:1px solid var(--border-subtle);border-radius:10px;background:rgba(255,255,255,.02);display:grid;gap:4px;min-width:0}
.sidebar-summary small{display:block;color:var(--muted);font-size:10px;line-height:1.2;letter-spacing:.06em;text-transform:uppercase;font-weight:700}
.sidebar-summary strong{display:block;font-size:13px;line-height:1.3;color:var(--text);font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sidebar-user-profile{margin-top:auto;padding-top:16px;border-top:1px solid var(--border-subtle);position:relative}
.profile-button{width:100%;display:flex;align-items:center;gap:12px;padding:10px;border:1px solid transparent;border-radius:12px;background:rgba(255,255,255,.02);color:inherit;cursor:pointer;transition:.2s ease;text-align:left;position:relative}
.profile-button:hover{background:var(--surface-hover);border-color:var(--border-subtle)}
.profile-toggle-icon{position:absolute;right:10px;color:var(--muted);font-size:14px;opacity:.7;transition:.2s}
.profile-button:hover .profile-toggle-icon{opacity:1}
.profile-avatar{width:38px;height:38px;min-width:38px;border-radius:50%;background:linear-gradient(135deg,var(--green),#27b777);display:flex;align-items:center;justify-content:center;color:#062018;font-weight:800;font-size:14px}
.profile-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.profile-name{display:block;font-size:13px;font-weight:600;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.profile-company{display:block;font-size:11px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* FASE 2D.8E.11: Destaque de gestores por cargo (cores semânticas) */
/* FASE VISUAL 1A: menu expandido com menos divisores/contornos pesados */
.profile-menu{position:absolute;bottom:calc(100% + 8px);left:0;right:0;background:#111512 !important;border:1px solid var(--border-subtle) !important;border-radius:12px;padding:14px;box-shadow:0 16px 40px rgba(0,0,0,.5);z-index:100}
.menu-content{display:grid;gap:2px}
.menu-item{padding:6px 0;border-bottom:0;color:#ffffff}
.menu-item small{display:block;color:#8b96a8;font-size:10px;letter-spacing:.05em;text-transform:uppercase;margin-bottom:2px}
.menu-item strong{display:block;font-size:12px;color:#ffffff;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}
.menu-item-role{margin-bottom:8px;padding-bottom:10px;border-bottom:1px solid var(--border-subtle)}
.menu-action-btn{width:100%;padding:9px 10px;border:1px solid transparent;background:rgba(255,255,255,.03);color:#ffffff;border-radius:8px;cursor:pointer;font-size:12px;font-weight:600;transition:.2s;margin-top:6px;text-align:left}
.menu-action-btn:hover{background:rgba(255,255,255,.07);border-color:var(--border-subtle)}
.menu-item-role strong{font-weight:600}
.menu-logout{width:100%;padding:8px 10px;border:1px solid rgba(255,102,122,.2);background:rgba(255,102,122,.08);color:var(--red);border-radius:6px;cursor:pointer;font-size:12px;font-weight:600;transition:.2s;margin-top:8px}
.menu-logout:hover{background:rgba(255,102,122,.15);border-color:rgba(255,102,122,.4)}
.filter-note{margin:0 0 16px;color:var(--muted);font-size:14px}
.portfolio-context-name{font-weight:700;color:inherit}
.dashboard-period-row,.reference-period-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:14px}
.dashboard-period-label,.reference-period-label{font-size:12px;color:var(--muted);text-transform:uppercase;letter-spacing:.08em;font-weight:700}
.dashboard-period-badge,.reference-period-badge{display:inline-flex;align-items:center;padding:8px 12px;border-radius:999px;background:linear-gradient(180deg,#292d30,#1d2023);border:1px solid #44494e;color:#fff;font-size:14px;box-shadow:inset 0 1px 0 rgba(255,255,255,.06),0 8px 18px rgba(0,0,0,.18)}
.dashboard-scope-note{margin-top:10px;margin-bottom:0}

/* FASE VISUAL 1A: navegação com ícones consistentes (SVG currentColor) e item ativo discreto */
.nav{border:0;border-left:2px solid transparent;background:transparent;color:#9aa7bd;padding:11px 12px;border-radius:8px;text-align:left;cursor:pointer;display:flex;align-items:center;gap:12px;font-size:14px;white-space:nowrap}
.nav-icon{width:18px;height:18px;min-width:18px;color:currentColor}
.nav span{overflow:hidden;text-overflow:ellipsis}
.nav:hover{background:var(--surface-hover);color:#d7dfec}
.nav:focus-visible{outline:2px solid var(--green);outline-offset:-2px}
.nav.active{background:rgba(61,220,151,.08);color:var(--text);border-left-color:var(--green)}
.nav.active .nav-icon{color:var(--green)}
main{padding:32px 36px 48px;height:100vh;min-width:0;min-height:0;overflow-y:auto;overflow-x:hidden}.top{display:flex;justify-content:space-between;gap:16px;align-items:center;margin-bottom:22px}.top h2{font-size:30px;margin:0 0 6px}.top p{margin:0;color:var(--muted)}
.btn{border:1px solid var(--border-default);background:var(--panel);color:var(--text);padding:10px 13px;border-radius:10px;cursor:pointer}.btn.primary{border:0;background:linear-gradient(135deg,var(--green),#25b774);color:#06150f;font-weight:800}.btn.danger{border-color:rgba(255,102,122,.35);background:rgba(255,102,122,.1);color:var(--red)}
.btn.disabled,.btn:disabled{opacity:.42;cursor:not-allowed;filter:saturate(.55)}
.grid{display:grid;gap:16px}.kpis{grid-template-columns:repeat(5,1fr)}.card{background:linear-gradient(180deg,#17191b 0%,#131517 100%);border:1px solid var(--border-default);border-radius:16px}.kpi{padding:18px}.kpi small{color:var(--muted)}.kpi strong{display:block;font-size:25px;margin:8px 0}.up{font-size:12px;color:var(--green)}

/* FASE VISUAL 1B.1: cabeçalho e cards superiores do Dashboard — seletores
   escopados a #dashboard para não afetar Cliente/Faturamento, que reusam as
   mesmas classes .top/.card.kpi/.up/.reference-period-*. Nenhum ID, classe
   compartilhada de outras telas ou lógica de cálculo foi alterada. */
#dashboard .dashboard-top{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;flex-wrap:wrap;margin-bottom:20px}
#dashboard .dashboard-heading{display:flex;flex-direction:column;gap:6px;min-width:0}
#dashboard .dashboard-heading h2{margin:0;font-size:26px;line-height:1.3;font-weight:700}
#dashboard .dashboard-heading .dashboard-scope-note{margin:0;font-size:14px;color:var(--muted)}
#dashboard .dashboard-period-row{margin-top:2px;flex-direction:column;align-items:flex-end;gap:4px}
#dashboard .dashboard-period-label{font-size:10px}
#dashboard .dashboard-period-badge{padding:7px 14px;font-size:13px;font-weight:600;background:rgba(255,255,255,.03);border:1px solid var(--border-subtle);box-shadow:none}
@media(max-width:900px){
  #dashboard .dashboard-top{flex-direction:column;align-items:flex-start}
  #dashboard .dashboard-period-row{align-items:flex-start}
}

#dashboard .kpis{grid-template-columns:repeat(5,minmax(0,1fr));gap:14px;margin-bottom:22px}
#dashboard .kpis .kpi{padding:16px;min-height:100px;display:flex;flex-direction:column;justify-content:space-between;border-radius:14px}
#dashboard .kpis .kpi small{font-size:12px;line-height:1.35;font-weight:600}
#dashboard .kpis .kpi strong{font-size:22px;line-height:1.15;margin:8px 0 0;font-weight:800;white-space:nowrap}
#dashboard .kpis .kpi>span{margin-top:6px;display:block}
@media(max-width:1366px){#dashboard .kpis{grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}#dashboard .kpis .kpi{padding:14px}#dashboard .kpis .kpi strong{font-size:20px}}
@media(max-width:1100px){#dashboard .kpis{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:700px){#dashboard .kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:460px){#dashboard .kpis{grid-template-columns:1fr}}
.rule-kpi{transition:border-color .18s ease,box-shadow .18s ease}
.rule-kpi strong,.rule-kpi .metric-rule-status{transition:color .18s ease}
.rule-kpi.metric-healthy{border-color:rgba(143,207,169,.46);box-shadow:inset 0 1px 0 rgba(255,255,255,.035),0 18px 50px rgba(0,0,0,.24),0 0 0 1px rgba(143,207,169,.055)}
.rule-kpi.metric-healthy strong,.rule-kpi.metric-healthy .metric-rule-status{color:#93d3ad}
.rule-kpi.metric-attention{border-color:rgba(223,189,120,.5);box-shadow:inset 0 1px 0 rgba(255,255,255,.035),0 18px 50px rgba(0,0,0,.24),0 0 0 1px rgba(223,189,120,.06)}
.rule-kpi.metric-attention strong,.rule-kpi.metric-attention .metric-rule-status{color:#e3be72}
.rule-kpi.metric-critical{border-color:rgba(237,139,152,.46);box-shadow:inset 0 1px 0 rgba(255,255,255,.035),0 18px 50px rgba(0,0,0,.24),0 0 0 1px rgba(237,139,152,.055)}
.rule-kpi.metric-critical strong,.rule-kpi.metric-critical .metric-rule-status{color:#f08b98}
.rule-kpi.metric-disabled .metric-rule-status,.rule-kpi.metric-no-data .metric-rule-status{color:var(--muted)}
.threshold-rules-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.threshold-rule-card{padding:16px;border:1px solid var(--border-default);border-radius:14px;background:var(--surface-card-inner)}
.threshold-rule-card h4{margin:0 0 5px}.threshold-rule-card>p{margin:0 0 14px;color:var(--muted);font-size:12px;line-height:1.45}
.threshold-rule-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.threshold-preview{margin-top:12px;padding:10px 11px;border:1px dashed #383c40;border-radius:10px;color:#b9bbbe;font-size:12px;line-height:1.5}
.threshold-preview .healthy{color:#93d3ad}.threshold-preview .attention{color:#e3be72}.threshold-preview .critical{color:#f08b98}
@media(max-width:850px){.threshold-rules-grid,.threshold-rule-fields{grid-template-columns:1fr}}
.section{padding:18px}.section-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}.section-head h3{margin:0}
/* FASE VISUAL 1B.2: proporção ajustada para o card de resumo ter largura
   suficiente para as duas seções (performance + atualização diária). */
.main-grid{grid-template-columns:minmax(0,2fr) minmax(320px,.9fr);margin-top:16px;align-items:start}.chart{height:260px;border-top:1px solid var(--line);padding-top:14px}svg{width:100%;height:100%}.chart-label{fill:var(--muted);font-size:12px;letter-spacing:0}.chart-grid{stroke:#22314c;stroke-width:1}.chart-line{fill:none;stroke:var(--green);stroke-width:4;stroke-linecap:round;stroke-linejoin:round}.chart-area{fill:rgba(61,220,151,.08)}.chart-point{fill:var(--green);stroke:#07111f;stroke-width:2}
.alert{display:grid;grid-template-columns:38px 1fr auto;gap:10px;align-items:center;padding:12px 0;border-bottom:1px solid var(--line)}
/* FASE VISUAL 1B.2C: Clientes em atenção — lista sempre compacta, uma linha
   por cliente; a expansão inline foi removida em favor do modal único
   #attentionAnalysisModal. Altura alvo: ~58-72px por item. */
.attention-card{border:1px solid var(--border-default);border-radius:12px;background:var(--surface-card-inner);margin-bottom:12px;overflow:hidden;transition:box-shadow .2s ease}
.attention-card:hover{box-shadow:0 4px 12px rgba(0,0,0,.15)}
.attention-main{display:grid;grid-template-columns:36px 1fr auto;gap:12px;align-items:center;padding:13px 15px;min-height:56px}
.attention-main .icon{width:36px;height:36px;font-size:16px;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.attention-main strong{font-size:14px;line-height:1.3;color:var(--text)}
.attention-reason{display:block;color:var(--muted);margin-top:3px;font-size:13px;line-height:1.4;max-width:48ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:break-word}
/* FASE VISUAL 1B.2C: refinamento leve — menos espaço vertical entre
   categorias do card "Resumo de performance" (sem alterar cálculos). */
.status-summary-item{margin-bottom:14px}.status-summary-item-label{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px;font-size:13px;font-weight:600;color:var(--text)}.status-summary-item-label strong{font-weight:700;color:var(--text)}.status-summary-bar{background:var(--surface-inner);height:6px;border-radius:3px;overflow:hidden}.status-summary-bar-fill{height:100%;border-radius:3px}.status-summary-healthy{background:#5dd9a8}.status-summary-attention{background:#f0c855}.status-summary-critical{background:#f57b87}.status-summary-noupdate{background:#7b8b9b}.status-priority{margin-top:16px;padding-top:16px;border-top:1px solid var(--border-subtle);font-size:12px;color:var(--muted);line-height:1.6}
/* FASE VISUAL 1B.2: seção "Atualização diária" — dimensão separada da
   performance, dentro do mesmo card de resumo. */
.status-update-section{margin-top:16px;padding-top:16px;border-top:1px solid var(--line)}
#openRules{font-size:12px;padding:6px 10px;color:var(--muted);background:transparent;border:1px solid var(--border-subtle);border-radius:6px;transition:all .2s ease}
#openRules:hover{color:var(--text);border-color:var(--border-default)}
.status-update-title{display:block;font-size:13px;font-weight:700;margin-bottom:12px;color:var(--text)}
/* FASE VISUAL 1B.2: badge de atualização na tabela — nunca vermelho (evita
   competir visualmente com o badge "Crítico" de performance). */
.update-badge{display:inline-flex;align-items:center;padding:5px 10px;border-radius:999px;font-size:11px;font-weight:700;white-space:nowrap}
.update-badge-today{background:rgba(61,220,151,.12);color:var(--green)}
.update-badge-pending{background:rgba(242,184,75,.12);color:var(--yellow)}
/* FASE VISUAL 1B.2C: modal único "Análise do cliente" — reaproveita
   .modal/.modal-box já existentes no projeto; classes abaixo são exclusivas
   do conteúdo interno deste modal. */
/* FASE VISUAL 1B.2D: modal reduzido e simplificado — três zonas visuais
   (cabeçalho / "O que está acontecendo" / "O que fazer agora"), status
   exibido uma única vez, sem faixas coloridas grandes. */
.attn-modal-box{width:min(620px,calc(100vw - 40px));max-height:min(720px,calc(100vh - 32px));display:flex;flex-direction:column;overflow:hidden;padding:24px}
.attn-modal-header-top{display:flex;align-items:center;justify-content:space-between;gap:12px}
.attn-modal-header-top h3{margin:0;font-size:12px;color:var(--muted);font-weight:600;text-transform:uppercase;letter-spacing:.04em}
.attn-modal-client{margin-top:10px;display:flex;flex-direction:column;gap:4px}
.attn-modal-client-row{display:flex;align-items:center;justify-content:space-between;gap:10px}
.attn-modal-client strong{font-size:19px;line-height:1.3}
.attn-modal-origin{font-size:12px;color:var(--muted)}
.attn-modal-body{overflow:auto;padding-right:2px;flex:1;margin-top:22px}
.attn-modal-section+.attn-modal-section{margin-top:24px}
.attn-modal-section h4{margin:0 0 6px;font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);font-weight:700}
/* Marcador lateral discreto único (sem badge repetido por linha). */
.attn-issue-row{display:flex;flex-direction:column;gap:2px;padding:12px 0 12px 10px;border-left:2px solid var(--border-default);border-bottom:1px solid var(--line);font-size:13px;margin-bottom:2px}
.attn-issue-row:last-of-type{border-bottom:none}
.attn-issue-row.attn-issue-red{border-left-color:var(--red)}
.attn-issue-row.attn-issue-yellow{border-left-color:var(--yellow)}
.attn-issue-row small{color:var(--muted);font-size:11px}
.attn-issue-more{margin-top:6px;background:none;border:none;padding:0;color:var(--muted);font-size:12px;text-decoration:underline;cursor:pointer}
.attn-suggestion-row{display:flex;align-items:baseline;gap:10px;padding:10px 0;border-bottom:1px solid var(--line);font-size:13px}
.attn-suggestion-row:last-child{border-bottom:none}
.attn-suggestion-index{color:var(--muted);font-weight:700;min-width:14px}
.attn-suggestion-text{display:flex;flex-direction:column;gap:2px}
.attn-suggestion-priority{color:var(--muted);font-size:11px}
/* FASE MOBILE 1A: wrapper utilitário para tabelas com muitas colunas —
   disponível para uso futuro; os wrappers já existentes (Carteira de
   clientes, Clientes, Faturamento, Histórico, Unidades, Convites) já usam
   overflow:auto/overflow-x:auto inline e não escondem colunas, então não
   precisaram ser reescritos nesta fase. */
.table-scroll{width:100%;overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
.table-scroll table{min-width:760px}
.rules-grid{display:grid;gap:14px}
.rule-card{padding:14px;border:1px solid var(--border-default);border-radius:12px;background:var(--surface-card-inner)}
.rule-card h4{margin:0 0 8px}
.rule-card ul{margin:0;padding-left:18px;color:#cbd6e6}
.rule-card li{margin:6px 0}
.icon{width:36px;height:36px;border-radius:11px;display:grid;place-items:center;font-weight:900}
.red{background:rgba(255,102,122,.14);color:var(--red)}.yellow{background:rgba(242,184,75,.14);color:var(--yellow)}.green{background:rgba(61,220,151,.14);color:var(--green)}.status{font-size:12px;padding:6px 8px;border-radius:8px}
table{width:100%;border-collapse:collapse;font-size:14px}th,td{padding:11px 12px;text-align:left;border-bottom:1px solid var(--border-subtle)}th{color:var(--muted);font-weight:600;font-size:12px;text-transform:uppercase;letter-spacing:.02em;background:rgba(0,0,0,.02)}td{color:var(--text)}tbody tr:hover{background:rgba(255,255,255,.02)}td:nth-child(3),td:nth-child(4){text-align:right;font-family:monospace;font-size:13px}td:nth-child(5){text-align:center}th:nth-child(3),th:nth-child(4){text-align:right}th:nth-child(5){text-align:center}
.progress{height:8px;background:#26344e;border-radius:99px;overflow:hidden}.progress span{display:block;height:100%;background:linear-gradient(90deg,var(--yellow),var(--green))}
.view{display:none}.view.active{display:block}.chips{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}.chip{padding:7px 10px;border-radius:999px;border:1px solid var(--border-default);background:var(--surface-card-inner);color:#aebbd0;cursor:pointer;transition:.2s}.chip:hover{border-color:#355078;color:#dce6f5}.chip.active{background:rgba(61,220,151,.12);border-color:var(--green);color:var(--green)}
.client-kpis{grid-template-columns:repeat(5,1fr)}.two{grid-template-columns:1.3fr .7fr;margin-top:16px}.action{display:flex;gap:10px;padding:12px;border:1px solid var(--border-default);border-radius:11px;margin-bottom:10px}.timeline{display:grid;gap:10px}
.history-card{background:var(--surface-card-inner);border-left:3px solid var(--blue);border-radius:0 11px 11px 0;overflow:hidden}
.history-summary{width:100%;border:0;background:transparent;color:var(--text);padding:14px;text-align:left;cursor:pointer;display:flex;justify-content:space-between;gap:12px;align-items:center}
.history-summary:hover{background:rgba(93,140,255,.07)}
.history-summary small{display:block;color:var(--muted);margin-top:4px}
.history-date{font-size:17px;line-height:1;font-weight:800;color:var(--text)}
.history-time{font-size:12px;color:var(--muted);line-height:1.2}
.history-guest{font-size:14px;color:#c8d2e2;line-height:1.2}

.history-details{display:none;padding:0 14px 14px}
.history-card.open .history-details{display:block}

.event-badge{display:inline-flex;align-items:center;gap:6px;padding:5px 8px;border-radius:999px;font-size:11px;font-weight:800}
.event-traffic{background:rgba(93,140,255,.14);color:#8eb0ff}
.event-sale-created{background:rgba(61,220,151,.14);color:var(--green)}
.event-sale-deleted{background:rgba(255,102,122,.14);color:var(--red)}
.event-goal{background:rgba(168,116,255,.15);color:#bd9aff}
.event-guest{background:rgba(242,184,75,.14);color:var(--yellow)}
.event-manager{background:rgba(52,199,190,.14);color:#65d8d1}
.event-detail-grid{display:grid;grid-template-columns:180px 1fr;gap:9px 14px;padding-top:12px;border-top:1px solid var(--line)}
.event-detail-grid span:nth-child(odd){color:var(--muted)}

.history-card.open .history-arrow{transform:rotate(180deg)}
.history-arrow{transition:.2s}
.change-grid{display:grid;grid-template-columns:1fr auto auto;gap:8px 14px;padding:12px 0;border-top:1px solid var(--line);font-size:13px}
.change-grid strong{font-size:12px;color:var(--muted)}
.change-grid .before{color:var(--muted)}
.change-grid .after{color:var(--green);font-weight:700}
.history-note{margin-top:12px;padding:12px;border-radius:10px;background:var(--surface-card-inner);color:#c8d2e2}
.history-filters{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px}

.history-toolbar{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:14px}
.history-toolbar .field{margin:0}
.timeline-day{margin-bottom:18px}
.timeline-day-header{display:flex;align-items:center;gap:12px;margin:4px 0 10px}
.timeline-day-header strong{font-size:16px}
.timeline-day-header::after{content:"";height:1px;background:var(--line);flex:1}
.timeline-day-summary{font-size:12px;color:var(--muted)}
.timeline-stack{display:grid;gap:10px}
.timeline-event{position:relative;padding-left:18px}
.timeline-event::before{content:"";position:absolute;left:0;top:18px;width:9px;height:9px;border-radius:50%;background:var(--blue);box-shadow:0 0 0 4px rgba(93,140,255,.12)}
.timeline-event::after{content:"";position:absolute;left:4px;top:28px;bottom:-14px;width:1px;background:var(--line)}
.timeline-event:last-child::after{display:none}
.history-empty{padding:22px;text-align:center;border:1px dashed var(--line);border-radius:12px;color:var(--muted)}
.history-more-wrap{display:flex;justify-content:center;padding-top:14px;margin-top:4px;border-top:1px solid var(--line)}
.history-more-button{min-width:140px}

.daily-summary-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.daily-summary-card{padding:14px;border:1px solid var(--border-default);border-radius:12px;background:var(--surface-card-inner)}
.daily-summary-card small{display:block;color:var(--muted);margin-bottom:6px}
.daily-summary-card strong{font-size:19px}
.chart-event-marker{font-size:15px;cursor:pointer}
.chart-event-line{stroke:#52627d;stroke-width:1;stroke-dasharray:4 4}

.global-billing-summary{grid-template-columns:repeat(4,1fr);margin-top:8px}
.global-kpi-card{padding:18px;display:grid;grid-template-columns:58px 1fr;gap:14px;align-items:center}
.global-kpi-icon{width:58px;height:58px;border-radius:18px;display:grid;place-items:center;font-size:28px;font-weight:900}
.global-kpi-icon.green{background:rgba(61,220,151,.14);color:var(--green)}
.global-kpi-icon.blue{background:rgba(93,140,255,.16);color:#8eb0ff}
.global-kpi-icon.purple{background:rgba(168,116,255,.16);color:#cba9ff}
.global-kpi-icon.gold{background:rgba(242,184,75,.16);color:var(--yellow)}
.global-kpi-card small{display:block;color:var(--muted);margin-bottom:6px}
.global-kpi-card strong{display:block;font-size:20px;margin-bottom:6px}
.global-kpi-delta{font-size:13px;font-weight:700}
.global-kpi-delta.positive{color:var(--green)}
.global-kpi-delta.negative{color:var(--red)}
.global-kpi-delta.neutral{color:var(--muted)}
.global-billing-main{display:grid;grid-template-columns:1.2fr 1fr;gap:16px;margin-top:16px}
.global-billing-bottom{display:grid;grid-template-columns:2fr 1fr;gap:16px;margin-top:16px}
.global-billing-bottom>.card{min-width:0;overflow:hidden}
.global-billing-bottom>.card:nth-child(3){grid-column:1/-1}
.section-subhead{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:14px}
.section-subhead h3{margin:0}
.forecast-chart-wrap{height:290px;display:grid;grid-template-columns:62px 1fr;gap:12px}
.forecast-axis{display:grid;grid-template-rows:repeat(6,1fr);align-items:space-between;color:var(--muted);font-size:12px;padding:10px 0 34px}
.forecast-axis span{align-self:end}
.forecast-bars{display:grid;grid-template-columns:repeat(3,minmax(82px,1fr));gap:18px;align-items:stretch;border-left:1px solid var(--line);border-bottom:1px solid var(--line);padding:10px 8px 34px 18px;position:relative;overflow-x:auto;overflow-y:hidden}
.forecast-bars::before,.forecast-bars::after{content:"";position:absolute;left:0;right:0;border-top:1px solid rgba(34,49,76,.7)}
.forecast-bars::before{top:33%}
.forecast-bars::after{top:66%}
.forecast-bar-item{display:flex;flex-direction:column;gap:10px;height:100%;min-width:82px}
.forecast-bar-value{font-size:13px;font-weight:700;text-align:center;color:#dfe7f5}
.forecast-bar-column{flex:1;min-height:180px;display:flex;align-items:flex-end;justify-content:center}
.forecast-bar-fill{width:54px;max-width:100%;border-radius:14px 14px 0 0;background:linear-gradient(180deg,#4f84ff,#2d5bd0);box-shadow:0 18px 32px rgba(61,102,210,.2);min-height:0;transition:height .2s ease}
.forecast-bar-label{text-align:center;color:#d0d8e7;font-size:13px}
.manager-distribution-list{display:grid;gap:26px;margin-top:10px}
.manager-distribution-row{display:grid;grid-template-columns:auto 1fr auto;gap:16px;align-items:center}
.manager-distribution-row strong{font-size:17px}
.manager-distribution-bar{height:12px;background:#132238;border-radius:999px;overflow:hidden;border:1px solid rgba(93,140,255,.18)}
.manager-distribution-bar span{display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,#4f84ff,#5d8cff)}
.manager-distribution-value{text-align:right}
.manager-distribution-value strong{display:block;font-size:18px}
.manager-distribution-value small{display:block;color:var(--muted);margin-top:4px}
.currency-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
.currency-card{padding:14px;border:1px solid var(--border-default);border-radius:14px;background:var(--surface-card-inner)}
.currency-head{display:flex;align-items:center;gap:10px;margin-bottom:10px}
.currency-pill{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;font-weight:800}
.currency-pill.green{background:rgba(61,220,151,.14);color:var(--green)}
.currency-pill.blue{background:rgba(93,140,255,.16);color:#8eb0ff}
.currency-pill.cyan{background:rgba(52,199,190,.14);color:#65d8d1}
.currency-pill.purple{background:rgba(168,116,255,.16);color:#cba9ff}
.currency-card strong{display:block;font-size:18px;margin-bottom:4px}
.currency-card small{display:block;color:var(--muted)}
.billing-page-table{min-width:100%;width:100%}
.billing-page-table td,.billing-page-table th{font-size:13px;vertical-align:middle}
.billing-page-table th:nth-child(n+3){word-break:break-word;max-width:80px}
.global-footer-row{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:14px 18px;border-top:1px solid var(--line);margin:16px -18px -18px}
.global-footer-row small{color:var(--muted)}
.inline-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
@media(max-width:1440px){.global-billing-bottom{grid-template-columns:1.5fr 1fr}}
@media(max-width:1250px){.global-billing-summary{grid-template-columns:repeat(2,1fr)}.global-billing-main{grid-template-columns:1fr}.global-billing-bottom{grid-template-columns:1fr}}
@media(max-width:1024px){.metric-control-head .segmented-control{width:100%}}
@media(max-width:768px){.section-subhead{flex-direction:column;align-items:flex-start}.metric-control-head .segmented-control{width:100%;margin-top:8px}.segmented-control .segment{min-width:auto;padding:6px 8px;font-size:12px}}
@media(max-width:900px){.currency-grid{grid-template-columns:1fr}.forecast-chart-wrap{grid-template-columns:48px 1fr}.forecast-bars{gap:10px;padding-left:10px}.forecast-bar-fill{width:38px}}
@media(max-width:700px){.global-billing-summary{grid-template-columns:1fr}.manager-distribution-row{grid-template-columns:1fr;gap:8px}.global-footer-row{flex-direction:column;align-items:flex-start}}
@media(max-width:1100px){.daily-summary-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:600px){.daily-summary-grid{grid-template-columns:1fr}}

@media(max-width:700px){.history-toolbar{grid-template-columns:1fr}}

.modal{position:fixed;inset:0;background:rgba(0,0,0,.78);display:none;align-items:center;justify-content:center;padding:20px;z-index:20}.modal.open{display:flex}.modal-box{width:min(760px,100%);max-height:90vh;overflow:auto;background:linear-gradient(180deg,#262626 0%,#050505 100%);border:1px solid var(--border-default);border-radius:18px;padding:22px}
.form{display:grid;grid-template-columns:1fr 1fr;gap:14px}.field label{display:block;font-size:13px;color:var(--muted);margin-bottom:6px}.field input,.field textarea,.field select{width:100%;padding:12px;background:#07111f;border:1px solid var(--border-default);border-radius:10px;color:var(--text)}.actions{display:flex;justify-content:flex-end;gap:10px;margin-top:18px}
.name-link{cursor:pointer;color:var(--text)}.name-link:hover{color:var(--green)}
.guest-tag{display:inline-block;margin:2px 4px 2px 0;padding:5px 8px;border:1px solid var(--border-default);border-radius:999px;color:#c8d2e2}
.guest-manager-list{display:grid;gap:10px;margin-top:14px}
.guest-manager-row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:11px 12px;border:1px solid var(--border-default);border-radius:11px;background:var(--surface-card-inner)}

.comparison-table td,.comparison-table th{vertical-align:middle}
.delta{font-weight:800}
.delta.positive{color:var(--green)}
.delta.negative{color:var(--red)}
.delta.neutral{color:var(--muted)}
.guest-performance-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px}
.guest-performance-card{padding:16px;border:1px solid var(--border-default);border-radius:14px;background:var(--surface-card-inner)}
.guest-performance-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;margin-bottom:12px}
.guest-performance-metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.guest-performance-metrics small{display:block;color:var(--muted);margin-bottom:4px}
.guest-performance-metrics strong{font-size:15px}
.insights-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
.insight-card{display:flex;gap:12px;padding:14px;border:1px solid var(--border-default);border-radius:12px;background:var(--surface-card-inner)}
.insight-icon{width:38px;height:38px;border-radius:11px;display:grid;place-items:center;flex:0 0 auto;font-weight:900}
.insight-card strong{display:block;margin-bottom:4px}
.insight-card p{margin:0;color:var(--muted);line-height:1.45}
.auto-summary{margin-top:14px;padding:14px;border-radius:12px;border:1px solid var(--border-default);background:var(--surface-card-inner);color:#cbd6e6}

.sales-summary-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:16px}
.sales-summary-card{padding:14px;border:1px solid var(--border-default);border-radius:12px;background:var(--surface-card-inner)}
.sales-summary-card small{display:block;color:var(--muted);margin-bottom:6px}
.sales-summary-card strong{font-size:19px}
.billing-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}
.billing-card{padding:14px;border:1px solid var(--border-default);border-radius:12px;background:var(--surface-card-inner)}
.billing-card small{display:block;color:var(--muted);margin-bottom:6px}
.sale-actions{display:flex;gap:8px;justify-content:flex-end}
.empty-state{padding:26px;text-align:center;color:var(--muted);border:1px dashed var(--line);border-radius:12px}
@media(max-width:1000px){.sales-summary-grid,.billing-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:650px){.sales-summary-grid,.billing-grid{grid-template-columns:1fr}}

@media(max-width:900px){.guest-performance-grid,.insights-grid{grid-template-columns:1fr}.guest-performance-metrics{grid-template-columns:1fr 1fr}}


@media(max-width:1200px){.main-grid{grid-template-columns:minmax(0,1.45fr) minmax(280px,.75fr)}}
@media(max-width:1050px){.app{grid-template-columns:76px 1fr}.brand-text,.nav span{display:none}.brand{justify-content:center}.kpis,.client-kpis{grid-template-columns:repeat(2,1fr)}.main-grid,.two{grid-template-columns:1fr}}
/* FASE MOBILE 1A: shell mobile — cabeçalho fixo em cima, somente `main` rola.
   Causa do corte anterior: `.app{display:block}` fazia aside+main empilharem
   em fluxo normal, mas `main` mantinha `height:100vh` herdado do desktop
   (regra base em `main{...height:100vh...}`), somando à altura do aside e
   estourando a viewport sem o `body` rolar — o final da página ficava
   inacessível. Correção: grid de 2 linhas (`auto minmax(0,1fr)`) com `100dvh`,
   `main` sem altura fixa e única área com `overflow-y:auto`. */
@media(max-width:700px){
 .app{
  height:100vh;
  height:100dvh;
  min-height:0;
  display:grid;
  grid-template-columns:1fr;
  grid-template-rows:auto minmax(0,1fr);
  overflow:hidden;
 }
 aside{
  width:100%;
  height:auto;
  min-height:0;
  position:relative;
  inset:auto;
  overflow:visible;
  display:flex;
  flex-direction:column;
  gap:10px;
  padding:14px 16px;
 }
 .brand{margin:0}
 .brand-text{display:none}
 nav{display:flex;flex-wrap:wrap;gap:8px}
 .nav{white-space:nowrap}
 main{
  width:100%;
  height:auto;
  min-height:0;
  overflow-y:auto;
  overflow-x:hidden;
  padding:16px 16px calc(32px + env(safe-area-inset-bottom));
 }
 .top{align-items:flex-start;flex-direction:column}
 .kpis,.client-kpis,.form{grid-template-columns:1fr}
 /* FASE MOBILE 1A: menu do usuário abre para baixo no mobile (no desktop
    ele abre para cima, `bottom:calc(100% + 8px)`, o que no mobile ficava
    cortado pelo topo da tela por haver pouco espaço acima do botão). */
 .sidebar-user-profile{position:relative;overflow:visible}
 .profile-menu{
  top:calc(100% + 8px);
  bottom:auto;
  left:0;
  right:0;
  width:100%;
  max-height:calc(100dvh - 220px);
  overflow-y:auto;
  z-index:1200;
 }
 /* FASE MOBILE 1A: Usuários e Permissões — cada <tr> vira um card; os
    mesmos dados/atributos já gerados por renderUsuariosSuccess() (nenhuma
    consulta ou regra de permissão duplicada), apenas reorganizados
    visualmente via CSS com o rótulo vindo de data-label. */
 #usuariosTableContainer{overflow:visible}
 #usuariosTable{width:100%;min-width:0;font-size:13px}
 #usuariosTable thead{display:none}
 #usuariosTable,#usuariosTable tbody{display:block;width:100%}
 #usuariosTable tr{
  display:block;
  width:100%;
  border:1px solid var(--border-default);
  border-radius:12px;
  background:var(--surface-card-inner);
  padding:14px;
  margin-bottom:10px;
 }
 #usuariosTable td{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:8px 0;
  border-bottom:1px solid var(--line);
  text-align:right;
 }
 #usuariosTable td:last-child{border-bottom:none}
 #usuariosTable td::before{content:attr(data-label);color:var(--muted);font-size:12px;font-weight:600;text-align:left;white-space:nowrap}
 #usuariosTable td:first-child{justify-content:flex-start;padding-top:0}
 #usuariosTable td:first-child::before{content:none}
 #usuariosTable .usuarios-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px}
 /* FASE MOBILE 1A: reforço de rolagem por toque nos wrappers de tabela já
    existentes (Carteira de clientes, Clientes, Faturamento, Histórico,
    Unidades, Convites) — nenhum deles usa overflow-x:hidden, então nenhuma
    coluna já era escondida; isto só melhora o gesto de arrastar no mobile. */
 div[style*="overflow:auto"],div[style*="overflow-x:auto"],.table-scroll{
  -webkit-overflow-scrolling:touch;
  overscroll-behavior-x:contain;
 }
 /* FASE MOBILE 1A: modais cabendo na viewport — largura/altura calculadas
    a partir da viewport dinâmica; corpo interno de cada modal continua
    responsável pelo próprio scroll (`.attn-modal-body`, `.rules-grid` etc.). */
 .modal{padding:12px}
 .modal-box{width:100%;max-height:calc(100dvh - 24px)}
 /* FASE MOBILE 1B: tela Clientes — tabela vira cards, filtros compactos
    aparecem, contagem duplicada é ocultada (o texto único já é montado em
    JS a partir dos mesmos números). A exibição de .clients-mobile-list/
    .mobile-filters/.archived-mobile-list é feita em um bloco @media mais
    abaixo neste arquivo (depois das regras base display:none), para vencer
    a cascata corretamente — aqui só ficam as regras que não têm par "base"
    depois no arquivo. */
 #clientes .clients-table-wrap{display:none}
 #clientsFilterNote{display:none}
 /* Seção 6: encurtar somente o rótulo visível do botão "Clientes arquivados"
    no mobile — aria-label (definido em JS) preserva o texto completo para
    leitores de tela; o texto real fica com font-size:0 e um pseudo-elemento
    mostra "Arquivados". */
 #openArchivedClients{font-size:0}
 #openArchivedClients::after{content:"Arquivados";font-size:13px}
 /* Seção 7: modal "Clientes arquivados" — tabela vira cards; modal cabe na
    viewport com margem de 24px. */
 .archived-modal-card{width:calc(100vw - 24px);max-height:calc(100dvh - 24px)}
 .archived-desktop-table{display:none}
 /* Confirmação de exclusão definitiva — largura total com margem. */
 .permanently-delete-modal-card{width:calc(100vw - 24px)!important;max-width:calc(100vw - 24px)!important;padding:22px!important;max-height:calc(100dvh - 24px);overflow-y:auto}
}



/* =========================================================
   TELA CLIENTES — LAYOUT PREMIUM BLACK
   Escopo isolado para não alterar outras áreas do sistema.
   ========================================================= */
#clientes .clients-premium-top{margin-bottom:20px}
#clientes .clients-premium-top .top{margin-bottom:0}
#clientes .clients-premium-description{margin-top:6px;color:var(--muted);font-size:15px}
#clientes .clients-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin:18px 0}
#clientes .clients-summary-card{min-height:116px;padding:18px;border:1px solid #2f3337;border-radius:16px;background:linear-gradient(145deg,rgba(255,255,255,.028),transparent 48%),linear-gradient(180deg,#171a1d,#101315);box-shadow:inset 0 1px 0 rgba(255,255,255,.035),0 14px 34px rgba(0,0,0,.2);display:grid;grid-template-columns:48px 1fr;gap:14px;align-items:center}
#clientes .clients-summary-icon{width:48px;height:48px;border-radius:14px;display:grid;place-items:center;background:#22262a;border:1px solid #34393e;color:#e7e8e9;font-size:21px;font-weight:800}
#clientes .clients-summary-card small{display:block;color:#9a9ca0;margin-bottom:7px;font-size:13px}
#clientes .clients-summary-card strong{display:block;font-size:21px;line-height:1.15;color:#f7f7f8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#clientes .clients-summary-note{display:block;margin-top:7px;color:#a2a4a7;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#clientes .clients-summary-note.positive{color:#92d5aa}
#clientes .clients-summary-note.negative{color:#ef929d}
#clientes .clients-summary-note.neutral{color:#9b9da1}
#clientes .clients-table-card{padding:0;overflow:visible}
#clientes .clients-table-wrap{overflow:auto;border-radius:16px}
#clientes .clients-table{min-width:940px}@media(max-width:768px){#clientes .clients-table{min-width:auto;width:100%}#clientes .client-identity{min-width:auto}}
#clientes .clients-table th{padding:16px 14px;background:rgba(255,255,255,.012);font-size:12px;letter-spacing:.01em}
#clientes .clients-table td{padding:16px 14px;vertical-align:middle}
#clientes .clients-table tbody tr{transition:background .15s ease}
#clientes .clients-table tbody tr:hover{background:rgba(255,255,255,.022)}
#clientes .client-identity{display:flex;align-items:center;gap:12px;min-width:180px}
#clientes .client-avatar{width:40px;height:40px;border-radius:12px;display:grid;place-items:center;flex:0 0 auto;background:linear-gradient(145deg,#2b2f33,#171a1d);border:1px solid #3a3f44;color:#f5f5f6;font-size:16px;font-weight:800;box-shadow:inset 0 1px 0 rgba(255,255,255,.05)}
#clientes .client-identity-text strong{display:block;font-size:14px}
#clientes .client-identity-text small{display:flex;align-items:center;gap:6px;margin-top:5px;color:#8f9195}
#clientes .client-identity-text small::before{content:"";width:6px;height:6px;border-radius:50%;background:#8fcfa9}
#clientes .client-manager{display:inline-flex;align-items:center;gap:7px;font-weight:500}
#clientes .client-manager::before{content:"•";font-size:18px;color:#9b9da1;line-height:1}
#clientes .client-performance-units{display:flex;flex-direction:column;gap:8px}
#clientes .client-performance-unit-type{display:block;font-size:11px;font-weight:500;color:#8f9195;letter-spacing:0.3px;text-transform:uppercase;margin-bottom:2px}
#clientes .client-guests{display:flex;gap:6px;flex-wrap:wrap;max-width:310px}
#clientes .client-guests .guest-tag{margin:0;padding:5px 9px;background:var(--surface-card-inner);border-color:var(--border-default);color:#d0d1d3;font-size:12px}
#clientes .client-update-date{display:block;color:#e5e6e7;font-weight:650;font-size:13px;white-space:nowrap}
#clientes .client-update-relative{display:block;color:#8f9195;font-size:12px;margin-top:5px;white-space:nowrap}
#clientes .client-roas{font-size:15px;font-weight:750;color:#f2f2f3}
#clientes .client-status{display:inline-flex;align-items:center;gap:7px;padding:7px 10px;border-radius:9px;font-size:12px;font-weight:750;border:1px solid currentColor;background:transparent!important;white-space:nowrap}
#clientes .client-status::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor}
#clientes .client-actions-menu{position:relative;display:inline-block}
#clientes .client-actions-menu summary{list-style:none;width:38px;height:36px;border-radius:10px;border:1px solid var(--border-default);background:#141719;color:#e6e7e8;display:grid;place-items:center;cursor:pointer;font-weight:800;letter-spacing:2px}
#clientes .client-actions-menu summary::-webkit-details-marker{display:none}
#clientes .client-actions-menu[open] summary{border-color:#4a4f54;background:#1b1e21}
#clientes .client-actions-popover{position:absolute;right:0;top:42px;z-index:12;min-width:150px;padding:6px;border:1px solid #34383c;border-radius:12px;background:var(--surface-card-inner);box-shadow:0 18px 45px rgba(0,0,0,.48)}
#clientes .client-actions-popover button{width:100%;border:0;background:transparent;color:#e8e8e9;padding:9px 10px;border-radius:8px;text-align:left;cursor:pointer}
#clientes .client-actions-popover button:hover{background:#202326}
#clientes .client-actions-popover button.danger-action{color:#ed8b98}
#clientes .clients-table-footer{display:flex;justify-content:space-between;align-items:center;padding:14px 18px;border-top:1px solid #292d31;color:#96989c;font-size:12px}
/* FASE MOBILE 1B: agrupa "+ Novo cliente" e "Clientes arquivados" do lado
   direito do cabeçalho (antes o botão de arquivados era inserido dentro do
   bloco título+descrição e ficava deslocado abaixo do texto no mobile). */
.clients-header-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
/* FASE MOBILE 1B: cards mobile de Clientes ativos e barra de filtros —
   ocultos por padrão (desktop preserva a tabela); exibidos apenas em
   @media(max-width:700px) mais abaixo neste arquivo. */
.clients-mobile-list{display:none}
/* FASE MOBILE 1B.1/1B.2: card simplificado a três linhas — (1) nome+ações,
   (2) gestor discreto (ponto colorido, sem fundo grande)+quantidade de
   unidades, (3) ROAS+status. Meta de altura (1B.2, refinada): 84-100px. */
.client-mobile-card{border:1px solid var(--border-default);border-radius:12px;background:var(--surface-card-inner);padding:12px;margin-bottom:8px;display:flex;flex-direction:column;gap:6px}
.client-mobile-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.client-mobile-head .client-identity{display:flex;align-items:center;gap:10px;min-width:0}
.client-mobile-head .name-link{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.client-mobile-actions-trigger{width:34px;height:32px;border-radius:9px;border:1px solid var(--border-default);background:#141719;color:#e6e7e8;font-weight:800;letter-spacing:2px;cursor:pointer;flex-shrink:0}
.client-mobile-subline{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* Reaproveita apenas a cor das classes .role-* (mesma lógica de
   getManagerRoleClass/getRoleClass, não duplicada) — neutraliza o fundo/
   padding/borda "de badge" para virar só um ponto discreto, conforme pedido
   ("evitar fundo grande colorido"). */
.client-manager-dot.role-proprietario,.client-manager-dot.role-owner,.client-manager-dot.role-administrador,.client-manager-dot.role-admin,.client-manager-dot.role-gestor,.client-manager-dot.role-manager,.client-manager-dot.role-visualizador,.client-manager-dot.role-viewer{background:none;border:0;padding:0;border-radius:0;font-weight:400}
.client-mobile-subline .client-manager-dot{font-size:10px;line-height:1;flex-shrink:0}
.client-mobile-subline .client-manager-text{color:inherit;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.client-mobile-sep{color:var(--muted)}
.client-mobile-footer{display:flex;align-items:center;justify-content:space-between;gap:10px}
/* FASE MOBILE 1B.2: ROAS deixa de dominar o card — label pequeno/muted,
   valor em peso médio (não mais o antigo .client-roas do desktop, que é
   grande/bold e usado apenas na tabela/#clientes, não tocado aqui). */
.client-mobile-metric{display:flex;align-items:baseline;gap:5px}
.client-mobile-metric-label{font-size:11px;font-weight:600;color:var(--muted);letter-spacing:.02em;text-transform:uppercase}
.client-mobile-metric-value{font-size:15px;font-weight:700;color:var(--text)}
/* FASE MOBILE 1B.2: status mais discreto que o badge desktop (#clientes
   .client-status, com borda forte de currentColor) — fundo sutil, sem
   borda, ponto colorido opcional embutido via ::before. Reaproveita as
   mesmas classes de cor (.red/.yellow/.green, de statusClass()), já usadas
   em toda a aplicação — nenhuma nova regra de classificação. */
.client-mobile-status{display:inline-flex;align-items:center;gap:5px;font-size:12px;font-weight:600;padding:5px 9px;border-radius:8px;white-space:nowrap}
.client-mobile-status::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor}
.client-mobile-status.neutral{background:rgba(142,160,187,.12);color:#8ea0bb}
.mobile-filters{display:none}
.mobile-filters-toggle{width:100%;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 14px;border:1px solid var(--border-default);border-radius:10px;background:var(--surface-card-inner);color:inherit;cursor:pointer;font-size:13px;font-weight:600}
.mobile-filters-toggle small{color:var(--muted);font-weight:400;font-size:12px}
.mobile-filters-panel [data-filters-apply]{width:100%;margin-top:2px}
.mobile-filters-panel{position:relative;margin-top:8px;padding:14px;border:1px solid var(--border-default);border-radius:10px;background:var(--surface-card-inner);display:flex;flex-direction:column;gap:12px}
.mobile-filters-panel .field{display:flex;flex-direction:column;gap:6px}
.mobile-filters-panel label{font-size:12px;color:var(--muted)}
/* FASE MOBILE 1B: bottom sheet de ações do cliente (mobile). */
.client-actions-sheet-box{width:min(420px,calc(100vw - 32px))}
.client-actions-sheet-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.client-actions-sheet-header h3{margin:0;font-size:16px}
.client-actions-sheet-body{display:flex;flex-direction:column;gap:8px}
.client-actions-sheet-item{width:100%;padding:12px 14px;border:1px solid var(--border-default);border-radius:10px;background:var(--surface-card-inner);color:inherit;text-align:left;cursor:pointer;font-size:14px}
.client-actions-sheet-item.danger-action{color:#ed8b98;border-color:#5a2f34}
/* FASE MOBILE 1B: clientes arquivados — cards mobile ocultos por padrão. */
.archived-mobile-list{display:none}
.archived-mobile-card{border:1px solid var(--border-default);border-radius:12px;background:var(--surface-card-inner);padding:14px;margin:0 20px 10px}
.archived-mobile-card strong{display:block;color:#ffffff;font-size:14px;margin-bottom:10px}
.archived-mobile-meta{display:grid;grid-template-columns:1fr 1fr;gap:10px 14px;margin-bottom:12px}
.archived-mobile-meta small{display:block;color:#8e95a5;font-size:11px;margin-bottom:3px}
.archived-mobile-meta span{color:#e0e0e0;font-size:13px}
.archived-mobile-actions{display:flex;gap:8px;flex-wrap:wrap}
.archived-mobile-actions .btn{flex:1;min-width:110px}
/* FASE MOBILE 1B: dimensões do modal "Clientes arquivados" — movidas do
   style inline para permitir override responsivo abaixo. */
.archived-modal-card{width:min(980px,94vw);max-height:86vh}
/* FASE MOBILE 1B: este bloco fica DEPOIS das regras base display:none acima
   (.clients-mobile-list, .mobile-filters, .archived-mobile-list) de propósito
   — com a mesma especificidade (uma classe), a ordem no arquivo decide quem
   vence, e a exibição mobile precisa vencer sobre a ocultação padrão. */
@media(max-width:700px){
 .clients-mobile-list{display:block}
 .mobile-filters{display:block;margin-bottom:14px}
 .archived-mobile-list{display:block}
}
@media(max-width:1200px){#clientes .clients-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){#clientes .clients-summary-grid{grid-template-columns:1fr}#clientes .clients-summary-card{min-height:100px}#clientes .clients-table-footer{align-items:flex-start;flex-direction:column;gap:6px}}

/* =========================================================
   TEMA BLACK / GRAY — REVISÃO SEGURA
   Apenas aparência: cores, fundos, bordas, sombras e tipografia.
   Nenhuma regra estrutural, de exibição ou de interação foi alterada.
   ========================================================= */
:root{
  --bg:#080a0c;
  --panel:#111416;
  --panel2:#181b1e;
  --line:#2e3236;
  --text:#f4f4f5;
  --muted:#9b9da1;
  --green:#8fcfa9;
  --blue:#aebddd;
  --yellow:#dfbd78;
  --red:#ed8b98;
}
html{background:#080a0c;color-scheme:dark}
body{
  background:radial-gradient(circle at 72% -10%,rgba(255,255,255,.045),transparent 32%),linear-gradient(180deg,#080a0c 0%,#0a0c0e 48%,#080a0c 100%);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
::selection{background:rgba(255,255,255,.18);color:#fff}
button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid rgba(255,255,255,.55);outline-offset:2px}
/* FASE VISUAL 1A: aside sem box-shadow externo (evita aparência de iframe/
   painel flutuante); .nav e .nav.active alinhados ao acento verde Evolora
   em vez do cinza monocromático original deste bloco. */
aside{
  background:linear-gradient(180deg,rgba(255,255,255,.018),transparent 26%),#07090b;
  border-right-color:rgba(255,255,255,.08);
}
.logo{
  background:linear-gradient(145deg,#393d41,#17191c);
  border:1px solid rgba(255,255,255,.1);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.13),0 10px 24px rgba(0,0,0,.32);
  color:#fff;
}
.brand h1{color:#fff}.brand small{color:#8e9094}
.nav{color:#9aa7bd;transition:background .18s ease,border-color .18s ease,color .18s ease}
.nav:hover{background:var(--surface-hover);color:#d7dfec}
.nav.active{background:rgba(61,220,151,.08);border-left-color:var(--green);color:#fff}
.nav.active .nav-icon{color:var(--green)}
.sidebar-footer{border-top-color:rgba(255,255,255,.08)}
.sidebar-footer label{color:#9a9ca0}
.sidebar-footer select,.field input,.field textarea,.field select{
  background:#0d1012;color:#f3f3f4;border-color:var(--border-default);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.025);
}
.sidebar-footer select:hover,.field input:hover,.field textarea:hover,.field select:hover{border-color:#44494e}
.sidebar-footer select:focus,.field input:focus,.field textarea:focus,.field select:focus{border-color:#666b70;background:var(--surface-card-inner);box-shadow:0 0 0 3px rgba(255,255,255,.055);outline:none}
.sidebar-summary{border-color:var(--border-default)}.sidebar-summary small{color:#8f9195}.sidebar-summary strong{color:#fff}
.top h2{color:#f7f7f8}.top p,.filter-note{color:#9b9da1}
.card{background:linear-gradient(145deg,rgba(255,255,255,.034),transparent 44%),linear-gradient(180deg,#181b1e,#111416);border-color:#2e3236;box-shadow:inset 0 1px 0 rgba(255,255,255,.035),0 18px 50px rgba(0,0,0,.24)}
.card:hover{border-color:#3a3f44}
.kpi small,.section small,.section-subhead small{color:#9b9da1!important}.kpi strong{color:#f7f7f8}
.btn{background:linear-gradient(180deg,#191c1f,#111416);border-color:#34383c;color:#f0f0f1;box-shadow:inset 0 1px 0 rgba(255,255,255,.04),0 5px 14px rgba(0,0,0,.18)}
.btn:hover{background:linear-gradient(180deg,#24272a,#191c1f);border-color:#4a4f54;color:#fff}
.btn.primary{background:linear-gradient(180deg,#efefef,#cfcfcf);color:#111;border-color:#dedede;box-shadow:inset 0 1px 0 rgba(255,255,255,.8),0 7px 18px rgba(0,0,0,.25)}
.btn.primary:hover{background:linear-gradient(180deg,#fff,#d8d8d8);color:#050505}
.btn.danger{background:rgba(237,139,152,.08);border-color:rgba(237,139,152,.3);color:#ed8b98}
.chip{background:var(--surface-card-inner);border-color:var(--border-default);color:#b7b9bc}.chip:hover{border-color:#50555a;color:#fff}.chip.active{background:#272b2e;border-color:#686d72;color:#fff}
table{color:#e1e2e3}th{color:#97999d;border-bottom-color:var(--border-default)}td{border-bottom-color:#272b2f}tbody tr:hover{background:rgba(255,255,255,.018)}
.progress{background:#292d30}.progress span{background:linear-gradient(90deg,#777b7f,#dedfe0)}
.chart{border-top-color:#2d3135}.chart-grid{stroke:#2d3135}.chart-label{fill:#97999d;letter-spacing:0}.chart-line{stroke:#d2d3d4}.chart-area{fill:rgba(255,255,255,.045)}.chart-point{fill:#e8e8e8;stroke:#111416}
.alert,.change-grid,.event-detail-grid,.global-footer-row{border-color:#2d3135}
.attention-card,.rule-card,.history-note,.daily-summary-card,.guest-performance-card,.insight-card,.sales-summary-card,.billing-card,.currency-card,.empty-state{background:var(--surface-card-inner);border-color:var(--border-default)}
.icon,.insight-icon,.global-kpi-icon,.currency-pill{background:#25292c!important;color:#ededee!important;border:1px solid #383c40}
.status{border:1px solid currentColor;background:transparent!important}.status.green{color:#93d3ad}.status.yellow{color:#e3be72}.status.red{color:#f08b98}
.history-card{background:var(--surface-card-inner);border-left-color:#8fa2ca}.history-summary:hover{background:rgba(255,255,255,.025)}
.event-badge{border:1px solid currentColor;background:transparent!important}
.forecast-bars{border-color:#363a3e;background:linear-gradient(180deg,rgba(255,255,255,.012),transparent)}
.forecast-bars::before,.forecast-bars::after{border-color:rgba(255,255,255,.075)}
.forecast-bar-fill{background:linear-gradient(180deg,#d8d9da,#74787c);box-shadow:0 14px 28px rgba(0,0,0,.25)}
.manager-distribution-bar{background:#292d30;border-color:#373b3f}.manager-distribution-bar span{background:linear-gradient(90deg,#74787c,#dedfe0)}
.modal{background:rgba(0,0,0,.78)}.modal-box{background:linear-gradient(180deg,#262626 0%,#050505 100%);border-color:var(--border-default);box-shadow:0 28px 80px rgba(0,0,0,.60)}
.guest-manager-row{background:var(--surface-card-inner);border-color:var(--border-default)}.name-link:hover{color:#fff}
.delta.positive,.global-kpi-delta.positive{color:#93d3ad!important}.delta.negative,.global-kpi-delta.negative{color:#f08b98!important}.delta.neutral,.global-kpi-delta.neutral{color:#a3a5a8!important}
*{scrollbar-color:#34383c #090b0d}
select option{background:var(--surface-card-inner);color:#f4f4f5}
.segmented-control{display:inline-flex;gap:4px;padding:4px;border:1px solid #34383c;border-radius:12px;background:#0d1012;flex-wrap:wrap}
.segmented-control .segment{border:0;background:transparent;color:#aeb0b3;padding:8px 11px;border-radius:8px;cursor:pointer;font-weight:700;white-space:normal;flex:1;min-width:90px;text-align:center}
.segmented-control .segment:hover{color:#fff;background:#191c1f}
.segmented-control .segment.active{background:#e4e4e4;color:#111;box-shadow:0 4px 12px rgba(0,0,0,.25)}

.suggestion-settings-list{display:grid;gap:12px}
.suggestion-setting-card{padding:16px;border:1px solid var(--border-default);border-radius:14px;background:var(--surface-card-inner)}
.suggestion-setting-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:14px}
.suggestion-setting-head h4{margin:0 0 5px;font-size:16px}
.suggestion-setting-head p{margin:0;color:var(--muted);font-size:13px;line-height:1.45}
.suggestion-setting-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;align-items:stretch}
.suggestion-severity-box{padding:14px;border:1px solid var(--border-default);border-radius:12px;background:#0b0e10}
.suggestion-severity-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}
.suggestion-severity-head strong{font-size:14px}
.suggestion-severity-box.attention{border-color:rgba(223,189,120,.3)}
.suggestion-severity-box.critical{border-color:rgba(237,139,152,.3)}
.suggestion-severity-box .field+ .field{margin-top:10px}
.switch-control{display:inline-flex;align-items:center;gap:9px;cursor:pointer;user-select:none;white-space:nowrap}
.switch-control input{position:absolute;opacity:0;pointer-events:none}
.switch-track{width:44px;height:24px;border-radius:999px;background:var(--border-default);border:1px solid #44494e;position:relative;transition:.18s ease}
.switch-track::after{content:"";position:absolute;width:18px;height:18px;border-radius:50%;background:#d7d8d9;left:2px;top:2px;transition:.18s ease}
.switch-control input:checked + .switch-track{background:#e2e2e2;border-color:#f2f2f2}
.switch-control input:checked + .switch-track::after{transform:translateX(20px);background:var(--surface-card-inner)}
.switch-label{font-size:13px;color:#d9dadd}
.suggestion-preview{margin-top:12px;padding:11px 12px;border-radius:10px;border:1px dashed #383c40;color:var(--muted);font-size:13px}
.priority-badge{display:inline-flex;padding:4px 7px;border-radius:999px;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.04em;border:1px solid currentColor;margin-right:6px}
.priority-high{color:var(--red)}.priority-medium{color:var(--yellow)}.priority-low{color:var(--green)}
@media(max-width:700px){.suggestion-setting-head{flex-direction:column}.suggestion-setting-controls{grid-template-columns:1fr}}
.metric-control-head{flex-direction:column;align-items:flex-start;width:100%}
.metric-control-head .segmented-control{margin-top:8px;display:flex}
.rule-help{margin:0 0 16px;padding:11px 12px;border:1px solid var(--border-default);border-radius:10px;background:var(--surface-card-inner);color:var(--muted);font-size:13px;line-height:1.45}
.rule-field-status{display:inline-flex;align-items:center;gap:6px;margin-top:7px;font-size:12px;font-weight:700}
.rule-field-status::before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor}
.rule-field-status.active{color:#93d3ad}
.rule-field-status.disabled{color:#a3a5a8}


.backup-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.backup-card{padding:20px;border:1px solid var(--border-default);border-radius:14px;background:var(--surface-card-inner)}
.backup-card h3{margin:0 0 8px}.backup-card p{margin:0 0 16px;color:var(--muted);line-height:1.55}
.backup-icon{width:46px;height:46px;border-radius:14px;display:grid;place-items:center;margin-bottom:14px;background:#25292c;border:1px solid #383c40;font-size:22px}
.backup-status{margin-top:16px;padding:13px 14px;border-radius:11px;border:1px solid var(--border-default);background:#0d1012;color:var(--muted);line-height:1.5}
.backup-status.success{border-color:rgba(143,207,169,.35);color:#a8dbbb}.backup-status.error{border-color:rgba(237,139,152,.35);color:#f0a2ad}
.backup-list{margin:14px 0 0;padding-left:19px;color:#c9cbce}.backup-list li{margin:7px 0}
.backup-file-name{display:block;margin-top:10px;color:#c9cbce;font-size:13px;word-break:break-all}
.backup-reset{margin-top:16px;padding:18px 20px;border:1px solid rgba(237,139,152,.28);border-radius:14px;background:rgba(237,139,152,.045);display:flex;justify-content:space-between;gap:18px;align-items:center}
.backup-reset h3{margin:0 0 6px}.backup-reset p{margin:0;color:var(--muted);line-height:1.5}
@media(max-width:800px){.backup-grid{grid-template-columns:1fr}.backup-reset{flex-direction:column;align-items:flex-start}}

@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}

.guest-modal-content{overflow-y:auto;max-height:calc(100vh - 240px)}.guest-modal-section{padding:16px;background:rgba(255,255,255,.02);border:1px solid var(--border-default);border-radius:12px;margin-bottom:20px}.guest-modal-section:last-of-type{margin-bottom:0}.guest-modal-header h4{margin:0 0 16px;font-size:13px;font-weight:700;text-transform:uppercase;letter-spacing:.5px;color:var(--muted)}.guest-modal-body{margin:0}.guest-modal-input{padding:10px 12px;border:1px solid var(--border-default);border-radius:8px;background:var(--surface-input);color:#fff;font-size:14px;font-family:inherit;width:100%;transition:border-color .2s ease,box-shadow .2s ease}.guest-modal-input:focus{outline:none;border-color:var(--green);box-shadow:0 0 0 2px rgba(61,220,151,.1)}.guest-modal-hint{margin:0 0 16px;color:var(--muted);font-size:12px}.guest-modal-add-guest{display:flex;gap:10px;margin-bottom:16px;align-items:center}.guest-modal-add-guest input{flex:1}

.performance-notes-block{padding:16px;background:rgba(255,255,255,.02);border:1px solid var(--border-default);border-radius:12px;margin:16px 0}.performance-notes-block .section-head{margin:0;padding:0}.performance-notes-block h3{margin:0 0 12px;font-size:13px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.5px}
#performanceNotesContent{white-space:normal}
.guest-note-item{display:block;margin:0 0 14px}.guest-note-item:last-child{margin-bottom:0}.guest-note-name{display:block;margin:0 0 4px;font-size:13px;font-weight:600;color:var(--green)}.guest-note-text{display:block;margin:0;white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;color:var(--text)}

.fx-rate-box{display:grid;gap:9px}
.fx-rate-row{display:flex;gap:8px;align-items:center}
.fx-rate-row input{flex:1}
.fx-rate-meta{min-height:18px;color:var(--muted);font-size:12px;line-height:1.45}
.fx-rate-meta.success{color:#93d3ad}.fx-rate-meta.warning{color:#e3be72}.fx-rate-meta.error{color:#f08b98}
.fx-rate-actions{display:flex;gap:8px;flex-wrap:wrap}
.fx-rate-actions .btn{padding:8px 10px;font-size:12px}
.fx-rate-field.is-brl .fx-rate-actions,.fx-rate-field.is-brl .fx-rate-meta{display:none}
.fx-rate-field.is-brl input{opacity:.72;cursor:not-allowed}
.fx-rate-field.is-loading input{opacity:.7}

.usuarios-summary-cards{grid-template-columns:repeat(4,1fr)}
.usuarios-member-row{display:grid;grid-template-columns:1fr auto auto auto auto auto auto;gap:12px;align-items:center;padding:14px 0;border-bottom:1px solid var(--line)}
.usuarios-member-row:last-child{border-bottom:none}
.usuarios-member-name{display:flex;flex-direction:column;gap:2px}
.usuarios-member-name strong{color:var(--text);font-size:14px;font-weight:600}
.usuarios-member-name small{color:var(--muted);font-size:12px;word-break:break-all}
.usuarios-role-badge,.usuarios-visibility-badge,.usuarios-status-badge{display:inline-flex;align-items:center;padding:6px 10px;border-radius:6px;font-size:12px;font-weight:600}
.usuarios-role-badge{background:rgba(93,140,255,.14);color:#8eb0ff}
.usuarios-visibility-badge{background:rgba(242,184,75,.14);color:var(--yellow)}
/* FASE 2D.5F: Viewer access scope badges */
.usuarios-visibility-badge.viewer{background:rgba(93,140,255,.14);color:var(--blue)}
.usuarios-visibility-badge.viewer-empty{background:rgba(142,160,187,.14);color:var(--muted)}
.usuarios-edit-badge{display:inline-flex;align-items:center;padding:6px 10px;border-radius:6px;font-size:12px;font-weight:600;background:rgba(61,220,151,.14);color:var(--green)}
.usuarios-edit-badge.no{background:rgba(142,160,187,.14);color:var(--muted)}
.usuarios-status-badge.active{background:rgba(61,220,151,.14);color:var(--green)}
/* FASE 2D.3: Both suspended and removed show as "Inativo" */
.usuarios-status-badge.suspended,.usuarios-status-badge.removed{background:rgba(242,184,75,.14);color:var(--yellow)}
/* FASE 2D.8E.5: Convites status badges */
.convite-status-pending{display:inline-flex;align-items:center;padding:6px 10px;border-radius:6px;font-size:12px;font-weight:600;background:rgba(102,126,234,.14);color:#8eb0ff}
.convite-status-accepted{display:inline-flex;align-items:center;padding:6px 10px;border-radius:6px;font-size:12px;font-weight:600;background:rgba(61,220,151,.14);color:var(--green)}
.convite-status-expired{display:inline-flex;align-items:center;padding:6px 10px;border-radius:6px;font-size:12px;font-weight:600;background:rgba(142,160,187,.14);color:var(--muted)}
.convite-status-cancelled{display:inline-flex;align-items:center;padding:6px 10px;border-radius:6px;font-size:12px;font-weight:600;background:rgba(242,184,75,.14);color:var(--yellow)}
.usuarios-client-count{text-align:center;color:var(--text);font-weight:600;font-size:14px}
.usuarios-actions{text-align:center;color:var(--muted)}
#usuariosTableContainer{display:block}
#usuariosEditModal .section-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:20px}
#usuariosEditModal .section-head h3{margin:0;font-size:16px}
#usuariosEditModal .section-head button{margin:0;padding:6px 8px}
#usuariosEditModalContent>div>label{display:block;font-weight:600;font-size:13px;margin-bottom:6px;color:var(--text)}
/* FASE 2D.3: Styling for explanatory help block */
#usuariosEditHelpBlock{color:var(--text)!important}
#usuariosEditHelpBlock strong{font-weight:600;font-size:12px}
#usuariosEditHelpBlock ul li{margin-bottom:4px}
/* FASE 2D.3: Faded appearance when status is suspended/inactive */
#usuariosEditModalContent.inactive-mode{opacity:.85}

/* FASE 2D.5D: Safe visibility control for Carteira Visível field */
#usuariosEditVisibilityField[hidden]{display:none!important}

/* FASE 2D.5B & 2D.6A: Viewer client access styling */
#usuariosEditViewerClientsSection{background:rgba(102,126,234,.05)!important;border:1px solid rgba(102,126,234,.2)!important}

/* FASE 2D.8E.5: Responsividade para seção de convites */
#convitesTableContainer{display:block}
#convitesCardsContainer{display:none}
@media(max-width:768px){
 #convitesTableContainer{display:none!important}
 #convitesCardsContainer{display:block!important}
}
#usuariosEditViewerClientsList{display:block;max-height:300px;overflow-y:auto;border:1px solid rgba(102,126,234,.2);border-radius:6px;padding:8px;background:rgba(0,0,0,.2)}
#usuariosEditViewerClientsList>div{padding:8px;border-radius:4px;transition:background .15s;display:flex;align-items:center;gap:10px}
#usuariosEditViewerClientsList>div:hover{background:rgba(102,126,234,.1)}
/* FASE 2D.6A: Radio buttons for single client selection */
#usuariosEditViewerClientsList input[type="radio"]{cursor:pointer;width:18px;height:18px;flex-shrink:0;accent-color:var(--blue)}
#usuariosEditViewerClientsList input[type="checkbox"]{cursor:pointer;width:18px;height:18px;flex-shrink:0;accent-color:var(--green)}
#usuariosEditViewerClientsList label{cursor:pointer;font-size:13px;color:var(--text);margin:0;flex:1}
#usuariosEditViewerClientsCounter{font-size:12px;color:var(--muted);text-align:center;margin-top:10px}
/* FASE 2D.8E.9A: Modal de Perfil */
/* ========== PROFILE MODAL - COMPLETAMENTE ISOLADO ========== */
#perfilUsuarioModal{position:fixed;top:0;left:0;right:0;bottom:0;z-index:2000;display:none;align-items:center;justify-content:center;background:rgba(0,0,0,.78);backdrop-filter:blur(3px)}
#perfilUsuarioModal[style*="display: flex"],#perfilUsuarioModal[style*="display:flex"]{display:flex!important;align-items:center;justify-content:center}

#perfilUsuarioModal .profile-modal-content{background:linear-gradient(180deg,#262626 0%,#050505 100%);border:1px solid rgba(255,255,255,.14);border-radius:18px;padding:28px 30px 24px;width:min(560px,calc(100vw - 40px));max-height:calc(100vh - 40px);overflow-y:auto;box-shadow:0 28px 80px rgba(0,0,0,.60),0 0 0 1px rgba(255,255,255,.02) inset}
@media(max-width:768px){#perfilUsuarioModal .profile-modal-content{width:calc(100vw - 24px);max-height:calc(100vh - 24px);max-height:calc(100dvh - 24px);padding:22px 18px 18px}}

#perfilUsuarioModal .profile-modal-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px;border-bottom:1px solid rgba(255,255,255,.10);padding-bottom:16px}
#perfilUsuarioModal .profile-modal-header h2{margin:0;font-size:20px;font-weight:700;color:#ffffff}

#perfilUsuarioModal .profile-modal-close{background:none;border:none;color:#ffffff;cursor:pointer;font-size:24px;padding:0;opacity:.6;transition:.2s}
#perfilUsuarioModal .profile-modal-close:hover{opacity:1}

#perfilUsuarioModal .profile-modal-body{display:flex;flex-direction:column;gap:0}
#perfilUsuarioModal .profile-modal-avatar{width:84px;height:84px;border-radius:50%;object-fit:cover;display:block;margin:16px auto 22px;border:1px solid rgba(255,255,255,.12);box-shadow:0 4px 12px rgba(0,0,0,.3)}

#perfilUsuarioModal .profile-field-group{display:flex;flex-direction:column;gap:8px;margin-bottom:16px}
#perfilUsuarioModal .profile-field-group label{font-size:12px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:#a0a5aa}

#perfilUsuarioModal .profile-readonly-label{font-size:11px;font-weight:400;letter-spacing:0;text-transform:none;color:#a0a5aa}

#perfilUsuarioModal .profile-field-group input{height:44px;padding:0 14px;background:#0b0d0f;border:1px solid rgba(255,255,255,.12);border-radius:9px;color:#ffffff;font-size:13px;transition:.2s;font-family:inherit}
#perfilUsuarioModal .profile-field-group input::placeholder{color:#a0a5aa;opacity:.6}
#perfilUsuarioModal .profile-field-group input:focus{outline:none;border-color:rgba(255,255,255,.32);box-shadow:0 0 0 3px rgba(255,255,255,.06)}

#perfilUsuarioModal .profile-field-hint{font-size:12px;line-height:1.45;color:#a0a5aa;margin-top:2px}

#perfilUsuarioModal .profile-divider{margin:16px 0 14px;border-top:1px solid rgba(255,255,255,.10)}

#perfilUsuarioModal .profile-readonly-card{min-height:50px;display:flex;align-items:center;gap:12px;padding:0 14px;background:linear-gradient(180deg,#121518 0%,#0d1012 100%);border:1px solid rgba(255,255,255,.10);border-radius:10px;color:#ffffff;font-size:13px}
#perfilUsuarioModal .profile-readonly-icon{font-size:18px;opacity:.7}
#perfilUsuarioModal .profile-readonly-card strong{color:#ffffff;font-weight:600}
#perfilUsuarioModal .profile-readonly-card .role-badge{padding:6px 10px;border-radius:6px;font-size:12px;font-weight:600;background:transparent}

#perfilUsuarioModal .profile-message{padding:12px 14px;border-radius:9px;margin-top:12px;font-size:13px;border-left:3px solid}

#perfilUsuarioModal .profile-footer{display:flex;justify-content:flex-end;gap:12px;padding-top:18px;margin-top:6px;border-top:1px solid rgba(255,255,255,.10)}

#perfilUsuarioModal .profile-btn-cancel{height:44px;min-width:120px;padding:0 20px;background:#111315;border:1px solid rgba(255,255,255,.12);border-radius:9px;color:#ffffff;cursor:pointer;font-weight:600;font-size:13px;transition:.2s;font-family:inherit}
#perfilUsuarioModal .profile-btn-cancel:hover{border-color:rgba(255,255,255,.24);background:rgba(255,255,255,.05)}

#perfilUsuarioModal .profile-btn-save{height:44px;min-width:120px;padding:0 24px;background:linear-gradient(180deg,#48d17d,#22b861);border:none;border-radius:9px;color:#ffffff;cursor:pointer;font-weight:600;font-size:13px;transition:.2s;font-family:inherit}
#perfilUsuarioModal .profile-btn-save:hover{box-shadow:0 4px 12px rgba(72,209,125,.25)}
#perfilUsuarioModal .profile-btn-save:disabled{opacity:.6;cursor:not-allowed}
/* ========== FIM PROFILE MODAL ========== */

/* FASE 2D.8E.9C: Badges de papel e status em Usuários */
.usuarios-role-badge{display:inline-block;border-radius:6px;padding:4px 8px;font-weight:600;border:1px solid;font-size:12px}
.usuarios-visibility-badge{display:inline-block;border-radius:6px;padding:4px 8px;font-weight:500;border:1px solid var(--border-default);background:rgba(0,0,0,.2);color:var(--muted);font-size:12px}
.usuarios-visibility-badge.viewer{border-color:rgba(142,160,187,.5);background:rgba(142,160,187,.12);color:#8ea0bb}
.usuarios-visibility-badge.viewer-empty{border-color:rgba(255,102,122,.3);background:rgba(255,102,122,.12);color:var(--red)}
.usuarios-status-badge{display:inline-block;border-radius:6px;padding:4px 8px;font-weight:600;border:1px solid;font-size:12px}
.usuarios-status-badge.active{border-color:rgba(61,220,151,.5);background:rgba(61,220,151,.12);color:#3ddc97}
.usuarios-status-badge.suspended{border-color:rgba(255,102,122,.3);background:rgba(255,102,122,.12);color:var(--red)}
.usuarios-status-badge.removed{border-color:rgba(142,160,187,.5);background:rgba(142,160,187,.12);color:var(--muted)}
.usuarios-member-name{display:flex;flex-direction:column;gap:2px;min-width:150px}
.usuarios-member-name strong{font-weight:600;color:var(--text)}
.usuarios-member-name small{color:var(--muted);font-size:11px}
@media(max-width:768px){#perfilForm button{padding:12px 16px;font-size:14px}}

/* FASE 2D.8E.9: Role-based colors */
.role-badge{display:inline-flex;align-items:center;padding:6px 12px;border-radius:6px;font-size:12px;font-weight:600;border:1px solid;background:rgba(0,0,0,.3)}
.role-proprietario,.role-owner{border-color:rgba(242,184,75,.5);background:rgba(242,184,75,.12);color:#f2b84b;border-radius:6px;padding:4px 8px;font-weight:600}
.role-administrador,.role-admin{border-color:rgba(93,140,255,.5);background:rgba(93,140,255,.12);color:#5d8cff;border-radius:6px;padding:4px 8px;font-weight:600}
.role-gestor,.role-manager{border-color:rgba(147,85,233,.5);background:rgba(147,85,233,.12);color:#9355e9;border-radius:6px;padding:4px 8px;font-weight:600}
.role-visualizador,.role-viewer{border-color:rgba(142,160,187,.5);background:rgba(142,160,187,.12);color:#8ea0bb;border-radius:6px;padding:4px 8px;font-weight:600}
#usuariosEditViewerClientsValidation{display:none}
#usuariosEditViewerClientsLoading,#usuariosEditViewerClientsError,#usuariosEditViewerClientsEmpty{padding:12px;text-align:center;font-size:12px;border-radius:6px}
#usuariosEditViewerClientsError{background:rgba(211,47,47,.1);border:1px solid rgba(211,47,47,.3);color:var(--red)}
#usuariosEditViewerClientsLoading,#usuariosEditViewerClientsEmpty{color:var(--muted)}

/* FASE 2D.7A: Viewer Portal Mode Styles */
body.viewer-mode .admin-manager-nav,
body.viewer-mode .admin-only-nav,
body.viewer-mode [class*="admin-only"],
body.viewer-mode [class*="admin-manager"] {
 display: none !important;
}

body.viewer-mode .viewer-only-nav {
 display: flex !important;
}

.viewer-unavailable {
 display: flex;
 align-items: center;
 justify-content: center;
 min-height: 100vh;
 padding: 20px;
}

.unavailable-content {
 text-align: center;
 max-width: 500px;
}

.unavailable-content h2 {
 font-size: 24px;
 margin: 0 0 16px;
 color: var(--text);
}

.unavailable-content p {
 color: var(--muted);
 margin: 0;
 line-height: 1.6;
}

/* FASE 2D.7B: Viewer Month Control */
.viewer-month-control {
 margin-bottom: 16px;
 padding: 12px 16px;
 background: linear-gradient(180deg, var(--panel2), var(--panel));
 border: 1px solid var(--line);
 border-radius: 12px;
 display: flex;
 align-items: center;
 gap: 12px;
}

.viewer-month-control label {
 color: var(--muted);
 font-size: 12px;
 font-weight: 600;
 letter-spacing: .01em;
 margin: 0;
 white-space: nowrap;
}

.viewer-month-control select {
 flex: 1;
 max-width: 300px;
 padding: 8px 12px;
 border-radius: 8px;
 border: 1px solid var(--line);
 background: #0b1728;
 color: var(--text);
 font-size: 13px;
}

.viewer-month-control[hidden] {
 display: none !important;
}

/* FASE 2D.7C: Ocultar ações de escrita para Viewer */
body.viewer-mode .viewer-write-action,
body.viewer-mode .sales-write-action {
 display: none !important;
}

/* FASE 2D.7F: Ocultar ações de escrita para Manager sem edição (not-editor-mode) */
body.not-editor-mode .can-edit-action {
 display: none !important;
}

/* FASE 2D.7F: Ocultar coluna "Ações" em tabelas quando Manager não tiver edição */
body.not-editor-mode #clientsBody tr td:last-child,
body.not-editor-mode #dashboardBody tr td:last-child,
body.not-editor-mode .clients-table thead tr th:last-child {
 display: none !important;
}

/* FASE 1: Estrutura de página interna do cliente com sub-abas */
.client-page-header {
 margin-bottom: 20px;
 border-bottom: 1px solid var(--border-default);
 padding-bottom: 16px;
}

.client-header-top {
 margin-bottom: 12px;
}

.client-back-btn {
 background: transparent;
 border: none;
 color: var(--green);
 cursor: pointer;
 font-size: 13px;
 font-weight: 600;
 padding: 0;
 transition: .2s;
}

.client-back-btn:hover {
 color: #25b774;
}

.client-header-content {
 display: flex;
 justify-content: space-between;
 align-items: flex-start;
 gap: 16px;
 flex-wrap: wrap;
}

.client-header-info {
 flex: 1;
 min-width: 200px;
}

.client-breadcrumb {
 font-size: 12px;
 color: var(--muted);
 margin-bottom: 6px;
 text-transform: uppercase;
 letter-spacing: .05em;
 font-weight: 600;
}

.client-breadcrumb span {
 color: var(--green);
 font-weight: 700;
}

.client-page-header h1 {
 font-size: 28px;
 margin: 0 0 8px;
 color: var(--text);
}

.client-meta {
 display: flex;
 gap: 12px;
 flex-wrap: wrap;
 margin-top: 8px;
}

.client-meta span {
 font-size: 12px;
 padding: 6px 10px;
 background: var(--surface-card-inner);
 border: 1px solid var(--border-subtle);
 border-radius: 8px;
 color: var(--muted);
}

.client-header-actions {
 display: flex;
 gap: 10px;
 flex-wrap: wrap;
 align-items: center;
}

.client-tabs-container {
 margin: 0 -26px 16px;
 border-bottom: 1px solid var(--border-default);
}

.client-tabs {
 display: flex;
 gap: 0;
 overflow-x: auto;
 -webkit-overflow-scrolling: touch;
 padding: 0 26px;
 position: relative;
}

.client-tabs::-webkit-scrollbar {
 height: 4px;
}

.client-tabs::-webkit-scrollbar-track {
 background: transparent;
}

.client-tabs::-webkit-scrollbar-thumb {
 background: var(--border-default);
 border-radius: 2px;
}

.client-tab {
 background: transparent;
 border: none;
 border-bottom: 2px solid transparent;
 color: var(--muted);
 cursor: pointer;
 font-size: 13px;
 font-weight: 600;
 padding: 14px 16px;
 transition: .2s;
 white-space: nowrap;
}

.client-tab:hover {
 color: var(--text);
 border-bottom-color: var(--border-default);
}

.client-tab.active {
 color: var(--green);
 border-bottom-color: var(--green);
}

.client-tabs-content {
 display: grid;
}

.client-tab-pane {
 display: none;
}

.client-tab-pane.active {
 display: block;
}

.placeholder-state {
 text-align: center;
 padding: 32px 20px;
 color: var(--muted);
}

.placeholder-state p {
 margin: 0 0 8px;
 line-height: 1.5;
}

.placeholder-state p:first-child {
 color: var(--text);
 font-weight: 600;
}

/* FASE 1C: Ocultação de título legado duplicado */
.client-legacy-title {
 display: none;
}

/* FASE VISUAL 2A: mês de referência agora vive no cabeçalho único (sempre
   visível, qualquer aba ativa) — antes só existia dentro da aba Visão
   Geral. Reaproveita .reference-period-row já usado em Dashboard/Faturamento. */
.client-header-period-row{margin-top:14px;padding-top:14px;border-top:1px solid var(--border-subtle)}

/* Reaproveita as mesmas cores de status já usadas em toda a aplicação
   (.red/.yellow/.green de statusClass()); "neutral" cobre Sem dados/Sem
   critério, que não tinha classe de cor genérica no projeto. */
.neutral{background:rgba(142,160,187,.14);color:#8ea0bb}

/* FASE VISUAL 2A: badge de status real no cabeçalho — reaproveita a mesma
   classificação exibida no Dashboard (analyzeClientByUnits/
   aggregateUnitAnalyses, não duplicada — client.js só chama e formata). */
.client-meta .client-meta-status{display:inline-flex;align-items:center;gap:6px;font-weight:700}
.client-meta .client-meta-status::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor}
.client-meta .client-meta-status.red{color:var(--red);border-color:rgba(255,102,122,.35)}
.client-meta .client-meta-status.yellow{color:var(--yellow);border-color:rgba(242,184,75,.35)}
.client-meta .client-meta-status.green{color:var(--green);border-color:rgba(61,220,151,.35)}
.client-meta .client-meta-status.neutral{color:#8ea0bb}


/* FASE VISUAL 2A: seletor mobile de aba/seção — oculto no desktop (as abas
   horizontais continuam sendo a navegação real ali); no mobile substitui a
   rolagem horizontal de abas por um único select compacto. */
.client-mobile-tab-select{display:none}

/* FASE VISUAL 2A: accordion mobile-only — no desktop os grupos permanecem
   sempre expandidos (JS força `open` e bloqueia o toggle do summary via
   syncClientMobileSectionsForViewport(), chamada em renderClient()); no
   mobile funciona como <details> nativo. Nenhuma alteração de conteúdo,
   apenas apresentação. */
.client-mobile-section-summary{cursor:default;list-style:none}
.client-mobile-section-summary::-webkit-details-marker{display:none}

/* FASE 2: Títulos de seção da Visão Geral */
.section-title {
 margin-top: 28px;
 padding: 0 26px;
}

.section-title h3 {
 font-size: 16px;
 margin: 0 0 12px;
 color: var(--text);
 font-weight: 600;
 text-transform: uppercase;
 letter-spacing: 0.05em;
 font-size: 13px;
 opacity: 0.9;
}

.section-title p {
 font-size: 12px;
 color: var(--muted);
 margin: 0;
 line-height: 1.4;
}

@media(max-width:650px){.fx-rate-row{align-items:stretch;flex-direction:column}.fx-rate-actions{width:100%}.fx-rate-actions .btn{flex:1}}

/* FASE 1C: Ocultar filtros da sidebar no mobile */
@media(max-width:700px){
 aside .sidebar-footer {
  display: none;
 }
}
@media(max-width:768px){
 .client-page-header {
  padding-bottom: 12px;
  margin-bottom: 12px;
 }
 .client-header-content {
  flex-direction: column;
  align-items: stretch;
 }
 .client-header-actions {
  width: 100%;
 }
 .client-header-actions .btn {
  flex: 1;
 }
 .client-tabs {
  padding: 0 16px;
 }
 .client-tab {
  padding: 12px 12px;
  font-size: 12px;
 }
 /* FASE VISUAL 2A: abas horizontais viram select compacto no mobile —
    mesma navegação real (activateClientTab()), sem abas gigantes. */
 .client-tabs-container{margin:0 0 14px;padding:0 16px 12px;border-bottom:1px solid var(--border-default)}
 .client-tabs{display:none}
 .client-mobile-tab-select{display:block;width:100%;padding:10px 14px;border:1px solid var(--border-default);border-radius:10px;background:var(--surface-card-inner);color:var(--text);font-size:14px;font-weight:600}
}
.performance-traffic-head{margin-top:22px;padding:0 26px;display:flex;justify-content:space-between;align-items:flex-start;gap:20px}
.performance-traffic-head__content{flex:1}
.performance-traffic-head__content h3{font-size:16px;margin:0 0 4px;color:var(--text);font-weight:600}
.performance-traffic-head__content p{font-size:13px;color:var(--muted);margin:0}
.performance-traffic-head__action{margin:0;white-space:nowrap;flex-shrink:0}
@media(max-width:768px){
 .performance-traffic-head{flex-direction:column;align-items:stretch;gap:12px}
 .performance-traffic-head__action{width:100%}
}
@media(max-width:500px){.usuarios-summary-cards{grid-template-columns:repeat(2,1fr)}.section-subhead{flex-direction:column;align-items:flex-start;gap:8px}.section-subhead select,.section-subhead .segmented-control{width:100%}.section-subhead h3{word-break:break-word}.forecast-chart-wrap{grid-template-columns:48px 1fr}.forecast-bars{grid-template-columns:repeat(3,minmax(70px,1fr));gap:8px;padding:8px 4px 30px 12px}.forecast-bar-fill{width:32px}.manager-distribution-row{grid-template-columns:auto 1fr auto}.manager-distribution-bar{height:10px}.billing-page-table{min-width:auto}table{font-size:13px}table th,table td{padding:9px 8px;white-space:nowrap}.currency-grid{grid-template-columns:1fr}.currency-card{padding:12px}.metric-control-head{flex-direction:column;align-items:flex-start;gap:8px}.metric-control-head .segmented-control{width:100%;justify-content:flex-start}.attention-main{grid-template-columns:1fr;padding:11px;gap:10px;min-height:auto}.attention-main>.icon{margin-bottom:4px;width:32px;height:32px}.attention-main>div:nth-child(2){width:100%;min-width:0}.attention-main>div:nth-child(3){width:100%;justify-content:flex-start;flex-direction:column;gap:8px}.attention-reason{display:block;word-break:normal;overflow-wrap:normal;white-space:normal}.section-subhead h3{overflow:visible;text-overflow:clip;white-space:normal;width:100%}.section-subhead small{display:block;width:100%;word-break:normal;overflow-wrap:normal;white-space:normal;overflow:visible}.segmented-control{flex-wrap:wrap;width:100%!important}.segmented-control .segment{padding:6px 10px;font-size:12px}div[style*="overflow:auto"] table{min-width:100%;width:100%}.card.section{overflow:hidden;max-width:100vw}.card.section table{display:block;overflow-x:auto;overflow-y:visible;-webkit-overflow-scrolling:touch;width:100%;max-width:100%;min-width:0}.card.section>div[style*="overflow"]{overflow-x:auto;overflow-y:visible;max-width:100%;width:100%;-webkit-overflow-scrolling:touch}.card.section h3,.card.section h2{max-width:100%;overflow:visible;word-break:normal;white-space:normal;text-overflow:clip}.card.section small{display:block;max-width:100%;word-break:normal;white-space:normal;overflow:visible}.sidebar-user-profile{margin-bottom:8px}.profile-button{padding:8px 10px;font-size:12px}.profile-name{font-size:12px}.profile-company{font-size:10px}.profile-avatar{width:32px;height:32px;min-width:32px;font-size:12px}.menu-item small{font-size:10px}.menu-item strong{font-size:11px}.menu-logout{font-size:11px;padding:6px}}


/* FASE 4E.1B — Regras e Metas */
.rules-context-toolbar{display:flex;align-items:flex-end;gap:14px;flex-wrap:wrap;margin:18px 0}
.rules-context-switch{display:flex;gap:8px;flex-wrap:wrap}
.rules-context-button.active{border-color:var(--green);color:var(--green);background:rgba(110,231,183,.08)}
.rules-unit-field{min-width:260px;margin:0}
.rules-summary-card,.rules-targets-card{margin-top:16px}
.rules-metrics-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.rule-metric-card{padding:16px;border:1px solid var(--border-default);border-radius:12px;background:var(--surface-card-inner)}
.rule-metric-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.rule-metric-card h4{margin:0;font-size:16px}
.rule-metric-card>p{margin:8px 0 14px;color:var(--muted);font-size:12px}
.rule-origin-badge{padding:4px 8px;border:1px solid var(--border-default);border-radius:999px;color:var(--muted);font-size:10px;white-space:nowrap}
.rule-metric-card dl{display:grid;gap:8px;margin:0}
.rule-metric-card dl>div{display:flex;justify-content:space-between;gap:12px;padding-top:8px;border-top:1px solid var(--border-default)}
.rule-metric-card dt{color:var(--muted);font-size:12px}
.rule-metric-card dd{margin:0;font-weight:700}
.rules-targets-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.rules-target-item{display:grid;gap:6px;padding:16px;border:1px solid var(--border-default);border-radius:12px;background:var(--surface-card-inner)}
.rules-target-item span,.rules-target-item small{color:var(--muted);font-size:12px}
.rules-target-item strong{font-size:20px}
@media(max-width:1050px){.rules-metrics-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.rules-targets-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:650px){.rules-metrics-grid,.rules-targets-grid{grid-template-columns:1fr}.rules-context-switch{width:100%}.rules-context-button{flex:1}.rules-unit-field{width:100%;min-width:0}}


/* SGP — refinamento visual da Visão Geral e confirmação de exclusão */
.performance-traffic-head{
 margin-bottom:32px;
}

.performance-traffic-head__action{
 min-height:42px;
 padding:0 18px;
 border-radius:10px;
}

.performance-traffic-head__action:disabled{
 opacity:.52;
 background:linear-gradient(180deg,#25282b,#1a1d20);
 border:1px solid #383c40;
 color:#92979d;
 box-shadow:none;
}

.sgp-confirm-overlay{
 position:fixed;
 inset:0;
 z-index:5000;
 display:flex;
 align-items:center;
 justify-content:center;
 padding:20px;
 background:rgba(0,0,0,.72);
 backdrop-filter:blur(5px);
 opacity:0;
 transition:opacity .16s ease;
}

.sgp-confirm-overlay.open{
 opacity:1;
}

.sgp-confirm-dialog{
 width:min(460px,100%);
 display:grid;
 grid-template-columns:44px 1fr;
 gap:16px;
 padding:24px;
 border:1px solid rgba(255,255,255,.13);
 border-radius:16px;
 background:linear-gradient(180deg,#191c1f,#111416);
 box-shadow:0 28px 80px rgba(0,0,0,.58);
 transform:translateY(8px) scale(.985);
 transition:transform .16s ease;
}

.sgp-confirm-overlay.open .sgp-confirm-dialog{
 transform:translateY(0) scale(1);
}

.sgp-confirm-icon{
 width:44px;
 height:44px;
 display:grid;
 place-items:center;
 border-radius:12px;
 border:1px solid rgba(255,255,255,.14);
 background:rgba(255,255,255,.06);
 color:#e8e8e9;
 font-size:20px;
 font-weight:800;
}

.sgp-confirm-icon.danger{
 border-color:rgba(237,139,152,.32);
 background:rgba(237,139,152,.10);
 color:#ed8b98;
}

.sgp-confirm-copy h3{
 margin:1px 0 7px;
 color:#f4f4f5;
 font-size:17px;
 line-height:1.3;
}

.sgp-confirm-copy p{
 margin:0;
 color:#aeb2b7;
 font-size:13px;
 line-height:1.55;
}

.sgp-confirm-actions{
 grid-column:1/-1;
 display:flex;
 justify-content:flex-end;
 gap:10px;
 margin-top:6px;
 padding-top:18px;
 border-top:1px solid rgba(255,255,255,.08);
}

.sgp-confirm-actions .btn{
 min-width:104px;
 min-height:40px;
 padding:0 17px;
 border-radius:9px;
 font-size:13px;
 font-weight:700;
}

.sgp-confirm-actions .sgp-confirm-cancel{
 background:#171a1d;
 border-color:#383c40;
 color:#d9dcdf;
}

.sgp-confirm-actions .sgp-confirm-cancel:hover{
 background:#202428;
 border-color:#50555a;
}

.sgp-confirm-actions .sgp-confirm-accept.danger,
.sgp-confirm-actions .danger{
 background:linear-gradient(180deg,#d76575,#b84b5b);
 border-color:#dd7482;
 color:#fff;
 box-shadow:0 8px 20px rgba(184,75,91,.22);
}

.sgp-confirm-actions .danger:hover{
 background:linear-gradient(180deg,#e17584,#c35666);
 border-color:#e78894;
}

@media(max-width:600px){
 .performance-traffic-head{margin-bottom:24px}
 .sgp-confirm-dialog{grid-template-columns:38px 1fr;padding:20px}
 .sgp-confirm-icon{width:38px;height:38px}
 .sgp-confirm-actions{display:grid;grid-template-columns:1fr 1fr}
 .sgp-confirm-actions .btn{width:100%;min-width:0}
}


/* GPT — acabamento da página individual do cliente */
.client-title-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.client-title-row h1{margin:0}
.client-meta{gap:6px;margin-top:7px;align-items:center}
.client-meta span:not(.client-meta-status){padding:0;background:transparent;border:0;border-radius:0;color:var(--muted)}
.client-meta span:not(.client-meta-status)+span:not(.client-meta-status)::before{content:"·";margin-right:6px;color:var(--muted)}
.client-title-row .client-meta-status{font-size:11px;padding:5px 9px;border:1px solid currentColor;border-radius:999px;background:transparent}
.client-actions-menu{position:relative;flex:0 0 auto}
.client-actions-menu>summary{list-style:none}
.client-actions-menu>summary::-webkit-details-marker{display:none}
.client-actions-trigger{display:grid;place-items:center;width:40px;height:40px;border:1px solid var(--border-default);border-radius:10px;background:var(--surface-card-inner);color:var(--text);cursor:pointer;font-size:18px;letter-spacing:2px}
.client-actions-popover{position:absolute;z-index:80;top:calc(100% + 8px);right:0;min-width:170px;padding:6px;border:1px solid var(--border-default);border-radius:10px;background:var(--surface-elevated,#171a1d);box-shadow:0 16px 40px rgba(0,0,0,.35)}
.client-actions-popover button{width:100%;padding:10px 12px;border:0;border-radius:7px;background:transparent;color:var(--text);text-align:left;cursor:pointer}
.client-actions-popover button:hover{background:rgba(255,255,255,.06)}
.performance-last-update{display:block;margin-top:7px;color:var(--muted);font-size:11px}
.performance-traffic-head{margin:18px 0 14px;padding:0;align-items:center}
.performance-traffic-head__content h3{font-size:17px}
.performance-traffic-head__action{min-height:38px;padding:0 14px}
.client-kpis{grid-template-columns:repeat(6,minmax(0,1fr));gap:10px}
.client-kpis .kpi{min-height:112px;padding:14px;border-radius:12px}
.client-kpis .kpi small{font-size:11px;margin-bottom:8px}
.client-kpis .kpi strong{font-size:21px;line-height:1.1}
.client-kpis .metric-rule-status{font-size:10px;line-height:1.35;margin-top:10px}
.client-analysis-section-title{margin:24px 0 10px;padding:0}
.client-analysis-section-title h3{font-size:16px;margin:0;color:var(--text);font-weight:600}
.client-tabs-container{margin-bottom:16px}
.client-mobile-tab-select{display:none!important}

@media(max-width:1200px){
 .client-kpis{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:768px){
 .client-page-header{padding-bottom:10px}
 .client-header-content{flex-direction:row;align-items:flex-start;flex-wrap:nowrap}
 .client-header-info{min-width:0}
 .client-page-header h1{font-size:24px}
 .client-breadcrumb{font-size:10px}
 .client-actions-trigger{width:38px;height:38px}
 .client-actions-popover{position:fixed;left:12px;right:12px;top:auto;bottom:calc(12px + env(safe-area-inset-bottom));min-width:0}
 .client-tabs-container{margin:0 -16px 14px;padding:0;border-bottom:1px solid var(--border-default)}
 .client-tabs{display:flex;padding:0 16px;overflow-x:auto;scrollbar-width:none}
 .client-tabs::-webkit-scrollbar{display:none}
 .client-tab{display:block;padding:12px 13px;font-size:12px}
 .performance-traffic-head{flex-direction:column;align-items:stretch;gap:12px;padding:0;margin:16px 0 12px}
 .performance-traffic-head__action{width:100%}
 .client-kpis{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 .client-kpis .kpi{min-height:96px;padding:12px}
 .client-kpis .kpi strong{font-size:18px}
}
@media(max-width:430px){
 .client-meta{font-size:11px}
 .client-title-row{gap:8px}
 .client-title-row .client-meta-status{font-size:10px;padding:4px 8px}
 .client-kpis{grid-template-columns:1fr 1fr}
}


/* EVOLORA — Fase Unidades: visão executiva e responsiva */
.units-page-head{align-items:flex-start}
.units-overview-section{padding:0;overflow:hidden}
.units-overview-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border-bottom:1px solid var(--border-default)}
.units-overview-item{padding:18px 20px;min-width:0}
.units-overview-item+ .units-overview-item{border-left:1px solid var(--border-default)}
.units-overview-item small{display:block;color:var(--muted);font-size:12px;margin-bottom:6px}
.units-overview-item strong{font-size:24px;line-height:1;color:var(--text)}
.units-list-section{overflow:visible}
.units-summary-table{width:100%;border-collapse:collapse;font-size:13px;min-width:900px}
.units-summary-table th{padding:12px 10px;text-align:left;color:var(--muted);font-weight:600;border-bottom:1px solid var(--border-default)}
.units-summary-table th:not(:first-child){text-align:right}
.units-summary-table td{padding:13px 10px;border-bottom:1px solid var(--border-default);vertical-align:middle}
.units-summary-table td.numeric{text-align:right;white-space:nowrap}
.units-summary-table td.actions-cell{width:46px;text-align:right;overflow:visible}
.unit-status{display:inline-flex;align-items:center;gap:6px;font-size:11px;font-weight:600;padding:5px 8px;border-radius:8px;border:1px solid currentColor;white-space:nowrap}
.unit-status::before{content:"";width:5px;height:5px;border-radius:50%;background:currentColor}
.unit-status.green{color:var(--status-healthy)}
.unit-status.yellow{color:var(--status-attention)}
.unit-status.red{color:var(--status-critical)}
.unit-status.neutral{color:var(--muted)}
.unit-actions-menu{position:relative;display:inline-block}
.unit-actions-menu>summary{list-style:none}
.unit-actions-menu>summary::-webkit-details-marker{display:none}
.unit-actions-trigger{display:grid;place-items:center;width:34px;height:32px;border:1px solid var(--border-default);border-radius:8px;background:var(--surface-card-inner);cursor:pointer;letter-spacing:2px}
.unit-actions-popover{position:absolute;z-index:120;right:0;top:calc(100% + 6px);min-width:170px;padding:6px;border:1px solid var(--border-default);border-radius:10px;background:var(--surface-elevated,#171a1d);box-shadow:0 16px 40px rgba(0,0,0,.4)}
.unit-actions-popover button{display:block;width:100%;border:0;background:transparent;color:var(--text);padding:9px 10px;border-radius:7px;text-align:left;cursor:pointer;font-size:13px}
.unit-actions-popover button:hover{background:rgba(255,255,255,.06)}
.unit-actions-popover .danger-text{color:#ff8d9e}
.units-mobile-list{display:none}
.units-status-note{margin:12px 0 0;color:var(--muted);font-size:12px}
.units-modal-box{width:min(560px,calc(100vw - 32px));max-height:calc(100dvh - 32px);padding:0;display:flex;flex-direction:column;overflow:hidden}
.units-modal-head{padding:18px 20px;margin:0;border-bottom:1px solid var(--border-default)}
.units-modal-head h3{margin:0 0 4px;font-size:18px}
.units-modal-head p{margin:0;color:var(--muted);font-size:12px}
.units-modal-body{padding:18px 20px;overflow-y:auto}
.units-modal-create{padding-bottom:20px;border-bottom:1px solid var(--border-default)}
.units-modal-type{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px;padding:10px 12px;border:1px solid var(--border-default);border-radius:9px;background:var(--surface-card-inner)}
.units-modal-type small{color:var(--muted)}
.units-modal-create>label{display:block;color:var(--muted);font-size:12px;margin-bottom:6px}
.units-modal-add-row{display:flex;gap:8px}
.units-modal-add-row input{flex:1;min-width:0;padding:10px 12px;border:1px solid var(--border-default);border-radius:9px;background:#111417;color:var(--text)}
.units-modal-existing h4{margin:18px 0 8px;font-size:13px;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
.units-modal-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 0;border-bottom:1px solid var(--border-default)}
.units-modal-row strong{display:block;font-size:13px}
.units-modal-row small{display:block;margin-top:3px;color:var(--muted);font-size:11px}
.unit-modal-delete{border:0;background:transparent;color:#ff8d9e;cursor:pointer;padding:7px 9px;border-radius:7px}
.unit-modal-delete:hover{background:rgba(255,109,130,.09)}
.units-modal-empty{color:var(--muted);font-size:12px}
.units-modal-actions{padding:12px 20px;margin:0;border-top:1px solid var(--border-default)}
.units-modal-actions .btn{width:100%}
@media(max-width:900px){.units-overview-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.units-overview-item:nth-child(3){border-left:0;border-top:1px solid var(--border-default)}.units-overview-item:nth-child(4){border-top:1px solid var(--border-default)}}
@media(max-width:700px){
 .units-page-head{gap:12px}.units-page-head .btn{width:100%}
 .units-overview-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.units-overview-item{padding:14px}.units-overview-item strong{font-size:20px}
 .units-desktop-table{display:none}.units-mobile-list{display:grid;gap:10px}
 .unit-mobile-card{padding:14px;border:1px solid var(--border-default);border-radius:12px;background:var(--surface-card-inner)}
 .unit-mobile-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:14px}.unit-mobile-head>div:first-child{display:flex;align-items:center;gap:8px;min-width:0}.unit-mobile-head strong{font-size:15px;overflow:hidden;text-overflow:ellipsis}.unit-mobile-head .unit-status{font-size:10px;padding:4px 7px}
 .unit-mobile-metrics{display:grid;grid-template-columns:1fr 1fr;gap:12px 16px}.unit-mobile-metrics small{display:block;color:var(--muted);font-size:10px;margin-bottom:3px}.unit-mobile-metrics span{font-size:13px;font-weight:600}
 .unit-actions-popover{position:fixed;left:12px;right:12px;top:auto;bottom:calc(12px + env(safe-area-inset-bottom));min-width:0}
 .units-modal-add-row{flex-direction:column}.units-modal-add-row .btn{width:100%}
}


/* EVOLORA — Fase Unidades 2B.1: criação focada e ações fora dos cards */
.units-modal-box{width:min(500px,calc(100vw - 32px))}
.units-modal-eyebrow{display:block;margin-bottom:5px;color:var(--brand-primary);font-size:10px;font-weight:700;letter-spacing:.08em;text-transform:uppercase}
.units-modal-body{padding:22px 20px}
.units-modal-context{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:20px;padding:11px 12px;border:1px solid var(--border-default);border-radius:10px;background:var(--surface-card-inner)}
.units-modal-context span{color:var(--muted);font-size:12px}
.units-modal-context strong{font-size:13px}
.units-modal-body>label{display:block;margin-bottom:7px;color:var(--text);font-size:12px;font-weight:600}
.units-modal-body>input{width:100%;padding:12px 13px;border:1px solid var(--border-default);border-radius:10px;background:#111417;color:var(--text);font-size:14px}
.units-modal-body>input:focus{outline:none;border-color:var(--brand-primary);box-shadow:0 0 0 3px rgba(101,224,167,.1)}
.units-modal-help{margin:9px 0 0;color:var(--muted);font-size:11px;line-height:1.45}
.units-modal-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.units-modal-actions .btn{width:auto}
.unit-actions-trigger{display:grid;place-items:center;width:34px;height:32px;border:1px solid var(--border-default);border-radius:8px;background:var(--surface-card-inner);color:var(--text);cursor:pointer;letter-spacing:2px}
.unit-actions-overlay{position:fixed;inset:0;z-index:2400;display:flex;align-items:center;justify-content:center;padding:20px;background:rgba(0,0,0,.68);opacity:0;transition:opacity .14s ease}
.unit-actions-overlay.open{opacity:1}
.unit-actions-sheet{width:min(360px,calc(100vw - 32px));padding:16px;border:1px solid var(--border-default);border-radius:16px;background:var(--surface-elevated,#171a1d);box-shadow:0 24px 70px rgba(0,0,0,.55)}
.unit-actions-sheet-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding-bottom:13px;border-bottom:1px solid var(--border-default)}
.unit-actions-sheet-head small{display:block;margin-bottom:4px;color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.06em}
.unit-actions-sheet-head h3{margin:0;font-size:17px}
.unit-actions-sheet-close{display:grid;place-items:center;width:34px;height:34px;border:1px solid var(--border-default);border-radius:9px;background:transparent;color:var(--text);cursor:pointer}
.unit-actions-sheet-list{display:grid;gap:4px;padding:10px 0}
.unit-actions-sheet-list button{width:100%;padding:11px 12px;border:0;border-radius:9px;background:transparent;color:var(--text);text-align:left;cursor:pointer;font-size:13px}
.unit-actions-sheet-list button:hover{background:rgba(255,255,255,.06)}
.unit-actions-sheet-list .danger-text{color:#ff8d9e}
.unit-actions-sheet-cancel{width:100%}
@media(max-width:700px){
 .units-modal-actions{grid-template-columns:1fr}
 .unit-actions-overlay{align-items:flex-end;padding:12px 12px calc(12px + env(safe-area-inset-bottom))}
 .unit-actions-sheet{width:100%;border-radius:16px}
}

/* EVOLORA — Fase Visual 2C: Vendas e Faturamento */
.sales-page-head{align-items:flex-end}
.sales-page-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.sales-workspace{padding:0;overflow:hidden}
.sales-view-tabs{display:flex;gap:18px;padding:0 18px;border-bottom:1px solid var(--border-default)}
.sales-view-tab{appearance:none;border:0;background:transparent;color:var(--muted);padding:16px 2px 14px;font:inherit;font-weight:700;cursor:pointer;border-bottom:2px solid transparent}
.sales-view-tab.active{color:var(--green);border-bottom-color:var(--green)}
.sales-view-tab-note{font-weight:500;color:inherit}
.sales-workspace .sales-summary-grid{padding:16px 18px 4px;margin-bottom:8px}
.sales-summary-card{min-height:94px;display:flex;flex-direction:column;justify-content:center}
.sales-summary-card span{display:block;color:var(--muted);font-size:12px;margin-top:4px}
.sales-view-panel{display:none;padding:12px 18px 18px}
.sales-view-panel.active{display:block}
.sales-list-head,.billing-list-head{margin:2px 0 12px}
.sales-table-wrap{overflow:auto;border:1px solid var(--border-default);border-radius:12px}
.sales-table{min-width:1040px}
.sales-table td,.sales-table th{vertical-align:middle}
.sale-currency-line{display:grid;grid-template-columns:auto 1fr;align-items:center;gap:8px}
.sale-currency-line b{font-size:11px;padding:4px 6px;border-radius:6px;background:var(--surface-card-inner);border:1px solid var(--border-default)}
.sale-billing-pill{display:inline-flex;padding:5px 8px;border-radius:7px;background:var(--surface-card-inner);border:1px solid var(--border-default);white-space:nowrap}
.sale-note-preview{display:block;max-width:190px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sale-row-actions{min-width:38px;padding:7px 9px}
.billing-overview-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:18px}
.billing-overview-card{padding:14px;border-radius:12px;border:1px solid var(--border-default);background:var(--surface-card-inner)}
.billing-overview-card small{display:block;color:var(--muted);margin-bottom:7px}
.billing-overview-card strong{font-size:18px}
.billing-agenda-list{display:grid;gap:12px}
.billing-month-group{border:1px solid var(--border-default);border-radius:12px;background:var(--surface-card-inner);overflow:hidden}
.billing-month-group summary{cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 16px;list-style:none}
.billing-month-group summary::-webkit-details-marker{display:none}
.billing-month-group summary div{display:grid;gap:3px}.billing-month-group summary span{font-size:12px;color:var(--muted)}
.billing-month-rows{border-top:1px solid var(--border-default)}
.billing-agenda-row{display:grid;grid-template-columns:1.2fr 1fr .85fr 1.1fr auto;gap:16px;align-items:center;padding:12px 16px;border-bottom:1px solid var(--border-default)}
.billing-agenda-row:last-child{border-bottom:0}.billing-agenda-row>div{display:grid;gap:3px}.billing-agenda-row span,.billing-agenda-row small{font-size:11px;color:var(--muted)}
.sale-actions-modal-box{width:min(480px,calc(100vw - 32px));padding:20px}
.sale-actions-eyebrow{display:block;color:var(--muted);font-size:10px;font-weight:800;letter-spacing:.08em;margin-bottom:5px}
.sale-actions-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:14px 0}
.sale-actions-summary>div{display:grid;gap:3px;padding:10px;border:1px solid var(--border-default);border-radius:10px;background:var(--surface-card-inner)}
.sale-actions-summary span{font-size:11px;color:var(--muted)}
.sale-actions-list{display:grid;border-top:1px solid var(--border-default);border-bottom:1px solid var(--border-default);margin-bottom:14px}
.sale-action-item{appearance:none;border:0;background:transparent;color:var(--text);text-align:left;padding:14px 2px;display:grid;gap:4px;cursor:pointer;border-bottom:1px solid var(--border-default)}
.sale-action-item:last-child{border-bottom:0}.sale-action-item span{font-size:12px;color:var(--muted)}.sale-action-item.danger strong{color:var(--red)}
@media(max-width:900px){.billing-overview-grid{grid-template-columns:repeat(2,1fr)}.billing-agenda-row{grid-template-columns:1fr 1fr}.billing-agenda-row .icon-btn{justify-self:end}}
@media(max-width:700px){
 .sales-page-head{align-items:stretch}.sales-page-actions{display:grid;grid-template-columns:1fr auto;width:100%}
 .sales-workspace{margin-left:0!important;margin-right:0!important}
 .sales-view-tabs{overflow-x:auto;white-space:nowrap}.sales-workspace .sales-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr));padding:14px}.sales-summary-card{min-height:82px;padding:11px}.sales-summary-card strong{font-size:16px}
 .sales-view-panel{padding:10px 14px 16px}.billing-overview-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .billing-agenda-row{grid-template-columns:1fr 1fr;gap:10px;padding:12px}.billing-agenda-row .icon-btn{grid-column:2;justify-self:end}
 .sale-actions-modal-box{align-self:flex-end;width:100%;max-width:none;border-radius:18px 18px 0 0;margin:-20px;padding-bottom:calc(20px + env(safe-area-inset-bottom))}
}

/* Fase Visual 2C.1 — tabela de faturamentos + modal de ações */
.billing-overview-card span{display:block;margin-top:5px;color:var(--muted);font-size:11px}
.billing-table{min-width:1120px}
.sale-actions-modal-box{width:min(430px,calc(100vw - 32px));padding:0;overflow:hidden}
.sale-actions-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:20px 20px 16px;border-bottom:1px solid var(--border-default)}
.sale-actions-header h3{margin:0;font-size:20px}
.sale-actions-header .icon-btn{min-width:40px;min-height:40px}
.sale-actions-summary{display:flex;flex-direction:column;gap:5px;margin:0;padding:18px 20px;background:var(--surface-card-inner);border-bottom:1px solid var(--border-default)}
.sale-actions-value{font-size:24px;line-height:1.1}
.sale-actions-meta,.sale-actions-billing{font-size:12px;color:var(--muted)}
.sale-actions-list{display:grid;margin:0;padding:8px 12px;border:0}
.sale-action-item{grid-template-columns:38px 1fr;align-items:center;gap:12px;padding:13px 10px;border:0;border-radius:10px}
.sale-action-item:hover{background:var(--surface-hover)}
.sale-action-item+.sale-action-item{margin-top:4px}
.sale-action-item>span:last-child{display:grid;gap:3px}
.sale-action-item strong{font-size:14px}
.sale-action-item small{font-size:11px;color:var(--muted)}
.sale-action-icon{display:grid;place-items:center;width:34px;height:34px;border-radius:9px;background:var(--surface-card-inner);border:1px solid var(--border-default);font-size:18px;color:var(--text)}
.sale-action-item.danger .sale-action-icon{color:var(--red);border-color:rgba(255,111,128,.28);background:rgba(255,111,128,.07)}
.sale-actions-footer{padding:14px 20px 18px;border-top:1px solid var(--border-default)}
.sale-actions-footer .btn{width:100%}
@media(max-width:700px){
 .billing-table{min-width:1080px}
 .sale-actions-modal-box{align-self:flex-end;width:100%;max-width:none;border-radius:18px 18px 0 0;margin:-20px;padding-bottom:env(safe-area-inset-bottom)}
}

/* EVOLORA — Fase Visual 2D: Critérios de Performance */
.criteria-page-head{margin-bottom:18px}
.criteria-context-card{display:grid;grid-template-columns:minmax(0,1fr) minmax(280px,420px);gap:24px;align-items:center;padding:18px 20px;border:1px solid var(--border-default);border-radius:14px;background:var(--surface-card-inner);margin-bottom:14px}
.criteria-context-copy{display:grid;gap:5px}
.criteria-context-copy strong{font-size:17px;color:var(--text)}
.criteria-context-copy p{margin:0;color:var(--muted);font-size:13px;line-height:1.5}
.criteria-eyebrow{font-size:10px;font-weight:800;letter-spacing:.1em;text-transform:uppercase;color:var(--muted)}
.criteria-context-field{display:grid;gap:7px;margin:0}
.criteria-context-field label{font-size:12px;font-weight:700;color:var(--muted)}
.criteria-context-field select{width:100%;min-height:44px;padding:0 13px;border:1px solid var(--border-default);border-radius:10px;background:#111417;color:var(--text);font-weight:650}
.criteria-classification-guide{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:16px}
.criteria-classification-guide>div{display:grid;grid-template-columns:auto 1fr;column-gap:9px;row-gap:2px;align-items:center;padding:12px 14px;border:1px solid var(--border-default);border-radius:12px;background:rgba(255,255,255,.018)}
.criteria-classification-guide strong{font-size:13px}
.criteria-classification-guide small{grid-column:2;color:var(--muted);line-height:1.4}
.criteria-status-dot{width:8px;height:8px;border-radius:50%;display:inline-block}
.criteria-status-dot.healthy{background:var(--green)}
.criteria-status-dot.attention{background:var(--yellow)}
.criteria-status-dot.critical{background:var(--red)}
.criteria-rules-card{margin-top:0}
.criteria-rules-head{align-items:flex-start}
.criteria-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.rules-loading-container{grid-column:1/-1;padding:28px;text-align:center;color:var(--muted)}
.criteria-metric-card{display:flex;flex-direction:column;gap:12px;min-height:250px;padding:18px}
.criteria-metric-card .rule-metric-head{align-items:flex-start}
.criteria-metric-card .rule-metric-head h4{font-size:17px}
.criteria-metric-card .rule-metric-head small{display:block;margin-top:3px;color:var(--muted);font-size:11px}
.criteria-card-statuses{display:flex;gap:6px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.criteria-active-badge,.rule-origin-badge{display:inline-flex;align-items:center;min-height:24px;padding:3px 8px;border-radius:999px;font-size:10px;font-weight:750;white-space:nowrap}
.criteria-active-badge.active{color:var(--green);border:1px solid rgba(110,231,183,.4);background:rgba(110,231,183,.08)}
.criteria-active-badge.inactive{color:var(--muted);border:1px solid var(--border-default);background:rgba(255,255,255,.025)}
.rule-origin-badge.unit{color:#c4b5fd;border-color:rgba(167,139,250,.35);background:rgba(139,92,246,.08)}
.rule-origin-badge.client{color:var(--muted)}
.criteria-direction{margin:0!important;color:var(--muted);font-size:12px;line-height:1.45}
.criteria-bands{display:grid;gap:8px;margin-top:auto}
.criteria-band{display:grid;grid-template-columns:auto 1fr;align-items:center;gap:12px;padding:10px 11px;border-radius:9px;background:rgba(255,255,255,.02);border-left:3px solid var(--border-default)}
.criteria-band span{font-size:11px;font-weight:700;color:var(--muted)}
.criteria-band strong{text-align:right;font-size:12px;font-weight:750}
.criteria-band.healthy{border-left-color:var(--green)}
.criteria-band.attention{border-left-color:var(--yellow)}
.criteria-band.critical{border-left-color:var(--red)}
.criteria-no-bands{padding:14px;border:1px dashed var(--border-default);border-radius:9px;color:var(--muted);font-size:12px;text-align:center}
.criteria-edit-modal{width:min(680px,calc(100vw - 32px));padding:0;overflow:hidden}
.criteria-modal-head{padding:20px 22px 16px;border-bottom:1px solid var(--border-default)}
.criteria-modal-head h3{margin:3px 0 2px;font-size:22px}
.criteria-modal-head p{margin:0;color:var(--muted);font-size:12px}
.criteria-modal-body{display:grid;gap:16px;padding:20px 22px;max-height:calc(100dvh - 220px);overflow-y:auto}
.criteria-modal-body .field{margin:0}
.criteria-field-help{display:block;margin-top:6px;color:var(--muted);font-size:11px;line-height:1.4}
.criteria-threshold-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.criteria-preview{display:grid;gap:9px;padding:14px;border:1px solid var(--border-default);border-radius:11px;background:rgba(255,255,255,.018)}
.criteria-preview>strong{font-size:12px}
.criteria-preview>span{color:var(--muted);font-size:12px}
.criteria-preview>div{display:grid;gap:6px}
.criteria-preview>div>span{font-size:12px;color:var(--text)}
.criteria-preview>div>span.healthy b{color:var(--green)}
.criteria-preview>div>span.attention b{color:var(--yellow)}
.criteria-preview>div>span.critical b{color:var(--red)}
.criteria-modal-error{display:none;color:var(--red);font-size:12px}
.criteria-modal-actions{padding:15px 22px;border-top:1px solid var(--border-default);margin:0}

@media(max-width:900px){
 .criteria-context-card{grid-template-columns:1fr}
 .criteria-classification-guide{grid-template-columns:1fr}
 .criteria-metric-card{min-height:auto}
}
@media(max-width:650px){
 .criteria-context-card{padding:15px}
 .criteria-rules-head{flex-direction:column;gap:12px}
 .criteria-actions,.criteria-actions .btn{width:100%}
 .criteria-threshold-grid{grid-template-columns:1fr}
 .criteria-classification-guide small{font-size:11px}
 .criteria-metric-card{padding:15px}
 .criteria-band{grid-template-columns:1fr;gap:3px}
 .criteria-band strong{text-align:left}
 .criteria-edit-modal{width:calc(100vw - 20px);max-height:calc(100dvh - 20px)}
 .criteria-modal-body{max-height:calc(100dvh - 200px);padding:16px}
 .criteria-modal-head,.criteria-modal-actions{padding-left:16px;padding-right:16px}
}

/* Fase Visual 2D.1 — origem dos critérios mais explícita */
.criteria-context-state{display:flex;align-items:center;gap:8px;margin-top:2px}
.criteria-context-state b{font-size:13px;color:var(--text)}
.criteria-context-state-dot{width:9px;height:9px;border-radius:50%;display:inline-block;background:var(--muted)}
.criteria-context-state-dot.client{background:var(--green)}
.criteria-context-state-dot.inherited{background:var(--green)}
.criteria-context-state-dot.unit{background:var(--yellow)}
.criteria-context-state-dot.mixed{background:#8aa5ff}
.criteria-context-impact{display:block;margin-top:2px;color:var(--muted);font-size:11px;line-height:1.45}
.criteria-context-field small{color:var(--muted);font-size:11px;line-height:1.4}
.criteria-use-client-btn[disabled]{opacity:.62;cursor:not-allowed}
.criteria-card-statuses .rule-origin-badge{display:none!important}
@media(max-width:700px){
 .criteria-context-state{align-items:flex-start}
 .criteria-context-state-dot{margin-top:4px;flex:0 0 auto}
}


/* Fase Mobile 2E — Vendas/Faturamento e mês do cliente */
.client-month-filter-mobile{display:none}
@media(max-width:700px){
  .client-header-period-row{display:grid;grid-template-columns:1fr;gap:10px;align-items:stretch}
  .client-header-period-row .reference-period-badge{display:none}
  .client-month-filter-mobile{display:block;width:100%;min-width:0;height:44px;padding:0 40px 0 14px;border:1px solid var(--border-default);border-radius:12px;background:var(--surface-card-inner);color:var(--text);font:inherit;font-weight:700}

  .sales-page-actions{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:10px;width:100%}
  .sales-page-actions select,.sales-page-actions .btn{width:100%;min-width:0;max-width:100%}
  .sales-page-actions .btn{white-space:normal;text-align:center;justify-content:center}

  .sales-workspace{width:100%;max-width:100%;overflow:hidden}
  .sales-view-tabs{gap:12px;padding:0 14px;max-width:100%;scrollbar-width:none}
  .sales-view-tabs::-webkit-scrollbar{display:none}
  .sales-view-tab{flex:0 0 auto;padding:14px 0 12px;font-size:13px}
  .sales-workspace .sales-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:12px}
  .sales-summary-card{min-width:0;min-height:88px;padding:11px}
  .sales-summary-card small,.sales-summary-card span{overflow-wrap:anywhere}
  .sales-summary-card strong{font-size:16px;overflow-wrap:anywhere}
}
@media(max-width:390px){
  .sales-workspace .sales-summary-grid{grid-template-columns:1fr}
}

/* Fase Mobile 2E.1 — corrige recorte lateral em Vendas e Faturamento.
   O scroll vertical do shell ocupa parte da borda direita em alguns
   navegadores mobile/emulação. Mantemos uma área segura e impedimos que
   qualquer descendente da aba force largura acima do conteúdo disponível. */
@media (max-width:700px){
  main{
    padding-right:calc(24px + env(safe-area-inset-right));
    scrollbar-gutter:stable;
  }

  .client-tabs-content,
  .client-tab-pane[data-tab="vendas-faturamento"],
  .client-tab-pane[data-tab="vendas-faturamento"] > *,
  .sales-page-head,
  .sales-page-actions,
  .sales-workspace,
  .sales-view-tabs,
  .sales-summary-grid,
  .sales-view-panel{
    min-width:0;
    max-width:100%;
  }

  .client-tab-pane[data-tab="vendas-faturamento"]{
    width:100%;
    overflow-x:clip;
  }

  .sales-page-head,
  .sales-workspace{
    width:100%;
    margin-left:0!important;
    margin-right:0!important;
  }

  .sales-page-actions{
    box-sizing:border-box;
  }

  .sales-page-actions select,
  .sales-page-actions .btn{
    box-sizing:border-box;
    margin:0;
  }

  .sales-workspace .sales-summary-grid{
    width:100%;
    box-sizing:border-box;
  }
}


/* FASE VISUAL — Usuários e Permissões: hierarquia e regras por função */
.usuarios-access-guide{margin:16px 0;padding:18px;border:1px solid var(--border-default);border-radius:14px;background:linear-gradient(180deg,rgba(255,255,255,.025),rgba(255,255,255,.012))}
.usuarios-access-guide-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:14px}
.usuarios-access-guide-head h3{margin:3px 0 0;font-size:16px}
.usuarios-eyebrow{color:var(--muted);font-size:10px;font-weight:800;letter-spacing:.12em}
.usuarios-guide-highlight{display:inline-flex;align-items:center;min-height:28px;padding:5px 10px;border:1px solid rgba(110,231,183,.28);border-radius:999px;background:rgba(110,231,183,.07);color:var(--green);font-size:11px;font-weight:700;white-space:nowrap}
.usuarios-access-guide-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.usuarios-access-guide-grid article{min-width:0;padding:12px;border:1px solid var(--border-subtle);border-radius:10px;background:var(--surface-card-inner)}
.usuarios-access-guide-grid article.is-configurable{border-color:rgba(110,231,183,.32);background:rgba(110,231,183,.045)}
.usuarios-access-guide-grid strong,.usuarios-access-guide-grid span{display:block}
.usuarios-access-guide-grid strong{margin-bottom:4px;font-size:13px;color:var(--text)}
.usuarios-access-guide-grid span{font-size:11px;line-height:1.45;color:var(--muted)}
.usuarios-fixed-access-summary{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:20px}
.usuarios-fixed-access-summary[hidden]{display:none!important}
.usuarios-fixed-access-summary>div{padding:13px;border:1px solid var(--border-default);border-radius:10px;background:var(--surface-card-inner)}
.usuarios-fixed-access-summary small,.usuarios-fixed-access-summary strong{display:block}
.usuarios-fixed-access-summary small{margin-bottom:4px;color:var(--muted);font-size:11px}
.usuarios-fixed-access-summary strong{font-size:13px;color:var(--text)}
.usuarios-actions-menu{position:relative}
.usuarios-actions-menu summary{list-style:none;display:grid;place-items:center;width:36px;height:34px;border:1px solid var(--border-default);border-radius:9px;cursor:pointer;font-weight:800;letter-spacing:2px}
.usuarios-actions-menu summary::-webkit-details-marker{display:none}
.usuarios-actions-popover{position:absolute;right:0;top:calc(100% + 6px);z-index:40;min-width:180px;padding:6px;border:1px solid var(--border-default);border-radius:10px;background:var(--surface-card);box-shadow:0 16px 40px rgba(0,0,0,.42)}
.usuarios-menu-action{display:block;width:100%;padding:9px 10px;border:0;border-radius:7px;background:transparent;color:var(--text);font:inherit;font-size:12px;text-align:left;cursor:pointer}
.usuarios-menu-action:hover{background:rgba(255,255,255,.055)}
.usuarios-menu-action.danger-text{color:var(--red)}
.usuarios-action-note{font-size:11px;color:var(--muted)}
@media(max-width:1100px){.usuarios-access-guide-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){
 .usuarios-access-guide{padding:14px}
 .usuarios-access-guide-head{flex-direction:column;align-items:flex-start}
 .usuarios-access-guide-grid{grid-template-columns:1fr}
 .usuarios-guide-highlight{white-space:normal}
 .usuarios-fixed-access-summary{grid-template-columns:1fr}
 .usuarios-actions-popover{position:fixed;left:16px;right:16px;top:auto;bottom:16px;min-width:0;z-index:1400}
}


/* GPT — correção de layout Usuários e Permissões / Convites */
#usuarios .usuarios-summary-cards{
 display:grid;
 grid-template-columns:repeat(5,minmax(0,1fr));
 gap:14px;
 margin-top:16px;
}
#usuarios .usuarios-summary-cards>.card{
 min-width:0;
 min-height:112px;
}

#usuarios .usuarios-invites-section,
#usuarios .usuarios-history-section{
 overflow:hidden;
}

#usuarios .usuarios-history-section>summary{
 list-style:none;
 display:flex;
 align-items:center;
 justify-content:space-between;
 gap:18px;
 cursor:pointer;
 padding:0;
 outline:none;
 border:0;
 background:transparent;
 color:var(--text);
}
#usuarios .usuarios-history-section>summary::-webkit-details-marker{display:none}
#usuarios .usuarios-history-section>summary:focus,
#usuarios .usuarios-history-section>summary:focus-visible{
 outline:none;
 box-shadow:none;
}
#usuarios .usuarios-history-section>summary::after{
 content:"⌄";
 flex:0 0 auto;
 color:var(--muted);
 font-size:18px;
 transition:transform .18s ease;
}
#usuarios .usuarios-history-section[open]>summary{
 margin-bottom:16px;
 padding-bottom:16px;
 border-bottom:1px solid var(--line);
}
#usuarios .usuarios-history-section[open]>summary::after{transform:rotate(180deg)}
#usuarios .usuarios-history-section>summary>span{
 margin-left:auto;
 margin-right:8px;
 color:var(--muted);
 font-size:12px;
 white-space:nowrap;
}

#usuarios #convitesTableContainer,
#usuarios #convitesHistoryTableContainer{
 display:block;
 width:100%;
 overflow-x:auto;
 -webkit-overflow-scrolling:touch;
}
#usuarios #convitesCardsContainer,
#usuarios #convitesHistoryCardsContainer{
 display:none;
}
#usuarios #convitesTable,
#usuarios #convitesHistoryTableContainer table{
 width:100%;
 min-width:760px;
 table-layout:auto;
}
#usuarios .convite-pending-actions{
 display:flex;
 align-items:center;
 gap:8px;
 flex-wrap:wrap;
}
#usuarios .convite-pending-actions .btn{
 min-height:36px;
 white-space:nowrap;
}

#usuarios .convite-card{
 display:grid;
 gap:12px;
 padding:14px;
 border:1px solid var(--border-default);
 border-radius:12px;
 background:var(--surface-card-inner);
}
#usuarios .convite-card+.convite-card{margin-top:10px}
#usuarios .convite-card-head{
 display:flex;
 align-items:flex-start;
 justify-content:space-between;
 gap:12px;
 min-width:0;
}
#usuarios .convite-card-head>div{min-width:0}
#usuarios .convite-card-head strong,
#usuarios .convite-card-head small{display:block}
#usuarios .convite-card-head strong{font-size:13px;color:var(--text)}
#usuarios .convite-card-head small{
 margin-top:3px;
 color:var(--muted);
 font-size:11px;
 overflow-wrap:anywhere;
}
#usuarios .convite-card-meta{
 display:flex;
 justify-content:space-between;
 gap:12px;
 color:var(--muted);
 font-size:12px;
}

@media(max-width:1350px){
 #usuarios .usuarios-summary-cards{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:900px){
 #usuarios .usuarios-summary-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:768px){
 #usuarios #convitesTableContainer,
 #usuarios #convitesHistoryTableContainer{display:none!important}
 #usuarios #convitesCardsContainer,
 #usuarios #convitesHistoryCardsContainer{display:block}
 #usuarios .usuarios-invites-section,
 #usuarios .usuarios-history-section{padding:16px}
 #usuarios .usuarios-history-section>summary{
  align-items:flex-start;
  flex-wrap:wrap;
 }
 #usuarios .usuarios-history-section>summary>span{margin-left:0;margin-right:auto}
 #usuarios .convite-pending-actions{display:grid;grid-template-columns:1fr 1fr}
 #usuarios .convite-pending-actions .btn{width:100%;min-width:0}
}
@media(max-width:520px){
 #usuarios .usuarios-summary-cards{grid-template-columns:1fr 1fr;gap:10px}
 #usuarios .usuarios-summary-cards>.card{min-height:96px;padding:14px}
 #usuarios .convite-card-meta{flex-direction:column;gap:5px}
}
@media(max-width:380px){
 #usuarios .usuarios-summary-cards{grid-template-columns:1fr}
 #usuarios .convite-pending-actions{grid-template-columns:1fr}
}


/* PERFIL E MULTIEMPRESA — FASE VISUAL */
.profile-settings-modal-content,.company-settings-modal-content{width:min(720px,calc(100vw - 32px));max-height:min(880px,calc(100dvh - 32px));overflow:auto}
.profile-modal-header>div{min-width:0}.profile-modal-header h2{margin:2px 0 4px}.profile-modal-header p{margin:0;color:var(--muted);font-size:13px;line-height:1.45}
.settings-eyebrow,.settings-section-heading small{display:block;color:#8fa0b7;font-size:10px;font-weight:800;letter-spacing:.12em;text-transform:uppercase}
.settings-section{padding:18px 0;border-bottom:1px solid var(--line)}.settings-section:first-of-type{padding-top:8px}.settings-section:last-of-type{border-bottom:0}
.settings-section-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}.settings-section-heading h3{margin:3px 0 0;font-size:16px}
.settings-grid{display:grid;gap:14px}.settings-grid.two-columns{grid-template-columns:repeat(2,minmax(0,1fr))}.settings-span-2{grid-column:1/-1}
.profile-photo-editor,.company-logo-editor{display:flex;align-items:center;gap:16px;margin-bottom:16px}.profile-photo-editor>div,.company-logo-editor>div{display:grid;gap:4px}.profile-photo-editor span,.company-logo-editor span{color:var(--muted);font-size:12px}
.profile-modal-avatar,.company-logo-editor img{width:76px;height:76px;border-radius:20px;object-fit:cover;border:1px solid var(--line);background:#111416}.profile-modal-avatar{border-radius:50%}
.current-access-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.profile-readonly-card{display:flex;align-items:center;gap:12px}.profile-readonly-card>div{display:grid;gap:4px}.profile-readonly-card small{color:var(--muted)}
.profile-field-group input[readonly]{opacity:.72;cursor:not-allowed}
.settings-permission-notice{padding:12px 14px;border:1px solid rgba(111,226,171,.28);background:rgba(111,226,171,.07);border-radius:12px;color:#c8d8d0;font-size:13px;line-height:1.45;margin-bottom:16px}
.settings-permission-notice.readonly{border-color:var(--line);background:rgba(255,255,255,.025);color:var(--muted)}
.company-switch-item{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:12px;width:100%;padding:14px;border:1px solid var(--line);border-radius:14px;background:#111416;color:var(--text);text-align:left}.company-switch-item:not(:disabled):hover{border-color:rgba(111,226,171,.55);background:rgba(111,226,171,.05)}.company-switch-item.current{border-color:rgba(111,226,171,.45);background:rgba(111,226,171,.07)}
.company-switch-mark{width:42px;height:42px;border-radius:12px;display:grid;place-items:center;background:#1a1f21;font-weight:800;overflow:hidden}.company-switch-mark img{width:100%;height:100%;object-fit:cover}.company-switch-main{display:grid;gap:4px}.company-switch-main strong{font-size:14px}.company-switch-main small{color:var(--muted)}.company-switch-meta{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}.company-current-badge{font-size:10px;padding:4px 8px;border-radius:999px;background:rgba(111,226,171,.12);color:#8ee6b8;border:1px solid rgba(111,226,171,.28)}
.company-logo-placeholder{display:grid;width:100%;height:100%;place-items:center;background:linear-gradient(145deg,#202628,#111516);color:#eef5f1;font-weight:800;line-height:1;letter-spacing:.04em}
@media(max-width:640px){.profile-settings-modal-content,.company-settings-modal-content{width:calc(100vw - 18px);max-height:calc(100dvh - 18px)}.settings-grid.two-columns,.current-access-grid{grid-template-columns:1fr}.settings-span-2{grid-column:auto}.profile-photo-editor,.company-logo-editor{align-items:flex-start}.company-switch-item{grid-template-columns:auto 1fr}.company-switch-meta{grid-column:1/-1;justify-content:flex-start;padding-left:54px}.profile-footer{position:sticky;bottom:0;background:linear-gradient(180deg,rgba(19,21,22,.7),#131516 35%);padding-top:14px}}

/* PERFIL / EMPRESA — correção estrutural dos modais */
#perfilUsuarioModal,
#configuracoesEmpresaModal{
  position:fixed!important;
  inset:0!important;
  z-index:2000!important;
  align-items:center;
  justify-content:center;
  padding:16px;
  background:rgba(0,0,0,.78);
  backdrop-filter:blur(4px);
  overflow:hidden;
}
#perfilUsuarioModal[style*="display: flex"],
#perfilUsuarioModal[style*="display:flex"],
#configuracoesEmpresaModal[style*="display: flex"],
#configuracoesEmpresaModal[style*="display:flex"]{
  display:flex!important;
}
#perfilUsuarioModal .profile-modal-content,
#configuracoesEmpresaModal .profile-modal-content{
  position:relative;
  width:min(720px,100%);
  max-height:calc(100dvh - 32px);
  margin:auto;
  padding:26px 28px 22px;
  overflow-y:auto;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
  background:linear-gradient(180deg,#242424 0%,#111314 100%);
  border:1px solid rgba(255,255,255,.14);
  border-radius:18px;
  box-shadow:0 28px 80px rgba(0,0,0,.65),0 0 0 1px rgba(255,255,255,.02) inset;
}
#perfilUsuarioModal .profile-modal-header,
#configuracoesEmpresaModal .profile-modal-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  margin-bottom:18px;
  padding-bottom:16px;
  border-bottom:1px solid rgba(255,255,255,.1);
}
#perfilUsuarioModal .profile-modal-close,
#configuracoesEmpresaModal .profile-modal-close{
  flex:0 0 auto;
  width:40px;
  height:40px;
  display:grid;
  place-items:center;
  padding:0;
  border:1px solid rgba(255,255,255,.12);
  border-radius:11px;
  background:#15191b;
  color:#fff;
  font-size:22px;
  cursor:pointer;
}
#perfilUsuarioModal .profile-field-group,
#configuracoesEmpresaModal .profile-field-group{
  display:flex;
  flex-direction:column;
  gap:8px;
  min-width:0;
  margin-bottom:16px;
}
#perfilUsuarioModal .profile-field-group label,
#configuracoesEmpresaModal .profile-field-group label{
  color:#aeb4ba;
  font-size:12px;
  font-weight:750;
  letter-spacing:.045em;
  text-transform:uppercase;
}
#perfilUsuarioModal .profile-field-group input,
#perfilUsuarioModal .profile-field-group select,
#configuracoesEmpresaModal .profile-field-group input,
#configuracoesEmpresaModal .profile-field-group select{
  width:100%;
  min-width:0;
  height:44px;
  padding:0 14px;
  color:#fff;
  background:#0b0e10;
  border:1px solid rgba(255,255,255,.13);
  border-radius:9px;
  font:inherit;
  font-size:13px;
  box-sizing:border-box;
}
#perfilUsuarioModal .profile-field-group input:focus,
#perfilUsuarioModal .profile-field-group select:focus,
#configuracoesEmpresaModal .profile-field-group input:focus,
#configuracoesEmpresaModal .profile-field-group select:focus{
  outline:none;
  border-color:rgba(111,226,171,.58);
  box-shadow:0 0 0 3px rgba(111,226,171,.08);
}
#perfilUsuarioModal .profile-footer,
#configuracoesEmpresaModal .profile-footer{
  display:flex;
  justify-content:flex-end;
  gap:12px;
  margin-top:6px;
  padding-top:18px;
  border-top:1px solid rgba(255,255,255,.1);
}
#perfilUsuarioModal .profile-btn-cancel,
#configuracoesEmpresaModal .profile-btn-cancel,
#perfilUsuarioModal .profile-btn-save,
#configuracoesEmpresaModal .profile-btn-save{
  min-height:44px;
  padding:0 20px;
  border-radius:9px;
  font:inherit;
  font-weight:750;
  cursor:pointer;
}
#perfilUsuarioModal .profile-btn-cancel,
#configuracoesEmpresaModal .profile-btn-cancel{
  color:#fff;
  background:#111517;
  border:1px solid rgba(255,255,255,.14);
}
#perfilUsuarioModal .profile-btn-save,
#configuracoesEmpresaModal .profile-btn-save{
  color:#07110b;
  background:#6fe2ab;
  border:0;
}
#configuracoesEmpresaModal .company-logo-editor img:not([src]),
#configuracoesEmpresaModal .company-logo-editor img[src=""]{
  visibility:hidden;
}
@media(max-width:640px){
  #perfilUsuarioModal,#configuracoesEmpresaModal{padding:8px;align-items:flex-start}
  #perfilUsuarioModal .profile-modal-content,
  #configuracoesEmpresaModal .profile-modal-content{
    width:100%;
    max-height:calc(100dvh - 16px);
    padding:20px 16px 16px;
    border-radius:16px;
  }
  #perfilUsuarioModal .profile-footer,
  #configuracoesEmpresaModal .profile-footer{
    position:sticky;
    bottom:-16px;
    z-index:2;
    margin-inline:-16px;
    padding:14px 16px 16px;
    background:linear-gradient(180deg,rgba(17,19,20,.82),#111314 32%);
  }
  #perfilUsuarioModal .profile-footer>* ,
  #configuracoesEmpresaModal .profile-footer>*{flex:1}
}

/* Empresa — upload de logo */
.company-logo-upload{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:4px 0 14px}.company-logo-upload .profile-field-hint{flex:1;min-width:180px}.company-logo-remove{border-color:rgba(255,110,130,.35);color:#ff9aa9}.company-logo-url-fallback{margin-top:8px}.company-logo-editor img:not([src]),.company-logo-editor img[src=""]{display:block}.company-logo-editor img:not([src]){font-size:0}.company-logo-editor img:not([src])::after{content:attr(alt);font-size:16px;color:var(--text)}@media(max-width:640px){.company-logo-upload{align-items:stretch}.company-logo-upload button{flex:1}.company-logo-upload .profile-field-hint{flex-basis:100%}}


/* Empresa — refinamento visual e estabilidade do modal */
#configuracoesEmpresaModal{padding:24px;align-items:center;justify-content:center;overflow:hidden}
#configuracoesEmpresaModal .company-settings-modal-content{width:min(760px,calc(100vw - 32px));max-height:min(860px,calc(100dvh - 32px));padding:0;overflow:hidden;border-radius:18px;background:#17191a;border:1px solid rgba(255,255,255,.13);box-shadow:0 28px 80px rgba(0,0,0,.58)}
#configuracoesEmpresaModal .profile-modal-header{position:sticky;top:0;z-index:5;margin:0;padding:24px 28px 18px;background:linear-gradient(180deg,#1b1d1e 80%,rgba(27,29,30,.96));border-bottom:1px solid rgba(255,255,255,.09)}
#configuracoesEmpresaModal .profile-modal-body{padding:0 28px 24px;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
#configuracoesEmpresaModal .settings-permission-notice{margin-top:18px}
#configuracoesEmpresaModal .settings-section{padding:22px 0;margin:0;border-bottom:1px solid rgba(255,255,255,.09)}
#configuracoesEmpresaModal .company-logo-editor{display:grid;grid-template-columns:88px 1fr;gap:18px;align-items:center;margin-bottom:16px;padding:16px;border:1px solid rgba(255,255,255,.09);border-radius:14px;background:#121516}
#configuracoesEmpresaModal .company-logo-editor img{width:88px;height:88px;border-radius:16px;background:#0b0e0f}
#configuracoesEmpresaModal .company-logo-upload{margin:0;display:grid;grid-template-columns:auto auto 1fr;gap:10px;align-items:center}
#configuracoesEmpresaModal .company-logo-url-fallback{margin-top:18px}
#configuracoesEmpresaModal .profile-message{margin-top:16px;padding:12px 14px;border-radius:10px;border:1px solid transparent}
#configuracoesEmpresaModal .profile-footer{position:sticky;bottom:0;z-index:4;margin:0 -28px -24px;padding:16px 28px 20px;background:linear-gradient(180deg,rgba(23,25,26,.75),#17191a 32%)}
@media(max-width:640px){
 #configuracoesEmpresaModal{padding:8px;align-items:flex-start}
 #configuracoesEmpresaModal .company-settings-modal-content{width:100%;max-height:calc(100dvh - 16px);border-radius:15px}
 #configuracoesEmpresaModal .profile-modal-header{padding:20px 16px 16px}
 #configuracoesEmpresaModal .profile-modal-body{padding:0 16px 18px}
 #configuracoesEmpresaModal .company-logo-editor{grid-template-columns:68px 1fr;padding:12px;gap:12px}
 #configuracoesEmpresaModal .company-logo-editor img{width:68px;height:68px}
 #configuracoesEmpresaModal .company-logo-upload{grid-template-columns:1fr 1fr}
 #configuracoesEmpresaModal .company-logo-upload .profile-field-hint{grid-column:1/-1;min-width:0}
 #configuracoesEmpresaModal .profile-footer{margin:0 -16px -18px;padding:14px 16px 16px}
}


/* Correção definitiva — modal da empresa com rodapé sempre visível */
#configuracoesEmpresaModal .company-settings-modal-content{
  display:flex;
  flex-direction:column;
  height:min(820px,calc(100dvh - 32px));
  max-height:calc(100dvh - 32px);
  overflow:hidden;
}
#configuracoesEmpresaModal .profile-modal-header{
  position:relative;
  flex:0 0 auto;
}
#configuracoesEmpresaModal .profile-modal-body{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  padding-bottom:0;
}
#configuracoesEmpresaModal #configuracoesEmpresaForm{
  min-height:100%;
  display:flex;
  flex-direction:column;
}
#configuracoesEmpresaModal .profile-footer{
  position:sticky;
  bottom:0;
  flex:0 0 auto;
  margin-top:auto;
  margin-left:-28px;
  margin-right:-28px;
  margin-bottom:0;
  padding:16px 28px 20px;
  background:#17191a;
  box-shadow:0 -12px 24px rgba(0,0,0,.28);
}
#configuracoesEmpresaModal .settings-section:last-of-type{
  border-bottom:0;
  padding-bottom:18px;
}
@media(max-width:640px){
  #configuracoesEmpresaModal .company-settings-modal-content{
    height:calc(100dvh - 16px);
    max-height:calc(100dvh - 16px);
  }
  #configuracoesEmpresaModal .profile-footer{
    margin-left:-16px;
    margin-right:-16px;
    margin-bottom:0;
    padding:14px 16px 16px;
  }
}

/* Perfil e empresa — upload de imagem simplificado */
.media-settings-section{display:grid;gap:14px}
.media-preview-card{margin:0!important;padding:16px;border:1px solid rgba(255,255,255,.09);border-radius:16px;background:#121516}
.media-upload-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:0!important}
.media-action-button{appearance:none;border:1px solid rgba(255,255,255,.14);border-radius:12px;min-height:44px;padding:0 16px;display:inline-flex;align-items:center;justify-content:center;gap:8px;background:#111516;color:var(--text);font-weight:750;cursor:pointer;transition:border-color .18s ease,background .18s ease,transform .18s ease}
.media-action-button:hover{border-color:rgba(111,225,174,.5);background:#171c1a;transform:translateY(-1px)}
.media-action-button:disabled{opacity:.5;cursor:not-allowed;transform:none}
.media-action-button span{font-size:18px;line-height:1}
.media-action-primary{border-color:rgba(111,225,174,.35);background:rgba(111,225,174,.08)}
.media-action-danger{color:#ff9cab;border-color:rgba(255,110,130,.3);background:rgba(255,110,130,.05)}
.media-action-danger:hover{border-color:rgba(255,110,130,.55);background:rgba(255,110,130,.1)}
.media-file-status{color:var(--muted);font-size:13px;line-height:1.4;min-width:180px;flex:1}
#perfilUsuarioModal .profile-photo-editor{display:grid;grid-template-columns:82px 1fr;align-items:center;gap:16px}
#perfilUsuarioModal .profile-modal-avatar{width:82px;height:82px;margin:0;display:block;border-radius:50%;background:#0b0e0f}
#configuracoesEmpresaModal .company-logo-upload{display:flex;grid-template-columns:none;gap:10px;align-items:center}
#configuracoesEmpresaModal .company-logo-editor{margin-bottom:0}
@media(max-width:640px){
 .media-upload-actions{display:grid;grid-template-columns:1fr 1fr;width:100%}
 .media-file-status{grid-column:1/-1;min-width:0}
 #perfilUsuarioModal .profile-photo-editor{grid-template-columns:68px 1fr;padding:12px}
 #perfilUsuarioModal .profile-modal-avatar{width:68px;height:68px}
 #configuracoesEmpresaModal .company-logo-upload{display:grid;grid-template-columns:1fr 1fr}
}


/* 2026-07-30 — Perfil e Empresa: acabamento SaaS premium */
#perfilUsuarioModal,
#configuracoesEmpresaModal{
  --settings-surface:#151819;
  --settings-surface-2:#101314;
  --settings-border:rgba(255,255,255,.09);
  --settings-muted:#969da3;
  background:rgba(2,5,6,.78)!important;
  backdrop-filter:blur(10px);
}
#perfilUsuarioModal .profile-modal-content,
#configuracoesEmpresaModal .profile-modal-content{
  width:min(700px,calc(100vw - 32px));
  max-height:min(820px,calc(100dvh - 32px));
  border:1px solid rgba(255,255,255,.10);
  border-radius:20px;
  background:var(--settings-surface);
  box-shadow:0 36px 100px rgba(0,0,0,.72),0 1px 0 rgba(255,255,255,.04) inset;
  overflow:hidden;
}
#perfilUsuarioModal .profile-modal-header,
#configuracoesEmpresaModal .profile-modal-header{
  position:relative;
  padding:24px 28px 20px;
  margin:0;
  background:transparent;
  border-bottom:1px solid var(--settings-border);
}
#perfilUsuarioModal .profile-modal-header h2,
#configuracoesEmpresaModal .profile-modal-header h2{
  font-size:22px;
  letter-spacing:-.025em;
}
#perfilUsuarioModal .profile-modal-header p,
#configuracoesEmpresaModal .profile-modal-header p{
  margin-top:5px;
  color:var(--settings-muted);
}
#perfilUsuarioModal .profile-modal-close,
#configuracoesEmpresaModal .profile-modal-close{
  width:40px;height:40px;border-radius:12px;
  border:1px solid var(--settings-border);
  background:#111516;
  display:grid;place-items:center;
  opacity:1;font-size:20px;
}
#perfilUsuarioModal .profile-modal-body,
#configuracoesEmpresaModal .profile-modal-body{
  padding:0;
  overflow:auto;
  scrollbar-gutter:stable;
}
#perfilUsuarioModal form,
#configuracoesEmpresaModal form{min-height:100%;display:flex;flex-direction:column}
#perfilUsuarioModal .settings-section,
#configuracoesEmpresaModal .settings-section{
  margin:0 28px;
  padding:24px 0;
  border-bottom:1px solid var(--settings-border);
}
#perfilUsuarioModal .settings-section-heading,
#configuracoesEmpresaModal .settings-section-heading{margin-bottom:16px}
#perfilUsuarioModal .settings-section-heading h3,
#configuracoesEmpresaModal .settings-section-heading h3{
  margin:0;font-size:15px;letter-spacing:-.01em;
}
#configuracoesEmpresaModal .settings-permission-notice{
  margin:20px 28px 0;
  padding:10px 12px;
  border:0;
  border-radius:10px;
  background:rgba(103,221,166,.08);
  color:#a9d9c2;
  font-size:12px;
}
#perfilUsuarioModal .media-settings-section,
#configuracoesEmpresaModal .media-settings-section{gap:14px}
#perfilUsuarioModal .media-preview-card,
#configuracoesEmpresaModal .media-preview-card{
  display:grid;
  grid-template-columns:88px minmax(0,1fr);
  gap:18px;
  align-items:center;
  padding:0;
  border:0;
  background:transparent;
}
#perfilUsuarioModal .profile-modal-avatar,
#configuracoesEmpresaModal .company-logo-editor img{
  width:88px;height:88px;
  margin:0;
  border:1px solid rgba(255,255,255,.12);
  background:#0c0f10;
  box-shadow:0 8px 24px rgba(0,0,0,.28);
}
#configuracoesEmpresaModal .company-logo-editor img{border-radius:18px}
#perfilUsuarioModal .profile-modal-avatar{border-radius:50%}
.media-identity-copy{min-width:0;display:grid;gap:5px}
.media-identity-copy strong{font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.media-identity-copy span{font-size:12px;color:var(--settings-muted)}
#perfilUsuarioModal .media-upload-actions,
#configuracoesEmpresaModal .media-upload-actions{
  display:flex;
  align-items:center;
  gap:14px;
  margin-left:106px!important;
}
.media-action-button{
  min-height:40px;
  padding:0 14px;
  border-radius:10px;
  font-size:13px;
  font-weight:700;
  box-shadow:none;
}
.media-action-primary{
  background:#edf2ef!important;
  border-color:#edf2ef!important;
  color:#0b100e!important;
}
.media-action-primary:hover{background:#fff!important;border-color:#fff!important;transform:none}
.media-action-link-danger{
  appearance:none;border:0;background:transparent;color:#c58d97;
  padding:8px 2px;font-size:12px;font-weight:650;cursor:pointer;
}
.media-action-link-danger:hover{color:#ff9aaa;text-decoration:underline}
.media-file-status{
  display:block;
  min-width:0;
  color:#aeb5b9;
  font-size:12px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.media-file-status:empty{display:none}
#perfilUsuarioModal .settings-grid.two-columns,
#configuracoesEmpresaModal .settings-grid.two-columns{gap:16px 14px}
#perfilUsuarioModal .profile-field-group label,
#configuracoesEmpresaModal .profile-field-group label{
  margin-bottom:8px;
  color:#aeb4b8;
  font-size:11px;
  letter-spacing:.05em;
  text-transform:uppercase;
}
#perfilUsuarioModal input,
#perfilUsuarioModal select,
#configuracoesEmpresaModal input,
#configuracoesEmpresaModal select{
  min-height:44px;
  border-radius:10px;
  background:#0d1112;
  border:1px solid rgba(255,255,255,.10);
  transition:border-color .16s ease,box-shadow .16s ease;
}
#perfilUsuarioModal input:focus,
#perfilUsuarioModal select:focus,
#configuracoesEmpresaModal input:focus,
#configuracoesEmpresaModal select:focus{
  border-color:rgba(104,223,169,.62);
  box-shadow:0 0 0 3px rgba(104,223,169,.08);
}
#perfilUsuarioModal .current-access-grid{gap:12px}
#perfilUsuarioModal .profile-readonly-card{
  background:#101314;
  border-color:var(--settings-border);
  border-radius:12px;
}
#perfilUsuarioModal .profile-footer,
#configuracoesEmpresaModal .profile-footer{
  position:sticky;
  bottom:0;
  z-index:5;
  margin:0!important;
  padding:16px 28px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  background:rgba(21,24,25,.96);
  border-top:1px solid var(--settings-border);
  box-shadow:0 -16px 32px rgba(0,0,0,.22);
  backdrop-filter:blur(12px);
}
.settings-footer-note{color:#7f878c;font-size:11px;line-height:1.35}
.settings-footer-actions{display:flex;align-items:center;gap:10px;flex:0 0 auto}
#perfilUsuarioModal .profile-btn-cancel,
#configuracoesEmpresaModal .profile-btn-cancel,
#perfilUsuarioModal .profile-btn-save,
#configuracoesEmpresaModal .profile-btn-save{
  min-height:42px;
  border-radius:10px;
  padding:0 16px;
}
#perfilUsuarioModal .profile-btn-save,
#configuracoesEmpresaModal .profile-btn-save{
  background:#69dfa9;
  color:#07120d;
  border:0;
  font-weight:800;
  box-shadow:0 8px 22px rgba(64,193,132,.12);
}
#perfilUsuarioModal .profile-message,
#configuracoesEmpresaModal .profile-message{
  margin:16px 28px 0;
  border-radius:10px;
  font-size:12px;
}
@media(max-width:640px){
  #perfilUsuarioModal .profile-modal-content,
  #configuracoesEmpresaModal .profile-modal-content{width:calc(100vw - 16px);max-height:calc(100dvh - 16px);border-radius:16px}
  #perfilUsuarioModal .profile-modal-header,
  #configuracoesEmpresaModal .profile-modal-header{padding:20px 18px 16px}
  #perfilUsuarioModal .settings-section,
  #configuracoesEmpresaModal .settings-section{margin:0 18px;padding:20px 0}
  #configuracoesEmpresaModal .settings-permission-notice{margin:16px 18px 0}
  #perfilUsuarioModal .media-preview-card,
  #configuracoesEmpresaModal .media-preview-card{grid-template-columns:72px minmax(0,1fr);gap:14px}
  #perfilUsuarioModal .profile-modal-avatar,
  #configuracoesEmpresaModal .company-logo-editor img{width:72px;height:72px}
  #perfilUsuarioModal .media-upload-actions,
  #configuracoesEmpresaModal .media-upload-actions{margin-left:0!important;gap:12px}
  .media-file-status{flex-basis:100%}
  #perfilUsuarioModal .profile-footer,
  #configuracoesEmpresaModal .profile-footer{padding:14px 18px;align-items:stretch}
  .settings-footer-note{display:none}
  .settings-footer-actions{width:100%}
  .settings-footer-actions button{flex:1}
}

/* EVOLORA — configurações da empresa v2, estrutura compacta SaaS */
#configuracoesEmpresaModal .company-settings-modal-content{
  width:min(660px,calc(100vw - 32px))!important;
  max-height:calc(100dvh - 40px)!important;
  min-height:0!important;
  background:#141718!important;
  border:1px solid rgba(255,255,255,.11)!important;
  border-radius:18px!important;
  overflow:hidden!important;
}
#configuracoesEmpresaModal .profile-modal-header{
  padding:24px 28px 20px!important;
  align-items:flex-start!important;
}
#configuracoesEmpresaModal .company-modal-title{min-width:0}
#configuracoesEmpresaModal .company-modal-title h2{font-size:21px!important;margin:0 0 7px!important}
#configuracoesEmpresaModal .company-modal-context{display:flex;align-items:center;gap:10px;min-width:0}
#configuracoesEmpresaModal .company-modal-context p{margin:0!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#configuracoesEmpresaModal .company-owner-badge{
  display:inline-flex;align-items:center;min-height:24px;padding:0 9px;border-radius:999px;
  border:1px solid rgba(105,223,169,.35);background:rgba(105,223,169,.08);
  color:#9ce3c1;font-size:10px;font-weight:750;letter-spacing:.02em;flex:0 0 auto
}
#configuracoesEmpresaModal .settings-permission-notice{display:none!important}
#configuracoesEmpresaModal .profile-modal-body{overflow:auto!important;max-height:calc(100dvh - 132px)!important}
#configuracoesEmpresaModal form{min-height:0!important}
#configuracoesEmpresaModal .settings-section{margin:0 28px!important;padding:22px 0!important}
#configuracoesEmpresaModal .company-identity-section{
  display:grid!important;grid-template-columns:minmax(0,1fr) auto;column-gap:20px;row-gap:10px;
  align-items:center;padding-top:24px!important
}
#configuracoesEmpresaModal .media-preview-card{grid-column:1;grid-row:1;grid-template-columns:92px minmax(0,1fr)!important;gap:18px!important}
#configuracoesEmpresaModal .company-logo-frame{
  position:relative;width:92px;height:92px;border-radius:18px;overflow:hidden;
  border:1px solid rgba(255,255,255,.12);background:#0c0f10;box-shadow:0 10px 30px rgba(0,0,0,.28)
}
#configuracoesEmpresaModal .company-logo-editor img{width:100%!important;height:100%!important;border:0!important;border-radius:0!important;box-shadow:none!important}
#configuracoesEmpresaModal .company-logo-hover{
  position:absolute;inset:auto 7px 7px;min-height:25px;border-radius:7px;display:flex;align-items:center;justify-content:center;
  background:rgba(4,8,7,.82);backdrop-filter:blur(7px);color:#f2f5f3;font-size:10px;font-weight:750;
  opacity:0;transform:translateY(4px);transition:.16s ease;pointer-events:none
}
#configuracoesEmpresaModal .company-logo-frame:hover .company-logo-hover{opacity:1;transform:none}
#configuracoesEmpresaModal .media-identity-copy small{color:#8f989d;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.08em}
#configuracoesEmpresaModal .media-identity-copy strong{font-size:17px!important;margin-top:1px}
#configuracoesEmpresaModal .media-upload-actions{
  grid-column:2;grid-row:1;margin:0!important;display:flex!important;flex-direction:column;align-items:flex-end!important;gap:7px!important
}
#configuracoesEmpresaModal .media-action-primary{
  min-width:112px;min-height:38px!important;background:#202526!important;color:#f4f7f5!important;
  border:1px solid rgba(255,255,255,.12)!important;border-radius:9px!important
}
#configuracoesEmpresaModal .media-action-primary:hover{background:#282e2f!important;border-color:rgba(255,255,255,.2)!important}
#configuracoesEmpresaModal .media-action-link-danger{padding:4px 3px!important;color:#a98990!important;font-size:11px!important}
#configuracoesEmpresaModal .media-file-status{grid-column:1/-1;color:#8f989d!important;padding-left:110px}
#configuracoesEmpresaModal .settings-section-heading{margin-bottom:15px!important}
#configuracoesEmpresaModal .settings-section-heading h3{font-size:14px!important}
#configuracoesEmpresaModal .settings-grid.two-columns{gap:14px!important}
#configuracoesEmpresaModal .profile-footer{
  position:static!important;margin:0!important;padding:16px 28px!important;box-shadow:none!important;
  background:#121516!important
}
#configuracoesEmpresaModal .settings-footer-note{font-size:10px!important;color:#70797e!important}
#configuracoesEmpresaModal .profile-btn-save{min-width:150px;box-shadow:none!important}
@media(max-width:640px){
  #configuracoesEmpresaModal .company-settings-modal-content{width:calc(100vw - 16px)!important;max-height:calc(100dvh - 16px)!important}
  #configuracoesEmpresaModal .profile-modal-header{padding:20px 18px 16px!important}
  #configuracoesEmpresaModal .profile-modal-body{max-height:calc(100dvh - 102px)!important}
  #configuracoesEmpresaModal .settings-section{margin:0 18px!important;padding:20px 0!important}
  #configuracoesEmpresaModal .company-identity-section{grid-template-columns:1fr!important}
  #configuracoesEmpresaModal .media-preview-card{grid-column:1;grid-row:auto;grid-template-columns:76px minmax(0,1fr)!important}
  #configuracoesEmpresaModal .company-logo-frame{width:76px;height:76px;border-radius:15px}
  #configuracoesEmpresaModal .media-upload-actions{grid-column:1;grid-row:auto;flex-direction:row;align-items:center!important;justify-content:flex-start}
  #configuracoesEmpresaModal .media-file-status{padding-left:0;grid-column:1}
  #configuracoesEmpresaModal .profile-footer{position:sticky!important;bottom:0;padding:14px 18px!important}
  #configuracoesEmpresaModal .company-owner-badge{display:none}
}

/* EVOLORA — modal definitivo de configurações da empresa */
#configuracoesEmpresaModal{padding:20px!important;align-items:center!important;justify-content:center!important;overflow:hidden!important;background:rgba(2,5,6,.74)!important;backdrop-filter:blur(8px)!important}
#configuracoesEmpresaModal .evolora-company-dialog{width:min(640px,calc(100vw - 32px))!important;height:auto!important;min-height:0!important;max-height:calc(100dvh - 40px)!important;padding:0!important;overflow:hidden!important;display:flex!important;flex-direction:column!important;background:#141718!important;border:1px solid rgba(255,255,255,.11)!important;border-radius:18px!important;box-shadow:0 28px 90px rgba(0,0,0,.62)!important}
#configuracoesEmpresaModal .evolora-company-header{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;padding:24px 26px 20px;border-bottom:1px solid rgba(255,255,255,.08);flex:0 0 auto}
#configuracoesEmpresaModal .evolora-company-kicker{margin-bottom:7px;color:#8e989d;font-size:10px;font-weight:800;letter-spacing:.12em}
#configuracoesEmpresaModal .evolora-company-header h2{margin:0;color:#f5f7f6;font-size:22px;line-height:1.15}
#configuracoesEmpresaModal .evolora-company-subline{display:flex;align-items:center;gap:9px;margin-top:7px;color:#9ca4a8;font-size:12px}
#configuracoesEmpresaModal .company-owner-badge{display:inline-flex!important;align-items:center;min-height:22px;padding:0 8px;border:1px solid rgba(105,223,169,.34);border-radius:999px;background:rgba(105,223,169,.08);color:#9ce3c1;font-size:10px;font-weight:750}
#configuracoesEmpresaModal .profile-modal-close{position:static!important;flex:0 0 auto;width:40px;height:40px;border-radius:11px}
#configuracoesEmpresaModal .evolora-company-form{display:flex;flex-direction:column;min-height:0}
#configuracoesEmpresaModal .evolora-company-scroll{padding:22px 26px 24px;overflow-y:auto;overscroll-behavior:contain}
#configuracoesEmpresaModal .settings-permission-notice{display:none!important}
#configuracoesEmpresaModal .evolora-company-logo-section{display:grid;grid-template-columns:96px minmax(0,1fr);gap:18px;align-items:center;padding:0 0 22px;border-bottom:1px solid rgba(255,255,255,.08)}
#configuracoesEmpresaModal .evolora-company-logo-frame{width:96px;height:96px;overflow:hidden;border:1px solid rgba(255,255,255,.12);border-radius:18px;background:#0c0f10;box-shadow:0 10px 28px rgba(0,0,0,.3)}
#configuracoesEmpresaModal .evolora-company-logo-frame .company-logo-placeholder{font-size:28px}
#configuracoesEmpresaModal .evolora-company-logo-frame img{display:block;width:100%!important;height:100%!important;object-fit:cover;border:0!important;border-radius:0!important}
#configuracoesEmpresaModal .evolora-company-logo-copy>span:first-child{display:block;margin-bottom:3px;color:#8e989d;font-size:10px;font-weight:800;letter-spacing:.1em}
#configuracoesEmpresaModal .evolora-company-logo-copy strong{display:block;color:#f4f6f5;font-size:17px;line-height:1.25}
#configuracoesEmpresaModal .evolora-company-logo-copy p{margin:5px 0 12px;color:#8f989d;font-size:12px}
#configuracoesEmpresaModal .evolora-company-logo-actions{display:flex;align-items:center;gap:12px}
#configuracoesEmpresaModal .evolora-upload-btn{min-height:38px;padding:0 14px;border:1px solid rgba(255,255,255,.14);border-radius:9px;background:#202526;color:#f4f7f5;font-size:12px;font-weight:750;cursor:pointer}
#configuracoesEmpresaModal .evolora-upload-btn:hover{background:#292f30;border-color:rgba(255,255,255,.22)}
#configuracoesEmpresaModal .evolora-remove-btn{padding:7px 2px;border:0;background:transparent;color:#b58a93;font-size:12px;font-weight:700;cursor:pointer}
#configuracoesEmpresaModal .evolora-remove-btn:hover{color:#ff9aaa;text-decoration:underline}
#configuracoesEmpresaModal .media-file-status{display:block;margin-top:8px;color:#98a1a5;font-size:11px}
#configuracoesEmpresaModal .media-file-status:empty{display:none}
#configuracoesEmpresaModal .evolora-company-fields{padding-top:22px}
#configuracoesEmpresaModal .evolora-company-fields h3{margin:0 0 16px;color:#f1f4f2;font-size:15px}
#configuracoesEmpresaModal .evolora-company-name{margin-bottom:15px}
#configuracoesEmpresaModal .evolora-company-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
#configuracoesEmpresaModal .profile-field-group label{display:block;margin:0 0 8px;color:#9fa7ab;font-size:10px;font-weight:800;letter-spacing:.06em;text-transform:uppercase}
#configuracoesEmpresaModal input,#configuracoesEmpresaModal select{width:100%;min-height:44px;padding:0 13px;border:1px solid rgba(255,255,255,.11);border-radius:10px;background:#0d1112;color:#f2f4f3;font-size:13px}
#configuracoesEmpresaModal input:focus,#configuracoesEmpresaModal select:focus{outline:none;border-color:rgba(105,223,169,.62);box-shadow:0 0 0 3px rgba(105,223,169,.08)}
#configuracoesEmpresaModal .profile-message{margin:16px 0 0!important}
#configuracoesEmpresaModal .evolora-company-footer{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:15px 26px 18px;border-top:1px solid rgba(255,255,255,.08);background:#111415;flex:0 0 auto}
#configuracoesEmpresaModal .settings-footer-note{color:#737d82;font-size:10px}
#configuracoesEmpresaModal .settings-footer-actions{display:flex;gap:10px}
#configuracoesEmpresaModal .profile-btn-cancel,#configuracoesEmpresaModal .profile-btn-save{min-height:40px;padding:0 15px;border-radius:9px}
#configuracoesEmpresaModal .profile-btn-save{min-width:148px;background:#69dfa9!important;color:#07120d!important;border:0!important;font-weight:800;box-shadow:none!important}
#configuracoesEmpresaModal .profile-btn-save:disabled{opacity:.45;cursor:not-allowed}
@media(max-width:640px){
 #configuracoesEmpresaModal{padding:8px!important;align-items:flex-start!important}
 #configuracoesEmpresaModal .evolora-company-dialog{width:calc(100vw - 16px)!important;max-height:calc(100dvh - 16px)!important;border-radius:15px!important}
 #configuracoesEmpresaModal .evolora-company-header{padding:20px 18px 16px}
 #configuracoesEmpresaModal .evolora-company-scroll{padding:18px}
 #configuracoesEmpresaModal .evolora-company-logo-section{grid-template-columns:76px minmax(0,1fr);gap:14px}
 #configuracoesEmpresaModal .evolora-company-logo-frame{width:76px;height:76px;border-radius:14px}
 #configuracoesEmpresaModal .evolora-company-grid{grid-template-columns:1fr}
 #configuracoesEmpresaModal .evolora-company-footer{padding:13px 18px;align-items:stretch}
 #configuracoesEmpresaModal .settings-footer-note{display:none}
 #configuracoesEmpresaModal .settings-footer-actions{width:100%}
 #configuracoesEmpresaModal .settings-footer-actions button{flex:1}
}

/* FASE PERFIL/MULTIEMPRESA — identidade visual da empresa atual */
.company-profile-mark,
.menu-company-mark,
.dashboard-company-mark{
  overflow:hidden;
  background:#171b1d;
  border:1px solid var(--border-subtle);
  color:var(--text);
  font-weight:800;
  letter-spacing:.02em;
}
.company-profile-mark img,
.menu-company-mark img,
.dashboard-company-mark img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.company-profile-mark{
  width:40px;
  height:40px;
  min-width:40px;
  border-radius:11px;
  background:#f2f5f3;
}
.menu-company-context{
  display:grid;
  grid-template-columns:34px minmax(0,1fr);
  align-items:center;
  gap:10px;
}
.menu-company-mark{
  width:34px;
  height:34px;
  border-radius:9px;
  display:grid;
  place-items:center;
  font-size:11px;
}
.menu-company-copy{
  min-width:0;
  display:grid;
  gap:2px;
}
.menu-company-copy strong{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.dashboard-company-context{
  display:inline-flex;
  align-items:center;
  gap:10px;
  width:max-content;
  max-width:100%;
  padding:7px 10px 7px 7px;
  border:1px solid var(--border-subtle);
  border-radius:12px;
  background:rgba(255,255,255,.018);
}
.dashboard-company-mark{
  width:34px;
  height:34px;
  min-width:34px;
  border-radius:9px;
  display:grid;
  place-items:center;
  font-size:11px;
  background:#f2f5f3;
}
.dashboard-company-copy{
  min-width:0;
  display:grid;
  gap:1px;
}
.dashboard-company-copy>strong{
  font-size:13px;
  line-height:1.25;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
#dashboard .dashboard-company-copy .dashboard-scope-note{
  font-size:12px;
  line-height:1.35;
}
@media(max-width:640px){
  .dashboard-company-context{width:100%;box-sizing:border-box}
  .company-profile-mark{width:36px;height:36px;min-width:36px}
}

/* AJUSTE — logo da empresa com mais presença no contexto do Dashboard */
.dashboard-company-context{
  gap:12px;
  padding:8px 12px 8px 8px;
  border-radius:14px;
}
.dashboard-company-mark{
  width:46px;
  height:46px;
  min-width:46px;
  border-radius:11px;
  font-size:13px;
}
.dashboard-company-copy>strong{
  font-size:14px;
}
@media(max-width:640px){
  .dashboard-company-mark{
    width:42px;
    height:42px;
    min-width:42px;
  }
}

/* CORREÇÃO — alinhamento do contexto da empresa no Dashboard */
.dashboard-company-context{
  display:grid;
  grid-template-columns:48px minmax(0,1fr);
  align-items:center;
  column-gap:12px;
  width:max-content;
  max-width:100%;
  min-height:64px;
  padding:7px 13px 7px 7px;
  box-sizing:border-box;
}
.dashboard-company-mark{
  width:48px;
  height:48px;
  min-width:48px;
  align-self:center;
  border-radius:11px;
  display:grid;
  place-items:center;
  line-height:0;
}
.dashboard-company-mark img{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
  object-position:center;
}
.dashboard-company-copy{
  display:flex;
  min-width:0;
  flex-direction:column;
  justify-content:center;
  align-self:stretch;
  gap:2px;
}
.dashboard-company-copy>strong,
#dashboard .dashboard-company-copy .dashboard-scope-note{
  margin:0;
}
.dashboard-company-copy>strong{
  line-height:1.2;
}
#dashboard .dashboard-company-copy .dashboard-scope-note{
  line-height:1.25;
}
@media(max-width:640px){
  .dashboard-company-context{
    grid-template-columns:44px minmax(0,1fr);
    min-height:60px;
    padding:7px 11px 7px 7px;
  }
  .dashboard-company-mark{
    width:44px;
    height:44px;
    min-width:44px;
  }
}

/* EVOLORA — Backup 1C: snapshot real do Supabase */
.backup-page-header{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:18px}
.backup-page-header h2{margin:0 0 6px}
.backup-page-header p{margin:0;color:var(--muted)}
.backup-owner-badge{display:inline-flex;align-items:center;min-height:30px;padding:6px 11px;border:1px solid rgba(112,225,164,.34);border-radius:999px;background:rgba(47,151,101,.12);color:#9ee3bd;font-size:12px;font-weight:700;white-space:nowrap}
.backup-owner-badge.readonly{border-color:var(--border-default);background:var(--surface-card-inner);color:var(--muted)}
.backup-real-panel{padding:0;overflow:hidden}
.backup-real-intro{display:flex;gap:16px;align-items:flex-start;padding:24px 26px 20px}
.backup-real-icon{flex:0 0 48px;width:48px;height:48px;display:grid;place-items:center;border:1px solid rgba(112,225,164,.28);border-radius:14px;background:rgba(47,151,101,.11);font-size:24px;color:#a7e7c4}
.backup-eyebrow{display:block;margin-bottom:6px;color:#94a3b8;font-size:10px;font-weight:800;letter-spacing:.13em}
.backup-real-intro h3,.backup-result-header h3,.backup-future-card h3{margin:0 0 7px}
.backup-real-intro p,.backup-future-card p{max-width:820px;margin:0;color:var(--muted);line-height:1.55}
.backup-company-context{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1px;margin:0 26px;border:1px solid var(--border-default);border-radius:12px;overflow:hidden;background:var(--border-default)}
.backup-company-context>div{padding:15px 17px;background:var(--surface-card-inner)}
.backup-company-context span{display:block;margin-bottom:5px;color:var(--muted);font-size:11px}
.backup-company-context strong{display:block;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.backup-actions-row{display:flex;align-items:center;gap:16px;padding:22px 26px 24px}
.backup-actions-row p{margin:0;color:var(--muted);font-size:13px}
.backup-generate-button{display:inline-flex;align-items:center;gap:9px;min-height:44px}
.backup-button-icon{font-size:18px;line-height:1}
.backup-progress{margin:0 26px 22px;padding:15px 16px;display:flex;align-items:center;gap:13px;border:1px solid rgba(112,225,164,.25);border-radius:12px;background:rgba(47,151,101,.07)}
.backup-progress-spinner{width:22px;height:22px;border:2px solid rgba(255,255,255,.18);border-top-color:#78d9a5;border-radius:50%;animation:backupSpin .8s linear infinite}
.backup-progress strong,.backup-progress span{display:block}
.backup-progress span{margin-top:3px;color:var(--muted);font-size:12px}
@keyframes backupSpin{to{transform:rotate(360deg)}}
.backup-result{margin:0 26px 24px;padding:20px;border:1px solid var(--border-default);border-radius:14px;background:var(--surface-card-inner)}
.backup-result-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:17px}
.backup-integrity-badge{display:inline-flex;align-items:center;min-height:28px;padding:5px 10px;border-radius:999px;border:1px solid rgba(112,225,164,.35);background:rgba(47,151,101,.12);color:#9ee3bd;font-size:11px;font-weight:800}
.backup-integrity-badge.valid-with-warnings{border-color:rgba(241,196,91,.35);background:rgba(241,196,91,.1);color:#f3ce78}
.backup-integrity-badge.invalid{border-color:rgba(237,139,152,.38);background:rgba(237,139,152,.1);color:#f3a4af}
.backup-summary-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:9px}
.backup-summary-item{padding:12px;border:1px solid var(--border-default);border-radius:10px;background:#0d1012}
.backup-summary-item strong{display:block;margin-bottom:4px;font-size:20px}
.backup-summary-item span{display:block;color:var(--muted);font-size:11px;line-height:1.3}
.backup-integrity-details{margin-top:16px;padding:14px 15px;border:1px solid rgba(241,196,91,.28);border-radius:11px;background:rgba(241,196,91,.05)}
.backup-integrity-details h4{margin:0 0 9px;font-size:13px}
.backup-integrity-details ul{margin:0;padding:0;list-style:none}
.backup-integrity-item{display:flex;justify-content:space-between;gap:14px;padding:8px 0;border-top:1px solid rgba(255,255,255,.06);color:#d6d8dc;font-size:12px;line-height:1.45}
.backup-integrity-item:first-child{border-top:0}
.backup-integrity-item.error{color:#f0a2ad}
.backup-file-meta{display:flex;justify-content:space-between;gap:16px;margin-top:16px;padding-top:14px;border-top:1px solid var(--border-default);color:var(--muted);font-size:11px}
.backup-file-meta span:last-child{max-width:60%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:right}
.backup-status.warning{border-color:rgba(241,196,91,.35);color:#f3ce78}
.backup-status.info{border-color:rgba(110,168,255,.25);color:#b3cdf6}
.backup-scope-note{margin-top:16px;padding:17px 20px;border:1px solid var(--border-default);border-radius:13px;background:rgba(255,255,255,.015)}
.backup-scope-note strong{display:block;margin-bottom:5px}
.backup-scope-note p{margin:0;color:var(--muted);font-size:13px;line-height:1.55}
.backup-future-card{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-top:16px;padding:19px 21px;border:1px dashed var(--border-default);border-radius:13px;background:rgba(255,255,255,.012)}
.backup-future-lock{display:inline-flex;padding:7px 10px;border-radius:999px;background:var(--surface-card-inner);border:1px solid var(--border-default);color:var(--muted);font-size:11px;font-weight:700;white-space:nowrap}
@media(max-width:1100px){.backup-summary-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:760px){
 .backup-page-header{flex-direction:column;gap:12px}
 .backup-real-intro{padding:20px;gap:13px}
 .backup-company-context{grid-template-columns:1fr;margin:0 20px}
 .backup-actions-row{align-items:stretch;flex-direction:column;padding:20px}
 .backup-generate-button{justify-content:center;width:100%}
 .backup-progress,.backup-result{margin-left:20px;margin-right:20px}
 .backup-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .backup-result-header,.backup-file-meta,.backup-future-card{flex-direction:column;align-items:flex-start}
 .backup-file-meta span:last-child{max-width:100%;text-align:left}
}

/* Backup 1F — acabamento, progresso e histórico persistente */
.backup-version-context{grid-template-columns:repeat(4,minmax(0,1fr))}
.backup-progress-detailed{align-items:flex-start}
.backup-progress-content{min-width:0;flex:1}
.backup-progress-content>span{display:block;margin-top:4px}
.backup-progress-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:14px 0 0;padding:0;list-style:none;counter-reset:backup-step}
.backup-progress-steps li{position:relative;padding:9px 10px 9px 30px;border:1px solid var(--border-default);border-radius:9px;background:#0d1110;color:var(--muted);font-size:12px;line-height:1.25}
.backup-progress-steps li:before{counter-increment:backup-step;content:counter(backup-step);position:absolute;left:9px;top:8px;width:15px;height:15px;border-radius:50%;display:grid;place-items:center;background:#252c29;color:#9aa6a0;font-size:9px;font-weight:800}
.backup-progress-steps li.active{border-color:rgba(98,214,160,.45);background:rgba(98,214,160,.08);color:#d9ffec}
.backup-progress-steps li.active:before{background:#62d6a0;color:#06130d}
.backup-progress-steps li.done{color:#a8dbbb;border-color:rgba(143,207,169,.22)}
.backup-progress-steps li.done:before{content:'✓';background:#1f6b50;color:#fff}
.backup-result-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:16px 0}
.backup-result-metrics>div{padding:12px 13px;border:1px solid var(--border-default);border-radius:10px;background:#0d1110}
.backup-result-metrics span{display:block;color:var(--muted);font-size:11px;margin-bottom:5px}
.backup-result-metrics strong{display:block;color:var(--text);font-size:14px}
.backup-error-details{margin-top:10px;border:1px solid rgba(237,139,152,.25);border-radius:10px;background:rgba(237,139,152,.04);overflow:hidden}
.backup-error-details summary{cursor:pointer;padding:11px 13px;color:#f0a2ad;font-size:12px;font-weight:700}
.backup-error-details pre{margin:0;padding:0 13px 13px;color:#c7acae;white-space:pre-wrap;word-break:break-word;font:11px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace}
.backup-scope-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.backup-scope-note.included{border-color:rgba(98,214,160,.22)}
.backup-scope-note.excluded{border-color:rgba(237,139,152,.18)}
.backup-history-panel{margin-top:16px}
.backup-history-header{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:16px}
.backup-history-header h3{margin:3px 0 5px}
.backup-history-header p{margin:0;color:var(--muted);font-size:12px;line-height:1.5;max-width:760px}
.backup-history-state{padding:16px;border:1px dashed var(--border-default);border-radius:10px;color:var(--muted);font-size:13px}
.backup-history-list{display:grid;gap:9px}
.backup-history-item{display:grid;grid-template-columns:minmax(190px,1.2fr) minmax(130px,.8fr) minmax(110px,.6fr) minmax(120px,.7fr) auto;align-items:center;gap:12px;padding:13px 14px;border:1px solid var(--border-default);border-radius:11px;background:#0d1110}
.backup-history-primary strong,.backup-history-item>div>strong{display:block;color:var(--text);font-size:13px}
.backup-history-primary span,.backup-history-item>div>span{display:block;color:var(--muted);font-size:11px;margin-top:4px}
.backup-history-badge{justify-self:end;padding:5px 8px;border-radius:999px;border:1px solid rgba(98,214,160,.3);background:rgba(98,214,160,.08);color:#9af2c5;font-size:10px;font-weight:800}
.backup-history-badge.warning{border-color:rgba(243,201,105,.35);background:rgba(243,201,105,.08);color:#f3d98f}
.backup-history-badge.invalid{border-color:rgba(237,139,152,.35);background:rgba(237,139,152,.08);color:#f0a2ad}
@media(max-width:900px){.backup-version-context{grid-template-columns:repeat(2,minmax(0,1fr))}.backup-result-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.backup-progress-steps{grid-template-columns:1fr 1fr}.backup-scope-grid{grid-template-columns:1fr}.backup-history-item{grid-template-columns:1fr 1fr}.backup-history-badge{justify-self:start}}
@media(max-width:560px){.backup-version-context,.backup-result-metrics,.backup-progress-steps,.backup-history-item{grid-template-columns:1fr}.backup-history-header{display:block}.backup-history-header .btn{margin-top:12px;width:100%}}


/* RESTAURAÇÃO 2B — validador local e dry-run somente leitura */
.restore-validator-card{
 margin-top:24px;padding:24px;border:1px solid var(--line);border-radius:18px;
 background:linear-gradient(180deg,rgba(255,255,255,.025),rgba(255,255,255,.01));
}
.restore-validator-head,.restore-result-head,.restore-file-summary{
 display:flex;align-items:flex-start;justify-content:space-between;gap:20px;
}
.restore-validator-head h3,.restore-result-head h3{margin:5px 0 7px}
.restore-validator-head p,.restore-result-head p{margin:0;color:var(--muted);max-width:760px}
.restore-upload-zone{
 margin-top:20px;min-height:210px;border:1px dashed rgba(98,214,160,.45);border-radius:16px;
 display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;
 padding:24px;background:rgba(98,214,160,.035);transition:.18s ease;
}
.restore-upload-zone.dragover{border-color:var(--green);background:rgba(98,214,160,.09);transform:translateY(-1px)}
.restore-upload-zone.disabled{opacity:.55;pointer-events:none}
.restore-upload-zone strong{font-size:17px;margin:5px 0}
.restore-upload-zone span,.restore-upload-zone small{color:var(--muted)}
.restore-upload-zone small{margin:6px 0 16px;max-width:620px}
.restore-upload-icon{font-size:26px;color:var(--green)}
.restore-file-summary{
 margin-top:16px;padding:15px 16px;border:1px solid var(--line);border-radius:12px;background:rgba(255,255,255,.02)
}
.restore-file-summary div{display:flex;flex-direction:column;gap:3px}
.restore-file-summary span,.restore-file-summary small{color:var(--muted);font-size:12px}
.restore-file-summary strong{font-size:14px;word-break:break-all}
.restore-progress{margin-top:16px;padding:14px 16px;border-radius:12px;border:1px solid rgba(98,214,160,.35);background:rgba(98,214,160,.06);display:flex;flex-direction:column;gap:4px}
.restore-progress span{color:var(--muted);font-size:13px}
.restore-result{margin-top:18px;padding:20px;border:1px solid var(--line);border-radius:16px;background:rgba(255,255,255,.018)}
.restore-result-status{padding:7px 10px;border-radius:999px;font-weight:700;font-size:12px;background:rgba(255,255,255,.06)}
.restore-result-status.valid{color:#79e8b8;background:rgba(51,197,130,.12);border:1px solid rgba(51,197,130,.3)}
.restore-result-status.warning{color:#f4cb72;background:rgba(244,203,114,.1);border:1px solid rgba(244,203,114,.25)}
.restore-result-status.invalid{color:#ff8b9a;background:rgba(255,100,120,.1);border:1px solid rgba(255,100,120,.25)}
.restore-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:18px}
.restore-kpis>div{padding:14px;border:1px solid var(--line);border-radius:12px;background:rgba(255,255,255,.02);display:flex;flex-direction:column;gap:5px}
.restore-kpis span{color:var(--muted);font-size:12px}
.restore-kpis strong{font-size:15px}
.restore-validation-columns{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:14px}
.restore-validation-columns>div{padding:15px;border:1px solid var(--line);border-radius:12px}
.restore-validation-columns h4{margin:0 0 10px}
.restore-validation-columns ul{margin:0;padding-left:19px;color:var(--muted);font-size:13px;line-height:1.55}
.restore-validation-columns li+li{margin-top:5px}
.restore-technical-details{margin-top:14px;border-top:1px solid var(--line);padding-top:13px}
.restore-technical-details summary{cursor:pointer;color:var(--muted);font-size:13px}
.restore-technical-details pre{white-space:pre-wrap;word-break:break-word;max-height:320px;overflow:auto;background:#0c100f;border:1px solid var(--line);border-radius:10px;padding:12px;font-size:11px;color:#c9d4cf}
@media(max-width:820px){
 .restore-validator-head,.restore-result-head,.restore-file-summary{flex-direction:column}
 .restore-kpis{grid-template-columns:1fr 1fr}
 .restore-validation-columns{grid-template-columns:1fr}
}
@media(max-width:520px){.restore-kpis{grid-template-columns:1fr}}


/* RESTAURAÇÃO 2C — plano detalhado somente leitura */
.restore-plan-card{
 margin-top:18px;padding:20px;border:1px solid var(--line);border-radius:16px;
 background:linear-gradient(180deg,rgba(98,214,160,.035),rgba(255,255,255,.012));
}
.restore-plan-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px}
.restore-plan-head h3{margin:5px 0 7px}
.restore-plan-head p{margin:0;color:var(--muted);max-width:800px}
.restore-plan-destination{margin-top:18px;padding:16px;border:1px solid var(--line);border-radius:12px;background:rgba(255,255,255,.02)}
.restore-plan-destination label{display:block;font-weight:700;margin-bottom:8px}
.restore-plan-destination>div{display:flex;gap:10px}
.restore-plan-destination input{
 flex:1;min-width:0;background:#0d1210;color:var(--text);border:1px solid var(--line);
 border-radius:10px;padding:11px 12px;font:inherit
}
.restore-plan-destination small{display:block;color:var(--muted);margin-top:8px}
.restore-plan-output{margin-top:16px}
.restore-plan-kpis{margin-top:0}
.restore-plan-sections{display:grid;gap:14px;margin-top:14px}
.restore-plan-sections section{padding:15px;border:1px solid var(--line);border-radius:12px;background:rgba(255,255,255,.015)}
.restore-plan-sections h4{margin:0 0 11px}
.restore-plan-table-wrap{overflow:auto}
.restore-plan-table{width:100%;border-collapse:collapse;font-size:13px}
.restore-plan-table th,.restore-plan-table td{padding:10px 9px;text-align:left;border-bottom:1px solid var(--line);vertical-align:top}
.restore-plan-table th{color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:.04em}
.restore-plan-table tr:last-child td{border-bottom:0}
.restore-plan-order,.restore-plan-list{margin:0;padding-left:21px;color:var(--muted);font-size:13px;line-height:1.55}
.restore-plan-order li+li,.restore-plan-list li+li{margin-top:5px}
@media(max-width:820px){
 .restore-plan-head,.restore-plan-destination>div{flex-direction:column}
 .restore-plan-destination button{width:100%}
}

.restore-original-company{
 display:grid;grid-template-columns:1fr 1fr;gap:10px;width:100%;margin-bottom:12px
}
.restore-original-company>div{
 padding:13px;border:1px solid var(--line);border-radius:10px;background:rgba(255,255,255,.02);
 display:flex;flex-direction:column;gap:4px
}
.restore-original-company span{color:var(--muted);font-size:12px}
.restore-original-company strong{font-size:14px;word-break:break-word}
@media(max-width:700px){.restore-original-company{grid-template-columns:1fr}}


/* RESTAURAÇÃO 2D.1 — pré-execução segura */
.restore-preexecution-card{
 margin-top:18px;padding:20px;border:1px solid var(--line);border-radius:16px;
 background:linear-gradient(180deg,rgba(240,190,80,.045),rgba(255,255,255,.012))
}
.restore-preexecution-warning{
 display:flex;flex-direction:column;gap:4px;margin-top:16px;padding:14px 15px;
 border:1px solid rgba(240,190,80,.25);border-radius:12px;background:rgba(240,190,80,.055)
}
.restore-preexecution-warning span{color:var(--muted);font-size:13px}
.restore-preexecution-actions{display:flex;gap:10px;margin-top:14px;flex-wrap:wrap}
.restore-preexecution-result{margin-top:16px}
.restore-preexecution-card.is-ready{border-color:rgba(98,214,160,.3)}
.restore-preexecution-card.is-cancelled{opacity:.92}
@media(max-width:700px){
 .restore-preexecution-actions{flex-direction:column}
 .restore-preexecution-actions .btn{width:100%}
}


/* RESTAURAÇÃO 2D.3 — simulação transacional */
.restore-simulation-result{
 margin-top:16px;padding:15px;border:1px solid rgba(98,214,160,.28);
 border-radius:12px;background:rgba(98,214,160,.035)
}
.restore-simulation-head{
 display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:13px
}
.restore-simulation-head>div{display:flex;flex-direction:column;gap:4px}
.restore-simulation-head span:first-child{
 color:var(--muted);font-size:11px;letter-spacing:.05em;font-weight:700
}
.restore-simulation-head strong{font-size:15px}


/* RESTAURAÇÃO 2D.4B — primeira categoria real controlada */
.restore-controlled-action{
 border-color:rgba(98,214,160,.38)!important;
 background:rgba(98,214,160,.1)!important;
 color:var(--text)!important
}
.restore-category-result{
 margin-top:16px;padding:15px;border:1px solid rgba(98,214,160,.32);
 border-radius:12px;background:linear-gradient(180deg,rgba(98,214,160,.05),rgba(255,255,255,.015))
}
.restore-category-note{
 display:flex;flex-direction:column;gap:4px;margin-top:13px;padding:12px 13px;
 border:1px solid var(--line);border-radius:10px;background:rgba(255,255,255,.02)
}
.restore-category-note span{color:var(--muted);font-size:12px}
.restore-category-note code{font-size:12px}


/* EVOLORA — Restauração 2D.10B */
.restore-final-action{
  min-width:220px;
  font-weight:800;
}
.restore-final-result{
  margin-top:20px;
}
.restore-final-kpis{
  grid-template-columns:repeat(4,minmax(130px,1fr));
}
.restore-final-steps{
  display:grid;
  gap:10px;
  margin-top:16px;
}
.restore-final-step{
  display:grid;
  grid-template-columns:minmax(180px,1.4fr) repeat(4,minmax(74px,.6fr));
  gap:10px;
  align-items:center;
  padding:12px 14px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:12px;
  background:rgba(255,255,255,.025);
}
.restore-final-step strong{font-size:13px}
.restore-final-step span{font-size:11px;opacity:.72}
.restore-final-step .valid{opacity:1;font-weight:800}
.restore-token-panel{
  margin-top:16px;
  padding:16px;
  border:1px solid rgba(255,255,255,.12);
  border-radius:14px;
  background:rgba(255,255,255,.035);
}
.restore-token-panel>div{
  display:flex;
  flex-direction:column;
  gap:4px;
  margin-bottom:12px;
}
.restore-token-panel pre{
  max-height:220px;
  overflow:auto;
  white-space:pre-wrap;
  word-break:break-word;
}
@media (max-width:900px){
  .restore-final-kpis{grid-template-columns:repeat(2,minmax(120px,1fr))}
  .restore-final-step{grid-template-columns:1fr 1fr}
}


/* EVOLORA — fluxo de recuperação orientado ao cliente */
.restore-validator-card{
  max-width:1100px;
  margin-inline:auto;
}
.restore-technical-details,
.restore-support-details{
  margin-top:16px;
  opacity:.78;
}
.restore-technical-details summary,
.restore-support-details summary{
  cursor:pointer;
  color:var(--muted);
  font-size:12px;
}
.restore-completion-card{
  margin-top:22px;
  padding:26px;
  border:1px solid rgba(61,220,151,.38);
  border-radius:20px;
  background:
    radial-gradient(circle at top right,rgba(61,220,151,.13),transparent 38%),
    linear-gradient(180deg,rgba(17,37,31,.98),rgba(7,15,13,.98));
  display:grid;
  grid-template-columns:64px 1fr;
  gap:20px;
  box-shadow:0 22px 60px rgba(0,0,0,.28);
}
.restore-completion-icon{
  width:64px;
  height:64px;
  border-radius:20px;
  display:grid;
  place-items:center;
  background:rgba(61,220,151,.16);
  border:1px solid rgba(61,220,151,.35);
  color:var(--green);
  font-size:34px;
  font-weight:900;
}
.restore-completion-content h3{
  margin:5px 0 8px;
  font-size:24px;
}
.restore-completion-content>p{
  margin:0;
  color:#cbd7d1;
  line-height:1.55;
}
.restore-completion-summary{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin-top:20px;
}
.restore-completion-summary>div{
  padding:13px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:12px;
  background:rgba(0,0,0,.18);
}
.restore-completion-summary span,
.restore-completion-summary strong{
  display:block;
}
.restore-completion-summary span{
  color:var(--muted);
  font-size:11px;
  margin-bottom:6px;
}
.restore-completion-summary strong{
  font-size:14px;
}
.restore-completion-list{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:9px;
  margin-top:18px;
}
.restore-completion-item{
  display:grid;
  grid-template-columns:28px 1fr auto;
  gap:9px;
  align-items:center;
  padding:11px 12px;
  border-radius:11px;
  background:rgba(0,0,0,.16);
  border:1px solid rgba(255,255,255,.06);
}
.restore-completion-check{
  width:24px;
  height:24px;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:rgba(61,220,151,.15);
  color:var(--green);
  font-weight:900;
}
.restore-completion-item strong{font-size:13px}
.restore-completion-item small{color:var(--green);font-weight:700}
.restore-completion-actions{
  display:flex;
  justify-content:flex-end;
  margin-top:20px;
}
.restore-preexecution-actions{
  align-items:center;
}
.restore-final-action{
  background:linear-gradient(135deg,#2fbf83,#1d9665)!important;
  color:#04130d!important;
  border-color:rgba(61,220,151,.45)!important;
  font-weight:900!important;
}
@media(max-width:800px){
  .restore-completion-card{grid-template-columns:1fr;padding:20px}
  .restore-completion-summary{grid-template-columns:repeat(2,1fr)}
  .restore-completion-list{grid-template-columns:1fr}
}
@media(max-width:520px){
  .restore-completion-summary{grid-template-columns:1fr}
  .restore-preexecution-actions{display:grid;grid-template-columns:1fr}
  .restore-preexecution-actions .btn{width:100%}
}


/* EVOLORA — recuperação intuitiva V2 */
.restore-step-number{
  display:inline-grid;
  place-items:center;
  width:24px;
  height:24px;
  margin-right:8px;
  border-radius:50%;
  background:rgba(61,220,151,.16);
  border:1px solid rgba(61,220,151,.34);
  color:#68e4ad;
  font-size:12px;
}
.restore-support-only{display:none!important}
.restore-preexecution-summary{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
}
.restore-preexecution-card details{opacity:.55}
@media(max-width:700px){
  .restore-preexecution-summary{grid-template-columns:1fr!important}
}


/* EVOLORA — BACKUP E RECUPERAÇÃO V3 */
#backup{max-width:1180px;margin:0 auto}
.backup-page-header-v3{margin-bottom:18px}
.backup-page-kicker{display:block;margin-bottom:7px;color:#69dda5;font-size:11px;font-weight:800;letter-spacing:.12em;text-transform:uppercase}
.backup-page-header-v3 h2{font-size:28px;margin-bottom:7px}
.backup-page-header-v3 p{max-width:680px;font-size:14px}
.backup-mode-switch{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:6px;margin-bottom:18px;border:1px solid var(--border-default);border-radius:16px;background:#0b0f0e}
.backup-mode-tab{min-height:70px;display:flex;align-items:center;gap:13px;padding:13px 16px;border:1px solid transparent;border-radius:12px;background:transparent;color:var(--muted);cursor:pointer;text-align:left;transition:.18s ease}
.backup-mode-tab:hover{background:rgba(255,255,255,.025);color:var(--text)}
.backup-mode-tab.is-active{border-color:rgba(89,216,157,.32);background:linear-gradient(180deg,rgba(38,122,84,.17),rgba(24,73,52,.09));color:var(--text)}
.backup-mode-tab strong,.backup-mode-tab small{display:block}
.backup-mode-tab strong{font-size:14px;margin-bottom:4px}
.backup-mode-tab small{color:var(--muted);font-size:11px}
.backup-mode-icon{flex:0 0 38px;width:38px;height:38px;display:grid;place-items:center;border-radius:11px;border:1px solid var(--border-default);background:#111615;font-size:19px}
.backup-mode-tab.is-active .backup-mode-icon{border-color:rgba(89,216,157,.35);background:rgba(43,143,96,.16);color:#76e5ad}
.backup-mode-pane[hidden]{display:none!important}
.backup-mode-pane.is-active{animation:backupPaneIn .18s ease}
@keyframes backupPaneIn{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}

.backup-real-panel{border-radius:18px;background:linear-gradient(180deg,#111614,#0d1110)}
.backup-real-intro{padding:25px 25px 18px}
.backup-real-intro h3{font-size:21px}
.backup-company-context{grid-template-columns:repeat(2,minmax(0,1fr))!important;margin-inline:25px;background:transparent;gap:10px;border:0}
.backup-company-context>div{border:1px solid var(--border-default);border-radius:11px}
.backup-technical-meta{display:none!important}
.backup-actions-row{padding:20px 25px 25px}
.backup-actions-row p{max-width:460px}
.backup-status{margin:0 25px 24px;background:#0b0f0e}
.backup-scope-compact{margin:14px 0;border:1px solid var(--border-default);border-radius:14px;background:#0d1110;overflow:hidden}
.backup-scope-compact>summary{cursor:pointer;padding:15px 18px;font-size:13px;font-weight:700;color:#d5dbd8}
.backup-scope-compact[open]>summary{border-bottom:1px solid var(--border-default)}
.backup-scope-compact .backup-scope-grid{padding:14px}
.backup-scope-note{margin-top:0}
.backup-scope-note ul{margin:10px 0 0;padding-left:18px;color:var(--muted);font-size:12px;line-height:1.65}
.backup-history-panel{padding:20px;border-radius:16px}
.backup-history-header h3{font-size:18px}
.backup-history-item{grid-template-columns:minmax(220px,1.5fr) minmax(110px,.55fr) minmax(150px,.8fr) auto!important}
.backup-history-item>div:nth-child(4){display:none}

#backupRestorePane .restore-validator-card{border:0;padding:0;background:transparent}
.restore-validator-head{padding:22px 22px 18px;border:1px solid var(--border-default);border-radius:16px 16px 0 0;background:linear-gradient(180deg,#111614,#0e1211)}
.restore-upload-zone{margin-top:0;border-radius:0 0 16px 16px;min-height:190px;background:#0c100f}
.restore-file-summary,.restore-progress,.restore-result,.restore-plan-card,.restore-preexecution-card{border-radius:16px}
.restore-result{padding:22px}
.restore-result-head h3{font-size:20px}
.restore-kpis{grid-template-columns:repeat(3,minmax(0,1fr))!important}
.restore-kpis>div:nth-child(2){display:none}
.restore-validation-summary{display:flex;align-items:center;gap:12px;padding:14px 15px;margin-top:15px;border:1px solid rgba(89,216,157,.25);border-radius:12px;background:rgba(44,145,98,.08)}
.restore-validation-check{width:30px;height:30px;display:grid;place-items:center;flex:0 0 30px;border-radius:50%;background:rgba(52,181,115,.18);color:#74e3ad;font-size:17px;font-weight:900}
.restore-validation-summary strong,.restore-validation-summary small{display:block}
.restore-validation-summary small{margin-top:3px;color:var(--muted)}
.restore-customer-details{margin-top:13px;border:1px solid var(--border-default);border-radius:12px;background:#0d1110;overflow:hidden}
.restore-customer-details>summary{cursor:pointer;padding:13px 15px;color:#c9d1cd;font-size:12px;font-weight:700}
.restore-customer-details[open]>summary{border-bottom:1px solid var(--border-default)}
.restore-customer-details .restore-validation-columns,.restore-customer-details .restore-plan-sections{margin:0;padding:14px}
.restore-technical-details,.restore-support-details,.backup-error-details{opacity:.48}
.restore-technical-details summary,.restore-support-details summary,.backup-error-details summary{font-size:11px}
.restore-plan-card,.restore-preexecution-card{margin-top:16px;padding:21px}
.restore-plan-head{margin-bottom:16px}
.restore-plan-destination{padding:15px}
.restore-original-company{grid-template-columns:1fr 1fr}
.restore-original-company strong{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.restore-plan-kpis{grid-template-columns:repeat(3,minmax(0,1fr))!important}
.restore-plan-kpis>div:first-child{display:none}
.restore-preexecution-warning{border-color:rgba(89,216,157,.24);background:rgba(49,135,93,.07)}
.restore-preexecution-warning strong{color:#dce7e1}
.restore-preexecution-actions{gap:10px}
.restore-simulation-result,.restore-category-result,#restoreClientsResult{border-radius:13px}
.restore-simulation-result .restore-kpis{grid-template-columns:repeat(2,minmax(0,1fr))!important}
.restore-simulation-result .restore-kpis>div:nth-child(3),.restore-simulation-result .restore-kpis>div:nth-child(4){display:none}

.restore-completion-card{grid-template-columns:56px 1fr;padding:26px;border-radius:18px;background:radial-gradient(circle at top left,rgba(62,183,120,.11),transparent 35%),linear-gradient(180deg,#101714,#0a0f0d)}
.restore-completion-icon{width:56px;height:56px;border-radius:16px;font-size:29px}
.restore-completion-content h3{font-size:24px}
.restore-completion-summary{grid-template-columns:repeat(3,minmax(0,1fr))}
.restore-completion-list{grid-template-columns:1fr;border:1px solid var(--border-default);border-radius:13px;overflow:hidden;gap:0}
.restore-completion-item{border:0;border-radius:0;border-top:1px solid var(--border-default);background:transparent;padding:13px 15px}
.restore-completion-item:first-child{border-top:0}
.restore-completion-actions .btn{min-width:128px;background:linear-gradient(135deg,#50ca91,#2b9d69);border-color:transparent;color:#05120c}

.restore-simplified-flow .restore-plan-head{text-align:center;padding:0;border:0;background:none}
.restore-simplified-flow .restore-plan-head h3{font-size:22px;margin-bottom:8px;color:var(--text)}
.restore-simplified-flow .restore-plan-head p{margin:0;color:var(--muted);font-size:14px;line-height:1.5}

.btn-large{min-height:48px;padding:12px!important;font-size:15px!important;font-weight:600!important}

.restore-automatic-progress{border:1px solid var(--border-default);border-radius:12px;padding:16px;background:rgba(0,0,0,.2)}
.restore-progress-step{display:flex;align-items:center;gap:12px;padding:10px 0;color:var(--text);font-size:14px}
.restore-progress-step:not(:last-child){border-bottom:1px solid var(--border-default);margin-bottom:8px;padding-bottom:12px}
.restore-progress-icon{width:24px;height:24px;display:flex;align-items:center;justify-content:center;border-radius:50%;border:2px solid var(--border-default);font-size:12px;flex:0 0 24px;transition:all .3s ease}
.restore-progress-step.active .restore-progress-icon{border-color:#50ca91;color:#50ca91;animation:spin .6s linear infinite}
.restore-progress-step.done .restore-progress-icon{background:#50ca91;border-color:#50ca91;color:#05120c;content:'✓'}

@keyframes spin{
 from{transform:rotate(0)}
 to{transform:rotate(360deg)}
}

@media(max-width:760px){
 .backup-mode-switch{grid-template-columns:1fr}
 .backup-company-context{grid-template-columns:1fr!important}
 .restore-kpis,.restore-plan-kpis,.restore-completion-summary{grid-template-columns:1fr!important}
 .restore-original-company{grid-template-columns:1fr}
 .backup-history-item{grid-template-columns:1fr!important}
}

/* FASE 1B: Shell Administrativo */
.admin-shell{display:flex;flex-direction:column;height:100%;background:var(--surface-page);color:var(--text)}
.admin-shell-header{display:flex;align-items:center;justify-content:space-between;padding:20px 24px;border-bottom:1px solid var(--border-subtle);background:var(--surface-page)}
.admin-shell-brand{display:flex;align-items:center;gap:12px}
.admin-shell-symbol{width:32px;height:32px;display:flex;align-items:center;justify-content:center;min-width:32px}
.admin-shell-symbol svg{width:100%;height:100%}
.admin-shell-text{display:flex;flex-direction:column;gap:2px}
.admin-shell-title{margin:0;font-size:16px;font-weight:700;color:var(--text)}
.admin-shell-subtitle{margin:0;font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.05em}
.admin-shell-close{background:transparent;border:none;color:var(--muted);cursor:pointer;font-size:28px;padding:0;width:32px;height:32px;display:flex;align-items:center;justify-content:center;transition:.2s ease}
.admin-shell-close:hover{color:var(--text)}

.admin-shell-nav{display:flex;gap:8px;padding:12px 20px;border-bottom:1px solid var(--border-subtle);background:var(--surface-page);overflow-x:auto}
.admin-shell-nav-item{background:transparent;border:1px solid transparent;padding:8px 12px;border-radius:8px;color:var(--muted);cursor:pointer;font-size:13px;display:flex;align-items:center;gap:8px;transition:.2s ease;white-space:nowrap;flex:0 0 auto}
.admin-shell-nav-item:hover{color:var(--text);background:var(--surface-hover)}
.admin-shell-nav-item.active{color:var(--green);border-color:var(--green);background:rgba(61,220,151,.1)}
.admin-nav-icon{width:16px;height:16px}

.admin-shell-content{flex:1;overflow-y:auto;padding:24px;min-height:0}
.admin-shell-section{max-width:800px}
.admin-shell-section h2{margin:0 0 12px;font-size:18px;font-weight:600;color:var(--text)}
.admin-shell-section p{margin:0;font-size:14px;color:var(--text-light);line-height:1.5}

.admin-shell-svg-sm{width:24px;height:24px}

/* FASE 2A.2: Dashboard administrativo global */
.admin-dashboard-loading{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:80px 20px;text-align:center}
.admin-dashboard-spinner{width:40px;height:40px;border:3px solid var(--border-subtle);border-top-color:var(--green);border-radius:50%;animation:spin 0.8s linear infinite;margin-bottom:20px}
.admin-dashboard-loading-text{margin:0;font-size:14px;color:var(--text-light)}

.admin-dashboard-error{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:60px 20px;text-align:center;max-width:500px;margin:0 auto}
.admin-dashboard-error-title{margin:0 0 12px;font-size:18px;font-weight:600;color:var(--text)}
.admin-dashboard-error-message{margin:0 0 24px;font-size:14px;color:var(--text-light)}
.admin-dashboard-error-buttons{display:flex;gap:12px;justify-content:center}

.admin-dashboard{display:flex;flex-direction:column;gap:32px;max-width:1400px}
.admin-dashboard-header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:8px}
.admin-dashboard-title{margin:0;font-size:20px;font-weight:600;color:var(--text)}
.admin-dashboard-refresh{display:flex;align-items:center;gap:8px;padding:8px 16px;border:1px solid var(--border-default);border-radius:8px;background:transparent;color:var(--muted);cursor:pointer;font-size:13px;transition:0.2s ease}
.admin-dashboard-refresh:hover{color:var(--text);border-color:var(--border-default);background:var(--surface-hover)}
.admin-dashboard-refresh svg{width:16px;height:16px}

.admin-dashboard-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:16px;margin-bottom:8px}
.admin-dashboard-card{padding:20px;border:1px solid var(--border-subtle);border-radius:12px;background:var(--surface-card);display:flex;flex-direction:column;gap:12px}
.admin-dashboard-card-label{font-size:12px;color:var(--text-light);font-weight:500}
.admin-dashboard-card-value{font-size:32px;font-weight:700;color:var(--green);line-height:1}
.admin-dashboard-card-title{font-size:14px;font-weight:600;color:var(--text)}

.admin-dashboard-series{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,400px),1fr));gap:24px;margin-bottom:8px}
.admin-dashboard-series-panel{padding:20px;border:1px solid var(--border-subtle);border-radius:12px;background:var(--surface-card);min-width:0;overflow:hidden}
.admin-dashboard-series-title{margin:0 0 16px;font-size:14px;font-weight:600;color:var(--text)}
.admin-dashboard-series-chart{width:100%;height:auto;min-width:0;display:flex;align-items:flex-end}

.admin-dashboard-footer{display:flex;flex-direction:column;gap:8px;padding-top:16px;border-top:1px solid var(--border-subtle);font-size:12px;color:var(--text-light)}
.admin-dashboard-footer-text{margin:0}
.admin-dashboard-footer-timezone{font-style:italic}

@keyframes spin{to{transform:rotate(360deg)}}

.admin-companies-section{display:flex;flex-direction:column;gap:24px;max-width:1400px}
.admin-companies-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:8px}
.admin-companies-subtitle{margin:4px 0 0;font-size:14px;color:var(--text-light)}

.admin-companies-filters{background:var(--surface-card);border:1px solid var(--border-subtle);border-radius:8px;padding:16px;margin-bottom:16px}
.admin-companies-filters-content{display:flex;flex-wrap:wrap;gap:12px;align-items:flex-end}
.admin-companies-filter-group{flex:1;min-width:150px}
.admin-companies-filter-input,
.admin-companies-filter-select{width:100%;padding:8px 12px;background:var(--surface-input);border:1px solid var(--border-default);border-radius:6px;color:var(--text);font-size:13px}
.admin-companies-filter-input:focus,
.admin-companies-filter-select:focus{outline:none;border-color:var(--green)}

.admin-companies-table-wrapper{background:var(--surface-card);border:1px solid var(--border-subtle);border-radius:8px;overflow-x:auto}
.admin-companies-table{width:100%;border-collapse:collapse;font-size:13px}
.admin-companies-table thead{background:var(--surface-card-inner)}
.admin-companies-table th{text-align:left;padding:12px;border-bottom:1px solid var(--border-subtle);font-weight:600;color:var(--muted)}
.admin-companies-table td{padding:12px;border-bottom:1px solid var(--border-subtle);color:var(--text)}
.admin-companies-table tbody tr:hover{background:var(--surface-hover)}

.admin-companies-badge{display:inline-block;padding:4px 8px;border-radius:4px;font-size:12px;font-weight:500}
.badge-active{background:rgba(61,220,151,.15);color:#3ddc97}
.badge-paused{background:rgba(242,184,75,.15);color:#f2b84b}
.badge-closed{background:rgba(255,102,122,.15);color:#ff667a}
.badge-default{background:var(--border-subtle);color:var(--muted)}

.admin-companies-pagination{display:flex;align-items:center;justify-content:center;gap:16px;padding:16px;border-top:1px solid var(--border-subtle)}
.admin-companies-pagination-info{font-size:13px;color:var(--muted)}

.admin-companies-footer{display:flex;flex-direction:column;gap:8px;padding-top:16px;border-top:1px solid var(--border-subtle);font-size:12px;color:var(--text-light)}

@media(max-width:768px){
.admin-companies-table-wrapper{font-size:12px}
.admin-companies-table th,
.admin-companies-table td{padding:8px}
.admin-companies-filters-content{gap:8px}
.admin-companies-filter-group{min-width:120px}
}
