/* styles.css */
:root {
    --bg-dark: #0D1126;
    /* Azul profundo baseado no logo */
    --bg-sidebar: #151B3D;
    /* Azul secundÃ¡rio da marca */
    --accent: #F58220;
    /* Laranja vibrante do "seu" no logo */
    --blue-logo: #2E3192;
    /* Azul do "vendedor" no logo */
    --gold: #FFB347;
    /* Laranja mais claro para contrastes */
    --text-main: #F8FAFC;
    /* Branco limpo */
    --text-dim: #94A3B8;
    /* Cinza azulado para textos secundÃ¡rios */
    --card-bg: rgba(255, 255, 255, 0.03);
    --border: rgba(255, 255, 255, 0.08);
    --hover-bg: rgba(245, 130, 32, 0.1);
    /* Hover baseado no laranja */

    /* Variáveis globais do Design System baseados na referência aprovada */
    --green: #10b981;
    --green-bg: rgba(16, 185, 129, 0.12);
    --red: #ef4444;
    --red-bg: rgba(239, 68, 68, 0.1);
    --yellow: #f59e0b;
    --yellow-bg: rgba(245, 158, 11, 0.1);
    --blue: #00a8cc;
    --blue-bg: rgba(0, 168, 204, 0.12);
    --gold-bg: rgba(255, 179, 71, 0.1);
    --card-radius: 16px;
    --card-padding: 1.5rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    
    min-height: 100vh;
}

/* Partículas de Fundo */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.app-container {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: 320px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-title-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    width: 100%;
}

.sidebar-title-container h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0;
}

.close-sidebar-btn {
    display: none;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.filter-group label {
    font-size: 0.75rem;
    color: var(--text-dim);
    font-weight: 500;
}

.filter-group select {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.6rem;
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s;
}

.filter-group select:focus {
    border-color: var(--accent);
}

/* Estilo para Custom Multi-SeleÃ§Ã£o (Lista Suspensa) */
.custom-select {
    position: relative;
    user-select: none;
}

.select-header {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.7rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

.select-header:hover,
.custom-select.active .select-header {
    border-color: var(--accent);
}

.select-header .status-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.select-header .arrow {
    font-size: 0.6rem;
    transition: transform 0.3s;
    color: var(--text-dim);
}

.custom-select.active .arrow {
    transform: rotate(180deg);
}

.select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1A1F37; /* Cor sÃ³lida para nÃ£o ser transparente */
    border: 1px solid var(--border);
    border-radius: 0 0 8px 8px;
    margin-top: 4px;
    max-height: 250px;
    overflow-y: auto;
    display: none;
    z-index: 2500; /* Aumentei para garantir que fique por cima de tudo */
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    padding: 0;
}

.custom-select.active .select-options {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
    color: var(--text-main);
    justify-content: flex-start;
}

.option-item:hover {
    background: var(--hover-bg);
}

.option-item.loading-item {
    opacity: 0.4;
    cursor: pointer;
}

.checkbox-box {
    width: 14px;
    height: 14px;
    border: 1px solid var(--border);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.option-item.selected {
    background: rgba(245, 130, 32, 0.15);
    color: var(--accent);
    font-weight: 600;
}

.option-item.selected .checkbox-box {
    background: var(--accent);
    border-color: var(--accent);
}

.option-item.selected .checkbox-box::after {
    content: '\2713';
    color: var(--bg-dark);
    font-size: 10px;
    font-weight: bold;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-secondary {
    margin-top: 1rem;
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: var(--hover-bg);
}

/* Main Content Styling */
.main-content {
    flex: 1;
    padding: 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
    overflow-y: auto;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.8rem;
    position: relative;
}

.top-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 80px;
    height: 2px;
    background: var(--accent);
}

.header-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.header-pretitle {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: -2px;
}

.header-info h1 {
    font-size: 1.65rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.5px;
    background: linear-gradient(to right, #fff 30%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    display: inline-block;
    margin-bottom: 2px;
}

.status-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 4px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-dim);
    transition: all 0.2s ease;
}

.status-badge:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

.status-badge.version-badge {
    background: rgba(245, 130, 32, 0.06);
    border: 1px solid rgba(245, 130, 32, 0.2);
    color: var(--accent);
    font-weight: 600;
}

.status-badge.sync-status {
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #10b981;
    font-weight: 600;
}

.status-badge.schedule-status {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #94a3b8;
}

.status-badge.query-status {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.18);
    color: #60a5fa;
}

.pulse-dot {
    animation: pulse-animation 2s infinite ease-in-out;
    display: inline-block;
    font-size: 0.55rem;
    color: #10b981;
    line-height: 1;
}

@keyframes pulse-animation {
    0% { transform: scale(0.85); opacity: 0.6; }
    50% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(0.85); opacity: 0.6; }
}

/* Logo do Header (Design Limpo e Elegante com Vetor Transparente) */
.header-logo-container {
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 4px;
    box-shadow: none;
    border: none;
    border-radius: 0;
    transition: all 0.25s ease;
    cursor: pointer;
}

.header-logo-container:hover {
    transform: scale(1.04);
    opacity: 0.95;
    box-shadow: none;
}

.header-logo {
    height: 34px;
    width: auto;
    max-width: 140px;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.metric-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 1.2rem 1.5rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

/* Cards Principais e Interativos (Botões) */
#card-faturamento,
#card-volume,
#card-preco-medio,
#card-mix,
#card-investimento,
#card-pedidos,
#card-positivacao,
#card-sem-compras,
#card-pedidos-pendentes,
#card-inadimplencia {
    background: linear-gradient(135deg, rgba(245, 130, 32, 0.1) 0%, rgba(255, 179, 71, 0.03) 100%);
    border: 1px solid rgba(245, 130, 32, 0.3) !important;
    box-shadow: 0 0 15px rgba(245, 130, 32, 0.08), inset 0 1px 0 rgba(245, 130, 32, 0.1);
}

#card-faturamento:hover,
#card-volume:hover,
#card-preco-medio:hover,
#card-mix:hover,
#card-investimento:hover,
#card-pedidos:hover,
#card-positivacao:hover,
#card-sem-compras:hover,
#card-pedidos-pendentes:hover,
#card-inadimplencia:hover {
    box-shadow: 0 0 25px rgba(245, 130, 32, 0.2);
}

#card-faturamento.active,
#card-volume.active,
#card-preco-medio.active,
#card-mix.active,
#card-investimento.active,
#card-pedidos.active,
#card-positivacao.active {
    background: linear-gradient(135deg, var(--accent) 0%, #e07010 100%);
    box-shadow: 0 0 25px rgba(245, 130, 32, 0.35);
}

