/* ===================================
   DASHBOARD STYLES
   =================================== */

/* Grid de Cards */
.dashboard-grid {
    display: grid;
    /* 300px: largura em que "R$ 999.999,99" cabe a 32px com o padding de
       24px, e que evita colunas estreitas demais em monitor grande.
       min() protege viewports menores que isso. */
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    /* Sem grid-auto-rows:1fr: ele igualava TODAS as linhas à mais alta e,
       com uma coluna só (celular), deixava cada cartão com espaço vazio.
       A igualdade dentro da mesma linha continua vindo do height:100% do
       .metric-card com o stretch padrão do grid. */
    gap: 20px;
    margin-bottom: 32px;
}

/* Metric Card */
.metric-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    border: 1px solid var(--gray-200);
    height: 100%; /* preenche a célula do grid para ficar do mesmo tamanho */
    /* Mesma correção do painel do vendedor: o valor escala com a largura do
       próprio cartão, então valor grande cabe em qualquer proporção de tela. */
    container-type: inline-size;
    min-width: 0;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.metric-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.metric-card-title {
    font-size: 13px;
    font-weight: var(--font-weight-medium);
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.metric-card-icon.blue { background: rgba(var(--primary-rgb), 0.1); color: var(--primary); }
.metric-card-icon.green { background: rgba(52, 199, 89, 0.1); color: var(--success); }
.metric-card-icon.orange { background: rgba(255, 149, 0, 0.1); color: var(--warning); }
.metric-card-icon.red { background: rgba(255, 59, 48, 0.1); color: var(--danger); }
.metric-card-icon.purple { background: rgba(88, 86, 214, 0.1); color: var(--secondary); }

.metric-card-value {
    /* 9cqi da largura do cartão (24px de padding de cada lado). Vale do
       mínimo do grid (300px) até monitor grande. */
    font-size: 32px;                       /* fallback: navegador sem cqi */
    font-size: clamp(1rem, 9cqi, 2rem);
    font-weight: var(--font-weight-bold);
    color: var(--gray-900);
    margin-bottom: 8px;
    line-height: 1.05;
    white-space: nowrap;
}

.metric-card-subtitle {
    font-size: 13px;
    color: var(--gray-500);
}

.metric-card-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: var(--font-weight-semibold);
    padding: 4px 8px;
    border-radius: 6px;
    margin-top: 8px;
}

.metric-card-trend.up {
    background: rgba(52, 199, 89, 0.1);
    color: var(--success);
}

.metric-card-trend.down {
    background: rgba(255, 59, 48, 0.1);
    color: var(--danger);
}

/* Dashboard Sections */
.dashboard-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
}

.section-title {
    font-size: 18px;
    font-weight: var(--font-weight-bold);
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: var(--primary);
}

.section-action {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    font-weight: var(--font-weight-semibold);
    transition: all var(--transition-fast);
}

.section-action:hover {
    color: var(--primary-dark);
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 350px;
    margin: 20px 0;
}

/* Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--gray-50);
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: var(--font-weight-semibold);
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--gray-200);
}

.data-table td {
    padding: 14px 16px;
    font-size: 14px;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-100);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: var(--font-weight-semibold);
}

.status-badge.pendente {
    background: rgba(255, 149, 0, 0.1);
    color: var(--warning);
}

.status-badge.separado {
    background: rgba(88, 86, 214, 0.1);
    color: var(--secondary);
}

.status-badge.pago {
    background: rgba(52, 199, 89, 0.1);
    color: var(--success);
}

.status-badge.enviado {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
}

.status-badge.cancelado {
    background: rgba(255, 59, 48, 0.1);
    color: var(--danger);
}

.status-badge i {
    font-size: 8px;
}

/* Product Item */
.product-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.product-image {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.product-info h4 {
    font-size: 14px;
    font-weight: var(--font-weight-semibold);
    color: var(--gray-900);
    margin-bottom: 2px;
}

.product-info p {
    font-size: 12px;
    color: var(--gray-500);
}

/* Alert Box */
.alert-box {
    padding: 16px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    border-left: 4px solid;
}

.alert-box.warning {
    background: rgba(255, 149, 0, 0.1);
    border-color: var(--warning);
}

.alert-box.info {
    background: rgba(var(--primary-rgb), 0.1);
    border-color: var(--primary);
}

.alert-box i {
    font-size: 20px;
    color: var(--warning);
}

.alert-box.info i {
    color: var(--primary);
}

.alert-content h4 {
    font-size: 14px;
    font-weight: var(--font-weight-semibold);
    color: var(--gray-900);
    margin-bottom: 4px;
}

.alert-content p {
    font-size: 13px;
    color: var(--gray-600);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 64px;
    color: var(--gray-300);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    color: var(--gray-600);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: var(--gray-500);
}

/* Loading State */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Botões de Período */
.btn-periodo {
    padding: 10px 20px;
    border: 2px solid var(--gray-300);
    background: white;
    color: var(--gray-700);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-periodo:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.05);
}

.btn-periodo.active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.btn-periodo i {
    font-size: 13px;
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-success {
    background: rgba(52, 199, 89, 0.1);
    color: var(--success);
}

.badge-warning {
    background: rgba(255, 149, 0, 0.1);
    color: var(--warning);
}

.badge-info {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
}

.badge-primary {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
}

.badge-secondary {
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        height: 300px;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 12px;
    }
}

