/* ============================================================
   1. VARIÁVEIS GLOBAIS (TEMA PADRÃO - CLARO / LIGHT)
   ============================================================ */
:root {
    /* Cores Principais */
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;

    /* Fundos */
    --color-bg-body: #fff;       /* Fundo da tela */
    --color-bg-white: #F4F4F4;      /* Fundo dos cards e menu */
    --color-bg-secondary: #f9fafb;  /* Fundo de blocos internos (cinza bem claro) */
    --color-bg-tertiary: #e5e7eb;   /* Fundo de hovers */
    --color-bg-input: #ffffff;      /* Fundo de inputs */

    /* Textos */
    --color-text-main: #1f2937;     /* Texto principal (quase preto) */
    --color-text-muted: #6b7280;    /* Texto secundário (cinza) */
    --color-text-inverse: #ffffff;  /* Texto em botões coloridos */

    /* Bordas */
    --color-border: #e5e7eb;

    /* Configurações */
    --border-radius-main: 8px;
    --spacing-std: 1rem;
}


/* ============================================================
   2. TEMA ESCURO (AZUL NOTURNO / MIDNIGHT BLUE)
   ============================================================ */
body.dark-theme {
    /* Cor Primária (Azul Céu Vibrante para destacar no fundo escuro) */

    --color-primary: #3b82f6;
    --color-primary-hover: #60a5fa;

    /* TONS DE AZUL MUITO ESCURO */
    --color-bg-body: #000010;       /* Fundo da tela: Quase preto, levemente azul */
    --color-bg-white: #000008;      /* Cards: Azul Marinho Escuro */
    --color-bg-secondary: #1e293b;  /* Blocos internos: Azul Petróleo */
    --color-bg-tertiary: #334155;   /* Hovers */
    --color-bg-input: #020617;      /* Inputs: Mais escuros para profundidade */

    /* Textos */
    --color-text-main: #f8fafc;     /* Branco Gelo (Máximo contraste) */
    --color-text-muted: #94a3b8;    /* Cinza Azulado */
    --color-text-inverse: #ffffff;  /* Texto em botões */

    /* Bordas */
    --color-border: #1e293b;       /* Borda Azulada Discreta */

}

/* ============================================================
   TEMA RED (Animado)
   ============================================================ */

body.red-theme {
    /* Variações do #3A0029 para criar o movimento */
    --color-bg-body: #4a0033;

    --color-bg-white: #4a0035;   /* Fundo dos cards/tabelas */
 
    --color-bg-secondary: rgba(255, 255, 255, 0.2);
    --color-bg-input: rgba(255, 255, 255, 0.1);


    --color-text-primary: #fff; /* Texto claro */
    --color-text-secondary: #fff;


    /* Configuração da Animação de Fundo */
    background-size: 350% 350%;
    animation: moveGradient 9s ease infinite;

    --color-text-main: #ffffff;     /* Branco Gelo (Máximo contraste) */
    --color-text-muted: #ffffff;    /* Cinza Azulado */
    --color-text-inverse: #ffffff;  /* Texto em botões */

    --color-border: #3A0029;     /* Bordas */
    --color-primary: #FCA905; /* botões */

}

/* Animação do Gradiente */
@keyframes moveGradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Ajuste opcional para Inputs e Botões no tema RED */
body.red-theme .form-control {
    color: #FFF;
}

body.red-theme select{
    color: #000;

}

body.red-theme select option {
    /* Não aceita gradiente, usamos a cor base do tema */
    background-color: var(--color-bg-white);
    color: #fff;
}

/* Ajustes Finos para o tema Azulado */
body.dark-theme input,
body.dark-theme select,
body.dark-theme textarea {

    border-color: #334155;
}

body.dark-theme .table-items thead {
    background-color: #0f172a; /* Cabeçalho da tabela mais escuro */
}