.card-top {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.icon-circle {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(245, 130, 32, 0.15); /* var(--accent) com opacidade */
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.card-icon {
    width: 16px;
    height: 16px;
    color: var(--accent);
}

.metric-card.active .icon-circle {
    background: rgba(255, 255, 255, 0.2);
}

.metric-card.active .card-icon {
    color: var(--bg-dark);
}

.metric-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 10px 30px -15px var(--accent);
}

.metric-card.active {
    background: var(--accent);
    color: var(--bg-dark);
}

.metric-card.active .metric-label,
.metric-card.active .metric-value {
    color: var(--bg-dark);
}

.metric-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-dim);
    letter-spacing: 1px;
}

.metric-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    align-self: flex-start;
    margin-top: 5px;
}

.metric-comparisons {
    font-size: 0.75rem;
    font-weight: 500;
    text-align: left;
    margin-top: auto;
    line-height: 1.4;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.comp-label {
    color: var(--text-dim);
}

.metric-card.active .comp-label {
    color: rgba(13, 17, 38, 0.6); /* --bg-dark atenuado para ficar legível em fundo laranja */
}

/* Informational Split Card (Positivação e Mix) */
.info-card-split {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    justify-content: space-evenly;
    align-items: stretch;
    backdrop-filter: blur(10px);
    cursor: default; /* Não clicável */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.info-card-split:hover {
    border-color: rgba(255, 255, 255, 0.2); /* Hover mais discreto que o accent */
    box-shadow: 0 10px 30px -15px rgba(0, 0, 0, 0.5);
}

.info-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.2rem 1rem;
    flex: 1;
}

.info-divider {
    width: 1px;
    background: var(--border);
    margin: 1rem 0;
}

/* --- DESCONGELAMENTO TOTAL: NADA PRESO NO TOPO --- */
.table-container {
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
}

.table-scroll {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 65vh;
}

table {
    width: auto;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    table-layout: auto;
}

/* Headers CONGELADOS no topo da tabela */
thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

thead th {
    background-color: #151B3D !important;
    color: var(--accent);
    text-align: center;
    font-weight: 700;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
}

/* Header secundÃ¡rio (Medidas) - SOLTO */
thead tr:nth-child(2) th {
    top: auto;
    background-color: #1a1f37 !important;
    font-size: 0.65rem;
    color: var(--text-dim);
    border-bottom: 2px solid var(--border);
}

/* Nome Fantasia e todas as cÃ©lulas - COMPLETAMENTE SOLTAS */
th, td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    background-color: transparent;
    position: relative;
    left: auto !important;
    width: auto;
}

/* Coluna Nome Fantasia — EXPANDE para ocupar espaço */
#sales-table > tbody > tr > td:first-child, .fixed-column-header {
    width: 100%;
    min-width: 130px;
    white-space: nowrap;
    background-color: #0D1126 !important;
    border-right: 1px solid var(--border);
    padding-right: 15px !important;
}

/* Colunas de dados — ENCOLHEM ao tamanho do conteúdo */
#sales-table > tbody > tr > td:not(:first-child), thead tr:nth-child(2) th:not(.fixed-column-header) {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

@media (max-width: 768px) {
    table {
        width: auto !important;
        border-collapse: collapse;
        font-size: 0.7rem;
        min-width: 100%;
    }
    th, td {
        padding: 8px 4px !important;
    }
    #sales-table > tbody > tr > td:first-child, .fixed-column-header { 
        min-width: 90px; 
        white-space: normal !important;
        word-wrap: break-word;
        padding-right: 4px !important;
    }
}

/* Shake animation para erro */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    50% { transform: translateX(8px); }
    75% { transform: translateX(-8px); }
}

.shake { animation: shake 0.4s ease-in-out; }

/* Pulse animation para indicador do banco de dados */
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.2); }
}

.pulse-dot {
    display: inline-block;
    animation: pulse 2s infinite ease-in-out;
}


tbody tr:hover {
    background: rgba(245, 130, 32, 0.08);
}

tbody tr.total-row {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 700;
}

tbody tr.total-row td {
    color: var(--gold);
}

/* EstilizaÃ§Ã£o das Barras de Rolagem (Mais Claras e VisÃ­veis) */
::-webkit-scrollbar { 
    width: 10px; 
    height: 10px; 
}

::-webkit-scrollbar-track { 
    background: rgba(0, 0, 0, 0.2); 
    border-radius: 10px;
}

::-webkit-scrollbar-thumb { 
    background: rgba(255, 255, 255, 0.2); /* Cinza claro e nÃ­tido */
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover { 
    background: rgba(255, 255, 255, 0.4); /* Mais brilhante no hover */
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Botão Mobile */
.mobile-only-btn {
    display: none;
    background: var(--gold);
    color: var(--bg-dark);
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.mobile-only-btn:hover {
    transform: scale(1.05);
    background: var(--accent);
    color: #fff;
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 999;
}

@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -45%) scale(0.95);
        width: 92%;
        max-width: 440px;
        height: auto;
        max-height: 85vh;
        background: rgba(17, 22, 51, 0.97);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 16px;
        box-shadow: 0 24px 50px rgba(0, 0, 0, 0.85), 0 0 32px rgba(245, 130, 32, 0.15);
        z-index: 2100;
        padding: 1.8rem 1.5rem 1.5rem;
        display: flex;
        flex-direction: column;
        gap: 0.6rem;
        
        opacity: 0;
        visibility: hidden;
        transition: 
            opacity 0.25s ease, 
            transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), 
            visibility 0.25s;
        overflow-y: auto;
    }
    
    .sidebar.active {
        opacity: 1;
        visibility: visible;
        transform: translate(-50%, -50%) scale(1);
    }
    
    .close-sidebar-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 50%;
        color: var(--text-dim);
        font-size: 1.3rem;
        width: 32px;
        height: 32px;
        line-height: 1;
        cursor: pointer;
        transition: all 0.2s ease;
        padding-bottom: 2px;
    }
    
    .close-sidebar-btn:hover {
        background: var(--hover-bg);
        color: var(--accent);
        border-color: var(--accent);
    }

    .mobile-only-btn { display: flex; }
    
    #sidebar-overlay.overlay.active { 
        display: block;
        z-index: 2050;
        animation: fadeInOverlay 0.25s ease-out;
    }
    
    .main-content { padding: 1rem; }
    .metrics-grid { grid-template-columns: 1fr 1fr; gap: 0.8rem; }
}

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 480px) {
    /* Main Content: Aproveita melhor as bordas da tela do celular */
    .main-content { 
        padding: 1rem 0.6rem; 
        gap: 1.2rem; 
    }
    
    /* Header: Alinha a logo e as ações lado a lado sem sobreposições */
    .top-header {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding-top: 5px;
        gap: 8px;
    }
    .header-info {
        flex: 1;
        min-width: 0;
    }
    .header-info h1 {
        font-size: 1.15rem;
        max-width: 100%;
    }
    .header-actions {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
    }
    .header-logo-container {
        width: auto;
        height: auto;
        padding: 0;
    }
    .header-logo {
        height: 28px;
        max-width: 110px;
    }

    /* Cards de Métrica: Grid 2x2 super prático, reduz margens fofas e foca nos NÚMEROS */
    .metrics-grid { 
        grid-template-columns: 1fr 1fr; 
        gap: 0.5rem; 
    }
    .metric-card {
        padding: 0.8rem 0.4rem;
        gap: 0.4rem;
        border-radius: 8px;
    }
    .metric-label {
        font-size: 0.55rem;
    }
    .metric-value {
        font-size: 0.95rem; /* Menor mas perfeitamente legivel de perto */
    }
    .metric-card .metric-comparisons {
        font-size: 0.55rem !important; /* Mini-textos de comparação */
        margin-top: 2px !important;
    }
}