/* ===================================================================
   DASHBOARD — NOVO LAYOUT (09/09/2026)
   Classes .cfd-*: cabeçalho, KPIs com sparkline, gráfico + fluxo de
   caixa, tabelas e cartões. Usa só as variáveis do sistema, então
   funciona no tema claro e no escuro (cf-dark-pro.css troca as vars).
   =================================================================== */
.cfd { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* Cabeçalho */
.cfd-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.cfd-title { font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: var(--gray-900); margin: 0 0 4px; line-height: 1.15; }
.cfd-sub { font-size: 13px; color: var(--gray-500); margin: 0; }
.cfd-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cfd-chips { display: inline-flex; gap: 4px; padding: 4px; background: var(--gray-100); border: 1px solid var(--gray-200); border-radius: 10px; }
.cfd-chip { border: 0; background: transparent; color: var(--gray-600); font: inherit; font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 7px; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.cfd-chip:hover { color: var(--gray-900); }
.cfd-chip.on { background: var(--white); color: var(--gray-900); box-shadow: var(--shadow-sm); }
.cfd-range, .cfd-export { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 13px; font-weight: 600; padding: 9px 14px; border-radius: 10px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.cfd-range { background: var(--white); border: 1px solid var(--gray-200); color: var(--gray-700); }
.cfd-range:hover, .cfd-range.on { border-color: var(--primary); color: var(--gray-900); }
.cfd-range.on i { color: var(--primary); }
.cfd-export { background: var(--primary); border: 1px solid var(--primary); color: #fff; }
.cfd-export:hover { filter: brightness(1.06); }

/* KPIs */
.cfd-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 16px; }
.cfd-kpi { position: relative; overflow: hidden; background: var(--white); border: 1px solid var(--gray-200); border-radius: 16px; padding: 18px 18px 46px; box-shadow: var(--shadow-sm); min-width: 0; container-type: inline-size; transition: transform .15s, box-shadow .15s, border-color .15s; }
.cfd-kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.cfd-kpi.clicavel { cursor: pointer; }
.cfd-kpi.clicavel:hover { border-color: var(--kc); }
.cfd-kpi-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cfd-kpi-ico { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; color: var(--kc); background: color-mix(in srgb, var(--kc) 14%, transparent); flex: none; }
.cfd-kpi-tit { font-size: 12px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: .04em; line-height: 1.2; }
.cfd-kpi-val { font-size: 26px; font-size: clamp(1.1rem, 11cqi, 1.7rem); font-weight: 800; letter-spacing: -.02em; color: var(--gray-900); line-height: 1.1; white-space: nowrap; margin-bottom: 8px; }
.cfd-delta { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; white-space: nowrap; max-width: 100%; overflow: hidden; }
.cfd-delta em { overflow: hidden; text-overflow: ellipsis; }
.cfd-delta em { font-style: normal; font-weight: 500; color: var(--gray-500); }
.cfd-delta.bom { color: #22c55e; }
.cfd-delta.ruim { color: #ef4444; }
.cfd-delta.neutro { color: var(--gray-500); }
.cfd-kpi-foot { font-size: 11px; color: var(--gray-500); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cfd-spark { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 40px; display: block; pointer-events: none; }

/* Linhas / cartões */
.cfd-row { display: grid; gap: 20px; min-width: 0; }
.cfd-row-chart { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.cfd-row-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.cfd-row-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
/* 26/09/2026: Clientes Novos + Recompras empilhados à esquerda; o mapa de Vendas por Região ocupa o resto */
.cfd-row-mapa { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); align-items: stretch; }
.cfd-col-mapa { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.cfd-col-mapa > .cfd-card { flex: 1; min-height: 0; }
@media (max-width: 900px) { .cfd-row-mapa { grid-template-columns: minmax(0, 1fr); } }
/* Listas de Clientes Novos e Recompras: enchem o cartão; o que passar rola dentro dele */
.cfd-lista-rolar { overflow-y: auto; scrollbar-width: thin; padding-right: 4px; }
.cfd-lista-rodape { margin-top: 10px; }
.cfd-destaque-lista .cfd-lista { gap: 10px; }
@media (min-width: 901px) {
    /* A altura da linha vem do mapa; a coluna da esquerda só acompanha (não estica a linha) */
    .cfd-col-mapa { contain: size; min-height: 560px; }
    .cfd-col-mapa .cfd-lista-rolar { flex: 1 1 0; min-height: 0; }
    .cfd-col-mapa .cfd-recompra { flex: 1; min-height: 0; }
    .cfd-col-mapa .cfd-destaque-lista { flex: 1; min-height: 0; display: flex; flex-direction: column; }
}
@media (max-width: 900px) { .cfd-lista-rolar { max-height: 340px; } }
.cfd-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: 16px; padding: 20px; box-shadow: var(--shadow-sm); min-width: 0; display: flex; flex-direction: column; }
.cfd-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.cfd-card-head.wrap { flex-wrap: wrap; }
.cfd-card-head > .cfd-card-title, .cfd-card-head > div:first-child { flex: 1; min-width: 0; }
.cfd-card-head.cf-clicavel { cursor: pointer; }
.cfd-card-title { font-size: 15px; font-weight: 700; color: var(--gray-900); margin: 0; display: flex; align-items: center; gap: 8px; line-height: 1.3; }
.cfd-card-title i { font-size: 14px; }
.cfd-card-sub { font-size: 12px; color: var(--gray-500); margin: 3px 0 0; }
.cfd-card-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cfd-link { font-size: 13px; font-weight: 600; color: var(--primary); text-decoration: none; white-space: nowrap; }
.cfd-link:hover { text-decoration: underline; }
.cfd-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--bc); background: color-mix(in srgb, var(--bc) 14%, transparent); }
.cfd-legend { display: flex; gap: 14px; flex-wrap: wrap; }
.cfd-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--gray-600); }
.cfd-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.cfd-select { font: inherit; font-size: 12px; font-weight: 600; color: var(--gray-700); background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 8px; padding: 6px 28px 6px 10px; cursor: pointer; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238a8578' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.cfd-chart { position: relative; height: 320px; min-height: 240px; flex: 1; }

/* Fluxo de caixa */
.cfd-fluxo-linha { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.cfd-fluxo-ico { width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; color: var(--fc); background: color-mix(in srgb, var(--fc) 14%, transparent); flex: none; }
.cfd-fluxo-lbl { flex: 1; font-size: 13px; color: var(--gray-600); font-weight: 500; }
.cfd-fluxo-val { font-size: 15px; font-weight: 700; white-space: nowrap; }
.cfd-fluxo-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--gray-200); margin: 6px 0 14px; }
.cfd-fluxo-bar span { display: block; height: 100%; }
.cfd-fluxo-saldo { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px; border-radius: 12px; background: var(--gray-50); border: 1px dashed var(--gray-300); }
.cfd-fluxo-saldo-lbl { font-size: 13px; font-weight: 600; color: var(--gray-700); }
.cfd-fluxo-saldo-val { font-size: 22px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.cfd-fluxo-nota { margin-top: 14px; font-size: 12px; color: var(--gray-500); line-height: 1.45; display: flex; gap: 8px; align-items: flex-start; }
.cfd-fluxo-nota i { color: #06b6d4; margin-top: 2px; }

/* Tabelas */
.cfd-tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; }
.cfd-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.cfd-tbl th { text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--gray-500); padding: 8px 10px; border-bottom: 1px solid var(--gray-200); white-space: nowrap; }
.cfd-tbl td { padding: 11px 10px; border-bottom: 1px solid var(--gray-100); color: var(--gray-800); vertical-align: middle; }
.cfd-tbl tbody tr:last-child td { border-bottom: 0; }
.cfd-tbl tbody tr:hover td { background: var(--gray-50); }
.cfd-tbl tr.cf-clicavel { cursor: pointer; }
.cfd-tbl .num { text-align: right; white-space: nowrap; }
.cfd-tbl .rank { width: 36px; }
.cfd-tbl strong { color: var(--gray-900); font-weight: 700; }
.cfd-rank { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 7px; font-size: 12px; font-weight: 700; color: var(--gray-600); background: var(--gray-100); flex: none; }
.cfd-rank.r1 { color: #b45309; background: rgba(245,158,11,.18); }
.cfd-rank.r2 { color: #475569; background: rgba(148,163,184,.22); }
.cfd-rank.r3 { color: #9a3412; background: rgba(234,88,12,.16); }
.cfd-prod { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cfd-prod-nome { font-weight: 600; color: var(--gray-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cfd-thumb { width: 36px; height: 36px; border-radius: 9px; object-fit: cover; flex: none; background: var(--gray-100); }
.cfd-thumb.ph { display: inline-flex; align-items: center; justify-content: center; color: var(--gray-400); font-size: 14px; }
.cfd-pessoa { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cfd-pessoa-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.cfd-pessoa-txt strong { font-size: 13px; font-weight: 600; color: var(--gray-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cfd-pessoa-txt small { font-size: 11px; color: var(--gray-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cfd-avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--ac); background: color-mix(in srgb, var(--ac) 16%, transparent); flex: none; letter-spacing: .02em; }
.cfd-status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; color: var(--gray-600); background: var(--gray-100); }
.cfd-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.cfd-status.pendente { color: #b45309; background: rgba(245,158,11,.16); }
.cfd-status.separado, .cfd-status.separacao, .cfd-status.em_separacao, .cfd-status.pronto_envio { color: #1d4ed8; background: rgba(59,130,246,.16); }
.cfd-status.pago     { color: #15803d; background: rgba(34,197,94,.16); }
.cfd-status.enviado  { color: #6d28d9; background: rgba(139,92,246,.16); }
.cfd-status.entregue { color: #0f766e; background: rgba(20,184,166,.16); }
.cfd-status.cancelado{ color: #b91c1c; background: rgba(239,68,68,.16); }

/* Listas, destaques e barras */
.cfd-lista { display: flex; flex-direction: column; gap: 12px; }
.cfd-recompra { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.cfd-big { font-size: 40px; font-weight: 800; letter-spacing: -.03em; line-height: 1; margin-top: 4px; }
.cfd-big-sub { font-size: 12px; color: var(--gray-500); }
.cfd-destaque { width: 100%; margin-top: 14px; padding: 12px; border-radius: 12px; background: var(--gray-50); border: 1px solid var(--gray-200); text-align: left; }
.cfd-destaque > small { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--gray-500); margin-bottom: 8px; }
.cfd-muted { font-size: 12px; color: var(--gray-500); margin: 8px 0 0; }
.cfd-stats2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.cfd-stat { padding: 12px; border-radius: 12px; background: var(--gray-50); border: 1px solid var(--gray-200); text-align: center; }
.cfd-stat strong { display: block; font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.cfd-stat small { font-size: 11px; color: var(--gray-500); }
.cfd-barras { display: flex; flex-direction: column; gap: 12px; }
.cfd-barra-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.cfd-barra-nome { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--gray-900); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cfd-barra-val { font-size: 12px; font-weight: 600; color: var(--gray-500); white-space: nowrap; }
.cfd-track { height: 8px; border-radius: 4px; background: var(--gray-200); overflow: hidden; }
.cfd-track span { display: block; height: 100%; border-radius: 4px; transition: width .3s ease; }
.cfd-barras .cfm-vermais { margin-top: 4px; }

/* Vazio e rodapé */
.cfd-vazio { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 28px 12px; color: var(--gray-500); font-size: 13px; text-align: center; flex: 1; }
.cfd-vazio i { font-size: 30px; color: var(--gray-300); }
.cfd-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-radius: 12px; background: var(--white); border: 1px solid var(--gray-200); font-size: 12px; color: var(--gray-500); }
.cfd-foot-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.2); flex: none; }
.cfd-foot-sep { color: var(--gray-300); }

/* Responsivo */
@media (max-width: 1100px) {
    .cfd-row-chart { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .cfd-title { font-size: 22px; }
    .cfd-tools { width: 100%; }
    .cfd-chips { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .cfd-chip { flex: 1; padding: 7px 8px; font-size: 12px; }
    .cfd-range { flex: 1; justify-content: center; }
    .cfd-card { padding: 16px; }
    .cfd-chart { height: 260px; }
    .cfd-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .cfd-kpi { padding: 14px 14px 40px; }
    .cfd-kpi-ico { width: 30px; height: 30px; font-size: 13px; }
    .cfd-kpi-tit { font-size: 10px; }
    .cfd-delta { font-size: 11px; }
    .cfd-delta em { display: none; }
    .cfd-foot { justify-content: center; text-align: center; }
    .cfd-foot-sep { display: none; }
}
@media (max-width: 380px) {
    .cfd-kpis { grid-template-columns: 1fr; }
}
/* No celular a tabela vira cartões (cf-responsive); a coluna de ranking "#"
   sozinha numa linha só ocupa espaço — o número já aparece no avatar/nome. */
@media (max-width: 640px) {
    table.cf-rt.cfd-tbl td.rank, table.cf-rt.cfd-tbl th.rank { display: none !important; }
    .cfd-tbl-wrap { margin: 0; }
}

/* ── GRADE FIXA DO DASHBOARD (pedido do dono, 09/09/2026) ──
   Em tablet e desktop (≥ 768px) os blocos ficam SEMPRE na posição da
   imagem: cabeçalho numa linha, 6 KPIs em linha, gráfico | fluxo de
   caixa, produtos | top clientes, 4 cartões, pedidos recentes. Só
   encolhem. Abaixo de 768px (celular) continua em coluna única. */
@media (min-width: 768px) {
    .cfd { gap: clamp(12px, 1.3vw, 20px); }
    .cfd-head { flex-wrap: nowrap; align-items: center; }
    .cfd-head-txt { min-width: 0; }
    .cfd-title { font-size: clamp(18px, 1.8vw, 26px); }
    .cfd-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: clamp(11px, .9vw, 13px); }
    .cfd-tools { flex-wrap: nowrap; flex: none; gap: clamp(6px, .7vw, 10px); }
    .cfd-chip { padding: clamp(5px, .5vw, 7px) clamp(7px, .8vw, 12px); font-size: clamp(11px, .9vw, 13px); }
    .cfd-range, .cfd-export { padding: clamp(6px, .6vw, 9px) clamp(8px, .9vw, 14px); font-size: clamp(11px, .9vw, 13px); }

    .cfd-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(8px, 1vw, 16px); }
    .cfd-kpi { padding: clamp(10px, 1.2vw, 18px) clamp(10px, 1.2vw, 18px) clamp(34px, 3.2vw, 46px); }
    .cfd-kpi-top { gap: clamp(6px, .7vw, 10px); margin-bottom: clamp(6px, .8vw, 12px); }
    .cfd-kpi-ico { width: clamp(28px, 2.6vw, 36px); height: clamp(28px, 2.6vw, 36px); font-size: clamp(12px, 1.1vw, 15px); }
    .cfd-kpi-tit { font-size: clamp(9px, .8vw, 12px); white-space: normal; line-height: 1.15; }
    .cfd-kpi-val { font-size: clamp(.95rem, 12cqi, 1.7rem); }
    .cfd-delta { font-size: clamp(10px, .85vw, 12px); }
    .cfd-spark { height: clamp(28px, 2.8vw, 40px); }

    .cfd-row-chart { grid-template-columns: minmax(0, 1fr); }
    .cfd-row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cfd-row-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .cfd-row { gap: clamp(10px, 1.2vw, 20px); }
    .cfd-card { padding: clamp(12px, 1.4vw, 20px); }
    .cfd-card-head { flex-wrap: nowrap; align-items: center; }
    .cfd-card-title { font-size: clamp(12.5px, 1.05vw, 15px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
    .cfd-card-title i { margin-right: 6px; }
    .cfd-card-head > div:first-child { min-width: 0; }
    .cfd-card-tools { flex-wrap: nowrap; }
    .cfd-link { font-size: clamp(11px, .9vw, 13px); }
    .cfd-chart { height: clamp(260px, 26vw, 380px); min-height: 260px; }
    .cfd-tbl { font-size: clamp(11px, .9vw, 13px); }
    .cfd-tbl th, .cfd-tbl td { padding: clamp(6px, .75vw, 11px) clamp(5px, .7vw, 10px); white-space: nowrap; }
    .cfd-tbl td:nth-child(2) { white-space: normal; min-width: 90px; }
    .cfd-thumb { width: clamp(26px, 2.6vw, 36px); height: clamp(26px, 2.6vw, 36px); }
    .cfd-avatar { width: clamp(26px, 2.5vw, 34px); height: clamp(26px, 2.5vw, 34px); font-size: clamp(9px, .85vw, 12px); }
    .cfd-fluxo-val { font-size: clamp(12px, 1.05vw, 15px); }
    .cfd-fluxo-saldo-val { font-size: clamp(15px, 1.5vw, 22px); }
    .cfd-fluxo-nota { font-size: clamp(10.5px, .85vw, 12px); }
    .cfd-big { font-size: clamp(26px, 2.8vw, 40px); }
    .cfd-stat strong { font-size: clamp(16px, 1.7vw, 24px); }
    .cfd-barra-nome, .cfd-barra-val { font-size: clamp(10.5px, .9vw, 13px); }
    .cfd-pessoa-txt strong { font-size: clamp(11px, .95vw, 13px); }
}
/* Telas médias: o essencial fica, o secundário sai para nada quebrar */
@media (min-width: 768px) and (max-width: 1500px) {
    .cfd-sub { display: none; }
    .cfd-delta em { display: none; }
    .cfd-card-sub { display: none; }
    .cfd-tbl .rank, .cfd-tbl td.rank { display: none; }
    .cfd-pessoa-txt small { display: none; }
    .cfd-fluxo-nota { display: none; }
    .cfd-foot-sep, .cfd-foot span:nth-child(4) { display: none; }
}
@media (min-width: 768px) and (max-width: 1200px) {
    .cfd-range span { display: none; }
    .cfd-export { padding-left: 8px; padding-right: 8px; }
    .cfd-tbl th:nth-child(3), .cfd-tbl td:nth-child(3) { display: none; } /* Data / Vendidos-Pedidos secundário */
    .cfd-stats2 { grid-template-columns: 1fr; gap: 6px; }
}

/* Vendas por Vendedora */
.cfd-vend-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cfd-vend-stats .cfd-stat strong { font-size: clamp(14px, 1.4vw, 20px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cfd-tbl-vend td.cfd-vend-total { min-width: 150px; }
.cfd-vend-bar { height: 5px; margin: 5px 0 3px; }
.cfd-tbl-vend td.cfd-vend-total small { font-size: 10.5px; color: var(--gray-500); font-weight: 500; }
.cfd-vend-delta .cfd-delta { justify-content: flex-end; }
.cfd-vend-delta .cfd-delta em { display: none; }
@media (max-width: 1500px) { .cfd-tbl-vend th:nth-child(7), .cfd-tbl-vend td:nth-child(7), .cfd-tbl-vend th:nth-child(8), .cfd-tbl-vend td:nth-child(8) { display: none; } }
@media (max-width: 1200px) { .cfd-tbl-vend th:nth-child(6), .cfd-tbl-vend td:nth-child(6) { display: none; } }
@media (max-width: 640px) { .cfd-vend-stats { grid-template-columns: 1fr 1fr; } .cfd-vend-stats .cfd-stat:last-child { grid-column: 1 / -1; } }

/* Gráfico em barras (15/09/2026): legenda sempre visível, altura maior */
.cfd-chart { height: clamp(260px, 26vw, 380px); min-height: 260px; }
.cfd-legend span { font-size: 12.5px; }
.cfd-legend i { width: 12px; height: 12px; border-radius: 4px; }

/* Quantidade de pedidos nos KPIs — sempre visível (15/09/2026) */
.cfd-kpi-foot { display: block !important; font-size: clamp(10px, .8vw, 11.5px); color: var(--gray-500); margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cfd-kpi-foot b { color: var(--gray-900); font-weight: 800; }
@media (min-width: 768px) { .cfd-kpi { padding-bottom: clamp(38px, 3.4vw, 48px); } }

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD NO CELULAR (≤767px) — layout das imagens de 15/09/2026
   ═══════════════════════════════════════════════════════════════ */
.cfd-stat-ic { display: none; }
.cfd-chev { display: none; }
@media (max-width: 767px) {
    .cfd { gap: 16px; }
    .cfd-card { padding: 16px; border-radius: 18px; }
    .cfd-card-head { align-items: flex-start; gap: 10px; margin-bottom: 14px; }
    .cfd-card-title { font-size: 19px; }
    .cfd-card-title i { font-size: 20px; margin-right: 8px; }
    .cfd-card-sub { display: block; font-size: 13px; margin-top: 4px; line-height: 1.35; }
    .cfd-link { font-size: 14px; padding: 8px 12px; border: 1px solid var(--gray-200); border-radius: 10px; background: var(--gray-50); margin-top: 0; }
    .cfd-badge { font-size: 16px; min-width: 44px; height: 40px; border-radius: 12px; }
    /* Gráfico */
    .cfd-card-tools { width: 100%; gap: 10px; align-items: center; }
    .cfd-legend { gap: 8px; }
    .cfd-legend span { padding: 8px 12px; border: 1px solid var(--gray-200); border-radius: 999px; background: var(--gray-50); font-size: 13px; }
    .cfd-card-head.wrap > div:first-child { flex: 1 1 60%; }
    .cfd-card-head.wrap .cfd-select { order: -1; margin-left: auto; min-height: 44px; font-size: 15px; border-radius: 12px; }
    .cfd-chart { height: 300px; }
    /* Ícone-caixa reutilizado (stats, produtos, clientes, fluxo) */
    .cfd-stat-ic { display: inline-flex; width: 44px; height: 44px; border-radius: 12px; align-items: center; justify-content: center; font-size: 17px; flex: none; color: var(--sc); background: color-mix(in srgb, var(--sc) 16%, transparent); }
    .cfd-stats2 .cfd-stat { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px; }
    .cfd-stats2 .cfd-stat strong { font-size: 26px; }
    .cfd-stats2 .cfd-stat small { font-size: 13px; }
    /* Fluxo de caixa (só celular) */
    .cfd-mfluxo-io { display: grid; grid-template-columns: 1fr 1fr; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 14px; padding: 12px; margin-bottom: 12px; }
    .cfd-mfluxo-io > div { display: flex; align-items: center; gap: 10px; min-width: 0; }
    .cfd-mfluxo-io > div + div { border-left: 1px solid var(--gray-200); padding-left: 12px; }
    .cfd-mfluxo-io small { display: block; font-size: 12px; color: var(--gray-500); }
    .cfd-mfluxo-io b { font-size: 17px; font-weight: 800; color: var(--gray-900); white-space: nowrap; }
    .cfd-mfluxo-saldo { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 14px; padding: 14px; }
    .cfd-mfluxo-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
    .cfd-mfluxo-top small { display: block; font-size: 13px; color: var(--gray-500); }
    .cfd-mfluxo-top b { font-size: 26px; font-weight: 800; }
    .cfd-mfluxo-res { text-align: right; }
    .cfd-mfluxo-res small { display: block; font-size: 12px; color: var(--gray-500); margin-top: 4px; }
    .cfd-mfluxo-leg { display: flex; justify-content: space-between; font-size: 12px; color: var(--gray-500); margin-top: 6px; }
    .cfd-mfluxo .cfd-fluxo-nota { display: flex; margin-top: 12px; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 12px; padding: 12px; }
    /* Vendas por vendedora */
    .cfd-mv-lista { display: flex; flex-direction: column; gap: 12px; }
    .cfd-mv { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 16px; padding: 12px; }
    .cfd-mv-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
    .cfd-avatar-lg { width: 44px; height: 44px; font-size: 15px; }
    .cfd-mv-nome { flex: 1; min-width: 0; }
    .cfd-mv-nome strong { display: block; font-size: 17px; color: var(--gray-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .cfd-mv-nome small { font-size: 12.5px; color: var(--gray-500); }
    .cfd-mv-delta { text-align: right; flex: none; }
    .cfd-mv-delta .cfd-delta { display: flex; flex-direction: column; align-items: flex-end; font-size: 16px; white-space: normal; }
    .cfd-mv-delta .cfd-delta em { font-size: 12px; }
    .cfd-mv-boxes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
    .cfd-mv-box { background: var(--white); border: 1px solid var(--gray-200); border-radius: 12px; padding: 8px 4px; text-align: center; min-width: 0; }
    .cfd-mv-box i { font-size: 14px; display: block; margin-bottom: 4px; }
    .cfd-mv-box small { display: block; font-size: 10px; color: var(--gray-500); }
    .cfd-mv-box b { display: block; font-size: 11px; font-weight: 800; color: var(--gray-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .cfd-mv-box em { display: block; font-style: normal; font-size: 9.5px; color: var(--gray-500); margin-top: 2px; }
    /* Produtos mais vendidos */
    .cfd-mp-lista { display: flex; flex-direction: column; gap: 10px; }
    .cfd-mp { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 12px; align-items: center; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 16px; padding: 12px; }
    .cfd-mp-img { position: relative; width: 84px; height: 84px; }
    .cfd-mp-img .cfd-thumb { width: 84px; height: 84px; border-radius: 12px; }
    .cfd-mp-img .cfd-rank { position: absolute; top: -6px; left: -6px; width: 26px; height: 26px; border-radius: 50%; z-index: 1; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
    .cfd-mp-nome strong { display: block; font-size: 16px; color: var(--gray-900); line-height: 1.25; }
    .cfd-mp-best { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; color: #b45309; background: rgba(245,158,11,.18); }
    .cfd-mp-stats { display: flex; flex-direction: column; gap: 8px; }
    .cfd-mp-stats > div, .cfd-mc-stats > div, .cfd-mo-stats > div { display: flex; align-items: center; gap: 8px; min-width: 0; }
    .cfd-mp-stats small, .cfd-mc-stats small, .cfd-mo-stats small { display: block; font-size: 11px; color: var(--gray-500); text-transform: uppercase; letter-spacing: .04em; }
    .cfd-mp-stats b, .cfd-mc-stats b, .cfd-mo-stats b { display: block; font-size: 15px; font-weight: 800; color: var(--gray-900); white-space: nowrap; }
    .cfd-mp-stats .cfd-stat-ic { width: 36px; height: 36px; font-size: 14px; }
    /* Top clientes */
    .cfd-mc-lista { display: flex; flex-direction: column; gap: 10px; }
    .cfd-mc { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 16px; padding: 12px; }
    .cfd-mc-head { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--gray-200); margin-bottom: 10px; }
    .cfd-rank-lg { width: 40px; height: 40px; border-radius: 12px; font-size: 16px; }
    .cfd-mc-nome { min-width: 0; }
    .cfd-mc-nome strong { display: block; font-size: 16px; color: var(--gray-900); }
    .cfd-mc-nome small { font-size: 13px; color: var(--gray-500); }
    .cfd-mc-stats { display: grid; grid-template-columns: 1fr 1fr; }
    .cfd-mc-stats > div + div { border-left: 1px solid var(--gray-200); padding-left: 12px; }
    .cfd-mc-stats .cfd-stat-ic { width: 40px; height: 40px; }
    .cfd-mc-stats small { text-transform: none; font-size: 12px; letter-spacing: 0; }
    /* Pedidos recentes */
    .cfd-mo-lista { display: flex; flex-direction: column; gap: 10px; }
    .cfd-mo { display: flex; align-items: flex-start; gap: 12px; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 16px; padding: 12px; cursor: pointer; }
    .cfd-mo-ic { width: 48px; height: 48px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; color: var(--primary); background: color-mix(in srgb, var(--primary) 16%, transparent); flex: none; }
    .cfd-mo-body { flex: 1; min-width: 0; }
    .cfd-mo-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
    .cfd-mo-top strong { display: block; font-size: 16px; color: var(--gray-900); }
    .cfd-mo-top small { display: block; font-size: 13px; color: var(--gray-500); }
    .cfd-mo-stats { display: grid; grid-template-columns: 1fr 1fr; margin-top: 8px; }
    .cfd-mo-stats > div + div { border-left: 1px solid var(--gray-200); padding-left: 10px; }
    .cfd-mo-stats > div > i { font-size: 16px; color: var(--gray-500); width: 22px; text-align: center; }
    .cfd-mo-stats small { text-transform: none; letter-spacing: 0; font-size: 12px; }
    .cfd-mo-stats b { font-size: 14px; }
    .cfd-mo .cfd-chev { display: block; align-self: center; color: var(--gray-500); font-size: 14px; }
    /* Clientes novos / recompras */
    .cfd-lista .cfd-pessoa { padding: 6px 0; border-bottom: 1px solid var(--gray-100); }
    .cfd-lista .cfd-pessoa .cfd-avatar { width: 44px; height: 44px; font-size: 15px; }
    .cfd-lista .cfd-pessoa strong { font-size: 15px; }
    .cfd-lista .cfd-pessoa small { font-size: 13px; }
    .cfd-lista .cfd-chev { display: block; margin-left: auto; color: var(--gray-500); }
    .cfd-lista > .cfd-link { display: flex; justify-content: space-between; align-items: center; padding: 14px; border: 1px solid var(--primary); border-radius: 12px; background: color-mix(in srgb, var(--primary) 10%, transparent); font-size: 15px; margin-top: 6px; }
    .cfd-big { font-size: 48px; }
    .cfd-big-sub { font-size: 14px; }
    .cfd-destaque { background: rgba(139,92,246,.10); border-color: rgba(139,92,246,.35); padding: 14px; }
    .cfd-destaque > small { color: #a78bfa; font-size: 11px; }
    .cfd-destaque .cfd-avatar { width: 44px; height: 44px; font-size: 15px; }
    .cfd-destaque strong { font-size: 16px; }
    /* Transportadoras / regiões */
    .cfd-barras { gap: 14px; }
    .cfd-barra-nome { font-size: 15px; gap: 10px; }
    .cfd-barra-nome .cfd-rank { width: 40px; height: 40px; border-radius: 12px; font-size: 16px; }
    .cfd-barra-val { font-size: 14px; }
    .cfd-track { height: 10px; border-radius: 5px; margin-left: 50px; }
    .cfd-barras .cfm-vermais { border: 1px dashed var(--gray-300); border-radius: 12px; padding: 14px; font-size: 15px; background: transparent; }
    /* Rodapé */
    .cfd-foot { flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px 16px; font-size: 13px; }
    .cfd-foot-sep { display: none; }
}
/* Celular: acabamento (vendedoras roláveis, nº do pedido e produtos) */
@media (max-width: 767px) {
    .cfd-mv-boxes { display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch; gap: 8px; padding-bottom: 4px; scrollbar-width: none; }
    .cfd-mv-boxes::-webkit-scrollbar { display: none; }
    .cfd-mv-box { flex: 0 0 108px; padding: 10px 6px; }
    .cfd-mv-box b { font-size: 12.5px; }
    .cfd-mv-box small { font-size: 11px; }
    .cfd-mo-top strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .cfd-mo-top > div { min-width: 0; }
    .cfd-mp { grid-template-columns: 72px minmax(0, 1fr) auto; gap: 10px; }
    .cfd-mp-img, .cfd-mp-img .cfd-thumb { width: 72px; height: 72px; }
    .cfd-mp-nome strong { font-size: 15px; }
    .cfd-mp-stats b { font-size: 14px; }
}

/* ═══ TABLET (768–1100px, barra lateral aberta) — 16/09/2026 ═══
   O conteúdo fica com ~500–800px: 5 KPIs numa linha não cabem. Aqui a
   grade vira 3+2 KPIs, os blocos em pares e as tabelas enxutas. */
@media (min-width: 768px) and (max-width: 1100px) {
    .cfd-head { flex-wrap: wrap; align-items: flex-start; }
    .cfd-head-txt { flex: 1 1 100%; }
    .cfd-sub { display: block; white-space: normal; }
    .cfd-tools { flex-wrap: wrap; width: 100%; }
    .cfd-chips { flex: 1 1 auto; }
    .cfd-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
    .cfd-kpi { padding: 14px 14px 44px; }
    .cfd-kpi-val { font-size: clamp(1.05rem, 12cqi, 1.6rem); }
    .cfd-delta em { display: inline; }
    .cfd-row-2 { grid-template-columns: 1fr; }
    .cfd-row-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cfd-card-title { white-space: normal; }
    .cfd-card-head { flex-wrap: wrap; }
    .cfd-card-tools { flex-wrap: wrap; }
    .cfd-legend { display: flex; }
    .cfd-chart { height: 300px; }
    .cfd-tbl th:nth-child(3), .cfd-tbl td:nth-child(3) { display: table-cell; }
    .cfd-tbl-vend th:nth-child(6), .cfd-tbl-vend td:nth-child(6),
    .cfd-tbl-vend th:nth-child(7), .cfd-tbl-vend td:nth-child(7),
    .cfd-tbl-vend th:nth-child(8), .cfd-tbl-vend td:nth-child(8) { display: none; }
    .cfd-stats2 { grid-template-columns: 1fr 1fr; }
}

/* ═══ CELULAR: topo do Dashboard no estilo da imagem (16/09/2026) ═══ */
.cfd-kpi-chev { display: none; }
@media (max-width: 767px) {
    .cfd-head { flex-direction: column; align-items: stretch; gap: 10px; }
    .cfd-head-txt { display: none; }               /* o cabeçalho do app já mostra "Dashboard" */
    .cfd-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; width: 100%; gap: 10px; }
    .cfd-tools .cfd-chips { grid-column: 1 / -1; width: 100%; display: flex; padding: 4px; border-radius: 14px; }
    .cfd-chip { flex: 1; padding: 12px 4px; font-size: 14.5px; border-radius: 11px; text-align: center; }
    .cfd-chip.on { background: rgba(59,130,246,.22); color: var(--gray-900); box-shadow: none; }
    .cfd-tools > .cfd-range, .cfd-tools > .cfd-export { min-height: 52px; border-radius: 14px; font-size: 15px; justify-content: center; }
    .cfd-range span { display: inline; }
    .cfd-export { padding-left: 18px; padding-right: 18px; }
    /* KPIs: 2 colunas, Lucro (5º) na linha inteira */
    .cfd-kpis { grid-template-columns: 1fr 1fr; gap: 12px; }
    .cfd-kpi { padding: 18px 16px 70px; border-radius: 18px; }
    .cfd-kpi:nth-child(5) { grid-column: 1 / -1; }
    .cfd-kpi-top { gap: 12px; margin-bottom: 18px; }
    .cfd-kpi-ico { width: 56px; height: 56px; border-radius: 50%; font-size: 22px; }
    .cfd-kpi-tit { font-size: 12px; letter-spacing: .06em; white-space: normal; }
    .cfd-kpi-val { font-size: clamp(1.35rem, 15cqi, 2.1rem); margin-bottom: 8px; }
    .cfd-delta { font-size: 16px; }
    .cfd-delta em { display: none; }
    .cfd-kpi-foot { display: block !important; font-size: 13px; margin-top: 6px; white-space: normal; }
    .cfd-kpi-foot b { font-size: 14px; }
    .cfd-kpi-chev { display: block; position: absolute; top: 20px; right: 16px; font-size: 16px; color: var(--gray-500); }
    .cfd-spark { height: 64px; }
    .cfd-spark path:first-child { opacity: .35; }
    .cfd-spark path:last-child { stroke-width: 3; }
}
/* Celular: ordem como na imagem (Faturamento, Pagos, Pendentes, Despesas, Lucro na linha inteira) */
@media (max-width: 767px) {
    .cfd-kpi:nth-child(4) { order: 5; grid-column: 1 / -1; }   /* Lucro */
    .cfd-kpi:nth-child(5) { order: 4; grid-column: auto; }     /* Despesas */
    .cfd-kpi-top { padding-right: 26px; }
}
/* Celular: os 5 indicadores cabem na primeira tela (16/09/2026) */
@media (max-width: 767px) {
    .cfd { gap: 10px; }
    .cfd-head { gap: 8px; }
    .cfd-tools { gap: 8px; }
    .cfd-tools .cfd-chips { padding: 3px; border-radius: 12px; }
    .cfd-chip { padding: 9px 4px; font-size: 13.5px; }
    .cfd-tools > .cfd-range, .cfd-tools > .cfd-export { min-height: 42px; font-size: 14px; border-radius: 12px; }
    .cfd-kpis { gap: 10px; }
    .cfd-kpi { padding: 12px 12px 46px; border-radius: 16px; }
    .cfd-kpi-top { gap: 10px; margin-bottom: 8px; padding-right: 22px; }
    .cfd-kpi-ico { width: 40px; height: 40px; font-size: 17px; }
    .cfd-kpi-tit { font-size: 10.5px; }
    .cfd-kpi-val { font-size: clamp(1.15rem, 13cqi, 1.6rem); margin-bottom: 4px; }
    .cfd-delta { font-size: 14px; }
    .cfd-kpi-foot { font-size: 11.5px; margin-top: 3px; }
    .cfd-kpi-chev { top: 14px; right: 12px; font-size: 14px; }
    .cfd-spark { height: 40px; }
    .cfd-kpi:nth-child(4) { padding-bottom: 40px; }
    .cfd-kpi:nth-child(4) .cfd-spark { height: 34px; }
    .cfd-kpi:nth-child(4) .cfd-kpi-body, .cfd-kpi:nth-child(4) .cfd-kpi-foot { display: block; }
}