/* ============================================================
   3. RESET E ESTRUTURA BÁSICA
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {

    color: var(--color-text-main);
    height: 100vh;
    background-color: var(--color-bg-white);
}

/* Classe utilitária para esconder elementos */
.hidden {
    display: none !important;
}

.app-container {
    display: flex;
    height: 100%;
}

.top-bar {
    margin-bottom: 1rem;
}

/* ============================================================
   4. SIDEBAR (MENU LATERAL)
   ============================================================ */
.sidebar {
    width: 260px;
    background-color: var(--color-bg-white);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    height: 100vh;
    transition: width 0.3s ease, transform 0.3s ease, background-color 0.3s;
    z-index: 100;
}

.sidebar-brand {
    height: 64px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 1.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
    border-bottom: 1px solid var(--color-border);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.group-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--color-text-muted);
    font-weight: 700;
    margin-bottom: 0.75rem;
    padding-left: 0.75rem;
    letter-spacing: 0.05em;
}

.sidebar ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.btn-menu {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.75rem;
    background: transparent;
    border: none;
    border-radius: var(--border-radius-main);
    color: var(--color-text-main);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
    text-align: left;
}

.btn-menu:hover {
    background-color: var(--color-bg-body); /* Adaptável ao tema */
    color: var(--color-primary);
}

.btn-menu svg {
    color: var(--color-text-muted);
    transition: color 0.2s;
}

.btn-menu:hover svg {
    color: var(--color-primary);
}

.btn-menu.has-submenu {
    justify-content: space-between;
}

.btn-menu .btn-label {
    display: flex;
    align-items: center;
    gap: 12px;
}

.arrow-icon {
    transition: transform 0.3s;
}

.btn-menu.open .arrow-icon {
    transform: rotate(180deg);
}

.submenu {
    margin-top: 4px;
    padding-left: 1rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.submenu.hidden {
    display: none;
}

.btn-submenu {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.6rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: var(--border-radius-main);
    color: var(--color-text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.2s;
}

.btn-submenu:hover {
    color: var(--color-primary);
    background-color: var(--color-bg-body);
}

.sidebar.closed {
    margin-left: -260px;
}

/* ============================================================
   5. MAIN CONTENT & VIEWS
   ============================================================ */
.content {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    background-color: var(--color-bg-body);
}

.view-section {
    background-color: var(--color-bg-white);
    padding: 1rem;
    border-radius: var(--border-radius-main);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    max-width: 970px;
    margin: 0 auto;
    border: 1.5px solid var(--color-border); /* Borda sutil para dark mode */
}

.header-view {
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--color-bg-body);
    padding-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ============================================================
   6. FORMULÁRIOS & BOTÕES
   ============================================================ */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group.full-width {
    grid-column: span 2;
}

label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-main);
}

input, select, textarea {
    padding: 0.75rem;
    background-color: var(--color-bg-input);
    color: var(--color-text-main);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-main);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--color-primary);
}

/* Botões */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius-main);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background-color 0.2s, color 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-theme {
    background-color: var(--color-primary);
    color: var(--color-text-inverse);
}

.btn-theme:hover {
    background-color: var(--color-primary-hover);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-main);
}

.btn-outline:hover {
    background-color: var(--color-bg-tertiary);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

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

/* ============================================================
   7. TABELAS
   ============================================================ */
.table-container {
    width: 100%;
    overflow-x: auto;
    position: relative;
    border: 1px solid var(--color-border);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-main);
}

th {
    background-color: var(--color-bg-body);
    font-weight: 600;
    color: var(--color-text-muted);
}

tr:hover {
    background-color: var(--color-bg-body); /* Hover na tabela */
}

/* ============================================================
   8. COMPONENTES ESPECÍFICOS (FILTROS, BADGES, ETC)
   ============================================================ */
.filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.5rem;
    background-color: var(--color-bg-secondary); /* Usa variável adaptável */
    padding: 1rem;
    border-radius: var(--border-radius-main);
    border: 1px solid var(--color-border);
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
}

