/* style.css - ESTRUTURA GLOBAL */

/* style.css */

:root {
    /* O NOVO AZUL PARA COMBINAR COM A SIDEBAR */
    --primary: #19253f;
    /* Azul escuro da sua nova sidebar */
    --bg: #f0f0f0;
    /* 👇 AQUI: garante que a área rolável fique com a cor certa */
    --card-bg: #f0f0f0;
    /* Azul um pouco mais escuro para o clique/hover dos botões */

    /* AS CORES BASE QUE VOCÊ JÁ TINHA (Mantidas) */
    --bg: #ECF0F1;
    /* O Fundo Branco Gelo */
    --text: #1e293b;
    /* Texto principal escuro elegante */
    --text-muted: #64748b;
    /* Texto de apoio (cinza claro) */

    /* Fundo branco puro para os painéis e tabela */
    --border: #e2e8f0;
    /* Linhas e bordas bem sutis */

    /* CORES DE STATUS (Mantidas para a Tabela e Alertas) */
    --success: #10b981;
    /* Verde para estoque cheio */
    --warning: #f59e0b;
    /* Laranja para atenção */
    --danger: #ef4444;
    /* Vermelho para erros e falta de estoque */
}

/* style.css */
/* 1. RESET GLOBAL */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    /* O body não rola */
}


/* 2. ESTRUTURA DASHBOARD */
.app-container {
    display: flex;
    width: 100%;
    height: 100%;
    background-color: var(--bg);
}

.main-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    /* A rolagem acontece aqui */

    /* 🚨 AS DUAS LINHAS QUE MATAM O FUNDO ROXO 🚨 */
    background-color: var(--bg) !important;
    background-image: none !important;

    /* Respiro que você pediu */
    padding: 30px 40px;
    gap: 30px;
}


/* 3. CARDS E CONTEÚDO */
.container {
    background: var(--bg);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    width: 100%;
    /* Deixa o container crescer conforme o conteúdo */
    min-height: min-content;
}


/* Sidebar fixa */
.sidebar {
    position: fixed !important;
    top: 0;
    left: 0;
    height: 100vh !important;
}

/* Conteúdo empurrado para direita */
.main-content-wrapper {
    margin-left: 80px !important;
    transition: margin-left 0.3s ease;
}

/* Quando sidebar expandida */
.sidebar:not(.collapsed)~.main-content-wrapper {
    margin-left: 270px !important;
}

/* 4. O LOG: Deixar ele mais alto e legível */
/* style.css */

#log {
    width: 100%;

    /* 1. LIMITA A ALTURA: Escolha um valor que não "esmague" a tabela (ex: 150px) */
    max-height: 150px;

    /* 2. BARRA DE ROLAGEM: Só aparece se o texto ultrapassar a altura acima */
    overflow-y: auto;

    /* 3. MANUTENÇÃO DO FORMATO */
    background-color: #19253f;
    color: white;
    padding: 15px 20px;
    border-radius: 12px;
    font-family: 'Consolas', monospace;
    font-size: 0.9rem;

    /* Garante que o Log não "encolha" se o ecrã for pequeno */
    flex-shrink: 0;
    box-sizing: border-box;

    /* Mantém as quebras de linha automáticas para os SKUs */
    white-space: pre-wrap;
}

/* OPCIONAL: Deixar a barra de rolagem do Log mais discreta */
#log::-webkit-scrollbar {
    width: 8px;
}

#log::-webkit-scrollbar-thumb {
    background: #134e4a;
    border-radius: 4px;
}

#log::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}




h1 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--primary);
}

/* =========================================
   ESTRUTURA DO CONTEÚDO (Grid)
   ========================================= */

.grid {
    display: grid;
    /* 320px para os painéis da esquerda, e 1fr (todo o espaço restante) para a tabela */
    grid-template-columns: 320px 1fr;
    gap: 30px;
    /* Cria aquele respiro entre as duas colunas */
    align-items: start;
    /* Impede que os painéis estiquem até o fim da tela sozinhos */
    width: 100%;
}

