/* ============================================================================
   morada-ca.css — Design System "Morada-CA" · v6
   ----------------------------------------------------------------------------
   Padrão visual oficial do sistema Morada Blindada, baseado na Conta Azul.
   Cobertura: tokens · botões · forms · dropdowns (+ menu de conta) · KPI strip ·
   tabelas · pills/chips · modais · empty state · datepicker · banners ·
   paginação · dashboard (card · stat-card · lista de contas · charts SVG · layout) ·
   assistente Levi (avatar · chip · ação de IA · painel · welcome · análise).
   (v2 acrescentou datepicker, banners e paginação — seções 11–13.
    v3 acrescentou os primitivos de dashboard e os charts SVG — seção 14.
    v4 acrescentou o menu de conta/configurações — seção 5.3.
    v5 acrescentou o assistente Levi — seção 15.
    v6 documentou a marca/logo na galeria — sem novos componentes CSS.)

   Decisões travadas (handoff 2026-05-29 + amostragem das capturas):
     - Fonte ................ Plus Jakarta Sans (Google Fonts)
     - Rail/sidebar ......... --navy  #0a1d3a
     - Accent de marca ...... --brand-orange #ea5811  (nav/detalhe, NUNCA botão)
     - Azul secundário/link . --brand-blue #15669d     (amostrado)
     - Verde principal ...... #1d9c45  (botão Salvar/Confirmar/Criar — amostrado)
     - Vermelho destrutivo .. #b7182a  (botão Excluir/Descartar — amostrado)

   Regra de botões (conforme conversa anterior + decisão 2026-05-29):
     VERDE     = ação principal (Salvar, Confirmar, Criar)
     AZUL      = secundária, SEMPRE SÓLIDA (Cancelar, Exportar, Voltar, Aplicar)
     VERMELHO  = destrutiva (Excluir, Descartar)
   Nota: .mb-btn--ghost (azul-outline) NÃO é a secundária canônica — a
   secundária é azul sólido. Os usos legados de --ghost na galeria (Voltar/
   Exportar/Ações ▾/modal) ficaram pendentes de limpeza em conversa dedicada.
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800&display=swap');

/* ----------------------------------------------------------------------------
   1. TOKENS
   ---------------------------------------------------------------------------- */
:root {
  /* --- Marca ------------------------------------------------------------- */
  --navy:            #0a1d3a;   /* rail / sidebar                            */
  --navy-700:        #102845;   /* hover de item no rail                     */
  --brand-orange:    #ea5811;   /* accent de navegação/detalhe (não-botão)  */
  --brand-orange-50: #fdeee6;   /* tint do accent                           */
  --brand-orange-700:#b8470f;   /* laranja queimado (texto sobre tint claro) */
  --brand-blue:      #15669d;   /* botão secundário + links (amostrado)     */
  --brand-blue-700:  #114f7b;   /* hover do azul                            */
  --brand-blue-50:   #e8f0f7;   /* tint do azul                             */

  /* --- Semânticas (ação) ------------------------------------------------- */
  --success:         #1d9c45;   /* botão principal — verde (amostrado)      */
  --success-700:     #167a36;   /* hover                                    */
  --success-50:      #e6f5ec;   /* tint                                     */
  --danger:          #b7182a;   /* botão destrutivo — vermelho (amostrado)  */
  --danger-700:      #921320;   /* hover                                    */
  --danger-50:       #fbe9eb;   /* tint                                     */

  /* --- Semânticas (estado/valor) ----------------------------------------
     Usadas em valores numéricos e pills de status, NÃO em botões.          */
  --positive:        #28b745;   /* valor positivo / pill "recebido|pago"    */
  --negative:        var(--danger);  /* valor negativo — usa Danger #b7182a (decisão do usuário) */
  --warning:         #9a6b00;   /* texto de aviso / pill "em aberto"        */
  --warning-bg:      #fff7d0;   /* fundo âmbar (badge/banner — amostrado)   */
  --info:            var(--brand-blue);  /* pill "parcial"                  */

  /* --- Pills de status (referenciam os tokens semânticos — padrão único) - */
  --pill-paid-bg:    var(--success-50);    --pill-paid-fg:    var(--success-700); /* recebido/pago */
  --pill-open-bg:    var(--warning-bg);    --pill-open-fg:    var(--warning);     /* em aberto     */
  --pill-partial-bg: var(--brand-blue-50); --pill-partial-fg: var(--brand-blue);  /* parcial       */
  --pill-overdue-bg: var(--danger-50);     --pill-overdue-fg: var(--danger);      /* vencido       */

  /* --- Neutros / superfícies (cool grays da UI CA) ----------------------- */
  --bg:              #f4f6f9;   /* fundo da página                          */
  --bg-subtle:       #eef1f6;   /* faixa/zebra mais fria                     */
  --surface:         #ffffff;   /* cards, modais, campos                    */
  --surface-2:       #f7f9fc;   /* cabeçalho de tabela, header de filtro    */
  --border:          #e4e9f0;   /* borda padrão                             */
  --border-strong:   #d3dae5;   /* borda de campo/input                     */
  --overlay:         rgba(10, 29, 58, .45);  /* scrim de modal              */

  /* --- Texto ------------------------------------------------------------- */
  --text:            #1f2a3d;   /* corpo / títulos                          */
  --text-muted:      #5b687a;   /* labels, legendas                         */
  --text-subtle:     #8a96a6;   /* placeholder, linha esmaecida             */
  --text-on-dark:    #ffffff;   /* texto sobre navy                         */
  --link:            var(--brand-blue);

  /* --- Tipografia -------------------------------------------------------- */
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --fs-11: .6875rem;  /* 11px — micro/badge        */
  --fs-12: .75rem;    /* 12px — legenda            */
  --fs-13: .8125rem;  /* 13px — label, tabela      */
  --fs-14: .875rem;   /* 14px — corpo (base)       */
  --fs-16: 1rem;      /* 16px — corpo grande       */
  --fs-18: 1.125rem;  /* 18px — subtítulo          */
  --fs-20: 1.25rem;   /* 20px — título de seção    */
  --fs-24: 1.5rem;    /* 24px — título de tela     */
  --fs-30: 1.875rem;  /* 30px — KPI/valor grande   */
  --fw-regular: 400;
  --fw-medium:  500;
  --fw-semibold:600;
  --fw-bold:    700;
  --fw-extra:   800;
  --lh-tight:   1.2;
  --lh-normal:  1.5;

  /* --- Espaçamento (escala 4px) ------------------------------------------ */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;
  --sp-12: 48px; --sp-16: 64px;

  /* --- Raios ------------------------------------------------------------- */
  --r-sm:   4px;
  --r-md:   6px;   /* botões, campos (padrão CA)  */
  --r-lg:   8px;
  --r-xl:   12px;  /* cards, modais               */
  --r-pill: 999px;

  /* --- Sombras (frias, suaves) ------------------------------------------- */
  --sh-sm: 0 1px 2px rgba(16, 40, 69, .06);
  --sh-md: 0 4px 12px rgba(16, 40, 69, .08);
  --sh-lg: 0 12px 32px rgba(16, 40, 69, .14);
  --ring:  0 0 0 3px;  /* usado com cor de foco por componente              */

  /* --- Movimento --------------------------------------------------------- */
  --t-fast: 120ms ease;
  --t-base: 180ms ease;

  /* --- Camadas ----------------------------------------------------------- */
  --z-dropdown: 1000;
  --z-sticky:   1020;
  --z-modal:    1080;
  --z-toast:    1100;
}