/* Loading Overlay Padronizado do Sistema */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(13, 17, 38, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12px;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    display: none !important;
    pointer-events: none;
}

.spinner {
    width: 38px;
    height: 38px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 0;
}

@keyframes spin { 
    0% { transform: rotate(0deg); } 
    100% { transform: rotate(360deg); } 
}

.loading-overlay p {
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 0;
}

/* Login Page Styles */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100vw;
    background: var(--bg-dark);
    overflow: hidden;
    position: relative;
}

.login-container {
    width: 100%;
    max-width: 440px;
    padding: 24px;
    z-index: 10;
}

.login-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 16px;
    padding: 2rem 2.2rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.login-card:hover {
    border-color: rgba(245, 130, 32, 0.25);
    box-shadow: 
        0 30px 60px -10px rgba(0, 0, 0, 0.6),
        0 0 30px rgba(245, 130, 32, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

/* Logo com Efeito 3D e Sem Fundo Visível */
.login-brand {
    background: transparent;
    padding: 0;
    margin: 0 auto 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
}

.login-logo {
    width: 210px;
    height: auto;
    display: block;
    
    /* Sombra de Alta Definição (Mais Nítida) */
    filter: drop-shadow(4px 4px 0px rgba(0,0,0,0.9)) 
            drop-shadow(10px 10px 20px rgba(0,0,0,0.95))
            drop-shadow(0px 0px 5px rgba(245, 130, 32, 0.5));
    
    transform: rotateX(10deg) rotateY(-5deg);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
    0%, 100% { transform: translateY(0) rotateX(10deg) rotateY(-5deg); }
    50% { transform: translateY(-12px) rotateX(15deg) rotateY(0deg); }
}

.login-logo:hover {
    transform: scale(1.08) rotateX(0deg) rotateY(0deg);
    filter: drop-shadow(0px 10px 30px rgba(245, 130, 32, 0.6));
}

.login-header p {
    background: linear-gradient(to right, #fff 30%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.35rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 3px;
    white-space: nowrap;
    margin-top: 1.2rem;
    margin-bottom: 0.5rem;
}

.input-group {
    margin-bottom: 1.2rem;
}

.input-group label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-bottom: 0.4rem;
    font-weight: 700;
    letter-spacing: 1px;
}
/* EstilizaÃ§Ã£o do Campo de Pesquisa Interna dos Filtros - AGORA SOLTO */
.select-search-container {
    background: #1A1F37;
    padding: 12px;
    border-bottom: 2px solid var(--border);
    position: relative; /* Mudado de sticky para soltar */
}

.select-search-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3); /* Fundo mais escuro para contraste */
    border: 1px solid var(--accent); /* Borda laranja discreta por padrÃ£o */
    border-radius: 6px;
    padding: 10px 12px;
    color: #fff;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s;
}

.select-search-input:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 2px rgba(245, 130, 32, 0.2);
}

.select-search-input::placeholder {
    color: var(--text-dim);
    opacity: 0.6;
}
.input-group input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-group input:focus {
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.55);
    box-shadow: 0 0 0 3px rgba(245, 130, 32, 0.2);
}

.input-group input::placeholder {
    color: var(--text-dim);
    opacity: 0.4;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--accent) 0%, #e07010 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 4px 15px rgba(245, 130, 32, 0.2);
}

.btn-login:hover {
    background: linear-gradient(135deg, #ff9238 0%, var(--accent) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 130, 32, 0.35);
}

.login-error {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    padding: 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    text-align: center;
    margin-bottom: 1rem;
}

.hidden { display: none !important; }

.btn-logout {
    margin-top: auto;
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #ef4444;
    padding: 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    text-align: center;
}
/* Estilização da Tabela de Detalhamento por Produto */
.nested-table-row {
    background-color: rgba(0, 0, 0, 0.2) !important;
}

.nested-container-cell {
    padding: 0 !important;
    border: none !important;
}

.nested-wrapper {
    padding: 8px 12px 12px 12px; /* Mais compactado */
    border-left: 3px solid var(--accent);
    margin: 3px 0;
    max-width: 600px; /* Garante que caiba na tela inteira sem se espalhar horizontalmente */
    width: 100%;
}

.nested-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.product-item-row {
    background-color: rgba(0, 0, 0, 0.15) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background 0.2s;
}

.product-item-row:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

.product-total-row {
    background-color: rgba(0, 0, 0, 0.25) !important;
    border-top: 1px solid var(--border);
}

.product-label {
    color: var(--text-dim);
    font-style: italic;
}

/* Destaque premium para linhas ativas/abertas na hierarquia */
tr.active-detail td {
    background-color: rgba(245, 130, 32, 0.05) !important;
    transition: background-color 0.2s ease, border-left 0.2s ease;
}

tr.active-detail td:first-child {
    background: linear-gradient(to right, rgba(245, 130, 32, 0.18) 0%, rgba(245, 130, 32, 0.05) 100%) !important;
    border-left: 4px solid var(--accent) !important;
}

tr.active-detail:hover td {
    background-color: rgba(245, 130, 32, 0.08) !important;
}

tr.active-detail:hover td:first-child {
    background: linear-gradient(to right, rgba(245, 130, 32, 0.25) 0%, rgba(245, 130, 32, 0.08) 100%) !important;
}

tr.active-detail .expand-icon {
    color: var(--gold) !important;
    text-shadow: 0 0 8px rgba(255, 179, 71, 0.8);
    transform: scale(1.15);
}

.client-label {
    font-weight: 500;
    color: var(--text);
    min-width: 130px;
}

.sortable-header {
    transition: background 0.2s;
}

.sortable-header:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--accent) !important;
}

