/* Reset e Configurações Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 0.5rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

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

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    padding: 4px;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.caixa-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: rgba(255,255,255,0.1);
    border-radius: 25px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-indicator.livre {
    background: #27ae60;
}

.status-indicator.ocupado {
    background: #e74c3c;
}

.status-indicator.fechado {
    background: #95a5a6;
}

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

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Navegação Principal */
.main-nav {
    background: #34495e;
    padding: 0 2rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.nav-menu {
    display: flex;
    list-style: none;
    max-width: 1400px;
    margin: 0 auto;
}

.nav-item {
    padding: 0.75rem 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #ecf0f1;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
}

.nav-item.active {
    background: rgba(255,255,255,0.15);
    border-bottom-color: #3498db;
    color: #3498db;
}

.nav-item i {
    font-size: 1.2rem;
}

/* Conteúdo Principal */
.main-content {
    flex: 1;
    padding: 0;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.page {
    display: none;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    padding: 1.5rem;
    margin-top: 1rem;
    min-height: 80vh;
}

.page.active {
    display: block;
}

/* Forçar PDV visível e outras ocultas */
#pdv {
    display: block !important;
}

#pdv.active {
    display: block !important;
}

/* Ocultar todas as outras páginas quando PDV estiver ativo */
body.pdv-mode .main-content section.page:not(#pdv) {
    display: none !important;
}

/* Permitir que outras páginas sejam mostradas quando navegadas do PDV */
body.pdv-mode .main-content section.page.active:not(#pdv) {
    display: block !important;
}

/* Ocultar PDV quando outra página está ativa no modo PDV */
body.pdv-mode .main-content section.page:not(.active)#pdv {
    display: none !important;
}

/* Ocultar seção de relatórios específica quando PDV estiver ativo */
body.pdv-mode #relatorios:not(.active) {
    display: none !important;
}

/* Mostrar relatórios quando estiver ativo mesmo no modo PDV */
body.pdv-mode #relatorios.active {
    display: block !important;
}

/* Ocultar header quando PDV estiver ativo */
body.pdv-mode .header {
    display: none;
}

/* Mostrar header quando sair do PDV para outras páginas */
body.pdv-mode:not(.pdv-mode) .header,
body:not(.pdv-mode) .header {
    display: block;
}

/* Manter navegação visível no modo PDV */
body.pdv-mode .main-nav {
    display: block;
}

/* Manter main-content visível no modo PDV */
body.pdv-mode .main-content {
    display: block;
}

/* Quando PDV está ativo, ajustar layout */
body.pdv-mode {
    background: #f8f9fa;
}

body.pdv-mode .main-content {
    padding: 0;
    margin: 0;
}

body.pdv-mode .page {
    margin: 0;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    min-height: 100vh;
}

/* Ajustes específicos para página de relatórios - Adicionar espaçamento adequado */
#relatorios {
    margin-top: 1rem;
    padding-top: 0;
}

#relatorios .relatorios-container {
    margin-top: 0;
    padding-top: 0.5rem;
}

/* Forçar relatórios a aparecer com espaçamento do menu */
#relatorios.active {
    display: block !important;
    margin-top: 1rem !important;
    padding-top: 0 !important;
}

/* Adicionar espaçamento controlado do main-content para relatórios */
.main-content #relatorios {
    margin: 1rem 0 0 0 !important;
    padding: 0 !important;
}

/* Ajustes específicos para todas as páginas - espaçamento consistente */
.page#pdv {
    margin-top: 1rem;
}

.page#orcamento {
    margin-top: 1rem;
}

.page#retaguarda {
    margin-top: 1rem;
}

.page#fiscal {
    margin-top: 1rem;
}

/* Forçar PDV a ter espaçamento mesmo no modo normal */
#pdv {
    margin-top: 1rem !important;
}

body.pdv-mode #sistema-container {
    height: 100vh;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 120px);
}