/* ----------------------------------------------------------------------------
   2. BASE mínima (escopo do design system; não substitui reset global)
   ---------------------------------------------------------------------------- */
.mb {
  font-family: var(--font);
  font-size: var(--fs-14);
  line-height: var(--lh-normal);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
.mb a { color: var(--link); text-decoration: none; }
.mb a:hover { text-decoration: underline; }
/* Padrão de fonte: nada de monospace na UI (o <code>/<pre>/<kbd>/<samp> do navegador
   vem com mono de "zero pontilhado"). Força a fonte do DS — uma fonte só em toda a UI.
   Números tabulares = Plus Jakarta + font-variant-numeric:tabular-nums (não monospace). */
.mb code, .mb kbd, .mb samp, .mb pre, .mb tt { font-family: var(--font); }

/* ----------------------------------------------------------------------------
   3. BOTÕES
   ----------------------------------------------------------------------------
   Estrutura:
     .mb-btn                       base
     .mb-btn--primary              verde  (ação principal)
     .mb-btn--secondary            azul sólido (Aplicar/Confirmar-secundário)
     .mb-btn--ghost                azul outline/texto (Voltar/Exportar/Cancelar)
     .mb-btn--danger               vermelho (destrutiva)
     .mb-btn--danger-ghost         vermelho outline
   Tamanhos: .mb-btn--sm | (padrão) | .mb-btn--lg
   Estados:  :hover :focus-visible :active [disabled] .is-loading
   Split:    .mb-btn-split  (wrapper com botão + gatilho de chevron)
   ---------------------------------------------------------------------------- */
.mb-btn {
  --_bg:        var(--brand-blue);
  --_bg-hover:  var(--brand-blue-700);
  --_fg:        #fff;
  --_border:    transparent;
  --_ring:      rgba(21, 102, 157, .35);

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-family: var(--font);
  font-size: var(--fs-14);
  font-weight: var(--fw-semibold);
  line-height: 1;
  letter-spacing: .005em;
  padding: 11px 18px;
  min-height: 40px;
  border: 1px solid var(--_border);
  border-radius: var(--r-md);
  background: var(--_bg);
  color: var(--_fg);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast),
              box-shadow var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.mb-btn:hover    { background: var(--_bg-hover); border-color: var(--_bg-hover); }
.mb-btn:active   { transform: translateY(1px); }
.mb-btn:focus-visible {
  outline: none;
  box-shadow: var(--ring) var(--_ring);
}
.mb-btn[disabled],
.mb-btn.is-disabled {
  cursor: not-allowed;
  opacity: .5;
  pointer-events: none;
}

/* Ícone dentro do botão acompanha o texto */
.mb-btn svg,
.mb-btn .mb-btn__icon { width: 18px; height: 18px; flex: none; }

/* --- Variantes --------------------------------------------------------- */
.mb-btn--primary {
  --_bg: var(--success); --_bg-hover: var(--success-700);
  --_fg: #fff; --_ring: rgba(29, 156, 69, .35);
}
.mb-btn--secondary {
  --_bg: var(--brand-blue); --_bg-hover: var(--brand-blue-700);
  --_fg: #fff; --_ring: rgba(21, 102, 157, .35);
}
.mb-btn--danger {
  --_bg: var(--danger); --_bg-hover: var(--danger-700);
  --_fg: #fff; --_ring: rgba(183, 24, 42, .35);
}

/* Ghost/outline azul — Voltar, Exportar, Cancelar (fundo branco, texto azul) */
.mb-btn--ghost {
  --_bg: var(--surface); --_bg-hover: var(--brand-blue-50);
  --_fg: var(--brand-blue); --_border: var(--border-strong);
  --_ring: rgba(21, 102, 157, .25);
}
.mb-btn--ghost:hover { color: var(--brand-blue-700); border-color: var(--border-strong); }

.mb-btn--danger-ghost {
  --_bg: var(--surface); --_bg-hover: var(--danger-50);
  --_fg: var(--danger); --_border: var(--border-strong);
  --_ring: rgba(183, 24, 42, .25);
}
.mb-btn--danger-ghost:hover { color: var(--danger-700); border-color: var(--border-strong); }

/* --- Tamanhos ---------------------------------------------------------- */
.mb-btn--sm { padding: 7px 12px;  min-height: 32px; font-size: var(--fs-13); border-radius: var(--r-sm); }
.mb-btn--lg { padding: 14px 24px; min-height: 48px; font-size: var(--fs-16); }

/* --- Largura cheia ----------------------------------------------------- */
.mb-btn--block { display: flex; width: 100%; }

/* --- Estado de carregamento (spinner) ---------------------------------- */
.mb-btn.is-loading { color: transparent !important; pointer-events: none; position: relative; }
.mb-btn.is-loading::after {
  content: "";
  position: absolute;
  width: 16px; height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  color: #fff;
  animation: mb-spin .6s linear infinite;
}
/* Em botões ghost o spinner usa a cor do texto da variante */
.mb-btn--ghost.is-loading::after        { color: var(--brand-blue); border-right-color: transparent; }
.mb-btn--danger-ghost.is-loading::after { color: var(--danger);     border-right-color: transparent; }
@keyframes mb-spin { to { transform: rotate(360deg); } }

/* ----------------------------------------------------------------------------
   3.1 SPLIT BUTTON  (ex.: "Salvar ▾" / "Nova ▾" / "Novo registro ▾")
   ---------------------------------------------------------------------------- */
.mb-btn-split { display: inline-flex; align-items: stretch; }
.mb-btn-split > .mb-btn:first-child {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.mb-btn-split > .mb-btn__caret {
  --_bg: inherit;
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; min-height: 40px;
  border: 1px solid transparent;
  border-left: 1px solid rgba(255, 255, 255, .25);
  border-top-right-radius: var(--r-md);
  border-bottom-right-radius: var(--r-md);
  background: inherit; color: inherit; cursor: pointer;
  transition: background var(--t-fast);
}
/* O caret herda a cor da variante por reutilizar a mesma classe base */
.mb-btn-split > .mb-btn__caret svg { width: 16px; height: 16px; }

/* ============================================================================
   4. CAMPOS DE FORMULÁRIO
   ---------------------------------------------------------------------------- */
.mb-field { display: flex; flex-direction: column; gap: 6px; }
.mb-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-13); font-weight: var(--fw-semibold); color: var(--text);
}
.mb-label .req { color: var(--danger); font-weight: var(--fw-bold); }
.mb-help {
  width: 16px; height: 16px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.4px solid var(--text-subtle); color: var(--text-subtle);
  font-size: 10px; font-weight: 700; cursor: help; flex: none;
}
.mb-input, .mb-select, .mb-textarea {
  font-family: var(--font); font-size: var(--fs-14); color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-md); padding: 10px 12px; min-height: 42px; width: 100%;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.mb-textarea { min-height: 88px; resize: vertical; line-height: var(--lh-normal); }