/* Reset da primeira coluna para o modal, evitando conflito com a tabela principal */
#unpurchased-modal td:first-child {
    min-width: 0 !important;
    width: auto !important;
    padding-right: 4px !important;
    background-color: transparent !important;
    border-right: none !important;
}

.unsold-products-table td:first-child, .unsold-products-table th:first-child {
    min-width: 0 !important;
    max-width: 320px !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    padding-right: 8px !important;
    background-color: transparent !important;
    border-right: none !important;
}

.btn-modal-filter {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
}

.btn-modal-filter:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-dim);
}

.btn-modal-filter.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg-dark);
}

/* Estilos Adicionais para Hierarquia de Drilldown no Mix de Produtos */
.group-item-row {
    background-color: rgba(0, 0, 0, 0.1) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    transition: background-color 0.2s, border-left 0.2s;
}

.group-item-row:hover {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

.client-item-row {
    background-color: rgba(0, 0, 0, 0.2) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    transition: background-color 0.2s;
}

.client-item-row:hover {
    background-color: rgba(255, 255, 255, 0.04) !important;
}

.expand-icon {
    display: inline-block;
    color: var(--accent);
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

/* Detalhamento de Investimentos (Sub-tabela) */
.investment-table th {
    padding: 6px 10px; /* Mais compactado */
    font-weight: 600;
    color: var(--accent);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.75rem;
    text-transform: uppercase;
}

.investment-table td {
    padding: 6px 10px; /* Mais compactado */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-light);
    font-size: 0.75rem;
}

.investment-table tr:hover td {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

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

/* Badge de percentual do investimento sobre o faturamento */
.invest-pct-badge {
    display: inline-block;
    align-self: flex-start;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--accent);
    background: rgba(245, 130, 32, 0.12);
    border: 1px solid rgba(245, 130, 32, 0.3);
    border-radius: 20px;
    padding: 2px 8px;
    letter-spacing: 0.5px;
    margin-top: -2px;
    margin-bottom: 4px;
    transition: color 0.3s, background 0.3s, border-color 0.3s;
}

/* No card ativo (fundo laranja) o badge inverte para legibilidade */
#card-investimento.active .invest-pct-badge {
    color: rgba(13, 17, 38, 0.85);
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Premium styling for product client detail rows and positive status dots */
.product-detail-row tr:hover {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

.pos-dot {
    transition: transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.pos-dot:hover {
    transform: scale(1.3);
    box-shadow: 0 0 8px currentColor;
}

/* ── CUSTOM NOTIFICATION SYSTEM ── */
#toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: rgba(21, 27, 61, 0.95);
    border: 1px solid var(--border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(245, 130, 32, 0.05);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: 400px;
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    border-left: 4px solid var(--accent);
}

.toast.toast-success {
    border-left-color: var(--green);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(16, 185, 129, 0.05);
}

.toast.toast-error {
    border-left-color: var(--red);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(239, 68, 68, 0.05);
}

.toast.toast-warning {
    border-left-color: var(--yellow);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(245, 158, 11, 0.05);
}

.toast-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.toast-message {
    line-height: 1.4;
}

/* Animations */
@keyframes slideInRight {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

/* Custom Confirm Modal */
.custom-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 12, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInModal 0.25s ease-out forwards;
}

.custom-confirm-card {
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    width: 90%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.85), 0 0 32px rgba(245, 130, 32, 0.05);
    animation: scaleInModal 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.custom-confirm-card h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 0;
}

.custom-confirm-card p {
    font-size: 0.8rem;
    color: #fff;
    line-height: 1.5;
    margin: 0;
}

.custom-confirm-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.custom-confirm-buttons button {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.btn-confirm-sec {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
}

.btn-confirm-sec:hover {
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
}

.btn-confirm-prim {
    background: var(--accent);
    border: none;
    color: #fff;
}

.btn-confirm-prim:hover {
    background: #e07010;
    transform: translateY(-1px);
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleInModal {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ── CONFIGURAÇÕES VISUAIS UNIFICADAS (METAS & DIÁLOGOS) ── */

/* Botões de Filtro e Ação das Metas */
.btn-filter {
    background: var(--accent);
    color: var(--bg-dark) !important;
    border: none;
    padding: 0.55rem 1.2rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.72rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.btn-filter:hover {
    background: #e07010;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 130, 32, 0.25);
}

.btn-filter:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Segmented Control (Toggle Buttons) na Sidebar */
.btn-toggle-option {
    flex: 1;
    font-size: 0.68rem;
    font-weight: 700;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
    color: var(--text-dim);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-toggle-option.active {
    background: var(--accent) !important;
    color: var(--bg-dark) !important;
    box-shadow: 0 2px 6px rgba(245, 130, 32, 0.2);
}

/* Ajuste de Contraste para Abas Ativas */
.md-tab.active {
    color: #fff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

/* Ajuste de Cabeçalhos de Tabelas das Telas de Metas */
table.md-table thead th {
    color: var(--accent) !important;
    font-weight: 700 !important;
    background-color: #151B3D !important;
}

/* Inputs Modernos para as Metas (Design Premium) */
.meta-input-modern {
    width: 85px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.meta-input-modern:hover {
    border-color: rgba(245, 130, 32, 0.4);
    background: rgba(255, 255, 255, 0.06);
}

.meta-input-modern:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 10px rgba(245, 130, 32, 0.3), inset 0 1px 2px rgba(0, 0, 0, 0.2);
    transform: scale(1.02);
}

/* Ocultar setas padrão de incremento nos inputs numéricos */
.meta-input-modern::-webkit-outer-spin-button,
.meta-input-modern::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.meta-input-modern {
    -moz-appearance: textfield;
}

/* Sidebar Collapse on Desktop */
.sidebar {
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 993px) {
    .sidebar.collapsed {
        margin-left: -320px;
    }
}

/* Sidebar Toggle Desktop Button */
.sidebar-toggle-desktop {
    position: sticky;
    top: 25px;
    align-self: flex-start;
    z-index: 1001;
    margin-left: -14px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
}

.sidebar-toggle-desktop:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 10px rgba(245, 130, 32, 0.4);
}

.sidebar-toggle-desktop .toggle-icon {
    display: inline-block;
    transition: transform 0.3s ease;
    font-size: 0.7rem;
    line-height: 1;
}

.sidebar.collapsed + .sidebar-toggle-desktop {
    margin-left: 0px;
}

.sidebar.collapsed + .sidebar-toggle-desktop .toggle-icon {
    transform: rotate(180deg);
}

/* Hide on mobile devices where sidebar is an overlay */
@media (max-width: 992px) {
    .sidebar-toggle-desktop {
        display: none;
    }
}

/* Botão de Navegação Comum (Voltar ao Menu) */
.btn-nav {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(245, 130, 32, 0.1);
    border: 1px solid rgba(245, 130, 32, 0.3);
    color: var(--accent);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-nav:hover {
    background: rgba(245, 130, 32, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 130, 32, 0.15);
}

/* Hover do Botão de Sair */
.btn-logout:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: #ef4444 !important;
}

/* ── BOTÃO E MODAL CONSULTA RÁPIDA ── */
.btn-quick-consult {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(245, 130, 32, 0.1);
    border: 1px solid rgba(245, 130, 32, 0.35);
    color: var(--accent);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn-quick-consult:hover:not(:disabled) {
    background: var(--accent);
    color: var(--bg-dark);
    transform: translateY(-1.5px);
    box-shadow: 0 0 15px rgba(245, 130, 32, 0.45);
}

.btn-quick-consult:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.03);
}

/* Efeito Pulsante (Glow) quando ativado */
.btn-quick-consult.glow:not(:disabled) {
    border-color: var(--accent);
    animation: quickGlowPulse 1.8s infinite alternate;
}

@keyframes quickGlowPulse {
    0% {
        box-shadow: 0 0 4px rgba(245, 130, 32, 0.2), inset 0 0 0px rgba(245, 130, 32, 0);
        background: rgba(245, 130, 32, 0.1);
    }
    100% {
        box-shadow: 0 0 14px rgba(245, 130, 32, 0.6), inset 0 0 4px rgba(245, 130, 32, 0.2);
        background: rgba(245, 130, 32, 0.18);
    }
}


/* ── BOTÃO DE VISÃO GERAL ── */
.btn-overview-consult {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 168, 204, 0.1);
    border: 1px solid rgba(0, 168, 204, 0.35);
    color: #00a8cc;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn-overview-consult:hover:not(:disabled) {
    background: #00a8cc;
    color: var(--bg-dark);
    transform: translateY(-1.5px);
    box-shadow: 0 0 15px rgba(0, 168, 204, 0.45);
}

.btn-overview-consult:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.03);
}

.btn-overview-consult.glow:not(:disabled) {
    border-color: #00a8cc;
    animation: overviewGlowPulse 1.8s infinite alternate;
}

@keyframes overviewGlowPulse {
    0% {
        box-shadow: 0 0 4px rgba(0, 168, 204, 0.2), inset 0 0 0px rgba(0, 168, 204, 0);
        background: rgba(0, 168, 204, 0.1);
    }
    100% {
        box-shadow: 0 0 14px rgba(0, 168, 204, 0.6), inset 0 0 4px rgba(0, 168, 204, 0.2);
        background: rgba(0, 168, 204, 0.18);
    }
}

.btn-expand-store {
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.45);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}
.btn-expand-store:hover {
    background: rgba(0, 168, 204, 0.15);
    border-color: #00a8cc;
    color: #00a8cc;
}
.btn-expand-store.active {
    background: rgba(0, 168, 204, 0.2);
    border-color: #00a8cc;
    color: #00a8cc;
}

/* Abas de Navegação (Tabs) */
.quick-tab-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-dim);
    padding: 8px 14px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    text-transform: uppercase;
    white-space: nowrap;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.quick-tab-btn:hover {
    color: #fff;
}

.quick-tab-btn.active {
    color: var(--accent) !important;
    border-bottom-color: var(--accent);
}

/* Tabelas e Alertas */
.quick-table th {
    padding: 8px 10px;
    font-weight: 700;
    color: var(--accent) !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.08);
    text-transform: uppercase;
}