/* Coluna dos Painéis (Upload, Erros, Reposição) */
.left-column {
    display: flex;
    flex-direction: column;
    gap: 25px;
    /* Espaçamento automático entre os painéis */
    width: 100%;
}

/* Coluna da Tabela e Barra de Busca */
.main-table-area {
    /* O SEGREDO: Isso impede a tabela de "vazar" da tela e sobrepor os painéis */
    min-width: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.panel {
    background: #ffffff;
    /* Branco para destacar do fundo #FAFAFA */
    padding: 25px;
    border-radius: 16px;
    /* Bordas mais arredondadas para seguir o padrão moderno */
    border: 1px solid #e2e8f0;
    /* Borda cinza bem clarinha e discreta */

    /* O TOQUE DE ESTILO: */
    border-left: 5px solid var(--primary);
    /* Uma barra lateral sólida com o seu verde */

    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    /* Sombra suave para dar profundidade */

    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: transform 0.3s ease;
}

.panel:hover {
    transform: translateX(5px);
    /* Ele "empurra" levemente para a direita ao passar o mouse */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
}

/* Ajuste para o título dentro do painel */
.panel h2 {
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* style.css */

.panel-error {
    /* MUDANÇA: Fundo branco para harmonizar com o site */
    background: #ffffff;

    /* Borda neutra, mas com a sinalização vermelha na esquerda */
    border: 1px solid #e2e8f0;
    border-left: 5px solid #ef4444;

    /* Espaçamento que você pediu */
    margin: 25px 0;
    padding: 30px;
    border-radius: 16px;

    /* Mesma sombra do painel principal para consistência */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);

    max-height: 500px;
    overflow-y: auto;
}

/* Título de erro mais discreto */
.panel-error h3 {
    color: #b91c1c;
    /* Vermelho escuro apenas no texto para autoridade */
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Texto de apoio */
.panel-error p {
    color: #64748b;
    /* Cinza suave */
    font-size: 0.85rem;
    margin-bottom: 20px;
}

/* Estilo dos itens da lista de erro - VERSÃO NEUTRA */
#errorList li {
    /* Layout e Alinhamento */
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none;

    /* Cores e Fundo */
    background: #ffffff;
    color: #475569;
    /* Um cinza azulado mais moderno que o preto puro */

    /* Espaçamento e Bordas */
    margin-bottom: 12px;
    padding: 14px 20px;
    border-radius: 10px;
    border: 1px solid #f1f5f9;
    /* Borda quase invisível */
    border-left: 4px solid #cbd5e1;
    /* Um detalhe lateral elegante em cinza */

    /* Tipografia */
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: -0.01em;

    /* Efeito de Elevação (Sombra) */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);

    /* Animação suave */
    transition: all 0.2s ease-in-out;
}

/* Efeito ao passar o mouse (opcional, mas recomendado) */
#errorList li:hover {
    border-left-color: #94a3b8;
    /* Escurece o detalhe lateral */
    transform: translateY(-1px);
    /* Sobe de leve */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
}

/* style.css */