.mb-input::placeholder, .mb-textarea::placeholder { color: var(--text-subtle); }
.mb-input:focus, .mb-select:focus, .mb-textarea:focus {
  outline: none; border-color: var(--brand-blue);
  box-shadow: var(--ring) rgba(21, 102, 157, .18);
}
.mb-input:disabled, .mb-select:disabled, .mb-textarea:disabled {
  background: var(--surface-2); color: var(--text-subtle); cursor: not-allowed;
}
/* Select com chevron desenhado */
.mb-select {
  appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%235b687a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
/* Grupo com prefixo (R$) */
.mb-input-group { display: flex; align-items: stretch; }
.mb-input-group .mb-affix {
  display: inline-flex; align-items: center; padding: 0 12px;
  background: var(--surface-2); border: 1px solid var(--border-strong); border-right: none;
  border-radius: var(--r-md) 0 0 var(--r-md); color: var(--text-muted);
  font-size: var(--fs-13); font-weight: var(--fw-semibold);
}
.mb-input-group .mb-input { border-radius: 0 var(--r-md) var(--r-md) 0; }
/* Estado de erro */
.mb-field.is-error .mb-input,
.mb-field.is-error .mb-select { border-color: var(--danger); box-shadow: var(--ring) rgba(183,24,42,.14); }
.mb-error { font-size: var(--fs-12); color: var(--danger); font-weight: var(--fw-medium); }

/* ----------------------------------------------------------------------------
   4.1 TOGGLE (pill on/off)
   ---------------------------------------------------------------------------- */
.mb-toggle { display: inline-flex; align-items: center; cursor: pointer; }
.mb-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.mb-toggle__track {
  position: relative; width: 52px; height: 28px; border-radius: var(--r-pill);
  background: #d7dde6; transition: background var(--t-base);
  display: inline-flex; align-items: center; flex: none;
}
.mb-toggle__track::after {
  content: ""; position: absolute; left: 3px; width: 22px; height: 22px;
  background: #fff; border-radius: 50%; box-shadow: var(--sh-sm);
  transition: transform var(--t-base);
}
/* ícones ✓ / ✕ dentro do track */
.mb-toggle__track::before {
  content: "✕"; position: absolute; right: 8px; font-size: 11px; font-weight: 700;
  color: var(--text-muted); transition: opacity var(--t-fast);
}
.mb-toggle input:checked + .mb-toggle__track { background: var(--success-50); box-shadow: inset 0 0 0 1.5px var(--success); }
.mb-toggle input:checked + .mb-toggle__track::after { transform: translateX(24px); }
.mb-toggle input:checked + .mb-toggle__track::before { content: "✓"; right: auto; left: 9px; color: var(--success-700); }
.mb-toggle input:focus-visible + .mb-toggle__track { box-shadow: var(--ring) rgba(21,102,157,.25); }

/* ----------------------------------------------------------------------------
   4.2 SEGMENTED CONTROL  (ex.: "Tipo da venda" / Diário·Mensal)
   ---------------------------------------------------------------------------- */
.mb-segmented { display: inline-flex; background: var(--surface-2);
  border: 1px solid var(--border-strong); border-radius: var(--r-md); padding: 3px; gap: 3px; }
.mb-segmented button {
  font-family: var(--font); font-size: var(--fs-14); font-weight: var(--fw-semibold);
  color: var(--text-muted); background: transparent; border: none; cursor: pointer;
  padding: 8px 18px; border-radius: var(--r-sm); transition: all var(--t-fast);
}
.mb-segmented button:hover { color: var(--text); }
.mb-segmented button.is-active { background: var(--brand-blue); color: #fff; }

/* ----------------------------------------------------------------------------
   4.3 TABS  (ex.: Observações / Anexo)
   ---------------------------------------------------------------------------- */
.mb-tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--border); }
.mb-tab {
  font-family: var(--font); font-size: var(--fs-14); font-weight: var(--fw-semibold);
  color: var(--text-muted); background: none; border: none; cursor: pointer;
  padding: 12px 2px; margin-bottom: -1px; border-bottom: 2px solid transparent;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.mb-tab:hover { color: var(--text); }
.mb-tab.is-active { color: var(--brand-blue); border-bottom-color: var(--brand-blue); }

/* ============================================================================
   5. DROPDOWN / MENU
   ---------------------------------------------------------------------------- */
.mb-dropdown { position: relative; display: inline-block; }
.mb-menu {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--sh-md); padding: 6px;
  min-width: 220px; z-index: var(--z-dropdown);
}
.mb-menu__item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  font-family: var(--font); font-size: var(--fs-14); color: var(--text);
  background: none; border: none; text-align: left; cursor: pointer;
  padding: 10px 12px; border-radius: var(--r-sm); transition: background var(--t-fast);
}
.mb-menu__item:hover { background: var(--surface-2); }
.mb-menu__item.is-active { background: var(--brand-blue-50); color: var(--brand-blue); font-weight: var(--fw-semibold); }
.mb-menu__sep { height: 1px; background: var(--border); margin: 6px 4px; }
.mb-menu__foot {
  display: flex; align-items: center; gap: 8px; justify-content: flex-start;
  color: var(--brand-blue); font-weight: var(--fw-semibold); font-size: var(--fs-14);
  padding: 10px 12px; border-top: 1px solid var(--border); cursor: pointer; margin-top: 4px;
}

