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

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --success-dark: #15803d;
    --danger: #dc2626;
    --warning: #f59e0b;
    --dark: #1e293b;
    --gray: #64748b;
    --light: #f8fafc;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    /* SPARK Tech Theme */
    --spark-green: #10b981;
    --spark-green-dark: #059669;
    --spark-green-light: #34d399;
    --spark-gold: #f59e0b;
    --spark-gold-light: #fbbf24;
    --spark-dark: #0f172a;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
}

/* Header - Fixo no topo, ultra compacto */
.header {
    background: linear-gradient(100deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 0.5rem 1.5rem; /* Reduzido ao mínimo */
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: box-shadow 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    height: auto;
    min-height: 50px;
}

/* Sombra extra quando scrolled */
.header.is-scrolled {
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0; /* Não encolhe */
}

.brand-icon {
    font-size: 2.5rem;
}

.brand h1 {
    font-size: 1.25rem; /* Reduzido */
    font-weight: 700;
    line-height: 1.2;
}

.brand-subtitle {
    opacity: 0.9;
    font-size: 0.75rem; /* Reduzido */
    line-height: 1.2;
}

/* Navigation - na mesma linha do logo */
.main-nav {
    display: flex;
    gap: 0.35rem; /* Reduzido */
    flex-wrap: wrap;
    justify-content: flex-end;
    flex: 1;
    max-width: 550px;
}

.nav-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 0.4rem 0.75rem; /* Compacto */
    border-radius: 0.4rem;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.3);
}

.nav-btn.active {
    background: white;
    color: var(--primary);
}

/* Main Content - Padding para não ficar escondido atrás do header */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 2rem; /* Reduzido topo */
    min-height: calc(100vh - 120px); /* Ajustado para header ultra compacto */
}

/* Garante que o conteúdo tenha espaço após o header sticky */
body {
    scroll-padding-top: 80px; /* Ajustado para header ultra compacto */
}

/* Pages */
.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-header h2 {
    font-size: 1.5rem;
    color: var(--dark);
}

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

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

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

.btn-secondary {
    background: var(--gray);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: var(--success-dark);
}

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

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Filtros */
.filtros {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border);
    background: white;
    border-radius: 2rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Grid de Estoque */
.estoque-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.item-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
    transition: transform 0.2s, box-shadow 0.2s;
}

.item-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.item-card.estoque-baixo {
    border-left-color: var(--danger);
}

.item-card.estoque-medio {
    border-left-color: var(--warning);
}

.item-card.estoque-ok {
    border-left-color: var(--success);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.75rem;
}

.item-categoria {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--gray);
    font-weight: 600;
}

.item-actions {
    display: flex;
    gap: 0.25rem;
}

.btn-icon {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--light);
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--border);
}