.quick-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-light);
}

.quick-table tr:hover td {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

.quick-alert-card {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fca5a5;
    font-size: 0.72rem;
    font-weight: 600;
}

.quick-alert-card.warning {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: #fcd34d;
}

/* Impedir que a última linha da Consulta Rápida seja estilizada como linha de total */
.quick-table tbody tr:last-child {
    background: transparent !important;
    font-weight: inherit !important;
}
.quick-table tbody tr:last-child td {
    color: inherit;
}

/* Correção de sticky headers no modal unificado para evitar corte da primeira linha */
.quick-table thead {
    position: static !important;
}

.quick-table thead tr {
    position: static !important;
}

.quick-table th {
    position: static !important;
    background: #151B3D !important;
}

/* ── BADGES DE TENDÊNCIA E COMPARATIVO HISTÓRICO ── */
.trend-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}
.trend-badge.trend-up {
    background: rgba(16, 185, 129, 0.12);
    color: var(--green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.trend-badge.trend-down {
    background: rgba(239, 68, 68, 0.12);
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.trend-badge.trend-neutral {
    background: rgba(245, 130, 32, 0.12);
    color: var(--accent);
    border: 1px solid rgba(245, 130, 32, 0.3);
}
.peak-badge {
    background: rgba(251, 191, 36, 0.15);
    color: var(--gold);
    border: 1px solid rgba(251, 191, 36, 0.4);
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.2);
}

.evol-bar-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    padding: 8px 12px;
    border-radius: 8px;
}
.evol-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
}
.evol-bar-month {
    font-weight: 700;
    color: #fff;
}
.evol-bar-vals {
    color: var(--text-dim);
}
.evol-bar-track {
    height: 8px;
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    display: flex;
}

/* ── ESTILOS PWA & BOTAO DE INSTALAÇÃO ── */
.hidden-pwa {
    display: none !important;
}

.pwa-install-wrapper {
    margin-top: 1rem;
    width: 100%;
}

.pwa-install-target {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 0.75rem 0;
}

.btn-pwa-install {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, rgba(245, 130, 32, 0.2) 0%, rgba(245, 130, 32, 0.08) 100%);
    border: 1px solid var(--accent);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(245, 130, 32, 0.15);
}

