/* ==========================================================================
   Autoprotecta v2 — folha de estilo da aplicação

   Sem framework de CSS e sem passo de build: o servidor IIS serve este arquivo
   direto. As cores NUNCA aparecem cravadas aqui — vêm das variáveis que o
   layout injeta a partir da marca do tenant (App\Domain\Tenant\Branding).

   Sumário
     1. Reset e tokens
     2. Tipografia e utilitários
     3. Shell (sidebar, topbar, conteúdo)
     4. Componentes (cards, botões, tabelas, badges, alertas, formulários)
     5. Telas específicas
     6. Animações
     7. Responsivo
   ========================================================================== */

/* ============================ 1. Reset e tokens =========================== */

*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

:root {
    /* Sobrescritos em runtime pelo tenant — estes são apenas o fallback. */
    --brand-primary: #FB4516;
    --brand-primary-dark: #e03d12;
    --brand-primary-light: #ff6b3d;
    --brand-primary-rgb: 251, 69, 22;
    --brand-ink: #0C0C0C;
    --brand-surface: #F5F5F5;
    --brand-line: #E2E2E2;

    --c-white: #ffffff;
    --c-text: #17181A;
    --c-text-soft: #5B6067;
    --c-text-faint: #8A9099;
    --c-success: #10B981;
    --c-success-bg: #ECFDF5;
    --c-warning: #F59E0B;
    --c-warning-bg: #FFFBEB;
    --c-danger: #EF4444;
    --c-danger-bg: #FEF2F2;
    --c-info: #3B82F6;
    --c-info-bg: #EFF6FF;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --radius-full: 999px;

    --shadow-sm: 0 1px 2px rgba(12, 12, 12, .06);
    --shadow: 0 2px 8px rgba(12, 12, 12, .07);
    --shadow-lg: 0 12px 32px rgba(12, 12, 12, .12);

    --sidebar-w: 264px;
    --sidebar-w-collapsed: 76px;
    --topbar-h: 68px;
    --drawer-width: 50%;
    --drawer-z: 60;

    --font: 'Satoshi', 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI',
            Roboto, Helvetica, Arial, sans-serif;
    --font-mono: ui-monospace, 'Cascadia Mono', 'Segoe UI Mono', Consolas, monospace;

    --ease: cubic-bezier(.4, 0, .2, 1);
}

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--c-text);
    background: var(--brand-surface);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
svg { width: 1.25em; height: 1.25em; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
ul, ol { list-style: none; }
table { border-collapse: collapse; width: 100%; }

[x-cloak] { display: none !important; }

::selection { background: rgba(var(--brand-primary-rgb), .22); }

:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/*
 * Pular para o conteúdo — primeiro foco da página.
 *
 * Quem navega por teclado ou leitor de tela não deveria percorrer os ~25 links
 * da sidebar em toda troca de tela. Fica fora da viewport até receber foco.
 */
.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 200;
    padding: 10px 18px;
    background: var(--brand-ink);
    color: #fff;
    font-weight: 600;
    font-size: .88rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    transform: translateY(calc(-100% - 20px));
    transition: transform .18s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

/* ==================== 2. Tipografia e utilitários ==================== */

h1, h2, h3, h4 { font-weight: 700; line-height: 1.25; letter-spacing: -.015em; }
h1 { font-size: 1.4rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }

.muted   { color: var(--c-text-soft); }
.faint   { color: var(--c-text-faint); }
.small   { font-size: .82rem; }
.tiny    { font-size: .72rem; }
.strong  { font-weight: 700; }
.mono    { font-family: var(--font-mono); font-size: .85em; }
.nowrap  { white-space: nowrap; }
.right   { text-align: right; }
.center  { text-align: center; }
.uppercase { text-transform: uppercase; letter-spacing: .08em; }
.text-primary { color: var(--brand-primary); }
.text-success { color: var(--c-success); }
.text-danger  { color: var(--c-danger); }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.stack     { display: flex; flex-direction: column; gap: 20px; }
.stack-sm  { display: flex; flex-direction: column; gap: 10px; }
.mt-2      { margin-top: 8px; }
.mt-3      { margin-top: 14px; }
.row       { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row-top   { align-items: flex-start; }
.wrap      { flex-wrap: wrap; }
.grow      { flex: 1; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-sidebar { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

/* ========================= 3. Shell da aplicação ========================= */

.app-shell { display: flex; min-height: 100vh; }

/* ---- Sidebar ---- */

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-w);
    background: var(--brand-ink);
    color: rgba(255, 255, 255, .82);
    transition: width .22s var(--ease);
}

.sidebar-collapsed .app-sidebar { width: var(--sidebar-w-collapsed); }

.sidebar-brand {
    position: relative;
    display: flex;
    align-items: center;
    height: var(--topbar-h);
    padding: 0 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.sidebar-brand img { height: 30px; width: auto; }
.sidebar-brand-icon { display: none; }

.sidebar-collapsed .sidebar-brand { justify-content: center; padding: 0 10px; }
.sidebar-collapsed .sidebar-brand-full { display: none; }
.sidebar-collapsed .sidebar-brand-icon { display: block; }

.sidebar-toggle {
    position: absolute;
    right: -12px;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    background: var(--brand-primary);
    color: #fff;
    box-shadow: var(--shadow);
    transition: transform .22s var(--ease);
}

.sidebar-toggle svg { width: 14px; height: 14px; }
.sidebar-collapsed .sidebar-toggle { transform: translateY(-50%) rotate(180deg); }

.sidebar-panel-label {
    padding: 16px 20px 4px;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--brand-primary);
}

.sidebar-collapsed .sidebar-panel-label { display: none; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 12px 20px; }

.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 3px; }

.sidebar-group-title {
    padding: 18px 8px 6px;
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .34);
}

.sidebar-collapsed .sidebar-group-title {
    padding: 14px 0 6px;
    text-align: center;
    font-size: 0;
}

.sidebar-collapsed .sidebar-group-title::after {
    content: '';
    display: block;
    height: 1px;
    background: rgba(255, 255, 255, .1);
    margin: 0 12px;
}

.sidebar-list { display: flex; flex-direction: column; gap: 2px; }

.sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: .92rem;
    font-weight: 500;
    color: rgba(255, 255, 255, .74);
    transition: background .16s var(--ease), color .16s var(--ease);
}

.sidebar-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }

.sidebar-link.is-active {
    background: rgba(var(--brand-primary-rgb), .16);
    color: var(--brand-primary-light);
    font-weight: 600;
}

.sidebar-link.is-active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    border-radius: 0 3px 3px 0;
    background: var(--brand-primary);
}

.sidebar-icon { display: grid; place-items: center; flex-shrink: 0; width: 20px; }
.sidebar-icon svg { width: 19px; height: 19px; }

.sidebar-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar-sprint {
    flex-shrink: 0;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, .1);
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .04em;
    color: rgba(255, 255, 255, .5);
}

.sidebar-collapsed .sidebar-label,
.sidebar-collapsed .sidebar-sprint { display: none; }

.sidebar-collapsed .sidebar-link { justify-content: center; padding: 11px 0; }

/* Tooltip quando recolhida */
.sidebar-collapsed .sidebar-link::after {
    content: attr(data-label);
    position: absolute;
    left: calc(100% + 10px);
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    background: var(--brand-ink);
    box-shadow: var(--shadow-lg);
    font-size: .8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .14s var(--ease);
}

.sidebar-footer {
    padding: 14px 12px;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 6px 8px 12px; }

.sidebar-user-info { overflow: hidden; }
.sidebar-user-info strong {
    display: block;
    font-size: .85rem;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-user-info small {
    display: block;
    font-size: .72rem;
    color: rgba(255, 255, 255, .45);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-collapsed .sidebar-user-info { display: none; }
.sidebar-collapsed .sidebar-user { justify-content: center; }

.avatar {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    overflow: hidden;
    background: var(--brand-primary);
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
}

/* Com foto o círculo vira moldura: a imagem preenche e o fundo da marca some. */
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.avatar-lg { width: 56px; height: 56px; font-size: 1.4rem; }

.sidebar-logout { display: block; }

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(12, 12, 12, .5);
}

/* Menu aberto no celular trava a rolagem do fundo, como a cortina já fazia. */
body.menu-open { overflow: hidden; }

/* ---- Main ---- */

.app-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-w);
    transition: margin-left .22s var(--ease);
}

.sidebar-collapsed .app-main { margin-left: var(--sidebar-w-collapsed); }

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 16px;
    height: var(--topbar-h);
    padding: 0 28px;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--brand-line);
}

.topbar-burger { display: none; }

.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 1.22rem; }
.topbar-title p { font-size: .82rem; color: var(--c-text-soft); }

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.app-content { flex: 1; padding: 28px; }

/* ---- Navegação sem recarregar (public/assets/js/nav.js) ---- */

/*
 * Fita de progresso da troca de tela. Só entra em cena se a resposta demorar
 * mais que um piscar (o JS segura 120 ms antes de mostrar), então navegação
 * rápida continua parecendo instantânea.
 */
.pjax-progress {
    position: fixed;
    inset: 0 auto auto 0;
    z-index: 90;
    width: 0;
    height: 3px;
    background: var(--brand-primary);
    opacity: 0;
    pointer-events: none;
}

.pjax-progress.is-loading {
    width: 80%;
    opacity: 1;
    transition: width 6s cubic-bezier(.1, .7, .2, 1);
}

.pjax-progress.is-done {
    width: 100%;
    opacity: 0;
    transition: width .2s var(--ease), opacity .3s .1s var(--ease);
}

.app-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 18px 28px;
    border-top: 1px solid var(--brand-line);
    font-size: .78rem;
    color: var(--c-text-faint);
}

.app-footer-note { font-weight: 600; }

/* ---- Faixa de personificação ---- */

.impersonation-bar {
    position: sticky;
    top: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 10px 24px;
    background: var(--c-warning);
    color: #3B2A05;
    font-size: .88rem;
}