/* 5.1 Period stepper  ‹  Maio de 2026 ▾  › */
.mb-period { display: inline-flex; align-items: stretch; border: 1px solid var(--border-strong);
  border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.mb-period button { font-family: var(--font); background: var(--surface-2); border: none;
  color: var(--brand-blue); cursor: pointer; display: inline-flex; align-items: center;
  justify-content: center; transition: background var(--t-fast); }
.mb-period button:hover { background: var(--brand-blue-50); }
.mb-period .mb-period__nav { width: 44px; }
.mb-period .mb-period__label { padding: 10px 18px; gap: 8px; font-weight: var(--fw-bold);
  border-left: 1px solid var(--border-strong); border-right: 1px solid var(--border-strong); }
.mb-period svg { width: 18px; height: 18px; }

/* 5.2 Multi-select (lista de checkbox + Aplicar) */
.mb-checkrow { display: flex; align-items: center; gap: 12px; padding: 11px 12px;
  border-bottom: 1px solid var(--border); cursor: pointer; font-size: var(--fs-14); }
.mb-checkrow:last-of-type { border-bottom: none; }
.mb-check { width: 20px; height: 20px; border-radius: var(--r-sm); border: 1.6px solid var(--border-strong);
  background: var(--surface); flex: none; display: inline-flex; align-items: center; justify-content: center;
  transition: all var(--t-fast); }
.mb-check svg { width: 13px; height: 13px; color: #fff; opacity: 0; }
.mb-checkrow input { position: absolute; opacity: 0; }
.mb-checkrow input:checked + .mb-check { background: var(--brand-blue); border-color: var(--brand-blue); }
.mb-checkrow input:checked + .mb-check svg { opacity: 1; }

/* 5.3 Menu de conta / configurações (variante larga do .mb-menu) --------- */
.mb-menu--account { min-width: 320px; padding: 0; }
.mb-menu--account .mb-menu__sep { margin: 0; }

.mb-menu__header { display: flex; gap: 14px; align-items: flex-start; padding: 18px; }
.mb-menu__avatar { width: 56px; height: 56px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-blue-50); color: var(--brand-blue); }
.mb-menu__avatar svg { width: 30px; height: 30px; }
.mb-menu__identity { min-width: 0; }
.mb-menu__company { font-weight: var(--fw-bold); color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-menu__name { font-size: var(--fs-14); color: var(--text); }
.mb-menu__support { display: inline-flex; align-items: center; gap: 8px;
  font-size: var(--fs-13); color: var(--text-muted); margin-top: 2px; }
.mb-menu__support b { color: var(--text); font-weight: var(--fw-bold); }
.mb-menu__copy { display: inline-flex; background: none; border: none; cursor: pointer;
  color: var(--brand-blue); padding: 2px; border-radius: var(--r-sm); }
.mb-menu__copy:hover { background: var(--brand-blue-50); }
.mb-menu__copy svg { width: 16px; height: 16px; }

/* corpo com grupos (cada grupo = título com ícone + links-filhos opcionais) */
.mb-menu__body { padding: 8px 8px 6px; }
.mb-menu__group + .mb-menu__group { margin-top: 2px; }
.mb-menu__grouptitle { display: flex; align-items: center; gap: 10px; width: 100%;
  font-family: var(--font); font-size: var(--fs-14); font-weight: var(--fw-bold);
  color: var(--text); background: none; border: none; text-align: left; cursor: pointer;
  padding: 9px 12px; border-radius: var(--r-sm); transition: background var(--t-fast); }
.mb-menu__grouptitle:hover { background: var(--surface-2); text-decoration: none; }
.mb-menu__grouptitle.is-active { color: var(--brand-blue); }
.mb-menu__ico { display: inline-flex; align-items: center; justify-content: center;
  width: 18px; flex: none; color: var(--text-muted); }
.mb-menu__grouptitle svg { width: 18px; height: 18px; }
.mb-menu__grouptitle.is-active .mb-menu__ico { color: var(--brand-blue); }
/* monograma circular (ex.: "CA" em Conta PJ) no lugar do ícone */
.mb-menu__mono { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid currentColor;
  display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted);
  font-size: 9px; font-weight: var(--fw-bold); flex: none; }
/* links-filhos: indentados sob o título (alinham após o ícone: 12+18+10=40px) */
.mb-menu__sublink { display: block; font-size: var(--fs-14); color: var(--link);
  padding: 8px 12px 8px 40px; border-radius: var(--r-sm); cursor: pointer; }
.mb-menu__sublink:hover { background: var(--surface-2); text-decoration: none; }

/* rodapé: itens com ícone (Termos de uso / Sair) */
.mb-menu__footlinks { padding: 6px 8px 8px; }
.mb-menu__footlink { display: flex; align-items: center; gap: 10px; width: 100%;
  font-family: var(--font); font-size: var(--fs-14); color: var(--link);
  background: none; border: none; text-align: left; cursor: pointer;
  padding: 9px 12px; border-radius: var(--r-sm); transition: background var(--t-fast); }
.mb-menu__footlink:hover { background: var(--surface-2); text-decoration: none; }
.mb-menu__footlink svg { width: 18px; height: 18px; flex: none; }

/* ============================================================================
   6. KPI STRIP
   ---------------------------------------------------------------------------- */
.mb-kpi-strip { display: flex; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden; }
.mb-kpi { flex: 1; padding: 16px 20px; text-align: center; border-right: 1px solid var(--border);
  border-top: 3px solid transparent; }
.mb-kpi:last-child { border-right: none; }
.mb-kpi.is-active { border-top-color: var(--brand-blue); background: var(--surface); }
.mb-kpi__label { font-size: var(--fs-13); color: var(--text-muted); margin-bottom: 6px; }
.mb-kpi__value { font-size: var(--fs-20); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.mb-kpi__value.is-pos { color: var(--positive); }
.mb-kpi__value.is-neg { color: var(--negative); }
.mb-kpi__value.is-info { color: var(--brand-blue); }

/* ============================================================================
   7. TABELAS
   ---------------------------------------------------------------------------- */
.mb-table { width: 100%; border-collapse: collapse; font-size: var(--fs-14); background: var(--surface); }
.mb-table thead th { background: var(--surface-2); color: var(--text-muted); font-weight: var(--fw-semibold);
  font-size: var(--fs-13); text-align: left; padding: 14px 16px; white-space: nowrap; }
.mb-table thead th .mb-sort { display: inline-flex; vertical-align: middle; margin-left: 6px; color: var(--text-subtle); }
.mb-table tbody td { padding: 14px 16px; border-top: 1px solid var(--border); vertical-align: middle; }
.mb-table tbody tr:hover { background: var(--surface-2); }
.mb-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.mb-table .mb-desc__link { color: var(--brand-blue); font-weight: var(--fw-semibold); }
.mb-table .mb-desc__sub { display: inline-block; margin-top: 4px; }
.mb-subtag { display: inline-block; font-size: var(--fs-11); color: var(--text-muted);
  background: var(--bg-subtle); border-radius: var(--r-sm); padding: 2px 7px; }
.mb-clip { color: var(--text-subtle); width: 16px; height: 16px; vertical-align: middle; }
/* linha de exceção (vencido) — borda esquerda vermelha */
.mb-table tr.is-overdue td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
/* linha histórica esmaecida */
.mb-table tr.is-muted td { color: var(--text-subtle); }

/* 7.1 Tabela-matriz (grade completa, fluxo mensal) */
.mb-matrix { width: 100%; border-collapse: collapse; font-size: var(--fs-13); background: var(--surface); }
.mb-matrix th, .mb-matrix td { border: 1px solid var(--border); padding: 12px 16px; }
.mb-matrix thead th { background: var(--surface-2); color: var(--text-muted); font-weight: var(--fw-semibold); text-align: center; }
.mb-matrix tbody th { text-align: left; font-weight: var(--fw-medium); color: var(--text); position: relative; }
.mb-matrix tbody td { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.mb-matrix tr.row-rec th { box-shadow: inset 4px 0 0 var(--positive); }
.mb-matrix tr.row-pag th { box-shadow: inset 4px 0 0 var(--danger); }
.mb-matrix tr.row-tra th { box-shadow: inset 4px 0 0 var(--brand-blue); }
.mb-matrix tr.is-strong td, .mb-matrix tr.is-strong th { font-weight: var(--fw-bold); }

/* ============================================================================
   8. PILLS & CHIPS
   ---------------------------------------------------------------------------- */
.mb-pill { display: inline-flex; align-items: center; font-size: var(--fs-12);
  font-weight: var(--fw-semibold); padding: 4px 12px; border-radius: var(--r-pill); white-space: nowrap; }
.mb-pill--paid    { background: var(--pill-paid-bg);    color: var(--pill-paid-fg); }
.mb-pill--open    { background: var(--pill-open-bg);    color: var(--pill-open-fg); }
.mb-pill--partial { background: var(--pill-partial-bg); color: var(--pill-partial-fg); }
.mb-pill--overdue { background: var(--pill-overdue-bg); color: var(--pill-overdue-fg); }
/* badge "Novo" (nav) */
.mb-badge-new { background: var(--brand-blue-50); color: var(--brand-blue);
  font-size: var(--fs-11); font-weight: var(--fw-bold); padding: 3px 9px; border-radius: var(--r-pill); }

/* Chip de filtro removível */
.mb-chip { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-13);
  color: var(--brand-blue); background: var(--brand-blue-50); border: 1px solid transparent;
  padding: 6px 8px 6px 12px; border-radius: var(--r-pill); }
.mb-chip button { display: inline-flex; background: none; border: none; cursor: pointer;
  color: var(--brand-blue); padding: 2px; border-radius: 50%; }
.mb-chip button:hover { background: rgba(21,102,157,.15); }
.mb-clear { display: inline-flex; align-items: center; gap: 6px; color: var(--brand-blue);
  font-size: var(--fs-13); font-weight: var(--fw-semibold); cursor: pointer; background: none; border: none; }

/* ============================================================================
   9. MODAIS
   ---------------------------------------------------------------------------- */
.mb-overlay { position: fixed; inset: 0; background: var(--overlay); display: grid; place-items: center;
  z-index: var(--z-modal); padding: 24px; }
.mb-modal { background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--sh-lg);
  width: 100%; max-width: 520px; overflow: hidden; }
.mb-modal__head { display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border); }
.mb-modal__head h3 { margin: 0; font-size: var(--fs-18); font-weight: var(--fw-bold); color: var(--text); }
.mb-modal__close { background: none; border: none; cursor: pointer; color: var(--text-muted);
  width: 32px; height: 32px; border-radius: var(--r-sm); display: inline-flex; align-items: center; justify-content: center; }