.btn-pwa-install:hover {
    background: linear-gradient(135deg, var(--accent) 0%, #e07010 100%);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 130, 32, 0.35);
}

.btn-pwa-install svg {
    flex-shrink: 0;
}

.pwa-ios-guide {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(245, 130, 32, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    color: #f8fafc;
    font-size: 0.82rem;
    line-height: 1.4;
    text-align: left;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.pwa-ios-guide-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 4px;
}

.pwa-ios-guide-text {
    color: var(--text-dim);
}

.pwa-ios-guide-text strong {
    color: #ffffff;
}

.pwa-ios-guide .ios-icon {
    display: inline-block;
    padding: 0 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
    font-weight: bold;
}

.pwa-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    background: #0f172a;
    color: #38bdf8;
    border: 1px solid #0284c7;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    animation: slideUpToast 0.3s ease forwards;
}

@keyframes slideUpToast {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ── SUPORTE A TELA CHEIA E SAFE AREAS (iOS NOTCH & ANDROID STANDALONE) ── */
@supports (padding-top: env(safe-area-inset-top)) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}

/* ── MODAL INTERATIVO DE GUIA DE INSTALAÇÃO PWA ── */
.pwa-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 8, 18, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
}

.pwa-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.pwa-modal-card {
    background: linear-gradient(180deg, #131929 0%, #0b0f19 100%);
    border: 1px solid rgba(245, 130, 32, 0.35);
    border-radius: 20px;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 30px rgba(245, 130, 32, 0.15);
    overflow: hidden;
    transform: scale(0.92) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.pwa-modal-overlay.show .pwa-modal-card {
    transform: scale(1) translateY(0);
}

.pwa-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.pwa-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
}

.pwa-modal-title h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: #ffffff;
}

.pwa-title-icon {
    color: var(--accent);
}

.pwa-modal-close {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}

.pwa-modal-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.pwa-modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-height: 75vh;
    overflow-y: auto;
}

.pwa-device-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    gap: 4px;
}

.pwa-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 8px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.pwa-tab-btn.active {
    background: linear-gradient(135deg, var(--accent) 0%, #e07010 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(245, 130, 32, 0.25);
}

.pwa-guide-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hidden-pwa-tab {
    display: none !important;
}

.pwa-guide-desc {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin: 0;
}

.pwa-guide-desc strong {
    color: #ffffff;
}

.pwa-steps-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.pwa-step-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 12px 14px;
    border-radius: 12px;
}

.pwa-step-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(245, 130, 32, 0.15);
    border: 1px solid var(--accent);
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pwa-step-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.82rem;
}

.pwa-step-text strong {
    color: #ffffff;
    font-size: 0.88rem;
}

.pwa-step-text span {
    color: var(--text-dim);
    line-height: 1.35;
}

.ios-icon, .pc-icon {
    display: inline-block;
    padding: 1px 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    font-weight: bold;
    color: var(--accent);
}

.pwa-http-warning {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 12px;
    padding: 12px 14px;
    color: #fde68a;
    font-size: 0.78rem;
    line-height: 1.4;
}

.pwa-http-warning svg {
    color: #f59e0b;
    flex-shrink: 0;
    margin-top: 2px;
}

.pwa-modal-footer {
    padding: 1rem 1.5rem 1.25rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: flex-end;
    background: rgba(0, 0, 0, 0.15);
}

.btn-pwa-modal-ok {
    background: linear-gradient(135deg, var(--accent) 0%, #e07010 100%);
    border: none;
    color: #ffffff;
    padding: 0.7rem 1.5rem;
    font-size: 0.88rem;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(245, 130, 32, 0.3);
    width: 100%;
}

.btn-pwa-modal-ok:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 130, 32, 0.5);
}

/* ================================================================
   ESTILOS: MODAL DE MIX CADASTRADO & PAUTA DE PEDIDOS PERSONALIZÁVEL
   ================================================================ */

.btn-pauta-consult {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(245, 130, 32, 0.2);
    transition: all 0.2s ease;
}

.btn-pauta-consult:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, rgba(245, 130, 32, 0.35) 0%, rgba(255, 179, 71, 0.35) 100%) !important;
    box-shadow: 0 6px 16px rgba(245, 130, 32, 0.4);
}

/* Modal Mix Cadastrado & Pauta de Pedidos */
#modal-mix-pauta {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(8, 12, 28, 0.85) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    z-index: 3500 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 12px !important;
    box-sizing: border-box !important;
}

#modal-mix-pauta.active {
    display: flex !important;
}

#modal-mix-pauta.hidden {
    display: none !important;
}

.pauta-modal-card {
    background: #12182F !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 14px !important;
    padding: 1rem !important;
    width: 96% !important;
    max-width: 1250px !important;
    height: 92vh !important;
    max-height: 92vh !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: 0 25px 60px rgba(0,0,0,0.85) !important;
    overflow: hidden !important;
    gap: 10px !important;
    position: relative !important;
    box-sizing: border-box !important;
}

@media (max-width: 768px) {
    #modal-mix-pauta {
        padding: 0 !important;
    }
    .pauta-modal-card {
        padding: 0.6rem !important;
        width: 100vw !important;
        height: 100vh !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        border: none !important;
        gap: 8px !important;
    }
}

/* Botão Trocar Cliente no Header */
.pauta-btn-trocar-cliente {
    background: rgba(245, 130, 32, 0.15);
    border: 1px solid var(--accent);
    color: var(--accent);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
    white-space: nowrap;
    height: 24px;
    margin-left: auto;
}

.pauta-btn-trocar-cliente:hover {
    background: var(--accent);
    color: #fff;
}

.pauta-btn-trocar-cliente:active {
    transform: scale(0.96);
}

.pauta-btn-help-rules {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid #3b82f6;
    color: #60a5fa;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
    white-space: nowrap;
    height: 24px;
}

.pauta-btn-help-rules:hover {
    background: #3b82f6;
    color: #fff;
}

.pauta-btn-help-rules:active {
    transform: scale(0.96);
}

/* Painel Guia & Regras da Pauta */
.pauta-rules-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: #0F152B !important;
    z-index: 120 !important;
    display: none !important;
    flex-direction: column !important;
    padding: 1.2rem !important;
    border-radius: 14px !important;
    gap: 12px !important;
    box-sizing: border-box !important;
    animation: pautaFadeIn 0.15s ease-out !important;
    overflow-y: auto !important;
}

.pauta-rules-overlay.active {
    display: flex !important;
}

.pauta-rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    margin-top: 4px;
}