.item-nome {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.item-info {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.info-label {
    color: var(--gray);
}

.info-value {
    font-weight: 600;
}

.estoque-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.estoque-badge.baixo {
    background: #fee2e2;
    color: var(--danger);
}

.estoque-badge.medio {
    background: #fef3c7;
    color: #b45309;
}

.estoque-badge.ok {
    background: #dcfce7;
    color: var(--success);
}

/* Produção */
.producao-card {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.produto-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.produto-icon {
    font-size: 3rem;
}

.estoque-atual {
    text-align: right;
}

.estoque-atual span {
    opacity: 0.9;
    font-size: 0.9rem;
}

.estoque-atual strong {
    display: block;
    font-size: 1.5rem;
}

.section-title {
    margin: 1.5rem 0 1rem;
    font-size: 1.1rem;
    color: var(--gray);
}

.insumos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.insumo-card {
    background: white;
    padding: 1rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    text-align: center;
}

.insumo-card.disponivel {
    border-top: 3px solid var(--success);
}

.insumo-card.indisponivel {
    border-top: 3px solid var(--danger);
    opacity: 0.7;
}

.insumo-numero {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.insumo-nome {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.insumo-qtd {
    font-size: 0.85rem;
    color: var(--gray);
}

.producao-actions {
    margin-top: 2rem;
    text-align: center;
}

.historico-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.historico-item {
    background: white;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.historico-item.cancelado {
    background: #f3f4f6;
    border: 1px dashed var(--gray);
    opacity: 0.7;
}

.historico-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.historico-data {
    font-weight: 600;
}

.historico-qtd {
    background: var(--success);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.9rem;
}

.historico-item.cancelado .historico-qtd {
    background: var(--gray);
    text-decoration: line-through;
}

.historico-cancelamento {
    font-size: 0.8rem;
    color: var(--danger);
    font-style: italic;
}

.badge-cancelado {
    background: var(--danger);
    color: white;
    padding: 0.35rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.btn-estorno {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    color: #92400e;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-estorno:hover {
    background: #f59e0b;
    color: white;
}

/* Caderneta/Créditos */
.creditos-resumo {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.resumo-card {
    background: white;
    padding: 1.25rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    text-align: center;
}

.resumo-card span {
    display: block;
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.resumo-card strong {
    font-size: 1.75rem;
    color: var(--dark);
}

.clientes-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cliente-card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    overflow: hidden;
}

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

.cliente-info h4 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.cliente-contato {
    font-size: 0.85rem;
    color: var(--gray);
}

.saldo-badge {
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 1rem;
}

.saldo-badge.devedor {
    background: #fee2e2;
    color: var(--danger);
}

.saldo-badge.credor {
    background: #dcfce7;
    color: var(--success);
}

.cliente-actions {
    padding: 0.75rem 1.25rem;
    background: var(--light);
    display: flex;
    gap: 0.5rem;
}

.lancamentos-list {
    padding: 0.75rem 1.25rem;
    background: var(--light);
    max-height: 200px;
    overflow-y: auto;
}

.lancamento-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

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

.lancamento-desc {
    color: var(--dark);
}

.lancamento-tipo {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 1rem;
    margin-right: 0.5rem;
}

.lancamento-tipo.venda {
    background: #fee2e2;
    color: var(--danger);
}

.lancamento-tipo.pagamento {
    background: #dcfce7;
    color: var(--success);
}

.lancamento-tipo.troca {
    background: #dbeafe;
    color: var(--primary);
}

.lancamento-valor {
    font-weight: 600;
}

/* Precificação */
.precificacao-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.precificacao-card h3 {
    margin-bottom: 1rem;
    color: var(--dark);
}

.formula {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.formula-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--light);
    border-radius: 0.5rem;
}

.formula-item.highlight {
    background: var(--success);
    color: white;
    font-weight: 600;
}

.formula-item span:first-child {
    flex: 1;
}

.calculadora {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    max-width: 500px;
}

.calculadora h3 {
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--gray);
    margin-top: 0.25rem;
    font-style: italic;
}

#item-unidade-nivel {
    font-size: 1rem;
}

#item-frete-proporcional {
    background-color: #f3f4f6;
    cursor: not-allowed;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--gray);
    font-size: 0.8rem;
}

.resultado {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border);
}

.resultado-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
}

.resultado-item.highlight {
    padding: 0.75rem 0;
    margin-top: 0.5rem;
    border-top: 2px dashed var(--border);
    font-size: 1.1rem;
}

.resultado-item.highlight strong {
    color: var(--success);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1100; /* Acima do header sticky (1000) */
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.modal-header h3 {
    font-size: 1.2rem;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.btn-close:hover {
    background: var(--light);
    color: var(--dark);
}

.modal form {
    padding: 1.25rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--gray);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Vendas e Carrinho */
.vendas-layout {
    display: grid;
    grid-template-columns: 1fr 270px;
    gap: 1.5rem;
}

.vendas-produtos {
    min-width: 0;
}

.vendas-carrinho {
    background: white;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    padding: 1rem;
    width: 270px; /* LARGURA FIXA - não oscila */
    flex: 0 0 270px; /* Não cresce, não encolhe, base 270px */
    height: calc(100vh - 90px); /* MAXIMIZADO - header compacto liberou espaço */
    max-height: calc(100vh - 90px);
    min-height: 350px;
    position: sticky;
    top: 55px; /* Colado no header ultra compacto (~50px + gap) */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Previne overflow externo */
}

.carrinho-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.carrinho-header h3 {
    font-size: 1rem;
}

.carrinho-itens {
    flex: 1; /* Ocupa todo espaço disponível */
    overflow-y: auto; /* Scroll quando necessário */
    min-height: 80px; /* Mínimo reduzido */
    margin-bottom: 0.75rem;
    padding-right: 0.5rem; /* Espaço para scrollbar */
}

/* Estilização da scrollbar */
.carrinho-itens::-webkit-scrollbar {
    width: 6px;
}

.carrinho-itens::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.carrinho-itens::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.carrinho-vazio {
    text-align: center;
    padding: 2rem;
    color: var(--gray);
}

.carrinho-vazio span {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.5rem;
}

.carrinho-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    gap: 0.5rem;
}

.carrinho-item-info {
    flex: 1;
    min-width: 0;
}

.carrinho-item-nome {
    font-weight: 500;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px; /* Limita largura para ellipsis funcionar */
}

.carrinho-item-preco {
    font-size: 0.75rem;
    color: var(--gray);
}

.carrinho-item-qtd {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0 0.25rem;
}

.carrinho-item-qtd button {
    width: 20px;
    height: 20px;
    border: none;
    background: var(--light);
    border-radius: 0.2rem;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carrinho-item-qtd button:hover {
    background: var(--border);
}

.carrinho-item-qtd span {
    min-width: 18px;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
}

.carrinho-item-total {
    font-weight: 600;
    color: var(--dark);
    min-width: 55px;
    text-align: right;
    font-size: 0.85rem;
}

.carrinho-item-remover {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    margin-left: 0.25rem;
    opacity: 0.6;
    transition: opacity 0.2s;
    padding: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carrinho-item-remover:hover {
    opacity: 1;
}

.carrinho-totais {
    border-top: 2px solid var(--border);
    padding-top: 0.75rem;
    margin-bottom: 0.75rem;
    flex-shrink: 0; /* NÃO ENCOLHE - sempre visível */
    background: white; /* Fundo sólido */
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    font-size: 0.85rem;
}

.total-row.destaque {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--success);
    border-top: 2px dashed var(--border);
    margin-top: 0.4rem;
    padding-top: 0.6rem;
}

.carrinho-acoes {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex-shrink: 0; /* NÃO ENCOLHE - botões sempre visíveis */
    margin-top: auto; /* Empurra para o final */
}

.carrinho-acoes .btn {
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

/* Grid de Produtos para Venda */
.produtos-venda-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.produtos-venda-grid .produto-venda-card {
    max-width: 280px; /* Limita largura máxima dos cards */
}

.produto-venda-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.produto-venda-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.produto-venda-categoria {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--gray);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.produto-venda-nome {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    flex: 1;
}

.produto-venda-estoque {
    font-size: 0.8rem;
    color: var(--gray);
    margin-bottom: 0.75rem;
}

.produto-venda-preco {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.produto-venda-add {
    width: 100%;
    padding: 0.6rem;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s;
}

.produto-venda-add:hover {
    background: var(--success-dark);
}

.produto-venda-add:disabled {
    background: var(--gray);
    cursor: not-allowed;
}

/* Modal Nota */
.modal-large {
    max-width: 500px;
}

.lancamentos-list {
    margin-top: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    display: none;
}

.lancamentos-list.lancamentos-visible {
    display: block;
}

.lancamentos-empty {
    text-align: center;
    color: var(--gray);
}

.nota-conteudo {
    padding: 1rem;
    background: var(--light);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.nota-header {
    text-align: center;
    border-bottom: 2px dashed var(--border);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.nota-header h2 {
    font-size: 1.3rem;
    margin-bottom: 0.25rem;
}

.nota-header p {
    font-size: 0.85rem;
    color: var(--gray);
}

.nota-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    color: var(--gray);
}

.nota-cliente {
    background: white;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.nota-cliente strong {
    display: block;
    margin-bottom: 0.25rem;
}

.nota-itens {
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 1rem;
}

.nota-item {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

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

.nota-item-info {
    flex: 1;
}

.nota-item-nome {
    font-weight: 500;
}

.nota-item-qtd {
    font-size: 0.8rem;
    color: var(--gray);
}

.nota-item-preco {
    font-weight: 600;
    min-width: 80px;
    text-align: right;
}

.nota-totais {
    border-top: 2px solid var(--dark);
    padding-top: 0.75rem;
}

.nota-total-row {
    display: flex;
    justify-content: space-between;
    padding: 0.35rem 0;
    font-size: 0.95rem;
}

.nota-total-final {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--success);
    border-top: 1px dashed var(--border);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
}

.nota-rodape {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border);
    font-size: 0.9rem;
    color: var(--gray);
}

.nota-cliente-contato {
    font-size: 0.9rem;
    color: var(--gray);
    margin-top: 0.25rem;
}

.nota-caderneta-badge {
    display: inline-block;
    margin-top: 0.25rem;
    color: var(--danger);
    font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: 0.75rem 1rem;
        z-index: 1001;
        flex-wrap: wrap; /* Permite quebrar linha se necessário */
        gap: 0.75rem;
    }
    
    .header.is-scrolled {
        box-shadow: 0 4px 15px rgba(0,0,0,0.35);
    }
    
    .brand h1 {
        font-size: 1.2rem;
    }
    
    .brand-subtitle {
        font-size: 0.75rem;
    }
    
    .main-nav {
        gap: 0.25rem;
        max-width: none; /* Remove limite em mobile */
    }
    
    .nav-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .main-content {
        padding: 1rem;
        min-height: calc(100vh - 110px); /* Ajustado para header ultra compacto em mobile */
    }
    
    .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .producao-card {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .estoque-atual {
        text-align: center;
    }

    .vendas-layout {
        grid-template-columns: 1fr;
    }

    .vendas-carrinho {
        position: static;
    }

    .produtos-venda-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .modal-large {
        max-width: 100%;
    }
}

/* Estoque Badge - Nível Crítico */
.estoque-badge.critico {
    background: var(--danger);
    color: white;
    font-weight: 700;
    animation: pulse 1.5s infinite;
}

.item-card.estoque-critico {
    border: 2px solid var(--danger);
    background: #fef2f2;
}

.text-critico {
    color: var(--danger);
    font-weight: 700;
}

/* ===== PAINEL DE ALERTAS DE ESTOQUE ===== */
.painel-alertas {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: white;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-lg);
    animation: slideDown 0.3s ease;
}

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

.alertas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.3);
}

.alertas-titulo {
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alertas-contador {
    background: rgba(255,255,255,0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
}

.alertas-lista {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.alerta-item {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.alerta-item:hover {
    background: rgba(255,255,255,0.15);
    transform: translateX(4px);
}

.alerta-item.visto {
    opacity: 0.7;
    border-left: 3px solid #fbbf24;
}

.alerta-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.alerta-categoria {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
    background: rgba(255,255,255,0.2);
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    display: inline-block;
    width: fit-content;
}

.alerta-nome {
    font-weight: 600;
    font-size: 1rem;
}

.alerta-qtd {
    font-size: 0.875rem;
    opacity: 0.9;
    color: #fca5a5;
}

.alerta-acoes {
    display: flex;
    gap: 0.5rem;
}

.btn-alerta {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 1.125rem;
}

.btn-alerta:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
}

.btn-visto:hover {
    background: #fbbf24;
    color: #92400e;
}

.btn-resolver:hover {
    background: #22c55e;
    color: #14532d;
}

/* Container para posicionamento do badge crítico */
.has-critico-badge {
    position: relative;
}

/* Badge de estoque crítico nos cards */
.estoque-critico-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ===== SPARK TECH IDENTITY - Verde e Dourado ===== */
:root {
    --spark-green: #10b981;
    --spark-green-dark: #059669;
    --spark-gold: #f59e0b;
    --spark-gold-light: #fbbf24;
    --spark-dark: #0f172a;
    --spark-dark-light: #1e293b;
}

/* Aplicar tema escuro opcional */
body.spark-theme {
    background: var(--spark-dark);
    color: #e2e8f0;
}

body.spark-theme .header {
    background: linear-gradient(135deg, var(--spark-green) 0%, var(--spark-green-dark) 100%);
}

body.spark-theme .btn-primary {
    background: var(--spark-green);
}

body.spark-theme .btn-primary:hover {
    background: var(--spark-green-dark);
}

body.spark-theme .total-card,
body.spark-theme .resumo-card,
body.spark-theme .cat-card {
    background: var(--spark-dark-light);
    border: 1px solid var(--spark-green);
}

/* ===== CARDS DE CATEGORIAS VISUAIS ===== */
.categorias-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.cat-card {
    background: white;
    border: 2px solid var(--border);
    border-radius: 1rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
}

.cat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.cat-card.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.cat-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.cat-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.cat-nome {
    font-weight: 600;
    font-size: 0.95rem;
}

.cat-qtd {
    font-size: 0.8rem;
    color: var(--gray);
}

.cat-card.active .cat-qtd {
    color: rgba(255,255,255,0.8);
}

/* Card Bebidas Destaque */
.cat-bebidas {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: var(--spark-gold);
    border-width: 3px;
}

.cat-bebidas:hover {
    border-color: var(--spark-gold-light);
    box-shadow: 0 10px 25px -5px rgba(245, 158, 11, 0.3);
}

.cat-bebidas.active {
    background: linear-gradient(135deg, var(--spark-gold) 0%, var(--spark-gold-light) 100%);
    color: var(--spark-dark);
}

.cat-badge {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: var(--spark-green);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== ETIQUETAS DE TAMANHO BEBIDAS ===== */
.bebida-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Lata - Azul metálico */
.bebida-tag-lata {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    color: #0369a1;
    border: 1px solid #7dd3fc;
}

/* Pet - Verde refrescante */
.bebida-tag-pet {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #047857;
    border: 1px solid #6ee7b7;
}

/* Galão - Dourado premium */
.bebida-tag-galao {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid var(--spark-gold);
}

/* Caçulinha - Rosa divertido */
.bebida-tag-caculinha {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
    color: #be185d;
    border: 1px solid #f9a8d4;
}

/* Long Neck - Roxo elegante */
.bebida-tag-longneck {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    color: #5b21b6;
    border: 1px solid #c4b5fd;
}

/* Garrafa - Âmbar clássico */
.bebida-tag-garrafa {
    background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
    color: #9a3412;
    border: 1px solid #fdba74;
}

/* Fardo - Verde SPARK */
.bebida-tag-fardo {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 2px solid var(--spark-green);
    font-weight: 700;
}

/* ===== PÁGINA DE REPOSIÇÃO ===== */
.reposicao-card {
    background: white;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.reposicao-info {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid var(--border);
}

.reposicao-info strong {
    color: var(--dark);
}

/* ===== TABELA LISTA DE REPOSIÇÃO ===== */
.table-reposicao {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 1rem;
}

.table-reposicao thead th {
    background: var(--spark-green);
    color: white;
    padding: 14px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
}

.table-reposicao thead th:first-child {
    border-radius: 8px 0 0 0;
}

.table-reposicao thead th:last-child {
    border-radius: 0 8px 0 0;
    text-align: center;
}

.table-reposicao tbody tr {
    transition: background 0.2s ease;
}

.table-reposicao tbody tr:hover {
    background: #f0fdf4;
}

.table-reposicao tbody td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

.table-reposicao tbody td:first-child {
    font-weight: 500;
    color: var(--dark);
}

.table-reposicao tbody td:last-child {
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--spark-green);
}

/* Barra de relatórios */
.relatorios-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ===== RESPONSIVIDADE PARA DISPOSITIVOS MÓVEIS ===== */
@media (max-width: 768px) {
    .header {
        padding: 0.75rem 1rem;
    }
    
    .brand h1 {
        font-size: 1.2rem;
    }
    
    .main-nav {
        gap: 0.25rem;
        padding: 0 0.5rem;
    }
    
    .nav-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .categorias-dashboard {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .cat-card {
        padding: 0.75rem;
    }
    
    .cat-icon {
        font-size: 1.5rem;
    }
    
    .cat-nome {
        font-size: 0.85rem;
    }
    
    .filtros {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
        flex: 1;
        min-width: 100px;
    }
    
    .modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }
    
    /* Tabela de reposição em mobile */
    .table-reposicao tbody td {
        padding: 12px 8px;
        font-size: 0.9rem;
    }
    
    .table-reposicao tbody td:last-child {
        font-size: 1rem;
    }
    
    .relatorios-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .relatorios-bar span {
        text-align: center;
        font-size: 0.85rem;
    }
    
    .vendas-layout {
        grid-template-columns: 1fr;
    }
    
    .vendas-carrinho {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%; /* Mobile: largura total */
        flex: none;
        height: 55vh; /* Altura fixa em mobile */
        max-height: 450px;
        min-height: 300px;
        z-index: 900; /* Abaixo do header (1000) mas acima do conteúdo */
        border-radius: 1rem 1rem 0 0;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
        display: flex;
        flex-direction: column;
        top: auto; /* Remove sticky em mobile */
    }
    
    .form-row {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .estoque-grid,
    .produtos-venda-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .cliente-card {
        padding: 1rem;
    }
    
    .calculadora {
        margin-top: 1rem;
    }
}

@media (max-width: 480px) {
    .categorias-dashboard {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cat-card {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .estoque-grid,
    .produtos-venda-grid {
        grid-template-columns: 1fr;
    }
    
    .produto-card {
        padding: 0.75rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* Tablet - Modo paisagem */
@media (min-width: 769px) and (max-width: 1024px) {
    .categorias-dashboard {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .vendas-layout {
        grid-template-columns: 2fr 1fr;
    }
}

/* ===== DATA-ATTRIBUTES PARA BEBIDAS ===== */
[data-tipo-bebida] {
    font-size: 0.95rem;
}

[data-tipo-bebida] option {
    padding: 0.5rem;
}

[data-frete-calculado] {
    background: #f0fdf4 !important;
    border-color: var(--spark-green) !important;
    color: var(--spark-green-dark) !important;
    font-weight: 600;
}

[data-unidades-embalagem] {
    background: #fffbeb;
    border-color: var(--spark-gold);
}

/* ===== ESTOQUE BEBIDAS - INDICADORES VISUAIS ===== */
.estoque-card[data-categoria="bebidas"] {
    border-left: 4px solid var(--spark-gold);
}

.estoque-card[data-nivel="fardo"] {
    border-left-width: 6px;
    border-left-color: var(--spark-green);
}

.estoque-card[data-nivel="grande"] {
    border-left-color: #8b5cf6;
}

.estoque-card[data-nivel="medio"] {
    border-left-color: #06b6d4;
}

.estoque-card[data-nivel="tamanho"] {
    border-left-color: #f59e0b;
}

.estoque-card[data-nivel="caçulinha"] {
    border-left-color: #ec4899;
}

/* ============================================
   SCANNER DE CÓDIGO DE BARRAS
   ============================================ */

/* Modal do Scanner */
.modal-scanner-content {
    max-width: 500px;
    width: 100%;
}

.scanner-body {
    padding: 1rem;
}

#scanner-container {
    width: 100%;
    min-height: 300px;
    background: #000;
    border-radius: 0.75rem;
    overflow: hidden;
    margin-bottom: 1rem;
    position: relative;
}

#reader {
    width: 100%;
    min-height: 300px;
}

#reader video {
    width: 100% !important;
    height: auto !important;
    border-radius: 0.5rem;
}

/* Esconde elementos desnecessários do html5-qrcode */
#reader__dashboard_section_csr span,
#reader__dashboard_section_swaplink {
    display: none !important;
}

#reader__dashboard_section_csr {
    padding: 0.5rem !important;
}

.scanner-manual {
    padding: 0.75rem;
    background: var(--light);
    border-radius: 0.5rem;
    border: 1px solid var(--border);
}

.scanner-hint {
    margin: 0 0 0.5rem 0;
    font-size: 0.85rem;
    color: var(--gray);
}

.scanner-status {
    margin-top: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    text-align: center;
    font-size: 0.9rem;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scanner-status.sucesso {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.scanner-status.erro {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.scanner-status.scanning {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* Animação de scan */
@keyframes scanLine {
    0% { top: 0; }
    50% { top: 100%; }
    100% { top: 0; }
}

.scanner-linha {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--spark-green), transparent);
    animation: scanLine 2s ease-in-out infinite;
    z-index: 10;
}

/* Responsividade Mobile para Scanner */
@media (max-width: 768px) {
    .modal-scanner-content {
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }

    #scanner-container {
        min-height: 50vh;
        flex: 1;
    }

    #reader {
        min-height: 50vh;
    }

    .scanner-manual {
        padding: 1rem;
    }

    .scanner-manual input {
        font-size: 16px; /* Previne zoom no iOS */
    }

    .scanner-status {
        font-size: 1rem;
        padding: 1rem;
    }
}

/* Modo paisagem mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .modal-scanner-content {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .scanner-body {
        display: flex;
        gap: 1rem;
        flex: 1;
    }

    #scanner-container {
        flex: 2;
        min-height: 200px;
    }

    .scanner-manual {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}

/* Feedback visual ao escanear */
.scanner-feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 1.5rem 2rem;
    border-radius: 1rem;
    font-size: 1.2rem;
    z-index: 9999;
    animation: scannerFeedback 0.3s ease;
    text-align: center;
}

@keyframes scannerFeedback {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.scanner-feedback.sucesso {
    background: rgba(16, 185, 129, 0.95);
}

.scanner-feedback.erro {
    background: rgba(220, 38, 38, 0.95);
}

/* ============================================
   SCANNER REMOTO - PAINEL DO PDV (Kahoot-style)
   ============================================ */

.remote-scanner-panel {
    background: linear-gradient(135deg, var(--dark) 0%, #0f172a 100%);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    color: white;
    box-shadow: var(--shadow-lg);
}

.scanner-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 1rem;
}

.scanner-panel-header h3 {
    font-size: 1.3rem;
    margin: 0;
}

.scanner-panel-header .btn-close {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scanner-panel-content {
    text-align: center;
}

.scanner-panel-desc {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

/* Display do PIN */
.pin-display-container {
    background: rgba(255,255,255,0.1);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.pin-label {
    font-size: 1rem;
    opacity: 0.8;
    margin-bottom: 1rem;
}

.pin-display {
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: 1rem;
    font-family: 'Courier New', monospace;
    color: var(--spark-green);
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
    margin-bottom: 1rem;
    animation: pulse-pin 2s infinite;
}

@keyframes pulse-pin {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.pin-url {
    font-size: 0.9rem;
    opacity: 0.8;
}

.pin-url strong {
    color: var(--spark-green-light);
    word-break: break-all;
}

/* Status do PDV */
.scanner-status-pdv {
    background: rgba(255,255,255,0.05);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.status-indicator-pdv {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.status-dot-pdv {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--warning);
    animation: pulse-dot 2s infinite;
}

.status-dot-pdv.connected {
    background: var(--success);
    animation: none;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.1); }
}

.device-info {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    opacity: 0.8;
    color: var(--spark-green-light);
}

/* Códigos Recebidos */
.scanner-codigos-recebidos {
    background: rgba(0,0,0,0.3);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.scanner-codigos-recebidos h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    opacity: 0.9;
}

.codigos-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.codigo-recebido-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255,255,255,0.1);
    border-radius: 0.5rem;
    animation: slideInCode 0.3s ease;
}

@keyframes slideInCode {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.codigo-recebido-item.success {
    border-left: 3px solid var(--success);
}

.codigo-recebido-item.error {
    border-left: 3px solid var(--danger);
}

.codigo-recebido-item.pending {
    border-left: 3px solid var(--warning);
}

.codigo-valor {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 1rem;
}

.codigo-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    background: rgba(255,255,255,0.2);
}

.codigo-status.success {
    background: var(--success);
}

.codigo-status.error {
    background: var(--danger);
}

.empty-codigos {
    text-align: center;
    opacity: 0.6;
    font-style: italic;
    padding: 1rem;
}

/* Ações do Painel */
.scanner-panel-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

/* Responsividade */
@media (max-width: 768px) {
    .remote-scanner-panel {
        padding: 1rem;
    }

    .pin-display {
        font-size: 3rem;
        letter-spacing: 0.5rem;
    }

    .pin-display-container {
        padding: 1.5rem 1rem;
    }
}