/* Ajustar layout do app container para incluir rodapé */
#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#sistema-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.pdv-mode .page {
    margin: 0;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    min-height: 100vh;
}

/* Ajuste específico para PDV ter espaçamento mesmo no modo PDV */
body.pdv-mode .page#pdv {
    margin: 1rem 0 0 0 !important;
    padding: 0 !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1) !important;
    min-height: calc(100vh - 5rem) !important;
}

/* Ocultar todas as outras páginas quando PDV estiver ativo */
body.pdv-mode .main-content .page:not(#pdv) {
    display: none !important;
}

/* Botão para sair do modo PDV */
.pdv-exit-btn {
    position: fixed;
    top: 5rem;
    right: 1rem;
    z-index: 1001;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.pdv-exit-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
}

/* PDV Styles */
.pdv-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    height: 100%;
}

.pdv-left, .pdv-right {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Search Container */
.search-container {
    margin-bottom: 1.5rem;
}

.search-input-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
}

.search-btn, .barcode-btn {
    padding: 1rem 1.5rem;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-btn:hover, .barcode-btn:hover {
    background: #2980b9;
}

.barcode-btn {
    background: #27ae60;
}

.barcode-btn:hover {
    background: #2ecc71;
}

/* Barcode Scanner */
.barcode-scanner {
    background: #f8f9fa;
    border: 2px solid #3498db;
    border-radius: 8px;
    margin-top: 1rem;
    overflow: hidden;
}

.scanner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #3498db;
    color: white;
}

.scanner-header h4 {
    margin: 0;
    font-size: 1rem;
}

.scanner-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.scanner-close:hover {
    background: rgba(255,255,255,0.2);
}

.scanner-content {
    padding: 1.5rem;
}

.barcode-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1.2rem;
    text-align: center;
    font-family: 'Courier New', monospace;
    margin-bottom: 1rem;
    transition: border-color 0.3s ease;
}

.barcode-input:focus {
    outline: none;
    border-color: #27ae60;
}

.scanner-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    font-size: 0.9rem;
}

.scanner-status i {
    font-size: 1.2rem;
    color: #3498db;
}

.scanner-status.success {
    color: #27ae60;
}

.scanner-status.success i {
    color: #27ae60;
}

.scanner-status.error {
    color: #e74c3c;
}

.scanner-status.error i {
    color: #e74c3c;
}

/* Botões de Atalho */
.botoes-atalho {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
}

.botoes-atalho h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.atalho-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.atalho-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.atalho-btn:hover {
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.atalho-btn i {
    font-size: 2rem;
    color: #3498db;
}

.atalho-btn span {
    font-size: 0.9rem;
    color: #333;
}

/* Produtos Encontrados */
.produtos-encontrados {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    flex: 1;
    overflow-y: auto;
}

.produtos-encontrados h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.produtos-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 400px; /* Altura máxima para mostrar aproximadamente 5 produtos */
    overflow-y: auto; /* Adiciona scroll vertical */
    padding-right: 10px; /* Espaço para a barra de scroll */
    position: relative; /* Para posicionamento do indicador */
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: white;
}

.produtos-list.scrollable::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.9), transparent);
    pointer-events: none;
    z-index: 1;
}

.produtos-list.scrollable::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(to top, rgba(255,255,255,0.9), transparent);
    pointer-events: none;
    z-index: 1;
}

.produtos-list::-webkit-scrollbar {
    width: 8px;
}

.produtos-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.produtos-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.produtos-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Indicador de scroll */
.scroll-indicator {
    text-align: center;
    padding: 0.5rem;
    border-top: 1px solid #e9ecef;
    margin-top: 0.5rem;
    animation: pulse 2s infinite;
}

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

.produto-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.produto-item:hover {
    border-color: #3498db;
    transform: translateX(5px);
}

.produto-info {
    flex: 1;
}

.produto-codigo {
    font-weight: 700;
    color: #2c3e50;
}