.impersonation-bar-text { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.impersonation-badge {
    padding: 2px 9px;
    border-radius: var(--radius-full);
    background: rgba(0, 0, 0, .18);
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
}

/* ============================ 4. Componentes ============================ */

/* ---- Card ---- */

.card {
    background: var(--c-white);
    border: 1px solid var(--brand-line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 18px 22px;
    border-bottom: 1px solid var(--brand-line);
}

.card-head h2 { font-size: 1rem; }
.card-head p { font-size: .82rem; color: var(--c-text-soft); margin-top: 2px; }

.card-body { padding: 22px; }
.card-body.is-flush { padding: 0; }

.card-foot {
    padding: 14px 22px;
    border-top: 1px solid var(--brand-line);
    background: #FAFAFA;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    font-size: .82rem;
}

/* ---- Estatística ---- */

.stat {
    position: relative;
    overflow: hidden;
    padding: 20px 22px;
    background: var(--c-white);
    border: 1px solid var(--brand-line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}

.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.stat-label {
    display: block;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--c-text-faint);
}

.stat-value {
    display: block;
    margin-top: 8px;
    font-size: 1.9rem;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.1;
}

.stat-hint { display: block; margin-top: 6px; font-size: .8rem; color: var(--c-text-soft); }

.stat-icon {
    position: absolute;
    top: 18px;
    right: 18px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius);
    background: rgba(var(--brand-primary-rgb), .1);
    color: var(--brand-primary);
}

.stat-icon svg { width: 20px; height: 20px; }

/* ---- Botões ---- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: .88rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background .16s var(--ease), transform .12s var(--ease), box-shadow .16s var(--ease);
}

.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; }

.btn-primary { background: var(--brand-primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-primary-dark); box-shadow: var(--shadow); }

.btn-dark { background: var(--brand-ink); color: #fff; }
.btn-dark:hover { background: #262626; }

.btn-ghost { background: var(--c-white); border: 1px solid var(--brand-line); color: var(--c-text); }
.btn-ghost:hover { background: #FAFAFA; border-color: #cfcfcf; }

.btn-xs { padding: 4px 10px; font-size: .74rem; gap: 5px; }
.btn-xs svg { width: 14px; height: 14px; }
.btn-sm { padding: 6px 13px; font-size: .8rem; }
.btn-lg { padding: 12px 26px; font-size: .95rem; }
.btn-block { display: flex; width: 100%; }

.btn-icon { padding: 8px; }
.btn-icon svg { width: 18px; height: 18px; }

.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---- Badges ---- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
}

.badge-neutral { background: #EFF0F1; color: var(--c-text-soft); }
.badge-success { background: var(--c-success-bg); color: #047857; }
.badge-warning { background: var(--c-warning-bg); color: #B45309; }
.badge-danger  { background: var(--c-danger-bg);  color: #B91C1C; }
.badge-info    { background: var(--c-info-bg);    color: #1D4ED8; }
.badge-primary { background: rgba(var(--brand-primary-rgb), .12); color: var(--brand-primary-dark); }

.badge-level { color: #fff; }

/* ---- Tabela ---- */

.table-wrap { overflow-x: auto; }

.table { font-size: .88rem; }

.table thead th {
    position: sticky;
    top: 0;
    padding: 11px 18px;
    background: #FAFAFA;
    border-bottom: 1px solid var(--brand-line);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--c-text-faint);
    text-align: left;
    white-space: nowrap;
}

.table tbody td {
    padding: 13px 18px;
    border-bottom: 1px solid #F0F0F0;
    vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s var(--ease); }
.table tbody tr:hover { background: #FCFCFC; }

.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.table-empty { padding: 48px 24px; text-align: center; color: var(--c-text-faint); }

/*
 * Ações no fim de uma linha de tabela.
 *
 * Cada ação com efeito é um <form> próprio (POST + CSRF), e form é bloco: sem
 * isto, "subir / descer / editar / remover" empilhariam em quatro linhas e
 * inflariam a altura da linha. Combine sempre com `.btn-xs`.
 */
.table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.table-actions form { display: contents; }

/*
 * Kanban do funil (Sprint 17).
 *
 * Rola na horizontal em vez de espremer as colunas: um funil de cinco etapas
 * numa tela de notebook daria 180px por coluna, e cartão de 180px não cabe o
 * nome do lead. Cada coluna tem largura fixa e a barra horizontal é honesta
 * sobre o que existe fora da vista.
 */
.kanban {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 10px;
    align-items: flex-start;
}

.kanban-col {
    flex: 0 0 268px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/*
 * O handoff: a linha entre o que o Pleno entrega e o que o Sênior assume.
 *
 * É um separador VERTICAL entre duas colunas, não uma coluna — cartão nenhum
 * para aqui. Por isso `flex: 0 0 auto` e largura mínima: ele não pode roubar
 * espaço das colunas de verdade num quadro que já rola na horizontal.
 *
 * `align-self: stretch` não serve: o quadro alinha por `flex-start` e as
 * colunas têm alturas diferentes conforme o número de cartões — esticar faria
 * o separador acompanhar a coluna mais alta e ficar desproporcional. Altura
 * fixa alinhada ao cabeçalho é o que mantém a leitura.
 */
.kanban-handoff {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 86px;
    padding-top: 6px;
    text-align: center;
}

.kanban-handoff-side {
    font-size: .68rem;
    line-height: 1.3;
    font-weight: 600;
    color: var(--c-text-soft);
    text-transform: uppercase;
    letter-spacing: .02em;
}

.kanban-handoff-side em {
    font-style: normal;
    font-weight: 400;
    color: var(--c-text-faint);
    text-transform: none;
    letter-spacing: 0;
}

.kanban-handoff-rule {
    width: 1px;
    flex: 1 1 auto;
    min-height: 18px;
    background: linear-gradient(
        to bottom,
        transparent,
        var(--brand-line) 20%,
        var(--brand-line) 80%,
        transparent
    );
}

.kanban-handoff-label {
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--brand-primary);
    background: rgba(var(--brand-primary-rgb), .08);
    border-radius: var(--radius-full);
    padding: 3px 8px;
    white-space: nowrap;
}

/*
 * Sem `position: sticky`: o quadro rola na HORIZONTAL, e um cabeçalho grudado
 * no topo da janela sobe por cima da barra de título quando a página rola —
 * foi o que aconteceu na primeira versão.
 */
.kanban-col-head {
    background: var(--c-white);
    border: 1px solid var(--brand-line);
    border-top: 3px solid var(--brand-primary);
    border-radius: var(--radius-lg);
    padding: 10px 12px;
}

.kanban-card {
    background: var(--c-white);
    border: 1px solid var(--brand-line);
    border-radius: var(--radius-lg);
    padding: 12px;
    transition: box-shadow .18s var(--ease), transform .18s var(--ease);
}

.kanban-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

/*
 * O seletor de etapa fica sempre visível.
 *
 * A primeira versão o escondia até o hover, e ele continuava ocupando altura —
 * o cartão inchava com um vazio que ninguém explicava. Escondê-lo de verdade
 * (`display:none`) tiraria o controle do alcance do teclado, que é pior:
 * arrastar cartão com o mouse não pode ser a única forma de mover uma
 * negociação.
 */
.kanban-move {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.kanban-move .select {
    padding: 4px 8px;
    font-size: .74rem;
    height: auto;
}

.kanban-empty {
    padding: 14px;
    text-align: center;
    font-size: .8rem;
    color: var(--c-text-soft);
    border: 1px dashed var(--brand-line);
    border-radius: var(--radius-lg);
}

/*
 * Cartão rico do funil (formato PowerCRM, Sprint 22).
 *
 * Os selos (situação, origem, nº de propostas) ficam numa linha própria que
 * quebra sozinha; o rodapé separa "o que falta fazer" (follow-up, à esquerda)
 * de "de quem é" (avatar do responsável, à direita) — a mesma leitura do
 * cartão do PowerCRM, sem inventar dado que não temos (vistoria/pagamento
 * moram no contrato, não na cotação).
 */
.crm-card-tags { gap: 6px; margin-top: 8px; }

.crm-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--brand-line);
}

.crm-avatar {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: var(--radius-full);
    background: var(--c-text);
    color: #fff;
    font-size: .64rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.crm-avatar-lg { width: 44px; height: 44px; font-size: 1rem; }

/*
 * Detalhe da negociação (formato PowerCRM, Sprint 22).
 *
 * Duas colunas: o miolo em abas à esquerda, o rail fixo de contexto à direita
 * (responsável, comissão, situação). No celular o rail desce para baixo do
 * conteúdo — a decisão da negociação continua sendo a primeira coisa na tela.
 */
.crm-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 16px;
    align-items: start;
}

.crm-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.crm-rail { display: flex; flex-direction: column; gap: 14px; }

.crm-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    border-bottom: 1px solid var(--brand-line);
}

.crm-tab {
    appearance: none;
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    padding: 10px 14px;
    font: inherit;
    font-weight: 600;
    color: var(--c-text-soft);
    cursor: pointer;
    transition: color .15s var(--ease), border-color .15s var(--ease);
}

.crm-tab:hover { color: var(--c-text); }

.crm-tab.is-active {
    color: var(--brand-primary-dark);
    border-bottom-color: var(--brand-primary);
}

.crm-rail-owner { display: flex; align-items: center; gap: 12px; }

.crm-rail-facts { display: flex; flex-direction: column; gap: 14px; }
.crm-rail-facts p { margin: 2px 0 0; }

@media (max-width: 900px) {
    .crm-detail { grid-template-columns: minmax(0, 1fr); }
}

/*
 * Drag & drop do funil + a negociação na cortina lateral (Sprint 22).
 *
 * O cartão inteiro é a alça de arrasto e o alvo de clique; o `<select>` de etapa
 * segue como saída de teclado (`@click.stop`), então arrastar não é a única
 * forma de mover — decisão herdada do S17. Clicar abre a negociação na cortina
 * padrão do sistema (`.drawer-root`), não num modal.
 */
.kanban-card.is-clickable { cursor: pointer; }
.kanban-card.is-dragging { opacity: .45; }

.kanban-col.is-drop {
    outline: 2px dashed var(--brand-primary);
    outline-offset: -2px;
    border-radius: var(--radius-lg);
    background: rgba(var(--brand-primary-rgb), .05);
}

/*
 * Trava de rolagem própria da cortina do CRM. A `drawer-open` do appShell é
 * ligada/desligada pelos drawers de formulário internos (Nova proposta), e não
 * pode destravar o fundo enquanto a cortina da negociação segue aberta.
 */
body.crm-drawer-open { overflow: hidden; }

/*
 * Dentro da cortina (50% da tela), a negociação empilha numa coluna só — o rail
 * desce para baixo das abas, como já acontece no responsivo (< 900px).
 */
.crm-detail.is-fragment { grid-template-columns: minmax(0, 1fr); }

/* Cabeçalho de identidade do lead, no topo do miolo carregado na cortina. */
.crm-record-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.crm-record-head h2 { margin: 2px 0 0; }

/*
 * Formulário de "Nova proposta" / "Registrar" inline na aba — não uma cortina
 * aninhada. Um drawer dentro do drawer da negociação (que tem `transform`) se
 * posicionava relativo a ele e cortava o conteúdo.
 */
.crm-inline-form {
    background: var(--brand-surface);
    border-bottom: 1px solid var(--brand-line);
}

.crm-inline-form .stack { gap: 14px; }

/*
 * Valor que reduz o saldo (Sprint 14).
 *
 * O extrato precisa distinguir entrada de saída num relance, e o sinal sozinho
 * não resolve: numa coluna de números alinhada à direita, "−" e "+" ficam
 * distantes do olho. A cor vem do token de perigo, não de um vermelho cravado.
 */
.is-negative { color: var(--c-danger); }

/* ---- Alertas ---- */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
    padding: 14px 18px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-size: .88rem;
    animation: slide-down .3s var(--ease);
}

.alert-icon { flex-shrink: 0; margin-top: 1px; }
.alert-icon svg { width: 18px; height: 18px; }