.btn-upload {
    background: var(--primary);
    border: 2px dashed none;
    padding: 20px;
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    width: 100%;
    display: block;
    margin-bottom: 15px;
    font-weight: 600;
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Transição mais suave e orgânica */
    box-sizing: border-box;

    /* TOQUE DE ESTILO: Sombras e Letras */
    letter-spacing: 0.5px;
    /* Deixa o texto mais nítido */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: flex;
    /* Para alinhar ícone e texto se você usar */
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-upload:hover {
    /* MANTENDO SUAS CORES BASE */
    background: #2d477e;
    border-color: var(--primary);
    color: white;

    /* MOVIMENTO E BRILHO */
    transform: translateY(-5px);
    /* Sobe um pouco mais para destacar o brilho */

    /* EFEITO DE BRILHO (GLOW) */
    box-shadow:
        0 0 20px rgba(15, 118, 110, 0.4),
        /* Aura de brilho externa (suave) */
        0 0 40px rgba(15, 118, 110, 0.1),
        /* Expansão maior da luz no fundo */
        0 10px 15px -3px rgba(0, 0, 0, 0.1);
    /* Sombra de profundidade para não parecer "flat" */

    /* TOQUE EXTRA DE LUZ */
    filter: brightness(1.1);
    /* Dá um leve "punch" nas cores para parecer que emitem luz */
}


.btn-upload:active {
    transform: translateY(-1px);
    /* Efeito de "apertar" o botão ao clicar */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.search-box {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
}

.btn-add {
    background-color: #19253f;
    color: white;
    border: none;
    padding: 0 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-add:hover {
    background: #2d477e;
}

.btn-reset {
    background: var(--danger);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

.table-container {
    flex-grow: 1;
    /* Isso força o container a ocupar TODO o resto da largura */
    width: 100%;
    /* Garante que ele não encolha */
    background: #f0f0f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    /* Remova qualquer max-width que possa estar limitando a largura aqui */
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #ccfbf1;
    color: var(--primary);
    padding: 12px;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 10;
}

td {
    padding: 10px;
    border-bottom: 1px solid #f0fdfa;
    vertical-align: middle;
}

tr:hover {
    background: #f8fafc;
}

.action-btn {
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 5px;
    font-size: 1em;
}

.btn-edit {
    background: #fde047;
    color: #854d0e;
}

.btn-del {
    background: #fca5a5;
    color: #7f1d1d;
}

.tag-ok {
    background: #dcfce7;
    color: #166534;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.75rem;
}

.tag-low {
    background: #fee2e2;
    color: #991b1b;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.75rem;
}



#errorList,
#shortageList {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.9em;
}

#errorList li,
#shortageList li {
    padding: 8px;
    border-bottom: 1px solid #fecaca;
}

#errorList li:last-child,
#shortageList li:last-child {
    border-bottom: none;
}

#errorList strong {
    display: block;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal {
    background: white;
    padding: 25px;
    border-radius: 8px;
    width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* --- ESTILO DOS ALERTAS (TOASTS) --- */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: #fff;
    border-left: 6px solid #dc2626;
    color: #333;
    padding: 15px 20px;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    min-width: 250px;
    animation: slideIn 0.3s ease-out forwards;
    display: flex;
    flex-direction: column;
}

.toast strong {
    color: #b91c1c;
    font-size: 14px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast span {
    font-size: 13px;
    color: #555;
}



/* Ajuste no body para a Nav não sobrepor com padding */
body {
    padding: 0;
    /* Removemos o padding do body para a nav encostar nas bordas */
}

/* Criamos um wrapper para o conteúdo manter o padding de 20px */
.content-wrapper {
    padding: 20px;
}


/* Define uma altura máxima para a lista de produtos */
.table-container {
    max-height: 94vh;
    /* Ocupa 94% da altura da tela do computador */
    overflow-y: auto;
    /* Ativa o scroll vertical */
    margin-top: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

/* Deixa o cabeçalho da tabela fixo no topo enquanto você desce a lista */
thead th {
    position: sticky;
    top: 0;
    background-color: #f8fafc;
    /* Cor de fundo para não ficar transparente ao rolar */
    z-index: 10;
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* --- Estilos do Painel de Erros (SKUs Não Encontrados) --- */

/* A lista em si */
#errorList {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.error-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    /* O fundo já é branco */
    margin-bottom: 10px;
    padding: 12px 15px;
    border-radius: 8px;

    /* ALTERE ESTA LINHA ABAIXO */
    border-left: 6px solid #bdc3c7;
    /* Cinza neutro (ou use #3498db para Azul) */

    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s;
}

.error-card:hover {
    transform: translateX(3px);
    /* Efeito sutil ao passar o mouse */
}

/* Informações do SKU (Texto) */
.error-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sku-title {
    font-weight: 700;
    color: #2c3e50;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.sku-qtd {
    color: #7f8c8d;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}



/* --- Botões --- */
.error-actions {
    display: flex;
    gap: 8px;
    /* Espaço entre o ícone de copiar e o X */
    align-items: center;
}

/* Botão Copiar (Apenas Ícone) */
/* Botão Copiar (Apenas o Ícone Transparente) */
.btn-copy {
    background: transparent;
    /* Torna o fundo do botão invisível */
    border: none;
    /* Remove a borda padrão do botão */
    padding: 5px;
    /* Pequena área de respiro para o clique */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    /* Adiciona uma animação suave */
}

/* Aumenta ligeiramente o ícone ao passar o mouse para indicar que é clicável */
.btn-copy:hover {
    transform: scale(1.1);
    background: transparent;
    /* Garante que o fundo continue transparente no hover */
}

/* Ajuste o tamanho da imagem se necessário */
.btn-copy img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    /* Opcional: adiciona uma sombra leve apenas no ícone para destacar */
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* Efeito ao passar o mouse */
.btn-copy:hover {
    transform: scale(1.15);
    /* Aumenta 15% ao passar o mouse */
}

/* Efeito ao clicar */
.btn-copy:active {
    transform: scale(0.95);
    /* Diminui levemente ao clicar */
}

/* MANTENHA O BTN-REMOVE IGUAL AO QUE VOCÊ JÁ TINHA */
/* --- Botões (Área Container) --- */
.error-actions {
    display: flex;
    gap: 4px;
    /* Espaço entre o ícone de copiar e o de excluir */
    align-items: center;
}

/* --- CLASSE PADRÃO PARA BOTÕES SÓ COM IMAGEM --- */
/* Esta classe fará a mágica de tirar o fundo e a borda dos dois botões */
.btn-icon-only {
    background: transparent;
    /* FUNDO INVISÍVEL */
    border: none;
    /* SEM BORDA PADRÃO */
    padding: 5px;
    /* Área de respiro para o clique */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    /* Animação suave */
}

/* Efeito Hover (Zoom) igual para os dois */
.btn-icon-only:hover {
    transform: scale(1.2);
    /* Aumenta 20% ao passar o mouse */
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
    /* Adiciona uma sombrinha suave no hover */
}

/* Efeito Click (Diminui um pouco) */
.btn-icon-only:active {
    transform: scale(0.9);
}

/* --- Tamanho das Imagens --- */
/* Ajuste o width/height se seus ícones ficarem muito grandes ou pequenos */

/* Imagem do Copiar */
.icon-copy-img {
    width: 35px;
    height: 35px;
    object-fit: contain;
}

/* Nova Imagem do Excluir */
.icon-delete-img {
    width: 27px;
    /* Se sua imagem nova for muito grande, diminua aqui (ex: 20px) */
    height: 27px;
    object-fit: contain;
}



/* Estilos base para o Dashboard Executivo */



:root {
    --bg-color: #F0F0F0;
    --card-bg: #F0F0F0;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --accent-green: #22c55e;
    --accent-light-green: #dcfce7;
    --border-radius: 16px;
}



#executivo-modern {
    background-color: var(--bg-color);
    padding: 20px;
    font-family: 'Inter', sans-serif;
    /* Sugestão de fonte moderna */
}

/* Grid do Topo (4 KPIs) */
.modern-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

.modern-kpi-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    position: relative;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.modern-kpi-card .modern-kpi-title {
    color: #64748B;
    font-size: 12.5px;
    font-weight: 500 !important;
    font-style: normal;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
    position: relative;
    width: 100%;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 0.01em;
    opacity: 0.95;
}

.modern-kpi-card .modern-kpi-value {
    font-size: 22px;
    font-weight: 600 !important;
    font-style: normal;
    color: #0F172A;
    margin-bottom: 8px;
    text-align: center;
    line-height: 1.2;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: -0.01em;
}

.modern-kpi-card .kpi-info-icon {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    margin: 0 !important;
    z-index: 10 !important;
    width: 16px;
    height: 16px;
    opacity: 0.75;
    object-fit: contain;
    pointer-events: auto;
}

.modern-kpi-card .kpi-info-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    max-width: 240px;
    width: max-content;
    padding: 8px 10px;
    border-radius: 8px;
    background: #0F172A;
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
    white-space: normal;
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.16);
    z-index: 20;
}

.modern-kpi-card .kpi-info-icon:hover::after {
    opacity: 1;
    transform: translateY(0);
}

.modern-kpi-trend {
    font-size: 12px;
    color: #64748B;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-align: center;
    flex-wrap: wrap;
    line-height: 1.35;
}

.trend-up {
    color: #16A34A;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #F0FDF4;
}

.trend-down {
    color: #DC2626;
    font-weight: 600;
    background: #FEF2F2;
    padding: 2px 8px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.modern-kpi-card[data-kpi-category="financeiro"] {
    border-color: #8B5CF6;
}

.modern-kpi-card[data-kpi-category="marketplace"] {
    border-color: #3B82F6;
}

.modern-kpi-card[data-kpi-category="verde"] {
    border-color: #16A34A;
}

.kpi-icon-box {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-light-green);
    color: var(--accent-green);
}

/* Grid do Meio (Gráfico Linha e Donut) */
.modern-middle-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.modern-chart-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.chart-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* Grid de Produtos Inferior */
.modern-products-section h3 {
    margin-bottom: 15px;
    color: var(--text-main);
}

.products-flex {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    /* Permite rolar se tiver muitos */
    padding-bottom: 10px;
}

.product-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 15px;
    min-width: 220px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    flex: 1;
}

