/* Reset e configurações gerais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Tela de Login */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    max-width: 400px;
    width: 90%;
    text-align: center;
    animation: loginSlideIn 0.5s ease-out;
}

.login-header h2 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.8em;
}

.login-header p {
    color: #666;
    margin-bottom: 30px;
}

.login-form input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    margin-bottom: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.login-form input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-login {
    width: 100%;
    padding: 15px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-login:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.login-error {
    background: #fee;
    color: #c53030;
    padding: 10px;
    border-radius: 8px;
    margin-top: 15px;
    border: 1px solid #feb2b2;
}

.login-hint {
    margin-top: 20px;
    color: #718096;
}

@keyframes loginSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Estilos para mensagens de erro detalhadas */
.erro {
    background: #fee;
    border: 1px solid #feb2b2;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    color: #c53030;
}

.erro h3 {
    margin-bottom: 10px;
    color: #e53e3e;
}

.erro p {
    margin-bottom: 10px;
    line-height: 1.5;
}

.erro ul {
    margin-left: 20px;
    margin-top: 10px;
}

.erro li {
    margin-bottom: 5px;
}

.erro code {
    background: #f7fafc;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.sem-resultados {
    text-align: center;
    color: #718096;
    padding: 30px;
    font-style: italic;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px;
}

header {
    margin-bottom: 30px;
    color: white;
    text-align: center;
}

.header-content {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    position: relative;
    max-width: 100%;
}

.header-content > div {
    flex: 1;
    text-align: center;
}

.btn-logout {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-50%) translateY(-2px);
}

.btn-recibos {
    position: absolute;
    right: 120px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.btn-recibos:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-50%) translateY(-2px);
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

main {
    display: flex;
    flex-direction: column;
    gap: 25px;
    align-items: center;
    max-width: 100%;
}

/* Seção do formulário */
.form-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 800px;
}

/* Visualização do recibo */
.recibo-preview {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 800px;
    margin-top: 20px;
}