.alert-success { background: var(--c-success-bg); border-color: #A7F3D0; color: #065F46; }
.alert-error   { background: var(--c-danger-bg);  border-color: #FECACA; color: #991B1B; }
.alert-warning { background: var(--c-warning-bg); border-color: #FDE68A; color: #92400E; }
.alert-info    { background: var(--c-info-bg);    border-color: #BFDBFE; color: #1E40AF; }

.alert-list { margin-top: 6px; padding-left: 16px; list-style: disc; }
.alert-list li { margin-top: 2px; }

/* ---- Formulários ---- */

.field { display: flex; flex-direction: column; gap: 6px; }

.field label {
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--c-text-soft);
}

.input, .select, .textarea {
    width: 100%;
    padding: 10px 13px;
    background: var(--c-white);
    border: 1px solid var(--brand-line);
    border-radius: var(--radius-sm);
    font-size: .92rem;
    transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}

.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(var(--brand-primary-rgb), .14);
}

.input.has-error { border-color: var(--c-danger); }

.input-sm {
    padding: 6px 10px;
    font-size: .82rem;
    border-radius: var(--radius-sm);
}

.field-error { font-size: .78rem; color: var(--c-danger); }
.field-hint  { font-size: .78rem; color: var(--c-text-faint); }

/*
 * Rótulo de um BLOCO, não de um campo (Sprint 21).
 *
 * Uma grade de toggles ou uma lista de chips não tem `<input>` para o `<label>`
 * apontar, e usar `.field label` ali produziria um rótulo órfão. Mesma
 * tipografia do label de campo, para os dois lerem como a mesma coisa.
 */
.field-label {
    display: block;
    margin-bottom: 10px;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--c-text-soft);
}

/*
 * Rótulo com um atalho à direita ("Senha … Esqueci minha senha").
 *
 * O link fica na linha do label, não abaixo do campo: é onde a pessoa já está
 * olhando quando percebe que não lembra a senha.
 */
.field-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.field-link {
    font-size: .78rem;
    font-weight: 600;
    color: var(--brand-primary);
    text-transform: none;
    letter-spacing: 0;
}
.field-link:hover { color: var(--brand-primary-dark); text-decoration: underline; }

.input-color {
    width: 46px;
    height: 40px;
    padding: 3px;
    border: 1px solid var(--brand-line);
    border-radius: var(--radius-sm);
    background: var(--c-white);
    cursor: pointer;
}

/* ---- Select pesquisável (S24) — `partials/search-select` ---- */

/*
 * Um <select> nativo não filtra: com as 90 marcas ou as 245 versões da FIPE, a
 * pessoa rola atrás do item no escuro. Aqui o campo fechado tem a mesma cara de
 * um `.select` (para a linha do formulário não desalinhar) e, aberto, vira uma
 * lista com busca em cima.
 */
.search-select { position: relative; }

.search-select label { cursor: pointer; }

.search-select-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    text-align: left;
    font-family: inherit;
    color: var(--c-text);
    cursor: pointer;
}

.search-select-control.is-placeholder .search-select-value { color: var(--c-text-faint); }

.search-select-control.is-open {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(var(--brand-primary-rgb), .14);
}

.search-select-control:disabled {
    background: var(--brand-surface);
    color: var(--c-text-faint);
    cursor: not-allowed;
}

/* O rótulo escolhido pode ser longo ("GOL 1.6 MI TOTAL FLEX 8V 4P"): corta com
   reticências em vez de esticar o campo e quebrar a grade. */
.search-select-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-select-caret {
    flex-shrink: 0;
    display: inline-flex;
    color: var(--c-text-faint);
    transition: transform .16s var(--ease);
}

.search-select-caret svg { width: 16px; height: 16px; }
.search-select-control.is-open .search-select-caret { transform: rotate(180deg); }

.search-select-pop {
    position: absolute;
    z-index: 30;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--c-white);
    border: 1px solid var(--brand-line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: search-select-in .12s var(--ease);
}

@keyframes search-select-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.search-select-search {
    position: relative;
    padding: 8px;
    border-bottom: 1px solid var(--brand-line);
}

.search-select-search-icon {
    position: absolute;
    top: 50%;
    left: 18px;
    transform: translateY(-50%);
    display: inline-flex;
    color: var(--c-text-faint);
    pointer-events: none;
}

.search-select-search-icon svg { width: 15px; height: 15px; }

.search-select-query {
    width: 100%;
    padding: 8px 10px 8px 34px;
    background: var(--brand-surface);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: .88rem;
}

.search-select-query:focus {
    outline: none;
    background: var(--c-white);
    border-color: var(--brand-primary);
}

/* Rola por dentro: a lista nunca empurra o botão de salvar para fora da tela. */
.search-select-list {
    max-height: 240px;
    overflow-y: auto;
    margin: 0;
    padding: 4px;
    list-style: none;
}

.search-select-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: .88rem;
    color: var(--c-text);
    cursor: pointer;
}

/* Teclado e mouse apontam o MESMO item: o cursor segue o ponteiro no
   @mousemove, então não existem dois destaques disputando a atenção. */
.search-select-option.is-active { background: rgba(var(--brand-primary-rgb), .1); }
.search-select-option.is-picked { font-weight: 600; }

.search-select-mark {
    flex-shrink: 0;
    display: inline-flex;
    color: var(--brand-primary);
}

.search-select-mark svg { width: 15px; height: 15px; }

.search-select-empty,
.search-select-count {
    padding: 10px;
    font-size: .8rem;
    color: var(--c-text-faint);
}

.search-select-count {
    padding: 6px 10px;
    border-top: 1px solid var(--brand-line);
    background: var(--brand-surface);
    text-align: right;
}

/* Prévia de assets na tela Marca */
.brand-preview {
    margin-bottom: 8px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.brand-preview-ink {
    padding: 14px;
    background: var(--brand-ink);
}

.brand-preview-ink img {
    display: block;
    max-height: 40px;
    width: auto;
}

.brand-preview-login {
    display: flex;
    align-items: flex-end;
    min-height: 160px;
    padding: 14px 16px;
    color: rgba(255, 255, 255, .72);
    background:
        linear-gradient(
            160deg,
            rgba(12, 12, 12, .78) 0%,
            rgba(12, 12, 12, .55) 45%,
            rgba(12, 12, 12, .82) 100%
        ),
        var(--auth-aside-bg, none) center / cover no-repeat,
        var(--brand-ink);
    border: 1px solid var(--brand-line);
}

.brand-preview-login.is-empty {
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(420px 180px at 78% 20%, rgba(var(--brand-primary-rgb), .22), transparent 62%),
        linear-gradient(155deg, #141414 0%, var(--brand-ink) 55%);
}

.check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .88rem;
    color: var(--c-text);
    cursor: pointer;
    user-select: none;
}

.check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--brand-primary);
    cursor: pointer;
    flex-shrink: 0;
}

/* ---- Checkbox em linha (formulários de configuração) ---- */

.check-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .85rem;
    color: var(--c-text-soft);
    cursor: pointer;
    user-select: none;
}

.check-inline input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--brand-primary);
    cursor: pointer;
}

/*
 * Grade de toggles selecionáveis (área de atuação; qualquer config de liga/desliga
 * sobre um conjunto finito: 27 UFs, tipos de veículo…). O tile inteiro é clicável,
 * marcado = verde. Beira o `.check`, mas com peso visual de cartão em vez de linha.
 */
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.opt {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 13px;
    border: 1.5px solid var(--brand-line);
    border-radius: var(--radius-sm);
    background: var(--c-white);
    cursor: pointer;
    user-select: none;
    transition: border-color .15s var(--ease), background .15s var(--ease);
}
.opt:hover { border-color: var(--c-text-faint); }
.opt input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--c-success);
    cursor: pointer;
    flex-shrink: 0;
}
.opt .opt-body { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.opt .opt-title { font-weight: 600; font-size: .9rem; color: var(--c-text); }
.opt .opt-sub { font-size: .74rem; color: var(--c-text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opt:has(input:checked) { border-color: var(--c-success); background: var(--c-success-bg); }
.opt:has(input:not(:checked)) .opt-title { color: var(--c-text-soft); }
/* Ponto de marca: sinaliza que este item foge da política padrão (é uma exceção). */
.opt-mark { position: absolute; top: 7px; right: 9px; width: 7px; height: 7px; border-radius: var(--radius-full); background: var(--brand-primary); }

/*
 * Árvore marca ▸ família ▸ versão da tabela de preços (Sprint 21).
 *
 * O conjunto aqui é grande demais para uma `.opt-grid` — uma marca sozinha tem
 * 245 versões. A árvore mantém tudo fechado por padrão e abre uma família por
 * vez; a rolagem é interna, para o passo não empurrar o botão de salvar para
 * fora da tela.
 */
.model-tree { max-height: 520px; overflow: auto; padding-right: 4px; }
.model-tree details {
    border: 1px solid var(--brand-line);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    background: var(--c-surface);
}
.model-tree summary {
    padding: 9px 12px;
    font-size: .88rem;
    font-weight: 600;
    color: var(--c-text);
    cursor: pointer;
    list-style: none;
}
.model-tree summary::-webkit-details-marker { display: none; }
.model-tree summary::before { content: "▸"; margin-right: 8px; color: var(--c-text-faint); }
.model-tree details[open] > summary::before { content: "▾"; }
.model-tree details[open] > summary { border-bottom: 1px solid var(--brand-line); }
.model-tree .model-count { margin-left: 8px; font-weight: 500; color: var(--c-text-faint); font-size: .76rem; }
.model-tree .model-row { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 26px; }
.model-tree .model-row + .model-row { border-top: 1px solid var(--brand-line-soft, var(--brand-line)); }
.model-tree .model-row .input { max-width: 116px; }

/* Coluna das marcas, ao lado da árvore: rola sozinha e marca a marca aberta. */
.brand-list { max-height: 520px; overflow: auto; }
.brand-list .is-open { font-weight: 700; color: var(--brand-primary); }

/*
 * Chip removível — listas abertas que não cabem numa grade fixa (cidades, marcas,
 * palavras de modelo não atendidas). `is-block` lê como exclusão; `is-allow` como
 * exceção que libera.
 */
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px 6px 13px;
    border-radius: var(--radius-full);
    background: var(--brand-surface);
    border: 1px solid var(--brand-line);
    font-size: .85rem;
    font-weight: 600;
    color: var(--c-text);
}
.tag.is-block { background: var(--c-danger-bg); border-color: #f4cfcf; color: #b42318; }
.tag.is-allow { background: var(--c-success-bg); border-color: #bfe9d6; color: #0f7a56; }
.tag .tag-meta { font-weight: 500; opacity: .75; font-size: .76rem; }
.tag form { display: inline-flex; margin: 0; }
.tag-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-full);
    background: transparent;
    color: inherit;
    opacity: .55;
    cursor: pointer;
    font: inherit;
    line-height: 1;
}
.tag-x:hover { opacity: 1; background: rgba(0, 0, 0, .08); }

/* ---- Campo de link copiável ---- */

.copy-field { display: flex; gap: 8px; }
.copy-field .input { background: #FAFAFA; font-size: .82rem; }

/* ---- Barra de progresso ---- */

.bar { height: 8px; border-radius: var(--radius-full); background: #EDEDED; overflow: hidden; }
.bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--brand-primary);
    transform-origin: left;
    animation: grow-x .7s var(--ease) both;
}

/*
 * Variantes da barra (Sprint 15).
 *
 * No relatório de receita × despesa as duas tabelas têm a mesma forma, e só a
 * cor separa entrada de saída. Com a barra na cor da marca nos dois blocos, a
 * página inteira lê como uma coisa só.
 */
.bar-success .bar-fill,
.bar-fill.bar-success { background: var(--c-success); }
.bar-danger .bar-fill,
.bar-fill.bar-danger  { background: var(--c-danger); }

/* ---- Meus Ganhos (Sprint 7) ---- */

/* Ponto de cor inline (legenda de tipo de comissão no extrato). */
.dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: var(--radius-full);
    margin-right: 6px;
    vertical-align: baseline;
}

/* Gráfico de rosca (ApexCharts). Altura fixa para não pular no carregamento. */
.chart-donut { min-height: 240px; }

/* --------------------------------------------------------------------------
   Faixa de graduação.

   A equipe representa cada graduação por uma cor, como faixa de karatê. A cor
   chega por `--belt`, vinda de network_levels.color — nunca fixa aqui, porque
   nível é dado e o admin pode repintar.

   A escada de carreira saiu de propósito (S24): mostrar "o próximo degrau"
   para quem tem perfil de Sênior e nunca vai querer ser Diretor é prometer uma
   progressão que não existe. A tela mostra o que a pessoa É.
   -------------------------------------------------------------------------- */
.belt {
    --belt: var(--brand-primary);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border-radius: var(--radius-full);
    background: color-mix(in srgb, var(--belt) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--belt) 34%, transparent);
    color: var(--c-text);
    line-height: 1.15;
    max-width: 100%;
}
.belt-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: var(--belt);
    color: #fff;
    flex-shrink: 0;
}
.belt-icon svg { width: 60%; height: 60%; }
.belt-text { display: flex; flex-direction: column; min-width: 0; }
.belt-text strong { font-weight: 700; white-space: nowrap; }
.belt-text small { color: var(--c-text-soft); font-size: .74rem; }