.product-img-box {
    background: #f1f5f9;
    border-radius: 12px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    overflow: hidden;
}

.product-img-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-title {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.95em;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.85em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.product-price {
    color: #f59e0b;
    font-weight: 700;
}

.product-progress-bg {
    background: #e2e8f0;
    height: 6px;
    border-radius: 3px;
    width: 100%;
    overflow: hidden;
}

.product-progress-fill {
    background: var(--accent-green);
    height: 100%;
    border-radius: 3px;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}


/* ESTILO DA TABELA */
#table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    /* Cria um respiro entre as linhas */
}

#table th {
    background: #f8fafc;
    color: #64748b;
    font-size: 0.75rem;
    text-transform: uppercase;
    padding: 12px;
    border-bottom: 2px solid #edf2f7;
}

#table tbody tr {
    background-color: #ffffff;
    transition: all 0.2s;
}

#table tbody tr:hover {
    background-color: #f1f5f9;
    /* Efeito de destaque ao passar o mouse */
    transform: scale(1.005);
}

#table td {
    padding: 15px;
    color: #1e293b;
    border-bottom: 1px solid #f1f5f9;
}

/* STATUS PILLS (Aquelas bolinhas de status) */
.status-pill {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.status-ok {
    background: #dcfce7;
    color: #15803d;
}

.status-low {
    background: #fef9c3;
    color: #854d0e;
}

.status-empty {
    background: #fee2e2;
    color: #b91c1c;
}

.analytics-section {
    /* Usa a variável definida no global */
    margin-left: calc(var(--sidebar-mini) + var(--gap-content)) !important;
    transition: margin-left 0.3s ease;
}

/* ── CARDS DE MÉTRICAS GLOBAIS ─────────────────── */
/* Container principal (mantém o que fizemos antes) */
.met-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 16px 20px 0;
    grid-auto-rows: minmax(140px, auto);
}