.mb-modal__close:hover { background: var(--surface-2); }
.mb-modal__body { padding: 20px 24px; color: var(--text); }
.mb-modal__foot { display: flex; justify-content: space-between; gap: 12px;
  padding: 16px 24px 20px; }
.mb-modal__foot.is-end { justify-content: flex-end; }
.mb-modal__foot.is-center { justify-content: center; }
/* variante anúncio de feature: borda superior azul + corpo centralizado */
.mb-modal--feature { max-width: 460px; border-top: 4px solid var(--brand-blue); text-align: center; }
.mb-modal--feature .mb-modal__body { padding: 28px 32px; }
.mb-modal__illus { width: 96px; height: 96px; margin: 0 auto 18px; color: var(--brand-blue); }

/* ============================================================================
   10. EMPTY STATE
   ---------------------------------------------------------------------------- */
.mb-empty { display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 48px 24px; color: var(--text-muted); }
.mb-empty__illus { width: 132px; height: 110px; margin-bottom: 18px; }
.mb-empty__title { font-size: var(--fs-18); font-weight: var(--fw-bold); color: var(--text); margin: 0 0 6px; }
.mb-empty__sub { font-size: var(--fs-14); color: var(--text-muted); margin: 0; }

/* ============================================================================
   11. DATEPICKER / CALENDÁRIO
   ----------------------------------------------------------------------------
   Campo-gatilho (visual de campo) + popover de calendário (.mb-cal).
   Navegação de mês = mesmo padrão de setas do period stepper.
   Dia selecionado / extremos de intervalo = --brand-blue (igual KPI/segmented).
   Variantes: single (padrão) e .mb-cal--range (faixa --brand-blue-50 entre
   os extremos). Demo estático na galeria; lógica de datas vem na migração PHP.
   ---------------------------------------------------------------------------- */
.mb-datepicker { position: relative; display: inline-block; }

/* Campo-gatilho — herda o visual do .mb-input, com ícone de calendário */
.mb-datefield {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font); font-size: var(--fs-14); color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-md); padding: 0 12px; min-height: 42px; min-width: 210px;
  cursor: pointer; transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.mb-datefield:hover { border-color: var(--brand-blue); }
.mb-datefield:focus-visible,
.mb-datefield.is-open { outline: none; border-color: var(--brand-blue);
  box-shadow: var(--ring) rgba(21, 102, 157, .18); }
.mb-datefield svg { width: 18px; height: 18px; color: var(--text-muted); flex: none; }
.mb-datefield__val { flex: 1; text-align: left; }
.mb-datefield.is-placeholder .mb-datefield__val { color: var(--text-subtle); }

/* Popover do calendário */
.mb-cal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--sh-md);
  padding: 14px; width: 300px; z-index: var(--z-dropdown);
}
.mb-cal--range { width: 320px; }

/* Cabeçalho: ‹  Maio de 2026  › */
.mb-cal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mb-cal__nav {
  width: 34px; height: 34px; border-radius: var(--r-md); border: none;
  background: transparent; color: var(--brand-blue); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--t-fast);
}
.mb-cal__nav:hover { background: var(--brand-blue-50); }
.mb-cal__nav svg { width: 18px; height: 18px; }
.mb-cal__title {
  font-family: var(--font); font-size: var(--fs-14); font-weight: var(--fw-bold);
  color: var(--text); background: none; border: none; cursor: pointer;
  padding: 6px 10px; border-radius: var(--r-sm); transition: background var(--t-fast);
}
.mb-cal__title:hover { background: var(--surface-2); }

/* Cabeçalho dos dias da semana */
.mb-cal__dow { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 2px; }
.mb-cal__dow span {
  text-align: center; font-size: var(--fs-11); font-weight: var(--fw-semibold);
  color: var(--text-subtle); padding: 6px 0; text-transform: lowercase;
}