.belt-sm { padding: 2px 10px 2px 2px; gap: 7px; }
.belt-sm .belt-icon { width: 20px; height: 20px; }
.belt-sm .belt-text strong { font-size: .76rem; }

.belt-md { padding: 4px 14px 4px 4px; }
.belt-md .belt-icon { width: 28px; height: 28px; }
.belt-md .belt-text strong { font-size: .85rem; }

.belt-lg { padding: 8px 20px 8px 8px; gap: 14px; }
.belt-lg .belt-icon { width: 46px; height: 46px; }
.belt-lg .belt-text strong { font-size: 1.15rem; }

/* Faixa clara (o Pleno é BRANCO): ícone branco sobre fundo branco desaparece,
   e a pílula sem contorno some no cartão. `partials/belt` mede a luminância da
   cor e marca a classe — a régua vai do branco ao preto e as duas pontas
   precisam ser legíveis. */
.belt-light { background: color-mix(in srgb, var(--belt) 26%, transparent); }
.belt-light .belt-icon {
    color: #1A1A1A;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-text) 22%, transparent);
}

/* A régua das cinco faixas: contexto sem prometer promoção. */
.belt-rule { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.belt-rule-item {
    flex: 1 1 88px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    padding: 8px 4px;
    border-radius: var(--radius-sm);
    text-align: center;
}
.belt-rule-item.is-current { background: color-mix(in srgb, var(--belt) 10%, transparent); }
.belt-rule-swatch { width: 100%; height: 7px; border-radius: var(--radius-full); background: var(--belt); }
.belt-rule-item:not(.is-current) .belt-rule-swatch { opacity: .3; }
.belt-rule-item span { font-size: .72rem; color: var(--c-text-faint); }
.belt-rule-item.is-current span { color: var(--c-text); font-weight: 700; }

/* Foto do consultor. Sem foto, as iniciais no lugar. */
.consultant-photo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--brand-surface);
    border: 2px solid var(--belt, var(--brand-line));
    color: var(--c-text-soft);
    font-weight: 700;
    text-transform: uppercase;
}
.consultant-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.consultant-photo-sm { width: 32px; height: 32px; font-size: .72rem; }
.consultant-photo-md { width: 48px; height: 48px; font-size: .9rem; }
.consultant-photo-lg { width: 96px; height: 96px; font-size: 1.6rem; }

/* Controle segmentado (abas do simulador). */
.seg {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: var(--brand-surface);
    border-radius: var(--radius);
}
.seg-btn {
    border: 0;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    font-size: .9rem;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--c-text-soft);
    white-space: nowrap;
    transition: background .16s var(--ease), color .16s var(--ease);
}
.seg-btn:hover { color: var(--c-text); }
.seg-btn.is-active {
    background: var(--c-white);
    color: var(--c-text);
    box-shadow: var(--shadow-sm);
}

/*
 * Sub-navegação em abas dentro de uma tela (partials/subnav).
 *
 * Reaproveita o segmentado, mas é bloco: fica entre o topo da página e o
 * conteúdo, com respiro próprio. Sobre fundo surface o `.seg` sumiria — por
 * isso a versão em abas ganha fundo branco e borda.
 */
.subnav {
    display: flex;
    margin-bottom: 4px;
    max-width: 100%;
    overflow-x: auto;
    background: var(--c-white);
    border: 1px solid var(--brand-line);
    scrollbar-width: none;
}
.subnav::-webkit-scrollbar { display: none; }
.subnav .seg-btn.is-active { background: rgba(var(--brand-primary-rgb), .1); color: var(--brand-primary-dark); box-shadow: none; }

/* Rótulo de seção dentro de um formulário. */
.section-label {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--c-text-soft);
    font-weight: 600;
    margin: 22px 0 10px;
}

/* Amostra da cor de marca de um tenant (listagem do super admin). */
.brand-swatch { display: inline-flex; align-items: center; gap: 6px; }
.brand-swatch-chip {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid rgba(12, 12, 12, .12);
    flex: none;
}
.brand-swatch-chip.is-lg { width: 26px; height: 26px; border-radius: 6px; }

/*
 * Cartão de plano de assinatura do SaaS (super admin).
 *
 * Um cartão por plano do cardápio: preço em destaque, limites, recursos
 * inclusos e quantos tenants assinam. Vira componente para não repetir
 * `style=` em cada card.
 */
.plan-price { display: flex; align-items: baseline; gap: 6px; margin: 4px 0; }
.plan-price strong { font-size: 1.65rem; font-weight: 800; letter-spacing: -.02em; }

.plan-limits { display: flex; flex-direction: column; gap: 4px; }
.plan-limits li { font-size: .72rem; color: var(--c-text-soft); }
.plan-limits strong { color: var(--c-text); }

.plan-features { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.plan-feature { display: flex; align-items: center; gap: 7px; font-size: .72rem; color: var(--c-text-faint); }
.plan-feature svg { width: 13px; height: 13px; flex: none; }
.plan-feature.is-on { color: var(--c-text); font-weight: 600; }
.plan-feature.is-on svg { color: var(--c-success); }

.plan-foot {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--brand-line);
    font-size: .72rem;
    color: var(--c-text-soft);
}

/*
 * Verificação em duas etapas (Sprint 12).
 *
 * O código de 6 dígitos é o campo mais digitado da tela: fonte mono, grande e
 * espaçada, para não errar 0 por O nem 1 por l ao copiar do celular.
 */
.input-code {
    font-family: var(--font-mono);
    font-size: 1.35rem;
    letter-spacing: .3em;
    text-align: center;
    padding: 12px 13px;
}
.input-code::placeholder { letter-spacing: .3em; color: var(--c-text-faint); }

/* Códigos de recuperação: aparecem uma vez, então precisam ser fáceis de copiar. */
.recovery-codes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
}
.recovery-codes li {
    padding: 10px 14px;
    background: var(--brand-surface);
    border: 1px solid var(--brand-line);
    border-radius: var(--radius-sm);
    font-size: .95rem;
    letter-spacing: .06em;
    text-align: center;
    user-select: all;
}

.setup-steps { counter-reset: step; display: flex; flex-direction: column; gap: 10px; }
.setup-steps li {
    counter-increment: step;
    display: flex;
    gap: 12px;
    align-items: baseline;
    font-size: .9rem;
}
.setup-steps li::before {
    content: counter(step);
    flex: none;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-full);
    background: rgba(var(--brand-primary-rgb), .12);
    color: var(--brand-primary-dark);
    font-size: .74rem;
    font-weight: 700;
}

.setup-details summary { font-size: .82rem; color: var(--c-text-soft); cursor: pointer; }
.setup-uri {
    margin-top: 8px;
    padding: 10px 12px;
    background: var(--brand-surface);
    border-radius: var(--radius-sm);
    word-break: break-all;
    user-select: all;
}

/* Botão que se comporta como link (dentro de um form que só faz POST). */
.link-button {
    color: var(--brand-primary);
    font-weight: 600;
    font-size: inherit;
}
.link-button:hover { color: var(--brand-primary-dark); text-decoration: underline; }

/* Selo de elegibilidade. */
.eligibility-seal {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: .9rem;
}
.eligibility-seal.is-eligible { background: var(--c-success-bg); color: var(--c-success); }
.eligibility-seal.is-blocked { background: var(--c-warning-bg); color: var(--c-warning); }

/* ---- Vistoria (Sprint 13) ---- */

/*
 * Um item do checklist na tela de revisão. Não é `.card`: são doze itens dentro
 * de um card de etapa, e card dentro de card viraria uma escada de sombras.
 * Separador leve, hierarquia pelo espaçamento.
 */
.insp-item {
    padding-bottom: 18px;
    border-bottom: 1px solid var(--brand-line);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.insp-item:last-child { padding-bottom: 0; border-bottom: 0; }
.insp-item h3 { font-size: 1rem; }
.insp-item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }

/*
 * Item que a condicional deixou de fora. Fica visível e esmaecido: quem revisa
 * precisa ver que a pergunta existia e que foi legitimamente pulada — sumir
 * pareceria checklist incompleto.
 */
.insp-item.is-skipped { opacity: .55; }

/* Observação que o vistoriador digitou no item. */
.insp-note {
    padding: 10px 14px;
    border-left: 3px solid var(--brand-primary);
    background: var(--brand-surface);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: .9rem;
    color: var(--c-text-soft);
}

/* Galeria das mídias de um item. */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.media-tile {
    border: 1px solid var(--brand-line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--c-white);
}

.media-tile img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform .2s var(--ease);
}

.media-tile:hover img { transform: scale(1.03); }

.media-file {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    aspect-ratio: 4 / 3;
    background: var(--brand-surface);
    color: var(--c-text-soft);
}

.media-tile figcaption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 7px 10px;
    border-top: 1px solid var(--brand-line);
}

/* ============================ 5. Telas ============================ */

/* ---- Login ---- */

.auth-page {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    background: var(--brand-ink);
}

/* Com os três cartões fora (S24) sobrou só o bloco de cima — que centralizado
   ocupa a lateral melhor do que ancorado no topo com o resto vazio. */