/* Regra para os cartões (borda e centralização interna) */
.met-grid>div {
    border: 2px solid #19253f;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 15px;
}

/* O SEGREDO DA CENTRALIZAÇÃO AQUI */
/* Pega o 5º cartão e força ele a começar na coluna 2 */
.met-grid>div:nth-child(5) {
    grid-column: 2;
}

.met-card {
    background: #fff;
    border: 1px solid #edf2f7;
    border-radius: 10px;
    padding: 14px 16px;
}

.met-label {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 4px;
}

.met-value {
    font-size: 20px;
    font-weight: 800;
    color: #1e293b;
}

.met-value.green {
    color: #16a34a;
}

.met-value.orange {
    color: #d97706;
}

.met-value.purple {
    color: #7c3aed;
}

/* ── BARRA DE FILTROS ──────────────────────────── */
.prod-filters {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    padding: 20px 24px;
    margin: 40px 0;

    border-radius: 12px;

    /* Cria uma sombra esfumaçada e quase invisível ao redor da div */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);

    /* Mantém a bordinha bem fina para ajudar no contorno */
    border: 1px solid #edf2f7;
}

.prod-filters .log-search {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    height: 50px;

    /* 1. Prepara a caixa para uma animação suave */
    transition: all 0.2s ease;
}