.pauta-rule-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pauta-rule-card h4 {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 700;
    color: #F8FAFC;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pauta-rule-card p, .pauta-rule-card ul {
    margin: 0;
    font-size: 0.72rem;
    color: #94A3B8;
    line-height: 1.45;
}

.pauta-rule-card ul {
    padding-left: 16px;
}

.pauta-rule-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
}

/* Painel Seletor de Clientes / Redes */
.pauta-client-picker-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: #0F152B !important;
    z-index: 100 !important;
    display: none !important;
    flex-direction: column !important;
    padding: 1rem !important;
    border-radius: 14px !important;
    gap: 10px !important;
    box-sizing: border-box !important;
    animation: pautaFadeIn 0.15s ease-out !important;
    overflow: hidden !important;
}

.pauta-client-picker-overlay.active {
    display: flex !important;
}

.pauta-client-picker-overlay.hidden {
    display: none !important;
}

@media (max-width: 768px) {
    .pauta-client-picker-overlay {
        padding: 0.75rem 0.6rem !important;
        border-radius: 0 !important;
        gap: 8px !important;
    }
}

@keyframes pautaFadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

.pauta-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 8px;
    flex-shrink: 0;
    width: 100%;
}

.pauta-picker-title {
    font-size: 0.92rem;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.pauta-picker-search-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(245, 130, 32, 0.4);
    border-radius: 8px;
    padding: 0 10px;
    height: 42px;
    gap: 8px;
    box-sizing: border-box;
    flex-shrink: 0;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.pauta-picker-search-box:focus-within {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 2px rgba(245, 130, 32, 0.25);
}

.pauta-picker-search-box input {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 0.88rem;
    width: 100%;
    outline: none;
}

.pauta-picker-search-box input::placeholder {
    color: #94A3B8;
    font-size: 0.8rem;
}

.pauta-picker-clear-btn {
    background: transparent;
    border: none;
    color: #94A3B8;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.pauta-picker-clear-btn:hover {
    color: #fff;
}

.pauta-picker-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    flex-shrink: 0;
    padding-bottom: 2px;
    width: 100%;
}

.pauta-picker-tab {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #CBD5E1;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
    user-select: none;
}

.pauta-picker-tab.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.pauta-picker-list {
    flex: 1 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    padding-right: 2px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.pauta-picker-item {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 8px !important;
    padding: 8px 10px !important;
    cursor: pointer !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 3px !important;
    transition: all 0.15s !important;
    user-select: none !important;
    touch-action: manipulation !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.pauta-picker-item:hover, .pauta-picker-item:active {
    background: rgba(245, 130, 32, 0.15) !important;
    border-color: var(--accent) !important;
}

.pauta-picker-item-top {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    width: 100% !important;
    min-width: 0 !important;
}

.pauta-picker-item-tag {
    font-family: monospace !important;
    font-size: 0.65rem !important;
    font-weight: 800 !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    flex-shrink: 0 !important;
}

.pauta-picker-item-tag.rede {
    background: rgba(59, 130, 246, 0.2) !important;
    color: #60A5FA !important;
    border: 1px solid rgba(59, 130, 246, 0.4) !important;
}

.pauta-picker-item-tag.cliente {
    background: rgba(245, 130, 32, 0.15) !important;
    color: var(--accent) !important;
    border: 1px solid rgba(245, 130, 32, 0.3) !important;
}

.pauta-picker-item-name {
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    color: #F8FAFC !important;
    flex: 1 !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.pauta-picker-item-meta {
    font-size: 0.66rem !important;
    color: #94A3B8 !important;
    display: flex !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
}

.pauta-picker-empty {
    text-align: center;
    padding: 30px 10px;
    color: var(--text-dim);
    font-size: 0.82rem;
}

/* Header Compacto */
.pauta-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 0.6rem;
    gap: 8px;
    flex-shrink: 0;
}

.pauta-header-left {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    gap: 3px;
}

.pauta-header-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pauta-title {
    color: #fff;
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 75vw;
}

.pauta-badge-count {
    background: rgba(245, 130, 32, 0.2);
    border: 1px solid var(--accent);
    color: var(--accent);
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 12px;
}

.pauta-header-sub {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    color: var(--text-dim);
    flex-wrap: wrap;
}

.pauta-sub-info {
    color: #CBD5E1;
    font-weight: 600;
}

.pauta-sub-kpi {
    color: #94A3B8;
    background: rgba(255, 255, 255, 0.04);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.66rem;
}

.pauta-close-btn {
    background: transparent !important;
    border: none !important;
    color: #94A3B8 !important;
    font-size: 1.8rem !important;
    line-height: 1 !important;
    cursor: pointer !important;
    padding: 2px 8px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
    z-index: 100 !important;
    position: relative !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
}

.pauta-close-btn:hover, .pauta-close-btn:active {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

/* Barra de Filtros & Ações Rápidas Elegante */
.pauta-quick-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    flex-wrap: wrap;
    background: rgba(0, 0, 0, 0.22);
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.pauta-search-wrap {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 0 8px;
    flex: 1;
    min-width: 140px;
    height: 32px;
    transition: all 0.15s;
}

.pauta-search-wrap:focus-within {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 2px rgba(245, 130, 32, 0.2);
}

.pauta-search-wrap input {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 0.75rem;
    width: 100%;
    outline: none;
}

.pauta-search-wrap input::placeholder {
    color: #94A3B8;
}

/* Selects e Multi-selects Customizados Dark Theme */
.pauta-multiselect-wrap {
    position: relative;
    display: inline-block;
}

.pauta-select-btn {
    background-color: #171E3D;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #F8FAFC;
    padding: 0 10px;
    height: 32px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    outline: none;
    max-width: 180px;
    white-space: nowrap;
    transition: all 0.15s;
    user-select: none;
}

.pauta-select-btn:hover {
    background-color: #1D264E;
    border-color: rgba(245, 130, 32, 0.6);
}

.pauta-select-btn.active, .pauta-select-btn:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(245, 130, 32, 0.2);
}

.pauta-select-chevron {
    color: var(--accent);
    font-size: 0.7rem;
    pointer-events: none;
}

.pauta-multiselect-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 210px;
    max-width: min(290px, calc(100vw - 32px));
    background: #12182F;
    border: 1px solid rgba(245, 130, 32, 0.5);
    border-radius: 8px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.9);
    z-index: 1200;
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-sizing: border-box;
    animation: pautaFadeIn 0.15s ease-out;
}