.auth-aside {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(1000px 520px at 78% 12%, rgba(var(--brand-primary-rgb), .28), transparent 62%),
        linear-gradient(155deg, #141414 0%, var(--brand-ink) 55%);
}

/* Foto enviada em Marca → cover + véu escuro para o texto continuar legível */
.auth-aside.has-bg {
    background:
        linear-gradient(
            160deg,
            rgba(12, 12, 12, .78) 0%,
            rgba(12, 12, 12, .58) 42%,
            rgba(12, 12, 12, .82) 100%
        ),
        radial-gradient(900px 480px at 85% 8%, rgba(var(--brand-primary-rgb), .22), transparent 58%),
        var(--auth-aside-bg, none) center / cover no-repeat,
        var(--brand-ink);
}

.auth-aside::after {
    content: '';
    position: absolute;
    right: -140px;
    bottom: -140px;
    width: 460px;
    height: 460px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--brand-primary-rgb), .16), transparent 68%);
    pointer-events: none;
}

.auth-aside.has-bg::after {
    opacity: .45;
}

.auth-panel {
    display: grid;
    place-items: center;
    padding: 48px;
    background: var(--brand-surface);
}

.auth-aside-top {
    position: relative;
    z-index: 1;
    max-width: 440px;
}

.auth-aside h2 {
    margin-top: 42px;
    font-size: 2.15rem;
    line-height: 1.15;
    letter-spacing: -.03em;
}

.auth-aside h2 em { font-style: normal; color: var(--brand-primary); }

.auth-card { width: 100%; max-width: 400px; }

.auth-card h1 { font-size: 1.65rem; letter-spacing: -.025em; }
.auth-card > p { margin-top: 6px; margin-bottom: 30px; color: var(--c-text-soft); font-size: .9rem; }

.auth-form { display: flex; flex-direction: column; gap: 18px; }

.auth-hint {
    margin-top: 26px;
    padding: 15px 17px;
    border: 1px dashed var(--brand-line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .6);
    font-size: .78rem;
    color: var(--c-text-soft);
}

.auth-hint strong { display: block; margin-bottom: 8px; color: var(--c-text); font-size: .74rem;
                    letter-spacing: .08em; text-transform: uppercase; }

.auth-hint-row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.auth-hint-row code { font-family: var(--font-mono); font-size: .76rem; }

/* Rodapé das telas de acesso: voltar para o login, ir para a recuperação. */
.auth-alt {
    margin-top: 26px;
    text-align: center;
    font-size: .85rem;
    color: var(--c-text-soft);
}
.auth-alt a { color: var(--brand-primary); font-weight: 600; }
.auth-alt a:hover { color: var(--brand-primary-dark); text-decoration: underline; }

/* ---- Placeholder de sprint ---- */

.placeholder { max-width: 720px; }

.placeholder-icon {
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    border-radius: var(--radius-lg);
    background: rgba(var(--brand-primary-rgb), .1);
    color: var(--brand-primary);
}

.placeholder-icon svg { width: 30px; height: 30px; }

.placeholder h2 { margin-top: 22px; font-size: 1.4rem; }
.placeholder-summary { margin-top: 10px; color: var(--c-text-soft); }

.placeholder-features { margin-top: 24px; display: flex; flex-direction: column; gap: 11px; }

.placeholder-feature { display: flex; gap: 11px; align-items: flex-start; font-size: .9rem; }

.placeholder-feature-mark {
    flex-shrink: 0;
    margin-top: 7px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand-primary);
}

/* ---- Matriz de comissão ---- */

.matrix th:first-child,
.matrix td:first-child {
    position: sticky;
    left: 0;
    background: var(--c-white);
    font-weight: 700;
    z-index: 1;
}

.matrix thead th:first-child { background: #FAFAFA; }

.matrix .rate-slot { font-weight: 700; font-variant-numeric: tabular-nums; }
.matrix .rate-cumulative { display: block; font-size: .72rem; color: var(--c-text-faint); margin-top: 2px; }

.matrix-cell-edit {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    min-width: 96px;
}

.matrix-cell-edit .input {
    width: 100%;
    max-width: 112px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.matrix td.num { vertical-align: middle; }

.inline-edit-panel {
    padding: 14px;
    margin-top: 8px;
    background: var(--brand-surface);
    border: 1px solid var(--brand-line);
    border-radius: var(--radius);
    min-width: 280px;
}

.inline-edit-panel .stack { gap: 12px; }

/* ---- Cortina lateral (drawer) ---- */

.drawer-root {
    position: fixed;
    inset: 0;
    z-index: var(--drawer-z);
    pointer-events: none;
}

.drawer-root.is-open { pointer-events: auto; }

.drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 12, 12, .45);
    opacity: 0;
    transition: opacity .24s var(--ease);
}

.drawer-root.is-open .drawer-backdrop { opacity: 1; }

.drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--drawer-width);
    max-width: 100%;
    display: flex;
    flex-direction: column;
    background: var(--c-white);
    box-shadow: var(--shadow-lg);
    border-left: 1px solid var(--brand-line);
    transform: translateX(100%);
    transition: transform .28s var(--ease);
}

.drawer-root.is-open .drawer-panel { transform: translateX(0); }

.drawer-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px;
    border-bottom: 1px solid var(--brand-line);
    flex-shrink: 0;
}

.drawer-head h2 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -.015em;
    line-height: 1.3;
}

.drawer-head p {
    margin-top: 4px;
    color: var(--c-text-soft);
    font-size: .9rem;
}

.drawer-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.drawer-body {
    flex: 1;
    overflow: auto;
    padding: 22px;
}

.drawer-body > .stack { gap: 18px; }

.drawer-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    padding: 16px 22px;
    border-top: 1px solid var(--brand-line);
    background: var(--c-white);
    flex-shrink: 0;
}

body.drawer-open { overflow: hidden; }

/* ---- Árvore da rede ---- */

.tree { display: flex; flex-direction: column; gap: 4px; }

.tree-node {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    background: var(--c-white);
    border: 1px solid var(--brand-line);
    border-radius: var(--radius);
    transition: border-color .16s var(--ease), transform .16s var(--ease);
    animation: fade-up .35s var(--ease) both;
}

.tree-node:hover { border-color: var(--brand-primary); transform: translateX(2px); }
.tree-node.is-root { border-color: var(--brand-primary); background: rgba(var(--brand-primary-rgb), .04); }

.tree-toggle {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--brand-line);
    background: var(--brand-surface);
    color: var(--c-text-soft);
    font-weight: 700;
    line-height: 1;
}

.tree-toggle:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.tree-rail { flex-shrink: 0; width: 3px; height: 30px; border-radius: 2px; }

.tree-node-info { flex: 1; min-width: 0; }
.tree-node-info strong { display: block; font-size: .9rem; }
.tree-node-info span { font-size: .76rem; color: var(--c-text-faint); }

.tree-node-meta { display: flex; align-items: center; gap: 18px; text-align: right; }
.tree-node-meta div span { display: block; font-size: .66rem; text-transform: uppercase;
                           letter-spacing: .08em; color: var(--c-text-faint); }
.tree-node-meta div strong { font-size: .95rem; font-variant-numeric: tabular-nums; }

/* ---- Kit de adesão ---- */

.kit-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 18px;
    border-bottom: 1px solid #F0F0F0;
}

.kit-item:last-child { border-bottom: 0; }

.kit-item-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: rgba(var(--brand-primary-rgb), .1);
    color: var(--brand-primary);
}

.kit-item-info { flex: 1; min-width: 0; }
.kit-item-info strong { display: block; font-size: .92rem; }
.kit-item-info span { font-size: .8rem; color: var(--c-text-soft); }

/* ---- Onboarding público ---- */

.onboarding-page {
    min-height: 100vh;
    padding: 40px 24px;
    color: #fff;
    background:
        radial-gradient(900px 520px at 72% 8%, rgba(var(--brand-primary-rgb), .2), transparent 60%),
        linear-gradient(170deg, #151515 0%, var(--brand-ink) 60%);
}

.onboarding-shell { max-width: 1180px; margin: 0 auto; }

.onboarding-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.onboarding-head-title { text-align: right; }
.onboarding-head-title span { font-size: .68rem; letter-spacing: .22em; text-transform: uppercase;
                              color: rgba(255, 255, 255, .45); }
.onboarding-head-title strong { display: block; font-size: .92rem; }
.onboarding-head-title strong em { font-style: normal; color: var(--brand-primary); }

.steps { display: flex; align-items: center; justify-content: center; margin-bottom: 44px; }

.step { display: flex; flex-direction: column; align-items: center; gap: 8px; }

.step-dot {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .18);
    font-size: .85rem;
    font-weight: 700;
    color: rgba(255, 255, 255, .45);
}

.step.is-current .step-dot { border-color: var(--brand-primary); color: var(--brand-primary); }
.step span { font-size: .74rem; color: rgba(255, 255, 255, .45); }
.step.is-current span { color: #fff; font-weight: 600; }

.step-line { width: 88px; height: 1px; margin: 0 4px 24px; background: rgba(255, 255, 255, .14); }

.onboarding-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 26px; }

.panel-dark {
    padding: 34px;
    background: rgba(255, 255, 255, .035);
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 20px;
}

.panel-dark h1 { font-size: 2rem; letter-spacing: -.03em; }
.panel-dark > p { margin-top: 8px; color: rgba(255, 255, 255, .58); }

.referred-by {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 24px;
    padding: 11px 18px;
    border: 1px solid var(--brand-primary);
    border-radius: var(--radius);
    background: rgba(var(--brand-primary-rgb), .1);
    font-size: .9rem;
}

.referred-by svg { color: var(--brand-primary); }

.benefit-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 30px; }

.benefit {
    padding: 18px;
    background: rgba(255, 255, 255, .035);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: var(--radius);
}

.benefit svg { color: var(--brand-primary); margin-bottom: 12px; width: 22px; height: 22px; }
.benefit strong { display: block; font-size: .9rem; }
.benefit span { font-size: .78rem; color: rgba(255, 255, 255, .5); }

.badge-card {
    padding: 26px;
    background: rgba(255, 255, 255, .035);
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 20px;
    text-align: center;
}

.badge-card-label { font-size: .64rem; letter-spacing: .24em; text-transform: uppercase;
                    color: rgba(255, 255, 255, .42); }

.badge-photo {
    display: grid;
    place-items: center;
    margin: 20px 0;
    aspect-ratio: 1;
    border-radius: var(--radius);
    background: linear-gradient(160deg, rgba(255, 255, 255, .05), rgba(var(--brand-primary-rgb), .08));
    border: 1px dashed rgba(255, 255, 255, .14);
    color: rgba(255, 255, 255, .2);
}

.badge-photo svg { width: 60px; height: 60px; }

.badge-name { font-size: 1.05rem; font-weight: 700; letter-spacing: .04em; }

.badge-meta {
    display: flex;
    justify-content: space-between;
    padding-top: 14px;
    margin-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, .1);
    font-size: .72rem;
    color: rgba(255, 255, 255, .42);
}

.price-card {
    margin-top: 20px;
    padding: 24px;
    background: rgba(255, 255, 255, .035);
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 20px;
}

.price-card-label { font-size: .64rem; letter-spacing: .24em; text-transform: uppercase;
                    color: rgba(255, 255, 255, .42); }