/* 2. Efeito suave ao passar o mouse por cima (Hover) */
.prod-filters .log-search:hover {
    border-color: #cbd5e1;
}

/* 3. Efeito ao clicar para digitar (Focus) */
.prod-filters .log-search:focus-within {
    border-color: #19253f;
    /* Fica com a borda azul */
    box-shadow: 0 0 0 3px rgba(25, 37, 63, 0.1);
    /* Cria a "aura" azul em volta */
}

/* 1. Padronização do Select (Filtro Ativo/Inativo) */
.log-select {
    height: 42px;
    /* Altura padrão para todos os campos */
    padding: 0 16px;
    /* Espaço interno nas laterais */
    font-size: 14px;
    color: #334155;
    /* Texto cinza escuro elegante */
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    /* Borda cinza clara */
    border-radius: 8px;
    /* Arredondamento moderno */
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Efeito ao clicar/focar no Select */
.log-select:focus,
.log-select:hover {
    border-color: #19253f;
    /* Fica azul ao focar */
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    /* Aura azul suave */
}

/* ── NOVA TABELA DE PRODUTOS ───────────────────── */
.ads-table th {
    white-space: nowrap;
    font-size: 11px;
}

.ads-table td {
    vertical-align: middle;
}

.termometro-wrap {
    min-width: 180px;
}

.termometro-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.termometro-val {
    font-size: 14px;
    font-weight: 800;
}

.termometro-meta {
    font-size: 11px;
    color: #94a3b8;
}

.termometro-label {
    font-size: 11px;
    font-weight: 700;
}

.termometro-bar-bg {
    height: 7px;
    border-radius: 4px;
    background: #e2e8f0;
    overflow: hidden;
}

.termometro-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width .4s;
}

.diag-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.diag-badge.excelente {
    background: #dcfce7;
    color: #16a34a;
}

.diag-badge.boa {
    background: #dbeafe;
    color: #2563eb;
}

.diag-badge.atencao {
    background: #fef3c7;
    color: #d97706;
}

.diag-badge.sem-dados {
    background: #f1f5f9;
    color: #94a3b8;
}

.btn-acao-circ {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .15s, opacity .15s;
}

.btn-acao-circ:hover {
    transform: scale(1.1);
}

.btn-acao-circ .material-symbols-rounded {
    font-size: 16px;
}

.roas-input-inline {
    width: 60px;
    padding: 3px 6px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    text-align: center;
}

/* ── MODAL ROAS ────────────────────────────────── */
.ads-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.ads-modal-box {
    background: #fff;
    border-radius: 14px;
    width: 360px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .18);
    overflow: hidden;
}

.ads-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #edf2f7;
    font-weight: 700;
    font-size: 14px;
}

.ads-modal-body {
    padding: 20px;
}

.ads-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid #edf2f7;
}

.close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    display: flex;
    align-items: center;
}

.close-btn:hover {
    color: #1e293b;
}

.btn-cancel {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
}

.btn-confirm {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: #ee4d2d;
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
}

.shopee-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    margin-top: 12px;
}

.shopee-input-group input {
    border: none;
    outline: none;
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    width: 100%;
}

.currency-label {
    font-size: 13px;
    color: #94a3b8;
    font-weight: 600;
}


.metrica-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    padding: 4px 0;
    cursor: pointer;

}

.metrica-check input {
    cursor: pointer;

}