/* Badges */
.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    display: inline-block;
}
.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}
.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}
.badge-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}
.badge-neutral {
    background-color: var(--color-bg-tertiary);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}
.badge-blue    {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* ============================================================
   9. PEDIDO NOVO (AUTOCOMPLETE, CÁLCULOS)
   ============================================================ */
.relative-container {
    position: relative;
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--color-bg-white);
    border: 1px solid var(--color-border);
    border-radius: 0 0 var(--border-radius-main) var(--border-radius-main);
    list-style: none;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.autocomplete-list li {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--color-text-main);
}

.autocomplete-list li:hover {
    background-color: var(--color-bg-body);
    color: var(--color-primary);
}

.autocomplete-list li strong {
    color: var(--color-text-main);
}

.table-items {
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-main);

}
.table-items thead {
    background-color: var(--color-bg-body);
}

.autocomplete-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid var(--color-bg-body);
    font-size: 0.9rem;
    color: var(--color-text-main);
}
.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background-color: var(--color-primary);
    color: #fff;
}

/* Lucro Box */
.lucro-box {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    border: 2px dashed var(--color-border);
    border-radius: var(--border-radius-main);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--color-text-muted);
    background-color: var(--color-bg-secondary); /* Adaptável */
    height: 100%;
}
.lucro-positivo {
    border-style: solid;
    border-color: #34d399;
    background-color: #ecfdf5;
    color: #059669;
}
.lucro-negativo {
    border-style: solid;
    border-color: #f87171;
    background-color: #fef2f2;
    color: #dc2626;
}

/* No Dark Mode, ajustar o fundo das cores fixas para não ficar 'aceso' demais */
body.dark-theme .lucro-positivo {
    background-color: rgba(5, 150, 105, 0.1);
}
body.dark-theme .lucro-negativo {
    background-color: rgba(220, 38, 38, 0.1);
}

hr {
    border: 0;
    height: 1px;
    background-color: var(--color-border);
    margin: 2rem 0;
}

.card-section h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--color-primary);
    border-left: 4px solid var(--color-primary);
    padding-left: 0.5rem;
}


.btn-close-modal {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: var(--color-text-muted);
}
.btn-close-modal:hover {
    color: var(--color-text-main);
}

/* Scroll Modal */
#modal-editar-pedido .modal-content {
    max-height: 85vh;
    overflow-y: auto;
    scroll-behavior: smooth;
}

/* Scrollbars customizadas */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--color-bg-body);
}
::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
    border: 2px solid var(--color-bg-body);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* ============================================================
   11. BLOCOS DE EDIÇÃO E DETALHES
   ============================================================ */
.edit-block {
    background-color: var(--color-bg-secondary); /* Adaptável */
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-main);
    margin-bottom: 1.5rem;
    overflow: hidden;
}
.edit-block:last-child {
    margin-bottom: 0;
}

.block-header {
    background-color: var(--color-bg-tertiary); /* Adaptável */
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
}
.block-header h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--color-text-muted);
    font-weight: 700;
    margin: 0;
}
.block-body {
    padding: 1rem;
}
.block-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
}

/* Ícones de Ação */
.action-icons {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    transition: transform 0.2s;
    color: var(--color-text-muted);
}
.btn-icon:hover {
    transform: scale(1.1);
    color: var(--color-primary);
}
.icon-trash:hover {
    color: #dc2626;
}

/* ============================================================
   VIEW: PEDIDO CONSULTA (Tabela Fixa)
   ============================================================ */

/* Coluna de Ações Fixa na Direita (Sticky) */
.col-actions-fixed {
    position: sticky !important;
    right: 0;
    z-index: 5;
    background-color: var(--color-bg-secondary); /* Fundo OBRIGATÓRIO */
    text-align: center;
    width:100px;
}

/* Garante que o cabeçalho (TH) também fique fixo e acima das linhas */
th.col-actions-fixed {
    z-index: 10;
    background-color: var(--color-bg-body); /* Cor diferente pro Header */
}