.price-card-value { margin-top: 8px; font-size: 2rem; font-weight: 800; letter-spacing: -.03em; }
.price-card-note { font-size: .8rem; color: rgba(255, 255, 255, .5); }

.kit-list { margin-top: 18px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .1);
            display: flex; flex-direction: column; gap: 10px; }

.kit-list-item { display: flex; align-items: center; gap: 10px; font-size: .84rem; }
.kit-list-item svg { flex-shrink: 0; width: 15px; height: 15px; color: var(--brand-primary); }
.kit-list-item span { color: rgba(255, 255, 255, .68); }

.legal-note {
    margin-top: 30px;
    padding: 15px 18px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(255, 255, 255, .07);
    font-size: .76rem;
    color: rgba(255, 255, 255, .5);
}

/* ---- Wizard de adesão (passos 2 a 7) ---- */

.step.is-done .step-dot {
    border-color: var(--brand-primary);
    background: var(--brand-primary);
    color: #fff;
}

.step-line.is-done { background: var(--brand-primary); }

.wizard-title { font-size: 1.55rem; letter-spacing: -.025em; }
.wizard-sub { margin-top: 6px; color: rgba(255, 255, 255, .55); }

.wizard-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 26px;
}

.wizard-form .span-2 { grid-column: span 2; }

/* Campos sobre fundo escuro: o .input padrão é para painel claro. */
.panel-dark .input,
.panel-dark .select {
    background: rgba(255, 255, 255, .05);
    border-color: rgba(255, 255, 255, .12);
    color: #fff;
}

.panel-dark .input::placeholder { color: rgba(255, 255, 255, .3); }

/*
 * O popup nativo do <select> abre com fundo branco do sistema, mas as opções
 * herdam o color:#fff do campo escuro — texto branco sobre branco, invisível.
 * Forçamos cor escura nas opções para que fiquem legíveis na lista aberta.
 */
.panel-dark .select option {
    color: var(--c-text, #17181A);
    background: #fff;
}

/*
 * O select pesquisável no fundo escuro: o campo fechado já herda `.input`, só
 * o que o navegador desenhava sozinho (placeholder, seta, desabilitado) precisa
 * de cor aqui. A lista aberta continua clara de propósito — é o mesmo contraste
 * do popup nativo logo acima, e o que sustenta a leitura de 500 modelos.
 */
.panel-dark .search-select-control.is-placeholder .search-select-value { color: rgba(255, 255, 255, .3); }
.panel-dark .search-select-control.is-open { background: rgba(255, 255, 255, .07); }
.panel-dark .search-select-caret { color: rgba(255, 255, 255, .45); }

.panel-dark .search-select-control:disabled {
    background: rgba(255, 255, 255, .03);
    color: rgba(255, 255, 255, .35);
}

.panel-dark .input:focus,
.panel-dark .select:focus {
    border-color: var(--brand-primary);
    background: rgba(255, 255, 255, .07);
}

.panel-dark .input.has-error { border-color: var(--c-danger); }
.panel-dark .field label { color: rgba(255, 255, 255, .55); }
.panel-dark .field-hint { color: rgba(255, 255, 255, .35); }

.panel-dark .input[type="file"] { padding: 8px 12px; font-size: .85rem; }

.field-label-loose {
    margin-top: 26px;
    margin-bottom: 12px;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .55);
}

.wizard-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 32px;
}

.btn-ghost-light {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .16);
    color: rgba(255, 255, 255, .75);
}

.btn-ghost-light:hover { background: rgba(255, 255, 255, .06); color: #fff; }

.referred-by.is-warning {
    border-color: var(--c-warning);
    background: rgba(245, 158, 11, .1);
}

.referred-by.is-warning svg { color: var(--c-warning); }

/* Tamanhos de camiseta */

.size-grid { display: flex; flex-wrap: wrap; gap: 10px; }

.size-option {
    min-width: 62px;
    padding: 14px 18px;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .04);
    color: rgba(255, 255, 255, .8);
    font-weight: 700;
    transition: border-color .16s var(--ease), background .16s var(--ease), transform .12s var(--ease);
}

.size-option:hover { border-color: rgba(255, 255, 255, .3); }

.size-option.is-selected {
    border-color: var(--brand-primary);
    background: rgba(var(--brand-primary-rgb), .16);
    color: #fff;
    transform: translateY(-1px);
}

/* Contrato e aceite */

.contract-box {
    margin-top: 24px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .03);
    overflow: hidden;
}

.contract-box-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    font-size: .9rem;
}

.contract-box-body {
    max-height: 230px;
    overflow-y: auto;
    padding: 16px 18px;
    font-size: .82rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, .6);
}

.contract-box-body::-webkit-scrollbar { width: 6px; }
.contract-box-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .14);
    border-radius: 3px;
}

.accept-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 22px;
    padding: 16px 18px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .03);
    font-size: .88rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, .78);
    cursor: pointer;
    transition: border-color .16s var(--ease);
}

.accept-box:hover { border-color: rgba(255, 255, 255, .24); }
.accept-box.has-error { border-color: var(--c-danger); }

.accept-box input[type="checkbox"] {
    flex-shrink: 0;
    margin-top: 2px;
    width: 18px;
    height: 18px;
    accent-color: var(--brand-primary);
    cursor: pointer;
}

/* Foto do crachá */

.badge-photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius);
}

/* Pagamento */

.pay-amount {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-top: 26px;
    padding: 20px 22px;
    border-radius: var(--radius);
    background: rgba(var(--brand-primary-rgb), .1);
    border: 1px solid rgba(var(--brand-primary-rgb), .3);
}

.pay-amount span { font-size: .8rem; color: rgba(255, 255, 255, .6); }
.pay-amount strong { font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; }

.pay-methods {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.pay-method {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 14px;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, .09);
    background: rgba(255, 255, 255, .03);
}

.pay-method-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    background: rgba(var(--brand-primary-rgb), .14);
    color: var(--brand-primary);
}

.pay-method-icon svg { width: 17px; height: 17px; }
.pay-method strong { display: block; font-size: .86rem; }
.pay-method span { font-size: .72rem; color: rgba(255, 255, 255, .45); }

.pay-pix { margin-top: 24px; }
.pay-pix .input { background: rgba(255, 255, 255, .05); }

/* QR Code do PIX: fundo branco obrigatorio — leitor nao le QR invertido. */
.pay-qr {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 18px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .08);
}

.pay-qr img {
    background: #FFF;
    padding: 10px;
    border-radius: 10px;
    max-width: 100%;
    height: auto;
}

.pay-waiting {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-top: 22px;
    padding: 15px 18px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(255, 255, 255, .08);
    font-size: .86rem;
    color: rgba(255, 255, 255, .65);
}

.pulse-dot {
    flex-shrink: 0;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--c-warning);
    animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .35; transform: scale(.82); }
}

/* Boas-vindas */

.welcome-wrap { display: grid; place-items: center; padding: 20px 0 60px; }
.welcome-card { max-width: 560px; width: 100%; text-align: center; }

.welcome-check {
    display: grid;
    place-items: center;
    width: 66px;
    height: 66px;
    margin: 0 auto 22px;
    border-radius: 50%;
    background: rgba(16, 185, 129, .16);
    color: var(--c-success);
    animation: fade-up .45s var(--ease) both;
}

.welcome-check svg { width: 32px; height: 32px; }

.welcome-card h1 { font-size: 1.9rem; letter-spacing: -.03em; }

.welcome-id {
    margin-top: 26px;
    padding: 20px;
    border-radius: var(--radius);
    background: rgba(var(--brand-primary-rgb), .1);
    border: 1px solid rgba(var(--brand-primary-rgb), .3);
}

.welcome-id span {
    display: block;
    font-size: .7rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .5);
}

.welcome-id strong { display: block; margin-top: 6px; font-size: 2rem; letter-spacing: .1em; }

.welcome-links { margin-top: 26px; text-align: left; }

/* ---- Venda direta: escolha de plano e memória do cálculo ---- */

.plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-top: 26px;
}

.plan-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px;
    text-align: left;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .04);
    color: rgba(255, 255, 255, .8);
    transition: border-color .16s var(--ease), background .16s var(--ease), transform .12s var(--ease);
}

.plan-card:hover { border-color: rgba(255, 255, 255, .28); transform: translateY(-2px); }

.plan-card.is-selected {
    border-color: var(--brand-primary);
    background: rgba(var(--brand-primary-rgb), .12);
    color: #fff;
}

.plan-card-name {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--brand-primary);
}

.plan-card-price { font-size: .9rem; color: rgba(255, 255, 255, .6); }
.plan-card-price strong { font-size: 1.7rem; font-weight: 800; letter-spacing: -.03em; color: #fff; }
.plan-card-price small { font-size: .8rem; }

.plan-card-join { font-size: .78rem; color: rgba(255, 255, 255, .5); }

.plan-card-benefits {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, .1);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.plan-card-benefits li { display: flex; align-items: center; gap: 7px; font-size: .8rem; }
.plan-card-benefits svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--brand-primary); }

/* Memória do cálculo na proposta */

.breakdown {
    margin-top: 14px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: var(--radius);
    overflow: hidden;
}

.breakdown-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
    font-size: .88rem;
    color: rgba(255, 255, 255, .68);
}

.breakdown-row:last-child { border-bottom: 0; }
.breakdown-row em { font-style: normal; font-size: .76rem; color: rgba(255, 255, 255, .4); }
.breakdown-row strong { font-variant-numeric: tabular-nums; white-space: nowrap; }

.breakdown-row.is-subtotal {
    background: rgba(255, 255, 255, .03);
    color: rgba(255, 255, 255, .85);
}

.breakdown-row.is-total {
    background: rgba(var(--brand-primary-rgb), .12);
    color: #fff;
    font-weight: 700;
}

.breakdown-row.is-total strong { font-size: 1.05rem; }
.welcome-links .field-label-loose { margin-top: 0; }

/* ---- Página de erro ---- */

.error-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 40px;
    text-align: center;
    background: var(--brand-ink);
    color: #fff;
}

.error-code { font-size: 5.5rem; font-weight: 800; letter-spacing: -.05em; color: var(--brand-primary);
              line-height: 1; }
.error-page h1 { margin-top: 12px; font-size: 1.4rem; }
.error-page p { margin-top: 8px; color: rgba(255, 255, 255, .55); max-width: 460px; }
.error-page .btn { margin-top: 28px; }

/* ============================ 6. Animações ============================ */

