/**
 * Estilos da tela principal de comandas
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    background: #ffffff !important;
    margin: 0;
    padding: 0;
}

body.comandas-page {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #ffffff !important;
    min-height: 100vh;
    padding: 20px;
    margin: 0;
}

.comandas-container {
    max-width: 1200px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
}

/* Header */
.comandas-header {
    background: #ffffff;
    color: #333;
    padding: 30px;
    text-align: center;
    border-bottom: 2px solid #e0e0e0;
}

.comandas-header h1 {
    font-size: 2.5em;
    font-weight: 900;
    margin-bottom: 10px;
    color: #333;
}

.comandas-subtitle {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 15px;
}

.comandas-info {
    font-size: 1em;
    color: #666;
}

/* Tabs de Período */
.comandas-periodo-tabs {
    display: flex;
    background: #f5f5f5;
    border-bottom: 2px solid #e0e0e0;
}

.periodo-tab {
    flex: 1;
    padding: 15px 20px;
    background: transparent;
    border: none;
    font-size: 1.1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    color: #666;
}

.periodo-tab.active {
    background: #f5f5f5;
    color: #333;
    font-weight: 700;
    border-bottom: 3px solid #E63946;
}

.periodo-tab:hover:not(.active) {
    background: #e8e8e8;
}

/* Botões de Comanda */
.comandas-buttons-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 30px;
    min-height: 500px;
}