/* Grade de dias */
.mb-cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.mb-cal__cell { display: flex; align-items: center; justify-content: center; padding: 1px 0; }
.mb-cal__day {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font); font-size: var(--fs-13); color: var(--text);
  background: transparent; border: none; cursor: pointer; position: relative;
  transition: background var(--t-fast), color var(--t-fast);
}
.mb-cal__day:hover { background: var(--brand-blue-50); }
.mb-cal__day.is-muted { color: var(--text-subtle); }            /* dia de outro mês */
.mb-cal__day.is-today { box-shadow: inset 0 0 0 1.5px var(--brand-blue); font-weight: var(--fw-bold); }
.mb-cal__day.is-selected { background: var(--brand-blue); color: #fff; }
.mb-cal__day.is-selected:hover { background: var(--brand-blue-700); }
.mb-cal__day[disabled] { color: var(--text-subtle); opacity: .5; cursor: not-allowed; pointer-events: none; }

/* Intervalo: a faixa fica na CÉLULA (atrás do círculo) p/ ficar contínua */
.mb-cal--range .mb-cal__cell.is-in-range    { background: var(--brand-blue-50); }
.mb-cal--range .mb-cal__cell.is-range-start { background: linear-gradient(to right, transparent 50%, var(--brand-blue-50) 50%); }
.mb-cal--range .mb-cal__cell.is-range-end   { background: linear-gradient(to left,  transparent 50%, var(--brand-blue-50) 50%); }
.mb-cal--range .mb-cal__day.is-range-start,
.mb-cal--range .mb-cal__day.is-range-end    { background: var(--brand-blue); color: #fff; }

/* Rodapé: atalho de texto (Hoje/Limpar) + Aplicar (azul sólido = secundária) */
.mb-cal__foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--border);
}

/* ============================================================================
   12. BANNERS
   ----------------------------------------------------------------------------
   Faixa de comunicação. Família semântica na mesma lógica das pills
   (referencia tokens; sem hex solto). Cross-sell = navy + accent laranja
   (derivado de tokens — decisão 2026-05-29; sem hex novo); CTA usa o verde
   principal pelo contraste sobre navy (laranja segue "nunca em botão").
   Base = full-bleed (topo de página/topbar); .mb-banner--inline arredonda.
   ---------------------------------------------------------------------------- */
.mb-banner {
  display: flex; align-items: center; gap: 12px; padding: 12px 18px;
  font-size: var(--fs-14); color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-left-width: 4px;
}
.mb-banner__icon { width: 20px; height: 20px; flex: none; }
.mb-banner__body { flex: 1; }
.mb-banner__body strong { font-weight: var(--fw-bold); }
.mb-banner__actions { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.mb-banner__close {
  background: none; border: none; cursor: pointer; color: inherit; opacity: .6;
  width: 28px; height: 28px; border-radius: var(--r-sm); flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  transition: opacity var(--t-fast), background var(--t-fast);
}
.mb-banner__close:hover { opacity: 1; background: rgba(10, 29, 58, .07); }
.mb-banner__close svg { width: 16px; height: 16px; }
.mb-banner--inline { border-radius: var(--r-lg); }

/* Variantes semânticas (tints existentes; bordas laterais nos tokens-base) */
.mb-banner--warning { background: var(--warning-bg);    border-left-color: var(--warning); }
.mb-banner--info    { background: var(--brand-blue-50);  border-left-color: var(--brand-blue); }
.mb-banner--success { background: var(--success-50);     border-left-color: var(--success); }
.mb-banner--danger  { background: var(--danger-50);      border-left-color: var(--danger); }
.mb-banner--warning .mb-banner__icon { color: var(--warning); }
.mb-banner--info    .mb-banner__icon { color: var(--brand-blue); }
.mb-banner--success .mb-banner__icon { color: var(--success-700); }
.mb-banner--danger  .mb-banner__icon { color: var(--danger); }
.mb-banner--warning .mb-banner__body strong { color: var(--warning); }

/* Cross-sell (promocional) — navy + accent laranja; CTA verde */
.mb-banner--crosssell {
  background: linear-gradient(95deg, var(--navy) 0%, var(--navy-700) 100%);
  color: var(--text-on-dark); border: none;
}
.mb-banner--crosssell .mb-banner__icon { color: var(--brand-orange); }
.mb-banner--crosssell .mb-accent { color: var(--brand-orange); font-weight: var(--fw-bold); }
.mb-banner--crosssell .mb-banner__close { color: var(--text-on-dark); }
.mb-banner--crosssell .mb-banner__close:hover { background: rgba(255, 255, 255, .14); }

/* ============================================================================
   13. PAGINAÇÃO
   ----------------------------------------------------------------------------
   Per-page (.mb-select) + páginas numéricas + "Ir para página".
   Página ativa = --brand-blue sólido (igual KPI/segmented ativo).
   ---------------------------------------------------------------------------- */
.mb-pagination {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px; font-size: var(--fs-13); color: var(--text-muted);
}
.mb-pagination__info { display: inline-flex; align-items: center; gap: 8px; }
.mb-pagination__info .mb-select { min-height: 34px; padding: 6px 30px 6px 10px; width: auto; }
.mb-pagination__nav { display: inline-flex; align-items: center; gap: 6px; }

.mb-pg {
  min-width: 36px; height: 36px; padding: 0 8px; border-radius: var(--r-md);
  border: 1px solid var(--border-strong); background: var(--surface);
  font-family: var(--font); font-size: var(--fs-13); font-weight: var(--fw-semibold);
  color: var(--text); cursor: pointer; transition: all var(--t-fast);
  display: inline-flex; align-items: center; justify-content: center;
}
.mb-pg:hover { border-color: var(--brand-blue); color: var(--brand-blue); background: var(--brand-blue-50); }
.mb-pg.is-active { background: var(--brand-blue); border-color: var(--brand-blue); color: #fff; }
.mb-pg[disabled] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.mb-pg svg { width: 16px; height: 16px; }
.mb-pg--icon { padding: 0; }
.mb-pg__gap { min-width: 22px; text-align: center; color: var(--text-subtle); user-select: none; }

.mb-pagination__jump { display: inline-flex; align-items: center; gap: 8px; }
.mb-pagination__jump .mb-input { width: 64px; min-height: 36px; padding: 6px 10px; text-align: center; }

/* ============================================================================
   14. DASHBOARD — card, stat-card, lista de contas, charts (SVG), layout
   ----------------------------------------------------------------------------
   Primitivos da tela inicial (amostrados do dashboard da Conta Azul).
   Charts são SVG puro (zero dependência, igual ao resto do DS); as cores vêm
   de classes que apontam para os tokens — NENHUM hex dentro do SVG.
   ---------------------------------------------------------------------------- */

/* 14. Card genérico (cabeçalho opcional + corpo) -------------------------- */
.mb-card { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); box-shadow: var(--sh-sm); }
.mb-card__head { display: flex; align-items: center; gap: 10px;
  padding: 18px 22px; border-bottom: 1px solid var(--border); }
.mb-card__title { font-size: var(--fs-20); font-weight: var(--fw-bold);
  color: var(--text); margin: 0; }
.mb-card__body { padding: 22px; }

/* Tag de rótulo (ex.: "Demonstração" âmbar) — neutra/semântica ------------ */
.mb-tag { display: inline-block; font-size: var(--fs-12); font-weight: var(--fw-semibold);
  padding: 3px 10px; border-radius: var(--r-pill); }
.mb-tag--demo { background: var(--warning-bg); color: var(--warning); }

/* 14.1 Stat-card (KPI elevado: prefixo R$ + valor grande + rótulo) -------- */
.mb-stat { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); box-shadow: var(--sh-sm); padding: 22px 24px; text-align: center; }
.mb-stat__value { font-size: var(--fs-30); font-weight: var(--fw-bold);
  line-height: var(--lh-tight); font-variant-numeric: tabular-nums; }