.produto-descricao {
    color: #666;
    font-size: 0.9rem;
}

.produto-preco {
    font-weight: 700;
    color: #27ae60;
    font-size: 1.1rem;
}

/* Carrinho */
.carrinho {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    flex: 1;
}

.carrinho h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.carrinho-items {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.carrinho-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

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

.carrinho-item-nome {
    font-weight: 500;
    color: #2c3e50;
}

.carrinho-item-quantidade {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantidade-btn {
    width: 25px;
    height: 25px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantidade-btn:hover {
    background: #3498db;
    color: white;
}

.carrinho-total {
    border-top: 2px solid #ddd;
    padding-top: 1rem;
}

.total-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.total-line.final {
    font-weight: 700;
    font-size: 1.2rem;
    color: #2c3e50;
    border-top: 1px solid #ddd;
    padding-top: 0.5rem;
}

/* Pagamento */
.pagamento {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
}

.pagamento h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.pagamento-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.pagamento-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagamento-btn:hover {
    border-color: #3498db;
    background: #3498db;
    color: white;
}

.pagamento-btn i {
    font-size: 1.5rem;
}

.finalizar-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.finalizar-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.3);
}

/* Cliente Info */
.cliente-info {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.cliente-input {
    flex: 1;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
}

.cliente-input:focus {
    outline: none;
    border-color: #3498db;
}

/* Tipo Venda */
.tipo-venda {
    margin-bottom: 1rem;
}

.tipo-venda label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.tipo-venda-buttons {
    display: flex;
    gap: 0.5rem;
}

.tipo-venda-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tipo-venda-btn:hover {
    border-color: #3498db;
}

.tipo-venda-btn.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.tipo-venda-btn i {
    font-size: 1.2rem;
}

/* Entrega Info */
.entrega-info {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Campos Fiscais */
.fiscais-info, .fiscais-orcamento {
    background: #f0f8ff;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    border-left: 4px solid #3498db;
}

.fiscais-info .total-line, .fiscais-orcamento .total-line {
    color: #2c3e50;
}

.fiscais-info .total-line span:last-child, 
.fiscais-orcamento .total-line span:last-child {
    font-weight: 600;
    color: #3498db;
}

/* Tipo Orçamento */
.tipo-orcamento {
    margin-bottom: 1rem;
}

.tipo-orcamento label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.tipo-orcamento-buttons {
    display: flex;
    gap: 0.5rem;
}

.tipo-orcamento-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tipo-orcamento-btn:hover {
    border-color: #3498db;
}

.tipo-orcamento-btn.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.tipo-orcamento-btn i {
    font-size: 1.2rem;
}

/* Origem Produtos */
.origem-produtos {
    margin-bottom: 1rem;
}

.origem-produtos label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

/* Orçamento Styles */
.orcamento-container {
    max-width: 1000px;
    margin: 0 auto;
}

.orcamento-form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.cliente-section, .veiculo-section, .servicos-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
}

.cliente-section h3, .veiculo-section h3, .servicos-section h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-input {
    flex: 1;
    min-width: 200px;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
}

.form-input:focus {
    outline: none;
    border-color: #3498db;
}

.servicos-list {
    margin-bottom: 1rem;
}

.servico-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.add-servico-btn {
    padding: 0.8rem 1.5rem;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.add-servico-btn:hover {
    background: #2980b9;
}

.orcamento-total {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
}

.orcamento-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.save-btn {
    background: #27ae60;
    color: white;
}

.save-btn:hover {
    background: #2ecc71;
}

.print-btn {
    background: #3498db;
    color: white;
}

.print-btn:hover {
    background: #2980b9;
}

.convert-btn {
    background: #f39c12;
    color: white;
}

.convert-btn:hover {
    background: #e67e22;
}

.cancel-btn {
    background: #e74c3c;
    color: white;
}

.cancel-btn:hover {
    background: #c0392b;
}

.export-btn {
    background: #9b59b6;
    color: white;
}

.export-btn:hover {
    background: #8e44ad;
}

/* Retaguarda Styles */
.retaguarda-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.retaguarda-nav {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
}

.retaguarda-menu {
    display: flex;
    list-style: none;
    gap: 1rem;
}

.retaguarda-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retaguarda-item:hover {
    border-color: #3498db;
}

.retaguarda-item.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.retaguarda-content {
    background: white;
    border-radius: 8px;
    padding: 2rem;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.cadastro-form {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

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

.data-table th,
.data-table td {
    padding: 0.8rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.data-table tr:hover {
    background: #f8f9fa;
}

/* Relatórios */
.relatorios-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.relatorio-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.relatorio-card h4 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.relatorio-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.info-label {
    color: #666;
}

.info-value {
    font-weight: 700;
    color: #2c3e50;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

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

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #ddd;
}

.modal-header h3 {
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.modal-close:hover {
    color: #e74c3c;
}

.modal-body {
    padding: 1.5rem;
}

#sugestao-texto {
    margin-bottom: 1rem;
    color: #666;
}

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

.sugestao-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.sugestao-info {
    flex: 1;
}

.sugestao-nome {
    font-weight: 500;
    color: #2c3e50;
}

.sugestao-preco {
    color: #27ae60;
    font-weight: 700;
}

.sugestao-checkbox {
    width: 20px;
    height: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid #ddd;
}

.modal-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.accept-btn {
    background: #27ae60;
    color: white;
}

.accept-btn:hover {
    background: #2ecc71;
}

.decline-btn {
    background: #e74c3c;
    color: white;
}

.decline-btn:hover {
    background: #c0392b;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .pdv-container {
        grid-template-columns: 1fr;
    }
    
    .atalho-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-menu {
        flex-wrap: wrap;
    }
    
    .nav-item {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }
    
    .retaguarda-menu {
        flex-wrap: wrap;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-input {
        min-width: 100%;
    }
    
    .pagamento-buttons {
        flex-direction: column;
    }
    
    .orcamento-actions {
        flex-direction: column;
    }
    
    .relatorios-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 1rem;
    }
    
    .page {
        padding: 1rem;
    }
    
    .atalho-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .header-info {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* Animações e Transições */
.fade-in {
    animation: fadeIn 0.5s ease;
}

.slide-up {
    animation: slideUp 0.5s ease;
}

.pulse {
    animation: pulse 2s infinite;
}

/* Estados de Loading */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #3498db;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Tooltips */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.tooltip:hover::after {
    opacity: 1;
}

/* Modal Cupom */
.print-btn {
    background: #9b59b6 !important;
    color: white !important;
}

.print-btn:hover {
    background: #8e44ad !important;
}

.cupom-preview {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    max-height: 300px;
    overflow-y: auto;
}

.cupom-header {
    text-align: center;
    border-bottom: 2px dashed #333;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

.cupom-header h4 {
    margin: 0;
    font-size: 1rem;
}

.cupom-info {
    margin-bottom: 0.5rem;
}

.cupom-items {
    margin: 0.5rem 0;
}

.cupom-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.3rem;
}

.cupom-totals {
    border-top: 1px dashed #333;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
}

.cupom-total-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.2rem;
}

.cupom-total-line.final {
    font-weight: bold;
    border-top: 1px solid #333;
    padding-top: 0.2rem;
}

.cupom-fiscais {
    font-size: 0.7rem;
    color: #666;
    margin-top: 0.5rem;
}

.cupom-footer {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.7rem;
    color: #666;
}

/* Scrollbar Custom */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Estilos da Interface Fiscal */
.fiscal-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.fiscal-header {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.fiscal-header h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    text-align: center;
}

.fiscal-tabs {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.fiscal-tab {
    padding: 0.75rem 1.5rem;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #6c757d;
}

.fiscal-tab:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.fiscal-tab.active {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.fiscal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
}

.fiscal-tab-content {
    display: none;
    padding: 2rem;
}

.fiscal-tab-content.active {
    display: block;
}

.fiscal-section {
    margin-bottom: 2rem;
}

.fiscal-section:last-child {
    margin-bottom: 0;
}

.fiscal-section h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.form-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.form-input {
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
}

.action-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.action-btn.save-btn {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
}

.action-btn.save-btn:hover {
    background: linear-gradient(135deg, #229954, #1e8449);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.action-btn.cancel-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.action-btn.cancel-btn:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.action-btn.test-btn {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
}

.action-btn.test-btn:hover {
    background: linear-gradient(135deg, #e67e22, #d35400);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3);
}

.action-btn.export-btn {
    background: linear-gradient(135deg, #8e44ad, #7d3c98);
    color: white;
}

.action-btn.export-btn:hover {
    background: linear-gradient(135deg, #7d3c98, #6c3483);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(142, 68, 173, 0.3);
}

/* Certificado Status */
.certificado-status {
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.certificado-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.certificado-status.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.certificado-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* SEFAZ Status */
.sefaz-status {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.status-item i {
    color: #3498db;
    font-size: 1.2rem;
}

.status-text {
    font-weight: 500;
    color: #2c3e50;
}

.status-text.success {
    color: #27ae60;
}

.status-text.error {
    color: #e74c3c;
}

.status-text.warning {
    color: #f39c12;
}

/* Operações Grid */
.operacoes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.operacao-btn {
    padding: 1rem;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.operacao-btn:hover {
    background: linear-gradient(135deg, #2980b9, #1f618d);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.operacao-btn i {
    font-size: 1.5rem;
}

/* Sequência de Documentos */
.sequencia-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sequencia-item label {
    font-weight: 500;
    color: #2c3e50;
    font-size: 0.9rem;
}

.sequencia-item input {
    max-width: 200px;
}

/* Responsividade */
@media (max-width: 768px) {
    .fiscal-container {
        padding: 1rem;
    }
    
    .fiscal-header {
        padding: 1.5rem;
    }
    
    .fiscal-header h2 {
        font-size: 1.5rem;
    }
    
    .fiscal-tabs {
        flex-direction: column;
    }
    
    .fiscal-tab {
        text-align: center;
    }
    
    .fiscal-tab-content {
        padding: 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .operacoes-grid {
        grid-template-columns: 1fr;
    }
    
    .status-item {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
}

@media (max-width: 480px) {
    .fiscal-container {
        padding: 0.5rem;
    }
    
    .fiscal-header {
        padding: 1rem;
    }
    
    .fiscal-tab-content {
        padding: 1rem;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fiscal-tab-content.active {
    animation: fadeIn 0.3s ease;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Tooltips */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.tooltip:hover::after {
    opacity: 1;
}

/* Estilos para Campos de CEP */
.cep-input {
    position: relative;
}

.cep-input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.cep-input.loading {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10" fill="none" stroke="%233498db" stroke-width="2"><animate attributeName="stroke-dasharray" values="0 100;50 0;0 100" dur="2s" repeatCount="indefinite"/></circle></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
    padding-right: 40px;
}

/* Indicador de CEP válido/inválido */
.cep-input.valid {
    border-color: #27ae60;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="%2327ae60"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
    padding-right: 40px;
}

.cep-input.invalid {
    border-color: #e74c3c;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="%23e74c3c"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
    padding-right: 40px;
}

/* Campos de endereço desabilitados durante busca */
.form-input:disabled {
    background-color: #f8f9fa !important;
    color: #6c757d !important;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Mensagem de feedback do CEP */
.cep-feedback {
    font-size: 0.8rem;
    margin-top: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    display: none;
}

.cep-feedback.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.cep-feedback.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.cep-feedback.loading {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    display: block;
}

/* Animação de preenchimento automático */
@keyframes preenchimentoAutomatico {
    0% {
        background-color: #e3f2fd;
        transform: scale(1);
    }
    50% {
        background-color: #bbdefb;
        transform: scale(1.02);
    }
    100% {
        background-color: transparent;
        transform: scale(1);
    }
}

.form-input.preenchido-automatico {
    animation: preenchimentoAutomatico 0.5s ease;
}

/* Container de endereço com CEP */
.endereco-container {
    position: relative;
}

.endereco-container .cep-info {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.endereco-container .cep-info i {
    color: #3498db;
    margin-right: 0.25rem;
}

/* Botão de busca manual de CEP */
.cep-busca-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #3498db;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.cep-busca-btn:hover {
    background-color: #3498db;
    color: white;
}

.cep-busca-btn:disabled {
    color: #ccc;
    cursor: not-allowed;
}

/* Responsividade para campos de CEP */
@media (max-width: 768px) {
    .cep-input {
        font-size: 16px; /* Evita zoom no iOS */
    }
}

/* ========================================
   RELATÓRIOS - LAYOUT COMPACTO E OTIMIZADO
   ======================================== */

.relatorios-container {
    padding: 1rem;
    max-width: 1400px;
    margin: 0 auto;
    background: #f8f9fa;
    min-height: auto;
}

.relatorios-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(102,126,234,0.2);
    text-align: center;
    position: relative;
}

.relatorios-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    position: relative;
    z-index: 1;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    font-weight: 600;
}

.relatorios-header p {
    font-size: 0.9rem;
    opacity: 0.95;
    position: relative;
    z-index: 1;
    font-weight: 300;
}

/* Conteúdo do Relatório - Layout otimizado sem espaços vazios */
.relatorios-content {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1;
    min-height: 400px;
}

/* Forçar filtros e resultado a ficarem dentro da área azul */
.relatorio-filtros,
.relatorio-resultado {
    position: relative;
    z-index: 1;
}

/* Ajustar o container para conter tudo dentro da área azul */
.relatorios-container {
    padding: 1rem;
    max-width: 1400px;
    margin: 0 auto;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    min-height: 500px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Header branco dentro do azul */
.relatorios-header {
    background: white;
    color: #2c3e50;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
    position: relative;
    z-index: 2;
}

.relatorios-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    position: relative;
    z-index: 1;
    text-shadow: none;
    font-weight: 600;
    color: #2c3e50;
}

.relatorios-header p {
    font-size: 0.9rem;
    opacity: 0.95;
    position: relative;
    z-index: 1;
    font-weight: 300;
    color: #7f8c8d;
}

/* Seletor de Relatórios - Dentro da área azul - Ocupar todo o espaço */
.relatorio-selector {
    margin-bottom: 0;
    background: rgba(255,255,255,0.95);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.relatorio-selector h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    position: relative;
}

.relatorio-selector h3::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.relatorio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex: 1;
}

/* Cards de relatório - Dentro da área azul */
.relatorio-card {
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 10px;
    padding: 1rem 0.75rem;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
    opacity: 1;
    transform: scale(1) translateY(0);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.relatorio-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0;
}

.relatorio-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102,126,234,0.15);
    background: rgba(255,255,255,0.95);
}

.relatorio-card:hover::before {
    opacity: 1;
}

.relatorio-card.selected {
    background: rgba(255,255,255,0.95);
    color: #2c3e50;
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(102,126,234,0.25);
    border-color: #667eea;
}

.relatorio-card.selected::before {
    opacity: 0;
}

.relatorio-card i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    color: #667eea;
}

.relatorio-card.selected i {
    color: #667eea;
    transform: scale(1.1);
}

.relatorio-card h4 {
    color: #2c3e50;
    margin-bottom: 0.4rem;
    font-size: 1rem;
    font-weight: 600;
}

.relatorio-card.selected h4 {
    color: #2c3e50;
}

.relatorio-card p {
    color: #7f8c8d;
    font-size: 0.8rem;
    line-height: 1.3;
}

.relatorio-card.selected p {
    color: #7f8c8d;
}

/* Filtros do Relatório - Dentro da área azul - Ocupar espaço quando visível */
.relatorio-filtros {
    background: rgba(255,255,255,0.95);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    position: relative;
    backdrop-filter: blur(10px);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.relatorio-filtros::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 10px 10px 0 0;
}

.relatorio-filtros h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.relatorio-filtros h3::before {
    content: '🔍';
    font-size: 0.9rem;
}

.filtros-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
    flex: 1;
}

.filtro-group {
    display: flex;
    flex-direction: column;
}

.filtro-group label {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.periodo-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f8f9fa;
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.periodo-group:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102,126,234,0.1);
}

.periodo-group input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.85rem;
    outline: none;
    color: #2c3e50;
}

.periodo-group span {
    color: #7f8c8d;
    font-weight: 500;
    font-size: 0.75rem;
}

.filtro-input,
.filtro-select {
    padding: 0.5rem;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    background: white;
    color: #2c3e50;
}

.filtro-input:focus,
.filtro-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102,126,234,0.1);
}

.filtros-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    flex-wrap: wrap;
    padding-top: 0.75rem;
    border-top: 1px solid #e9ecef;
}

/* Resultado do Relatório - Dentro da área azul - Ocupar espaço quando visível */
.relatorio-resultado {
    background: rgba(255,255,255,0.95);
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    margin-bottom: 0;
    backdrop-filter: blur(10px);
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.resultado-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(102,126,234,0.2);
    flex-wrap: wrap;
    gap: 0.75rem;
}

.resultado-header h3 {
    color: #2c3e50;
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.resultado-header h3::before {
    content: '📊';
    font-size: 1rem;
}

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

/* Botões - Sem animações que interferem em orçamentos */
.btn-success {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    box-shadow: 0 2px 6px rgba(39,174,96,0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    box-shadow: 0 2px 6px rgba(52,152,219,0.2);
}

.btn-secondary {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    box-shadow: 0 2px 6px rgba(149,165,166,0.2);
}

/* Resumo do Relatório - Cards Ultra Compactos */
.relatorio-resumo {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

/* Cards de resumo - Dentro da área azul */
.resumo-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(102,126,234,0.3);
    opacity: 1;
    transform: translateY(0);
    position: relative;
    z-index: 2;
}

.resumo-card.total {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.resumo-card.positivo {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.resumo-card.negativo {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.resumo-card h4 {
    font-size: 0.75rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.resumo-card .valor {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.2rem;
}

.resumo-card .descricao {
    font-size: 0.7rem;
    opacity: 0.8;
}

/* Tabela do Relatório - Dentro da área azul */
.relatorio-tabela-container {
    overflow-x: auto;
    margin-bottom: 1rem;
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(5px);
}

.relatorio-tabela {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
}

.relatorio-tabela th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.5rem 0.4rem;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    font-size: 0.75rem;
    letter-spacing: 0.2px;
}

.relatorio-tabela td {
    padding: 0.5rem 0.4rem;
    border-bottom: 1px solid rgba(102,126,234,0.1);
    color: #2c3e50;
    font-size: 0.75rem;
    background: rgba(255,255,255,0.5);
}

.relatorio-tabela tr:hover {
    background: rgba(102,126,234,0.1);
}

.relatorio-tabela .valor {
    text-align: right;
    font-weight: 600;
    color: #27ae60;
}

.relatorio-tabela .status {
    text-align: center;
}

.status-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.status-badge.ativo {
    background: #d4edda;
    color: #155724;
}

.status-badge.cancelado {
    background: #f8d7da;
    color: #721c24;
}

/* Responsividade Ultra Compacta para Relatórios */
@media (max-width: 1200px) {
    .relatorio-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 0.5rem;
    }
    
    .relatorios-header h1 {
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .relatorios-container {
        padding: 0.5rem;
    }
    
    .relatorios-header {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .relatorios-header h1 {
        font-size: 1.2rem;
    }
    
    .relatorios-header p {
        font-size: 0.8rem;
    }
    
    .relatorio-selector {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .relatorio-selector h3 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .relatorio-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 0.5rem;
    }
    
    .relatorio-card {
        padding: 0.75rem;
    }
    
    .relatorio-card i {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
    }
    
    .relatorio-filtros {
        padding: 0.75rem;
    }
    
    .filtros-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .resultado-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .resultado-actions {
        width: 100%;
        justify-content: stretch;
    }
    
    .btn-success,
    .btn-primary,
    .btn-secondary {
        flex: 1;
        justify-content: center;
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .relatorio-resumo {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .resumo-card {
        padding: 0.75rem;
    }
    
    .resumo-card .valor {
        font-size: 1.2rem;
    }
    
    .relatorio-resultado {
        padding: 0.75rem;
    }
    
    .relatorio-tabela th,
    .relatorio-tabela td {
        padding: 0.4rem 0.2rem;
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .relatorios-header h1 {
        font-size: 1rem;
    }
    
    .relatorio-card {
        padding: 0.5rem;
    }
    
    .relatorio-card i {
        font-size: 1.5rem;
    }
    
    .relatorio-card h4 {
        font-size: 0.9rem;
    }
    
    .relatorio-card p {
        font-size: 0.7rem;
    }
    
    .resultado-actions {
        flex-direction: column;
    }
    
    .periodo-group {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .periodo-group span {
        text-align: center;
        font-size: 0.65rem;
    }
    
    .relatorio-resumo {
        grid-template-columns: 1fr;
    }
    
    .resumo-card .valor {
        font-size: 1rem;
    }
}

.status-badge.ativo {
    background: #d4edda;
    color: #155724;
}

.status-badge.inativo {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.cancelado {
    background: #fff3cd;
    color: #856404;
}

/* Gráficos */
.relatorio-graficos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.grafico-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.grafico-container h4 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    text-align: center;
}

.grafico-placeholder {
    height: 300px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7f8c8d;
    font-size: 1.1rem;
}

/* Animações Adicionais - Removidas para não atrapalhar orçamentos */
.relatorio-card {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* Removendo animações que podem interferir na abertura de orçamentos */

/* Responsividade dos Relatórios */
@media (max-width: 768px) {
    .relatorios-container {
        padding: 1rem;
    }
    
    .relatorios-header h1 {
        font-size: 2rem;
    }
    
    .relatorio-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .relatorio-card {
        padding: 1.5rem;
    }
    
    .relatorio-card i {
        font-size: 2rem;
    }
    
    .filtros-grid {
        grid-template-columns: 1fr;
    }
    
    .periodo-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .periodo-group span {
        text-align: center;
        margin: 0.5rem 0;
    }
    
    .resultado-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .resultado-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .relatorio-resumo {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .relatorio-graficos {
        grid-template-columns: 1fr;
    }
    
    .relatorio-tabela {
        font-size: 0.9rem;
    }
    
    .relatorio-tabela th,
    .relatorio-tabela td {
        padding: 0.75rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .relatorio-card {
        padding: 1rem;
    }
    
    .relatorio-card i {
        font-size: 1.5rem;
    }
    
    .relatorio-card h4 {
        font-size: 1.1rem;
    }
    
    .relatorio-card p {
        font-size: 0.8rem;
    }
    
    .resumo-card .valor {
        font-size: 1.5rem;
    }
    
    .resultado-actions {
        flex-direction: column;
    }
    
    .btn-success,
    .btn-primary,
    .btn-secondary {
        justify-content: center;
    }
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}