/* ============================================================
   12. DASHBOARD / RELATÓRIO
   ============================================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.card-dash {
    background-color: var(--color-bg-white);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-main);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.card-dash span {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    font-weight: 600;
}
.card-dash strong {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-text-main);
}

.card-highlight {
    background-color: #fff7ed;
    border-color: #ffedd5;
}
/* Adaptação Dark Mode para o Highlight */
body.dark-theme .card-highlight {
    background-color: rgba(255, 237, 213, 0.1); /* Laranja transparente */
    border-color: #7c2d12;
}

.color-green {
    color: #059669;
}
.color-red {
    color: #dc2626;
}
.color-blue {
    color: #2563eb;
}
.color-orange {
    color: #d97706;
}

/* ============================================================
   13. CLIENTES & OUTROS
   ============================================================ */
.divider-section {
    border: 0;
    height: 1px;
    background-color: var(--color-border);
    margin: 2rem 0;
}

.search-box-container {
    background-color: var(--color-bg-secondary); /* Adaptável */
    padding: 1.5rem;
    border-radius: var(--border-radius-main);
    border: 1px solid var(--color-border);
    margin-bottom: 1.5rem;
}

.anexo-container {
    background-color: var(--color-bg-secondary);
    padding: 10px;
    border-radius: var(--border-radius-main);
    border: 1px solid var(--color-border);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* Coluna de Ação Fixa na Logística */
#view-logistica-consulta th:last-child,
#view-logistica-consulta td:last-child {
    width: 140px;
}

/* ============================================================ */
/* INICIO - ESTILO DO MODAL EDITAR PEDIDO (COM SCROLLBAR) */
/* ============================================================ */

/* Fundo Escuro (Overlay) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}

/* Caixa Branca do Modal */
.modal-content {
    background-color: var(--color-bg-white);
    width: 90%;
    max-width: 850px;

    /* --- LÓGICA DA SCROLLBAR --- */
    max-height: 85vh; /* Altura máxima de 85% da tela */
    overflow-y: auto; /* Faz aparecer a barra vertical se passar da altura */
    /* --------------------------- */

    padding: 25px;
    border-radius: var(--border-radius-main, 8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideDown 0.3s ease-out;
}

/* --- PERSONALIZAÇÃO DA BARRA DE ROLAGEM (SCROLLBAR) --- */
/* Funciona no Chrome, Edge, Safari e Opera */

/* Largura da barra */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

/* Fundo da barra (Trilho) */
.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

/* A parte que mexe (Thumb) */
.modal-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

/* Quando passa o mouse em cima da barra */
.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary, #555);
}

/* ------------------------------------------------------ */

