/* static/css/style.css */

:root {
    --bg-dark: #121212;
    --bg-sidebar: #1e1e1e;
    --bg-card: #2c2c2c;
    --text-primary: #e0e0e0;
    --text-secondary: #aaaaaa;
    
    /* NOVA COR PADRÃO PEDIDA */
    --accent: #15a0a5;        
    --accent-hover: #107a7e; /* Um pouco mais escuro para efeito hover */
    
    --success: #15a0a5;      /* Usando a mesma cor para sucesso/destaque */
    --danger: #cf6679;
    --sidebar-width: 260px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    display: flex; /* ESSENCIAL PARA O MENU LATERAL */
    min-height: 100vh;
}

/* --- BARRA LATERAL (SIDEBAR) --- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid #333;
    position: fixed; /* ESSENCIAL PARA FIXAR NA ESQUERDA */
    top: 0;
    left: 0;
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #333;
}

.sidebar-header h2 {
    color: var(--accent);
    margin: 0;
    font-size: 1.5rem;
}

.sidebar-menu {
    padding: 10px 0;
    flex-grow: 1;
}

.sidebar a {
    display: block;
    padding: 15px 25px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.sidebar a:hover {
    background-color: rgba(21, 160, 165, 0.22);
    color: #fff;
    border-left-color: #15A0A5;
}

.sidebar a:focus-visible {
    outline: 2px solid rgba(21, 160, 165, 0.55);
    outline-offset: -2px;
}

.sidebar hr {
    border: 0;
    border-top: 1px solid #333;
    margin: 10px 20px;
}

/* --- CONTEÚDO PRINCIPAL --- */
.content {
    margin-left: var(--sidebar-width); /* ESSENCIAL: EMPURRA O CONTEÚDO */
    padding: 30px;
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    flex: 1;
    min-width: 0;
    max-width: 100%;
    transition: margin-left 0.25s ease, width 0.25s ease, padding 0.25s ease;
}

/* --- TELA CHEIA (oculta sidebar + mais área útil) --- */
.header-top {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    margin-bottom: 10px;
}

.btn-tela-cheia {
    background: rgba(21, 160, 165, 0.15);
    border: 1px solid rgba(21, 160, 165, 0.45);
    color: var(--accent);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 1rem;
    margin-right: auto;
    transition: background 0.2s;
}

.btn-tela-cheia:hover {
    background: rgba(21, 160, 165, 0.3);
}

body.modo-tela-cheia .sidebar,
.sidebar.sidebar-oculta {
    transform: translateX(-100%);
    pointer-events: none;
}

body.modo-tela-cheia .content {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 16px 20px !important;
}

body.modo-tela-cheia .header-top {
    padding: 6px 12px;
    margin-bottom: 6px;
}

.sidebar {
    transition: transform 0.25s ease;
}

/* --- CARDS E CONTAINERS --- */
.card {
    background-color: var(--bg-card);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    margin-bottom: 20px;
}

h2, h3 {
    color: var(--text-primary);
    margin-top: 0;
}

/* --- FORMULÁRIOS E INPUTS --- */
label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 500;
}

input, select, textarea {
    width: 100%;
    padding: 12px;
    background-color: #1e1e1e;
    border: 1px solid #444;
    border-radius: 6px;
    color: #fff;
    font-size: 1rem;
    margin-bottom: 15px;
    outline: none;
    transition: border-color 0.3s;
}

select option {
    background-color: #1e1e1e;
    color: #fff;
}

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

/* --- BOTÕES --- */
.btn, button {
    display: inline-block;
    background-color: var(--accent);
    color: #000;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    font-size: 1rem;
    transition: background 0.3s;
    text-align: center;
}

.btn:hover, button:hover {
    background-color: var(--accent-hover);
}

.btn-danger {
    background-color: var(--danger);
    color: #fff;
}