.mb-stat__value .mb-stat__cur { font-size: var(--fs-16); font-weight: var(--fw-semibold);
  margin-right: 3px; }                 /* "R$" herda a cor do valor */
.mb-stat__value.is-pos { color: var(--positive); }
.mb-stat__value.is-neg { color: var(--negative); }
.mb-stat__label { font-size: var(--fs-14); font-weight: var(--fw-semibold);
  color: var(--text); margin-top: 8px; }
.mb-stat__sub { font-size: var(--fs-13); color: var(--text-muted); margin-top: 2px; }

/* Grupo de stat-cards com título (ex.: "A receber" / "A pagar") ----------- */
.mb-stat-group__head { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.mb-stat-group__title { font-size: var(--fs-20); font-weight: var(--fw-bold); color: var(--text); }

/* 14.2 Lista de contas financeiras (dentro de um card) ------------------- */
.mb-acct-total { text-align: center; padding: 2px 0 18px; }
.mb-acct-total__value { font-size: var(--fs-24); font-weight: var(--fw-bold); color: var(--text); }
.mb-acct-total__label { font-size: var(--fs-13); color: var(--text-muted); }
.mb-acct { display: flex; gap: 14px; align-items: flex-start;
  border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; }
.mb-acct + .mb-acct { margin-top: 14px; }
.mb-acct__logo { width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-weight: var(--fw-bold); font-size: var(--fs-14); color: var(--text-on-dark); }
.mb-acct__body { flex: 1; min-width: 0; }
.mb-acct__name { font-weight: var(--fw-bold); color: var(--text); }
.mb-acct__type { font-size: var(--fs-13); color: var(--text-muted); }
.mb-acct__value { font-size: var(--fs-14); color: var(--text); margin-top: 2px; }
.mb-acct__foot { margin-top: 10px; }
.mb-acct__link { font-size: var(--fs-13); font-weight: var(--fw-semibold); color: var(--link); }

/* 14.3 Charts (SVG puro) -------------------------------------------------- */
.mb-chart svg { display: block; width: 100%; height: auto; font-family: var(--font); overflow: visible; }
.mb-chart .mb-grid-mid   { stroke: var(--border); stroke-width: 1; }
.mb-chart .mb-grid--zero { stroke: var(--border-strong); stroke-width: 1.5; }
.mb-chart .mb-axis-label    { fill: var(--text-subtle); font-size: 11px; }
.mb-chart .mb-axis-label--x { fill: var(--text-muted); font-size: 12px; }
.mb-chart .mb-bar--pos { fill: var(--positive); }   /* recebimentos / faturamento */
.mb-chart .mb-bar--neg { fill: var(--danger); }      /* pagamentos */
.mb-chart .mb-line { fill: none; stroke: var(--navy); stroke-width: 2;
  stroke-linejoin: round; stroke-linecap: round; }
.mb-chart .mb-line__dot { fill: var(--navy); }

/* Legenda do chart */
.mb-chart__legend { display: flex; flex-wrap: wrap; justify-content: center;
  gap: 20px; margin-top: 14px; }
.mb-chart__legend-item { display: inline-flex; align-items: center; gap: 7px;
  font-size: var(--fs-13); color: var(--text-muted); }
.mb-chart__swatch { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.mb-chart__swatch--pos  { background: var(--positive); }
.mb-chart__swatch--neg  { background: var(--danger); }
.mb-chart__swatch--line { width: 18px; height: 2px; border-radius: 0; background: var(--navy); }

/* 14.4 Layout do dashboard (grids responsivos) --------------------------- */
.mb-dash-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.mb-stat-grid  { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mb-dash-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px; margin-top: 24px; }
@media (max-width: 720px) {
  .mb-dash-stats { grid-template-columns: 1fr; }
}

/* ============================================================================
   15. ASSISTENTE (Levi) — avatar · chip · ação de IA · painel · welcome · análise
   ----------------------------------------------------------------------------
   Porte fiel do assistente "Levi" do mockup dre_v105 para os tokens do DS.
   Mapeamento de cor:
     mockup --azul (#08212e, fazia papel duplo de navy+texto):
        · como SUPERFÍCIE escura (header do painel, bolha do usuário, enviar) → --navy
        · como ÊNFASE de texto (negrito na bolha do bot)                      → --brand-blue
     mockup --laranja → --brand-orange (anel do avatar, ponto do rodapé, sub-label)
   Ação de IA usa o azul do sistema (--brand-blue) — sem cor fora da paleta CA.
   Os translúcidos rgba(255,255,255,…) são o tratamento "sobre navy" (sem token
   próprio no DS, mantidos do mockup — mesma lógica do gx-nav sobre o rail).
   ---------------------------------------------------------------------------- */

/* 15. Avatar (primitivo reutilizável; Levi é uma instância) --------------- */
.mb-avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden;
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-blue-50); }
.mb-avatar__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mb-avatar__fallback { width: 100%; height: 100%; display: flex; align-items: center;
  justify-content: center; font-weight: var(--fw-bold); color: var(--text-on-dark);
  background: var(--navy); font-size: var(--fs-14); }
.mb-avatar--sm { width: 26px; height: 26px; }
.mb-avatar--sm .mb-avatar__fallback { font-size: var(--fs-11); }
.mb-avatar--lg { width: 56px; height: 56px; }
.mb-avatar--ring { border: 1.5px solid var(--brand-orange); }

/* 15.1 Chip do assistente (gatilho no header; vive SOBRE superfície navy) - */
.mb-assistant-chip { display: inline-flex; align-items: center; gap: 7px;
  padding: 3px 12px 3px 3px; border-radius: var(--r-pill);
  border: 1px solid rgba(255,255,255,.20); background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.85); font-family: var(--font); font-size: var(--fs-14);
  font-weight: var(--fw-semibold); letter-spacing: -.01em; cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast); }
.mb-assistant-chip:hover { background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.35); color: #fff; }
.mb-assistant-chip:active { transform: scale(.97); }
.mb-assistant-chip__label { line-height: 1; }

/* 15.2 Ação de IA ("Analisar oportunidades") — chip azul (cor de ação do DS) */
.mb-ai-action { display: inline-flex; align-items: center; gap: 5px;
  background: var(--brand-blue-50); color: var(--brand-blue); padding: 3px 8px;
  border-radius: var(--r-sm); font-size: var(--fs-11); font-weight: var(--fw-semibold);
  border: none; cursor: pointer; font-family: var(--font); line-height: 1.3;
  transition: background var(--t-fast), color var(--t-fast); }
