/* Configurações Gerais */

/* Variáveis globais */
:root {
    /* Paleta de Cores */
  --cor-background-body: #0b0e11;
  --cor-backgroud-container: #161b22;
  --cor-background-modal: rgba(0,0,0,0.8);
  --cor-background-modal-content: #161b22;
  --cor-modal-content-text: black;
  --cor-modal-title-text: aliceblue;
  --cor-body-text: white;
  --cor-border-bottom-mainheader: #30363d;
  --cor-btn-logout-border: #30363d;
  --cor-btn-logout-text: #8b949e;
  --cor-btn-logout-hover: #ff4444;
  --cor-label-form: #8b949e;
  --cor-backgroud-formfields: #0b0e11;
  --cor-border-formfields: #30363d;
  --cor-text-formfields: white;
  --cor-background-radiobutton: #21262d;
  --cor-border-top-totalsection: #30363d;
  --cor-btn-finish-background: #8b1a1a;
  --cor-btn-finish-text: white;
  --cor-btn-finish-hover: #a31e1e;
  --cor-btn-secondary-border: #8b1a1a;
  --cor-btn-secondary-text: white;
  --cor-btn-secondary-hover: rgba(139, 26, 26, 0.1);
  --cor-hr-line: #30363d;
  --cor-carsection-text: #8b949e;
  --cor-table-th-text: #8b949e;
  --cor-table-td-border-bottom: #21262d;
  --cor-btn-remove-text: #ff4444;
  --cor-receipt-details-border-top: #ccc;
  --cor-btn-whatsapp-background: #25D366;

}


* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--cor-background-body); /* Fundo escuro como no logo */
    color: var(--cor-body-text);
    display: flex;
    justify-content: center;
    padding: 20px;
}

.container {
    background-color: var(--cor-backgroud-container);
    width: 100%;
    max-width: 500px; /* Ótimo para tablets e mobile */
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* Layout do Cabeçalho */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--cor-border-bottom-mainheader);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Botões */

.btn-logout {
    background: none;
    border: 1px solid var(--cor-btn-logout-border);
    color: var(--cor-btn-logout-text);
    border-radius: 4px;
    cursor: pointer;
    padding: 2px 6px;
    font-size: 0.8rem;
    transition: 0.3s;
}

.btn-logout:hover {
    color: var(--cor-btn-logout-hover);
    border-color: var(--cor-btn-logout-hover);
}

.btn-finish {
    width: 100%;
    padding: 15px;
    background-color: var(--cor-btn-finish-background); 
    color: var(--cor-btn-finish-text);
    border: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    transition: 0.3s;
}

.btn-finish:hover {
    background-color: var(--cor-btn-finish-hover);
}

.btn-secondary {
    width: 100%;
    margin-top: 10px;
    padding: 15px;
    background-color: transparent;
    color: var(--cor-btn-secondary-text);
    border: 1px solid var(--cor-btn-secondary-border);
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 25px;
}

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

.btn-remove {
    background: none;
    border: none;
    color: var(--cor-btn-remove-text);
    cursor: pointer;
    font-weight: bold;
}


header {
    text-align: center;
    margin-bottom: 30px;
}

/* Formulário */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--cor-label-form);
}

select, input {
    width: 100%;
    padding: 12px;
    background-color: var(--cor-backgroud-formfields);
    border: 1px solid var(--cor-border-formfields);
    color: var(--cor-text-formfields);
    border-radius: 8px;
    font-size: 1rem;
}

.row {
    display: flex;
    gap: 15px;
}


hr {
    border: 0;
    border-top: 1px solid var(--cor-hr-line);
    margin: 20px 0;
}


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

th {
    text-align: left;
    color: var(--cor-table-th-text);
    border-bottom: 1px solid var(--cor-hr-line);
    padding-bottom: 5px;
}

td {
    padding: 10px 0;
    border-bottom: 1px solid var(--cor-table-td-border-bottom);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: var(--cor-background-modal);
    justify-content: center;
    align-items: flex-start; /* MUDOU: De center para flex-start */
    overflow-y: auto;        /* NOVO: Permite rolar a tela do modal se necessário */
    z-index: 1000;
    padding: 20px 0;         /* NOVO: Dá uma margem em cima e embaixo para o modal não colar nas bordas */
}

.modal-content {
    background:  var(--cor-background-modal-content);
    color: var(--cor-modal-content-text);
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    max-height: 90vh; /* Novo */
    text-align: left;
    margin: auto;            /* NOVO: Centraliza o conteúdo perfeitamente dentro do flex */
    overflow-y: auto;        /* Adiciona a barra de rolagem vertical caso o conteúdo passe do limite */
    
}

/* Estilizando o Scrolling Bar das telas Modal

/* Para navegadores Chrome, Edge e Safari (WebKit) */
.modal-content::-webkit-scrollbar {
    width: 8px; /* Largura da barra de rolagem */
}