/* --- TABELAS --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th {
    text-align: left;
    padding: 12px;
    background-color: #333;
    color: var(--text-primary);
    font-weight: 600;
}

td {
    padding: 12px;
    border-bottom: 1px solid #444;
    color: var(--text-secondary);
}

tr:hover td {
    background-color: #333;
    color: #fff;
}

/* --- AJUSTES PARA A TELA DE VENDAS (legado — ver bloco PDV 3 colunas abaixo) --- */

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }


/* --- ESTILOS ESPECÍFICOS DA TELA DE VENDAS (legado removido — ver PDV 3 colunas) --- */

/* Display do Valor Total (global fallback) */

/* Botão de remover item (X) */
.btn-remover { 
    color: #cf6679; 
    cursor: pointer; 
    font-weight: bold; 
    text-align: center; 
    width: 30px;
}
.btn-remover:hover { color: #ff5555; }


/* --- PADRONIZAÇÃO DE TABELAS (NOVO) --- */

/* Classe para o Nome Principal (Branco e Negrito) */
.coluna-destaque {
    color: #fff !important;
    font-weight: bold;
    padding: 10px;
}

/* Classe para Valores, Preços e Estoque (Cor do Tema e Negrito) */
.coluna-valor {
    color: #03dac6 !important;
    font-weight: bold;
    font-size: 1.1em;
}

/* Quantidade/estoque: alinha e fixa largura dos números */
.coluna-quantidade {
    color: #03dac6 !important;
    font-weight: bold;
    font-size: 1.2em;
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Classe para informações secundárias (Ex: Preço de Custo) */
.coluna-secundaria {
    color: #aaa !important;
    font-size: 0.9em;
}

/* Ajuste fino para as linhas da tabela */
.table tbody tr {
    border-bottom: 1px solid #333;
}



/* Estilo normal do dia */
.card-dia {
    background-color: #2b2b2b; /* Cor de fundo normal */
    border: 1px solid #3e3e3e;
    color: #fff;
    /* ... resto do seu estilo */
}

/* Estilo para dias de outros meses (Opção 1) */
.card-dia.out-of-month {
    background-color: #1f1f1f; /* Fundo um pouco mais escuro */
    color: #6c757d; /* Texto cinza (muted) */
    opacity: 0.6;   /* Deixa tudo mais apagadinho */
    pointer-events: none; /* Opcional: impede clicar nesses dias */
}


.sale-value {
        display: block;
        margin-top: 5px;       /* Reduzi um pouco a margem para caber */
        font-size: 16px;       /* AUMENTEI: antes era 14px */
        font-weight: 800;      /* Mais negrito */
        color: #fff;
        text-align: center;
        letter-spacing: 0.5px; /* Espaçamento leve para leitura melhor */
    }


/* ==========================================================================
   ESTILOS DO DASHBOARD (ÚLTIMAS VENDAS E CORREÇÕES)
   Cole isso no final do style.css, logo após os estilos do PDV
   ========================================================================== */

/* 1. Remove linhas indesejadas nos cards */
.card-body hr { display: none !important; margin: 0 !important; }
.card-body .border-top { border-top: none !important; }

/* 2. Estilo da Lista "Últimas Vendas" (Nome na esquerda, Valor na direita) */
.lista-vendas {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.item-venda {
    display: flex;
    justify-content: space-between; /* O Pulo do Gato: afasta os itens */
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.item-venda:last-child { border-bottom: none; }

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

.nome-cliente {
    font-weight: bold;
    color: #fff;
    font-size: 0.95rem;
}

.data-venda {
    font-size: 0.8rem;
    color: #888;
}

.valor-venda {
    font-weight: bold;
    color: var(--accent, #15a0a5); /* Verde do tema */
    font-size: 1.1rem;
}


/* ==========================================================================
   PDV — LAYOUT 50/50 CLÁSSICO + BARRA DE RODAPÉ + MODO COMPACTO
   ========================================================================== */

.content:has(.pdv-page) {
    padding: 10px 14px;
    overflow-x: hidden;
    overflow-y: auto;
}

.content:has(.pdv-page) .header-top {
    padding: 4px 0;
    margin-bottom: 6px;
}

.pdv-page {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: calc(100vh - 72px);
    max-height: calc(100vh - 72px);
    min-height: 0;
    overflow: hidden;
}

.pdv-page .card {
    margin-bottom: 0 !important;
    padding: 12px;
    min-width: 0;
    width: 100%;
}

.pdv-compact label {
    font-size: 0.78rem;
    margin-bottom: 3px;
    color: #aaa;
}

.pdv-compact input,
.pdv-compact select {
    padding: 6px 8px;
    margin-bottom: 6px;
    font-size: 0.88rem;
}

.pdv-compact h3 {
    font-size: 0.92rem;
    margin: 0 0 8px 0;
    letter-spacing: 0.03em;
}

.pdv-field {
    min-width: 0;
}

/* Container 50/50 — grid evita quebra em notebooks */
.pdv-page .pdv-container {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 8px;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    align-items: stretch;
}

.painel-esquerdo {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}

.painel-esquerdo .card:first-child {
    flex: 0 0 auto;
}

.card-produto {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
}

.card-produto .btn-pdv-acao {
    margin-top: auto;
}

.painel-direito {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}

.card-cupom {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    height: 100%;
}

.pdv-row-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.pdv-label-inline {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
}

.pdv-unidade-tag {
    color: #107a7e;
    font-weight: bold;
}

.pdv-balanca-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-balanca-mini {
    padding: 2px 6px !important;
    font-size: 0.65rem !important;
    background: #03dac6 !important;
    color: #000 !important;
    width: auto !important;
    margin: 0 !important;
}

.pdv-balanca-status {
    font-size: 0.6rem;
    color: #888;
}

.pdv-input-destaque {
    background-color: #1a4d4f !important;
    border-color: #107a7e !important;
}

/* Cupom — rola internamente */
.card-cupom .cupom-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    border: 1px solid #333;
    border-radius: 4px;
    background: #222;
}

.cupom-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.cupom-table th {
    position: sticky;
    top: 0;
    background-color: #333;
    z-index: 2;
    padding: 6px 8px;
    text-align: left;
    font-size: 0.78rem;
    color: #fff;
}

.cupom-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #444;
    color: #ccc;
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cupom-table th:nth-child(1), .cupom-table td:nth-child(1) { width: 48%; }
.cupom-table th:nth-child(2), .cupom-table td:nth-child(2) { width: 22%; text-align: center; }
.cupom-table th:nth-child(3), .cupom-table td:nth-child(3) { width: 22%; text-align: right; }
.cupom-table th:nth-child(4), .cupom-table td:nth-child(4) { width: 8%; text-align: center; }

/* Barra de pagamento fixa no rodapé */
.pdv-footer-bar {
    flex-shrink: 0;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px !important;
    border-top: 2px solid #15a0a5;
}

.pdv-footer-campos {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px 12px;
    min-width: 0;
}

.pdv-footer-field {
    flex: 0 1 auto;
    min-width: 120px;
    max-width: 170px;
}

.pdv-footer-taxa {
    min-width: 100px;
    max-width: 110px;
}

.pdv-footer-field label {
    font-size: 0.72rem;
    margin-bottom: 2px;
    white-space: nowrap;
}

.pdv-footer-field input,
.pdv-footer-field select {
    margin-bottom: 0;
}

.pdv-footer-expand {
    min-width: 95px;
    max-width: 115px;
}

.pdv-footer-checks {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    padding-bottom: 4px;
}

.pdv-footer-checks .check-container {
    margin: 0;
}

.pdv-footer-checks .check-container label {
    font-size: 0.74rem;
    white-space: nowrap;
}

.pdv-footer-checkout {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.pdv-page .total-display {
    font-size: clamp(1.5rem, 2.5vw, 2.2rem);
    font-weight: 700;
    color: #107a7e;
    margin: 0;
    line-height: 1;
    white-space: nowrap;
}

.btn-finalizar-venda {
    margin: 0 !important;
    padding: 10px 18px !important;
    font-size: 0.88rem !important;
    white-space: nowrap;
    width: auto !important;
}

/* Pagamento dividido — mini-tabela no rodapé PDV */
.pdv-liquidacoes-wrap {
    flex: 1 1 100%;
    min-width: 280px;
    max-width: 100%;
    padding: 4px 0;
}

.pdv-liquidacoes-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.pdv-liquidacoes-restante {
    font-size: 0.72rem;
    color: #ccc;
}

.pdv-liquidacoes-restante strong {
    color: #ff9800;
}

.pdv-liquidacoes-lista {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 88px;
    overflow-y: auto;
}

.pdv-liquidacao-linha {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pdv-liquidacao-linha .liq-meio {
    min-width: 88px;
    max-width: 100px;
    margin-bottom: 0 !important;
    font-size: 0.78rem;
    padding: 4px 6px;
}

.pdv-liquidacao-linha .liq-valor,
.pdv-liquidacao-linha .liq-troco {
    width: 72px;
    margin-bottom: 0 !important;
    font-size: 0.78rem;
    padding: 4px 6px;
}

.pdv-liquidacao-linha .liq-troco-wrap {
    display: flex;
    align-items: center;
}

.btn-add-liquidacao,
.btn-remover-liq {
    border: 1px solid #15a0a5;
    background: transparent;
    color: #03dac6;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.72rem;
    padding: 3px 8px;
    line-height: 1.2;
}

.btn-remover-liq {
    border-color: #cf6679;
    color: #cf6679;
    padding: 2px 7px;
    font-size: 0.9rem;
}

.btn-pdv-acao {
    width: 100%;
    margin-top: 8px;
    padding: 8px 12px;
    font-size: 0.85rem;
}

.pdv-page .btn-remove {
    width: auto !important;
    display: inline-block !important;
    margin: 0;
    padding: 0;
    background: none;
    border: none;
    color: #cf6679;
    cursor: pointer;
    font-weight: bold;
}

.check-container {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.check-container input {
    width: auto !important;
    margin: 0 !important;
    flex-shrink: 0;
}

/* Histórico de vendas — card de filtros */
.vendas-filtros-card {
    margin-bottom: 20px;
    padding: 16px 18px !important;
    border-top: 3px solid #15a0a5;
}

.vendas-filtros-titulo {
    margin: 0 0 6px;
    font-size: 1.05rem;
    color: #03dac6;
}

.vendas-filtros-desc {
    margin: 0 0 14px;
    font-size: 0.82rem;
    color: #aaa;
}

.vendas-filtros-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vendas-filtros-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px 14px;
}

.vendas-filtro-field label {
    display: block;
    font-size: 0.78rem;
    margin-bottom: 4px;
    color: #ccc;
}

.vendas-filtro-field input,
.vendas-filtro-field select {
    width: 100%;
    margin-bottom: 0;
    font-size: 0.88rem;
    background-color: #1e1e1e;
    color: #fff;
    border: 1px solid #555;
}

.vendas-filtro-field select option {
    background-color: #1e1e1e;
    color: #fff;
}

.vendas-filtro-field-wide {
    grid-column: span 2;
}

@media (max-width: 640px) {
    .vendas-filtro-field-wide {
        grid-column: span 1;
    }
}

.vendas-filtros-acoes {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    padding-top: 4px;
}

.vendas-btn-filtrar {
    background-color: #15a0a5 !important;
    color: #fff !important;
    border: none;
    padding: 8px 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.vendas-btn-limpar {
    background-color: #333 !important;
    color: #ddd !important;
    border: 1px solid #555;
    padding: 8px 14px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.88rem;
}

.vendas-filtros-contagem {
    margin-left: auto;
    font-size: 0.82rem;
    color: #888;
}

@media (max-width: 640px) {
    .vendas-filtros-contagem {
        margin-left: 0;
        width: 100%;
    }
}

.check-container label {
    margin: 0;
    cursor: pointer;
}

@media (max-height: 800px) {
    .pdv-page {
        height: calc(100vh - 58px);
        max-height: calc(100vh - 58px);
    }

    .pdv-page .card {
        padding: 8px;
    }

    .pdv-compact input,
    .pdv-compact select {
        padding: 5px 7px;
        margin-bottom: 4px;
    }

    .pdv-page .total-display {
        font-size: clamp(1.2rem, 2vw, 1.6rem);
    }

    .btn-finalizar-venda {
        padding: 8px 14px !important;
        font-size: 0.82rem !important;
    }
}

/* Notebooks e telas médias — mantém 2 colunas alinhadas */
@media (max-width: 1400px) {
    .content:has(.pdv-page) {
        padding: 8px 10px;
    }

    .pdv-page .pdv-container {
        gap: 6px;
    }

    .pdv-row-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pdv-row-3 .pdv-field:first-child {
        grid-column: 1 / -1;
    }

    .pdv-footer-field {
        min-width: 95px;
        max-width: 145px;
    }

    .pdv-footer-checks .check-container label {
        font-size: 0.7rem;
    }
}

@media (max-width: 1200px) {
    .pdv-compact h3 {
        font-size: 0.85rem;
    }

    .pdv-footer-bar {
        gap: 8px;
        padding: 8px 10px !important;
    }

    .pdv-footer-checkout {
        gap: 8px;
    }

    .btn-finalizar-venda {
        padding: 8px 12px !important;
        font-size: 0.8rem !important;
    }
}

/* Mobile estreito — só aqui empilha colunas */
@media (max-width: 768px) {
    .pdv-page {
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .pdv-page .pdv-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(220px, 40vh);
        overflow: visible;
    }

    .painel-esquerdo {
        grid-column: 1;
    }

    .painel-direito {
        grid-column: 1;
    }

    .pdv-row-3 {
        grid-template-columns: 1fr;
    }

    .pdv-row-3 .pdv-field:first-child {
        grid-column: auto;
    }

    .pdv-footer-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .pdv-footer-checkout {
        width: 100%;
        justify-content: space-between;
    }
}

/* Compatibilidade com classes antigas (outras telas) */
.pdv-container .card { margin-bottom: 0 !important; }
.row-flex { display: flex; gap: 10px; }
.col-flex { flex: 1; min-width: 0; }

.total-display {
    text-align: right;
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent, #15a0a5);
    margin: 10px 0;
}

.btn-remove {
    background: none;
    border: none;
    color: #cf6679;
    cursor: pointer;
    padding: 0;
    width: auto;
    font-weight: bold;
}

/* --- CORREÇÃO DO DASHBOARD (Linha extra) --- */
.card-body hr { display: none !important; border: none !important; margin: 0 !important; }
.card-body .border-top { border-top: none !important; }


/* ==========================================================================
   TELA DE LOGIN - CÓDIGO LIMPO E DEFINITIVO
   ========================================================================== */

/* 1. Imagem de fundo limpa na tag body */
body.login-page {
    background: url('../pc.png') no-repeat center center fixed !important;
    background-size: cover !important;
    width: 100vw;
    height: 100vh;
    overflow: hidden; 
}

/* 2. Centraliza tudo e força transparência total no container principal */
body.login-page .content {
    margin-left: 0 !important;
    width: 100% !important;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* 3. MATA A TARJA FANTASMA: Torna qualquer div que envolva o card 100% transparente */
body.login-page .content > div {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

/* 4. Transforma o card de login em um "Vidro" para destacar a imagem no fundo */
body.login-page .card {
    background: rgba(20, 20, 20, 0.6) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.6) !important;
    width: 100%;
    min-width: 350px;
}