.form-section h2 {
    color: #4a5568;
    margin-bottom: 25px;
    font-size: 1.8em;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

.section {
    margin-bottom: 25px;
    background: #f7fafc;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.section h3 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.form-group {
    margin-bottom: 15px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #4a5568;
}

input, textarea, select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
    -webkit-appearance: none; /* Remove estilo padrão iOS */
    -moz-appearance: none;
    appearance: none;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Campos readonly - dados da empresa */
input[readonly] {
    background-color: #f8f9fa;
    color: #495057;
    border-color: #ced4da;
    cursor: not-allowed;
}

input[readonly]:focus {
    border-color: #ced4da;
    box-shadow: none;
}

/* Estilo para select */
select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667eea' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

select:focus {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235a6fd8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
}

/* Melhor experiência touch */
@media (max-width: 768px) {
    input, textarea, select {
        font-size: 16px; /* Evita zoom automático no iOS */
        padding: 15px;
    }
    
    input[readonly] {
        font-size: 16px;
        padding: 15px;
        background-color: #f1f3f4;
    }
    
    button {
        min-height: 44px; /* Tamanho mínimo recomendado para touch */
        -webkit-tap-highlight-color: transparent; /* Remove highlight azul no tap */
    }
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Tabela de produtos */
.produtos-header {
    margin-bottom: 15px;
}

.produtos-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

th {
    background: #667eea;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
}

tbody tr:hover {
    background: #f7fafc;
}

.produto-input {
    border: 1px solid #e2e8f0;
    padding: 8px;
    border-radius: 4px;
    width: 100%;
}

/* Totais */
.totais {
    background: white;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
}

.total-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 8px 0;
}

.total-item input {
    width: 120px;
    margin: 0;
}

.total-final {
    border-top: 2px solid #667eea;
    margin-top: 15px;
    padding-top: 15px;
    font-size: 1.3em;
    font-weight: bold;
    color: #667eea;
}

/* Botões */
.btn-primary, .btn-success, .btn-secondary, .btn-danger, .btn-info, .btn-social {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.btn-success {
    background: #48bb78;
    color: white;
}

.btn-success:hover {
    background: #38a169;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #a0aec0;
    color: white;
}

.btn-secondary:hover {
    background: #718096;
    transform: translateY(-2px);
}

.btn-info {
    background: #3182ce;
    color: white;
}

.btn-info:hover {
    background: #2c5282;
    transform: translateY(-2px);
}

.btn-social {
    background: #38b2ac;
    color: white;
}

.btn-social:hover {
    background: #319795;
    transform: translateY(-2px);
}

.btn-danger {
    background: #f56565;
    color: white;
    padding: 6px 12px;
    font-size: 12px;
}

.btn-danger:hover {
    background: #e53e3e;
}

.btn-small {
    padding: 8px 16px;
    font-size: 12px;
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    margin-top: 30px;
}

.acoes-recibo {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Menu de Compartilhamento */
.compartilhar-menu {
    background: white;
    border: 2px solid #667eea;
    border-radius: 15px;
    padding: 25px;
    margin-top: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: slideIn 0.3s ease-out;
}

.compartilhar-menu h4 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.compartilhar-opcoes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.btn-whatsapp {
    background: #25d366;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-whatsapp:hover {
    background: #1da851;
    transform: translateY(-2px);
}

.btn-telegram {
    background: #0088cc;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-telegram:hover {
    background: #006699;
    transform: translateY(-2px);
}

.btn-email {
    background: #ea4335;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-email:hover {
    background: #d23309;
    transform: translateY(-2px);
}

.btn-copy {
    background: #6f42c1;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-copy:hover {
    background: #5a2d91;
    transform: translateY(-2px);
}

/* Visualização do recibo */
.recibo-preview {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 800px;
    margin-top: 20px;
}

.recibo-container {
    max-width: 100%;
    margin: 0 auto;
}

.recibo-header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 3px solid #667eea;
    padding-bottom: 20px;
}

.logo-container {
    margin-bottom: 20px;
    text-align: center;
}

.recibo-logo {
    max-width: 100px !important;
    max-height: 50px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: block;
    margin: 0 auto;
}

/* Garantir que a logo no preview tenha tamanho específico */
.recibo-preview .recibo-logo,
#recibo-logo,
.recibo-container .recibo-logo,
.recibo-preview .logo-container .recibo-logo {
    max-width: 100px !important;
    max-height: 50px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto !important;
}

/* Garantir que imagens não ultrapassem o container */
.recibo-preview img,
.recibo-container img {
    max-width: 100% !important;
}

/* Especificidade extra para a logo */
img.recibo-logo,
img#recibo-logo {
    max-width: 100px !important;
    max-height: 50px !important;
    width: auto !important;
    height: auto !important;
}

.recibo-header h2 {
    font-size: 2.5em;
    color: #667eea;
    margin-bottom: 10px;
    letter-spacing: 3px;
}

.recibo-empresa {
    margin-bottom: 25px;
    background: #f7fafc;
    padding: 20px;
    border-radius: 10px;
}

.recibo-empresa h3 {
    color: #2d3748;
    font-size: 1.5em;
    margin-bottom: 10px;
}

.empresa-contatos, .cliente-contatos {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.empresa-contatos p, .cliente-contatos p {
    margin: 0;
    color: #4a5568;
}

@media (max-width: 768px) {
    .empresa-contatos, .cliente-contatos {
        flex-direction: column;
        gap: 5px;
    }
}

.recibo-cliente {
    margin-bottom: 25px;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
}

.recibo-cliente h4 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.recibo-produtos {
    margin-bottom: 25px;
}

.recibo-produtos table th {
    background: #2d3748;
}

.recibo-totais {
    background: #f7fafc;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
}

.total-linha {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 5px 0;
}

.recibo-observacoes {
    margin-bottom: 30px;
    padding: 15px;
    background: #fff5e6;
    border-radius: 8px;
    border-left: 4px solid #ed8936;
}

.recibo-observacoes h4 {
    color: #c05621;
    margin-bottom: 10px;
}

.recibo-footer {
    margin-top: 50px;
    text-align: center;
}

.recibo-footer {
    margin-top: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.assinatura {
    text-align: center;
    margin: 30px 0;
}

.linha-assinatura {
    width: 350px;
    height: 1px;
    border-bottom: 2px solid #000;
    margin: 0 auto 15px auto;
    position: relative;
}

.linha-assinatura::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    border-bottom: 1px solid #000;
}

.assinatura p {
    margin: 10px 0;
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.local-data {
    margin-top: 20px;
    text-align: center;
}

.local-data p {
    margin: 5px 0;
    font-size: 0.95em;
    color: #4a5568;
    font-weight: 500;
}

/* Responsividade */
@media (max-width: 1200px) {
    .container {
        padding: 15px;
    }
}

@media (max-width: 1024px) {
    .header-content {
        gap: 15px;
    }
    
    .btn-logout {
        right: 15px;
        padding: 8px 16px;
        font-size: 13px;
    }
    
    header h1 {
        font-size: 2.2em;
    }
    
    header p {
        font-size: 1.1em;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header-content {
        position: static;
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .header-content > div {
        text-align: center;
    }
    
    .btn-logout {
        position: static;
        transform: none;
        align-self: center;
    }
    
    .btn-logout:hover {
        transform: translateY(-2px);
    }
    
    .form-section, .recibo-preview {
        padding: 20px;
        border-radius: 10px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .actions {
        margin-top: 20px;
        gap: 15px;
    }
    
    .acoes-recibo {
        flex-direction: column;
        width: 100%;
    }
    
    .acoes-recibo button {
        width: 100%;
        padding: 15px;
        font-size: 16px;
    }

    .compartilhar-opcoes {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .compartilhar-menu {
        padding: 20px;
        margin: 15px 0;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    header p {
        font-size: 1em;
    }
    
    .produtos-container {
        font-size: 14px;
        overflow-x: auto;
    }
    
    th, td {
        padding: 8px 4px;
        font-size: 12px;
    }
    
    .produto-input {
        font-size: 14px;
        padding: 6px;
    }
    
    .btn-danger {
        padding: 4px 8px;
        font-size: 10px;
    }
    
    .section {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .section h3 {
        font-size: 1.1em;
    }
    
    .form-section h2 {
        font-size: 1.5em;
    }
    
    .totais {
        padding: 15px;
    }
    
    .total-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .total-item input {
        width: 100%;
    }
    
    .total-final {
        font-size: 1.2em;
    }
    
    .recibo-header h2 {
        font-size: 2em;
    }
    
    .recibo-logo {
        max-width: 80px;
        max-height: 40px;
    }
    
    .recibo-empresa, .recibo-cliente {
        padding: 15px;
    }
    
    .recibo-totais {
        padding: 15px;
    }
    
    .linha-assinatura {
        width: 280px !important;
    }
    
    .assinatura {
        margin: 20px 0 !important;
    }
    
    .assinatura p {
        font-size: 12px !important;
    }
    
    .local-data p {
        font-size: 11px !important;
    }
    
    /* Login em mobile */
    .login-container {
        padding: 30px 20px;
        margin: 10px;
    }
    
    .login-header h2 {
        font-size: 1.5em;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 5px;
    }
    
    .form-section, .recibo-preview {
        padding: 15px;
        margin: 5px 0;
    }
    
    header {
        margin-bottom: 20px;
    }
    
    header h1 {
        font-size: 1.8em;
    }
    
    .header-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-logout {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .section {
        padding: 12px;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    input, textarea {
        padding: 10px;
        font-size: 16px; /* Evita zoom no iOS */
    }
    
    .produtos-container table {
        min-width: 100%;
        font-size: 11px;
    }
    
    th, td {
        padding: 6px 2px;
    }
    
    .produto-input {
        font-size: 12px;
        padding: 4px;
        min-width: 60px;
    }
    
    .actions {
        margin-top: 20px;
        gap: 8px;
    }

    .acoes-recibo {
        gap: 8px;
    }
    
    .acoes-recibo button {
        padding: 12px;
        font-size: 14px;
    }
    
    .recibo-header h2 {
        font-size: 1.8em;
        letter-spacing: 1px;
    }
    
    .recibo-logo {
        max-width: 70px;
        max-height: 35px;
    }
    
    .recibo-empresa h3 {
        font-size: 1.2em;
    }
    
    /* Login em telas muito pequenas */
    .login-container {
        padding: 25px 15px;
        border-radius: 15px;
    }
    
    .login-form input, .btn-login {
        padding: 12px;
        font-size: 16px;
    }
    
    /* Compartilhamento em mobile */
    .compartilhar-menu {
        margin: 10px 5px;
        padding: 15px;
    }
    
    .compartilhar-opcoes button {
        padding: 10px;
        font-size: 12px;
    }
    
    /* Mensagens em mobile */
    #mensagem-temporaria {
        right: 10px !important;
        top: 10px !important;
        max-width: calc(100vw - 20px) !important;
        font-size: 14px !important;
    }
}

/* Animações */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.recibo-preview {
    animation: slideIn 0.5s ease-out;
}

/* Estilos para impressão */
@media print {
    /* Forçar exibição de todas as imagens */
    img {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .login-overlay {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .form-section, .actions, .acoes-recibo, .compartilhar-menu {
        display: none !important;
    }
    
    .recibo-preview {
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 20px !important;
        position: static !important;
        max-width: none !important;
        width: 100% !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        background: white !important;
    }
    
    .container {
        max-width: none !important;
        padding: 0 !important;
        display: block !important;
        visibility: visible !important;
    }
    
    main {
        display: block !important;
        visibility: visible !important;
    }
    
    .header-content {
        display: none;
    }
    
    /* Estilos da logo para impressão */
    .recibo-logo {
        max-width: 5cm !important;
        max-height: 2cm !important;
        display: block !important;
        margin: 0 auto 10px auto !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        page-break-inside: avoid !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .logo-container {
        margin-bottom: 10px !important;
        display: block !important;
        text-align: center !important;
        page-break-inside: avoid !important;
    }
    
    /* Garantir que a logo apareça mesmo se estiver oculta */
    img[data-logo="true"] {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Garantir que todos os elementos do recibo sejam visíveis */
    .recibo-header,
    .recibo-empresa,
    .recibo-cliente,
    .recibo-produtos,
    .recibo-totais,
    .recibo-observacoes,
    .recibo-footer {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        page-break-inside: avoid;
    }
    
    /* Garantir que o conteúdo das tabelas apareça */
    table, th, td {
        display: table-cell !important;
        visibility: visible !important;
        border: 1px solid #333 !important;
    }
    
    /* Forçar exibição de textos */
    p, h1, h2, h3, h4, span {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        color: #000 !important;
    }
    
    /* Força para qualquer imagem no recibo */
    .recibo-preview img,
    .recibo-container img {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    /* Estilos específicos para assinatura na impressão */
    .recibo-footer {
        margin-top: 60px !important;
        page-break-inside: avoid !important;
        display: block !important;
        text-align: center !important;
    }
    
    .assinatura {
        text-align: center !important;
        margin: 40px auto !important;
        display: block !important;
        width: 100% !important;
    }
    
    .linha-assinatura {
        width: 400px !important;
        height: 2px !important;
        border-bottom: 2px solid #000 !important;
        margin: 0 auto 20px auto !important;
        display: block !important;
        background: transparent !important;
    }
    
    .linha-assinatura::before {
        display: none !important;
    }
    
    .assinatura p {
        font-size: 16px !important;
        color: #000 !important;
        font-weight: bold !important;
        margin: 15px 0 !important;
    }
    
    .local-data {
        margin-top: 30px !important;
        text-align: center !important;
    }
    
    .local-data p {
        font-size: 14px !important;
        color: #000 !important;
        font-weight: 500 !important;
        margin: 8px 0 !important;
    }
}

/* Estilos para Modais */
.modal-overlay {
    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: 10000;
    backdrop-filter: blur(5px);
}

.modal-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease-out;
}

.modal-large {
    max-width: 1200px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 2px solid #e2e8f0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px 20px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5em;
}

.btn-close {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
    flex: 1;
    overflow-y: auto;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    border-radius: 0 0 20px 20px;
}

/* Filtros */
.filtros-container {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto auto;
    gap: 15px;
    align-items: end;
    margin-bottom: 30px;
    padding: 20px;
    background: #f7fafc;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.filtro-grupo {
    display: flex;
    flex-direction: column;
}

.filtro-grupo label {
    margin-bottom: 5px;
    font-weight: 600;
    color: #4a5568;
    font-size: 14px;
}

.filtro-grupo input {
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.filtro-grupo input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Loading Spinner */
.loading {
    text-align: center;
    padding: 40px;
    color: #667eea;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Lista de Recibos */
.recibos-lista {
    display: grid;
    gap: 15px;
}

.recibo-item {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.recibo-item:hover {
    border-color: #667eea;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.recibo-info {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 20px;
    align-items: center;
}

.recibo-numero {
    font-weight: 700;
    font-size: 1.2em;
    color: #667eea;
}

.recibo-cliente {
    color: #2d3748;
    font-weight: 600;
}

.recibo-data {
    color: #718096;
    font-size: 0.9em;
}

.recibo-valor {
    font-weight: 700;
    font-size: 1.1em;
    color: #38a169;
    text-align: right;
}

.recibo-acoes {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

/* Recibo Individual */
.recibo-individual {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 20px;
}

.acoes-recibo-individual {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* Paginação */
.paginacao {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
    padding: 20px;
}

.paginacao button {
    padding: 10px 15px;
    border: 2px solid #e2e8f0;
    background: white;
    color: #4a5568;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.paginacao button:hover {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.paginacao button.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.paginacao button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsividade dos Modais */
@media (max-width: 768px) {
    .modal-container {
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-header, .modal-body, .modal-footer {
        padding: 20px;
    }
    
    .filtros-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .btn-recibos {
        position: static;
        transform: none;
        margin-top: 10px;
        align-self: center;
    }
    
    .btn-recibos:hover {
        transform: translateY(-2px);
    }
    
    .recibo-info {
        grid-template-columns: 1fr;
        gap: 10px;
        text-align: center;
    }
    
    .acoes-recibo-individual {
        flex-direction: column;
    }
    
    .acoes-recibo-individual button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .modal-header h2 {
        font-size: 1.2em;
    }
    
    .btn-close {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .recibo-item {
        padding: 15px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .filtros-container {
        padding: 15px;
    }
    
    /* Estilos de impressão para local e data */
    .local-data {
        margin-top: 15px !important;
        text-align: center !important;
    }
    
    .local-data p {
        margin: 3px 0 !important;
        font-size: 0.9em !important;
        color: #000 !important;
        font-weight: 500 !important;
    }
}
