* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.header h1 {
    font-size: 24px;
    color: #667eea;
    font-weight: 700;
}

.tabs {
    display: flex;
    gap: 10px;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.tab-btn.active {
    background: #667eea;
    color: white;
}

.tab-btn:not(.active) {
    background: #e5e7eb;
    color: #374151;
}

.tab-btn:not(.active):hover {
    background: #d1d5db;
}

.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 25px;
    margin-bottom: 20px;
}

.card h2 {
    font-size: 20px;
    color: #1f2937;
    margin-bottom: 20px;
    font-weight: 700;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.radio-group {
    display: flex;
    gap: 20px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
}

.radio-label input {
    margin-right: 8px;
    cursor: pointer;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.btn-primary {
    background: #667eea;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-whatsapp {
    background: #25D366;
    color: white;
}

.btn-whatsapp:hover {
    background: #20BA5A;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.nf-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nf-item {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.3s;
}

.nf-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.nf-item-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.nf-info {
    flex: 1;
}

.nf-badges {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-fechado {
    background: #d1fae5;
    color: #065f46;
}

.badge-fracionado {
    background: #fef3c7;
    color: #92400e;
}

.nf-details {
    color: #374151;
    font-size: 14px;
}

.nf-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-icon:hover {
    transform: scale(1.2);
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #9ca3af;
    font-size: 14px;
}

.checkbox-list {
    max-height: 240px;
    overflow-y: auto;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.checkbox-item:hover {
    background: #f9fafb;
}

.checkbox-item input {
    margin-right: 12px;
    cursor: pointer;
}

.checkbox-item label {
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    flex: 1;
}

.palete-nfs {
    margin-top: 12px;
}

.palete-nf-item {
    background: #f9fafb;
    padding: 10px;
    border-radius: 6px;
    margin-top: 8px;
    font-size: 13px;
    color: #4b5563;
}

.hidden {
    display: none;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .header {
        flex-direction: column;
        align-items: stretch;
    }

    .header h1 {
        font-size: 20px;
        text-align: center;
    }

    .tabs {
        justify-content: center;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 15px;
    }

    .card-header {
        flex-direction: column;
        gap: 10px;
    }

    .card-header .btn {
        width: 100%;
    }

    .nf-item-content {
        flex-direction: column;
        gap: 12px;
    }

    .nf-actions {
        justify-content: flex-end;
        width: 100%;
    }
}