@media (max-width: 768px) {
    .pauta-multiselect-panel {
        left: auto !important;
        right: 0 !important;
    }
}

@keyframes pautaFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.pauta-multiselect-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 2px 4px 6px 4px;
}

.pauta-mini-link {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.68rem;
    font-weight: 700;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
}

.pauta-mini-link:hover {
    background: rgba(245, 130, 32, 0.18);
}

.pauta-multiselect-list {
    overflow-y: auto;
    max-height: 200px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pauta-check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.72rem;
    color: #E2E8F0;
    user-select: none;
    transition: background 0.1s;
}

.pauta-check-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.pauta-check-item input[type="checkbox"] {
    accent-color: #f58220;
    cursor: pointer;
    width: 14px;
    height: 14px;
    margin: 0;
}

.pauta-select {
    background-color: #171E3D !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%23F58220' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 8px center !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #F8FAFC !important;
    padding: 0 24px 0 8px !important;
    height: 32px !important;
    border-radius: 6px !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    outline: none !important;
    max-width: 160px !important;
    transition: all 0.15s;
}

.pauta-select:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 2px rgba(245, 130, 32, 0.2) !important;
}

.pauta-select option {
    background: #12182F !important;
    color: #fff !important;
    padding: 8px !important;
}

.pauta-btn-cols-toggle {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #CBD5E1;
    height: 32px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.pauta-btn-cols-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: var(--accent);
}

.pauta-badge-pill {
    background: var(--accent);
    color: #fff;
    font-size: 0.6rem;
    padding: 1px 5px;
    border-radius: 10px;
    font-weight: 800;
}

/* Drawer / Acordeão de Colunas */
.pauta-cols-drawer {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 8px 10px;
    flex-shrink: 0;
    animation: pautaSlideDown 0.2s ease-out;
}

@keyframes pautaSlideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.pauta-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.pauta-drawer-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: #94A3B8;
}

.pauta-presets-row {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.pauta-preset-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #F8FAFC;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.pauta-preset-btn:hover {
    background: rgba(245, 130, 32, 0.25);
    border-color: var(--accent);
    color: var(--accent);
}

.pauta-preset-btn.secondary {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--text-dim);
}

.pauta-chips-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.pauta-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 16px;
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94A3B8;
}

.pauta-chip.active {
    background: rgba(245, 130, 32, 0.2);
    border-color: var(--accent);
    color: #fff;
}

/* Área de Rolagem de Produtos */
.pauta-items-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.15);
}

/* Tabela Compacta de Alta Densidade (Mobile & Desktop) */
.pauta-table {
    width: 100%;
    table-layout: auto;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.70rem;
}

.pauta-table th {
    position: sticky;
    top: 0;
    background: #151B3D;
    z-index: 5;
    padding: 4px 6px;
    font-size: 0.64rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    height: 26px;
}

.pauta-table th.col-prod,
.pauta-table td.col-prod {
    width: 100% !important;
    min-width: 160px;
    white-space: normal !important;
    line-height: 1.2 !important;
}

.pauta-table th.col-compact,
.pauta-table td.col-compact {
    white-space: nowrap !important;
}

.pauta-table td {
    padding: 3px 6px;
    color: #F8FAFC;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
    line-height: 1.2;
    height: 26px;
}

.pauta-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

/* Linha de Seção na Tabela */
.pauta-table tr.pauta-secao-row td {
    background: rgba(245, 130, 32, 0.12) !important;
    color: var(--accent) !important;
    font-weight: 800 !important;
    font-size: 0.68rem !important;
    padding: 2px 8px !important;
    border-top: 1px solid rgba(245, 130, 32, 0.3) !important;
    border-bottom: 1px solid rgba(245, 130, 32, 0.3) !important;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    height: 22px;
}

/* Input de Sugestão de Pedido Compacto e Moderno (Sem setas nativas) */
.pauta-input-sug {
    width: 68px;
    height: 22px;
    background: #141B38;
    border: 1px solid rgba(245, 130, 32, 0.45);
    color: #FFFFFF;
    border-radius: 4px;
    padding: 1px 4px;
    font-size: 0.72rem;
    text-align: center;
    font-weight: 700;
    outline: none;
    box-sizing: border-box;
    -moz-appearance: textfield;
    appearance: textfield;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.pauta-input-sug::-webkit-outer-spin-button,
.pauta-input-sug::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pauta-input-sug::placeholder {
    color: rgba(255, 255, 255, 0.35);
    font-weight: 500;
    font-size: 0.72rem;
}

.pauta-input-sug:hover {
    border-color: rgba(245, 130, 32, 0.85);
    background: #192348;
}

.pauta-input-sug:focus {
    background: #1B2650;
    border-color: #ff9f43;
    box-shadow: 0 0 0 3px rgba(245, 130, 32, 0.25);
}

/* Rodapé Fixo com Botões de Exportação */
.pauta-footer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 0.6rem;
    gap: 8px;
    flex-wrap: wrap;
}

.pauta-footer-summary {
    font-size: 0.7rem;
    color: var(--text-dim);
    font-weight: 600;
}

.pauta-footer-btns {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.pauta-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    color: #fff;
    transition: all 0.15s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    touch-action: manipulation;
}

.pauta-action-btn:active {
    transform: scale(0.97);
}

.pauta-action-btn.whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
}

.pauta-action-btn.excel {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.pauta-action-btn.pdf {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.pauta-action-btn.copy {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

@media (max-width: 480px) {
    .pauta-footer-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .pauta-footer-btns {
        display: grid;
        grid-template-columns: 1.4fr 1fr 1fr 1fr;
        gap: 4px;
        width: 100%;
    }
    .pauta-action-btn {
        padding: 8px 4px;
        font-size: 0.68rem;
    }
}

/* Toast de Notificação */
.pauta-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #10b981;
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 6px;
}

.pauta-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Impressão / Exportação PDF */
@media print {
    body * {
        visibility: hidden;
    }
    #modal-mix-pauta, #modal-mix-pauta * {
        visibility: visible;
    }
    #modal-mix-pauta {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        background: #ffffff !important;
        color: #000000 !important;
        box-shadow: none !important;
        padding: 0 !important;
    }
    .pauta-quick-bar, .pauta-cols-drawer, .pauta-footer-actions, .pauta-close-btn, #pauta-toast {
        display: none !important;
    }
    .pauta-table {
        display: table !important;
    }
    .pauta-mobile-list {
        display: none !important;
    }
    .pauta-table th, .pauta-table td {
        color: #000 !important;
        border-bottom: 1px solid #ddd !important;
    }
}