.comanda-btn {
    min-height: 200px;
    border: none;
    border-radius: 15px;
    font-size: 1.5em;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.comanda-btn:active {
    transform: scale(0.95);
}

.comanda-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.comanda-btn-promocional-inteiro {
    background: linear-gradient(135deg, #2A9D8F 0%, #1a7d6f 100%);
}

.comanda-btn-promocional-meia {
    background: linear-gradient(135deg, #4ECDC4 0%, #3eb5ac 100%);
}

.comanda-btn-normal-inteiro {
    background: linear-gradient(135deg, #264653 0%, #1a2f38 100%);
}

.comanda-btn-normal-meia {
    background: linear-gradient(135deg, #457B9D 0%, #2d5a75 100%);
}

/* Alternativa com cores do tema */
.comanda-btn-promocional-inteiro.alternative {
    background: linear-gradient(135deg, #E63946 0%, #c92a37 100%);
}

.comanda-btn-promocional-meia.alternative {
    background: linear-gradient(135deg, #F77F00 0%, #d66a00 100%);
}

.comanda-btn-normal-inteiro.alternative {
    background: linear-gradient(135deg, #FCBF49 0%, #e6a832 100%);
}

.comanda-btn-normal-meia.alternative {
    background: linear-gradient(135deg, #E63946 0%, #c92a37 100%);
}

.btn-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
}

.btn-title {
    font-size: 1.2em;
    margin-bottom: 10px;
}

.btn-subtitle {
    font-size: 1.5em;
    margin-bottom: 15px;
}

.btn-valor {
    font-size: 1.8em;
    margin-top: 10px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

/* Loading state */
.comanda-btn.loading {
    pointer-events: none;
}

.comanda-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Footer */
.comandas-footer {
    background: #f5f5f5;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 2px solid #e0e0e0;
}

.comandas-status {
    display: flex;
    gap: 30px;
}

.status-item {
    display: flex;
    flex-direction: column;
}

.status-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.status-value {
    font-size: 1.3em;
    font-weight: 700;
    color: #333;
}

.btn-fechar-dia {
    padding: 15px 40px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-fechar-dia:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.3);
}

.btn-trocar-periodo {
    transition: all 0.3s;
}

.btn-trocar-periodo:hover {
    background: #e8e8e8 !important;
    border-color: #ccc !important;
    transform: translateY(-2px);
}

/* Modais */
.comandas-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #f3f3f3;
    border-top-color: #E63946;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: #28a745;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3em;
    margin: 0 auto 20px;
}

.error-icon {
    width: 80px;
    height: 80px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3em;
    margin: 0 auto 20px;
}

.modal-content h3 {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: #333;
}

.modal-content p {
    font-size: 1.1em;
    color: #666;
    margin-bottom: 20px;
}

.btn-close-modal {
    padding: 10px 30px;
    background: #E63946;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
}

/* Modal de Relatório */
.modal-relatorio-content {
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 0;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    background: white;
}

.modal-relatorio-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 2px solid #e0e0e0;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 12px 12px 0 0;
}

.modal-relatorio-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #333;
}

.btn-fechar-relatorio {
    background: transparent;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 5px 10px;
    line-height: 1;
    transition: all 0.2s;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-fechar-relatorio:hover {
    background: #f0f0f0;
    color: #E63946;
    transform: rotate(90deg);
}

.modal-relatorio-body {
    padding: 30px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-relatorio-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    padding: 30px;
    border-top: 2px solid #e0e0e0;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 0 0 12px 12px;
}

.btn-relatorio {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.btn-relatorio::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-relatorio:hover::before {
    width: 300px;
    height: 300px;
}

.btn-relatorio:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.btn-relatorio:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-relatorio:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-relatorio .btn-icon {
    font-size: 20px;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.btn-relatorio .btn-text {
    font-weight: 700;
    letter-spacing: 0.3px;
    position: relative;
    z-index: 1;
}

.btn-imprimir {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: 2px solid transparent;
}

.btn-imprimir:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-pdf {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: 2px solid transparent;
}

.btn-pdf:hover {
    background: linear-gradient(135deg, #c82333 0%, #a71e2a 100%);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Ocultar qualquer botão Excel que apareça */
.btn-excel,
.btn-relatorio.btn-excel,
.modal-relatorio-actions .btn-excel {
    display: none !important;
}


.btn-fechar {
    background: #6c757d;
    color: white;
}

.btn-fechar:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Relatório Simplificado */
.comandas-relatorio-simples {
    font-family: "Courier New", monospace;
    max-width: 80mm;
    margin: 0 auto;
    background: white;
    padding: 15px;
}

.relatorio-header {
    text-align: center;
    margin-bottom: 15px;
    border-bottom: 2px solid #000;
    padding-bottom: 10px;
}

.relatorio-header h2 {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
    text-transform: uppercase;
    color: #000;
}

.relatorio-data {
    font-size: 14px;
    color: #333;
}

.relatorio-conteudo {
    margin: 15px 0;
}

.relatorio-total-box {
    text-align: center;
    margin: 15px 0;
    padding: 10px;
    border: 2px solid #000;
    font-weight: bold;
    font-size: 14px;
}

.total-numero {
    display: block;
    font-size: 24px;
    margin-top: 5px;
}

.relatorio-info {
    display: flex;
    justify-content: space-between;
    margin: 8px 0;
    font-size: 11px;
    padding: 5px 0;
}

.relatorio-separador {
    border-top: 1px dashed #000;
    margin: 15px 0;
}

.relatorio-tipos {
    margin: 15px 0;
}

.tipo-grupo {
    margin-bottom: 15px;
}

.tipo-grupo h4 {
    font-size: 13px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 8px;
    border-bottom: 1px solid #000;
    padding-bottom: 3px;
}

.tipo-item {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
    font-size: 11px;
    padding: 3px 0;
}

.tipo-subtotal {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    padding-top: 5px;
    border-top: 1px solid #ccc;
    font-weight: bold;
    font-size: 12px;
}

.relatorio-total-final {
    text-align: center;
    margin: 20px 0;
    padding: 10px;
    border: 2px solid #000;
    font-weight: bold;
    font-size: 14px;
}

.relatorio-botoes {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.btn-imprimir-relatorio,
.btn-pdf-relatorio {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-imprimir-relatorio {
    background: #007bff;
    color: white;
}

.btn-imprimir-relatorio:hover {
    background: #0056b3;
}

.btn-pdf-relatorio {
    background: #dc3545;
    color: white;
}

.btn-pdf-relatorio:hover {
    background: #c82333;
}

/* Relatório Simplificado Front-end */
.comandas-relatorio-frontend {
    font-family: "Courier New", monospace;
    max-width: 100%;
    margin: 0 auto;
    background: white;
    padding: 20px;
}

.relatorio-frontend-header {
    text-align: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #E63946;
    padding-bottom: 15px;
}

.relatorio-frontend-header h2 {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.relatorio-frontend-data {
    font-size: 16px;
    color: #666;
    margin-top: 5px;
}

.relatorio-frontend-conteudo {
    margin: 20px 0;
}

.relatorio-frontend-total {
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background: #f5f5f5;
    border: 2px solid #E63946;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
}

.total-label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.total-valor {
    display: block;
    font-size: 36px;
    color: #E63946;
    font-weight: 900;
}

.relatorio-frontend-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 15px 0;
    padding: 12px 15px;
    background: #f9f9f9;
    border-left: 4px solid #E63946;
    border-radius: 5px;
    font-size: 14px;
}

.relatorio-frontend-info .info-label {
    font-weight: 500;
    color: #666;
}

.relatorio-frontend-info .info-value {
    display: flex;
    align-items: center;
    gap: 10px;
}

.relatorio-frontend-info strong {
    font-size: 18px;
    color: #E63946;
    font-weight: bold;
}

.relatorio-frontend-info .info-hora {
    font-size: 14px;
    color: #999;
    font-weight: normal;
}

.relatorio-frontend-separador {
    height: 1px;
    background: linear-gradient(to right, transparent, #e0e0e0, transparent);
    margin: 25px 0;
}

.relatorio-frontend-detalhes {
    margin-top: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.detalhe-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e8e8e8;
    font-size: 15px;
}

.detalhe-item:last-child {
    border-bottom: none;
}

.detalhe-item.detalhe-total {
    margin-top: 10px;
    padding-top: 15px;
    border-top: 2px solid #E63946;
    font-weight: bold;
    font-size: 16px;
}

.detalhe-label {
    color: #666;
    font-weight: 500;
}

.detalhe-valor {
    color: #333;
    font-weight: 600;
    font-size: 16px;
}

.detalhe-item.detalhe-total .detalhe-label {
    color: #E63946;
    font-size: 17px;
}

.detalhe-item.detalhe-total .detalhe-valor {
    color: #E63946;
    font-size: 20px;
}

/* Responsivo */
@media (max-width: 768px) {
    .comandas-buttons-container {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 20px;
    }
    
    .comanda-btn {
        min-height: 150px;
    }
    
    .comandas-header h1 {
        font-size: 2em;
    }
    
    .comandas-footer {
        flex-direction: column;
        gap: 15px;
    }
    
    .comandas-status {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .modal-relatorio-content {
        max-width: 95%;
    }
    
    .modal-relatorio-actions {
        flex-direction: column;
    }
    
    .btn-relatorio {
        width: 100%;
    }
}

