/* /c%3A/Users/cecil/Videos/fatura/public/invoice-creator.css */

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

/* Modal de Login - copiado do analytics.css */
.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.login-content {
    background: white;
    padding: 40px;
    border-radius: 15px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.input-group {
    margin-bottom: 20px;
}

.input-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
}

.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 10px;
    border-radius: 5px;
    margin: 15px 0;
    font-size: 14px;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: #000;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: normal;
    cursor: pointer;
    transition: background-color 0.2s;
}

.login-btn:hover {
    background: #333;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #fafafa;
    color: #333;
    line-height: 1.4;
    overscroll-behavior: none;
    -webkit-overscroll-behavior: none;
    -ms-overscroll-behavior: none;
}

html {
    overscroll-behavior: none;
    -webkit-overscroll-behavior: none;
    -ms-overscroll-behavior: none;
}

/* Layout Principal - 2 Colunas */
.app-container {
    display: flex;
    height: 100vh;
}

/* Painel Esquerdo - Fixo */
.edit-panel {
    width: 300px;
    height: 100vh;
    background: white;
    border-right: 1px solid #e0e0e0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.field-group {
    margin-bottom: 15px;
}

.field-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: #666;
}

.field-group input,
.field-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

.field-group input:focus {
    outline: none;
    border-color: #999;
}

.error-message {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
    padding: 5px 8px;
    background: #fdf2f2;
    border-radius: 3px;
    border-left: 3px solid #e74c3c;
}

.save-status {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    text-align: center;
}

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

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

.save-status.loading {
    background: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

.save-status.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.info-group {
    opacity: 0.8;
}

.info-group label {
    color: #888;
    font-size: 12px;
}

.auto-info {
    padding: 6px 8px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 3px;
    font-family: monospace;
    font-size: 13px;
    color: #495057;
}

.total-display {
    background-color: #f8f9fa;
    border: 2px solid #666;
    border-radius: 5px;
    padding: 10px;
    text-align: center;
    margin-top: 10px;
}

.total-display strong {
    font-size: 16px;
    color: #000;
}


.print-btn {
    padding: 12px 20px;
    background: #333;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-top: auto;
}

.print-btn:hover {
    background: #555;
}

/* Preview - Direita com Scroll */
.preview-container {
    flex: 1;
    height: 100vh;
    overflow-y: auto;
    padding: 20px;
    overscroll-behavior: none;
    -webkit-overscroll-behavior: none;
    -ms-overscroll-behavior: none;
}

/* Invoice Preview - Igual ao simple-mapper SEM background */
.invoice-preview {
    position: relative;
    width: 794px;
    height: 1123px;
    margin: 0 auto;
    background: white;
    border: 1px solid #ddd;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transform: scale(1);
    overflow: hidden;
}

/* Preview Overlay - Elementos sobrepostos */
.preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Elementos de Texto - Igual ao simple-mapper */
.preview-element {
    position: absolute;
    font-family: Arial, sans-serif;
    color: #000;
    white-space: nowrap;
    pointer-events: none;
    transition: all 0.2s ease;
}

.preview-element.bold {
    font-weight: bold;
}

/* Linhas - Igual ao simple-mapper */
.preview-line {
    position: absolute;
    pointer-events: none;
    /* Background definido pelo JavaScript conforme tipo de linha */
}

/* Responsive */
@media (max-width: 1200px) {
    .edit-panel {
        width: 250px;
    }
    
    .invoice-preview {
        transform: scale(0.8);
        transform-origin: top center;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .edit-panel {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .preview-container {
        height: auto;
    }
    
    .invoice-preview {
        transform: scale(0.6);
        transform-origin: top center;
    }
}

/* Print Styles - IGUAL AO SIMPLE-MAPPER */
@media print {
    /* Reset para impressão */
    * {
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }
    
    body {
        background: white !important;
        font-family: Arial, sans-serif !important;
    }
    
    /* Ocultar painel de edição */
    .edit-panel {
        display: none !important;
    }
    
    .preview-container {
        width: 100% !important;
        height: 100% !important;
        padding: 0 !important;
        background: white !important;
    }
    
    .invoice-preview {
        width: 210mm !important;
        height: 297mm !important;
        margin: 0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        transform: none !important;
        overflow: visible !important;
        border: none !important;
    }
    
    /* Garantir que linhas aparecem na impressão */
    .preview-line {
        border: none !important;
        min-height: 0.5mm !important;
        min-width: 0.5mm !important;
        print-color-adjust: exact !important;
        -webkit-print-color-adjust: exact !important;
    }
    
    /* Linhas pretas e cinzentas na impressão */
    .preview-line {
        print-color-adjust: exact !important;
        -webkit-print-color-adjust: exact !important;
    }
    
    /* Configuração da página */
    @page {
        size: A4;
        margin: 0;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
} 