/* Animação de entrada */
@keyframes slideDown {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Cabeçalho do Modal */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 11px;
    border-bottom: 1px solid var(--color-border, #ddd);
    /* Garante que o cabeçalho fique fixo se quiser (opcional, aqui ele rola junto) */
    position: sticky;
    top: -25px; /* Cola no topo compensando o padding */
    background: var(--color-border, #ddd);
    z-index: 10;
    padding-top: 5px;
}

.modal-header h3 {
    margin: 0;
    color: var(--color-text-main, #333);
    font-size: 1.4rem;
}

/* Botão Fechar (X) */
.btn-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    line-height: 1;
    color: #999;
    cursor: pointer;
}

.btn-close:hover {
    color: #ff4d4d;
}

/* Títulos das Seções */
.modal-content h4 {
    color: var(--color-primary, #007bff);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 8px;
    margin-bottom: 15px;
    margin-top: 10px;
}

/* Rodapé do Modal */
.modal-footer {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border, #ddd);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}


.modal-content small a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: bold;
}
.modal-content small a:hover {
    text-decoration: underline;
}

/* ESTILO DOS MODULOS DENTRO DO MODAL */
.module-section {
    background-color: var(--color-bg-secondary);
    padding: 15px;
    border-radius: var(--border-radius-main);
    border: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
}

.module-section h4 {
    margin-top: 0;
    color: var(--color-primary);
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 8px;
    margin-bottom: 15px;
}

.file-link {
    display: block;
    margin-top: 5px;
    font-size: 0.8rem;
    color: #666;
    word-break: break-all;
}

.full-width {
    width: 100%;
}

/* ============================================================ */
/* FIM - ESTILO DO MODAL EDITAR PEDIDO */
/* ============================================================ */

/* ============================================================ */
/* INICIO - ESTILO DO DASHBOARD (VIEW RELATORIO) */
/* ============================================================ */

/* --- LAYOUT DO CABEÇALHO E FILTROS --- */
#view-relatorio .page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end; /* Alinha inputs e botão por baixo */
    flex-wrap: wrap; /* Quebra linha em celular */
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--color-border, #ddd);
}

#form-filtro-dashboard {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

#form-filtro-dashboard label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 4px;
    display: block;
}

/* --- GRID DE CARDS (KPIs) --- */
.dashboard-grid {
    display: grid;
    /* Cria colunas automáticas com largura mínima de 220px */
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 35px;
}

.dash-card {
    background-color: var(--color-bg-white, #fff);
    padding: 20px;
    border-radius: var(--border-radius-main, 8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);

    /* Faixa colorida na esquerda padrão */
    border-left: 5px solid #ccc;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: transform 0.2s;
}

.dash-card:hover {
    transform: translateY(-3px); /* Leve subida ao passar o mouse */
}

.dash-card h3 {
    margin: 0 0 10px 0;
    font-size: 0.95rem;
    color: #777;
    text-transform: uppercase;
    font-weight: 600;
}

.big-number {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 5px 0;
    color: var(--color-text-main, #333);
}

.dash-card small {
    font-size: 0.8rem;
    color: #999;
}

/* --- VARIAÇÕES DE CORES DOS CARDS --- */
/* Verde - Recebido/Lucro */
.border-green {
    border-left-color: #28a745;
}
.text-green   {
    color: #28a745;
}
.bg-green     {
    background-color: #28a745;
}

/* Azul - Pendente/A Receber */
.border-blue  {
    border-left-color: #007bff;
}
.text-blue    {
    color: #007bff;
}
.bg-blue      {
    background-color: #007bff;
}

/* Vermelho - Atrasado/Prejuízo */
.border-red   {
    border-left-color: #dc3545;
}
.text-red     {
    color: #dc3545;
}
.bg-red       {
    background-color: #dc3545;
}

/* --- BARRA DE PROGRESSO (VISUALIZAÇÃO DA CARTEIRA) --- */
.progress-bar-container {
    width: 100%;
    height: 25px;
    background-color: #e9ecef;
    border-radius: 20px; /* Borda bem redonda */
    overflow: hidden; /* Corta o conteúdo que passar */
    display: flex; /* Para alinhar as barras lado a lado */
    margin-top: 15px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.progress-segment {
    height: 100%;
    /* Transição suave quando os valores mudam */
    transition: width 0.6s ease-in-out;
}

/* --- LEGENDA DA BARRA --- */
.legend-container {
    display: flex;
    justify-content: flex-start;
    gap: 20px;
    margin-top: 12px;
    font-size: 0.85rem;
    color: #555;
}

.legend-container span {
    display: flex;
    align-items: center;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    display: inline-block;
}

/* --- RESPONSIVIDADE ESPECÍFICA --- */
@media (max-width: 600px) {
    #form-filtro-dashboard {
        flex-direction: column;
        width: 100%;
    }

    #form-filtro-dashboard div,
    #form-filtro-dashboard input,
    #form-filtro-dashboard button {
        width: 100%;
    }
}

/* ============================================================ */
/* FIM - ESTILO DO DASHBOARD (VIEW RELATORIO) */
/* ============================================================ */