.modal-content::-webkit-scrollbar-track {
    background: transparent; /* Fundo do trilho transparente ou da cor desejada */
    border-radius: 8px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--cor-background-modal-content); /* Cor do "puxador" igual ao fundo */
    border-radius: 8px; /* Cantos arredondados */
}

/* Para o Firefox */
.modal-content {
    scrollbar-width: thin; /* Deixa a barra mais fina */
    scrollbar-color: var(--cor-background-modal-content) transparent; /* (Cor do puxador) (Cor do trilho) */
}
/* Fim da formatação da scrollbar */

#modalTitle {
    color: var(--cor-modal-title-text);
    text-align: center;
}

.receipt-header {
    display: flex;
    flex-direction: column; /* força os itens a ficarem em coluna */
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

#receipt-details {
    text-align: left;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    margin-bottom: 20px;
    border-top: 1px dashed var(--cor-receipt-details-border-top);
    padding-top: 15px;
}

/* Botões do Modal */
.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-whatsapp { 
    background-color: var(--cor-btn-whatsapp-background);
    color: var(--cor-body-text);
    border: none; 
    padding: 12px; 
    border-radius: 5px; 
    font-weight: bold; 
    cursor: pointer; 
}

.btn-print { 
    background-color: #333; 
    color: white; 
    border: none; 
    padding: 12px; 
    border-radius: 5px; 
    font-weight: bold; 
    cursor: pointer; 
}

.btn-close { 
    background-color: #ccc; 
    border: none; 
    padding: 15px; 
    border-radius: 5px; 
    cursor: pointer; 
}

/* ... (Estilos anteriores) ... */

.discount-global-section {
    margin-top: 20px;
    padding: 15px;
    background-color: #21262d;
    border-radius: 8px;
}

.history-section {
    margin-top: 30px;
}

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

.btn-clear {
    background: none;
    border: 1px solid #444;
    color: #8b949e;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
}

.sale-card {
    background-color: #161b22;
    border-left: 4px solid #8b1a1a;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 0 8px 8px 0;
}

.sale-card p {
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.sale-card .sale-total {
    font-weight: bold;
    color: white;
    font-size: 1rem;
}

.filter-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-controls input {
    flex: 1;
    padding: 8px;
    font-size: 0.8rem;
    background-color: #161b22;
}

.btn-reset-filters {
    background: none;
    border: 1px solid #8b1a1a;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.7rem;
}


.summary-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.summary-card {
    background-color: #1c2128;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #30363d;
}

.summary-card.highlight {
    border-color: #8b1a1a;
}

.summary-label {
    display: block;
    font-size: 0.75rem;
    color: #8b949e;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.summary-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
}

.btn-export {
    width: 100%;
    background-color: #1f6feb; /* Azul corporativo para exportação */
    color: white;
    border: none;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    margin-bottom: 20px;
    font-weight: bold;
}

.btn-export:hover {
    background-color: #388bfd;
}

/* ... (Manter estilos anteriores) ... */

.sale-actions {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

/* Estilo do Botão de Editar (Vazado) */
.btn-edit {
    background: none;
    border: 1px solid #1f6feb;
    color: #1f6feb;
    padding: 5px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.6rem;
    font-weight: bold;
}

.btn-edit:hover {
    /* background-color: rgba(31, 111, 235, 0.1); */
    background-color: #1f6feb;
    color: #ffffff;
    box-shadow: 0 0 8px rgba(31, 111, 235, 0.1);
}

/* Estilo do Botão de Excluir (Vazado) */
.btn-delete {
    background: transparent;
    border: 1px solid #da3633; /* Vermelho alerta */
    color: #da3633;
    padding: 5px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.7rem;
    line-height: 1;
    margin-left: 0px;
}

/* Efeito Hover: Preenche o fundo e muda a cor do ícone */
.btn-delete:hover {
    background: #da3633;
    color: #ffffff;
    box-shadow: 0 0 8px rgba(218, 54, 51, 0.4);
}

/* ... (Estilos anteriores) ... */

.analytics-section {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid #30363d;
}

.chart-box {
    background-color: #161b22;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #30363d;
}

.chart-box h4 {
    color: #8b949e;
    font-size: 0.9rem;
    margin-bottom: 15px;
    text-transform: uppercase;
}

canvas {
    max-width: 100%;
    height: auto !important;
}



/* Ajuste mobile */
@media (max-width: 480px) {
    .user-details { display: none; } /* Esconde nomes em telas muito pequenas */

    /* Responsividade Mobile para a Tabela */
     th:nth-child(1), td:nth-child(1) { width: 50%; }
    .total-section { font-size: 1.2rem; }

    /* Responsividade para Telas Pequenas */
    .container {
        padding: 15px;
    }
    .row {
        flex-direction: column;
    }

    /* Ajuste mobile para os filtros */
    .filter-controls {
        flex-direction: column;
    }

}