@keyframes slide-down {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes grow-x {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}

.animate-in { animation: fade-up .4s var(--ease) both; }
.delay-1 { animation-delay: .05s; }
.delay-2 { animation-delay: .1s; }
.delay-3 { animation-delay: .15s; }
.delay-4 { animation-delay: .2s; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* ============================ 7. Responsivo ============================ */

@media (max-width: 1100px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-sidebar { grid-template-columns: minmax(0, 1fr); }
    .onboarding-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
    .auth-page { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .steps { display: none; }
}

@media (max-width: 720px) {
    .app-sidebar { transform: translateX(-100%); transition: transform .24s var(--ease); }
    .app-sidebar.is-open { transform: translateX(0); }
    .app-main { margin-left: 0 !important; }
    .topbar-burger { display: grid; place-items: center; width: 38px; height: 38px;
                     border-radius: var(--radius-sm); border: 1px solid var(--brand-line); }
    .sidebar-toggle { display: none; }
    .app-topbar { padding: 0 16px; gap: 12px; }
    .app-content { padding: 18px 16px; }

    /*
     * Numa faixa de 68px o subtítulo não cabe junto do menu e das ações — some,
     * e o título trunca em vez de empurrar os botões para fora da tela.
     */
    .topbar-title p { display: none; }
    .topbar-title h1 { font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    .subnav { border-radius: var(--radius-sm); }

    .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
    .benefit-grid { grid-template-columns: minmax(0, 1fr); }
    .panel-dark { padding: 24px; }
    .stat-value { font-size: 1.6rem; }

    /* Wizard de adesão em coluna única */
    .wizard-form { grid-template-columns: minmax(0, 1fr); }
    .wizard-form .span-2 { grid-column: span 1; }
    .pay-methods { grid-template-columns: minmax(0, 1fr); }
    .wizard-actions { flex-direction: column-reverse; align-items: stretch; }
    .wizard-actions .btn { width: 100%; }
    .wizard-title { font-size: 1.3rem; }
    .pay-amount { flex-direction: column; align-items: flex-start; gap: 4px; }
    .pay-amount strong { font-size: 1.6rem; }
    .welcome-id strong { font-size: 1.6rem; }

    .drawer-panel { width: 100%; border-left: none; }
}

@media print {
    .app-sidebar, .app-topbar, .app-footer, .impersonation-bar { display: none !important; }
    .app-main { margin-left: 0 !important; }
    .card { break-inside: avoid; box-shadow: none; }
}

/* ------------------------------------------------------------------ */
/* Cotador do CRM (S23)                                                 */
/* Os cartões de oferta e as opções (.plan-card, .size-option,         */
/* .accept-box) reaproveitam as classes do wizard público, que são     */
/* pensadas para o fundo escuro do .panel-dark (texto branco). Dentro  */
/* do drawer claro do painel esse texto sumia. Aqui elas recebem as    */
/* cores do painel — escopadas ao .crm-cotador para não afetar a       */
/* venda pública.                                                      */
/* ------------------------------------------------------------------ */
.crm-cotador .size-option {
    border: 1px solid var(--brand-line);
    background: var(--c-white);
    color: var(--c-text);
}
.crm-cotador .size-option:hover { border-color: var(--c-text-faint); }
.crm-cotador .size-option.is-selected {
    border-color: var(--brand-primary);
    background: rgba(var(--brand-primary-rgb), .08);
    color: var(--c-text);
}

.crm-cotador .accept-box {
    border: 1px solid var(--brand-line);
    background: var(--c-white);
    color: var(--c-text);
}
.crm-cotador .accept-box:hover { border-color: var(--c-text-faint); }

.crm-cotador .plan-card {
    border: 1px solid var(--brand-line);
    background: var(--c-white);
    color: var(--c-text);
}
.crm-cotador .plan-card:hover { border-color: var(--c-text-faint); }
.crm-cotador .plan-card.is-selected {
    border-color: var(--brand-primary);
    background: rgba(var(--brand-primary-rgb), .06);
    color: var(--c-text);
}
.crm-cotador .plan-card-price { color: var(--c-text-soft); }
.crm-cotador .plan-card-price strong { color: var(--c-text); }
.crm-cotador .plan-card-join { color: var(--c-text-soft); }
.crm-cotador .plan-card-benefits { border-top-color: var(--brand-line); }
.crm-cotador .plan-card-benefits li { color: var(--c-text-soft); }

/* --------------------------------------------------------------------------
   Assistente de proposta (S24).

   O consultor monta a venda em quatro passos com o resumo sempre à vista —
   ele está com o cliente no telefone, e perder o que já preencheu para trocar
   de tela é perder a venda. Por isso uma tela só, com `x-show` nos passos.
   -------------------------------------------------------------------------- */
.wizard-rail {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.wizard-step {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 1 1 150px;
    padding: 10px 14px;
    border: 1px solid var(--brand-line);
    border-radius: var(--radius);
    background: var(--c-white);
    font-size: .84rem;
    color: var(--c-text-faint);
}
.wizard-step.is-current {
    border-color: var(--brand-primary);
    color: var(--c-text);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--brand-primary);
}
.wizard-step.is-done { color: var(--c-text-soft); }
.wizard-dot {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border-radius: var(--radius-full);
    background: var(--brand-surface);
    font-size: .76rem;
    font-weight: 700;
}
.wizard-step.is-current .wizard-dot { background: var(--brand-primary); color: #fff; }
.wizard-step.is-done .wizard-dot { background: var(--c-success); color: #fff; }

/* Uma oferta = um plano dentro de uma tabela. A linha inteira é o alvo do
   clique: em telefone, acertar o radinho de 16px é hostil. */
.offer-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--brand-line);
    cursor: pointer;
}
.offer-row:last-child { border-bottom: 0; }
.offer-row:hover { background: var(--brand-surface); }
.offer-row.is-chosen { background: rgba(var(--brand-primary-rgb), .06); }
.offer-row-info { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.offer-row-info strong { font-size: .95rem; }
.offer-row-info span { font-size: .8rem; color: var(--c-text-soft); }
.offer-row-price { text-align: right; }
.offer-row-price strong { display: block; font-size: 1.05rem; font-family: var(--font-mono); }
.offer-row-price span { font-size: .74rem; color: var(--c-text-faint); }

/* O papel de cada graduação na venda — a tela do Pleno. */
.role-step {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px;
    border: 1px solid var(--brand-line);
    border-radius: var(--radius);
    background: var(--c-white);
}
.role-step-num {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: rgba(var(--brand-primary-rgb), .12);
    color: var(--brand-primary);
    font-weight: 700;
    font-size: .82rem;
}
.role-step strong { font-size: .95rem; }
.role-step span:not(.role-step-num) { font-size: .84rem; color: var(--c-text-soft); }

/* Percentual do PLUS e da adesão: arrastar comunica "de 0 a 50" melhor que
   um campo numérico. */
.range {
    width: 100%;
    accent-color: var(--brand-primary);
    margin: 8px 0 2px;
}

.rule { border: 0; border-top: 1px solid var(--brand-line); margin: 4px 0; }

/* --------------------------------------------------------------------------
   Jornada de credenciamento (S24) — formulário de intenção, triagem, entrevista.
   -------------------------------------------------------------------------- */

/* O formulário público. Herda o painel escuro do onboarding. */
.intent-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 12px; }
.intent-grid .span-2 { grid-column: 1 / -1; }

/* ------------------------------------------------------------------
   O formulario publico: uma pergunta por vez.

   A lista inteira numa pagina so mostrava de cara 11 perguntas e 40
   respostas. Uma parede dessas convida a abandonar antes de comecar,
   ou a responder no automatico para chegar ao fim — e a nota so vale
   alguma coisa se as respostas forem pensadas.
   ------------------------------------------------------------------ */

.iw { max-width: 760px; margin: 0 auto; }

/* A barra e o unico lugar onde o candidato ve quanto falta. Sem ela,
   "uma por vez" vira um corredor sem fim. */
.iw-bar {
    height: 3px;
    border-radius: 3px;
    background: rgba(255, 255, 255, .09);
    overflow: hidden;
}

.iw-bar span {
    display: block;
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, rgba(var(--brand-primary-rgb), .5), var(--brand-primary));
    transition: width .5s cubic-bezier(.22, 1, .36, 1);
}

.iw-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin: 13px 2px 20px;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .4);
}

.iw-head-count b { color: var(--brand-primary); font-size: .84rem; }

/* Altura minima para o painel nao mudar de tamanho entre uma pergunta
   de duas linhas e outra de quatro opcoes longas: o passo trocando de
   altura a cada clique faz o botao fugir de baixo do cursor. */
.iw-step { min-height: 316px; }
.iw-step.is-in { animation: iwIn .42s cubic-bezier(.22, 1, .36, 1) both; }

@keyframes iwIn {
    from { opacity: 0; transform: translateY(15px); }
    to   { opacity: 1; transform: none; }
}

.iw-title { font-size: 1.9rem; letter-spacing: -.03em; }
.iw-intro { margin-top: 10px; max-width: 56ch; font-size: .95rem; color: rgba(255, 255, 255, .58); }

.iw-eyebrow {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 18px;
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--brand-primary);
}

.iw-eyebrow svg { width: 12px; height: 12px; }
.iw-step.is-gate .iw-eyebrow { color: rgba(255, 255, 255, .7); }

.iw-q { display: flex; align-items: flex-start; gap: 14px; }

.iw-q-num {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: rgba(var(--brand-primary-rgb), .18);
    color: var(--brand-primary);
    font-size: .85rem;
    font-weight: 700;
}

.iw-q-num svg { width: 14px; height: 14px; }
.iw-step.is-gate .iw-q-num { background: rgba(255, 255, 255, .12); color: rgba(255, 255, 255, .9); }

.iw-q-label { font-size: 1.4rem; font-weight: 600; line-height: 1.35; letter-spacing: -.02em; }
.iw-q-hint { margin: 11px 0 0 46px; font-size: .86rem; color: rgba(255, 255, 255, .5); }

.iw-choices { display: flex; flex-direction: column; gap: 10px; margin: 24px 0 0 46px; }

.iw-choice {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 15px 17px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .04);
    color: rgba(255, 255, 255, .86);
    font-size: .95rem;
    cursor: pointer;
    transition: border-color .18s, background .18s, transform .18s;
}

.iw-choice:hover { border-color: rgba(var(--brand-primary-rgb), .55); transform: translateX(3px); }

/* O controle nativo sai de cena: quem marca o estado sao a borda e o
   .iw-choice-mark. Continua sendo um input de verdade — teclado, leitor
   de tela e o POST nao mudam. */
.iw-choice input { appearance: none; width: 0; height: 0; margin: 0; opacity: 0; }

.iw-choice-mark {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: var(--radius-full);
    color: transparent;
    transition: background .18s, border-color .18s, color .18s;
}

.iw-choice-mark svg { width: 13px; height: 13px; }
.iw-choice-text { flex: 1; }

.iw-choice-key {
    flex-shrink: 0;
    padding: 2px 7px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 5px;
    background: rgba(255, 255, 255, .05);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .7rem;
    color: rgba(255, 255, 255, .38);
}

.iw-choice:has(input:checked) {
    border-color: var(--brand-primary);
    background: rgba(var(--brand-primary-rgb), .14);
    color: #fff;
}

.iw-choice:has(input:checked) .iw-choice-mark {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
}

.iw-choice:has(input:focus-visible) { outline: 2px solid var(--brand-primary); outline-offset: 2px; }

.iw-text { width: calc(100% - 46px); margin: 24px 0 0 46px; }

.iw-error { margin-top: 20px; font-size: .87rem; color: var(--c-danger); }