.mb-ai-action:hover { background: var(--brand-blue); color: #fff; }
.mb-ai-action svg { width: 13px; height: 13px; }

/* 15.3 Painel do assistente (drawer lateral conversacional) -------------- */
.mb-assistant__overlay { position: fixed; inset: 0; background: var(--overlay);
  backdrop-filter: blur(3px); z-index: var(--z-modal); opacity: 0;
  transition: opacity var(--t-base); }
.mb-assistant__overlay.is-open { opacity: 1; }
.mb-assistant { position: fixed; top: 0; right: 0; width: 400px; max-width: 92vw;
  height: 100vh; background: var(--surface); box-shadow: var(--sh-lg);
  z-index: calc(var(--z-modal) + 1); transform: translateX(100%);
  transition: transform var(--t-base); display: flex; flex-direction: column;
  font-family: var(--font); }
.mb-assistant.is-open { transform: translateX(0); }
.mb-assistant__header { background: var(--navy); color: var(--text-on-dark);
  padding: 14px 16px; display: flex; align-items: center; gap: 11px; flex: none; }
.mb-assistant__heading { flex: 1; min-width: 0; }
.mb-assistant__heading h3 { margin: 0; font-size: var(--fs-14); font-weight: var(--fw-bold);
  letter-spacing: -.01em; }
.mb-assistant__sub { font-size: var(--fs-11); color: rgba(255,255,255,.7);
  font-weight: var(--fw-medium); margin-top: 2px; }
.mb-assistant__sub strong { color: var(--brand-orange); font-weight: var(--fw-bold); }
.mb-assistant__close { background: none; border: none; color: rgba(255,255,255,.65);
  font-size: 22px; line-height: 1; cursor: pointer; padding: 0 4px; font-family: var(--font); }
.mb-assistant__close:hover { color: #fff; }
.mb-assistant__body { flex: 1; overflow-y: auto; padding: 16px 16px 12px;
  background: var(--bg); scroll-behavior: smooth; }
.mb-assistant__footer { flex: none; padding: 10px 12px 12px; background: var(--surface);
  border-top: 1px solid var(--border); }
.mb-assistant__inputrow { display: flex; gap: 6px; }
.mb-assistant__input { flex: 1; min-width: 0; border: 1px solid var(--border-strong);
  border-radius: var(--r-lg); padding: 8px 10px; font-size: var(--fs-13);
  font-family: var(--font); color: var(--text); background: var(--bg); outline: none;
  transition: border-color var(--t-fast), background var(--t-fast); }
.mb-assistant__input:focus { border-color: var(--brand-blue); background: var(--surface); }
.mb-assistant__input::placeholder { color: var(--text-subtle); }
.mb-assistant__send { background: var(--navy); border: 1px solid var(--navy);
  color: #fff; padding: 0 14px; border-radius: var(--r-lg); cursor: pointer;
  font-size: var(--fs-12); font-weight: var(--fw-semibold); font-family: var(--font);
  flex: none; transition: background var(--t-fast), border-color var(--t-fast); }
.mb-assistant__send:hover { background: var(--navy-700); border-color: var(--navy-700); }
.mb-assistant__send:disabled { background: var(--border); border-color: var(--border);
  color: var(--text-subtle); cursor: default; }
.mb-assistant__note { font-size: var(--fs-11); color: var(--text-subtle); text-align: center;
  margin-top: 6px; }
.mb-assistant__note-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: var(--brand-orange); margin-right: 4px; vertical-align: 1px; }

/* 15.4 Bolhas de conversa (dentro do painel) ----------------------------- */
.mb-assistant__msg { display: flex; gap: 8px; margin-bottom: 12px; }
.mb-assistant__msg--bot { justify-content: flex-start; }
.mb-assistant__msg--user { justify-content: flex-end; }
.mb-assistant__bubble { max-width: 88%; padding: 9px 12px; border-radius: var(--r-lg);
  font-size: var(--fs-13); line-height: var(--lh-normal); color: var(--text);
  word-wrap: break-word; }
.mb-assistant__msg--bot .mb-assistant__bubble { background: var(--surface);
  border: 1px solid var(--border); border-top-left-radius: var(--r-sm); box-shadow: var(--sh-sm); }
.mb-assistant__msg--bot .mb-assistant__bubble strong { color: var(--brand-blue); font-weight: var(--fw-bold); }
.mb-assistant__msg--user .mb-assistant__bubble { background: var(--navy); color: #fff;
  border-top-right-radius: var(--r-sm); }
.mb-assistant__msg--user .mb-assistant__bubble strong { color: #fff; }
.mb-assistant__chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.mb-assistant__chip { background: var(--surface); border: 1px solid var(--border);
  color: var(--text); padding: 7px 11px; border-radius: var(--r-pill); font-size: var(--fs-12);
  font-weight: var(--fw-medium); cursor: pointer; line-height: 1.2; text-align: left;
  font-family: var(--font); transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast); }
.mb-assistant__chip:hover { background: var(--brand-blue); border-color: var(--brand-blue); color: #fff; }
.mb-assistant__chip:disabled { opacity: .5; cursor: default; pointer-events: none; }

/* 15.5 Welcome popover (1ª visita; em produção é position:fixed + JS) ----- */
.mb-assistant-welcome { position: relative; width: 240px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-md);
  padding: 11px 28px 11px 14px; font-family: var(--font); }
.mb-assistant-welcome::before { content: ''; position: absolute; top: -6px; right: 24px;
  width: 12px; height: 12px; background: var(--surface); border-left: 1px solid var(--border);
  border-top: 1px solid var(--border); transform: rotate(45deg); }
.mb-assistant-welcome p { margin: 0 0 4px; font-size: var(--fs-12); color: var(--text);
  line-height: var(--lh-normal); }
.mb-assistant-welcome p:last-child { margin-bottom: 0; }
.mb-assistant-welcome strong { color: var(--brand-blue); font-weight: var(--fw-bold); }
.mb-assistant-welcome__cta { color: var(--text-subtle); font-size: var(--fs-11); }
.mb-assistant-welcome__close { position: absolute; top: 2px; right: 4px; background: none;
  border: none; font-size: 16px; line-height: 1; color: var(--text-subtle); cursor: pointer;
  padding: 3px 6px; font-family: var(--font); }
.mb-assistant-welcome__close:hover { color: var(--text); }

/* 15.6 Análise de IA (conteúdo de modal gerado pelo Levi) ---------------- */
.mb-ai-analysis { font-size: var(--fs-13); color: var(--text-muted); line-height: 1.55; padding: 4px 0; }
.mb-ai-analysis p { margin: 0 0 10px; }
.mb-ai-analysis ol { padding-left: 22px; margin: 8px 0; }
.mb-ai-analysis li { margin-bottom: 8px; }
.mb-ai-analysis strong { color: var(--text); }
.mb-ai-analysis code { background: var(--surface-2); padding: 1px 5px; border-radius: var(--r-sm);
  font-size: var(--fs-12); color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.mb-ai-analysis em { color: var(--text-subtle); font-size: var(--fs-12); }

/* Responsivo: painel ocupa a tela em telas pequenas */
@media (max-width: 600px) {
  .mb-assistant { width: 100vw; max-width: 100vw; }
}