.iw-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 30px;
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.iw-nav-end { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.iw-nav .btn svg { width: 15px; height: 15px; }
.iw-legal { max-width: 30ch; font-size: .78rem; color: rgba(255, 255, 255, .42); }
.iw-foot { margin-top: 20px; text-align: center; font-size: .8rem; color: rgba(255, 255, 255, .34); }

@media (max-width: 780px) {
    .iw-step { min-height: 0; }
    .iw-title { font-size: 1.5rem; }
    .iw-q-label { font-size: 1.16rem; }
    .iw-q-hint,
    .iw-choices { margin-left: 0; }
    .iw-text { width: 100%; margin-left: 0; }
    .iw-choice-key { display: none; }
    .iw-nav { flex-wrap: wrap; }
    .iw-nav-end { flex-direction: column-reverse; align-items: stretch; width: 100%; }
    .iw-nav-end .btn { width: 100%; }
    .iw-legal { max-width: none; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    .iw-step.is-in { animation: none; }
    .iw-bar span { transition: none; }
    .iw-choice:hover { transform: none; }
}

/* A jornada que o candidato vê depois de enviar. */
.journey { list-style: none; margin: 28px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.journey-step {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 12px 0;
    color: rgba(255, 255, 255, .42);
}
.journey-step strong { display: block; color: rgba(255, 255, 255, .62); font-size: .94rem; }
.journey-step span { font-size: .83rem; }
.journey-step.is-done strong,
.journey-step.is-current strong { color: #fff; }
.journey-step.is-current span { color: rgba(255, 255, 255, .7); }
.journey-dot {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, .08);
    font-size: .78rem;
    font-weight: 700;
}
.journey-dot svg { width: 15px; height: 15px; }
.journey-step.is-done .journey-dot { background: var(--c-success); color: #fff; }
.journey-step.is-current .journey-dot { background: var(--brand-primary); color: #fff; }

/* O mapa de calor da triagem.

   Cor é mais rápida que número numa fila de dezenas: o diretor precisa saber
   onde olhar primeiro sem ler nota por nota. A cor não decide nada — quem
   decide é a nota de corte. */
.heat { display: inline-flex; flex-direction: column; gap: 5px; min-width: 84px; }
.heat strong { font-size: .95rem; font-family: var(--font-mono); line-height: 1; }
.heat strong small { font-size: .72rem; color: var(--c-text-faint); font-weight: 400; }
.heat-bar { display: block; height: 5px; border-radius: var(--radius-full); background: var(--brand-line); }
.heat-bar > span { display: block; height: 100%; border-radius: var(--radius-full); }
.heat-quente strong { color: #D9480F; }
.heat-quente .heat-bar > span { background: linear-gradient(90deg, #FB4516, #F2B705); }
.heat-morno strong { color: #B7791F; }
.heat-morno .heat-bar > span { background: #F2B705; }
.heat-frio strong { color: var(--c-text-soft); }
.heat-frio .heat-bar > span { background: #93A5B1; }

/* As opções de uma pergunta, na tela do admin. */
.option-list { display: flex; flex-direction: column; gap: 6px; }
.option-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border: 1px solid var(--brand-line);
    border-radius: var(--radius-sm);
    background: var(--c-white);
}
.option-row > span:first-child { flex: 1; font-size: .9rem; }

/* --------------------------------------------------------------------------
   Ilustração do veículo na proposta (S24) — uma por tipo, em /admin/marca.

   A prévia tem fundo escuro porque é assim que a imagem aparece no cartão:
   testar sobre branco esconderia que o PNG não tem fundo transparente.
   -------------------------------------------------------------------------- */
.vehicle-art-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
}
.vehicle-art {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--brand-line);
    border-radius: var(--radius);
    background: var(--c-white);
}
.vehicle-art > strong { font-size: .88rem; }
.vehicle-art-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
    padding: 10px;
    border-radius: var(--radius-sm);
    background: linear-gradient(170deg, #16161a 0%, #0b0b0d 100%);
    text-align: center;
}
.vehicle-art-preview img { max-width: 100%; max-height: 100%; }
.vehicle-art-preview.is-empty { border: 1px dashed rgba(255, 255, 255, .18); }
.vehicle-art-preview .faint { color: rgba(255, 255, 255, .45); }

/* Os logotipos de montadora cadastrados. A previa e BRANCA, nao escura como a
   da ilustracao: no cartao eles ficam sobre uma placa branca, e mostra-los
   aqui sobre fundo preto esconderia justamente o erro que a tela precisa
   deixar obvio — o de subir a versao clara da marca. */
.brand-logo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
}

.brand-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--brand-line);
    border-radius: var(--radius);
    text-align: center;
}

.brand-logo > strong { font-size: .84rem; }

.brand-logo-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 76px;
    padding: 10px;
    border: 1px solid var(--brand-line);
    border-radius: var(--radius-sm);
    background: #fff;
}

.brand-logo-preview img { max-width: 100%; max-height: 100%; }


/* ==================================================================== */
/*  Ajustes de operação (S27)                                           */
/* ==================================================================== */

/* --------------------------------------------------------------------
   Graduação em pílula.

   `.badge-level` pinta o fundo com a cor do nível e escrevia sempre em
   branco. A régua vai do branco (Pleno) ao preto (Diretor): no Pleno o
   texto branco sumia sobre o fundo branco, e a própria pílula sumia no
   cartão. A tinta é decidida por `belt_ink()` no template; aqui fica o
   contorno, que resolve o segundo problema para qualquer cor clara.
   -------------------------------------------------------------------- */
.badge-level {
    color: #fff;
    border: 1px solid rgba(12, 12, 12, .16);
}

/* --------------------------------------------------------------------
   Assistentes dentro do painel.

   `.size-option`, `.accept-box` e `.plan-card` nasceram para o fundo
   escuro da venda pública (`.panel-dark`) — texto branco. O cotador do
   CRM já tinha o remendo escopado; faltavam os assistentes de "Nova
   cotação" e "Nova proposta", onde os botões de Pessoa física/jurídica
   e os cartões do passo 4 ficavam brancos no branco. `.app-content` é
   a área do painel: a venda pública não passa por ela.
   -------------------------------------------------------------------- */
.app-content .size-option {
    border: 1px solid var(--brand-line);
    background: var(--c-white);
    color: var(--c-text);
}
.app-content .size-option:hover { border-color: var(--c-text-faint); }
.app-content .size-option.is-selected {
    border-color: var(--brand-primary);
    background: rgba(var(--brand-primary-rgb), .08);
    color: var(--c-text);
}

.app-content .accept-box {
    border: 1px solid var(--brand-line);
    background: var(--c-white);
    color: var(--c-text);
}
.app-content .accept-box:hover { border-color: var(--c-text-faint); }

.app-content .plan-card {
    border: 1px solid var(--brand-line);
    background: var(--c-white);
    color: var(--c-text);
}
.app-content .plan-card:hover { border-color: var(--c-text-faint); }
.app-content .plan-card.is-selected {
    border-color: var(--brand-primary);
    background: rgba(var(--brand-primary-rgb), .06);
    color: var(--c-text);
}
.app-content .plan-card-price { color: var(--c-text-soft); }
.app-content .plan-card-price strong { color: var(--c-text); }
.app-content .plan-card-join { color: var(--c-text-soft); }
.app-content .plan-card-benefits { border-top-color: var(--brand-line); }
.app-content .plan-card-benefits li { color: var(--c-text-soft); }

/* A caixa do kit e a lista de fechadores também vinham do wizard escuro.
   O `span` precisa de regra própria: `.kit-list-item span` (a original) é mais
   específica que `.kit-list-item`, e sem isto o nome do Sênior continuava
   branco no branco — que foi exatamente o que sobrou na primeira passada. */
.app-content .kit-list { border-top-color: var(--brand-line); }
.app-content .kit-list-item { color: var(--c-text); }
.app-content .kit-list-item span { color: var(--c-text-soft); }
.app-content .kit-list-item strong { color: var(--c-text); }
.app-content .kit-list-item .faint { color: var(--c-text-faint); }
.app-content .legal-note {
    background: var(--brand-surface);
    border-color: var(--brand-line);
    color: var(--c-text-soft);
}

/* --------------------------------------------------------------------
   Meus Ganhos: o total e a repartição.
   -------------------------------------------------------------------- */
.earnings-hero-top {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
    justify-content: space-between;
}

.earnings-total {
    margin-top: 6px;
    font-size: clamp(2.1rem, 5vw, 3rem);
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.05;
    font-family: var(--font-mono);
}

.earnings-hero-side {
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
}
.earnings-hero-side strong { display: block; font-size: 1.2rem; }

/* Uma barra só: própria x estrutura é uma comparação de duas partes de um
   inteiro, e duas barras separadas obrigavam a comparar comprimentos que
   não começam no mesmo ponto. */
.split-bar {
    display: flex;
    height: 12px;
    margin-top: 22px;
    border-radius: var(--radius-full);
    overflow: hidden;
    background: var(--brand-surface);
}
.split-bar-own { background: var(--brand-primary); }
.split-bar-net { background: var(--c-info); }

.split-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 10px;
    font-size: .82rem;
    color: var(--c-text-soft);
}
.split-legend strong { color: var(--c-text); font-family: var(--font-mono); }
.split-legend .dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 6px;
    border-radius: var(--radius-full);
}
.dot-own { background: var(--brand-primary); }
.dot-net { background: var(--c-info); }

/* --------------------------------------------------------------------
   Tipos de comissão: cartões clicáveis que abrem o extrato filtrado.
   -------------------------------------------------------------------- */
.type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
}

.type-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px;
    border: 1px solid var(--brand-line);
    border-radius: var(--radius);
    background: var(--c-white);
    color: inherit;
    text-decoration: none;
    transition: border-color .16s var(--ease), transform .12s var(--ease),
                box-shadow .16s var(--ease);
}
.type-card:hover {
    border-color: var(--tipo, var(--brand-primary));
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.type-card-head { display: flex; align-items: center; gap: 8px; }
.type-card-head strong { font-size: .88rem; flex: 1; min-width: 0; }
.type-card-icon {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--tipo) 14%, transparent);
    color: var(--tipo);
}
.type-card-icon svg { width: 15px; height: 15px; }
.type-card-share { font-size: .72rem; color: var(--c-text-faint); }
.type-card-value { font-size: 1.25rem; font-weight: 700; }
.type-card-foot { font-size: .72rem; color: var(--c-text-faint); }

/* --------------------------------------------------------------------
   Árvore da estrutura comercial: a linha de conexão com o pai.

   Sem ela, um nó indentado no meio de uma lista longa não diz de quem é
   filho — que era metade da queixa de "encavalando".
   -------------------------------------------------------------------- */
.tree-node { position: relative; }
.tree-node.is-child::before {
    content: '';
    position: absolute;
    left: -14px;
    top: 0;
    bottom: 50%;
    width: 1px;
    background: var(--brand-line);
}
.tree-node.is-child::after {
    content: '';
    position: absolute;
    left: -14px;
    top: 50%;
    width: 12px;
    height: 1px;
    background: var(--brand-line);
}
.tree-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 12px;
}
.tree-count { font-size: .78rem; color: var(--c-text-faint); }

/* Campo preenchido pelo sistema: parece campo, mas não se digita nele. */
.input.is-readonly {
    display: block;
    background: var(--brand-surface);
    color: var(--c-text-soft);
    cursor: default;
    margin: 0;
}
